add_detect.ftl 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  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: 12px;}
  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: 80%;border:1px solid rgba(0,0,0,.1);}
  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-2 col-sm-2 huanhang">检测产品:</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. <input type="radio" id="radio-${product.productId!''}" name="productId" value="${product.productId!''}" <#if product_index == 0>checked</#if>/>${product.productName!''}
  51. </td>
  52. <td>
  53. <select name="colorId${product.productId!''}" id="colorId${product.productId!''}" style="width:90%" class="my-select">
  54. <#if (product.colorList?size > 0)>
  55. <#list product.colorList as colorList>
  56. <option value ="${colorList.colorId!''}">${colorList.colorName!''}</option>
  57. </#list>
  58. <#else>
  59. <option value ="">暂无颜色</option>
  60. </#if>
  61. </select>
  62. </td>
  63. <td>
  64. <input class="input-text" type="text" id="maintenanceEquipmentNumber${product.productId!''}" name="maintenanceEquipmentNumber${product.productId!''}" style="width: 100%;" placeholder="机器编号" /><br>
  65. </td>
  66. </tr>
  67. </#list>
  68. </#if>
  69. </tbody>
  70. </table>
  71. <#--<#if (productList?size > 0)>
  72. <#list productList as product>
  73. <input type="radio" id="radio-${product.productId!''}" name="productId" value="${product.productId!''}" <#if product_index == 0>checked</#if>/>${product.productName!''}
  74. <select name="colorId${product.productId!''}" id="colorId${product.productId!''}" style="width:60px" class="select">
  75. <#if (product.colorList?size > 0)>
  76. <#list product.colorList as colorList>
  77. <option value ="${colorList.colorId!''}">${colorList.colorName!''}</option>
  78. </#list>
  79. <#else>
  80. <option value ="">暂无颜色</option>
  81. </#if>
  82. </select>
  83. <input class="input-text" type="text" id="maintenanceEquipmentNumber${product.productId!''}" name="maintenanceEquipmentNumber${product.productId!''}" style="width: 20%;" placeholder="机器编号" /><br>
  84. </#list>
  85. </#if>-->
  86. </div>
  87. </div>
  88. <div class="input-box">
  89. <span class="input-dic spanhidth">检测日期</span>
  90. <input class="my-input-date" type="text" style="width: 76%;" name="detect_date" id="detectDate" onClick="WdatePicker({skin:'whyGreen',maxDate:'%y-%M-%d'})" placeholder="请选择检测日期" readonly="readonly"/>
  91. </div>
  92. <div class="input-box">
  93. <span class="input-dic" style="margin-top: 0">检测结果</span>
  94. <label for="radio-3">
  95. <input type="radio" id="radio-3" name="detectState" value="3" checked/>检测通过
  96. </label>
  97. <label for="radio-4" style="margin-left: 50px;">
  98. <input type="radio" id="radio-4" name="detectState" value="4"/>检测未通过
  99. </label>
  100. </div>
  101. <div class="input-box">
  102. <span class="input-dic ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
  103. <textarea rows="3" cols="20" name="detectPhenomenon" id="detectPhenomenon" class="my-textarea" placeholder="工厂检测现象"></textarea>
  104. </div>
  105. <div class="input-box">
  106. <span class="input-dic ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
  107. <textarea rows="3" cols="20" name="detectFailureClassification" id="detectFailureClassification" class="my-textarea" placeholder="故障分类"></textarea>
  108. </div>
  109. <div class="input-box">
  110. <span class="input-dic ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
  111. <textarea rows="3" cols="20" name="detectFailureCause" id="detectFailureCause" class="my-textarea" placeholder="故障原因"></textarea>
  112. </div>
  113. <div class="input-box">
  114. <span class="input-dic ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
  115. <textarea rows="3" cols="20" name="detectResults" id="detectResults" class="my-textarea" placeholder="判定结果"></textarea>
  116. </div>
  117. <div class="input-box">
  118. <span class="input-dic ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
  119. <textarea rows="3" cols="20" name="detectPoint" id="detectPoint" class="my-textarea" placeholder="故障指向"></textarea>
  120. </div>
  121. <div class="input-box">
  122. <span class="input-dic ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
  123. <textarea rows="3" cols="20" name="detectAnalysis" id="detectAnalysis" class="my-textarea" placeholder="原因分析"></textarea>
  124. </div>
  125. <div class="input-box">
  126. <span class="input-dic" style="margin-top: 0">是否维修</span>
  127. <label for="radio-5">
  128. <input type="radio" id="radio-5" name="detectIsMaintenance" value="1" checked/>需要维修
  129. </label>
  130. <label for="radio-6" style="margin-left: 50px;">
  131. <input type="radio" id="radio-6" name="detectIsMaintenance" value="2"/>不需要维修
  132. </label>
  133. </div>
  134. <div class="input-box">
  135. <span class="input-dic" style="margin-top: 0">是否已转入</span>
  136. <label for="radio-7">
  137. <input type="radio" id="radio-7" name="detectRevolutionProduced" value="1" checked/>已转入维修
  138. </label>
  139. <label for="radio-8" style="margin-left: 50px;">
  140. <input type="radio" id="radio-8" name="detectRevolutionProduced" value="2"/>未转入维修
  141. </label>
  142. </div>
  143. <div class="input-box">
  144. <span class="input-dic spanhidth">备注</span>
  145. <textarea rows="3" cols="20" name="detectDesc" id="detectDesc" class="my-textarea" placeholder="请详细备注签收的内容,便于以后复查。如果转入生产,则生产部门同事可查看!"></textarea>
  146. </div>
  147. <div>
  148. <button type="button" class="my-btn-submit" onclick="add();">确认提交</button>
  149. </div>
  150. </form>
  151. </article>
  152. <script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
  153. <script type="text/javascript">
  154. function add() {
  155. $("input[name='checkbox']:checkbox:checked").each(function () {
  156. });
  157. var detectDate = $("#detectDate").val();
  158. if( detectDate == null || detectDate == "" ){
  159. layer.msg('请选择检测日期',{icon: 5,time:1000});
  160. return;
  161. }
  162. var detectPhenomenon = $("#detectPhenomenon").val();
  163. if( detectPhenomenon == null || detectPhenomenon == "" ){
  164. layer.msg('请输入工厂检测现象',{icon: 5,time:1000});
  165. return;
  166. }
  167. if( detectPhenomenon.length > 300 ){
  168. layer.msg('工厂检测现象长度不得大于150个字符',{icon: 5,time:1000});
  169. return;
  170. }
  171. var detectFailureClassification = $("#detectFailureClassification").val();
  172. if( detectFailureClassification == null || detectFailureClassification == "" ){
  173. layer.msg('请输入故障分类',{icon: 5,time:1000});
  174. return;
  175. }
  176. if( detectFailureClassification.length > 50 ){
  177. layer.msg('故障分类长度不得大于25个字符',{icon: 5,time:1000});
  178. return;
  179. }
  180. var detectFailureCause = $("#detectFailureCause").val();
  181. if( detectFailureCause == null || detectFailureCause == "" ){
  182. layer.msg('请输入故障原因',{icon: 5,time:1000});
  183. return;
  184. }
  185. if( detectFailureCause.length > 100 ){
  186. layer.msg('故障原因长度不得大于50个字符',{icon: 5,time:1000});
  187. return;
  188. }
  189. var detectResults = $("#detectResults").val();
  190. if( detectResults == null || detectResults == "" ){
  191. layer.msg('请输入判定结果',{icon: 5,time:1000});
  192. return;
  193. }
  194. if( detectResults.length > 100 ){
  195. layer.msg('判定结果长度不得大于50个字符',{icon: 5,time:1000});
  196. return;
  197. }
  198. var detectPoint = $("#detectPoint").val();
  199. if( detectPoint == null || detectPoint == "" ){
  200. layer.msg('请输入故障指向',{icon: 5,time:1000});
  201. return;
  202. }
  203. if( detectPoint.length > 100 ){
  204. layer.msg('故障指向长度不得大于50个字符',{icon: 5,time:1000});
  205. return;
  206. }
  207. var detectAnalysis = $("#detectAnalysis").val();
  208. if( detectAnalysis == null || detectAnalysis == "" ){
  209. layer.msg('请输入原因分析',{icon: 5,time:1000});
  210. return;
  211. }
  212. if( detectAnalysis.length > 100 ){
  213. layer.msg('原因分析长度不得大于50个字符',{icon: 5,time:1000});
  214. return;
  215. }
  216. $.ajax({
  217. cache: true,
  218. type: "POST",
  219. url: "${path}/admin/detect/add_detect",
  220. data:$('#form-admin-add').serialize(),// 你的formid
  221. async: false,
  222. success: function(data){
  223. if (data.returnCode == 200) {
  224. layer.msg('添加成功',{icon: 1,time:1000},function () {
  225. window.parent.location.reload();
  226. var index = parent.layer.getFrameIndex(window.name);
  227. parent.layer.close(index)
  228. });
  229. } else {
  230. layer.msg('添加失败',{icon: 5,time:1000});
  231. }
  232. },
  233. error: function(XmlHttpRequest, textStatus, errorThrown){
  234. layer.msg('添加错误',{icon: 5,time:1000});
  235. }
  236. });
  237. }
  238. </script>
  239. </body>
  240. </html>