You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

323 lines
13 KiB

4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
4 days ago
  1. <#import "../master.ftl" as master>
  2. <@master.layout>
  3. <style>
  4. #fm label {
  5. width: 150px;
  6. }
  7. </style>
  8. <div class="page-header">
  9. <h3>Rework Registration</h3>
  10. </div>
  11. <table id="dg" class="easyui-datagrid" style="width:100%;height:460px;display: none;"
  12. data-options="pagination: true, showFooter: true, singleSelect:true, fitColumns:true , onSelect:onTableRowSelect, onLoadSuccess:onTableRowSelect, url:'/prepress/reworkAll',method:'get',pageSize:20,toolbar:'#tb'">
  13. <thead>
  14. <tr>
  15. <th data-options="field:'orderNo',width:100,editor:'textbox'">Order No</th>
  16. <th data-options="field:'partNo',width:100,editor:'textbox'">Part No</th>
  17. <th data-options="field:'partDesc',width:200,editor:'textbox'">Part Description</th>
  18. <th data-options="field:'apn',width:80">APN</th>
  19. <th data-options="field:'customerPartNo',width:80">Customer Part No</th>
  20. <th data-options="field:'project',width:80">Project</th>
  21. <th data-options="field:'revNo',width:50">Rev No</th>
  22. <th data-options="field:'lotSize',width:100,editor:'textbox'">Lot Size</th>
  23. <th data-options="field:'inputLotSize',width:100,editor:'textbox'">Input Lot Size</th>
  24. <th data-options="field:'serialsDate',width:150,align:'left',formatter:formatDate">Serials Date</th>
  25. <th data-options="field:'needDate',width:120,formatter:formatDate">Earliest Start Date</th>
  26. <th data-options="field:'noOfCross',width:100">No of Cross</th>
  27. <th data-options="field:'standardRollQty',width:100,editor:'textbox'">Std. Roll Qty</th>
  28. <th data-options="field:'createdBy',width:80,align:'left'">Created By</th>
  29. <th data-options="field:'createdDate',width:150,align:'center',formatter:formatDateTime">Created Date</th>
  30. <th data-options="field:'status',width:100,editor:'textbox'">Status</th>
  31. <th data-options="field:'id', width:100,formatter: formatAction">Actions</th>
  32. </tr>
  33. </thead>
  34. </table>
  35. <div id="tb" style="padding:10px 5px;display: none;">
  36. <div>
  37. Order No: <input class="easyui-textbox" id="orderNo" style="width:110px">
  38. Created Date: <input class="easyui-datebox" id="createdDateFrom" style="width:100px">
  39. to: <input class="easyui-datebox" id="createdDateTo" style="width:100px">
  40. <a href="#nowhere" id="queryLink" class="easyui-linkbutton" iconCls="icon-search">Search</a>
  41. &nbsp;&nbsp;&nbsp;
  42. <a href="javascript:void(0)" id="tbAddBox" data-options="disabled:true" class="easyui-linkbutton" iconCls="icon-add" onclick="scanBoxModal()">Register Rework Box</a>
  43. <a href="javascript:void(0)" id="tbAddRoll" data-options="disabled:true" class="easyui-linkbutton" iconCls="icon-add" onclick="scanRollModal()">Register Rework Roll</a>
  44. </div>
  45. </div>
  46. <!-- 扫描返工箱记录 -->
  47. <div id="dlgBoxDtls" class="easyui-dialog" style="width:600px;display: none;" closed="true" data-options="modal:true" >
  48. <form method="post" novalidate onsubmit="return false;" style="margin:0; padding: 20px 20px">
  49. <div style="margin-bottom:10px">
  50. <label>Box No:</label>
  51. <input id="scan_box_no" name="boxNo" style="width: 75%; margin-left: 10px;">
  52. </div>
  53. </form>
  54. <table id="rework_boxs" class="easyui-datagrid" style="width:100%;height:300px;display: none;"
  55. data-options="pagination: false, showFooter: true, singleSelect:true, fitColumns:true , method:'POST', pageSize:20">
  56. <thead>
  57. <tr>
  58. <th data-options="field:'boxNo',width:100">Box No</th>
  59. <th data-options="field:'rollNums',width:80">Roll Qty</th>
  60. <th data-options="field:'registerBy',width:80">Registered By</th>
  61. <th data-options="field:'registerDate',width:150,align:'center', formatter: formatStringTime">Registration Date</th>
  62. </tr>
  63. </thead>
  64. </table>
  65. </div>
  66. <!-- 扫描返工卷记录 -->
  67. <div id="dlgRollDtls" class="easyui-dialog" style="width:700px;display: none;" closed="true" data-options="modal:true" >
  68. <form id="fm_scan_roll" method="post" novalidate onsubmit="return false;" style="margin:0; padding: 20px 20px">
  69. <div style="margin-bottom:10px">
  70. <label>Roll No:</label>
  71. <input id="scan_roll_no" name="rollNo" style="width: 75%; margin-left: 10px;">
  72. </div>
  73. </form>
  74. <table id="rework_rolls" class="easyui-datagrid" style="width:100%;height:300px;display: none;"
  75. data-options="pagination: false, showFooter: true, singleSelect:true, fitColumns:true , method:'POST', pageSize:20">
  76. <thead>
  77. <tr>
  78. <th data-options="field:'boxNo',width:100">Box No</th>
  79. <th data-options="field:'finalRollNo',width:100">Roll No</th>
  80. <th data-options="field:'rollQty',width:80">Quantity</th>
  81. <th data-options="field:'registerBy',width:80">Registered By</th>
  82. <th data-options="field:'registerDate',width:150,align:'center', formatter: formatStringTime">Registration Date</th>
  83. <th data-options="field:'status',width:80">Status</th>
  84. </tr>
  85. </thead>
  86. </table>
  87. </div>
  88. <!-- 扫描返工卷记录 -->
  89. <div id="dlgRollsShow" class="easyui-dialog" style="width: 820px;display: none;" closed="true" data-options="modal:true" >
  90. <form id="fm_show_roll" method="post" novalidate onsubmit="return false;" style="margin:0; padding: 20px 20px">
  91. <div style="margin-bottom:10px">
  92. <label>Status:</label>
  93. <select id="search_status" class="easyui-combobox" style="width:110px;" data-options="required:true">
  94. <option value="ALL">All</option>
  95. <option value="已登记">已登记</option>
  96. <option value="已返工">已返工</option>
  97. </select>
  98. <a href="javascript:void(0)" id="closedAllOrder" class="easyui-linkbutton" iconCls="icon-search" onclick="seachRegisterRolls()">Query</a>
  99. </div>
  100. </form>
  101. <table id="show_rework_rolls" class="easyui-datagrid" style="width:100%;height:300px;display: none;"
  102. data-options="pagination: false, showFooter: true, singleSelect:true, fitColumns:true , method:'POST', pageSize:20">
  103. <thead>
  104. <tr>
  105. <th data-options="field:'boxNo',width:100">Box No</th>
  106. <th data-options="field:'finalRollNo',width:140">Roll No</th>
  107. <th data-options="field:'rollQty',width:80">Quantity</th>
  108. <th data-options="field:'registerBy',width:80">登记人</th>
  109. <th data-options="field:'registerDate',width:150,align:'center', formatter: formatStringTime">登记日期</th>
  110. <th data-options="field:'reworkBy',width:80">返工扫描人</th>
  111. <th data-options="field:'reworkDate',width:150,align:'center', formatter: formatStringTime">返工扫描日期</th>
  112. <th data-options="field:'status',width:80">Status</th>
  113. </tr>
  114. </thead>
  115. </table>
  116. </div>
  117. <script>
  118. var currentRow;
  119. var nowOrderNo='';
  120. $(window).resize(function () {
  121. $("#dg").datagrid({"height": $(window).height() - $(".datagrid").offset().top - 20});
  122. });
  123. $(function () {
  124. $(window).resize();
  125. });
  126. function onPartDescChange(n,o){
  127. //var p = /Label,([0-9A-Za-z\-]+)-(\S{1})/.exec(n);
  128. var p = n.split(',');
  129. if (p && p.length >= 3){
  130. $("#revNo").textbox("setValue", p[2]);
  131. }
  132. }
  133. $.extend($.fn.validatebox.defaults.rules, {
  134. notRequired: function(value){
  135. return true;
  136. },
  137. validDate: {
  138. validator: function(value){
  139. var date = $.fn.datebox.defaults.parser(value);
  140. var s = $.fn.datebox.defaults.formatter(date);
  141. return s==value;
  142. },
  143. message: 'Please enter a valid date.'
  144. },
  145. valueRange: {
  146. validator: function(value,param){
  147. return value >= param[0] && value <= param[1];
  148. },
  149. message: 'Field do not match.'
  150. }
  151. });
  152. function myparser(s){
  153. if(s) return new Date(s);
  154. }
  155. /* 选中行 */
  156. function onTableRowSelect(index, row) {
  157. var noRowSelect = !!!row;
  158. currentRow = row;
  159. $("#tbAddBox").linkbutton({"disabled": noRowSelect});
  160. $("#tbAddRoll").linkbutton({"disabled": noRowSelect});
  161. }
  162. /* 查询返工单 */
  163. $("#queryLink").click(function(){
  164. var dg = $('#dg').datagrid({
  165. queryParams: {
  166. orderNo: $("#orderNo").val(),
  167. createdDateFrom: $("#createdDateFrom").val(),
  168. createdDateTo: $("#createdDateTo").val()
  169. }
  170. });
  171. });
  172. /* 查询返工单登记的箱 */
  173. function scanBoxModal(){
  174. $('#dlgBoxDtls').dialog('open').dialog('center').dialog('setTitle','Registered Boxes in '+currentRow.orderNo);
  175. var opts = $('#rework_boxs').datagrid('options');
  176. opts.queryParams = {'orderNo': currentRow.orderNo};
  177. $("#rework_boxs").datagrid({url: "/rework/getReworkRegisterBoxs"});
  178. //清空
  179. $("#scan_box_no").val("");
  180. //获取焦点
  181. $("#scan_box_no").focus();
  182. }
  183. /* 返工箱的操作 */
  184. $("#scan_box_no").on("keyup", function(event){
  185. var boxNo = $(this).val();
  186. if(!boxNo || '' === boxNo){
  187. $.messager.show({title: 'Point', msg: 'Please scan the registered box number!', timeout: 1500, showType: 'slide'});
  188. return false;
  189. }
  190. if(event.keyCode == 13){
  191. var requestData = {
  192. 'orderNo': currentRow.orderNo,
  193. 'boxNo': boxNo,
  194. 'username': username
  195. };
  196. $.post("/rework/registerBoxWithReworkOrder", requestData, function(data){
  197. if (data.success){
  198. //刷新列列表
  199. $("#rework_boxs").datagrid('reload');
  200. //提示信息
  201. $.messager.show({title: 'Point', msg: data.msg, timeout: 1500, showType: 'slide'});
  202. //清空
  203. $("#scan_box_no").val("");
  204. //获取焦点
  205. $("#scan_box_no").focus();
  206. }else{
  207. //清空
  208. $("#scan_box_no").val("");
  209. //提示 获取焦点
  210. $.messager.alert('Error', data.msg, 'error', function () {
  211. $("#scan_box_no").focus(); // 弹窗关闭后让输入框获取焦点
  212. });
  213. }
  214. })
  215. }
  216. return false;
  217. });
  218. /* 查询返工单登记的卷 */
  219. function scanRollModal(){
  220. $('#dlgRollDtls').dialog('open').dialog('center').dialog('setTitle','Registered Rolls in '+currentRow.orderNo);
  221. var opts = $('#rework_rolls').datagrid('options');
  222. opts.queryParams = {'orderNo': currentRow.orderNo};
  223. $("#rework_rolls").datagrid({url: "/rework/getReworkRegisterRolls"});
  224. //清空
  225. $("#scan_roll_no").val("");
  226. //获取焦点
  227. $("#scan_roll_no").focus();
  228. }
  229. /* 返工箱的操作 */
  230. $("#scan_roll_no").on("keyup", function(event){
  231. var finalRollNo = $(this).val();
  232. if(!finalRollNo || '' === finalRollNo){
  233. $.messager.show({title: 'Point', msg: 'Please scan the registered roll number!', timeout: 1500, showType: 'slide'});
  234. return false;
  235. }
  236. if(event.keyCode == 13){
  237. var requestData = {
  238. 'orderNo': currentRow.orderNo,
  239. 'finalRollNo': finalRollNo,
  240. 'username': username
  241. };
  242. $.post("/rework/registerRollWithReworkOrder", requestData, function(data){
  243. if (data.success){
  244. //刷新列列表
  245. $("#rework_rolls").datagrid('reload');
  246. //提示信息
  247. $.messager.show({title: 'Point', msg: data.msg, timeout: 1500, showType: 'slide'});
  248. //清空
  249. $("#scan_roll_no").val("");
  250. //获取焦点
  251. $("#scan_roll_no").focus();
  252. }else{
  253. //清空
  254. $("#scan_roll_no").val("");
  255. //提示 获取焦点
  256. $.messager.alert('Error', data.msg, 'error', function () {
  257. $("#scan_roll_no").focus(); // 弹窗关闭后让输入框获取焦点
  258. });
  259. }
  260. })
  261. }
  262. return false;
  263. });
  264. /* 查询已经登记的卷信息 */
  265. function seachRegisterRolls(){
  266. $('#dlgRollsShow').dialog('open').dialog('center').dialog('setTitle','Registered Rolls in '+currentRow.orderNo);
  267. var opts = $('#show_rework_rolls').datagrid('options');
  268. var searchStatus = $('#search_status').combobox('getValue');
  269. opts.queryParams = {'orderNo': currentRow.orderNo, 'status': searchStatus};
  270. $("#show_rework_rolls").datagrid({url: "/rework/getReworkRegisterRolls"});
  271. }
  272. /* 展示当前卷的信息 */
  273. function viewRollsModal(orderNo){
  274. $('#dlgRollsShow').dialog('open').dialog('center').dialog('setTitle','Registered Rolls in '+orderNo);
  275. var opts = $('#show_rework_rolls').datagrid('options');
  276. opts.queryParams = {'orderNo': orderNo, 'status': 'ALL'};
  277. $('#search_status').combobox('setValue', 'ALL');
  278. $("#show_rework_rolls").datagrid({url: "/rework/getReworkRegisterRolls"});
  279. }
  280. //检查卷信息
  281. function formatAction(value, row){
  282. return "<a href='javascript:viewRollsModal(\""+row.orderNo+"\")'>Roll detail</a>";
  283. }
  284. var delay = (function(){
  285. var timer = 0;
  286. return function(callback, ms){
  287. clearTimeout (timer);
  288. timer = setTimeout(callback, ms);
  289. };
  290. })();
  291. </script>
  292. </@master.layout>