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.
1036 lines
39 KiB
1036 lines
39 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>
|
|
<p><button id="btnStart" onclick="doStart()" class="btn btn-default">Scan</button></p>
|
|
<p><button id="btnSetup" onclick="doSetupModal()" class="btn btn-default">Scan/setup</button></p>
|
|
<p><button id="btnFai" onclick="doFaiModal()" class="btn btn-default">Scan/first off</button></p>
|
|
<p><button id="btnCut" onclick="showCutRolls()" class="btn btn-default">Slit roll</button></p>
|
|
<p><button id="btnEai" onclick="doEaiConfirm()" 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 != "indigo">
|
|
<p><button id="btnBad" onclick="doBadModal()" 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> -->
|
|
<p><button id="btnBadRange" onclick="newDoBadRange()" 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%">
|
|
</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="dlg-bad" class="easyui-dialog for-scan" style="width:500px;display: none;" closed="true" buttons="#dlg-bad-buttons">
|
|
<form id="fm" method="post" novalidate style="margin:0; padding: 20px 20px;">
|
|
<div style="margin-bottom:10px">
|
|
<label id="show_roll_no" class="easyui-textbox" data-options="labelWidth:100, disabled:true" required="true" label="Roll No:" style="width:100%">
|
|
</div>
|
|
<div style="margin-bottom:10px">
|
|
<input id="start_bad_serial" name="firstSerialNo" class="easyui-textbox" required="true" data-options="labelWidth:100" label="开始序列号:" style="width:100%">
|
|
</div>
|
|
<div style="margin-bottom:10px">
|
|
<input id="end_bad_serial" name="endSerialNo" class="easyui-textbox" required="true" data-options="labelWidth:100" label="结束序列号:" style="width:100%">
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<div id="dlg-bad-buttons" style="display: none;">
|
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" id="badOK" onclick="countBadSerials()" style="width:90px">OK</a>
|
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg-bad').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="dlg-cut" class="easyui-dialog" style="width:800px;display: none;" closed="true" data-options="modal:true, " >
|
|
<div style="margin-bottom:10px; margin-left: 20px; margin-top: 10px;">
|
|
<input id="end_serial_no" name="endSerialNo" class="easyui-textbox" required="true" label="结束序列号:" style="width:60%">
|
|
<a href="javascript:void(0)" id="tbAdd" class="easyui-linkbutton" iconCls="icon-add" onclick="doCutting()">Create Slitting Roll</a>
|
|
</div>
|
|
<table id="dlg-cut-rolls" class="easyui-datagrid" style="width:100%;height:300px;display: none;"
|
|
data-options="pagination: false, showFooter: true, singleSelect:true, fitColumns:true , method:'post', pageSize:500,">
|
|
<thead>
|
|
<tr>
|
|
<th data-options="field:'cutRollNo',width:80,">Slitting Roll No</th>
|
|
<th data-options="field:'rollNo',width:80,">Roll No</th>
|
|
<th data-options="field:'startRow',width:60">From Row No</th>
|
|
<th data-options="field:'endRow',width:60">To Row No</th>
|
|
<th data-options="field:'columnSortIndex',width:80">No. of Cross</th>
|
|
<th data-options="field:'id',width:30, formatter: formatCutRollButton">Actions</th>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
</div>
|
|
|
|
<!-- 单个不良 -->
|
|
<div id="dlg-single-bad" class="easyui-dialog for-scan" style="width:500px;display: none;" closed="true" buttons="#dlg-single-bad-buttons">
|
|
<form id="fm-bad" method="post" novalidate style="margin:0;padding:20px 20px">
|
|
<div style="margin-bottom:10px">
|
|
<input id="bad_serialNo" name="serialNo" class="easyui-textbox" required="true" data-options="labelWidth:100" label="Defective serial number:" style="width:100%">
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div id="dlg-single-bad-buttons" style="display: none;">
|
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" id="badOK" onclick="doSingleBad()" style="width:90px">OK</a>
|
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg-single-bad').dialog('close')" style="width:90px">Cancel</a>
|
|
</div>
|
|
|
|
<!-- 调机扫号 -->
|
|
<div id="dlg-setup" class="easyui-dialog for-scan" style="width:500px;display: none;" closed="true" buttons="#dlg-setup-buttons">
|
|
<form id="fm-setup" method="post" novalidate style="margin:0;padding:20px 20px">
|
|
|
|
<div style="margin-bottom:10px">
|
|
<input id="setup_firstSerialNo" name="firstSerialNo" class="easyui-textbox" disabled="disabled" data-options="labelWidth:100" label="The first serial number:" style="width:100%">
|
|
</div>
|
|
|
|
<div style="margin-bottom:10px">
|
|
<input id="setup_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-setup-buttons" style="display: none;">
|
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" id="badOK" onclick="doSetup()" style="width:90px">OK</a>
|
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg-setup').dialog('close')" style="width:90px">Cancel</a>
|
|
</div>
|
|
|
|
<!-- 首件扫号 -->
|
|
<div id="dlg-fai" class="easyui-dialog for-scan" style="width:500px;display: none;" closed="true" buttons="#dlg-fai-buttons">
|
|
<form id="fm-fai" method="post" novalidate style="margin:0;padding:20px 20px">
|
|
|
|
<div style="margin-bottom:10px">
|
|
<input id="fai_firstSerialNo" name="firstSerialNo" class="easyui-textbox" required="true" data-options="labelWidth:100" label="The first serial number:" style="width:100%">
|
|
</div>
|
|
|
|
<div style="margin-bottom:10px">
|
|
<input id="fai_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-fai-buttons" style="display: none;">
|
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" id="badOK" onclick="doFai()" style="width:90px">OK</a>
|
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg-fai').dialog('close')" style="width:90px">Cancel</a>
|
|
</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 src="/laydate/laydate.js"></script>
|
|
<script type="text/javascript" src="/js/layer/layer.js"></script>
|
|
<script src='http://127.0.0.1:8000/CLodopfuncs.js'></script>
|
|
<script type="text/javascript" src="/js/print/print_label.js"></script>
|
|
<script>
|
|
var formPostUrl="";
|
|
var currentRoll="";
|
|
var currentRollOp = {};
|
|
var currentOrder={};
|
|
var urlPath="/rollop/${func}";
|
|
var work_center_data;
|
|
var temp_row;
|
|
var doUrl = "";
|
|
var flag = "N";
|
|
let currentPrinter = ${currentPrinter};
|
|
let clodoplisence = '${clodoplisence}';
|
|
|
|
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;
|
|
}
|
|
|
|
/* 打开批量不良的数据 */
|
|
function showBadDialog(title){
|
|
$('#dlg-bad').dialog('open').dialog('center').dialog('setTitle',title);
|
|
$('#dlg-bad form').form('clear');
|
|
$('#dlg-bad #show_roll_no').textbox({"value": 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(){
|
|
$.ajax({
|
|
url: "/aoi/slitting/updateStatus",
|
|
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){
|
|
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});
|
|
}
|
|
//打开分切卷的数据 LR 2024-06-25
|
|
function showCutRolls(){
|
|
//各种参数
|
|
let rollNo = $("#rollNo").val();
|
|
$('#dlg-cut').dialog('open').dialog('center').dialog('setTitle',"Slit roll");
|
|
$("#dlg-cut-rolls").datagrid({
|
|
url: "/cut/getCutRolls",
|
|
queryParams: {
|
|
rollNo: rollNo,
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
//modal打开关闭选中的箱
|
|
$("#dlg-cut").dialog({
|
|
onOpen: function(){
|
|
//获取焦点
|
|
//showEl("#dlg #input_roll", true);
|
|
$('#end_serial_no').textbox('setValue', '');
|
|
$('#end_serial_no').textbox('textbox').focus();
|
|
}
|
|
});
|
|
|
|
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";
|
|
showDialog("Scan", 1, "/start/do");
|
|
}
|
|
|
|
/* 调机扫号 */
|
|
function doSetupModal(){
|
|
$('#dlg-setup').dialog('open').dialog('center').dialog('setTitle', 'Scan/setup');
|
|
$('#dlg-setup form').form('clear');
|
|
//设置数据
|
|
$("#setup_firstSerialNo").textbox({value: currentRollOp.toSetupSerialNo || ""});
|
|
$("#setup_firstSerialNo").textbox({disabled:true});
|
|
}
|
|
|
|
//modal打开关闭选中的箱
|
|
$("#dlg-setup").dialog({
|
|
onOpen: function(){
|
|
//获取焦点
|
|
//showEl("#dlg #input_roll", true);
|
|
$('#setup_endSerialNo').textbox('textbox').focus();
|
|
}
|
|
});
|
|
|
|
//首件扫号的modal
|
|
function doFaiModal(){
|
|
$('#dlg-fai').dialog('open').dialog('center').dialog('setTitle', 'Scan/first off');
|
|
$('#dlg-fai form').form('clear');
|
|
//设置数据
|
|
}
|
|
|
|
//modal打开关闭选中的箱
|
|
$("#dlg-fai").dialog({
|
|
onOpen: function(){
|
|
//获取焦点
|
|
//showEl("#dlg #input_roll", true);
|
|
$('#fai_firstSerialNo').textbox('textbox').focus();
|
|
}
|
|
});
|
|
|
|
|
|
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");
|
|
}
|
|
|
|
/* 新增不良批量 2024-06-25 LR */
|
|
function newDoBadRange(){
|
|
showBadDialog("Batch defective serial number");
|
|
}
|
|
|
|
|
|
|
|
|
|
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 == "thermal">
|
|
$("#processNumber").val("15");
|
|
</#if>
|
|
<#if func == "cut">
|
|
$("#processNumber").val("18");
|
|
</#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("");
|
|
let requestParam = {'orderNo': workingOrder, 'rollNo': rollNo, 'func': 'cut'};
|
|
$.post("/rollop/newGetRoll", requestParam, 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);
|
|
enableEl("#btnBad", data.enableBad);
|
|
//判断是否打开当前的卷
|
|
<#if func == "cut">
|
|
enableEl("#btnCut", data.enableCut);//2024-07-05 LR添加分卷
|
|
</#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>
|
|
|
|
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.msg+"</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();
|
|
})
|
|
|
|
//2024-06-25 LR 后续增加的代码
|
|
function countBadSerials(){
|
|
//各种参数
|
|
let rollNo = $("#rollNo").val();
|
|
let firstSerialNo = $("#start_bad_serial").textbox('getValue');
|
|
let endSerialNo = $("#end_bad_serial").textbox('getValue');
|
|
|
|
//组装参数
|
|
let countParam = {'orderNo': workingOrder, 'rollNo': rollNo, 'firstSerialNo': firstSerialNo, 'endSerialNo': endSerialNo, 'username': username};
|
|
//请求参数
|
|
$.ajax({
|
|
url: "/cut/countBadRange",
|
|
//contentType: 'application/json',
|
|
type:"POST",
|
|
//data:JSON.stringify(inData),
|
|
data: countParam,
|
|
dataType:"JSON",
|
|
success: function (data) {
|
|
if(data.success){
|
|
//判断数量的限制
|
|
if(data.count > 1000){
|
|
$.messager.confirm('Confirm', 'Defective quantity greater than 1000, continue??', function(r) {
|
|
if (r){
|
|
//调用提交方法
|
|
createBadRange();
|
|
}
|
|
});
|
|
}else{
|
|
//调用提交方法
|
|
createBadRange();
|
|
}
|
|
}else{
|
|
$.messager.alert("Error",data.msg,"Error",);
|
|
}
|
|
}
|
|
})
|
|
}
|
|
|
|
//批量创建不良
|
|
function createBadRange(){
|
|
//各种参数
|
|
let rollNo = $("#rollNo").val();
|
|
let firstSerialNo = $("#start_bad_serial").textbox('getValue');
|
|
let endSerialNo = $("#end_bad_serial").textbox('getValue');
|
|
|
|
//组装参数
|
|
let badParam = {'orderNo': workingOrder, 'rollNo': rollNo, 'firstSerialNo': firstSerialNo, 'endSerialNo': endSerialNo, 'username': username};
|
|
//请求参数
|
|
$.ajax({
|
|
url: "/cut/createBadRange",
|
|
//contentType: 'application/json',
|
|
type:"POST",
|
|
//data:JSON.stringify(inData),
|
|
data: badParam,
|
|
dataType:"JSON",
|
|
success: function (data) {
|
|
if(data.success){
|
|
//$('#dlg-bad').dialog('close');
|
|
$('#dlg-bad form').form('clear');
|
|
$('#dlg-bad #show_roll_no').textbox({"value": currentRoll});
|
|
//刷新当前的页面
|
|
refreshRollInfo(rollNo);
|
|
}else{
|
|
$.messager.alert("Error",data.msg,"Error",);
|
|
}
|
|
}
|
|
})
|
|
}
|
|
|
|
//分切卷的功能
|
|
function formatCutRollButton(value, row){
|
|
let tags = '';
|
|
tags += '<a style="text-decoration:none;" onclick="cacheCutRollPrintData(\''+row.cutRollNo+'\')">补打标签</a>';
|
|
return tags;
|
|
}
|
|
|
|
//调用方法打印标签
|
|
function cacheCutRollPrintData(cutRollNo){
|
|
let printParam = {'rollNo': cutRollNo}
|
|
//请求参数
|
|
$.ajax({
|
|
url: "/cut/cacheCutRollPrintData",
|
|
//contentType: 'application/json',
|
|
type:"POST",
|
|
//data:JSON.stringify(inData),
|
|
data: printParam,
|
|
dataType: "JSON",
|
|
success: function (data) {
|
|
if(data.success){
|
|
currentPrinter.clodoplisence = clodoplisence;
|
|
printCutRollLabel(JSON.parse(data.printData), currentPrinter);
|
|
}else{
|
|
$.messager.alert("Error",data.msg,"Error",);
|
|
}
|
|
}
|
|
})
|
|
}
|
|
|
|
//创建分切卷
|
|
function doCutting(){
|
|
//各种参数
|
|
let rollNo = $("#rollNo").val();
|
|
let endSerialNo = $("#end_serial_no").textbox('getValue');
|
|
|
|
//组装参数
|
|
let cutParam = {'orderNo': workingOrder, 'rollNo': rollNo, 'endSerialNo': endSerialNo, 'username': username};
|
|
//请求参数
|
|
$.ajax({
|
|
url: "/cut/createCutRoll",
|
|
//contentType: 'application/json',
|
|
type:"POST",
|
|
//data:JSON.stringify(inData),
|
|
data: cutParam,
|
|
dataType:"JSON",
|
|
success: function (data) {
|
|
if(data.success){
|
|
currentPrinter.clodoplisence = clodoplisence;
|
|
printCutRollLabel(JSON.parse(data.printData), currentPrinter);
|
|
//刷新表格
|
|
$('#dlg-cut-rolls').datagrid('reload');
|
|
$('#end_serial_no').textbox('setValue', '');
|
|
$('#end_serial_no').textbox('textbox').focus();
|
|
}else{
|
|
$.messager.alert("Error",data.msg,"Error",);
|
|
}
|
|
}
|
|
})
|
|
}
|
|
|
|
//确认是否末件扫号
|
|
function doEaiConfirm(){
|
|
$.messager.confirm('Confirm', '确认所有分卷已创建完成?', function(r) {
|
|
if (r){
|
|
//调用提交方法
|
|
doEai();
|
|
}
|
|
});
|
|
}
|
|
|
|
//提交的方法
|
|
function doEai(){
|
|
//各种参数
|
|
let rollNo = $("#rollNo").val();
|
|
|
|
//组装参数
|
|
let eaiParam = {'orderNo': workingOrder, 'rollNo': rollNo, 'username': username};
|
|
//请求参数
|
|
$.ajax({
|
|
url: "/cut/doEai",
|
|
//contentType: 'application/json',
|
|
type:"POST",
|
|
//data:JSON.stringify(inData),
|
|
data: eaiParam,
|
|
dataType:"JSON",
|
|
success: function (data) {
|
|
if(data.success){
|
|
//$.messager.alert("info",data.msg,"info",);
|
|
//刷新当前的页面
|
|
refreshRollInfo(rollNo);
|
|
}else{
|
|
$.messager.alert("Error",data.msg,"Error",);
|
|
}
|
|
}
|
|
})
|
|
|
|
}
|
|
|
|
//单个不良方法
|
|
function doSingleBad(){
|
|
//各种参数
|
|
let rollNo = $("#rollNo").val();
|
|
let serialNo = $('#bad_serialNo').textbox('getValue');
|
|
|
|
//组装参数
|
|
let badParam = {'orderNo': workingOrder, 'rollNo': rollNo, 'username': username, 'serialNo': serialNo};
|
|
//请求参数
|
|
$.ajax({
|
|
url: "/cut/doSingleBad",
|
|
type:"POST",
|
|
data: badParam,
|
|
dataType:"JSON",
|
|
success: function (data) {
|
|
if(data.success){
|
|
//刷新当前的页面
|
|
refreshRollInfo(rollNo);
|
|
//关闭弹窗
|
|
//$('#dlg-single-bad').dialog('close');
|
|
$('#dlg-single-bad form').form('clear');
|
|
//$.messager.alert("info",data.msg,"info",);
|
|
}else{
|
|
$.messager.alert("Error",data.msg,"Error",);
|
|
}
|
|
}
|
|
})
|
|
}
|
|
|
|
//首件扫号的modal
|
|
function doBadModal(){
|
|
$('#dlg-single-bad').dialog('open').dialog('center').dialog('setTitle', 'Type defective serial number');
|
|
$('#dlg-single-bad form').form('clear');
|
|
}
|
|
|
|
//modal打开关闭选中的箱
|
|
$("#dlg-single-bad").dialog({
|
|
onOpen: function(){
|
|
//获取焦点
|
|
//showEl("#dlg #input_roll", true);
|
|
$('#bad_serialNo').textbox('textbox').focus();
|
|
}
|
|
});
|
|
|
|
//开工扫号的方法
|
|
function doSetup(){
|
|
//各种参数
|
|
let rollNo = $("#rollNo").val();
|
|
let firstSerialNo = $('#setup_firstSerialNo').textbox('getValue');
|
|
let endSerialNo = $('#setup_endSerialNo').textbox('getValue');
|
|
|
|
//组装参数
|
|
let setupParam = {'orderNo': workingOrder, 'rollNo': rollNo, 'username': username, 'firstSerialNo': firstSerialNo, 'endSerialNo': endSerialNo};
|
|
//请求参数
|
|
$.ajax({
|
|
url: "/cut/doSetup",
|
|
//contentType: 'application/json',
|
|
type:"POST",
|
|
//data:JSON.stringify(inData),
|
|
data: setupParam,
|
|
dataType:"JSON",
|
|
success: function (data) {
|
|
if(data.success){
|
|
//刷新当前的页面
|
|
refreshRollInfo(rollNo);
|
|
//关闭弹窗
|
|
$('#dlg-setup').dialog('close');
|
|
//$.messager.alert("info",data.msg,"info",);
|
|
}else{
|
|
$.messager.alert("Error",data.msg,"Error",);
|
|
}
|
|
}
|
|
})
|
|
}
|
|
|
|
//开工扫号的方法
|
|
function doFai(){
|
|
//各种参数
|
|
let rollNo = $("#rollNo").val();
|
|
let firstSerialNo = $('#fai_firstSerialNo').textbox('getValue');
|
|
let endSerialNo = $('#fai_endSerialNo').textbox('getValue');
|
|
|
|
//组装参数
|
|
let setupParam = {'orderNo': workingOrder, 'rollNo': rollNo, 'username': username, 'firstSerialNo': firstSerialNo, 'endSerialNo': endSerialNo};
|
|
//请求参数
|
|
$.ajax({
|
|
url: "/cut/doFai",
|
|
//contentType: 'application/json',
|
|
type:"POST",
|
|
//data:JSON.stringify(inData),
|
|
data: setupParam,
|
|
dataType:"JSON",
|
|
success: function (data) {
|
|
if(data.success){
|
|
//刷新当前的页面
|
|
refreshRollInfo(rollNo);
|
|
//关闭弹窗
|
|
$('#dlg-fai').dialog('close');
|
|
//$.messager.alert("info",data.msg,"info",);
|
|
}else{
|
|
$.messager.alert("Error",data.msg,"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');
|
|
}
|
|
}
|
|
})
|
|
}
|
|
</script>
|
|
|
|
</@master.layout>
|
|
|