update_maintenance.ftl 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  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: 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. 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;}
  24. 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;}
  25. .huanhang{ float:left}
  26. .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%;}
  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="col-9 col-sm-9 text-c">
  37. <div class="radio-box" style="margin-right: -37%;padding-left: 0px;">
  38. <table class="table table-border table-bg table-bordered" style="width: 420px;">
  39. <thead>
  40. <tr class="text-c">
  41. <th style="text-align: center;" width="100">产品名称</th>
  42. <th style="text-align: center;" width="50">产品颜色</th>
  43. <th style="text-align: center;" width="50">产品编号</th>
  44. </tr>
  45. </thead>
  46. <tbody id="addProduct">
  47. <#if (productList?size > 0)>
  48. <#list productList as product>
  49. <tr>
  50. <td>
  51. <div class="col-xs-12 col-sm-12 skin-minimal">
  52. <input type="radio" id="radio-X${product.productId!''}" name="productId" value="${product.productId!''}" <#if product.productId == maintenanceInfo.productId>checked</#if>/>
  53. <label for="radio-X${product.productId!''}">&nbsp;&nbsp;${product.productName!''}</label>
  54. </div>
  55. </td>
  56. <td>
  57. <select name="colorId${product.productId!''}" id="colorId${product.productId!''}" style="width:90%" class="my-select">
  58. <#if (product.colorList?size > 0)>
  59. <#list product.colorList as colorList>
  60. <option value ="${colorList.colorId!''}">${colorList.colorName!''}</option>
  61. </#list>
  62. <#else>
  63. <option value ="">暂无颜色</option>
  64. </#if>
  65. </select>
  66. </td>
  67. <td>
  68. <input class="input-text" type="text" <#if product.productId == maintenanceInfo.productId>value="${maintenanceInfo.maintenanceEquipmentNumber!''}"</#if> id="maintenanceEquipmentNumber${product.productId!''}" name="maintenanceEquipmentNumber${product.productId!''}" style="width: 100%;" placeholder="机器编号" /><br>
  69. </td>
  70. </tr>
  71. </#list>
  72. </#if>
  73. </tbody>
  74. </table>
  75. </div>
  76. </div>
  77. </div>
  78. <div class="input-box">
  79. <label class="col-3 col-sm-3 huanhang" style="text-align: right;">维修日期:</label>
  80. <div class="formControls col-7 col-sm-7 text-c huanhang" style="margin-left: -4.5%;">
  81. <input class="my-input-date" type="text" value="${(maintenanceInfo.maintenanceContentDate)?string("yyyy-MM-dd")!''}" name="maintenanceContent_Date" id="maintenanceContentDate" onClick="WdatePicker({skin:'whyGreen',maxDate:'%y-%M-%d'})" placeholder="请选择维修日期" readonly="readonly"/>
  82. </div>
  83. </div>
  84. <div class="input-box" style="margin-top: 11%;">
  85. <label class="col-3 col-sm-3 huanhang" style="text-align: right;">维修结果:</label>
  86. <div class="col-8 col-sm-8 text-c skin-minimal" >
  87. <div class="radio-box">
  88. <input type="radio" id="radio-3" name="maintenanceState" value="1" <#if maintenanceInfo.maintenanceState == 1>checked</#if>/>
  89. <label for="radio-3">正在维修</label>
  90. </div>
  91. <div class="radio-box">
  92. <input type="radio" id="radio-4" name="maintenanceState" value="2" <#if maintenanceInfo.maintenanceState == 2>checked</#if>/>
  93. <label for="radio-4">已完成</label>
  94. </div>
  95. </div>
  96. </div>
  97. <div class="input-box">
  98. <label class="col-3 col-sm-3 huanhang" style="text-align: right;">是否可返修:</label>
  99. <div class=" col-8 col-sm-8 text-c skin-minimal">
  100. <div class="radio-box">
  101. <input type="radio" id="radio-5" name="maintenanceIsRepair" value="1" <#if maintenanceInfo.maintenanceIsRepair == 1>checked</#if>/>
  102. <label for="radio-5">不可返修</label>
  103. </div>
  104. <div class="radio-box">
  105. <input type="radio" id="radio-6" name="maintenanceIsRepair" value="2" <#if maintenanceInfo.maintenanceIsRepair == 2>checked</#if>/>
  106. <label for="radio-6">可返修</label>
  107. </div>
  108. </div>
  109. </div>
  110. <div class="input-box">
  111. <label class="col-3 col-sm-3 huanhang" style="text-align: right;">是否可入库:</label>
  112. <div class="formControls col-10 col-sm-10 text-c skin-minimal">
  113. <div class="radio-box">
  114. <input type="radio" id="radio-7" name="maintenanceIsWarehousing" value="2" <#if maintenanceInfo.maintenanceIsWarehousing == 2>checked</#if>/>
  115. <label for="radio-7">已入库</label>
  116. </div>
  117. <div class="radio-box">
  118. <input type="radio" id="radio-8" name="maintenanceIsWarehousing" value="1" <#if maintenanceInfo.maintenanceIsWarehousing == 1>checked</#if>/>
  119. <label for="radio-8">未入库</label>
  120. </div>
  121. <div class="radio-box">
  122. <input type="radio" id="radio-9" name="maintenanceIsWarehousing" value="3" <#if maintenanceInfo.maintenanceIsWarehousing == 3>checked</#if>/>
  123. <label for="radio-9">无法入库</label>
  124. </div>
  125. </div>
  126. </div>
  127. <div class="input-box">
  128. <label class="form-label col-3 col-sm-3 huanhang" style="text-align: right;margin: 10px 0px;">备注:</label>
  129. <div class="formControls col-xs-9 col-sm-9">
  130. <div class="radio-box">
  131. <textarea rows="3" style="width: 221%;margin-left: -20%;margin-top: 5%;" cols="20" name="maintenanceDesc" id="maintenanceDesc" class="my-textarea" placeholder="请详细备注维修的内容!">${maintenanceInfo.maintenanceDesc!''}</textarea>
  132. </div>
  133. </div>
  134. </div>
  135. <div style="margin-left: 35%;">
  136. <input type="hidden" value="${maintenanceInfo.maintenanceId!''}" name="maintenanceId" id="maintenanceId">
  137. <button type="button" class="my-btn-submit" onclick="add();">确认提交</button>
  138. </div>
  139. </form>
  140. </article>
  141. <script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
  142. <script type="text/javascript">
  143. /*初始化单选框样式*/
  144. $(function(){
  145. $('input[name="productId"]').on('ifChecked', function(event){
  146. $("input[name='productId']").each(function () {
  147. $("#maintenanceEquipmentNumber"+$(this).val()).val("");
  148. });
  149. });
  150. $('.skin-minimal input').iCheck({
  151. checkboxClass: 'icheckbox-blue',
  152. radioClass: 'iradio-blue',
  153. increaseArea: '20%'
  154. });
  155. });
  156. function add() {
  157. var maintenanceContentDate = $("#maintenanceContentDate").val();
  158. if( maintenanceContentDate == null || maintenanceContentDate == "" ){
  159. layer.msg('请选择检测日期',{icon: 5,time:1000});
  160. return;
  161. }
  162. var maintenanceDesc = $("#maintenanceDesc").val();
  163. if( !maintenanceDesc == null){
  164. if( maintenanceDesc.length > 150 ){
  165. layer.msg('备注长度不得大于150个字符',{icon: 5,time:1000});
  166. return;
  167. }
  168. }
  169. $.ajax({
  170. cache: true,
  171. type: "POST",
  172. url: "${path}/admin/maintenance/update_maintenance",
  173. data:$('#form-admin-add').serialize(),// 你的formid
  174. async: false,
  175. success: function(data){
  176. if (data.returnCode == 200) {
  177. layer.msg('修改成功',{icon: 1,time:1000},function () {
  178. window.parent.location.reload();
  179. var index = parent.layer.getFrameIndex(window.name);
  180. parent.layer.close(index)
  181. });
  182. } else {
  183. layer.msg('修改失败',{icon: 5,time:1000});
  184. }
  185. },
  186. error: function(XmlHttpRequest, textStatus, errorThrown){
  187. layer.msg('添加错误',{icon: 5,time:1000});
  188. }
  189. });
  190. }
  191. </script>
  192. </body>
  193. </html>