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.
323 lines
13 KiB
323 lines
13 KiB
<#import "../master.ftl" as master>
|
|
<@master.layout>
|
|
<style>
|
|
#fm label {
|
|
width: 150px;
|
|
}
|
|
</style>
|
|
|
|
<div class="page-header">
|
|
<h3>Rework Registration</h3>
|
|
</div>
|
|
|
|
<table id="dg" class="easyui-datagrid" style="width:100%;height:460px;display: none;"
|
|
data-options="pagination: true, showFooter: true, singleSelect:true, fitColumns:true , onSelect:onTableRowSelect, onLoadSuccess:onTableRowSelect, url:'/prepress/reworkAll',method:'get',pageSize:20,toolbar:'#tb'">
|
|
<thead>
|
|
<tr>
|
|
<th data-options="field:'orderNo',width:100,editor:'textbox'">Order No</th>
|
|
<th data-options="field:'partNo',width:100,editor:'textbox'">Part No</th>
|
|
<th data-options="field:'partDesc',width:200,editor:'textbox'">Part Description</th>
|
|
<th data-options="field:'apn',width:80">APN</th>
|
|
<th data-options="field:'customerPartNo',width:80">Customer Part No</th>
|
|
<th data-options="field:'project',width:80">Project</th>
|
|
<th data-options="field:'revNo',width:50">Rev No</th>
|
|
<th data-options="field:'lotSize',width:100,editor:'textbox'">Lot Size</th>
|
|
<th data-options="field:'inputLotSize',width:100,editor:'textbox'">Input Lot Size</th>
|
|
<th data-options="field:'serialsDate',width:150,align:'left',formatter:formatDate">Serials Date</th>
|
|
<th data-options="field:'needDate',width:120,formatter:formatDate">Earliest Start Date</th>
|
|
<th data-options="field:'noOfCross',width:100">No of Cross</th>
|
|
<th data-options="field:'standardRollQty',width:100,editor:'textbox'">Std. Roll Qty</th>
|
|
<th data-options="field:'createdBy',width:80,align:'left'">Created By</th>
|
|
<th data-options="field:'createdDate',width:150,align:'center',formatter:formatDateTime">Created Date</th>
|
|
<th data-options="field:'status',width:100,editor:'textbox'">Status</th>
|
|
<th data-options="field:'id', width:100,formatter: formatAction">Actions</th>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
|
|
<div id="tb" style="padding:10px 5px;display: none;">
|
|
<div>
|
|
Order No: <input class="easyui-textbox" id="orderNo" style="width:110px">
|
|
Created Date: <input class="easyui-datebox" id="createdDateFrom" style="width:100px">
|
|
to: <input class="easyui-datebox" id="createdDateTo" style="width:100px">
|
|
<a href="#nowhere" id="queryLink" class="easyui-linkbutton" iconCls="icon-search">Search</a>
|
|
|
|
<a href="javascript:void(0)" id="tbAddBox" data-options="disabled:true" class="easyui-linkbutton" iconCls="icon-add" onclick="scanBoxModal()">Register Rework Box</a>
|
|
<a href="javascript:void(0)" id="tbAddRoll" data-options="disabled:true" class="easyui-linkbutton" iconCls="icon-add" onclick="scanRollModal()">Register Rework Roll</a>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 扫描返工箱记录 -->
|
|
<div id="dlgBoxDtls" class="easyui-dialog" style="width:600px;display: none;" closed="true" data-options="modal:true" >
|
|
<form method="post" novalidate onsubmit="return false;" style="margin:0; padding: 20px 20px">
|
|
<div style="margin-bottom:10px">
|
|
<label>Box No:</label>
|
|
<input id="scan_box_no" name="boxNo" style="width: 75%; margin-left: 10px;">
|
|
</div>
|
|
</form>
|
|
<table id="rework_boxs" class="easyui-datagrid" style="width:100%;height:300px;display: none;"
|
|
data-options="pagination: false, showFooter: true, singleSelect:true, fitColumns:true , method:'POST', pageSize:20">
|
|
<thead>
|
|
<tr>
|
|
<th data-options="field:'boxNo',width:100">Box No</th>
|
|
<th data-options="field:'rollNums',width:80">Roll Qty</th>
|
|
<th data-options="field:'registerBy',width:80">Registered By</th>
|
|
<th data-options="field:'registerDate',width:150,align:'center', formatter: formatStringTime">Registration Date</th>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
</div>
|
|
|
|
<!-- 扫描返工卷记录 -->
|
|
<div id="dlgRollDtls" class="easyui-dialog" style="width:700px;display: none;" closed="true" data-options="modal:true" >
|
|
<form id="fm_scan_roll" method="post" novalidate onsubmit="return false;" style="margin:0; padding: 20px 20px">
|
|
<div style="margin-bottom:10px">
|
|
<label>Roll No:</label>
|
|
<input id="scan_roll_no" name="rollNo" style="width: 75%; margin-left: 10px;">
|
|
</div>
|
|
</form>
|
|
<table id="rework_rolls" class="easyui-datagrid" style="width:100%;height:300px;display: none;"
|
|
data-options="pagination: false, showFooter: true, singleSelect:true, fitColumns:true , method:'POST', pageSize:20">
|
|
<thead>
|
|
<tr>
|
|
<th data-options="field:'boxNo',width:100">Box No</th>
|
|
<th data-options="field:'finalRollNo',width:100">Roll No</th>
|
|
<th data-options="field:'rollQty',width:80">Quantity</th>
|
|
<th data-options="field:'registerBy',width:80">Registered By</th>
|
|
<th data-options="field:'registerDate',width:150,align:'center', formatter: formatStringTime">Registration Date</th>
|
|
<th data-options="field:'status',width:80">Status</th>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
</div>
|
|
|
|
|
|
<!-- 扫描返工卷记录 -->
|
|
<div id="dlgRollsShow" class="easyui-dialog" style="width: 820px;display: none;" closed="true" data-options="modal:true" >
|
|
<form id="fm_show_roll" method="post" novalidate onsubmit="return false;" style="margin:0; padding: 20px 20px">
|
|
<div style="margin-bottom:10px">
|
|
<label>Status:</label>
|
|
<select id="search_status" class="easyui-combobox" style="width:110px;" data-options="required:true">
|
|
<option value="ALL">All</option>
|
|
<option value="已登记">已登记</option>
|
|
<option value="已返工">已返工</option>
|
|
</select>
|
|
<a href="javascript:void(0)" id="closedAllOrder" class="easyui-linkbutton" iconCls="icon-search" onclick="seachRegisterRolls()">Query</a>
|
|
</div>
|
|
</form>
|
|
<table id="show_rework_rolls" class="easyui-datagrid" style="width:100%;height:300px;display: none;"
|
|
data-options="pagination: false, showFooter: true, singleSelect:true, fitColumns:true , method:'POST', pageSize:20">
|
|
<thead>
|
|
<tr>
|
|
<th data-options="field:'boxNo',width:100">Box No</th>
|
|
<th data-options="field:'finalRollNo',width:140">Roll No</th>
|
|
<th data-options="field:'rollQty',width:80">Quantity</th>
|
|
<th data-options="field:'registerBy',width:80">登记人</th>
|
|
<th data-options="field:'registerDate',width:150,align:'center', formatter: formatStringTime">登记日期</th>
|
|
<th data-options="field:'reworkBy',width:80">返工扫描人</th>
|
|
<th data-options="field:'reworkDate',width:150,align:'center', formatter: formatStringTime">返工扫描日期</th>
|
|
<th data-options="field:'status',width:80">Status</th>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
</div>
|
|
|
|
<script>
|
|
var currentRow;
|
|
var nowOrderNo='';
|
|
$(window).resize(function () {
|
|
$("#dg").datagrid({"height": $(window).height() - $(".datagrid").offset().top - 20});
|
|
});
|
|
|
|
$(function () {
|
|
$(window).resize();
|
|
});
|
|
|
|
function onPartDescChange(n,o){
|
|
//var p = /Label,([0-9A-Za-z\-]+)-(\S{1})/.exec(n);
|
|
var p = n.split(',');
|
|
if (p && p.length >= 3){
|
|
$("#revNo").textbox("setValue", p[2]);
|
|
}
|
|
}
|
|
|
|
$.extend($.fn.validatebox.defaults.rules, {
|
|
notRequired: function(value){
|
|
return true;
|
|
},
|
|
validDate: {
|
|
validator: function(value){
|
|
var date = $.fn.datebox.defaults.parser(value);
|
|
var s = $.fn.datebox.defaults.formatter(date);
|
|
return s==value;
|
|
},
|
|
message: 'Please enter a valid date.'
|
|
},
|
|
valueRange: {
|
|
validator: function(value,param){
|
|
return value >= param[0] && value <= param[1];
|
|
},
|
|
message: 'Field do not match.'
|
|
}
|
|
});
|
|
|
|
function myparser(s){
|
|
if(s) return new Date(s);
|
|
}
|
|
|
|
|
|
/* 选中行 */
|
|
function onTableRowSelect(index, row) {
|
|
var noRowSelect = !!!row;
|
|
currentRow = row;
|
|
$("#tbAddBox").linkbutton({"disabled": noRowSelect});
|
|
$("#tbAddRoll").linkbutton({"disabled": noRowSelect});
|
|
}
|
|
|
|
/* 查询返工单 */
|
|
$("#queryLink").click(function(){
|
|
var dg = $('#dg').datagrid({
|
|
queryParams: {
|
|
orderNo: $("#orderNo").val(),
|
|
createdDateFrom: $("#createdDateFrom").val(),
|
|
createdDateTo: $("#createdDateTo").val()
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
/* 查询返工单登记的箱 */
|
|
function scanBoxModal(){
|
|
$('#dlgBoxDtls').dialog('open').dialog('center').dialog('setTitle','Registered Boxes in '+currentRow.orderNo);
|
|
var opts = $('#rework_boxs').datagrid('options');
|
|
opts.queryParams = {'orderNo': currentRow.orderNo};
|
|
$("#rework_boxs").datagrid({url: "/rework/getReworkRegisterBoxs"});
|
|
//清空
|
|
$("#scan_box_no").val("");
|
|
//获取焦点
|
|
$("#scan_box_no").focus();
|
|
}
|
|
|
|
/* 返工箱的操作 */
|
|
$("#scan_box_no").on("keyup", function(event){
|
|
var boxNo = $(this).val();
|
|
if(!boxNo || '' === boxNo){
|
|
$.messager.show({title: 'Point', msg: 'Please scan the registered box number!', timeout: 1500, showType: 'slide'});
|
|
return false;
|
|
}
|
|
if(event.keyCode == 13){
|
|
var requestData = {
|
|
'orderNo': currentRow.orderNo,
|
|
'boxNo': boxNo,
|
|
'username': username
|
|
};
|
|
$.post("/rework/registerBoxWithReworkOrder", requestData, function(data){
|
|
if (data.success){
|
|
//刷新列列表
|
|
$("#rework_boxs").datagrid('reload');
|
|
//提示信息
|
|
$.messager.show({title: 'Point', msg: data.msg, timeout: 1500, showType: 'slide'});
|
|
//清空
|
|
$("#scan_box_no").val("");
|
|
//获取焦点
|
|
$("#scan_box_no").focus();
|
|
}else{
|
|
//清空
|
|
$("#scan_box_no").val("");
|
|
//提示 获取焦点
|
|
$.messager.alert('Error', data.msg, 'error', function () {
|
|
$("#scan_box_no").focus(); // 弹窗关闭后让输入框获取焦点
|
|
});
|
|
}
|
|
})
|
|
}
|
|
return false;
|
|
});
|
|
|
|
|
|
/* 查询返工单登记的卷 */
|
|
function scanRollModal(){
|
|
$('#dlgRollDtls').dialog('open').dialog('center').dialog('setTitle','Registered Rolls in '+currentRow.orderNo);
|
|
var opts = $('#rework_rolls').datagrid('options');
|
|
opts.queryParams = {'orderNo': currentRow.orderNo};
|
|
$("#rework_rolls").datagrid({url: "/rework/getReworkRegisterRolls"});
|
|
//清空
|
|
$("#scan_roll_no").val("");
|
|
//获取焦点
|
|
$("#scan_roll_no").focus();
|
|
}
|
|
|
|
/* 返工箱的操作 */
|
|
$("#scan_roll_no").on("keyup", function(event){
|
|
var finalRollNo = $(this).val();
|
|
if(!finalRollNo || '' === finalRollNo){
|
|
$.messager.show({title: 'Point', msg: 'Please scan the registered roll number!', timeout: 1500, showType: 'slide'});
|
|
return false;
|
|
}
|
|
if(event.keyCode == 13){
|
|
var requestData = {
|
|
'orderNo': currentRow.orderNo,
|
|
'finalRollNo': finalRollNo,
|
|
'username': username
|
|
};
|
|
$.post("/rework/registerRollWithReworkOrder", requestData, function(data){
|
|
if (data.success){
|
|
//刷新列列表
|
|
$("#rework_rolls").datagrid('reload');
|
|
//提示信息
|
|
$.messager.show({title: 'Point', msg: data.msg, timeout: 1500, showType: 'slide'});
|
|
//清空
|
|
$("#scan_roll_no").val("");
|
|
//获取焦点
|
|
$("#scan_roll_no").focus();
|
|
}else{
|
|
//清空
|
|
$("#scan_roll_no").val("");
|
|
//提示 获取焦点
|
|
$.messager.alert('Error', data.msg, 'error', function () {
|
|
$("#scan_roll_no").focus(); // 弹窗关闭后让输入框获取焦点
|
|
});
|
|
}
|
|
})
|
|
}
|
|
return false;
|
|
});
|
|
|
|
|
|
/* 查询已经登记的卷信息 */
|
|
function seachRegisterRolls(){
|
|
|
|
$('#dlgRollsShow').dialog('open').dialog('center').dialog('setTitle','Registered Rolls in '+currentRow.orderNo);
|
|
var opts = $('#show_rework_rolls').datagrid('options');
|
|
var searchStatus = $('#search_status').combobox('getValue');
|
|
opts.queryParams = {'orderNo': currentRow.orderNo, 'status': searchStatus};
|
|
$("#show_rework_rolls").datagrid({url: "/rework/getReworkRegisterRolls"});
|
|
}
|
|
|
|
/* 展示当前卷的信息 */
|
|
function viewRollsModal(orderNo){
|
|
$('#dlgRollsShow').dialog('open').dialog('center').dialog('setTitle','Registered Rolls in '+orderNo);
|
|
var opts = $('#show_rework_rolls').datagrid('options');
|
|
opts.queryParams = {'orderNo': orderNo, 'status': 'ALL'};
|
|
$('#search_status').combobox('setValue', 'ALL');
|
|
$("#show_rework_rolls").datagrid({url: "/rework/getReworkRegisterRolls"});
|
|
}
|
|
|
|
//检查卷信息
|
|
function formatAction(value, row){
|
|
return "<a href='javascript:viewRollsModal(\""+row.orderNo+"\")'>Roll detail</a>";
|
|
}
|
|
|
|
var delay = (function(){
|
|
var timer = 0;
|
|
return function(callback, ms){
|
|
clearTimeout (timer);
|
|
timer = setTimeout(callback, ms);
|
|
};
|
|
})();
|
|
|
|
</script>
|
|
|
|
|
|
</@master.layout>
|
|
|