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.

211 lines
7.4 KiB

3 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. <h2>Rework verification</h2>
  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 , url:'/scanning/getReworkRollCheckData',method:'get',pageSize:20,toolbar:'#tb'">
  13. <thead>
  14. <tr>
  15. <th data-options="field:'orderNo',width:100">Order No</th>
  16. <th data-options="field:'status',width:80,align:'left'">Status</th>
  17. <th data-options="field:'statement',width:80,align:'left', formatter:getStatement">Close status</th>
  18. <th data-options="field:'statementBy',width:100">Close By</th>
  19. <th data-options="field:'statementDate',width:100,formatter:formatDateTime">Close Date</th>
  20. <th data-options="field:'id',width:100,editor:'textbox', formatter:formatAction">Actions</th>
  21. </tr>
  22. </thead>
  23. </table>
  24. <div id="tb" style="padding:10px 5px;display: none;">
  25. <div>
  26. 订单号: <input class="easyui-textbox" id="orderNo" style="width:110px">
  27. 卷状态: <select id="status" class="easyui-combobox" style="width:110px;" data-options="required:true">
  28. <option value="">All</option>
  29. <option value="Created">Created</option>
  30. <option value="Printed">Printed</option>
  31. <option value="Diecuted">Diecuted</option>
  32. <option value="Inspected">Inspected</option>
  33. <option value="Scanned">Scanned</option>
  34. </select>
  35. 结单状态: <select id="statement" class="easyui-combobox" style="width:110px;" data-options="required:true">
  36. <option value="">All</option>
  37. <option value="N">Open</option>
  38. <option value="Y">Closed</option>
  39. </select>
  40. <a href="#nowhere" id="queryLink" class="easyui-linkbutton" iconCls="icon-search">Search</a>
  41. <#if currentUser.isAdmin>
  42. <a href="javascript:void(0)" id="closedAllRoll" class="easyui-linkbutton" iconCls="icon-edit" onclick="closedAllRoll()">Batch close</a>
  43. </#if>
  44. <#if currentUser.isAdmin || currentUser.authorities?contains("closeorder")>
  45. <a href="javascript:void(0)" id="forceClosed" class="easyui-linkbutton" iconCls="icon-remove" onclick="forceClosed()">Force close</a>
  46. </#if>
  47. </div>
  48. </div>
  49. <script>
  50. $(window).resize(function () {
  51. $("#dg").datagrid({"height": $(window).height() - $(".datagrid").offset().top - 20});
  52. });
  53. $(function () {
  54. $(window).resize();
  55. });
  56. $("#queryLink").click(function(){
  57. var dg = $('#dg').datagrid({
  58. queryParams: {
  59. orderNo: $("#orderNo").val(),
  60. status: $("#status").val(),
  61. statement: $("#statement").val()
  62. }
  63. });
  64. });
  65. function formatAction(value, row){
  66. var action = " <a onclick='downReworkRollSerial(\""+row.orderNo+ "\")'>Trace</a>";
  67. if(row.statement=="Y"){
  68. action += " | Closed";
  69. }else{
  70. action += " | <a onclick='closedRoll(\""+row.orderNo+ "\")'>Close</a>";
  71. }
  72. return action;
  73. }
  74. //获取卷标签数量
  75. function getRollQty(value, row){
  76. if(row.rowTo==null||row.rowTo==""
  77. ||row.rowFrom==null||row.rowFrom==""){
  78. return 0;
  79. }
  80. var qty = row.rowTo-row.rowFrom+1;
  81. return qty;
  82. }
  83. //获取结单状态
  84. function getStatement(value, row){
  85. if(value==""||value==null||value=="N"){
  86. return "Open";
  87. }else if(value=="Y"){
  88. return "Closed";
  89. }else if(value=="W"){
  90. return "To be closed";
  91. }
  92. }
  93. function lodopPrint(rollNo){
  94. var url = "/print/finalrollScan/"+rollNo+"/";
  95. //设置href
  96. $("#lodopPrint"+rollNo).attr("href", url);
  97. }
  98. function formatDtlAction(value, row){
  99. return "<a href='/shipment/boxes/scan/" + value + "'>Scan and delivery</a>";
  100. }
  101. function deleteBadRoll(finalRollNo){
  102. $.messager.confirm('Confirm','Do you want to delete the defective roll <b>'+finalRollNo+'</b> ?',function(r){
  103. if (r){
  104. $.post('/scanning/deleteQcRoll/do',{finalRollNo: finalRollNo},function(result){
  105. if (result.success){
  106. $('#dg').datagrid('reload'); // reload the user data
  107. } else {
  108. $.messager.alert('error',result.errorMsg, 'error');
  109. }
  110. },'json');
  111. }
  112. });
  113. }
  114. function downExcel() {
  115. //拼接url
  116. $("#query_rollNo").val($("#finalRollNo").val());
  117. $("#query_jobId").val($("#jobId").val());
  118. $("#query_dateFrom").val($("#createdDateFrom").val());
  119. $("#query_dateTo").val($("#createdDateTo").val());
  120. var url = "/scanning/down/currentRollList?query_rollNo="+$("#query_rollNo").val()+"&query_jobId="+$("#query_jobId").val()+
  121. "&query_dateFrom="+$("#query_dateFrom").val()+"&query_dateTo="+$("#query_dateTo").val()+"&query_openNo=40";
  122. //设置href
  123. $("#downExcel").attr("href", url);
  124. }
  125. //trace
  126. function downReworkRollSerial(orderNo){
  127. $.post("/scanning/downReworkRoll", {orderNo: orderNo}, function(ret){
  128. console.log(ret);
  129. if(ret.success){
  130. window.location.href="/prepress/downloadFileZip/"+ret.fileName;
  131. }else{
  132. $.messager.alert('Error',ret.errorMsg, 'error');
  133. }
  134. });
  135. }
  136. //结单
  137. function closedRoll(orderNo){
  138. $.messager.confirm('Confirm','Close confirm ?',function(r){
  139. if (r){
  140. $.post('/scanning/closedRework',{orderNo: orderNo},function(result){
  141. console.log(result);
  142. if (result.success){
  143. $('#dg').datagrid('reload');
  144. } else {
  145. $.messager.alert('Error',result.errorMsg, 'error');
  146. }
  147. },'json');
  148. }
  149. });
  150. }
  151. //批量结单
  152. function closedAllRoll(){
  153. $.messager.confirm('Confirm','Are you sure to close the SO existing empty roll ?',function(r){
  154. if (r){
  155. $.messager.progress({
  156. title: 'Point',
  157. msg: 'Please Wait……',
  158. text: '',
  159. interval: 300
  160. });
  161. $.post('/scanning/closedAllRework',{},function(result){
  162. console.log(result);
  163. $.messager.progress('close');//进度条关闭
  164. if (result.success){
  165. $('#dg').datagrid('reload');
  166. } else {
  167. $.messager.alert('Error',result.errorMsg, 'error');
  168. }
  169. },'json');
  170. }
  171. });
  172. }
  173. //强制结单
  174. function forceClosed(){
  175. var row = $('#dg').datagrid('getSelected');
  176. if (row){
  177. var orderNo = row.orderNo;
  178. $.messager.confirm('Confirm','Force Close?',function(r){
  179. if (r){
  180. $.post('/scanning/forceClosedRework/',{orderNo: orderNo},function(result){
  181. if (result.success){
  182. $('#dg').datagrid('reload');
  183. } else {
  184. $.messager.alert('Error',result.errorMsg, 'error');
  185. }
  186. },'json');
  187. }
  188. });
  189. }else{
  190. $.messager.alert('Warning','Please select a row.', 'warning');
  191. }
  192. }
  193. </script>
  194. </@master.layout>