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.

193 lines
8.2 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>FG roll</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/finalrolls/${operNo}/all',method:'get',pageSize:20,toolbar:'#tb'">
  13. <thead>
  14. <tr>
  15. <#--<th data-options="field:'finalRollNo',width:100,formatter:formatLodopPrint">Roll No</th>-->
  16. <th data-options="field:'finalRollNo',width:100">Roll No</th>
  17. <th data-options="field:'jobId',width:100">Scanning Machine</th>
  18. <th data-options="field:'qty',width:80,align:'left'">Quantity</th>
  19. <th data-options="field:'status',width:80,align:'left'">Status</th>
  20. <th data-options="field:'locationFlag',width:50,align:'left'">Roll Status Flag</th>
  21. <th data-options="field:'createdBy',width:80,align:'center'">Created By</th>
  22. <th data-options="field:'createdDate',width:80,align:'center',formatter:formatDateTime">Create Date</th>
  23. <th data-options="field:'id',width:100,editor:'textbox', formatter:formatAction">Actions</th>
  24. </tr>
  25. </thead>
  26. </table>
  27. <div id="tb" style="padding:10px 5px;display: none;">
  28. <input id="query_rollNo" type="hidden">
  29. <input id="query_jobId" type="hidden">
  30. <input id="query_dateFrom" type="hidden">
  31. <input id="query_dateTo" type="hidden">
  32. <div>
  33. Roll No: <input class="easyui-textbox" id="finalRollNo" style="width:110px">
  34. Scanning machine: <input class="easyui-textbox" id="jobId" style="width:110px">
  35. Create Date: <input class="easyui-datebox" id="createdDateFrom" style="width:100px">
  36. 到: <input class="easyui-datebox" id="createdDateTo" style="width:100px">
  37. <a href="#nowhere" id="queryLink" class="easyui-linkbutton" iconCls="icon-search">Search</a>
  38. <a href="" id="downExcel" onclick="downExcel()" class="easyui-linkbutton">Download current query list</a>
  39. </div>
  40. </div>
  41. <div id="dlgDtls" class="easyui-dialog" style="width:600px;display: none;"
  42. closed="true" data-options="modal:true" >
  43. <table id="dgDtls" class="easyui-datagrid" style="width:100%;height:300px;display: none;"
  44. data-options="pagination: false, showFooter: true, singleSelect:true, fitColumns:true , method:'get', pageSize:50">
  45. <thead>
  46. <tr>
  47. <th data-options="field:'serialNo',width:100">Serials Number</th>
  48. </tr>
  49. </thead>
  50. </table>
  51. </div>
  52. <script>
  53. $(window).resize(function () {
  54. $("#dg").datagrid({"height": $(window).height() - $(".datagrid").offset().top - 20});
  55. });
  56. $(function () {
  57. $(window).resize();
  58. });
  59. $("#queryLink").click(function(){
  60. $("#query_rollNo").val($("#finalRollNo").val());
  61. $("#query_jobId").val($("#jobId").val());
  62. $("#query_dateFrom").val($("#createdDateFrom").val());
  63. $("#query_dateTo").val($("#createdDateTo").val());
  64. var dg = $('#dg').datagrid({
  65. queryParams: {
  66. finalRollNo: $("#finalRollNo").val(),
  67. jobId: $("#jobId").val(),
  68. createdDateFrom: $("#createdDateFrom").val(),
  69. createdDateTo: $("#createdDateTo").val()
  70. }
  71. });
  72. });
  73. function formatAction(value, row){
  74. var action = "<a href='javascript:viewSerials(\""+row.finalRollNo+"\")'>View Serials</a>";
  75. action += "|<a id='downSerial"+row.finalRollNo+"' onclick='downSerial(\""+row.finalRollNo+"\")'>Export Serials</a>";
  76. <#if currentUser.isAdmin || (currentUser.authorities?contains("super_leader") && currentUser.authorities?contains("indigo"))>
  77. if ((row.finalRollNo.indexOf("-Q") > 0 || row.finalRollNo.indexOf("-S") > 0) && row.jobId.indexOf("ROLLOP_10") >=0 ){
  78. action += "&nbsp;&nbsp;|&nbsp;&nbsp;<a href='javascript:deleteBadRoll(\""+row.finalRollNo+"\")'>Delete</a>";
  79. }
  80. </#if>
  81. <#if currentUser.isAdmin || (currentUser.authorities?contains("super_leader") && currentUser.authorities?contains("abg"))>
  82. if ((row.finalRollNo.indexOf("-Q") > 0 || row.finalRollNo.indexOf("-S") > 0) && row.jobId.indexOf("ROLLOP_20") >=0 ){
  83. action += "&nbsp;&nbsp;|&nbsp;&nbsp;<a href='javascript:deleteBadRoll(\""+row.finalRollNo+"\")'>Delete</a>";
  84. }
  85. </#if>
  86. <#if currentUser.isAdmin || (currentUser.authorities?contains("super_leader") && currentUser.authorities?contains("aoi"))>
  87. if ((row.finalRollNo.indexOf("-Q") > 0 || row.finalRollNo.indexOf("-S") > 0) && row.jobId.indexOf("ROLLOP_30") >=0 ){
  88. action += "&nbsp;&nbsp;|&nbsp;&nbsp;<a href='javascript:deleteBadRoll(\""+row.finalRollNo+"\")'>Delete</a>";
  89. }
  90. </#if>
  91. <#if currentUser.isAdmin || (currentUser.authorities?contains("super_leader") && currentUser.authorities?contains("scanning"))>
  92. if ((row.finalRollNo.indexOf("-Q") > 0 || row.finalRollNo.indexOf("-S") > 0) && row.jobId.indexOf("ROLLOP_40") >=0 ){
  93. action += "&nbsp;&nbsp;|&nbsp;&nbsp;<a href='javascript:deleteBadRoll(\""+row.finalRollNo+"\")'>Delete</a>";
  94. }
  95. </#if>
  96. <#-- <#if currentUser.isAdmin || (currentUser.authorities?contains("deleteFinalRoll") && ${operNo}==40)>-->
  97. <#-- action += "&nbsp;&nbsp;|&nbsp;&nbsp;<a href='javascript:deleteFinalRoll(\""+row.finalRollNo+"\")'>Delete Roll</a>";-->
  98. <#-- </#if>-->
  99. if(${operNo}==40){
  100. action += "|<a href='javascript:deleteFinalRoll(\""+row.finalRollNo+"\")'>Delete Roll</a>"
  101. }
  102. return action;
  103. }
  104. function deleteFinalRoll(finalRollNo) {
  105. $.messager.confirm('Confirm','Are you sure to delete the Roll <b>'+finalRollNo+'</b> ?',function(r){
  106. if (r){
  107. $.post('/scanning/deleteFinalRoll/do',{finalRollNo: finalRollNo},function(result){
  108. if (result.success){
  109. $('#dg').datagrid('reload'); // reload the user data
  110. } else {
  111. $.messager.alert('error',result.errorMsg, 'error');
  112. }
  113. },'json');
  114. }
  115. });
  116. }
  117. function formatLodopPrint(value, row){
  118. var action = "<a target='forprint' href='/print/finalrollScan/"+row.finalRollNo+"/'>"+value+"</a>";
  119. return action;
  120. }
  121. function lodopPrint(rollNo){
  122. var url = "/print/finalrollScan/"+rollNo+"/";
  123. //设置href
  124. $("#lodopPrint"+rollNo).attr("href", url);
  125. }
  126. function formatDtlAction(value, row){
  127. return "<a href='/shipment/boxes/scan/" + value + "'>Scan and delivery</a>";
  128. }
  129. var currentFinalRollNo = "";
  130. function viewSerials(finalRollNo){
  131. currentFinalRollNo = finalRollNo;
  132. $('#dlgDtls').dialog('open').dialog('center').dialog('setTitle',finalRollNo+'中的序列号');
  133. $("#dgDtls").datagrid({url: "/scanning/finalrolls/sn/"+finalRollNo});
  134. }
  135. function deleteBadRoll(finalRollNo){
  136. $.messager.confirm('Confirm','Do you want to delete the defective roll <b>'+finalRollNo+'</b> ?',function(r){
  137. if (r){
  138. $.post('/scanning/deleteQcRoll/do',{finalRollNo: finalRollNo},function(result){
  139. if (result.success){
  140. $('#dg').datagrid('reload'); // reload the user data
  141. } else {
  142. $.messager.alert('error',result.errorMsg, 'error');
  143. }
  144. },'json');
  145. }
  146. });
  147. }
  148. function downExcel() {
  149. //拼接url
  150. $("#query_rollNo").val($("#finalRollNo").val());
  151. $("#query_jobId").val($("#jobId").val());
  152. $("#query_dateFrom").val($("#createdDateFrom").val());
  153. $("#query_dateTo").val($("#createdDateTo").val());
  154. var url = "/scanning/down/currentRollList?query_rollNo="+$("#query_rollNo").val()+"&query_jobId="+$("#query_jobId").val()+
  155. "&query_dateFrom="+$("#query_dateFrom").val()+"&query_dateTo="+$("#query_dateTo").val()+"&query_openNo="+${operNo};
  156. //设置href
  157. $("#downExcel").attr("href", url);
  158. }
  159. function downSerial(rollNo){
  160. var url = "/scanning/down/currentSerialNumber?query_rollNo="+rollNo;
  161. //设置href
  162. $("#downSerial"+rollNo).attr("href", url);
  163. }
  164. </script>
  165. </@master.layout>