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.
806 lines
32 KiB
806 lines
32 KiB
<#import "../master.ftl" as master>
|
|
<@master.layout>
|
|
|
|
<div class="page-header">
|
|
<h3>${title}</h3>
|
|
</div>
|
|
|
|
<div class="row" id="app">
|
|
<div class="col-md-4">
|
|
<p><input id="rollNo" name="rollNo" type="text" class="form-control" placeholder="Roll No" /></p>
|
|
<table id="tblInfo" class="table">
|
|
</table>
|
|
</div>
|
|
<input type="hidden" id="processNumber" value="">
|
|
<input type="hidden" id="orderNo" value="">
|
|
<p><button id="btnStatus" onclick="updateStatus()" class="btn btn-default" style="margin-left: 15px;">Refresh Status</button></p>
|
|
<div class="col-md-1" id="actions" style="display: none">
|
|
<#if currentUser.isAdmin || currentUser.authorities?contains("refreshRollStatus")>
|
|
<p><button id="refreshRollStatus" onclick="refreshRollStatus()" class="btn btn-default">Reverse All Scanning Data</button></p>
|
|
</#if>
|
|
<#if func?is_string && func != "indigo">
|
|
<p><button id="btnConfirm" onclick="doConfirm()" class="btn btn-default">Confirm quantity</button></p>
|
|
</#if>
|
|
<#if func?is_string && func == "indigo">
|
|
<p><button id="scanMaterial" onclick="scanMaterialModal()" class="btn btn-default">扫描材料</button></p>
|
|
</#if>
|
|
<p><button id="btnStart" onclick="doStart()" class="btn btn-default">Scan</button></p>
|
|
<p><button id="btnSetup" onclick="doSetup()" class="btn btn-default">Scan/setup</button></p>
|
|
<p><button id="btnFai" onclick="doFai()" class="btn btn-default">Scan/first off</button></p>
|
|
<p><button id="btnEai" onclick="doEai()" class="btn btn-default">Scan/last off</button></p>
|
|
|
|
<#if func?is_string && func == "indigo">
|
|
<p><button id="btnCreateRoll" onclick="doCreateRoll()" class="btn btn-default">Create new roll</button></p>
|
|
</#if>
|
|
<#if func?is_string && func == "aoi">
|
|
<p><button id="btnSlitting" onclick="showSlittingRolls()" class="btn btn-default">Slit roll</button></p>
|
|
</#if>
|
|
<#if func?is_string && func != "indigo">
|
|
<p><button id="btnBad" onclick="doBad()" class="btn btn-default">Type defective serial number</button></p>
|
|
<p><button id="btnBadRange" onclick="doBadRange()" class="btn btn-default">Batch defective serial number</button></p>
|
|
</#if>
|
|
<#if func?is_string && func == "abg">
|
|
<p><button id="printSlitting" onclick="slittingPrint()" class="btn btn-default">Print Label</button></p>
|
|
|
|
</#if>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row" >
|
|
<div class="col-md-12" id="tblRollOpInfo">
|
|
</div>
|
|
</div>
|
|
|
|
<div id="dlg" class="easyui-dialog for-scan" style="width:500px;display: none;"
|
|
closed="true" buttons="#dlg-buttons">
|
|
<form id="fm" method="post" novalidate style="margin:0;padding:20px 20px">
|
|
<div style="margin-bottom:10px">
|
|
<label id="rollNo_display" class="easyui-textbox" data-options="labelWidth:100,disabled:true" required="true" label="Roll No:" style="width:100%"></label>
|
|
</div>
|
|
|
|
<div id="serial_input_1st" style="margin-bottom:10px">
|
|
<input id="firstSerialNo" name="firstSerialNo" class="easyui-textbox" required="true" data-options="labelWidth:100" label="The first serial number:" style="width:100%">
|
|
</div>
|
|
|
|
<div id="serial_input_2nd" style="margin-bottom:10px">
|
|
<input id="endSerialNo" name="endSerialNo" class="easyui-textbox" required="true" data-options="labelWidth:100" label="The second serial number:" style="width:100%">
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
|
|
<div id="dlg-buttons" style="display: none;">
|
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" id="badOK" onclick="doOK()" style="width:90px">OK</a>
|
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg').dialog('close')" style="width:90px">Cancel</a>
|
|
</div>
|
|
|
|
<div id="dlgConfirm" class="easyui-dialog for-scan" style="width:500px;display: none;"
|
|
closed="true" buttons="#dlg-buttons-confirm">
|
|
<form id="fm" method="post" novalidate style="margin:0;padding:20px 20px">
|
|
<div style="margin-bottom:10px">
|
|
<input name="workNo" class="easyui-textbox" data-options="labelWidth:100" required="true" label="Emoloyee ID:" style="width:100%">
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div id="dlg-buttons-confirm" style="display: none;">
|
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="doConfirmOK()" style="width:90px">OK</a>
|
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlgConfirm').dialog('close')" style="width:90px">Cancel</a>
|
|
</div>
|
|
|
|
<div id="dlgSlitting" class="easyui-dialog for-scan" style="width:500px;display: none;"
|
|
closed="true" buttons="#dlg-buttons-slitting" data-options="modal:true">
|
|
<form method="post" novalidate style="margin:0;padding:20px 20px">
|
|
<div style="margin-bottom:10px">
|
|
<input id="noOfCross" class="easyui-textbox" data-options="labelWidth:100,disabled:true" required="true" label="Roll Qty:" style="width:100%">
|
|
</div>
|
|
<div style="margin-bottom:10px">
|
|
<input name="endSerialNo" class="easyui-textbox" data-options="labelWidth:100" required="true" label="结束序列号:" style="width:100%">
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div id="dlg-buttons-slitting" style="display: none;">
|
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="doSlittingOK()" style="width:90px">OK</a>
|
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlgSlitting').dialog('close')" style="width:90px">Cancel</a>
|
|
</div>
|
|
|
|
<!-- 卷分切-->
|
|
<div id="dlgSlittingRolls" class="easyui-dialog" style="width:800px;display: none;"
|
|
closed="true" data-options="modal:true" >
|
|
<table id="dgSlittingRolls" class="easyui-datagrid" style="width:100%;height:300px;display: none;"
|
|
data-options="pagination: false, showFooter: true, singleSelect:true, fitColumns:true , method:'get', pageSize:500,toolbar:'#tbSlittingRolls'">
|
|
<thead>
|
|
<tr>
|
|
<th data-options="field:'slittingNo',width:80,formatter:formatLodopPrint('slittingNo')">Slitting Roll No</th>
|
|
<th data-options="field:'serialScope',width:300">序列号范围</th>
|
|
<th data-options="field:'status',width:60">Status</th>
|
|
<th data-options="field:'col',width:30">No. of Cross</th>
|
|
<th data-options="field:'rewindFlag',width:50">需要倒卷</th>
|
|
<th data-options="field:'combineFlag',width:50">倒卷完成</th>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
</div>
|
|
<div id="tbSlittingRolls" style="padding:10px 5px;display: none;">
|
|
<div>
|
|
<a href="javascript:void(0)" id="tbAdd" class="easyui-linkbutton" iconCls="icon-add" onclick="doSlitting()">新增卷</a>
|
|
<a href="javascript:void(0)" id="tbAdd" class="easyui-linkbutton" iconCls="icon-add" onclick="doSlittingTure()">Correct Data</a>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- 扫描材料modal(优化版) -->
|
|
<div id="scan_material_dlg" class="easyui-dialog" style="width: 720px; display: none;"
|
|
closed="true" data-options="modal:true, onOpen:function(){$('#scan_material_batch').focus();}, buttons:'#tb_scan_material'">
|
|
<form id="scan_material_fm" method="post" novalidate style="margin:0; padding: 16px 16px 8px 16px;">
|
|
<div id = "material_batch_wrap" style="margin-bottom:10px">
|
|
<label style="display:block; margin-bottom:6px; color:#666;">请扫描材料条码:</label>
|
|
<textarea id="scan_material_batch" name="code" rows="3" style="width:100%; resize: vertical;"
|
|
placeholder="请扫描材料批次"></textarea>
|
|
</div>
|
|
<div id="material_serial_wrap" style="margin-bottom:10px; display:none;">
|
|
<label style="display:block; margin-bottom:6px; color:#666;">请扫描结束码包:</label>
|
|
<input id="material_serial_no" name="materialSerialNo" class="easyui-textbox" style="width:100%" placeholder="请扫描结束码包">
|
|
</div>
|
|
</form>
|
|
<table id="scan_material_list" class="easyui-datagrid" style="width:100%;height: 300px;"
|
|
data-options="pagination:false, singleSelect:true, fitColumns:true, method:'POST'">
|
|
<thead>
|
|
<tr>
|
|
<th data-options="field:'rollNo',width:120">Roll No</th>
|
|
<th data-options="field:'componentPartNo',width:140">物料号</th>
|
|
<th data-options="field:'customerBatchNo',width:160">材料批次号</th>
|
|
<th data-options="field:'columnSortIndex',width:80,align:'center'">No. of Cross</th>
|
|
<th data-options="field:'startRow',width:80,align:'center'">From Row No</th>
|
|
<th data-options="field:'endRow',width:80,align:'center'">To Row No</th>
|
|
<th data-options="field:'scanTime',width:140">扫描时间</th>
|
|
<th data-options="field:'scanBy',width:100">扫描人</th>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
</div>
|
|
<div id="tb_scan_material" style="padding:10px 5px; display: none; text-align: center;">
|
|
<div>
|
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#scan_material_dlg').dialog('close')">Close</a>
|
|
</div>
|
|
</div>
|
|
|
|
<style>
|
|
table.roll-op-serials {
|
|
border: 1px solid gray;
|
|
}
|
|
table.roll-op-serials td{
|
|
border: 1px dotted gray;
|
|
padding: 3px;
|
|
text-align: center;
|
|
text-align: center;
|
|
font-family: Arial,monospace;
|
|
font-size: 11px;
|
|
background-color: aliceblue;
|
|
}
|
|
|
|
table.roll-op-serials td .serial-no{
|
|
font-size: 11px;
|
|
}
|
|
|
|
|
|
</style>
|
|
<script type="text/javascript" src="/js/layer/layer.js"></script>
|
|
<script>
|
|
var formPostUrl="";
|
|
var currentRoll = "";
|
|
var currentRollOp = {};
|
|
var currentOrder={};
|
|
var urlPath="/rollop/${func}";
|
|
var newUrlPath="/indigo";
|
|
var work_center_data;
|
|
var temp_row;
|
|
var doUrl = "";
|
|
var flag = "N";
|
|
var enableScanMaterialNo = false;
|
|
|
|
function show2ndBox(b){
|
|
showEl("#dlg #serial_input_1st", true);
|
|
showEl("#dlg #serial_input_2nd", true);
|
|
showEl("#dlg #serial_input_2nd", b);
|
|
$('#dlg #endSerialNo').textbox({disabled:!b});
|
|
}
|
|
|
|
function showDialog(title, serialNum, postUrl){
|
|
show2ndBox(serialNum > 1);
|
|
$('#dlg').dialog('open').dialog('center').dialog('setTitle',title);
|
|
$('#dlg form').form('clear');
|
|
$('#dlg #rollNo_display').textbox({"value": currentRoll});
|
|
formPostUrl = urlPath + postUrl + "?rollNo="+currentRoll;
|
|
doUrl = urlPath + "/badRange/do?rollNo="+currentRoll;
|
|
}
|
|
/* 新的 只给startDo setupDo faiDo eaiDo LR 2025-10-30*/
|
|
function showDialogNew(title, serialNum, postUrl){
|
|
show2ndBox(serialNum > 1);
|
|
$('#dlg').dialog('open').dialog('center').dialog('setTitle',title);
|
|
$('#dlg form').form('clear');
|
|
$('#dlg #rollNo_display').textbox({"value": currentRoll});
|
|
formPostUrl = newUrlPath + postUrl + "?rollNo="+currentRoll;
|
|
doUrl = urlPath + "/badRange/do?rollNo="+currentRoll;
|
|
}
|
|
|
|
function doConfirm(){
|
|
$('#dlgConfirm').dialog('open').dialog('center').dialog('setTitle',"Confirm quantity");
|
|
$('#dlgConfirm form').form('clear');
|
|
}
|
|
|
|
function doConfirmOK(){
|
|
console.log(urlPath + "/confirm/do?rollNo=" + currentRoll)
|
|
$('#dlgConfirm form').form('submit',{
|
|
url: urlPath + "/confirm/do?rollNo=" + currentRoll,
|
|
onSubmit: function(){
|
|
return $(this).form('validate');
|
|
},
|
|
success: function(result){
|
|
var result = $.parseJSON(result);
|
|
if (result.success){
|
|
refreshRollInfo(currentRoll);
|
|
$('#dlgConfirm').dialog('close'); // close the dialog
|
|
} else {
|
|
$.messager.alert('error',result.errorMsg, 'error');
|
|
}
|
|
}
|
|
});
|
|
}
|
|
//修正so_roll状态
|
|
function updateStatus(){
|
|
let func = '${func}';
|
|
$.ajax({
|
|
url: "/aoi/slitting/updateStatus",
|
|
type:"POST",
|
|
data:{
|
|
'rollNo': currentRoll,
|
|
'func': func,
|
|
},
|
|
dataType:"JSON",
|
|
success: function (ret) {
|
|
console.log(ret);
|
|
if(ret.success == false){
|
|
$.messager.alert('error',ret.errorMsg, 'error');
|
|
}else if(ret.success==true){
|
|
refreshRollInfo(currentRoll)
|
|
$.messager.alert('info',"Successfully",'info');
|
|
}
|
|
}
|
|
})
|
|
}
|
|
|
|
function doSlitting(){
|
|
$('#dlgSlitting').dialog('open').dialog('center').dialog('setTitle',"Slit roll");
|
|
$('#dlgSlitting form').form('clear');
|
|
$('#dlgSlitting #noOfCross').textbox({"value": 1});
|
|
}
|
|
|
|
function showSlittingRolls(){
|
|
$('#dlgSlittingRolls').dialog('open').dialog('center').dialog('setTitle',"Slit roll");
|
|
$("#dgSlittingRolls").datagrid({url: "/aoi/slittingrolls/"+currentRoll});
|
|
}
|
|
|
|
function doSlittingOK(){
|
|
$('#dlgSlitting form').form('submit',{
|
|
url: "/aoi/slitting/do?rollNo=" + currentRoll,
|
|
onSubmit: function(){
|
|
return $(this).form('validate');
|
|
},
|
|
success: function(result){
|
|
console.log(result);
|
|
var result = $.parseJSON(result);
|
|
if (result.success){
|
|
refreshRollInfo(currentRoll);
|
|
$('#dgSlittingRolls').datagrid('reload');
|
|
$('#dlgSlitting').dialog('close'); // close the dialog
|
|
} else {
|
|
$.messager.alert('error',result.errorMsg, 'error');
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
function doSlittingTure(){
|
|
// $('#dlgSlitting form').form('submit',{
|
|
// url: "/aoi/slitting/doTure?rollNo=" + currentRoll,
|
|
// onSubmit: function(){
|
|
// return $(this).form('validate');
|
|
// },
|
|
// success: function(result){
|
|
// var result = $.parseJSON(result);
|
|
// if (result.success){
|
|
// $.messager.alert('info',"Successfully",'info');
|
|
// } else {
|
|
// $.messager.alert('error',result.errorMsg, 'error');
|
|
// }
|
|
// }
|
|
// });
|
|
|
|
$.ajax({
|
|
url: "/aoi/slitting/doTure",
|
|
type:"POST",
|
|
data:{
|
|
'rollNo':currentRoll,
|
|
},
|
|
dataType:"JSON",
|
|
success: function (ret) {
|
|
console.log(ret);
|
|
if(ret.success==false){
|
|
$.messager.alert('error',ret.data, 'error');
|
|
}else if(ret.success==true){
|
|
$.messager.alert('info',"Successfully",'info');
|
|
}
|
|
}
|
|
})
|
|
}
|
|
|
|
function doStart(){
|
|
flag = "N";
|
|
$("#dlg #firstSerialNo").textbox({disabled:false});
|
|
showDialogNew("Scan", 1, "/start/do");
|
|
}
|
|
|
|
function doSetup(){
|
|
flag = "N";
|
|
$("#dlg #firstSerialNo").textbox({disabled:true});
|
|
showDialogNew("Scan/setup", 2, "/setup/do");
|
|
$("#dlg #firstSerialNo").textbox({value: currentRollOp.toSetupSerialNo || ""});
|
|
}
|
|
|
|
function doFai(){
|
|
flag = "N";
|
|
$("#dlg #firstSerialNo").textbox({disabled:false});
|
|
showDialogNew("Scan/first off", 2, "/fai/do");
|
|
}
|
|
|
|
function doEai(){
|
|
flag = "N";
|
|
$("#dlg #firstSerialNo").textbox({disabled:false});
|
|
showDialogNew("Scan/last off", 2, "/eai/do");
|
|
}
|
|
|
|
function doBad(){
|
|
flag = "N";
|
|
showDialog("Type defective serial number", 1, "/bad/do");
|
|
}
|
|
|
|
// function doIpqc(){
|
|
// flag = "N";
|
|
// showDialog("IPQC抽样", 1, "/ipqc/do");
|
|
// }
|
|
|
|
function doBadRange(){
|
|
$("#badOK").linkbutton({"disabled": false});
|
|
flag = "Y";
|
|
//showDialog("Batch defective serial number", 2, "/badRange/do");
|
|
showDialog("Batch defective serial number", 2, "/badRange/count");
|
|
}
|
|
|
|
|
|
<#if func == "aoi">
|
|
function doEai(){
|
|
showEl("#dlg #serial_input_1st", false);
|
|
showEl("#dlg #serial_input_2nd", false);
|
|
$('#dlg').dialog('open').dialog('center').dialog('setTitle',"Scan/last off");
|
|
$('#dlg form').form('clear');
|
|
$('#dlg #rollNo_display').textbox({"value": currentRoll});
|
|
$('#dlg #firstSerialNo').textbox({"value": "-"});
|
|
$('#dlg #endSerialNo').textbox({"value": "-"});
|
|
formPostUrl = urlPath + "/eai/do" + "?rollNo="+currentRoll;
|
|
}
|
|
</#if>
|
|
|
|
|
|
function doOK(){
|
|
var badFirstSN = $("#firstSerialNo").val();
|
|
var badEndSN = $("#endSerialNo").val();
|
|
$("#badOK").linkbutton({"disabled": true});
|
|
$('#dlg form').form('submit',{
|
|
url: formPostUrl,
|
|
onSubmit: function(){
|
|
return $(this).form('validate');
|
|
},
|
|
success: function(result){
|
|
if(flag=="Y"){
|
|
var result = $.parseJSON(result);
|
|
if (result.errorMsg){
|
|
$("#badOK").linkbutton({"disabled": false});
|
|
$('#dlg').dialog('close');
|
|
$.messager.alert('Error',result.errorMsg, 'error');
|
|
} else {
|
|
if(result.count>1000){
|
|
$.messager.confirm('Confirm','Defective quantity greater than 1000, continue??',function(r) {
|
|
if (r){
|
|
console.log("首个序列号:"+badFirstSN);
|
|
console.log("最后一个序列号:"+badEndSN);
|
|
console.log("请求地址:"+doUrl);
|
|
$.post(doUrl, {firstSerialNo:badFirstSN,endSerialNo:badEndSN}, function(data){
|
|
$("#badOK").linkbutton({"disabled": false});
|
|
console.log(data);
|
|
refreshRollInfo(currentRoll);
|
|
if (data.success){
|
|
$('#dlg form').form('clear');
|
|
$('#dlg #rollNo_display').textbox({"value": currentRoll});
|
|
//2020-09-16 添加不良录入成功提示
|
|
$.messager.alert('Success','The defect has been reported successfully, the total qty is '+result.count, 'info');
|
|
}else{
|
|
$('#dlg').dialog('close'); // close the dialog
|
|
}
|
|
});
|
|
}else{
|
|
$("#badOK").linkbutton({"disabled": false});
|
|
$('#dlg').dialog('close');
|
|
}
|
|
});
|
|
}else{
|
|
$.post(doUrl, {firstSerialNo:badFirstSN,endSerialNo:badEndSN}, function(data){
|
|
$("#badOK").linkbutton({"disabled": false});
|
|
refreshRollInfo(currentRoll);
|
|
if (data.success){
|
|
$('#dlg form').form('clear');
|
|
$('#dlg #rollNo_display').textbox({"value": currentRoll});
|
|
//2020-09-16 添加不良录入成功提示
|
|
$.messager.alert('Success','The defect has been reported successfully, the total qty is '+result.count, 'info');
|
|
}else{
|
|
$('#dlg').dialog('close'); // close the dialog
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}else{
|
|
var result = $.parseJSON(result);
|
|
$("#badOK").linkbutton({"disabled": false});
|
|
if (result.errorMsg){
|
|
$.messager.alert('Error',result.errorMsg, 'error');
|
|
} else {
|
|
refreshRollInfo(currentRoll);
|
|
if (formPostUrl.indexOf("/bad/") >= 0 || formPostUrl.indexOf("/ipqc/") >= 0){
|
|
$('#dlg form').form('clear');
|
|
$('#dlg #rollNo_display').textbox({"value": currentRoll});
|
|
}else{
|
|
$('#dlg').dialog('close'); // close the dialog
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
$("#rollNo").on("keydown", function(){
|
|
if(event.keyCode == 13){
|
|
refreshRollInfo($.trim($(this).val()));
|
|
}
|
|
});
|
|
|
|
<#if RequestParameters.rollNo ??>
|
|
$(function(){
|
|
$("#rollNo").val("${RequestParameters.rollNo}");
|
|
refreshRollInfo("${RequestParameters.rollNo}");
|
|
});
|
|
</#if>
|
|
|
|
function doCreateRoll(){
|
|
if (currentOrder){
|
|
$.messager.confirm('Confirm','Are you sure to create new roll for the shop order <b>'+currentOrder.orderNo+'</b>? ',function(r) {
|
|
if (r){
|
|
$.post("/indigo/create_roll/do", {orderNo: currentOrder.orderNo}, function(data){
|
|
if (data.success && data.newRollNo){
|
|
$("#rollNo").val(data.newRollNo);
|
|
refreshRollInfo(data.newRollNo);
|
|
}
|
|
});
|
|
}
|
|
});
|
|
}
|
|
}
|
|
function slittingPrint() {
|
|
$.messager.confirm('Confirm','Is Printed ?',function(r){
|
|
if (r){
|
|
$("#ifmforprint").attr('src', "/print/rollnoSlitting/" + currentRollOp.operationNo + "/" + currentRoll + "/");
|
|
console.log("/print/rollnoSlitting/" + currentRollOp.operationNo + "/" + currentRoll + "/")
|
|
}
|
|
});
|
|
}
|
|
|
|
function refreshRollStatus(){
|
|
|
|
$.messager.confirm('Confirm','Are you sure to reverse all scanning data ?',function(r){
|
|
if (r){
|
|
$.post(urlPath+"/refreshRollStatus", {rollNo: currentRoll}, function(data){
|
|
if (data.success ){
|
|
|
|
refreshRollInfo($("#rollNo").val());
|
|
$.messager.alert('info',"Successfully",'info');
|
|
}else{
|
|
$.messager.alert('error',data.errorMsg,'error');
|
|
}
|
|
})
|
|
}
|
|
});
|
|
}
|
|
|
|
//回车触发事件
|
|
function refreshRollInfo(rollNo){
|
|
<#if func == "indigo">
|
|
$("#processNumber").val("10");
|
|
</#if>
|
|
<#if func == "abg">
|
|
$("#processNumber").val("20");
|
|
</#if>
|
|
<#if func == "aoi">
|
|
$("#processNumber").val("30");
|
|
</#if>
|
|
var $tblInfo = $("#tblInfo");
|
|
var $tblRollOpInfo = $("#tblRollOpInfo");
|
|
$tblInfo.html("");
|
|
$tblRollOpInfo.html("");
|
|
$.post(urlPath+"/getRoll", {rollNo: rollNo}, function(data){
|
|
if (data.success && data.roll){
|
|
//首卷是否完成了上料
|
|
showEl("#actions", data.showAction);
|
|
enableEl("#btnConfirm", data.enableConfirm);
|
|
enableEl("#btnStatus", data.enableStatus);
|
|
enableEl("#btnStart", data.enableStart);
|
|
enableEl("#btnSetup", data.enableSetup);
|
|
enableEl("#btnFai", data.enableFai);
|
|
enableEl("#btnEai", data.enableEai);
|
|
|
|
<#if func == "scanning">
|
|
showEl("#btnStart");
|
|
showEl("#btnSetup");
|
|
showEl("#btnFai");
|
|
showEl("#btnEai");
|
|
|
|
showEl("#btnBad");
|
|
</#if>
|
|
<#if currentUser.isAdmin || currentUser.authorities?contains("refreshRollStatus")>
|
|
enableEl("#refreshRollStatus", true);
|
|
</#if>
|
|
|
|
<#if func != "indigo">
|
|
|
|
enableEl("#btnBad",!data.scanStatus);
|
|
enableEl("#btnBadRange", !data.scanStatus);
|
|
enableEl("#printSlitting", data.rollOp && data.rollOp.remainSnCount);
|
|
</#if>
|
|
|
|
<#if func == "indigo">
|
|
enableEl("#scanMaterial", data.rollOp && data.enableScanMaterial);
|
|
//判断是否显示
|
|
if(data.rollOp && data.enableScanMaterialBatch){
|
|
$('#material_batch_wrap').show();
|
|
}else {
|
|
$('#material_batch_wrap').hide();
|
|
}
|
|
if(data.rollOp && data.enableScanMaterialNo){
|
|
$('#material_serial_wrap').show();
|
|
}else {
|
|
$('#material_serial_wrap').hide();
|
|
}
|
|
enableScanMaterialNo = data.enableScanMaterialNo;
|
|
</#if>
|
|
|
|
currentRoll = data.roll.rollNo;
|
|
currentRollOp = data.rollOp;
|
|
currentOrder=data.roll.order;
|
|
var rollNoDisplay = data.roll.rollNo;
|
|
if (data.rollOp && data.rollOp.remainSnCount){
|
|
rollNoDisplay = "<a target='forprint' href='/print/rollno/"+data.rollOp.operationNo+"/"+rollNoDisplay+"/'>"+rollNoDisplay+"</a>";
|
|
|
|
}
|
|
|
|
$tblInfo.append("<tr><td>SO No:</td><td>"+data.roll.orderNo+"</td></tr>");
|
|
$tblInfo.append("<tr><td>Roll No:</td><td>"+rollNoDisplay+"</td></tr>");
|
|
$tblInfo.append("<tr><td>Status</td><td>"+(data.roll.status || "-")+"</td></tr>");
|
|
$("#orderNo").val(data.roll.orderNo);
|
|
if (data.rollOpHtml){
|
|
$tblRollOpInfo.append(data.rollOpHtml);
|
|
}
|
|
|
|
if (data.prevCount){
|
|
$tblInfo.append("<tr><td>Serials Qty:</td><td>"+(data.prevCount)+"</td></tr>");
|
|
|
|
}
|
|
$tblInfo.append("<tr><td>Good Products Qty:</td><td>"+(data.qtyBad)+"</td></tr>");
|
|
$tblInfo.append("<tr><td>Defect Product Qty:</td><td>"+(data.qtyApprove)+"</td></tr>");
|
|
$tblInfo.append("<tr><td>Total Qty:</td><td>"+(data.qtyAll)+"</td></tr>");
|
|
if (data.prevCount){
|
|
$tblInfo.append("<tr><td>Different Qty:</td><td>"+(data.prevDifferent)+"</td></tr>");
|
|
|
|
}
|
|
if (data.badSns){
|
|
$tblInfo.append("<tr><td>Defective serial number:</td><td>"+(data.badSns.split(",").join("<br />") || "-")+"</td></tr>");
|
|
}
|
|
|
|
if (data.slittingRolls){
|
|
$tblInfo.append("<tr><td>Slitting Roll No:</td><td>"+(data.slittingRolls.split(",").join("<br />") || "-")+"</td></tr>");
|
|
}
|
|
|
|
checkWithWorkingOrder(data.roll.order.orderNo);
|
|
|
|
}else{
|
|
$tblInfo.append("<tr><td>"+data.errorMsg+"</td></tr>");
|
|
}
|
|
})
|
|
}
|
|
|
|
function checkWithWorkingOrder(orderNo) {
|
|
var workingOrder = $("#hdnWorkingOrder").val();
|
|
|
|
if (workingOrder != orderNo){
|
|
var msg = 'Are you sure to swith to the order <b>'+orderNo+'</b>?';
|
|
if (workingOrder != "") {
|
|
msg = 'The order of this roll does not match with the current order '+workingOrder+'.';
|
|
}
|
|
|
|
$("#tblInfo").html("");
|
|
$("#tblRollOpInfo").html("");
|
|
$("#actions").hide();
|
|
$.messager.alert("Error", msg, "error", function(){
|
|
$("#rollNo").val("").focus();
|
|
});
|
|
}
|
|
}
|
|
|
|
function getday(){
|
|
lay('.Selection_time').each(function(){
|
|
laydate.render({
|
|
elem: this
|
|
});
|
|
});
|
|
$('.Selection_time').val(getToday());
|
|
}
|
|
//获取当天日期
|
|
function getToday(){
|
|
var date = new Date();
|
|
var seperator1 = "-";
|
|
var year = date.getFullYear();
|
|
var month = date.getMonth() + 1;
|
|
var strDate = date.getDate();
|
|
if (month >= 1 && month <= 9) {
|
|
month = "0" + month;
|
|
}
|
|
if (strDate >= 0 && strDate <= 9) {
|
|
strDate = "0" + strDate;
|
|
}
|
|
var currentdate = year + seperator1 + month + seperator1 + strDate;
|
|
return currentdate;
|
|
}
|
|
|
|
//给单选事件加事件监听
|
|
$("#close_schedule_flag input[name='closed']").bind('change', function(){
|
|
$("#close_schedule_flag").find('input[name="closed"]').removeAttr('checked');
|
|
$(this).prop('checked', true);
|
|
});
|
|
//查询operator是否存在
|
|
/* function findOperator(operatorId,colsedFlag){
|
|
$.ajax({
|
|
url: "/rollop/findOperator",
|
|
type:"POST",
|
|
data: {"operatorId":operatorId},// 你的formid
|
|
dataType:"JSON",
|
|
success: function (data) {
|
|
parent.layer.closeAll();
|
|
if(data==false){
|
|
layer.msg("用户不存在!");
|
|
return false;
|
|
}else{
|
|
|
|
}
|
|
}
|
|
})
|
|
} */
|
|
|
|
$(function () {
|
|
$("#rollNo").focus();
|
|
})
|
|
|
|
//扫描材料上级
|
|
function scanMaterialModal(){
|
|
// 打开对话框
|
|
$('#scan_material_dlg').dialog('open').dialog('center').dialog('setTitle', "材料扫描");
|
|
$('#scan_material_batch').val('').focus();
|
|
// 根据 是否显示材料 显示/隐藏结束码包输入
|
|
if (enableScanMaterialNo){
|
|
$('#material_serial_wrap').show();
|
|
// 处理材料接料时候的最后的码包(EasyUI textbox 需绑定到内部输入框)
|
|
$('#material_serial_no').textbox('setValue','');
|
|
var $serialIn = $('#material_serial_no').textbox('textbox');
|
|
//事件绑定
|
|
$serialIn.off('keydown.serial_in').on('keydown.serial_in', function(e){
|
|
if (e.which === 13) {
|
|
e.preventDefault();
|
|
scanSoRollMaterialBatch(true);
|
|
}
|
|
});
|
|
}else{
|
|
//$('#material_serial_wrap').hide();
|
|
}
|
|
// 触发布局重算,避免底部灰色残留
|
|
$('#scan_material_dlg').dialog('resize');
|
|
$('#scan_material_list').datagrid('resize');
|
|
// 初始化/刷新列表
|
|
$("#scan_material_list").datagrid({
|
|
url: "/material/querySoRollMaterialBatchs",
|
|
type: "POST",
|
|
dataType: "JSON",
|
|
queryParams: {
|
|
orderNo: currentOrder.orderNo,
|
|
rollNo: currentRoll,
|
|
operationNo: 10
|
|
}
|
|
});
|
|
}
|
|
|
|
//提交材料扫描(Enter 或 按钮)
|
|
function scanSoRollMaterialBatch(snFlag){
|
|
var rawStr = $.trim($('#scan_material_batch').val());
|
|
//检查
|
|
if(rawStr == null || "" == rawStr){
|
|
$.messager.alert('error','请扫描或输入材料条码','info');
|
|
$('#scan_material_batch').focus();
|
|
return;
|
|
}
|
|
//检查是否是接料 接料的时候必须输入码包号
|
|
if (enableScanMaterialNo && snFlag){
|
|
//继续往下走
|
|
}else if (enableScanMaterialNo && !snFlag){
|
|
$('#material_serial_no').textbox('setValue','');
|
|
$('#material_serial_no').textbox('textbox').focus();
|
|
return;
|
|
}
|
|
//拆分数据
|
|
var parts = rawStr.split(";");
|
|
//检查
|
|
// 至少需要8个字段 或者两个字段
|
|
if (!(parts.length == 2 || parts.length == 9)) {
|
|
$.messager.alert('error','材料批次数据有误!','info');
|
|
return null;
|
|
}
|
|
let endScanMaterialSerialNo = $.trim($('#material_serial_no').val());
|
|
$('#scan_material_batch').val('');
|
|
$('#material_serial_no').textbox('setValue','');
|
|
//组装数据
|
|
var resultRow = {"orderNo": currentOrder.orderNo, "operationNo": 10, "operationName": "Indigo", "rollNo": currentRoll,
|
|
"qrCode": rawStr, "scanSerialFlag": enableScanMaterialNo, "endSerialNo": endScanMaterialSerialNo, "username": username};
|
|
|
|
$.ajax({
|
|
url: "/material/scanSoRollMaterialBatch",
|
|
type: "POST",
|
|
dataType: "JSON",
|
|
async: false,
|
|
contentType: "application/json",
|
|
data: JSON.stringify(resultRow),
|
|
success: function (data) {
|
|
if(data && data.success){
|
|
$('#scan_material_batch').val('').focus();
|
|
$('#material_serial_no').textbox('setValue','');
|
|
$('#scan_material_list').datagrid('reload');
|
|
$.messager.show({title: 'Point',
|
|
msg: data.resultMsg,
|
|
timeout: 1500,
|
|
showType: 'slide'});
|
|
}else if(data && data.resultCode == 201){
|
|
$('#scan_material_batch').val('').focus();
|
|
$('#material_serial_no').textbox('setValue','');
|
|
$('#scan_material_list').datagrid('reload');
|
|
}else{
|
|
$.messager.alert('error', data.resultMsg || '扫描失败','error');
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
// 在文本域按Enter提交(简洁写法)
|
|
$('#scan_material_batch').keypress(function(e){
|
|
if(e.which === 13){
|
|
e.preventDefault();
|
|
scanSoRollMaterialBatch(false);
|
|
}
|
|
});
|
|
|
|
</script>
|
|
|
|
</@master.layout>
|
|
|