add_maintenance.ftl 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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>添加维修记录</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-3 col-sm-3 huanhang">维修产品:</label>
  36. <div class="formControls col-9 col-sm-9 text-c huanhang">
  37. <#if (productList?size > 0)>
  38. <#list productList as product>
  39. <input type="radio" id="radio-${product.productId!''}" name="productId" value="${product.productId!''}" <#if product_index == 0>checked</#if>/>${product.productName!''}
  40. <select name="colorId${product.productId!''}" id="colorId${product.productId!''}" style="width:60px" class="select">
  41. <#if (product.colorList?size > 0)>
  42. <#list product.colorList as colorList>
  43. <option value ="${colorList.colorId!''}">${colorList.colorName!''}</option>
  44. </#list>
  45. <#else>
  46. <option value ="">暂无颜色</option>
  47. </#if>
  48. </select>
  49. <input class="input-text" type="text" id="maintenanceEquipmentNumber${product.productId!''}" name="maintenanceEquipmentNumber${product.productId!''}" style="width: 20%;" placeholder="机器编号" /><br>
  50. </#list>
  51. </#if>
  52. </div>
  53. </div>
  54. <#--<div class="input-box">
  55. <span class="input-dic" style="margin-top: 0">&nbsp;</span>
  56. <label for="radio-2" style="margin-left: 50px;">
  57. <input type="radio" id="radio-2" name="detectProductType" value="2"/>配件
  58. <select name="productId2" class="select" style="width:100px">
  59. <#if (listFittings ?size > 0)>
  60. <#list listFittings as list>
  61. <option value ="${list.fittingsId}">${list.fittingsName}</option>
  62. </#list>
  63. <#else >
  64. <option value ="">暂无配件,请先添加配件</option>
  65. </#if>
  66. </select>
  67. </label>
  68. </div>-->
  69. <div class="input-box"><span class="input-dic spanhidth">维修日期</span><input class="my-input-date" type="text" style="width: 76%;" name="maintenanceContent_Date" id="maintenanceContentDate" onClick="WdatePicker({skin:'whyGreen',maxDate:'%y-%M-%d'})" placeholder="请选择检测日期" readonly="readonly"/> </div>
  70. <div class="input-box">
  71. <span class="input-dic" style="margin-top: 0">维修结果</span>
  72. <label for="radio-3">
  73. <input type="radio" id="radio-3" name="maintenanceState" value="1" checked/>正在维修
  74. </label>
  75. <label for="radio-4" style="margin-left: 50px;">
  76. <input type="radio" id="radio-4" name="maintenanceState" value="2"/>已完成
  77. </label>
  78. </div>
  79. <div class="input-box">
  80. <span class="input-dic" style="margin-top: 0">是否可返修</span>
  81. <label for="radio-5">
  82. <input type="radio" id="radio-5" name="maintenanceIsRepair" value="1" checked/>不可返修
  83. </label>
  84. <label for="radio-6" style="margin-left: 50px;">
  85. <input type="radio" id="radio-6" name="maintenanceIsRepair" value="2"/>可返修
  86. </label>
  87. </div>
  88. <div class="input-box">
  89. <span class="input-dic" style="margin-top: 0">是否可入库</span>
  90. <label for="radio-7">
  91. <input type="radio" id="radio-7" name="maintenanceIsWarehousing" value="2" checked/>已入库
  92. </label>
  93. <label for="radio-8" style="margin-left: 50px;">
  94. <input type="radio" id="radio-8" name="maintenanceIsWarehousing" value="1"/>未入库
  95. </label>
  96. <label for="radio-9" style="margin-left: 50px;">
  97. <input type="radio" id="radio-9" name="maintenanceIsWarehousing" value="3"/>无法入库
  98. </label>
  99. </div>
  100. <div class="input-box">
  101. <span class="input-dic spanhidth">备注</span>
  102. <textarea rows="3" cols="20" name="maintenanceDesc" id="maintenanceDesc" class="my-textarea" placeholder="请详细备注签收的内容,便于以后复查。如果转入生产,则生产部门同事可查看!"></textarea>
  103. </div>
  104. <div>
  105. <button type="button" class="my-btn-submit" onclick="add();">确认提交</button>
  106. </div>
  107. </form>
  108. </article>
  109. <script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
  110. <script type="text/javascript">
  111. function add() {
  112. var maintenanceContentDate = $("#maintenanceContentDate").val();
  113. if( maintenanceContentDate == null || maintenanceContentDate == "" ){
  114. layer.msg('请选择检测日期',{icon: 5,time:1000});
  115. return;
  116. }
  117. var maintenanceDesc = $("#maintenanceDesc").val();
  118. if( !maintenanceDesc == null){
  119. if( maintenanceDesc.length > 150 ){
  120. layer.msg('备注长度不得大于150个字符',{icon: 5,time:1000});
  121. return;
  122. }
  123. }
  124. $.ajax({
  125. cache: true,
  126. type: "POST",
  127. url: "${path}/admin/maintenance/add_maintenance",
  128. data:$('#form-admin-add').serialize(),// 你的formid
  129. async: false,
  130. success: function(data){
  131. if (data.returnCode == 200) {
  132. layer.msg('添加成功',{icon: 1,time:1000},function () {
  133. window.parent.location.reload();
  134. var index = parent.layer.getFrameIndex(window.name);
  135. parent.layer.close(index)
  136. });
  137. } else {
  138. layer.msg('添加失败',{icon: 5,time:1000});
  139. }
  140. },
  141. error: function(XmlHttpRequest, textStatus, errorThrown){
  142. layer.msg('添加错误',{icon: 5,time:1000});
  143. }
  144. });
  145. }
  146. </script>
  147. </body>
  148. </html>