|
|
<#import "../master.ftl" as master><@master.layout>
<style> #fm label { width: 150px; }</style>
<div class="page-header"> <h2>Rework verification</h2></div>
<table id="dg" class="easyui-datagrid" style="width:100%;height:460px;display: none;" data-options="pagination: true, showFooter: true, singleSelect:true, fitColumns:true , url:'/scanning/getReworkRollCheckData',method:'get',pageSize:20,toolbar:'#tb'"> <thead> <tr> <th data-options="field:'orderNo',width:100">Order No</th> <th data-options="field:'status',width:80,align:'left'">Status</th> <th data-options="field:'statement',width:80,align:'left', formatter:getStatement">Close status</th> <th data-options="field:'statementBy',width:100">Close By</th> <th data-options="field:'statementDate',width:100,formatter:formatDateTime">Close Date</th> <th data-options="field:'id',width:100,editor:'textbox', formatter:formatAction">Actions</th> </tr> </thead></table>
<div id="tb" style="padding:10px 5px;display: none;"> <div> 订单号: <input class="easyui-textbox" id="orderNo" style="width:110px"> 卷状态: <select id="status" class="easyui-combobox" style="width:110px;" data-options="required:true"> <option value="">All</option> <option value="Created">Created</option> <option value="Printed">Printed</option> <option value="Diecuted">Diecuted</option> <option value="Inspected">Inspected</option> <option value="Scanned">Scanned</option> </select> 结单状态: <select id="statement" class="easyui-combobox" style="width:110px;" data-options="required:true"> <option value="">All</option> <option value="N">Open</option> <option value="Y">Closed</option> </select> <a href="#nowhere" id="queryLink" class="easyui-linkbutton" iconCls="icon-search">Search</a> <#if currentUser.isAdmin> <a href="javascript:void(0)" id="closedAllRoll" class="easyui-linkbutton" iconCls="icon-edit" onclick="closedAllRoll()">Batch close</a> </#if> <#if currentUser.isAdmin || currentUser.authorities?contains("closeorder")> <a href="javascript:void(0)" id="forceClosed" class="easyui-linkbutton" iconCls="icon-remove" onclick="forceClosed()">Force close</a> </#if> </div></div>
<script> $(window).resize(function () { $("#dg").datagrid({"height": $(window).height() - $(".datagrid").offset().top - 20}); });
$(function () { $(window).resize(); });
$("#queryLink").click(function(){ var dg = $('#dg').datagrid({ queryParams: { orderNo: $("#orderNo").val(), status: $("#status").val(), statement: $("#statement").val() } }); });
function formatAction(value, row){ var action = " <a onclick='downReworkRollSerial(\""+row.orderNo+ "\")'>Trace</a>"; if(row.statement=="Y"){ action += " | Closed"; }else{ action += " | <a onclick='closedRoll(\""+row.orderNo+ "\")'>Close</a>"; } return action; } //获取卷标签数量 function getRollQty(value, row){ if(row.rowTo==null||row.rowTo=="" ||row.rowFrom==null||row.rowFrom==""){ return 0; } var qty = row.rowTo-row.rowFrom+1; return qty; } //获取结单状态 function getStatement(value, row){ if(value==""||value==null||value=="N"){ return "Open"; }else if(value=="Y"){ return "Closed"; }else if(value=="W"){ return "To be closed"; } } function lodopPrint(rollNo){ var url = "/print/finalrollScan/"+rollNo+"/"; //设置href $("#lodopPrint"+rollNo).attr("href", url); }
function formatDtlAction(value, row){ return "<a href='/shipment/boxes/scan/" + value + "'>Scan and delivery</a>"; }
function deleteBadRoll(finalRollNo){ $.messager.confirm('Confirm','Do you want to delete the defective roll <b>'+finalRollNo+'</b> ?',function(r){ if (r){ $.post('/scanning/deleteQcRoll/do',{finalRollNo: finalRollNo},function(result){ if (result.success){ $('#dg').datagrid('reload'); // reload the user data } else { $.messager.alert('error',result.errorMsg, 'error'); } },'json'); } }); }
function downExcel() { //拼接url $("#query_rollNo").val($("#finalRollNo").val()); $("#query_jobId").val($("#jobId").val()); $("#query_dateFrom").val($("#createdDateFrom").val()); $("#query_dateTo").val($("#createdDateTo").val()); var url = "/scanning/down/currentRollList?query_rollNo="+$("#query_rollNo").val()+"&query_jobId="+$("#query_jobId").val()+ "&query_dateFrom="+$("#query_dateFrom").val()+"&query_dateTo="+$("#query_dateTo").val()+"&query_openNo=40"; //设置href $("#downExcel").attr("href", url); } //trace function downReworkRollSerial(orderNo){ $.post("/scanning/downReworkRoll", {orderNo: orderNo}, function(ret){ console.log(ret); if(ret.success){ window.location.href="/prepress/downloadFileZip/"+ret.fileName; }else{ $.messager.alert('Error',ret.errorMsg, 'error'); } }); } //结单 function closedRoll(orderNo){ $.messager.confirm('Confirm','Close confirm ?',function(r){ if (r){ $.post('/scanning/closedRework',{orderNo: orderNo},function(result){ console.log(result); if (result.success){ $('#dg').datagrid('reload'); } else { $.messager.alert('Error',result.errorMsg, 'error'); } },'json'); } }); } //批量结单 function closedAllRoll(){ $.messager.confirm('Confirm','Are you sure to close the SO existing empty roll ?',function(r){ if (r){ $.messager.progress({ title: 'Point', msg: 'Please Wait……', text: '', interval: 300 }); $.post('/scanning/closedAllRework',{},function(result){ console.log(result); $.messager.progress('close');//进度条关闭 if (result.success){ $('#dg').datagrid('reload'); } else { $.messager.alert('Error',result.errorMsg, 'error'); } },'json'); } }); } //强制结单 function forceClosed(){ var row = $('#dg').datagrid('getSelected'); if (row){ var orderNo = row.orderNo; $.messager.confirm('Confirm','Force Close?',function(r){ if (r){ $.post('/scanning/forceClosedRework/',{orderNo: orderNo},function(result){ if (result.success){ $('#dg').datagrid('reload'); } else { $.messager.alert('Error',result.errorMsg, 'error'); } },'json'); } }); }else{ $.messager.alert('Warning','Please select a row.', 'warning'); } }
</script>
</@master.layout>
|