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
193 lines
8.2 KiB
<#import "../master.ftl" as master>
|
|
<@master.layout>
|
|
|
|
<style>
|
|
#fm label {
|
|
width: 150px;
|
|
}
|
|
</style>
|
|
|
|
<div class="page-header">
|
|
<h2>FG roll</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/finalrolls/${operNo}/all',method:'get',pageSize:20,toolbar:'#tb'">
|
|
<thead>
|
|
<tr>
|
|
<#--<th data-options="field:'finalRollNo',width:100,formatter:formatLodopPrint">Roll No</th>-->
|
|
<th data-options="field:'finalRollNo',width:100">Roll No</th>
|
|
<th data-options="field:'jobId',width:100">Scanning Machine</th>
|
|
<th data-options="field:'qty',width:80,align:'left'">Quantity</th>
|
|
<th data-options="field:'status',width:80,align:'left'">Status</th>
|
|
<th data-options="field:'locationFlag',width:50,align:'left'">Roll Status Flag</th>
|
|
<th data-options="field:'createdBy',width:80,align:'center'">Created By</th>
|
|
<th data-options="field:'createdDate',width:80,align:'center',formatter:formatDateTime">Create 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;">
|
|
<input id="query_rollNo" type="hidden">
|
|
<input id="query_jobId" type="hidden">
|
|
<input id="query_dateFrom" type="hidden">
|
|
<input id="query_dateTo" type="hidden">
|
|
<div>
|
|
Roll No: <input class="easyui-textbox" id="finalRollNo" style="width:110px">
|
|
Scanning machine: <input class="easyui-textbox" id="jobId" style="width:110px">
|
|
Create Date: <input class="easyui-datebox" id="createdDateFrom" style="width:100px">
|
|
到: <input class="easyui-datebox" id="createdDateTo" style="width:100px">
|
|
<a href="#nowhere" id="queryLink" class="easyui-linkbutton" iconCls="icon-search">Search</a>
|
|
<a href="" id="downExcel" onclick="downExcel()" class="easyui-linkbutton">Download current query list</a>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div id="dlgDtls" class="easyui-dialog" style="width:600px;display: none;"
|
|
closed="true" data-options="modal:true" >
|
|
<table id="dgDtls" class="easyui-datagrid" style="width:100%;height:300px;display: none;"
|
|
data-options="pagination: false, showFooter: true, singleSelect:true, fitColumns:true , method:'get', pageSize:50">
|
|
<thead>
|
|
<tr>
|
|
<th data-options="field:'serialNo',width:100">Serials Number</th>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
</div>
|
|
|
|
|
|
<script>
|
|
|
|
$(window).resize(function () {
|
|
$("#dg").datagrid({"height": $(window).height() - $(".datagrid").offset().top - 20});
|
|
});
|
|
|
|
$(function () {
|
|
$(window).resize();
|
|
});
|
|
|
|
|
|
$("#queryLink").click(function(){
|
|
$("#query_rollNo").val($("#finalRollNo").val());
|
|
$("#query_jobId").val($("#jobId").val());
|
|
$("#query_dateFrom").val($("#createdDateFrom").val());
|
|
$("#query_dateTo").val($("#createdDateTo").val());
|
|
var dg = $('#dg').datagrid({
|
|
queryParams: {
|
|
finalRollNo: $("#finalRollNo").val(),
|
|
jobId: $("#jobId").val(),
|
|
createdDateFrom: $("#createdDateFrom").val(),
|
|
createdDateTo: $("#createdDateTo").val()
|
|
}
|
|
});
|
|
});
|
|
|
|
function formatAction(value, row){
|
|
var action = "<a href='javascript:viewSerials(\""+row.finalRollNo+"\")'>View Serials</a>";
|
|
action += "|<a id='downSerial"+row.finalRollNo+"' onclick='downSerial(\""+row.finalRollNo+"\")'>Export Serials</a>";
|
|
<#if currentUser.isAdmin || (currentUser.authorities?contains("super_leader") && currentUser.authorities?contains("indigo"))>
|
|
if ((row.finalRollNo.indexOf("-Q") > 0 || row.finalRollNo.indexOf("-S") > 0) && row.jobId.indexOf("ROLLOP_10") >=0 ){
|
|
action += " | <a href='javascript:deleteBadRoll(\""+row.finalRollNo+"\")'>Delete</a>";
|
|
}
|
|
</#if>
|
|
|
|
<#if currentUser.isAdmin || (currentUser.authorities?contains("super_leader") && currentUser.authorities?contains("abg"))>
|
|
if ((row.finalRollNo.indexOf("-Q") > 0 || row.finalRollNo.indexOf("-S") > 0) && row.jobId.indexOf("ROLLOP_20") >=0 ){
|
|
action += " | <a href='javascript:deleteBadRoll(\""+row.finalRollNo+"\")'>Delete</a>";
|
|
}
|
|
</#if>
|
|
|
|
<#if currentUser.isAdmin || (currentUser.authorities?contains("super_leader") && currentUser.authorities?contains("aoi"))>
|
|
if ((row.finalRollNo.indexOf("-Q") > 0 || row.finalRollNo.indexOf("-S") > 0) && row.jobId.indexOf("ROLLOP_30") >=0 ){
|
|
action += " | <a href='javascript:deleteBadRoll(\""+row.finalRollNo+"\")'>Delete</a>";
|
|
}
|
|
</#if>
|
|
|
|
<#if currentUser.isAdmin || (currentUser.authorities?contains("super_leader") && currentUser.authorities?contains("scanning"))>
|
|
if ((row.finalRollNo.indexOf("-Q") > 0 || row.finalRollNo.indexOf("-S") > 0) && row.jobId.indexOf("ROLLOP_40") >=0 ){
|
|
action += " | <a href='javascript:deleteBadRoll(\""+row.finalRollNo+"\")'>Delete</a>";
|
|
}
|
|
</#if>
|
|
<#-- <#if currentUser.isAdmin || (currentUser.authorities?contains("deleteFinalRoll") && ${operNo}==40)>-->
|
|
<#-- action += " | <a href='javascript:deleteFinalRoll(\""+row.finalRollNo+"\")'>Delete Roll</a>";-->
|
|
<#-- </#if>-->
|
|
if(${operNo}==40){
|
|
action += "|<a href='javascript:deleteFinalRoll(\""+row.finalRollNo+"\")'>Delete Roll</a>"
|
|
}
|
|
return action;
|
|
}
|
|
|
|
function deleteFinalRoll(finalRollNo) {
|
|
$.messager.confirm('Confirm','Are you sure to delete the Roll <b>'+finalRollNo+'</b> ?',function(r){
|
|
if (r){
|
|
$.post('/scanning/deleteFinalRoll/do',{finalRollNo: finalRollNo},function(result){
|
|
if (result.success){
|
|
$('#dg').datagrid('reload'); // reload the user data
|
|
} else {
|
|
$.messager.alert('error',result.errorMsg, 'error');
|
|
}
|
|
},'json');
|
|
}
|
|
});
|
|
}
|
|
|
|
function formatLodopPrint(value, row){
|
|
var action = "<a target='forprint' href='/print/finalrollScan/"+row.finalRollNo+"/'>"+value+"</a>";
|
|
return action;
|
|
}
|
|
|
|
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>";
|
|
}
|
|
|
|
var currentFinalRollNo = "";
|
|
function viewSerials(finalRollNo){
|
|
currentFinalRollNo = finalRollNo;
|
|
$('#dlgDtls').dialog('open').dialog('center').dialog('setTitle',finalRollNo+'中的序列号');
|
|
$("#dgDtls").datagrid({url: "/scanning/finalrolls/sn/"+finalRollNo});
|
|
}
|
|
|
|
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="+${operNo};
|
|
//设置href
|
|
$("#downExcel").attr("href", url);
|
|
}
|
|
|
|
function downSerial(rollNo){
|
|
var url = "/scanning/down/currentSerialNumber?query_rollNo="+rollNo;
|
|
//设置href
|
|
$("#downSerial"+rollNo).attr("href", url);
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
</@master.layout>
|
|
|