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.
760 lines
32 KiB
760 lines
32 KiB
@{
|
|
ViewBag.Title = "Index";
|
|
Layout = "~/Views/Shared/_Index.cshtml";
|
|
}
|
|
<script src="~/Content/js/datepicker/WdatePicker.js"></script>
|
|
<script>
|
|
debugger;
|
|
|
|
|
|
var myDate = new Date;
|
|
var year = myDate.getFullYear(); //获取当前年
|
|
var mon = myDate.getMonth() + 1 < 10 ? "0" + (myDate.getMonth() + 1) : myDate.getMonth() + 1; //获取当前月
|
|
var date = myDate.getDate() + 1 < 10 ? "0" + myDate.getDate() : myDate.getDate(); //获取当前日
|
|
var MtimeFrom = year + "-" + mon + "-" + date;
|
|
var MtimeArrive = year + "-" + mon + "-" + date;
|
|
|
|
var _Clos = new Array();
|
|
var _Clos1 = new Array();
|
|
var flag = '1';
|
|
var mark = '';
|
|
var Arguments = '';
|
|
$(function () {
|
|
|
|
$("#TimeFrom").val(MtimeFrom);
|
|
$("#TimeArrive").val(MtimeArrive);
|
|
SetCols();
|
|
GetPickingListType();
|
|
gridList();
|
|
|
|
gridList2(flag);
|
|
|
|
});
|
|
|
|
function Selchange() {
|
|
//$("#txt_Mechanism").val("");
|
|
var Type = $("#selShow").val();
|
|
if (Type=='1') {
|
|
$(".Mechanism").css('display', 'table-cell');
|
|
}
|
|
else {
|
|
$(".Mechanism").css('display', 'none');
|
|
}
|
|
document.getElementById("gridPanel").innerHTML = ' <span><strong>详细信息</strong></span> <table id="gridList"></table> ';//重置grid
|
|
gridList();
|
|
|
|
}
|
|
|
|
|
|
|
|
function SetCols() {
|
|
$.ajax({
|
|
url: "/Print/SelectColumnName?" + Math.random(),
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
var cols = new Array();
|
|
|
|
var collast = { label: "主键", name: "ID", hidden: true, key: true };
|
|
cols.push(collast);
|
|
var collast = { label: '单据号', name: 'Code', width: 120, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: '操作日期', name: 'MTIME', width: 150, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: '维护人', name: 'MUSER', width: 80, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: '维护人名称', name: 'MUSERName', width: 80, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: '拣料ID', name: 'IsNew', width: 80, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: '是否占料', name: 'IsOccupy', width: 80, align: 'left' };
|
|
cols.push(collast);
|
|
|
|
var cols1 = new Array();
|
|
var collast1 = { label: "主键", name: "ID", hidden: true, key: true };
|
|
cols1.push(collast1);
|
|
var collast1 = { label: '领料合并ID', name: 'MergeID', width: 120, align: 'left' };
|
|
cols1.push(collast1);
|
|
var collast1 = { label: '单据号', name: 'Code', width: 120, align: 'left' };
|
|
cols1.push(collast1);
|
|
var collast1 = { label: '单据行号', name: 'Sequence', width: 120, align: 'left' };
|
|
cols1.push(collast1);
|
|
var collast1 = { label: '料品编码', name: 'InvCode', width: 150, align: 'left' };
|
|
cols1.push(collast1);
|
|
var collast1 = { label: '料品名称', name: 'InvName', width: 150, align: 'left' };
|
|
cols1.push(collast1);
|
|
var collast1 = { label: '规格型号', name: 'InvStd', width: 100, align: 'left' };
|
|
cols1.push(collast1);
|
|
var collast1 = { label: '应发数量', name: 'iQuantity', width: 100, align: 'left' };
|
|
cols1.push(collast1);
|
|
var collast1 = { label: 'SendQTY', name: 'SendQTY', width: 100, align: 'left', hidden: true };
|
|
cols1.push(collast1);
|
|
var collast1 = { label: '单位', name: 'InvUnit', width: 150, align: 'left' };
|
|
cols1.push(collast1);
|
|
var collast1 = { label: '仓库编码', name: 'WarehouseCode', width: 100, align: 'left' };
|
|
cols1.push(collast1);
|
|
var collast1 = { label: '库位编码', name: 'LocationCode', width: 100, align: 'left' };
|
|
cols1.push(collast1);
|
|
var collast1 = { label: '条码库存', name: 'QTY', width: 100, align: 'left' };
|
|
cols1.push(collast1);
|
|
var collast1 = { label: '条码', name: 'LotNO', width: 100, align: 'left' };
|
|
cols1.push(collast1);
|
|
|
|
var cols2 = new Array();
|
|
var collast2 = { label: '单据号', name: 'Code', width: 120, align: 'left' };
|
|
cols2.push(collast2);
|
|
var collast2 = { label: '单据行号', name: 'Sequence', width: 100, align: 'left' };
|
|
cols2.push(collast2);
|
|
var collast2 = { label: '操作日期', name: 'MTIME', width: 150, align: 'left' };
|
|
cols2.push(collast2);
|
|
var collast2 = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
|
|
cols2.push(collast2);
|
|
var collast2 = { label: '料品名称', name: 'InvName', width: 100, align: 'left' };
|
|
cols2.push(collast2);
|
|
var collast2 = { label: '料品描述', name: 'InvDesc', width: 100, align: 'left' };
|
|
cols2.push(collast2);
|
|
var collast2 = { label: '规格型号', name: 'InvStd', width: 100, align: 'left' };
|
|
cols2.push(collast2);
|
|
var collast2 = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
|
|
cols2.push(collast2);
|
|
var collast2 = { label: '已发数量', name: 'IssueQuantity', width: 100, align: 'left' };
|
|
cols2.push(collast2);
|
|
var collast2 = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
|
|
cols2.push(collast2);
|
|
var collast2 = { label: '维护人', name: 'MUSER', width: 80, align: 'left' };
|
|
cols2.push(collast2);
|
|
var collast2 = { label: '维护人名称', name: 'MUSERName', width: 80, align: 'left' };
|
|
cols2.push(collast2);
|
|
var collast2 = { label: '仓库编码', name: 'WHCode', width: 80, align: 'left' };
|
|
cols2.push(collast2);
|
|
var collast2 = { label: '仓库名称', name: 'WarehouseName', width: 80, align: 'left' };
|
|
cols2.push(collast2);
|
|
|
|
if (data != null && data.length > 0) {
|
|
DateList = data;
|
|
for (var i = 0; i < data.length; i++) {
|
|
var ColName = data[i].ColName;
|
|
var ColCode = data[i].ColCode;
|
|
var obj = new Array();
|
|
obj = {
|
|
label: ColName,
|
|
name: ColCode,
|
|
width: 80,
|
|
align: "left"
|
|
}
|
|
//cols.push(obj);
|
|
//cols1.push(obj);
|
|
cols2.push(obj);
|
|
}
|
|
}
|
|
_Clos = cols;
|
|
_Clos1 = cols1;
|
|
_Clos2 = cols2;
|
|
}
|
|
});
|
|
}
|
|
|
|
function gridList() {
|
|
|
|
var Type = $("#selShow").val();
|
|
var $gridList = $("#gridList");
|
|
var queryJson = {
|
|
POCode: $("#txt_POCode").val(),
|
|
InvCode: $("#txt_InvCode").val(),
|
|
TimeFrom: $("#TimeFrom").val(),
|
|
TimeArrive: $("#TimeArrive").val(),
|
|
}
|
|
$gridList.dataGrid({
|
|
url: "/WMS/PickMaterial/GetGridJson? " + Math.random(),
|
|
postData: { queryJson: JSON.stringify(queryJson), Type: Type },
|
|
//height: 280,
|
|
//width: 300,
|
|
height: $(window).height() - 550,
|
|
width: $(window).width() - 500,
|
|
colModel: _Clos,
|
|
//colModel: [
|
|
// { label: "主键", name: "ID", hidden: true, key: true },
|
|
// { label: '单据号', name: 'Code', width: 120, align: 'left' },
|
|
// { label: '操作日期', name: 'MTIME', width: 150, align: 'left' },
|
|
// { label: '维护人', name: 'MUSER', width: 80, align: 'left' },
|
|
// { label: '维护人名称', name: 'MUSERName', width: 80, align: 'left' },
|
|
// { label: '是否合并拣料', name: 'IsNew', width: 80, align: 'left' },
|
|
//],
|
|
shrinkToFit: false,//宽度自适应
|
|
autowidth: true,
|
|
gridComplete: function () {
|
|
},
|
|
rowNum: 10000,
|
|
autoScroll: true,
|
|
sortname: 'Code',
|
|
sortorder: "desc",
|
|
viewrecords: true,
|
|
multiselect: true,
|
|
subGrid: true, // (1)开启子表格支持
|
|
subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
|
|
$("#gridList").jqGrid("setSelection", rowid, false);
|
|
bindSubGrid(subgrid_id, rowid)
|
|
},
|
|
gridComplete: function () {
|
|
debugger;
|
|
var strIds = $("#gridList").jqGrid("getDataIDs");
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
function bindSubGrid(subgrid_id, rowid) {
|
|
var Type = $("#selShow").val();
|
|
var InvCode = $("#txt_InvCode").val();
|
|
var Mechanism = $("#txt_Mechanism").val();
|
|
$("#gridList").jqGrid("setSelection", rowid, false);
|
|
var subgrid_table_id;
|
|
subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
|
|
|
|
var subgrid_pager_id;
|
|
subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
|
|
|
|
// (5)动态添加子报表的table和pager
|
|
$("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
|
|
var Code = $("#gridList").jqGrid('getRowData', rowid).Code;
|
|
//var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
|
|
// (6)创建jqGrid对象
|
|
$("#" + subgrid_table_id).dataGrid({
|
|
cellEdit: true,
|
|
url: "/WMS/PickMaterial/GetSubGridJson?Code=" + Code + "&Type=" + Type + "&Mechanism=" + Mechanism + "&InvCode=" + InvCode + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
|
|
//colModel: [
|
|
// { label: '单据号', name: 'Code', width: 120, align: 'left' },
|
|
// { label: '单据行号', name: 'Sequence', width: 100, align: 'left' },
|
|
// { label: '操作日期', name: 'MTIME', width: 150, align: 'left' },
|
|
// { label: '是否合并拣料', name: 'IsNew', width: 80, align: 'left' },
|
|
// { label: '料品编码', name: 'InvCode', width: 100, align: 'left' },
|
|
// { label: '料品名称', name: 'InvName', width: 100, align: 'left' },
|
|
// { label: '料品描述', name: 'InvDesc', width: 100, align: 'left' },
|
|
// { label: '规格型号', name: 'InvStd', width: 100, align: 'left' },
|
|
// { label: '数量', name: 'Quantity', width: 100, align: 'left' },
|
|
// { label: '已发数量', name: 'IssueQuantity', width: 100, align: 'left' },
|
|
// { label: '单位', name: 'InvUnit', width: 100, align: 'left' },
|
|
// { label: '维护人', name: 'MUSER', width: 80, align: 'left' },
|
|
// { label: '维护人名称', name: 'MUSERName', width: 80, align: 'left' },
|
|
// { label: '仓库编码', name: 'WHCode', width: 80, align: 'left' },
|
|
// { label: '仓库名称', name: 'WarehouseName', width: 80, align: 'left' },
|
|
//],
|
|
colModel: _Clos2,
|
|
//colModel: ColModelSub,
|
|
shrinkToFit: true,//宽度自适应
|
|
sortname: 'Sequence',
|
|
sortorder: "desc",
|
|
//multiselect: true,
|
|
prmNames: { search: "search" },
|
|
viewrecords: true,
|
|
height: "100%",
|
|
rowNum: 20,
|
|
pager: subgrid_pager_id,
|
|
|
|
});
|
|
}
|
|
|
|
|
|
function gridList2(flag) {
|
|
debugger;
|
|
document.getElementById("gridPanel2").innerHTML = ' <span><strong>合并信息</strong></span> <table id="gridList2"></table>';//重置grid
|
|
var Mechanism = $("#txt_Mechanism").val();
|
|
var InvCode = $("#txt_InvCode").val();
|
|
var Type = $("#selShow").val();
|
|
var $gridList = $("#gridList2");
|
|
var objArr = '';
|
|
var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
|
|
for (var i = 0; i < objList.length; i++) {
|
|
var rowId = objList[i];
|
|
var rowData = $("#gridList").jqGrid('getRowData', rowId);
|
|
if (flag == '1') {
|
|
objArr += "'" + rowData.Code + "',";
|
|
} else {
|
|
objArr += "'" + rowData.Code + "',";
|
|
}
|
|
|
|
}
|
|
$gridList.dataGrid({
|
|
url: "/WMS/PickMaterial/GetICSMOPickMergeTemp?ID=" + objArr + "&Type=" + Type + "&flag=" + flag + "&Mechanism=" + Mechanism + "&InvCode=" + InvCode + "&" + Math.random(),
|
|
height: 500,
|
|
width: $(window).width() - 500,
|
|
colModel: _Clos1,
|
|
//colModel: [
|
|
// { label: "主键", name: "ID", hidden: true, key: true },
|
|
// { label: '领料合并ID', name: 'MergeID', width: 120, align: 'left' },
|
|
// { label: '单据号', name: 'Code', width: 120, align: 'left' },
|
|
// { label: '料品编码', name: 'InvCode', width: 150, align: 'left' },
|
|
// { label: '料品名称', name: 'InvName', width: 150, align: 'left' },
|
|
// { label: '规格型号', name: 'InvStd', width: 100, align: 'left' },
|
|
// { label: '应发数量', name: 'iQuantity', width: 100, align: 'left' },
|
|
// { label: '单位', name: 'InvUnit', width: 150, align: 'left' },
|
|
// { label: '仓库编码', name: 'WarehouseCode', width: 100, align: 'left' },
|
|
// { label: '库位编码', name: 'LocationCode', width: 100, align: 'left' },
|
|
// { label: '条码库存', name: 'QTY', width: 100, align: 'left' },
|
|
// { label: '条码', name: 'LotNO', width: 100, align: 'left' },
|
|
//],
|
|
shrinkToFit: false,//宽度自适应
|
|
autowidth: true,
|
|
gridComplete: function () {
|
|
},
|
|
rowNum: 10000,
|
|
sortorder: "desc",
|
|
viewrecords: true,
|
|
//multiselect: true,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
function btnMaterial() {
|
|
debugger;
|
|
var objArr = '';
|
|
var arr = [];
|
|
mark = '拣料';
|
|
flag = '1';
|
|
var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
|
|
for (var i = 0; i < objList.length; i++) {
|
|
var rowId = objList[i];
|
|
var rowData = $("#gridList").jqGrid('getRowData', rowId);
|
|
if (rowData.IsNew != "") {
|
|
$.modalAlertNew("WMS00091");
|
|
return;
|
|
}
|
|
objArr += "'" + rowData.Code + "',";
|
|
objArr = objArr.slice(0, objArr.length - 1);
|
|
objArr = "" + objArr + "|";
|
|
arr.push(objArr);
|
|
}
|
|
Arguments = arr;
|
|
gridList2(flag);
|
|
}
|
|
|
|
function btnBackMaterial() {
|
|
debugger;
|
|
var objArr = '';
|
|
var arr = [];
|
|
var ICSASN = [];
|
|
mark = '回撤拣料';
|
|
flag = '1';
|
|
//var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
|
|
//for (var i = 0; i < objList.length; i++) {
|
|
// var rowId = objList[i];
|
|
// var rowData = $("#gridList").jqGrid('getRowData', rowId);
|
|
// if (rowData.IsNew == "") {
|
|
// $.modalAlertNew("WMS00091");//该单据未检料,请确认!
|
|
// return;
|
|
// }
|
|
// objArr += "'" + rowData.Code + "',";
|
|
// objArr = objArr.slice(0, objArr.length - 1);
|
|
// objArr = "" + objArr + "|";
|
|
// arr.push(objArr);
|
|
//}
|
|
//Arguments = arr;
|
|
//gridList2(flag);
|
|
|
|
debugger;
|
|
mark = '回撤拣料';
|
|
var sign = '';
|
|
flag = '2';
|
|
var Type = $("#selShow").val();
|
|
var obj = '';
|
|
var objArr = '';
|
|
var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
|
|
//if (objList.length < 2) {
|
|
// $.modalAlertNew("WMS00092");
|
|
// return;
|
|
//}
|
|
for (var i = 0; i < objList.length; i++) {
|
|
var rowId = objList[i];
|
|
var rowData = $("#gridList").jqGrid('getRowData', rowId);
|
|
if (rowData.IsOccupy == '已占料') {
|
|
$.modalAlert("该单据已被占料,请至拣配查询页面查看!", "warning");
|
|
return;
|
|
}
|
|
obj += rowData.Code + ",";
|
|
objArr += "'" + rowData.Code + "',";
|
|
var obj = {
|
|
Code: rowData.Code
|
|
};
|
|
ICSASN.push(obj);
|
|
}
|
|
|
|
//var MergeID = rowData.Code;1 2
|
|
//if (MergeID != '') {
|
|
// $.modalAlertNew("WMS00091");
|
|
// return;
|
|
//}
|
|
$.submitForm({
|
|
url: "/WMS/PickMaterial/BackMergeMaterial?Type=" + Type + "&" + Math.random(),
|
|
//param: {
|
|
// keyValue: obj
|
|
//},
|
|
param: { keyValue: JSON.stringify(ICSASN) },
|
|
success: function () {
|
|
|
|
gridList2(flag);
|
|
$.currentWindow().$("#gridList").trigger("reloadGrid");
|
|
|
|
}
|
|
})
|
|
}
|
|
|
|
|
|
function btnMergeMaterial() {
|
|
debugger;
|
|
mark = '合并拣料';
|
|
var sign = '';
|
|
flag = '2';
|
|
|
|
var Type = $("#selShow").val();
|
|
var Mechanism = $("#txt_Mechanism").val();
|
|
if (Mechanism != "") {
|
|
$.modalAlert("单据已开启部分拣料功能,无法合并拣料!", "warning");
|
|
return;
|
|
}
|
|
var obj = '';
|
|
var objArr = '';
|
|
var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
|
|
if (objList.length < 2) {
|
|
$.modalAlertNew("WMS00092");
|
|
return;
|
|
}
|
|
|
|
var aa = '';
|
|
for (var i = 0; i < objList.length; i++) {
|
|
|
|
var rowId = objList[i];
|
|
var rowData = $("#gridList").jqGrid('getRowData', rowId);
|
|
if (rowData.IsOccupy=='已占料') {
|
|
$.modalAlert("该单据已被占料,请至拣配查询页面查看!", "warning");
|
|
return;
|
|
}
|
|
if (i == 0) {
|
|
aa = rowData.IsNew;
|
|
} else if (aa != rowData.IsNew && aa != '') {
|
|
$.modalAlertNew("WMS00091");
|
|
return;
|
|
}
|
|
|
|
obj += rowData.Code + ",";
|
|
objArr += "'" + rowData.Code + "',";
|
|
|
|
}
|
|
|
|
if (aa != '') {
|
|
gridList2(flag);
|
|
$.currentWindow().$("#gridList").trigger("reloadGrid");
|
|
} else {
|
|
$.submitForm({
|
|
url: "/WMS/PickMaterial/MergeMaterial?Type=" + Type + "&" + Math.random(),
|
|
param: {
|
|
keyValue: obj
|
|
},
|
|
success: function () {
|
|
|
|
gridList2(flag);
|
|
$.currentWindow().$("#gridList").trigger("reloadGrid");
|
|
|
|
|
|
}
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function btnPrint() {
|
|
debugger;
|
|
var Type = $("#selShow").val();
|
|
var Mechanism = $("#txt_Mechanism").val();
|
|
var InvCode = $("#txt_InvCode").val();
|
|
var mold = '';
|
|
if (mark == '') {
|
|
$.modalAlertNew("WMS00093");
|
|
return;
|
|
}
|
|
if (mark == '合并拣料') {
|
|
var objArr = '';
|
|
var arr = [];
|
|
var obj_Item1 = $("#gridList2");
|
|
var rowIds_Item1 = obj_Item1.getDataIDs();
|
|
var arrayData_Item1 = new Array();
|
|
var Enables = '';
|
|
if (rowIds_Item1.length > 0) {
|
|
debugger;
|
|
for (var i = 0; i < rowIds_Item1.length; i++) {
|
|
var RowData_Item1 = obj_Item1.getRowData(rowIds_Item1[0]);
|
|
objArr += "'" + RowData_Item1.MergeID + "',";
|
|
objArr = objArr.slice(0, objArr.length - 1);
|
|
objArr = "" + objArr + "|";
|
|
arr.push(objArr);
|
|
}
|
|
Arguments = arr;
|
|
mold = 'HBJL00001';
|
|
}
|
|
}
|
|
if (mark == '拣料') {
|
|
var objArr = '';
|
|
var arr = [];
|
|
var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
|
|
for (var i = 0; i < objList.length; i++) {
|
|
var objArr = '';
|
|
var rowId = objList[i];
|
|
var rowData = $("#gridList").jqGrid('getRowData', rowId);
|
|
//if (Type = '1' && Mechanism != '') {
|
|
// objArr += "'" + rowData.Code + Mechanism + "',";
|
|
//} else if (Type = '1' && InvCode != '') {
|
|
// objArr += "'" + rowData.Code + InvCode + "',";
|
|
//} else if (Type = '1' && InvCode != '' && Mechanism != '') {
|
|
// objArr += "'" + rowData.Code + Mechanism + InvCode + "',";
|
|
//} else if (Type = '1'&& InvCode == '' && Mechanism == '') {
|
|
// objArr += "'" + rowData.Code + "',";
|
|
//}
|
|
//else {
|
|
objArr += "'" + rowData.Code + "',";
|
|
//}
|
|
|
|
objArr = objArr.slice(0, objArr.length - 1);
|
|
objArr = "" + objArr + "|";
|
|
arr.push(objArr);
|
|
|
|
}
|
|
Arguments = arr;
|
|
mold = 'JL00001';
|
|
}
|
|
|
|
// sessionStorage.setItem("Arguments", Arguments); // 存储参数
|
|
$.modalOpen({
|
|
id: "PrintLot",
|
|
title: "打印",
|
|
url: "/WMS/Print/PrintView?Arguments=" + encodeURI(encodeURI(Arguments)) + "&mold=" + mold + "&" + Math.random(),
|
|
// url: "/WMS/Print/PrintView?&mold=" + mold + "&" + Math.random(),
|
|
width: "550px",
|
|
height: "1000px",
|
|
callBack: function (iframeId) {
|
|
top.frames[iframeId].submitForm();
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
|
|
function GetPickingListType() {
|
|
$.ajax({
|
|
url: "/WMS/PickMaterial/GetPickingListType",
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
if (data != false && data != null && data.length > 0) {
|
|
$("#selShow").find("option").remove();
|
|
//$("#selShow").append("<option value=''>==请选择站点==</option>");
|
|
for (var i = 0; i < data.length; i++) {
|
|
$("#selShow").append("<option value='" + data[i].Code + "'>" + data[i].Name + "</option>");
|
|
}
|
|
$("#selShow").val([data[0].Code]).trigger("change");
|
|
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
function btnSave() {
|
|
debugger;
|
|
var sign = '';
|
|
var Type = $("#selShow").val();
|
|
var Mechanism = $("#txt_Mechanism").val();
|
|
var array=[];
|
|
if (Mechanism!="") {
|
|
$.modalAlert("单据已开启部分拣料功能,无法保存!", "warning");
|
|
return;
|
|
}
|
|
$.ajax({
|
|
url: "/WMS/PickMaterial/SeachPickingListType" + "?" + Math.random() + "&Type=" + Type,
|
|
dataType: "json",
|
|
type: "post",
|
|
async: false,
|
|
success: function (data) {
|
|
sign = data.count;
|
|
}
|
|
});
|
|
if (sign!=true) {
|
|
$.modalAlert("该类型单据暂未开启占料保存功能!", "warning");
|
|
return;
|
|
}
|
|
var objLotNo='';
|
|
var objArr = '';
|
|
var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
|
|
for (var i = 0; i < objList.length; i++) {
|
|
var rowId = objList[i];
|
|
var rowData = $("#gridList").jqGrid('getRowData', rowId);
|
|
//if (Number(rowData.iQuantity) > Number(rowData.QTY) && rowData.LotNO=="") {
|
|
// $.modalAlert("单据:" + rowData.Code + ",行号:" + rowData.Sequence + "条码库存数量不足!", "warning");
|
|
// return;
|
|
//}
|
|
objArr += "'" + rowData.Code + "',";
|
|
}
|
|
var obj_Item1 = $("#gridList2");
|
|
var rowIds_Item1 = obj_Item1.getDataIDs();
|
|
var arrayData_Item1 = new Array();
|
|
if (rowIds_Item1.length > 0) {
|
|
|
|
for (var i = 0; i < rowIds_Item1.length; i++) {
|
|
var RowData_Item1 = obj_Item1.getRowData(rowIds_Item1[i]);
|
|
/* if (RowData_Item1.LotNO != "") {*/
|
|
var obj = {
|
|
Code: RowData_Item1.Code,
|
|
Sequence: RowData_Item1.Sequence,
|
|
InvCode: RowData_Item1.InvCode,
|
|
InvName: RowData_Item1.InvName,
|
|
InvStd: RowData_Item1.InvStd,
|
|
iQuantity: RowData_Item1.iQuantity,
|
|
InvUnit: RowData_Item1.InvUnit,
|
|
WarehouseCode: RowData_Item1.WarehouseCode,
|
|
LocationCode: RowData_Item1.LocationCode,
|
|
QTY: RowData_Item1.QTY,
|
|
LotNO: RowData_Item1.LotNO,
|
|
SendQTY: RowData_Item1.SendQTY
|
|
};
|
|
/* }*/
|
|
array.push(obj)
|
|
}
|
|
|
|
}
|
|
|
|
|
|
$.modalConfirm("确定占料保存吗?", function (r) {
|
|
if (r) {
|
|
$.submitForm({
|
|
url: "/WMS/PickMaterial/SaveSeizeMaterial?flag=" + flag + "&Type=" + Type + "&ID=" + objArr + "&LotNoInfo=" + objLotNo + "&" + Math.random(),
|
|
param: { keyValue: JSON.stringify(objArr), obj: JSON.stringify(array) },
|
|
success: function () {
|
|
// $.currentWindow().$("#gridList").trigger("reloadGrid");
|
|
}
|
|
})
|
|
}
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function fullscreen() {
|
|
var docElm = document.documentElement;
|
|
if (docElm.requestFullscreen) {
|
|
docElm.requestFullscreen();
|
|
} else if (docElm.mozRequestFullScreen) {
|
|
docElm.mozRequestFullScreen();
|
|
} else if (docElm.webkitRequestFullScreen) {
|
|
docElm.webkitRequestFullScreen();
|
|
} else if (docElm.msRequestFullscreen) {
|
|
docElm.msRequestFullscreen();
|
|
}
|
|
$(window).bind('resize', function () {
|
|
$("#gridList").setGridWidth($(window).width());
|
|
}).trigger('resize');
|
|
$(window).bind('resize', function () {
|
|
$("#gridList").setGridHeight($(window).height());
|
|
}).trigger('resize');
|
|
}
|
|
</script>
|
|
|
|
|
|
<div class="topPanel" style="height:60px;">
|
|
<div class="toolbar">
|
|
<div class="btn-group">
|
|
|
|
<a id="NF-Material" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnMaterial()"><i class="fa fa-pencil-square-o"></i>拣配</a>
|
|
<a id="NF-MergeMaterial" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnMergeMaterial()"><i class="fa fa-pencil-square-o"></i>合并拣配</a>
|
|
<a id="NF-BackMaterial" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnBackMaterial()"><i class="fa fa-pencil-square-o"></i>回撤拣配</a>
|
|
<a id="NF-Save" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnSave()"><i class="fa fa-pencil-square-o"></i>保存</a>
|
|
<a id="NF-Print" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnPrint()"><i class="fa fa-pencil-square-o"></i>打印</a>
|
|
<a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
|
|
|
|
</div>
|
|
<script>$('.toolbar').authorizeButton()</script>
|
|
</div>
|
|
<div class="search">
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
<label> 类型:</label>
|
|
</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<select id="selShow" name="F_Target" class="form-control" style="width: 80px;" onchange="Selchange()">
|
|
@*<option value="1" selected="selected">工单备料</option>
|
|
<option value="2" selected="selected">工单领料</option>
|
|
<option value="3" selected="selected">工单材料出库</option>
|
|
<option value="4" selected="selected">委外备料</option>
|
|
<option value="5" selected="selected">委外领料</option>
|
|
<option value="6" selected="selected">委外材料出库</option>
|
|
<option value="7" selected="selected">销售发货</option>
|
|
<option value="8" selected="selected">其它出库</option>
|
|
<option value="9" selected="selected">借用</option>
|
|
<option value="10" selected="selected">物料调拨</option>
|
|
<option value="11" selected="selected">两步调出</option>
|
|
<option value="12" selected="selected">补料</option>*@
|
|
</select>
|
|
</div>
|
|
</td>
|
|
<td style="text-align:right;"><label class="lglabel" for="txt_POCode"> 单据号</label>:</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input id="txt_POCode" type="text" class="form-control" style="width: 100px;">
|
|
</div>
|
|
</td>
|
|
<td style="text-align:right;"><label class="lglabel" for="txt_InvCode"> 料品编码</label>:</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input id="txt_InvCode" type="text" class="form-control" style="width: 100px;">
|
|
</div>
|
|
</td>
|
|
<td style="text-align:right;" class="Mechanism"><label class="lglabel" for="txt_Mechanism"> 机构</label>:</td>
|
|
<td class="Mechanism">
|
|
<div class="input-group">
|
|
<input id="txt_Mechanism" type="text" class="form-control" style="width: 100px;">
|
|
</div>
|
|
</td>
|
|
|
|
|
|
<td style="text-align:right;"><label class="lglabel" for="txt_TimeFrom"> 日期(从)</label>:</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input id="TimeFrom" name="Time" type="text" class="form-control required" style="width:80px;" maxlength="10" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd'})" placeholder="日期(从)" />
|
|
</div>
|
|
</td>
|
|
<td style="text-align:right;"><label class="lglabel" for="txt_TimeArrive"> 日期(到)</label>:</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<input id="TimeArrive" name="Time" type="text" class="form-control required" style="width:80px;" maxlength="10" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" placeholder="日期(到)" />
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<span class="input-group-btn">
|
|
<button id="btn_search" type="button" class="btn btn-primary" onclick="Selchange()"><i class="fa fa-search"></i></button>
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="gridPanel" id="gridPanel" style="width:99%">
|
|
<span><strong>详细信息</strong></span>
|
|
<table id="gridList"></table>
|
|
|
|
</div>
|
|
<div class="gridPanel" id="gridPanel2" style="width:99%">
|
|
<span><strong>合并信息</strong></span>
|
|
<table id="gridList2"></table>
|
|
</div>
|