var refreshGirdData;
var OneInTimebegin = '';
var OneInTimeend = '';
var ProductTimebegin = '';
var ProductTimeend = '';
var logbegin = '';
var logend = '';
var selectRowsData;
var bootstrap = function ($, learun) {
"use strict";
var page = {
init: function () {
page.initGird();
page.bind();
},
bind: function () {
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
// 调用后台查询
// queryJson 查询条件
var oneintime = $('#lr_search_date_OneInTime').html();
if (oneintime == '') {
OneInTimebegin = '';
OneInTimeend = '';
}
var producttime = $('#lr_search_date_ProductTime').html();
if (producttime == '') {
ProductTimebegin = '';
ProductTimeend = '';
}
console.log(queryJson);
queryJson["MatCode"] = $("#MatCode").val();
queryJson["MatName"] = $("#MatName").val();
queryJson["RFIDBarCode"] = $("#RFIDBarCode").val();
queryJson["InvBarCode"] = $("#InvBarCode").val();
queryJson["Tunnel"] = $("#Tunnel").val();
queryJson["Code"] = $("#Code").val();
queryJson["PutRow"] = $("#PutRow").val();
queryJson["PutCol"] = $("#PutCol").val();
queryJson["PutLayer"] = $("#PutLayer").val();
queryJson["OneInTimeBegin"] = $("#OneInTimeBegin").val();
queryJson["OneInTimeEnd"] = $("#OneInTimeEnd").val();
queryJson["ProductTimeBegin"] = $("#ProductTimeBegin").val();
queryJson["ProductTimeEnd"] = $("#ProductTimeEnd").val();
//queryJson["OneInTimeBegin"] = OneInTimebegin;
//queryJson["OneInTimeEnd"] = OneInTimeend;
//queryJson["ProductTimeBegin"] = ProductTimebegin;
//queryJson["ProductTimeEnd"] = ProductTimeend;
queryJson["Grade"] = $("#Grade").val();
queryJson["ExecStateCode"] = $("#ExecStateCode").lrselectGet();
queryJson["InvStateCode"] = 3;
queryJson["IsSurplus"] = $("#IsSurplus").lrselectGet();
queryJson["IsRework"] = $("#IsRework").lrselectGet();
queryJson["IsFast"] = $("#IsFast").lrselectGet();
queryJson["IsFail"] = $("#IsFail").lrselectGet();
queryJson["IsBack"] = $("#IsBack").lrselectGet();
queryJson["ExecStateCode"] = $("#ExecStateCode").lrselectGet();
page.search({ queryJson: JSON.stringify(queryJson) });
}, 250);
// 查询
$('#btn_Search').on('click', function () {
var keyword = $('#txt_Keyword').val();
page.search({ queryJson: JSON.stringify({ keyword: $('#txt_Keyword').val(), InvStateCode: 3 }) });
});
// 刷新
$('#lr_refresh').on('click', function () {
location.reload();
});
// 手动出库
$('#lr_edit').on('click', function ()
{
selectRowsData = $('#gridtable').jfGridGet("rowdata");
if (selectRowsData.length == 0) {
learun.alert.error('未选择行!');
return false;
}
learun.layerForm({
id: 'form',
title: '选择出库地址',
url: top.$.rootUrl + '/PTManager/Inventorys/Form',
width: 700,
height: 300,
callBack: function (id) {
return top[id].acceptClick(refreshGirdData);
}
});
});
$('#OneInTime').lrdatetime({
dfdata: [
{ name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
{ name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
{ name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
{ name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
],
// 月
mShow: false,
premShow: false,
// 季度
jShow: false,
prejShow: false,
// 年
ysShow: false,
yxShow: false,
preyShow: false,
yShow: false,
// 默认
dfvalue: 'all',
selectfn: function (begin, end) {
OneInTimebegin = begin;
OneInTimeend = end;
}
});
$('#ProductTime').lrdatetime({
dfdata: [
{ name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
{ name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
{ name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
{ name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
],
// 月
mShow: false,
premShow: false,
// 季度
jShow: false,
prejShow: false,
// 年
ysShow: false,
yxShow: false,
preyShow: false,
yShow: false,
// 默认
dfvalue: 'all',
selectfn: function (begin, end) {
ProductTimebegin = begin;
ProductTimeend = end;
}
});
$('#ExecStateCode').lrselect({
url: top.$.rootUrl + '/PTManager/Enums/GetExecStateList',
maxHeight: 180,
allowSearch: false
});
$('#InvStateCode').lrselect({
url: top.$.rootUrl + '/PTManager/Enums/GetInvStateList',
maxHeight: 180,
allowSearch: false
});
$('#IsSurplus').lrselect({
url: top.$.rootUrl + '/PTManager/Enums/YesNoList',
maxHeight: 60,
allowSearch: false
});
$('#IsRework').lrselect({
url: top.$.rootUrl + '/PTManager/Enums/YesNoList',
maxHeight: 60,
allowSearch: false
});
$('#IsFast').lrselect({
url: top.$.rootUrl + '/PTManager/Enums/YesNoList',
maxHeight: 60,
allowSearch: false
});
$('#IsFail').lrselect({
url: top.$.rootUrl + '/PTManager/Enums/YesNoList',
maxHeight: 60,
allowSearch: false
});
$('#IsBack').lrselect({
url: top.$.rootUrl + '/PTManager/Enums/YesNoList',
maxHeight: 60,
allowSearch: false
});
},
// 初始化列表
initGird: function () {
$('#gridtable').jfGrid({
url: top.$.rootUrl + '/PTManager/Inventorys/GetPageList',
headData: [
{ label: "容器条码", name: "ContGrpBarCode", width: 120, align: "left" },
{ label: "材料号", name: "InvBarCode", width: 110, align: "left" },
{ label: "库存状态", name: "InvStateName", width: 80, align: "left", sortname: "InvStateCode" },
{ label: "冻结/放行状态", name: "ExecStateName", width: 80, align: "left", sortname: "ExecStateCode" },
{ label: "巷道", name: "Tunnel", width: 50, align: "left" },
{ label: "货位号", name: "Code", width: 100, align: "left" },
{
label: "货位状态", name: "CellState", width: 80, align: "left"
, formatter: function (cellvalue) {
if (cellvalue == 0) {
return '启用';
} else {
return '禁用';
}
}
},
{ label: "行", name: "PutRow", width:40, align: "left" },
{ label: "列", name: "PutCol", width: 40, align: "left" },
{ label: "层", name: "PutLayer", width:40, align: "left" },
{ label: "首次入库时间", name: "OneInTime", width: 130, align: "left" },
{ label: "生产时间", name: "ProductTime", width: 130, align: "left" },
{ label: "物料编码", name: "MatCode", width: 80, align: "left" },
{ label: "物料名称", name: "MatName", width: 80, align: "left" },
{ label: "牌号", name: "BrandNo", width: 80, align: "left" },
{ label: "炉号", name: "BoilerNo", width: 80, align: "left" },
{ label: "包号", name: "PackNo", width: 80, align: "left" },
{ label: "碳当量", name: "CaQty", width: 80, align: "left" },
{ label: "总重量", name: "TolWQty", width: 80, align: "left" },
{ label: "净重", name: "NetWQty", width: 80, align: "left" },
{ label: "皮重", name: "TareWQty", width: 80, align: "left" },
{ label: "长度", name: "LengthQty", width: 80, align: "left" },
{ label: "RFID编号", name: "RFIDBarCode", width: 80, align: "left" },
{
label: "是否余料", name: "IsSurplus", width:70, align: "left"
, formatter: function (cellvalue) {
if (cellvalue == true) {
return '是';
} else {
return '否';
}
}
},
{
label: "是否退料", name: "IsBack", width: 70, align: "left"
, formatter: function (cellvalue) {
if (cellvalue == true) {
return '是';
} else {
return '否';
}
}
},
{
label: "是否锁定", name: "ExecStateCode", width: 80, align: "left"
, formatter: function (cellvalue) {
if (cellvalue == "InvState_Normal") {
return '否';
} else {
return '是';
}
}
},
{
label: "返工标记", name: "IsRework", width: 60, align: "left", formatter: function (cellvalue) {
if (cellvalue == true) {
return '是';
} else {
return '否';
}
}
},
{
label: "快投标记", name: "IsFast", width: 60, align: "left", formatter: function (cellvalue) {
if (cellvalue == true) {
return '是';
} else {
return '否';
}
}
},
{
label: "是否异常", name: "IsFail", width: 60, align: "left", formatter: function (cellvalue) {
if (cellvalue == true) {
return '是';
} else {
return '否';
}
}
},
{ label: "异常原因", name: "FailReason", width: 80, align: "left" },
{ label: "等级", name: "Grade", width: 80, align: "left" },
{ label: "退料原因", name: "BackReason", width: 80, align: "left" },
{ label: "工序订单号", name: "ProcessDocsCode", width: 120, align: "left" },
{ label: "生产机台号", name: "ProductMachCode", width: 80, align: "left" },
{ label: "产线编号", name: "ProductLineNo", width: 80, align: "left" },
{ label: "入库单号", name: "InDocsNo", width: 120, align: "left" },
{ label: "入库单行号", name: "InDocsRowNo", width: 120, align: "left" },
{ label: "创建时间", name: "AddTime", width: 150, align: "left" },
{ label: "更新时间", name: "EditTime", width: 150, align: "left" },
],
mainId: 'Id',
isPage: true,
reloadSelected: true,
autowWidth: true,
sidx: 'AddTime',
sord: 'DESC',
isMultiselect: true,
});
page.search({ queryJson: JSON.stringify({ keyword: $('#txt_Keyword').val(), InvStateCode: 3 }) });
},
search: function (param) {
param = param || { queryJson: JSON.stringify({InvStateCode: 3 }) };
$('#gridtable').jfGridSet('reload', param);
}
};
refreshGirdData = function () {
page.search();
};
page.init();
}