add_detect.ftl 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="renderer" content="webkit|ie-comp|ie-stand">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
  8. <meta http-equiv="Cache-Control" content="no-siteapp" />
  9. <#include "/base/add_base.ftl">
  10. <title>添加检测记录 - H-ui.filter v2.4</title>
  11. <style>
  12. .my-title{font-weight: 500;padding-left: 15px;position: relative;}
  13. .my-title:after{content: '';position: absolute;left: 0;top:12%;width: 3px;height: 80%;background: #32a3d8;}
  14. .my-input{padding: 8px 5px;width: 80%;border:1px solid rgba(0,0,0,.1);}
  15. .my-input-date{padding: 8px 10px;border:1px solid rgba(0,0,0,.1);width: 80%;background: url(http://s.iamberry.com/images/rili-1.png) 98.5% center no-repeat; background-size:auto 50%;}
  16. .input-box{margin: 18px 0;}
  17. .input-dic{float: left;margin:5px 10px 0 0;font-size: 14px;}
  18. .add-list{list-style-type: none;padding: 10px;background-color: #f5f5f5;width: 60%;float: left;margin: 0;}
  19. .add-list>li{margin: 10px 0;}
  20. .my-textarea{padding: 5px 10px;width: 65%;border:1px solid rgba(0,0,0,.1);margin-left: 12.5%;}
  21. .my-btn-reset{padding: 10px 20px;width: 150px; background-color: #fff;color: #32a3d8;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
  22. .my-btn-submit{padding: 10px 20px;width: 150px; background-color: #32a3d8;color: #fff;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
  23. .my-select{border: 1px solid rgba(0,0,0,.1);padding:6px 50px 6px 15px;width: 60%; height: 34px;margin: 0 10px; -webkit-appearance:none;appearance:none;background: url(http://s.iamberry.com/images/select-1.png) right center no-repeat #fff;background-size:auto 100%;}
  24. input[type=radio]{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-1.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
  25. input[type=radio]:checked{-webkit-appearance:none;appearance:none;background: url(${path}/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
  26. .huanhang{ float:left}
  27. </style>
  28. <meta name="keywords" content="${path}">
  29. <meta name="description" content="H-ui.admin v3.0,是一款由国人开发的轻量级扁平化网站后台模板,完全免费开源的网站后台管理系统模版,适合中小型CMS后台系统。">
  30. </head>
  31. <body>
  32. <article class="page-container">
  33. <form class="form form-horizontal" id="form-admin-add">
  34. <div class="input-box">
  35. <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;">检测产品:</label>
  36. <div class="formControls col-9 col-sm-9 text-c huanhang" style="margin-bottom: 15px;">
  37. <table class="table table-border table-bg table-bordered" style="width: 420px;">
  38. <thead>
  39. <tr class="text-c">
  40. <th style="text-align: center;" width="100">产品名称</th>
  41. <th style="text-align: center;" width="50">产品颜色</th>
  42. <th style="text-align: center;" width="50">产品编号</th>
  43. </tr>
  44. </thead>
  45. <tbody id="addProduct">
  46. <#if (productList?size > 0)>
  47. <#list productList as product>
  48. <tr>
  49. <td>
  50. <div class="formControls col-xs-12 col-sm-12 skin-minimal">
  51. <input type="radio" id="radio-${product.productId!''}" name="productId" value="${product.productId!''}" <#if product_index == 0>checked</#if>/>&nbsp;&nbsp;${product.productName!''}
  52. </div>
  53. </td>
  54. <td>
  55. <select name="colorId${product.productId!''}" id="colorId${product.productId!''}" style="width:90%" class="my-select">
  56. <#if (product.colorList?size > 0)>
  57. <#list product.colorList as colorList>
  58. <option value ="${colorList.colorId!''}">${colorList.colorName!''}</option>
  59. </#list>
  60. <#else>
  61. <option value ="">暂无颜色</option>
  62. </#if>
  63. </select>
  64. </td>
  65. <td>
  66. <input class="input-text" type="text" id="maintenanceEquipmentNumber${product.productId!''}" name="maintenanceEquipmentNumber${product.productId!''}" style="width: 100%;" placeholder="机器编号" /><br>
  67. </td>
  68. </tr>
  69. </#list>
  70. </#if>
  71. </tbody>
  72. </table>
  73. </div>
  74. </div>
  75. <div class="input-box">
  76. <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;">检测日期:</label>
  77. <div class="formControls col-8 col-sm-8 text-c huanhang" style="margin-left: -4.5%;">
  78. <input class="my-input-date" type="text" name="detect_date" id="detectDate" onClick="WdatePicker({skin:'whyGreen',maxDate:'%y-%M-%d'})" placeholder="请选择检测日期" readonly="readonly"/>
  79. </div>
  80. </div>
  81. <div class="input-box">
  82. <label class="col-3 col-sm-3 huanhang" style="text-align: right;margin: 10px 0px;">检测结果:</label>
  83. <div class="formControls col-xs-7 col-sm-7 skin-minimal huanhang" style="margin: 10px 0px;">
  84. <div class="radio-box">
  85. <input type="radio" id="radio-3" name="detectState" value="3" checked/>
  86. <label for="tel-3">检测通过</label>
  87. </div>
  88. <div class="radio-box">
  89. <input type="radio" id="radio-4" name="detectState" value="4"/>
  90. <label for="tel-4">检测未通过</label>
  91. </div>
  92. </div>
  93. </div>
  94. <div class="input-box" style="margin-left: 17%;">
  95. <textarea rows="3" cols="20" name="detectPhenomenon" id="detectPhenomenon" class="my-textarea" placeholder="工厂检测现象"></textarea>
  96. </div>
  97. <div class="input-box" style="margin-left: 17%;">
  98. <textarea rows="3" cols="20" name="detectFailureClassification" id="detectFailureClassification" class="my-textarea" placeholder="故障分类"></textarea>
  99. </div>
  100. <div class="input-box" style="margin-left: 17%;">
  101. <textarea rows="3" cols="20" name="detectFailureCause" id="detectFailureCause" class="my-textarea" placeholder="故障原因"></textarea>
  102. </div>
  103. <div class="input-box" style="margin-left: 17%;">
  104. <textarea rows="3" cols="20" name="detectResults" id="detectResults" class="my-textarea" placeholder="判定结果"></textarea>
  105. </div>
  106. <div class="input-box" style="margin-left: 17%;">
  107. <textarea rows="3" cols="20" name="detectPoint" id="detectPoint" class="my-textarea" placeholder="故障指向"></textarea>
  108. </div>
  109. <div class="input-box" style="margin-left: 17%;">
  110. <textarea rows="3" cols="20" name="detectAnalysis" id="detectAnalysis" class="my-textarea" placeholder="原因分析"></textarea>
  111. </div>
  112. <div class="input-box">
  113. <label class="col-3 col-sm-3 huanhang" style="text-align: right;">是否维修:</label>
  114. <div class="formControls col-xs-7 col-sm-7 skin-minimal">
  115. <div class="radio-box">
  116. <input type="radio" id="radio-5" name="detectIsMaintenance" value="1" checked/>
  117. <label for="tel-5">需要维修</label>
  118. </div>
  119. <div class="radio-box">
  120. <input type="radio" id="radio-6" name="detectIsMaintenance" value="2"/>
  121. <label for="tel-6">不需要维修</label>
  122. </div>
  123. </div>
  124. </div>
  125. <div class="input-box">
  126. <label class="col-3 col-sm-3 huanhang" style="text-align: right;margin: 10px 0px;">是否已转入:</label>
  127. <div class="formControls col-xs-7 col-sm-7 skin-minimal" style="margin: 10px 0px;">
  128. <div class="radio-box">
  129. <input type="radio" id="radio-7" name="detectRevolutionProduced" value="1" checked/>
  130. <label for="tel-7">已转入维修</label>
  131. </div>
  132. <div class="radio-box" style="margin-left: -4.1%;">
  133. <input type="radio" id="radio-8" name="detectRevolutionProduced" value="2"/>
  134. <label for="tel-8">未转入维修</label>
  135. </div>
  136. </div>
  137. </div>
  138. <div class="input-box" >
  139. <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;">备注:</label>
  140. <div class="formControls col-xs-9 col-sm-9">
  141. <div class="radio-box">
  142. <textarea rows="3" style="width: 200%;margin-left: -15%;margin-top: 5%;" cols="20" name="detectDesc" id="detectDesc" class="my-textarea" placeholder="请详细备注签收的内容,便于以后复查。如果转入生产,则生产部门同事可查看!"></textarea>
  143. </div>
  144. </div>
  145. </div>
  146. <div style="margin-left: 35%;">
  147. <button type="button" class="my-btn-submit" onclick="add();">确认提交</button>
  148. </div>
  149. </form>
  150. </article>
  151. <script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
  152. <script type="text/javascript">
  153. /*初始化单选框样式*/
  154. $(function(){
  155. $('input[name="productId"]').on('ifChecked', function(event){
  156. $("input[name='productId']").each(function () {
  157. $("#maintenanceEquipmentNumber"+$(this).val()).val("");
  158. });
  159. });
  160. $('.skin-minimal input').iCheck({
  161. checkboxClass: 'icheckbox-blue',
  162. radioClass: 'iradio-blue',
  163. increaseArea: '20%'
  164. });
  165. });
  166. function add() {
  167. var detectDate = $("#detectDate").val();
  168. if( detectDate == null || detectDate == "" ){
  169. layer.msg('请选择检测日期',{icon: 5,time:1000});
  170. return;
  171. }
  172. var detectPhenomenon = $("#detectPhenomenon").val();
  173. if( detectPhenomenon == null || detectPhenomenon == "" ){
  174. layer.msg('请输入工厂检测现象',{icon: 5,time:1000});
  175. return;
  176. }
  177. if( detectPhenomenon.length > 300 ){
  178. layer.msg('工厂检测现象长度不得大于150个字符',{icon: 5,time:1000});
  179. return;
  180. }
  181. var detectFailureClassification = $("#detectFailureClassification").val();
  182. if( detectFailureClassification == null || detectFailureClassification == "" ){
  183. layer.msg('请输入故障分类',{icon: 5,time:1000});
  184. return;
  185. }
  186. if( detectFailureClassification.length > 50 ){
  187. layer.msg('故障分类长度不得大于25个字符',{icon: 5,time:1000});
  188. return;
  189. }
  190. var detectFailureCause = $("#detectFailureCause").val();
  191. if( detectFailureCause == null || detectFailureCause == "" ){
  192. layer.msg('请输入故障原因',{icon: 5,time:1000});
  193. return;
  194. }
  195. if( detectFailureCause.length > 100 ){
  196. layer.msg('故障原因长度不得大于50个字符',{icon: 5,time:1000});
  197. return;
  198. }
  199. var detectResults = $("#detectResults").val();
  200. if( detectResults == null || detectResults == "" ){
  201. layer.msg('请输入判定结果',{icon: 5,time:1000});
  202. return;
  203. }
  204. if( detectResults.length > 100 ){
  205. layer.msg('判定结果长度不得大于50个字符',{icon: 5,time:1000});
  206. return;
  207. }
  208. var detectPoint = $("#detectPoint").val();
  209. if( detectPoint == null || detectPoint == "" ){
  210. layer.msg('请输入故障指向',{icon: 5,time:1000});
  211. return;
  212. }
  213. if( detectPoint.length > 100 ){
  214. layer.msg('故障指向长度不得大于50个字符',{icon: 5,time:1000});
  215. return;
  216. }
  217. var detectAnalysis = $("#detectAnalysis").val();
  218. if( detectAnalysis == null || detectAnalysis == "" ){
  219. layer.msg('请输入原因分析',{icon: 5,time:1000});
  220. return;
  221. }
  222. if( detectAnalysis.length > 100 ){
  223. layer.msg('原因分析长度不得大于50个字符',{icon: 5,time:1000});
  224. return;
  225. }
  226. $.ajax({
  227. cache: true,
  228. type: "POST",
  229. url: "${path}/admin/detect/add_detect",
  230. data:$('#form-admin-add').serialize(),// 你的formid
  231. async: false,
  232. success: function(data){
  233. if (data.returnCode == 200) {
  234. layer.msg('添加成功',{icon: 1,time:1000},function () {
  235. window.parent.location.reload();
  236. var index = parent.layer.getFrameIndex(window.name);
  237. parent.layer.close(index)
  238. });
  239. } else {
  240. layer.msg('添加失败',{icon: 5,time:1000});
  241. }
  242. },
  243. error: function(XmlHttpRequest, textStatus, errorThrown){
  244. layer.msg('添加错误',{icon: 5,time:1000});
  245. }
  246. });
  247. }
  248. </script>
  249. </body>
  250. </html>