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.
223 lines
7.5 KiB
223 lines
7.5 KiB
<#import "../master.ftl" as master>
|
|
<@master.layout>
|
|
|
|
<style>
|
|
#fm label {
|
|
width: 150px;
|
|
}
|
|
</style>
|
|
|
|
<div class="page-header">
|
|
<h2>Stock Query</h2>
|
|
</div>
|
|
|
|
<table id="dg" class="easyui-datagrid" style="width:100%;height:460px;display: none;"
|
|
data-options="pagination: true, pageSize:20, showFooter: true, singleSelect:true, fitColumns:true ,
|
|
queryParams:{status: $('#status').val()},
|
|
url:'/inventory/getStockList', method:'POST', toolbar:'#tb'">
|
|
<thead>
|
|
<tr>
|
|
<th data-options="field:'orderNo',width:100">SO No</th>
|
|
<th data-options="field:'boxNo',width:100">Box No</th>
|
|
<th data-options="field:'partNo',width:100">Part No</th>
|
|
<th data-options="field:'rollNums',width:100,align:'right'">Count of Rolls</th>
|
|
<th data-options="field:'boxQty',width:100,align:'right'">Box Qty</th>
|
|
<th data-options="field:'status',width:100,formatter: getStatement" >Status</th>
|
|
<th data-options="field:'locationNo',width:100">Location No</th>
|
|
<th data-options="field:'createdBy',width:100">Created By</th>
|
|
<th data-options="field:'createdDate',width:100,formatter:formatStringTime">Created Time</th>
|
|
<th data-options="field:'updatedBy',width:100">Updated By</th>
|
|
<th data-options="field:'updatedDate',width:100,formatter:formatStringTime">Updated Time</th>
|
|
<th data-options="field:'labelDate',width:100,formatter:formatStringDate">Label Tracking Date</th>
|
|
<th data-options="field:'id',width:200, formatter: formatDeliveryAction">Actions</th>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
|
|
<div id="tb" style="padding:10px 5px;display: none;">
|
|
<div>
|
|
SO No: <input class="easyui-textbox" id="orderNo" style="width:110px">
|
|
Box No: <input class="easyui-textbox" id="boxNo" style="width:110px">
|
|
Part No: <input class="easyui-textbox" id="partNo" style="width:110px">
|
|
Location No: <input class="easyui-textbox" id="locationNo" style="width:110px">
|
|
Status: <select class="easyui-combobox" name="status" id="status" style="width:90px;">
|
|
<option value="ALL">ALL</option>
|
|
<option value="5">Shipped</option>
|
|
<option value="4">In-Stock</option>
|
|
<option value="-1">Frozen</option>
|
|
</select>
|
|
<a href="#nowhere" id="queryLink" class="easyui-linkbutton" iconCls="icon-search">Search</a>
|
|
<a class="easyui-linkbutton" iconCls="icon-add" onclick="downInventoryExcel()">Export to Excel</a>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
$(window).resize(function () {
|
|
$("#dg").datagrid({"height": $(window).height() - $(".datagrid").offset().top - 20});
|
|
});
|
|
|
|
$(function () {
|
|
$(window).resize();
|
|
});
|
|
|
|
|
|
//格式化字符串时间
|
|
function formatStringDate(value, row){
|
|
if(null == value || '' == value){
|
|
return '';
|
|
}
|
|
value = value.substring(0, 10);
|
|
return value;
|
|
}
|
|
|
|
$("#queryLink").click(function(){
|
|
var dg = $('#dg').datagrid({
|
|
queryParams: {
|
|
orderNo: $("#orderNo").val(),
|
|
partNo: $("#partNo").val(),
|
|
locationNo: $("#locationNo").val(),
|
|
boxNo: $("#boxNo").val(),
|
|
status: $("#status").val()
|
|
}
|
|
});
|
|
});
|
|
|
|
//主表功能
|
|
function formatDeliveryAction(value, row){
|
|
//根据状态区分不同的按钮
|
|
let status = row.status;
|
|
let tags = '';
|
|
if('Freeze' == status){
|
|
tags += '<a onclick="performingTask(\''+row.boxNo+'\')" class="disabled-underscore">unFrozen</a>';
|
|
}else if('Stocked' == status){
|
|
tags += '<a onclick="freezeBoxConfirm(\''+row.boxNo+'\')" class="disabled-underscore">Frozen</a>';
|
|
}
|
|
return tags;
|
|
}
|
|
|
|
//解冻
|
|
function performingTask(boxNo){
|
|
$.messager.confirm('Confirm','Are you sure to unFrozen the box: <b>'+boxNo+'</b> ?', function(r){
|
|
if (r){
|
|
//取到当前的行
|
|
delay(function(){
|
|
//调用方法
|
|
updateFreezeTask(boxNo);
|
|
}, 500);
|
|
}
|
|
});
|
|
}
|
|
|
|
//解冻功能
|
|
function updateFreezeTask(boxNo){
|
|
let username = $('#current_username').val();
|
|
let postData = {'boxNo': boxNo, 'updatedBy': username};
|
|
//保存或修改数据
|
|
/*//序列化
|
|
postData = JSON.stringify(postData);*/
|
|
//post请求类型修改
|
|
$('#saveButton').addClass("button-disabled");
|
|
$.ajaxSetup({
|
|
contentType: "application/x-www-form-urlencoded"});
|
|
$.post('/inventory/updateFreezeTask', postData, function(result){
|
|
$('#saveButton').removeClass("button-disabled");
|
|
if (result.success){
|
|
//刷新主表数据
|
|
$('#dg').datagrid('reload');
|
|
} else {
|
|
$.messager.alert('error',result.msg, 'error');
|
|
}
|
|
},'json');
|
|
$.ajaxSetup({
|
|
contentType: " application/x-www-form-urlencoded"});
|
|
}
|
|
|
|
//解冻
|
|
function freezeBoxConfirm(boxNo){
|
|
$.messager.confirm('Confirm','Confirm Freeze: <b>'+boxNo+'</b> ?', function(r){
|
|
if (r){
|
|
//取到当前的行
|
|
delay(function(){
|
|
//调用方法
|
|
freezeBoxFunc(boxNo);
|
|
}, 500);
|
|
}
|
|
});
|
|
}
|
|
|
|
//冻结功能
|
|
function freezeBoxFunc(boxNo){
|
|
let username = $('#current_username').val();
|
|
let postData = {'boxNo': boxNo, 'updatedBy': username};
|
|
//保存或修改数据
|
|
/*//序列化
|
|
postData = JSON.stringify(postData);*/
|
|
//post请求类型修改
|
|
$.ajaxSetup({
|
|
contentType: "application/x-www-form-urlencoded"});
|
|
$.post('/inventory/freezeBoxFunc', postData, function(result){
|
|
if (result.success){
|
|
//刷新主表数据
|
|
$('#dg').datagrid('reload');
|
|
} else {
|
|
$.messager.alert('error',result.msg, 'error');
|
|
}
|
|
},'json');
|
|
$.ajaxSetup({
|
|
contentType: " application/x-www-form-urlencoded"});
|
|
}
|
|
|
|
//延时操作
|
|
var delay = (function(){
|
|
var timer = 0;
|
|
return function(callback, ms){
|
|
clearTimeout (timer);
|
|
timer = setTimeout(callback, ms);
|
|
};
|
|
})();
|
|
|
|
//获取状态
|
|
function getStatement(value, row){
|
|
if(value=="Delivered"){
|
|
return "Shipped";
|
|
}else if(value=="Stocked"){
|
|
return "In-Stock";
|
|
}else if(value=="Freeze"){
|
|
return "Frozen";
|
|
}
|
|
}
|
|
|
|
//下载Excel数据
|
|
function downInventoryExcel(){
|
|
let orderNo = $("#orderNo").val();
|
|
let partNo = $("#partNo").val();
|
|
let locationNo = $("#locationNo").val();
|
|
let boxNo = $("#boxNo").val();
|
|
let status = $("#status").val();
|
|
let print_url = '/export/inventory/downInventoryExcel?orderNo='+orderNo+'&partNo='+partNo+'&locationNo='+locationNo+'&boxNo='+boxNo+'&statusDesc='+status;
|
|
$("#ifmforprint").attr('src', print_url);
|
|
}
|
|
|
|
|
|
/* //TT扫描入库和IFS入库数量如果不相等,异常提醒
|
|
$('#dg').datagrid({
|
|
rowStyler:function(index,row){
|
|
if(row.confirmBy !=null&&row.confirmBy !=''){
|
|
return ''
|
|
}
|
|
|
|
if (Math.abs(Number(row.qtyComplete)-Number(row.qtyCompleteIfs))>=row.packageQty){
|
|
return 'background-color:#ff534d;font-weight:bold;';
|
|
}
|
|
}
|
|
}); */
|
|
|
|
</script>
|
|
|
|
|
|
</@master.layout>
|
|
|