|
|
@{ ViewBag.Title = "Index"; Layout = "~/Views/Shared/_Index.cshtml";}<script src="~/Content/js/datepicker/WdatePicker.js"></script><script> debugger; var _Clos = new Array(); var Type = $.request("Type"); var mold = $.request("mold"); var Name = "单据号"; var ColModelMain = []; var ColModelSub = []; $(function () { SetCols(); if (Type != '1') { $("#NF - Prints").css('display', 'none'); $("#NF-btnInWareHouse").css('display', 'none'); } if (Type != '13' && Type != '9') { $(".HideItems2").css('display', 'none'); } if (Type != '1' && Type!='12') { $(".HideItemsTime").css('display', 'none'); } if (Type != '3' && Type != '7' && Type != '8') { $(".selStatus").css('display', 'none'); } if (Type == '17') { Name = "条码号"; $("#POCodeShowLable").text(Name);
} else { $("#POCodeShowLable").text(Name); } if (Type!='3') { $("#GDLX").css('display', 'none'); $("#GDLX2").css('display', 'none'); $("#NF-Rebind").css('display', 'none');
} if (Type == '1' || Type == '2' || Type == '3' || Type == '4' || Type == '5' || Type == '6' || Type == '9' || Type == '17') { $(".HideItems").css('display', 'none'); }
if (Type == '3') { //$("#GDLX").css('display', 'block'); //$("#GDLX2").css('display', 'block'); //Select_SelGDLX(); gridList3();
} //审核委外到货单生成条码 if (Type == '8') { gridList8(); } })
function SetCols() { $.ajax({ url: "/Print/SelectColumnName?" + Math.random(), dataType: "json", async: false, success: function (data) { var cols = new Array(); var cols1 = new Array();
if (Type == '3') { var collast = { label: "主键", name: "ID", hidden: true, key: true }; cols.push(collast); var collast = { label: '工单号', name: 'MOCode', width: 120, align: 'left' }; cols.push(collast); var collast = { label: '工单行号', name: 'Sequence', width: 50, align: 'left' }; cols.push(collast); var collast = { label: 'ERP工单行ID', name: 'MODetailID', hidden: true }; cols.push(collast); var collast = { label: '已入库数量', name: 'RCVQuantity', hidden: true, }; cols.push(collast); var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '料品名称', name: 'InvName', width: 60, align: 'left', }; cols.push(collast); var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '仓库编码', name: 'WHCode', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '仓库名称', name: 'WHName', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '工单部门', name: 'DepName', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '工单创建日期', name: 'CreateDateTime', width: 60, align: 'left', }; cols.push(collast); var collast = { label: "状态", name: "MOStatus", width: 60, align: "left", formatter: function (cellvalue) { if (cellvalue == "1") { return "初始"; } else if (cellvalue == "2") { return "下发"; } else if (cellvalue == "3") { return "关单"; } else { return ""; } } }; cols.push(collast); var collast = { label: '规格型号', name: 'InvStd', width: 60, align: 'left', }; cols.push(collast); var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', }; cols.push(collast); var collast = { label: '已入库数量', name: 'RCVQuantity', width: 60, align: 'left', }; cols.push(collast); var collast = { label: '可入库数量', name: 'ERPNum', width: 100, align: 'left' }; cols.push(collast);
var collast = { label: '工单备注', name: 'MOMemo', width: 100, align: 'left' }; cols.push(collast);
$.ajax({ url: "/Print/SelectTableColumnName?" + Math.random(), dataType: "json", async: false, success: function (data) { if (data != null && data.length > 0) { DateList = data; for (var i = 0; i < data.length; i++) { var TableCode = data[i].TableCode; if (TableCode == "ICSMO") { var Code = data[i].Code; var Name = data[i].Name; var obj = new Array(); obj = { label: Name, name: Code, width: 80, align: "left" } cols.push(obj); } if (TableCode == "ICSInventory") { var Code = data[i].Code; var Name = data[i].Name; var obj = new Array(); obj = { label: Name, name: Code, width: 80, align: "left" } cols.push(obj); } } } _Clos = cols;
}
}); }
//审核委外到货单生成条码 if (Type == '8') { var collast = { label: "主键", name: "ID", hidden: true, key: true }; cols.push(collast); var collast = { label: '单据号', name: 'ODNCode', width: 120, align: 'left' }; cols.push(collast); var collast = { label: '行号', name: 'Sequence', width: 50, align: 'left' }; cols.push(collast); var collast = { label: '委外采购订单号', name: 'OOCode', width: 120, align: 'left' }; cols.push(collast); var collast = { label: '委外采购订单行号', name: 'OOSequence', width: 50, align: 'left' }; cols.push(collast); var collast = { label: '委外订单表体ID', name: 'OODetailID', hidden: true }; cols.push(collast); var collast = { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' }; cols.push(collast); var collast = { label: '供应商名称', name: 'VenName', width: 120, align: 'left' }; cols.push(collast); var collast = { label: '料品编码', name: 'InvCode', width: 50, align: 'left' }; cols.push(collast); var collast = { label: '料品名称', name: 'InvName', width: 120, align: 'left' }; cols.push(collast); var collast = { label: '是否批号管理', name: 'BatchEnable', width: 50, align: 'Center' }; cols.push(collast); var collast = { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' }; cols.push(collast); var collast = { label: '料品型号', name: 'InvStd', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '料品单位', name: 'InvUnit', width: 50, align: 'left' }; cols.push(collast); var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' }; cols.push(collast); //var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' }; //cols.push(collast); var collast = { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', }; cols.push(collast); var collast = { label: '未入库数量', name: 'NRCVQuantity', width: 60, align: 'left', }; cols.push(collast); var collast = { label: '币种', name: 'Currency', width: 60, align: 'left', }; cols.push(collast); var collast = { label: '料品失效天数', name: 'EffectiveDays', width: 60, align: 'left', }; cols.push(collast); var collast = { label: '料品是否开启失效', name: 'EffectiveEnable', width: 60, align: 'left', }; cols.push(collast); var collast = { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', }; cols.push(collast); var collast = { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' }; cols.push(collast); $.ajax({ url: "/Print/SelectTableColumnName?" + Math.random(), dataType: "json", async: false, success: function (data) { if (data != null && data.length > 0) { DateList = data; for (var i = 0; i < data.length; i++) { var TableCode = data[i].TableCode; if (TableCode == "ICSODeliveryNotice") { var Code = data[i].Code; var Name = data[i].Name; var obj = new Array(); obj = { label: Name, name: Code, width: 80, align: "left" } cols.push(obj); } if (TableCode == "ICSInventory") { var Code = data[i].Code; var Name = data[i].Name; var obj = new Array(); obj = { label: Name, name: Code, width: 80, align: "left" } cols.push(obj); //cols1.push(obj); } } } _Clos = cols; //_Clos1 = cols1; }
}); }
var cols1 = new Array(); var collast1 = { label: "主键", name: "ID", hidden: true, key: true }; cols1.push(collast1); var collast1 = { label: "来源单据号", name: "TransCode", width: 150, align: 'left' }; cols1.push(collast1); var collast1 = { label: '来源单据行', name: 'TransSequence', width: 80, align: 'left' }; cols1.push(collast1); var collast1 = { label: '条码', name: 'LotNo', width: 200, align: 'left' }; cols1.push(collast1); var collast1 = { label: '条码数量', name: 'Quantity', width: 80, align: 'left' }; cols1.push(collast1); var collast1 = { label: '辅计量数量', name: 'Amount', width: 80, align: 'left' }; cols1.push(collast1); var collast1 = { label: '生产日期', name: 'ProductDate', width: 80, align: 'left' }; cols1.push(collast1); var collast1 = { label: '失效日期', name: 'ExpirationDate', width: 80, align: 'left' }; cols1.push(collast1); var collast1 = { label: '有效期天数', name: 'EffectiveDays', width: 80, align: 'left' }; cols1.push(collast1); var collast1 = { label: '备注', name: 'EATTRIBUTE5', width: 100, align: 'left' }; cols1.push(collast1); var collast1 = { label: '是否入库', name: 'isStorage', width: 100, align: 'left' }; cols1.push(collast1); var collast1 = { label: '是否检验', name: 'isInspection', width: 100, align: 'left' }; cols1.push(collast1); var collast1 = { label: '是否免检', name: 'isExemption', width: 100, align: 'left' }; cols1.push(collast1); var collast1 = { label: '操作人', name: 'MUSERName', width: 100, align: 'left' }; cols1.push(collast1); var collast1 = { label: '操作时间', name: 'MTIME', width: 150, align: 'left' }; cols1.push(collast1);
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); } } _Clos = cols; _Clos1 = cols1; } }); }
//成品 function gridList3() { var $gridList = $("#gridList"); var queryJson = { POCode: $("#txt_POCode").val(), InvCode: $("#txt_InvCode").val(), InvName: $("#txt_InvName").val(), BatchCode: $("#txt_BatchCode").val(), POStatus: $("#selShow").val(), SelGDLX: $("#SelGDLX option:checked").val(), WHStatus: $("#selStatus").val(), InvStd: $("#txt_InvStd").val(), FromTime: '', ToTime: '', WHCode: '', } $gridList.dataGrid({ url: "/MFWMS/ScrapDocumentDealWith/GetGridJsonChengPing" + "?" + Math.random(), postData: { queryJson: JSON.stringify(queryJson) }, height: $(window).height() - 200, width: $(window).width() - 300, colModel: _Clos, width: "100%", autowidth: true, gridComplete: function () { }, pager: "#gridPager", sortname: "MOCode,REPLICATE('0',10-len(Sequence))+Sequence ", sortorder: "asc", viewrecords: true, multiselect: true, subGrid: true, // (1)开启子表格支持 subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数 $("#gridList").jqGrid("setSelection", rowid, false); bindSubGrid3(subgrid_id, rowid) } });
$("#warehouse a.btn-default").click(function () { $("#warehouse a.btn-default").removeClass("active"); $(this).addClass("active"); $('#btn_search').trigger("click"); }); $("#btn_search").click(function () { var warehouse = $("#warehouse a.active").attr('data-value'); var queryJson = { POCode: $("#txt_POCode").val(), InvCode: $("#txt_InvCode").val(), InvName: $("#txt_InvName").val(), BatchCode: $("#txt_BatchCode").val(), POStatus: $("#selShow").val(), SelGDLX: $("#SelGDLX option:checked").val(), WHStatus: $("#selStatus").val(), InvStd: $("#txt_InvStd").val(), FromTime: '', ToTime: '', WHCode: '',
} $gridList.jqGrid('setGridParam', { postData: { queryJson: JSON.stringify(queryJson) }, }).trigger('reloadGrid'); });
}
function bindSubGrid3(subgrid_id, rowid) { $("#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 MOCode = $("#gridList").jqGrid('getRowData', rowid).MOCode; var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence; // (6)创建jqGrid对象 $("#" + subgrid_table_id).dataGrid({ cellEdit: true, url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + MOCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数 colModel: _Clos1, shrinkToFit: true,//宽度自适应 multiselect: true, prmNames: { search: "search" }, viewrecords: true, height: "100%", rowNum: 20, pager: subgrid_pager_id,
}); }
//审核委外到货单生成条码 function gridList8() { var $gridList = $("#gridList"); var queryJson = { POCode: $("#txt_POCode").val(), VenCode: $("#txt_VenCode").val(), VenName: $("#txt_VenName").val(), InvCode: $("#txt_InvCode").val(), InvName: $("#txt_InvName").val(), BatchCode: $("#txt_BatchCode").val(), POStatus: $("#selShow").val(), WHStatus: $("#selStatus").val(), InvStd: $("#txt_InvStd").val(), } $gridList.dataGrid({ url: "/WMS/WMSCreateItemLot/GetGridJsonWWSHDH" + "?" + Math.random(), postData: { queryJson: JSON.stringify(queryJson) }, height: $(window).height() - 200, width: $(window).width() - 300, colModel: _Clos, //colModel: [ // { label: "主键", name: "ID", hidden: true, key: true }, // { label: '单据号', name: 'ODNCode', width: 120, align: 'left' }, // { label: '行号', name: 'Sequence', width: 50, align: 'left' }, // { label: '委外采购订单号', name: 'OOCode', width: 120, align: 'left' }, // { label: '委外采购订单行号', name: 'OOSequence', width: 50, align: 'left' }, // { label: '供应商代码', name: 'VenCode', width: 120, align: 'left' }, // { label: '供应商名称', name: 'VenName', width: 120, align: 'left' }, // { label: '料品编码', name: 'InvCode', width: 50, align: 'left' }, // { label: '料品名称', name: 'InvName', width: 120, align: 'left' }, // { label: '料品描述', name: 'InvDesc', width: 50, align: 'left' }, // { label: '料品型号', name: 'InvStd', width: 150, align: 'left' }, // { label: '料品单位', name: 'InvStd', width: 50, align: 'left' }, // { label: '数量', name: 'Quantity', width: 100, align: 'left' }, // { label: '批次', name: 'BatchCode', width: 100, align: 'left' }, // { label: '已生成数量', name: 'LOTQTY', width: 100, align: 'left' }, // { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' }, // { label: '入库数量', name: 'RCVQuantity', width: 60, align: 'left', }, // { label: '币种', name: 'Currency', width: 60, align: 'left', }, // { label: '创建人', name: 'CreatePerson', width: 60, align: 'left', }, // { label: '创建时间', name: 'CreateDateTime', width: 100, align: 'left' }, //], //colModel: ColModelMain, width: "100%", autowidth: true, //shrinkToFit: true, gridComplete: function () { }, pager: "#gridPager", //sortname: 'ODNCode,cast(Sequence as int)', sortname: "ODNCode,REPLICATE('0',10-len(Sequence))+Sequence ", sortorder: "asc", viewrecords: true, multiselect: true, //beforeSelectRow: function (rowid, e) { // $("#gridList").jqGrid('resetSelection'); // return (true); //}, subGrid: true, // (1)开启子表格支持 subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数 $("#gridList").jqGrid("setSelection", rowid, false); bindSubGrid8(subgrid_id, rowid) } });
$("#warehouse a.btn-default").click(function () { $("#warehouse a.btn-default").removeClass("active"); $(this).addClass("active"); $('#btn_search').trigger("click"); }); $("#btn_search").click(function () { var warehouse = $("#warehouse a.active").attr('data-value'); var queryJson = { POCode: $("#txt_POCode").val(), VenCode: $("#txt_VenCode").val(), VenName: $("#txt_VenName").val(), InvCode: $("#txt_InvCode").val(), InvName: $("#txt_InvName").val(), BatchCode: $("#txt_BatchCode").val(), POStatus: $("#selShow").val(), WHStatus: $("#selStatus").val(), InvStd: $("#txt_InvStd").val(), } $gridList.jqGrid('setGridParam', { postData: { queryJson: JSON.stringify(queryJson) }, }).trigger('reloadGrid'); });
} function bindSubGrid8(subgrid_id, rowid) { $("#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 ODNCode = $("#gridList").jqGrid('getRowData', rowid).ODNCode; var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence; // (6)创建jqGrid对象 $("#" + subgrid_table_id).dataGrid({ cellEdit: true, url: "/WMS/WMSCreateItemLot/GetSubGridJson?ApplyNegCode=" + ODNCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数 //colModel: [ // { label: "主键", name: "ID", hidden: true, key: true }, // { label: "来源单据号", name: "TransCode", width: 200, align: 'left' }, // { label: '来源单据行', name: 'TransSequence', width: 200, align: 'left' }, // { label: '条码', name: 'LotNo', width: 200, align: 'left' }, // { label: '条码数量', name: 'Quantity', width: 200, align: 'left' }, // { label: '操作人', name: 'MUSERName', width: 200, align: 'left' }, // { label: '操作时间', name: 'MTIME', width: 200, align: 'left' }, //], colModel: _Clos1, //colModel: ColModelSub, shrinkToFit: true,//宽度自适应 multiselect: true, prmNames: { search: "search" }, viewrecords: true, height: "100%", rowNum: 20, pager: subgrid_pager_id,
}); }
function btnDelete() { var objArr = ''; var obj = $("#gridList").jqGrid("getRowData"); for (var i = 0; i < obj.length; i++) { var $SubGird = $("#gridList_" + obj[i].ID + "_t"); var rowData = $SubGird.jqGrid('getGridParam', 'selarrrow'); if (rowData != "undefined" && rowData != null) { for (var j = 0; j < rowData.length; j++) { objArr += "'" + rowData[j] + "',"; } } } if (objArr == "") { $.modalAlertNew("WMS00099"); return; } $.deleteForm({ url: "/WMS/WMSCreateItemLot/DeleteItemLot", param: { keyValue: JSON.stringify(objArr) }, success: function () { $.currentWindow().$("#gridList").trigger("reloadGrid"); } }) }
function dateChange(num, date) { if (!date) { date = new Date();//没有传入值时,默认是当前日期 date = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate(); } date += " 00:00:00";//设置为当天凌晨12点 date = Date.parse(new Date(date)) / 1000;//转换为时间戳 date += (86400) * num;//修改后的时间戳 var newDate = new Date(parseInt(date) * 1000);//转换为时间 return newDate.getFullYear() + '-' + (newDate.getMonth() + 1) + '-' + newDate.getDate(); }
function btnCreate() { debugger; var PoStatus; var jsonData = ''; var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据 if (ids.length != 1) { $.modalAlertNew("WMS00100"); return; } var POCode = ""; var PORow = ""; if (Type == '3') { for (var i in ids) { MODetailID = $("#gridList").jqGrid('getRowData', ids[i]).MODetailID; MOCode = $("#gridList").jqGrid('getRowData', ids[i]).MOCode; Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence; InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode; Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity; ID = $("#gridList").jqGrid('getRowData', ids[i]).ID; } $.modalOpen({ id: "FormAddItemLot", title: "成品报废", url: "/MFWMS/ScrapDocumentDealWith/ScrapNumInput?MOCode=" + encodeURI(encodeURI(MOCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 3 + "&MODetailID=" + MODetailID + "&Quantity=" + Quantity + "&ID=" + ID + "&" + Math.random(), width: "550px", height: "1000px", callBack: function (iframeId) { top.frames[iframeId].submitForm(); } }); } else if (Type == '8') { for (var i in ids) { ODNCode = $("#gridList").jqGrid('getRowData', ids[i]).ODNCode; Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence; OODetailID = $("#gridList").jqGrid('getRowData', ids[i]).OODetailID; InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode; ID = $("#gridList").jqGrid('getRowData', ids[i]).ID; Quantity = $("#gridList").jqGrid('getRowData', ids[i]).Quantity; } $.modalOpen({ id: "FormAddItemLot", title: "委外半成品报废", url: "/MFWMS/ScrapDocumentDealWith/ScrapNumInput?ODNCode=" + ODNCode + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 8 + "&ID=" + ID + "&OODetailID=" + OODetailID + "&Quantity=" + Quantity + "&" + Math.random(), width: "550px", height: "1000px", callBack: function (iframeId) { top.frames[iframeId].submitForm(); } }); } }
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'); }
function btnPrint() { debugger; if (mold == '') { if (Type == '1') { mold = '00001'; }//生产退料生成条码 if (Type == '2') { mold = '00002'; }//委外退料生成条码 if (Type == '3') { mold = '00003'; }//工单成品生成条码 if (Type == '4') { mold = '00004'; }//销售退货生成条码 if (Type == '5') { mold = '00005'; }//其他入库生成条码 if (Type == '6') { mold = '00006'; }//归还单生成条码 if (Type == '7') { mold = '00007'; }//普通到货单生成条码 if (Type == '8') { mold = '00008'; }//委外到货单生成条码 if (Type == '9') { mold = '00009'; }//成品入库单生成条码 if (Type == '10') { mold = '00010'; }//拒收单生成条码 if (Type == '11') { mold = '00011'; }//委外拒收单生成条码 if (Type == '12') { mold = '00012'; }//领料申请退料 if (Type == '13') { mold = '00013'; }//材料出库退料 if (Type == '14') { mold = '00014'; }//委外领料申请退料 if (Type == '15') { mold = '00015'; }//委外材料出库退料 if (Type == '16') { mold = '00016'; }//返工工单 if (Type == '17') { mold = 'BHG00001'; }//不合格条码入库 if (Type == '18') { mold = 'FCP00001'; }//副产品生成条码 if (Type == '200') { mold = '00018'; }//采购入库生成条码 if (Type == '201') { mold = '00019'; }//委外采购入库生成条码 if (Type == '202') { mold = '00020'; }//委外采购入库生成条码 }
var objArr = ''; var arr = []; var obj = $("#gridList").jqGrid("getRowData"); for (var i = 0; i < obj.length; i++) { var $SubGird = $("#gridList_" + obj[i].ID + "_t"); var rowData = $SubGird.jqGrid('getGridParam', 'selarrrow'); if (rowData != "undefined" && rowData != null && rowData.length != 0) { for (var j = 0; j < rowData.length; j++) { objArr += "'" + rowData[j] + "',"; } objArr = objArr.slice(0, objArr.length - 1); objArr = "" + objArr + "|"; arr.push(objArr); } } if (objArr == "") { $.modalAlertNew("WMS00101"); return; } $.modalOpen({ id: "PrintLot", title: "打印", url: "/WMS/Print/PrintView?Arguments=" + encodeURI(encodeURI(arr)) + "&mold=" + mold + "&" + Math.random(), width: "550px", height: "1000px", callBack: function (iframeId) { top.frames[iframeId].submitForm(); } }); }
function btn_ExportAll() { debugger; var objArr = ''; var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); for (var i in ids) { objArr += "'" + $("#gridList").jqGrid('getRowData', ids[i]).ID + "',"; } if (objArr=="") { $.modalAlert("请选择单据后导出!"); return; } var postData = "&Type=" + Type + ""; //postData += "&ID=" + ID
postData += "&ID=" + objArr; $.download("/WMS/WMSCreateItemLot/StatementExportAll" + "?" + Math.random(), postData, 'post'); } function Select_SelGDLX() { $("#SelGDLX").find("option").remove(); var DeptName = $("#SelGDLX option:checked").text(); $("#SelGDLX").append("<option value=''>--请选择--</option>"); $.ajax({ url: "/WMS/WMSCreateItemLot/SelGDLX" + "?" + Math.random(), dataType: "json", async: false, success: function (data) { if (data != null && data.length > 0) { for (var i = 0; i < data.length; i++) { $("#SelGDLX").append("<option value='" + data[i].Code + "'>" + data[i].Name + "</option>"); } } } }); $("#SelGDLX option:checked").val(''); } function btnCreateLook() { var MODetailID = ''; var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow'); for (var i = 0; i < objList.length; i++) { var rowId = objList[i]; var rowData = $("#gridList").jqGrid('getRowData', rowId); MODetailID = rowData.MODetailID; } $.modalOpenClean({ id: "FormMoPick", title: "工单子件信息", url: "/WMS/WMSCreateItemLot/FormMoPick" + "?" + Math.random() + "&MODetailID=" + MODetailID, width: "90%", height: "90%", callBack: function (iframeId) { top.frames[iframeId].submitForm(); } }); }
function btn_Import() { $.modalOpen({ id: "Upload", title: "导入", url: "/WMS/WMSCreateItemLot/ImportLot?" + Math.random(), width: "400px", height: "200px", btn: null, });
}
function btnPrints() { debugger; var mold = ''; if (Type == '1') { mold = '00001'; }//生产退料生成条码 if (Type == '2') { mold = '00002'; }//委外退料生成条码 if (Type == '3') { mold = '00003'; }//工单成品生成条码 if (Type == '7') { mold = '00007'; }//普通到货单生成条码 if (Type == '8') { mold = '00008'; }//委外到货单生成条码 if (Type == '9') { mold = '00009'; }//成品入库单生成条码 if (Type == '10') { mold = '00010'; }//拒收单生成条码 if (Type == '11') { mold = '00011'; }//委外拒收单生成条码 if (Type == '12') { mold = '00012'; }//领料申请退料 if (Type == '13') { mold = '00013'; }//材料出库退料 if (Type == '14') { mold = '00014'; }//委外领料申请退料 if (Type == '15') { mold = '00015'; }//委外材料出库退料 if (Type == '16') { mold = '00016'; }//返工工单 if (Type == '17') { mold = 'BHG00001'; }//不合格条码入库 if (Type == '18') { mold = 'FCP00001'; }//副产品生成条码 var objArr = ''; var arr = []; var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow'); for (var i = 0; i < objList.length; i++) { var rowId = objList[i]; var rowData = $("#gridList").jqGrid('getRowData', rowId); objArr += "'" + rowData.ID + "',"; } objArr = objArr.slice(0, objArr.length - 1); if (objArr == "") { $.modalAlertNew("WMS00110"); return; } objArr = "" + objArr + "|"; arr.push(objArr);
$.modalOpen({ id: "PrintLot", title: "打印", url: "/WMS/Print/PrintView?Arguments=" + encodeURI(encodeURI(arr)) + "&mold=" + mold + "&" + Math.random(), width: "550px", height: "1000px", callBack: function (iframeId) { top.frames[iframeId].submitForm(); } }); } function btnInWareHouse() { debugger; var objArr = ''; var arr = []; var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow'); for (var i = 0; i < objList.length; i++) { var rowId = objList[i]; var rowData = $("#gridList").jqGrid('getRowData', rowId); objArr += "'" + rowData.ID + "',"; } objArr = objArr.slice(0, objArr.length - 1); if (objArr == "") { $.modalAlertNew("WMS00110"); return; } arr.push(objArr);
$.submitForm({ url: "/WMS/WMSCreateItemLot/PostInWareHouse" , param: { IDs: JSON.stringify(objArr) }, success: function () { $.currentWindow().$("#gridList").trigger("reloadGrid"); } })
}
function btn_Rebind() { var objArr = ''; var obj = $("#gridList").jqGrid("getRowData"); for (var i = 0; i < obj.length; i++) { var $SubGird = $("#gridList_" + obj[i].ID + "_t"); var rowData = $SubGird.jqGrid('getGridParam', 'selarrrow'); if (rowData != "undefined" && rowData != null && rowData.length != 0) { for (var j = 0; j < rowData.length; j++) { var rowDataZ = $SubGird.jqGrid('getRowData', rowData[j]); objArr += "'" + rowDataZ.LotNo + "',"; } objArr = objArr.slice(0, objArr.length - 1); } } if (objArr == "") { $.modalAlert("请选择条码信息后,进行重新绑定!"); return; } $.modalOpen({ id: "ICSLotRebind", title: "条码重新绑定", url: "/WMS/WMSCreateItemLot/ICSLotRebind?LotNo=" + encodeURI(encodeURI(objArr)) + "&" + Math.random(), width: "500px", height: "350px", callBack: function (iframeId) { top.frames[iframeId].submitForm(); } });
}
</script><iframe id="ifrm" src="" width="0" height="0"></iframe><script>
</script>
<div class="topPanel" style="height:155px;"> <div class="toolbar"> <div class="btn-group"> <a id="NF-Create" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnCreate()"><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 id="NF-Prints" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnPrints()"><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 class="POCodeShow" style="text-align:right;"><label class="lglabel " id="POCodeShowLable" for="txt_POCode"> </label>:</td> <td class="POCodeShow"> <div class="input-group"> <input id="txt_POCode" type="text" class="form-control" style="width: 130px;"> </div> </td> <td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_VenCode"> 供应商代码</label>:</td> <td class="HideItems"> <div class="input-group HideItems"> <input id="txt_VenCode" type="text" class="form-control HideItems" style="width: 130px;"> </div> </td>
<td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_VenName"> 供应商名称</label>:</td> <td class="HideItems"> <div class="input-group HideItems"> <input id="txt_VenName" type="text" class="form-control HideItems" style="width: 130px;"> </div> </td> <td class="HideItems2" style="text-align:right;"><label class="lglabel HideItems2" for="txt_VenName"> 源头单据号</label>:</td> <td class="HideItems2"> <div class="input-group HideItems2"> <input id="txt_SCode" type="text" class="form-control HideItems2" style="width: 130px;"> </div> </td> <td class="HideItemsTime" style="text-align:right;"><label class="lglabel HideItemsTime" for="txt_VenName"> 日期(从)</label>:</td> <td class="HideItemsTime"> <div class="input-group HideItemsTime"> <input id="FromTime" name="FromTime" type="text" class="form-control HideItemsTime" style="width:130px;" maxlength="10" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" placeholder="日期(从)" /> </div> </td> <td class="HideItemsTime" style="text-align:right;"><label class="lglabel HideItemsTime" for="txt_VenName"> 日期(到)</label>:</td> <td class="HideItemsTime"> <div class="input-group HideItemsTime"> <input id="ToTime" name="ToTime" type="text" class="form-control HideItemsTime" style="width:130px;" maxlength="10" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd' })" placeholder="日期(到)" /> </div> </td>
</tr> <tr> <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: 130px;"> </div> </td>
<td style="text-align:right;"><label class="lglabel" for="txt_InvName"> 料品名称</label>:</td> <td> <div class="input-group"> <input id="txt_InvName" type="text" class="form-control" style="width: 130px;"> </div> </td> <td class="HideItems3" style="text-align:right;"><label class="lglabel HideItems3" for="txt_InvStd"> 规格型号</label>:</td> <td class="HideItems3"> <div class="input-group HideItems3"> <input id="txt_InvStd" type="text" class="form-control" style="width: 130px;"> </div> </td> <td style="text-align:right;"><label class="lglabel" for="txt_BatchCode"> 批次号</label>:</td> <td> <div class="input-group"> <input id="txt_BatchCode" type="text" class="form-control" style="width: 130px;"> </div> </td>
<td id="GDLX"> <label> 工单类型: </label> </td> <td id="GDLX2"> <div class="input-group"> <select id="SelGDLX" name="SelShow" class="form-control" style="width: 130px;"> <option value="标准订单">标准订单</option> <option value="样品订单">样品订单</option> </select> </div> </td>
</tr> <tr> <td> <label> 是否全部生成: </label> </td> <td> <div class="input-group"> <select id="selShow" name="F_Target" class="form-control" style="width: 130px;"> <option value="0">显示全部</option> <option value="1">已全部生成</option> <option value="2" selected="selected">未全部生成</option> </select> </div> </td> <td clsaa="Status"> <label> 是否全部入库: </label> </td> <td clsaa="Status"> <div class="input-group"> <select id="selStatus" name="F_Target" class="form-control" style="width: 130px;"> <option value="0">全部</option> <option value="1" selected="selected">未全部入库</option> <option value="2">已全部入库</option> </select> </div> </td> <td> <span class="input-group-btn"> <button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button> </span> </td> </tr>
</table> </div></div><div class="gridPanel"> <table id="gridList"></table> <div id="gridPager"></div></div>
|