add_detect.ftl 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  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. </style>
  27. <meta name="keywords" content="${path}">
  28. <meta name="description" content="H-ui.admin v3.0,是一款由国人开发的轻量级扁平化网站后台模板,完全免费开源的网站后台管理系统模版,适合中小型CMS后台系统。">
  29. </head>
  30. <body>
  31. <article class="page-container">
  32. <form class="form form-horizontal" id="form-admin-add">
  33. <div class="input-box">
  34. <span class="input-dic" style="margin-top: 0">检测产品&nbsp;&nbsp;</span>
  35. <label for="radio-1">
  36. <select name="productId" style="width:100px" class="select">
  37. <#if (productList ?size > 0)>
  38. <#list productList as list>
  39. <option value ="${list.productId}">${list.productName}</option>
  40. </#list>
  41. <#else >
  42. <option value ="">暂无产品,请先添加产品</option>
  43. </#if>
  44. </select>
  45. <input class="input-text" type="text" id="machineNo" name="machineNo" style="width: 50%;" placeholder="机器编号" />
  46. </label>
  47. </div>
  48. <#--<div class="input-box">
  49. <span class="input-dic" style="margin-top: 0">&nbsp;</span>
  50. <label for="radio-2" style="margin-left: 50px;">
  51. <input type="radio" id="radio-2" name="detectProductType" value="2"/>配件
  52. <select name="productId2" class="select" style="width:100px">
  53. <#if (listFittings ?size > 0)>
  54. <#list listFittings as list>
  55. <option value ="${list.fittingsId}">${list.fittingsName}</option>
  56. </#list>
  57. <#else >
  58. <option value ="">暂无配件,请先添加配件</option>
  59. </#if>
  60. </select>
  61. </label>
  62. </div>-->
  63. <div class="input-box"><span class="input-dic spanhidth">检测日期</span><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"/> </div>
  64. <div class="input-box">
  65. <span class="input-dic" style="margin-top: 0">检测结果</span>
  66. <label for="radio-3">
  67. <input type="radio" id="radio-3" name="detectState" value="3" checked/>检测通过
  68. </label>
  69. <label for="radio-4" style="margin-left: 50px;">
  70. <input type="radio" id="radio-4" name="detectState" value="4"/>检测未通过
  71. </label>
  72. </div>
  73. <div class="input-box">
  74. <span class="input-dic ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
  75. <textarea rows="3" cols="20" name="detectPhenomenon" id="detectPhenomenon" class="my-textarea" placeholder="工厂检测现象"></textarea>
  76. </div>
  77. <div class="input-box">
  78. <span class="input-dic ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
  79. <textarea rows="3" cols="20" name="detectFailureClassification" id="detectFailureClassification" class="my-textarea" placeholder="故障分类"></textarea>
  80. </div>
  81. <div class="input-box">
  82. <span class="input-dic ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
  83. <textarea rows="3" cols="20" name="detectFailureCause" id="detectFailureCause" class="my-textarea" placeholder="故障原因"></textarea>
  84. </div>
  85. <div class="input-box">
  86. <span class="input-dic ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
  87. <textarea rows="3" cols="20" name="detectResults" id="detectResults" class="my-textarea" placeholder="判定结果"></textarea>
  88. </div>
  89. <div class="input-box">
  90. <span class="input-dic ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
  91. <textarea rows="3" cols="20" name="detectPoint" id="detectPoint" class="my-textarea" placeholder="故障指向"></textarea>
  92. </div>
  93. <div class="input-box">
  94. <span class="input-dic ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
  95. <textarea rows="3" cols="20" name="detectAnalysis" id="detectAnalysis" class="my-textarea" placeholder="原因分析"></textarea>
  96. </div>
  97. <div class="input-box">
  98. <span class="input-dic" style="margin-top: 0">是否维修</span>
  99. <label for="radio-5">
  100. <input type="radio" id="radio-5" name="detectIsMaintenance" value="1" checked/>需要维修
  101. </label>
  102. <label for="radio-6" style="margin-left: 50px;">
  103. <input type="radio" id="radio-6" name="detectIsMaintenance" value="2"/>不需要维修
  104. </label>
  105. </div>
  106. <div class="input-box">
  107. <span class="input-dic" style="margin-top: 0">是否已转入</span>
  108. <label for="radio-7">
  109. <input type="radio" id="radio-7" name="detectRevolutionProduced" value="1" checked/>已转入维修
  110. </label>
  111. <label for="radio-8" style="margin-left: 50px;">
  112. <input type="radio" id="radio-8" name="detectRevolutionProduced" value="2"/>未转入维修
  113. </label>
  114. </div>
  115. <div class="input-box">
  116. <span class="input-dic spanhidth">备注</span>
  117. <textarea rows="3" cols="20" name="detectDesc" id="detectDesc" class="my-textarea" placeholder="请详细备注签收的内容,便于以后复查。如果转入生产,则生产部门同事可查看!"></textarea>
  118. </div>
  119. <div>
  120. <button type="button" class="my-btn-submit" onclick="add();">确认提交</button>
  121. </div>
  122. </form>
  123. </article>
  124. <script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
  125. <script type="text/javascript">
  126. function add() {
  127. var detectDate = $("#detectDate").val();
  128. if( detectDate == null || detectDate == "" ){
  129. layer.msg('请选择检测日期',{icon: 5,time:1000});
  130. return;
  131. }
  132. var detectPhenomenon = $("#detectPhenomenon").val();
  133. if( detectPhenomenon == null || detectPhenomenon == "" ){
  134. layer.msg('请输入工厂检测现象',{icon: 5,time:1000});
  135. return;
  136. }
  137. if( detectPhenomenon.length > 300 ){
  138. layer.msg('工厂检测现象长度不得大于150个字符',{icon: 5,time:1000});
  139. return;
  140. }
  141. var detectFailureClassification = $("#detectFailureClassification").val();
  142. if( detectFailureClassification == null || detectFailureClassification == "" ){
  143. layer.msg('请输入故障分类',{icon: 5,time:1000});
  144. return;
  145. }
  146. if( detectFailureClassification.length > 50 ){
  147. layer.msg('故障分类长度不得大于25个字符',{icon: 5,time:1000});
  148. return;
  149. }
  150. var detectFailureCause = $("#detectFailureCause").val();
  151. if( detectFailureCause == null || detectFailureCause == "" ){
  152. layer.msg('请输入故障原因',{icon: 5,time:1000});
  153. return;
  154. }
  155. if( detectFailureCause.length > 100 ){
  156. layer.msg('故障原因长度不得大于50个字符',{icon: 5,time:1000});
  157. return;
  158. }
  159. var detectResults = $("#detectResults").val();
  160. if( detectResults == null || detectResults == "" ){
  161. layer.msg('请输入判定结果',{icon: 5,time:1000});
  162. return;
  163. }
  164. if( detectResults.length > 100 ){
  165. layer.msg('判定结果长度不得大于50个字符',{icon: 5,time:1000});
  166. return;
  167. }
  168. var detectPoint = $("#detectPoint").val();
  169. if( detectPoint == null || detectPoint == "" ){
  170. layer.msg('请输入故障指向',{icon: 5,time:1000});
  171. return;
  172. }
  173. if( detectPoint.length > 100 ){
  174. layer.msg('故障指向长度不得大于50个字符',{icon: 5,time:1000});
  175. return;
  176. }
  177. var detectAnalysis = $("#detectAnalysis").val();
  178. if( detectAnalysis == null || detectAnalysis == "" ){
  179. layer.msg('请输入原因分析',{icon: 5,time:1000});
  180. return;
  181. }
  182. if( detectAnalysis.length > 100 ){
  183. layer.msg('原因分析长度不得大于50个字符',{icon: 5,time:1000});
  184. return;
  185. }
  186. $.ajax({
  187. cache: true,
  188. type: "POST",
  189. url: "${path}/admin/detect/add_detect",
  190. data:$('#form-admin-add').serialize(),// 你的formid
  191. async: false,
  192. success: function(data){
  193. if (data.returnCode == 200) {
  194. layer.msg('添加成功',{icon: 1,time:1000},function () {
  195. location.replace(location.href);
  196. });
  197. } else {
  198. layer.msg('添加失败',{icon: 5,time:1000});
  199. }
  200. },
  201. error: function(XmlHttpRequest, textStatus, errorThrown){
  202. layer.msg('添加错误',{icon: 5,time:1000});
  203. }
  204. });
  205. }
  206. </script>
  207. </body>
  208. </html>