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.
855 lines
36 KiB
855 lines
36 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="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="btnBad" onclick="doBadModal()" class="btn btn-default">Type defective serial number</button></p>
|
|
<p><button id="btnBadRange" onclick="doBadRangeModal()" class="btn btn-default">Batch defective serial number</button></p>
|
|
</#if>
|
|
<#-- <#if func?is_string && func == "aoi">-->
|
|
<p><button id="btnSlitting" onclick="showSlittingRolls()" class="btn btn-default">Slit roll</button></p>
|
|
<#--<p><button id="btnSlittingConfirm" onclick="showSlittingConfirm()" class="btn btn-default">卷确认</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 class="modal fade" id="report_modal" tabindex="-1" role="dialog"
|
|
aria-labelledby="myModalLabel" aria-hidden="true" style="font-size:10px;">
|
|
<div class="modal-dialog" style="width:430px;height:300px;">
|
|
<div class="modal-content" >
|
|
<div class="modal-body">
|
|
<form id="report_form" class="form-horizontal" action="" method="post">
|
|
<fieldset>
|
|
<div id="legend" class="">
|
|
<input type="hidden" value="0" name="currentScheduleId" id="current_schedule_id">
|
|
<legend class="">报告产量</legend>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="col-sm-2 control-label" style = "width: 20%;">机台</label>
|
|
<div class="col-sm-4" style = "width: 30%;">
|
|
<select id="report_resource_id" class="form-control" name="resourceId" style="width:100px;font-size:12px;">
|
|
</select>
|
|
</div>
|
|
<label class="col-sm-2 control-label" style = "width: 20%;">人员</label>
|
|
<div class="col-sm-4" style = "width: 20%;">
|
|
<input id="report_person" type="text" class="form-control" name="person" readonly style="width:100px;font-size:12px;">
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="col-sm-2 control-label" style = "width: 20%;"><span>Production Date</span></label>
|
|
<div class="col-sm-4" style = "width: 30%;">
|
|
<input id="produce_date" type="text" class="form-control Selection_time" name="produceDate" style="width:100px;font-size:12px;">
|
|
</div>
|
|
<label class="col-sm-2 control-label" style = "width: 20%;">班次</label>
|
|
<div class="col-sm-4" style = "width: 20%;">
|
|
<select id="report_shift_no" class="form-control" name="shiftNo" style="width:100px;font-size:12px;">
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="col-sm-2 control-label" style = "width: 20%;">派工数量</label>
|
|
<div class="col-sm-4" style = "width: 30%;">
|
|
<input id="qty_required" class="form-control" name="qtyRequired" readonly style="width:100px;font-size:12px;">
|
|
</div>
|
|
<label class="col-sm-2 control-label" style = "width: 20%;">已报告数量</label>
|
|
<div class="col-sm-4" style = "width: 20%;">
|
|
<input id="qty_reported" type="number" class="form-control" name="qtyReported" readonly style="width:100px;font-size:12px;">
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="col-sm-2 control-label" style = "width: 20%;">良品数量</label>
|
|
<div class="col-sm-4" style = "width: 30%;">
|
|
<input id="qty_approved" type="number" class="form-control count_nums" name="qtyApproved" readonly style="width:100px;font-size:12px;">
|
|
</div>
|
|
<label class="col-sm-2 control-label" style = "width: 20%;">不良品数量</label>
|
|
<div class="col-sm-4" style = "width: 20%;">
|
|
<input id="qty_scrapped" type="number" class="form-control count_nums" name="qtyScrapped" readonly style="width:100px;font-size:12px;">
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="col-sm-2 control-label" style = "width: 20%;">报告总数量</label>
|
|
<div class="col-sm-4" style = "width: 30%;">
|
|
<input id="current_report_qty" type="number" class="form-control" name="currentReportTotalQty" readonly style="width:100px;font-size:12px;">
|
|
</div>
|
|
<label class="col-sm-2 control-label" style = "width: 20%;">生产时间</label>
|
|
<div class="col-sm-4" style = "width: 20%;">
|
|
<input id="produce_time" type="number" class="form-control count_nums" name="produceTime" style="width:100px;font-size:12px;">
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="col-sm-3 control-label">关闭派工单</label>
|
|
<div class="col-sm-9" id="close_schedule_flag">
|
|
<div class="checkbox checkbox-info checkbox-circle" style="margin-left: 20px;">
|
|
<input name="closed" value="0" type="checkbox" checked="" style="margin-top: -0.5px;">
|
|
<label for="checkbox1">是</label>
|
|
</div>
|
|
<div class="checkbox checkbox-info checkbox-circle" style="margin-top: -27px; margin-left: 100px;">
|
|
<input name="closed" value="1" type="checkbox" style="margin-top: -0.5px;">
|
|
<label for="checkbox2">否</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</fieldset>
|
|
</form>
|
|
</div>
|
|
<div class="modal-footer" style="TEXT-ALIGN: center;margin-top:-20px;">
|
|
<div class="control-group">
|
|
<!-- Button -->
|
|
<div class="controls">
|
|
<button onclick="reportSchedule()" class="btn btn-success" style="font-size:12px;">Confirm</button>
|
|
<button id="report_cancel" data-dismiss="modal" class="btn btn-success" style="font-size:12px;">取消</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="endWork-buttons" style="display: none;">
|
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="doOK()" style="width:90px">OK</a>
|
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#endWork').dialog('close')" style="width:90px">Cancel</a>
|
|
</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-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-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-bad').dialog('close')" style="width:90px">Cancel</a>
|
|
</div>
|
|
|
|
<!-- 批量不良 -->
|
|
<div id="dlg-batch-bad" class="easyui-dialog for-scan" style="width:500px;display: none;" closed="true" buttons="#dlg-batch-bad-buttons">
|
|
<form id="fm-batch-bad" method="post" novalidate style="margin:0; padding: 20px 20px;">
|
|
<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-batch-bad-buttons" style="display: none;">
|
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" id="badOK" onclick="countBadRange()" style="width:90px">OK</a>
|
|
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg-batch-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="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:120,formatter:formatLodopPrint('slittingNo')">Slitting Roll No</th>
|
|
<th data-options="field:'serialScope',width:260">序列号范围</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>
|
|
|
|
|
|
<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>
|
|
var formPostUrl="";
|
|
var currentRoll="";
|
|
var currentRollOp = {};
|
|
var currentOrder={};
|
|
var urlPath="/rollop/${func}";
|
|
var work_center_data;
|
|
var temp_row;
|
|
var doUrl = "";
|
|
var flag = "N";
|
|
var workingOrder;
|
|
let currentItemNo = 30;
|
|
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 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(){
|
|
$("#dlg #firstSerialNo").textbox({disabled:false});
|
|
flag = "N";
|
|
showDialog("Scan", 1, "/start/do");
|
|
}
|
|
|
|
function doSetup(){
|
|
flag = "N";
|
|
$("#dlg #firstSerialNo").textbox({disabled:true});
|
|
showDialog("Scan/setup", 2, "/setup/do");
|
|
$("#dlg #firstSerialNo").textbox({value: currentRollOp.toSetupSerialNo || ""});
|
|
}
|
|
|
|
function doFai(){
|
|
flag = "N";
|
|
$("#dlg #firstSerialNo").textbox({disabled:false});
|
|
showDialog("Scan/first off", 2, "/fai/do");
|
|
}
|
|
|
|
function doEai(){
|
|
flag = "N";
|
|
$("#dlg #firstSerialNo").textbox({disabled:false});
|
|
showDialog("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 == "aoi">
|
|
$("#processNumber").val("30");
|
|
</#if>
|
|
var $tblInfo = $("#tblInfo");
|
|
var $tblRollOpInfo = $("#tblRollOpInfo");
|
|
$tblInfo.html("");
|
|
$tblRollOpInfo.html("");
|
|
let requestParam = {'orderNo': workingOrder, 'rollNo': rollNo, 'func': 'aoi'};
|
|
$.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 == "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>
|
|
|
|
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) {
|
|
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;
|
|
}
|
|
|
|
|
|
$(function () {
|
|
$("#rollNo").focus();
|
|
})
|
|
|
|
|
|
//首件扫号的modal
|
|
function doBadModal(){
|
|
$('#dlg-bad').dialog('open').dialog('center').dialog('setTitle', 'Type defective serial number');
|
|
$('#dlg-bad form').form('clear');
|
|
}
|
|
|
|
//modal打开关闭选中的箱
|
|
$("#dlg-bad").dialog({
|
|
onOpen: function(){
|
|
//获取焦点
|
|
//showEl("#dlg #input_roll", true);
|
|
$('#bad_serialNo').textbox('textbox').focus();
|
|
}
|
|
});
|
|
|
|
/* 新增不良批量 2024-06-25 LR */
|
|
function doBadRangeModal(){
|
|
$('#dlg-batch-bad').dialog('open').dialog('center').dialog('setTitle', 'Batch defective serial number');
|
|
$('#dlg-batch-bad form').form('clear');
|
|
}
|
|
|
|
//modal打开关闭选中的箱
|
|
$("#dlg-batch-bad").dialog({
|
|
onOpen: function(){
|
|
//获取焦点
|
|
$('#start_bad_serial').textbox('textbox').focus();
|
|
}
|
|
});
|
|
|
|
|
|
//单个不良方法
|
|
function doSingleBad(){
|
|
//各种参数
|
|
let rollNo = $("#rollNo").val();
|
|
let serialNo = $('#bad_serialNo').textbox('getValue');
|
|
//组装参数
|
|
let badParam = {'orderNo': workingOrder, 'itemNo': currentItemNo, 'rollNo': rollNo, 'username': username, 'serialNo': serialNo};
|
|
//请求参数
|
|
$.ajax({
|
|
url: "/abg/doSingleBad",
|
|
type:"POST",
|
|
data: badParam,
|
|
dataType:"JSON",
|
|
success: function (data) {
|
|
if(data.success){
|
|
//刷新当前的页面
|
|
refreshRollInfo(rollNo);
|
|
//关闭弹窗
|
|
//$('#dlg-bad').dialog('close');
|
|
//清空历史数据
|
|
$('#dlg-bad form').form('clear');
|
|
// $.messager.alert("info",data.msg,"info",);
|
|
}else{
|
|
$.messager.alert("Error",data.msg,"Error",);
|
|
}
|
|
}
|
|
})
|
|
}
|
|
|
|
//2024-06-25 LR 后续增加的代码
|
|
function countBadRange(){
|
|
//各种参数
|
|
let rollNo = $("#rollNo").val();
|
|
let firstSerialNo = $("#start_bad_serial").textbox('getValue').trim();
|
|
let endSerialNo = $("#end_bad_serial").textbox('getValue').trim();
|
|
|
|
//组装参数
|
|
let countParam = {'orderNo': workingOrder, 'itemNo': currentItemNo, 'rollNo': rollNo, 'firstSerialNo': firstSerialNo, 'endSerialNo': endSerialNo, 'username': username};
|
|
//请求参数
|
|
$.ajax({
|
|
url: "/abg/countBadRange",
|
|
//contentType: 'application/json',
|
|
type:"POST",
|
|
//data:JSON.stringify(inData),
|
|
data: countParam,
|
|
dataType:"JSON",
|
|
success: function (data) {
|
|
if(data.success){
|
|
//判断数量的限制
|
|
if(data.count > 0){
|
|
$.messager.confirm('Confirm', 'Defect Qty:'+data.count+',If 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').trim();
|
|
let endSerialNo = $("#end_bad_serial").textbox('getValue').trim();
|
|
|
|
//组装参数
|
|
let badParam = {'orderNo': workingOrder, 'itemNo': currentItemNo, 'rollNo': rollNo, 'firstSerialNo': firstSerialNo, 'endSerialNo': endSerialNo, 'username': username};
|
|
//请求参数
|
|
$.ajax({
|
|
url: "/abg/createBadRange",
|
|
type:"POST",
|
|
data: badParam,
|
|
dataType:"JSON",
|
|
success: function (data) {
|
|
if(data.success){
|
|
//$('#dlg-batch-bad').dialog('close');
|
|
//清空页面的数据
|
|
$('#dlg-batch-bad form').form('clear');
|
|
//刷新当前的页面
|
|
refreshRollInfo(rollNo);
|
|
}else{
|
|
$.messager.alert("Error",data.msg,"Error",);
|
|
}
|
|
}
|
|
})
|
|
}
|
|
|
|
</script>
|
|
|
|
</@master.layout>
|
|
|