addRenovationMachine.ftl 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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. <title>添加翻新机</title>
  10. <style>
  11. .my-title{font-weight: 500;padding-left: 15px;position: relative;}
  12. .my-title:after{content: '';position: absolute;left: 0;top:12%;width: 3px;height: 80%;background: #32a3d8;}
  13. .my-input{padding: 8px 10px;width: 80%;border:1px solid rgba(0,0,0,.1);}
  14. .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%;}
  15. .input-box{margin: 18px 0;}
  16. .input-dic{float: left;margin:5px 10px 0 0;font-size: 12px;}
  17. .add-list{list-style-type: none;padding: 10px;background-color: #f5f5f5;width: 60%;float: left;margin: 0;}
  18. .add-list>li{margin: 10px 0;}
  19. .my-textarea{padding: 5px 10px;width: 80%;border:1px solid rgba(0,0,0,.1);}
  20. .my-btn-reset{padding: 10px 20px;width: 150px; background-color: #fff;color: #32a3d8;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
  21. .my-btn-submit{padding: 10px 20px;width: 150px; background-color: #32a3d8;color: #fff;border: 1px solid #32a3d8;cursor:pointer;margin: 10px 10px 0 10px;}
  22. .my-select{border: 1px solid rgba(0,0,0,.1);padding:6px 50px 6px 15px;width: 80%; height: 34px; -webkit-appearance:none;appearance:none;background: url(http://s.iamberry.com/images/select-1.png) right center no-repeat #fff;background-size:auto 100%;}
  23. input[type=radio]{-webkit-appearance:none;appearance:none;background: url(/rst/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(/rst/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
  25. .spanhidth{width: 70px;text-align: right;}
  26. </style>
  27. <#include "/base/add_base.ftl">
  28. </head>
  29. <body>
  30. <div class="pd-20">
  31. <form class="form form-horizontal" id="form-admin-add">
  32. <div class="input-box">
  33. <span class="input-dic spanhidth">批次:</span>
  34. <select class="my-select" name="batchId" id="batchId">
  35. <#if (listptsBatch ?size > 0)>
  36. <#list listptsBatch as list>
  37. <option value ="${list.batchId}">${list.batchNo}</option>
  38. </#list>
  39. <#else >
  40. <option value ="">暂无批次,请先添加批次</option>
  41. </#if>
  42. </select>
  43. </div>
  44. <div class="input-box">
  45. <span class="input-dic spanhidth">软件版本:</span>
  46. <select class="my-select" name="versionId" id="versionId">
  47. <#if (listVersion ?size > 0)>
  48. <#list listVersion as list>
  49. <option value ="${list.machineVersionId}">${list.machineVersionName}</option>
  50. </#list>
  51. <#else >
  52. <option value ="">暂无软件版本,请先添加软件版本</option>
  53. </#if>
  54. </select>
  55. </div>
  56. <div class="input-box">
  57. <span class="input-dic spanhidth">Bom单:</span>
  58. <select class="my-select" name="bomId" id="bomId">
  59. <#if (listBom ?size > 0)>
  60. <#list listBom as list>
  61. <option value ="${list.bomId}">${list.bomName}</option>
  62. </#list>
  63. <#else >
  64. <option value ="">暂无Bom,请先添加Bom单</option>
  65. </#if>
  66. </select>
  67. </div>
  68. <div class="input-box">
  69. <span class="input-dic" style="margin-top: 0">是否翻新机:</span>
  70. <label for="radio-10">
  71. <input type="radio" id="radio-10" name="isRefurbishment" value="1" checked/>是
  72. </label>
  73. <label for="radio-11" style="margin-left: 50px;">
  74. <input type="radio" id="radio-11" name="isRefurbishment" value="2"/>否
  75. </label>
  76. </div>
  77. <div class="input-box"><span class="input-dic spanhidth">拉线:</span><input class="my-input" type="text" style="width: 76%;" name="machineLine" id="machineLine" /> </div>
  78. <div class="input-box"><span class="input-dic spanhidth">机器数量:</span><input class="my-input" type="text" style="width: 76%;" name="number" id="number" placeholder="每次最少生成一个机器"/> </div>
  79. <div class="input-box">
  80. <span class="input-dic spanhidth"></span>
  81. <input id="sumbit" class="btn btn-primary radius" type="button" value="&nbsp;&nbsp;提交&nbsp;&nbsp;" onclick="admin_add()">
  82. </div>
  83. </form>
  84. </div>
  85. <#--<script type="text/javascript" src="${path}/common/admin/js/tips.js"></script>-->
  86. <script type="text/javascript">
  87. /*监听批次修改Bom bom单*/
  88. $("#batchId").change(function(){
  89. var batchId = $(this).val();
  90. getBom(batchId);
  91. });
  92. /*获取bom信息,赋值在页面上*/
  93. function getBom(batchId){
  94. var bom = new Object();
  95. $.ajax({
  96. type: "POST",
  97. data: {
  98. batchId : batchId
  99. },
  100. url: "${path}/admin/machine/select_bom",
  101. async: false,
  102. success: function(data){
  103. if (data.returnCode == 200) {
  104. bom = data.returnMsg.listBom;
  105. }
  106. },
  107. error: function(XmlHttpRequest, textStatus, errorThrown){
  108. }
  109. });
  110. if(bom != null){
  111. $("#bomId").empty();
  112. $.each(bom,function(n,value) {
  113. var appoption = "<option value='"+value.bomId+"'>"+value.bomName+"</option>";
  114. $("#bomId").append(appoption);
  115. });
  116. }
  117. }
  118. function dataCharm() {
  119. var batchId = $("#batchId").val();
  120. if(batchId == null || batchId == "" || typeof(batchId)=="undefined"){
  121. layer.msg("必须选择一个批次,没有批次请到批次列表添加批次",{icon: 5,time:3000});
  122. return false;
  123. }
  124. var versionId = $("#versionId").val();
  125. if(versionId == null || versionId == "" || typeof(versionId)=="undefined"){
  126. layer.msg("必须选择一个软件版本,没有软件版本请到产品列表中添加软件版本",{icon: 5,time:3000});
  127. return false;
  128. }
  129. var bomId = $("#bomId").val();
  130. if(bomId == null || bomId == "" || typeof(bomId)=="undefined"){
  131. layer.msg("必须选择一个Bom单,没有Bom单请到Bom单列表添加Bom单",{icon: 5,time:3000});
  132. return false;
  133. }
  134. var machineLine = $("#machineLine").val();
  135. if(machineLine == null || machineLine == "" || typeof(machineLine)=="undefined"){
  136. layer.msg("拉线不能为空",{icon: 5,time:3000});
  137. return false;
  138. }
  139. var number = $("#number").val();
  140. if(number == null || number == "" || typeof(number)=="undefined"){
  141. layer.msg("数量不能为空",{icon: 5,time:3000});
  142. return false;
  143. }
  144. if(number == 0){
  145. layer.msg("数量不能小于1",{icon: 5,time:3000});
  146. return false;
  147. }
  148. if(1 > number.length > 5){
  149. layer.msg("数量长度为2-10位",{icon: 5,time:3000});
  150. return false;
  151. }
  152. return true;
  153. }
  154. /*机器-添加*/
  155. function admin_add(){
  156. var msg = dataCharm();
  157. if(msg){
  158. $("#submit").attr("disabled","disabled");
  159. layer.msg('加载中', {icon: 16,time:500000});
  160. $.ajax({
  161. url: '${path}/admin/machine/add_renovationMachine',
  162. type: "POST",
  163. dataType: "json",
  164. data: $("#form-admin-add").serialize(),
  165. success: function(data){
  166. layer.msg('加载中', {icon: 16});
  167. $("#submit").removeAttr("disabled");
  168. if(data.returnCode){
  169. layer.msg("添加成功",{icon: 1,time:3000});
  170. window.parent.location.reload();
  171. var index = parent.layer.getFrameIndex(window.name);
  172. parent.layer.close(index);
  173. }else{
  174. layer.msg("添加失败",{icon: 5,time:3000});
  175. }
  176. },
  177. error:function(data){
  178. layer.msg("添加失败",{icon: 5,time:3000});
  179. }
  180. });
  181. }
  182. }
  183. </script>
  184. </body>
  185. </html>