|
|
@{ ViewBag.Title = "Index"; Layout = "~/Views/Shared/_Index.cshtml";}<style> .ui-jqgrid .ui-jqgrid-btable tbody tr.jqgrow td { overflow: inherit; word-wrap: break-word; }
.ui-jqgrid tr.jqgrow td { white-space: normal !important; height: auto; }</style><link href="~/Content/js/select2/select2.min.css" rel="stylesheet" /><link href="~/Content/css/bootstrap/bootstrap-select.css" rel="stylesheet" /><script src="~/Content/js/datepicker/WdatePicker.js"></script><script src="~/Content/js/bootstrap/bootstrap-select.js"></script><script src="~/Content/js/select2/select2.min.js"></script><script src="~/Content/js/layer/layer.js"></script>
<script> debugger; var Type = $.request("Type"); var _Clos = new Array(); var mold = $.request("mold"); var _MenuID = "";//菜单ID //var saveCode = new Array(); var DataCR = new Array();//保存数组 var Mtime = getLastMonthDate(); $(function () { //Modify on 20240126 来料检验、委外检验、其他入库检验: // 1、增加列:是否首次检验 如果料品第一次检验,显示:是 否则:否; // 2、增加列:是否加急 PDA扫了加急物料,显示:是 否则:否;是加急物料的突出颜色显示 SetCols(Type); $("#TimeFrom").val(Mtime); //来料检验 if (Type == '1') { gridList(); } //委外来料检验 if (Type == '3') { gridList2(); } if (Type != '1' && Type != '3') { $(".HideTxt3").css('display', 'none'); } //产成品检验 if (Type == '2') { $(".HideTxt").css('display', 'none'); $(".HideTxt2").css('display', 'none'); $("#NF-update").css('display', 'none'); gridList3(); } //其他入库 if (Type == '4') { $(".HideTxt").css('display', 'none'); $("#NF-update").css('display', 'none'); gridList4(); } //生产退料 if (Type == '5') { $(".HideTxt").css('display', 'none'); $(".HideTxt2").css('display', 'none'); $("#NF-update").css('display', 'none'); gridList5(); } //委外退料 if (Type == '6') { $(".HideTxt").css('display', 'none'); $(".HideTxt2").css('display', 'none'); $("#NF-update").css('display', 'none'); gridList6(); } //销售退货 if (Type == '7') { $(".HideTxt").css('display', 'none'); $(".HideTxt2").css('display', 'none'); $("#NF-update").css('display', 'none'); gridList7(); } //采购到货单检验 if (Type == '8') { $(".HideTxt").css('display', 'none'); $(".HideTxt2").css('display', 'none'); gridList8(); } //委外采购到货单检验 if (Type == '9') { $(".HideTxt").css('display', 'none'); $(".HideTxt2").css('display', 'none'); gridList9(); } //连副产品检验 if (Type == '10') { $(".HideTxt").css('display', 'none'); $(".HideTxt2").css('display', 'none'); gridList10(); } //在库检验 if (Type == '11') { $(".HideTxt").css('display', 'none'); $("#NF-update").css('display', 'none'); $(".HideTxt2").css('display', 'none'); $(".HideTxt4").css('display', 'none'); $("#NF-Approve").css('display', 'block'); $("#NF-SecApprove").css('display', 'block'); var selvalue = $("#selEnableShow"); selvalue.val("0"); gridList11(); $("#selShow").append("<option value='3'>已审核</option>"); $("#selShow").append("<option value='4'>已复审</option>"); } //采购入库单条码检验 if (Type == '22') { $(".HideTxt").css('display', 'none'); $(".HideTxt2").css('display', 'none'); $("#NF-update").css('display', 'none'); gridList22(); } //委外入库单条码检验 if (Type == '23') { $(".HideTxt").css('display', 'none'); $(".HideTxt2").css('display', 'none'); $("#NF-update").css('display', 'none'); gridList23(); } if (Type == '24') { $(".HideTxt").css('display', 'none'); $(".HideTxt2").css('display', 'none'); gridList24(); } $(".search").keydown(function (e) { var curKey = e.which; debugger; if (curKey == 13) { if (Type == '1') { gridList(); } //委外来料检验 if (Type == '3') { gridList2(); } //产成品检验 if (Type == '2') { $(".HideTxt").css('display', 'none'); $(".HideTxt2").css('display', 'none'); $("#NF-update").css('display', 'none'); gridList3(); } //其他入库 if (Type == '4') { $(".HideTxt").css('display', 'none'); $("#NF-update").css('display', 'none'); gridList4(); } //生产退料 if (Type == '5') { $(".HideTxt").css('display', 'none'); $(".HideTxt2").css('display', 'none'); $("#NF-update").css('display', 'none'); gridList5(); } //委外退料 if (Type == '6') { $(".HideTxt").css('display', 'none'); $(".HideTxt2").css('display', 'none'); $("#NF-update").css('display', 'none'); gridList6(); } //销售退货 if (Type == '7') { $(".HideTxt").css('display', 'none'); $(".HideTxt2").css('display', 'none'); $("#NF-update").css('display', 'none'); gridList7(); } //采购到货单检验 if (Type == '8') { $(".HideTxt").css('display', 'none'); $(".HideTxt2").css('display', 'none'); gridList8(); } //委外采购到货单检验 if (Type == '9') { $(".HideTxt").css('display', 'none'); $(".HideTxt2").css('display', 'none'); gridList9(); } //连副产品检验 if (Type == '10') { $(".HideTxt").css('display', 'none'); $(".HideTxt2").css('display', 'none'); gridList10(); } //在库检验 if (Type == '11') { $(".HideTxt").css('display', 'none'); $("#NF-update").css('display', 'none'); gridList11(); } //采购入库单条码检验 if (Type == '22') { $(".HideTxt").css('display', 'none'); $(".HideTxt2").css('display', 'none'); gridList22(); } //采购入库单条码检验 if (Type == '23') { $(".HideTxt").css('display', 'none'); $(".HideTxt2").css('display', 'none'); gridList23(); } } }); }) function getLastMonthDate() { // 获取当前日期 let today = new Date();
// 减去一个月,注意月份是从0开始的 today.setMonth(today.getMonth() - 1);
// 获取年份(四位数) let year = today.getFullYear();
// 获取月份,加1使其变为正常表示(1-12) let month = (today.getMonth() + 1).toString().padStart(2, '0');
// 获取日期,这里直接使用getDate()因为已经处理过月份了 let date = today.getDate().toString().padStart(2, '0');
// 拼接成"YYYY-MM-DD"格式 return `${year}-${month}-${date}`; }
//1、获取当前页菜单ID function GetMenuID() { var cc = self.frameElement.getAttribute('id'); _MenuID = cc.replace("iframe", ""); }
function SetCols(Type) { $.ajax({ url: "/Print/SelectColumnName?" + Math.random(), dataType: "json", async: false, success: function (data) { var cols = new Array();
//来料检验 if (Type == '1') { var collast = { label: "主键", name: "ID", hidden: true, key: true }; cols.push(collast);
var collast = { label: 'ID', name: 'ID', hidden: true }; cols.push(collast); var collast = { label: '到货ID', name: 'DHID', hidden: true }; cols.push(collast); var collast = { label: '检验ID', name: 'JYID', hidden: true }; cols.push(collast); var collast = { label: '操作', width: 200, align: 'left', formatter: btnLook }; cols.push(collast); var collast = { label: '料品编码', name: 'InvCode', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '供应商代码', name: 'VenCode', width: 50, align: 'left' }; cols.push(collast); var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '规格型号', name: 'INVSTD', width: 260, align: 'left' }; cols.push(collast); var collast = { label: '总数量', name: 'AllNumber', width: 100, align: 'left' }; cols.push(collast);
//var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' }; //cols.push(collast); //var collast = { label: '供应商名称', name: 'VenName', width: 150, align: 'left' }; //cols.push(collast); var collast = { label: '到货时间', name: 'CreateDateTime', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '是否加急', name: 'IsUrgent', width: 100, align: 'left', cellattr: TuChuShow_IsUrgent }; cols.push(collast); var collast = { label: '合格数量', name: 'YLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '不合格数量', name: 'NLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '特采数量', name: 'SpecialQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast);
var collast = { label: '抽样数量', name: 'SampleQuantity', width: 40, align: 'left', editable: true, editrules: { number: true }, }; cols.push(collast); var collast = { label: 'Editable', name: 'Editable', width: 100, align: 'left', hidden: true }; cols.push(collast); var collast = { label: '不良代码值', name: 'BCCodeValue', hidden: true }; cols.push(collast); var collast = { label: '不良代码', name: 'BadDesc', width: 120, align: 'left', sortable: false, formatter: function (cellvalue, options, rowObject) { debugger; var html = ""; html += ' <select id="SelBC_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; html += ' </select>'; return cellvalue = html; } }; cols.push(collast); var collast = { label: '不良原因值', name: 'BRCodeValue', hidden: true }; cols.push(collast); var collast = { label: '不良原因', name: 'BadReasonDesc', width: 120, align: 'left', sortable: false, formatter: function (cellvalue, options, rowObject) { var html = ""; html += ' <select id="SelBR_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; html += ' </select>'; return cellvalue = html; } }; cols.push(collast); var collast = { label: '检验人', name: 'Surveyor', width: 50, align: 'left' }; cols.push(collast); var collast = { label: '条码', name: 'LotNo', width: 400, align: 'left' }; cols.push(collast); var collast = { label: '检验状态', name: 'TestState', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '到货单号', name: 'DNCode', width: 70, align: 'left' }; cols.push(collast); var collast = { label: '送货单号', name: 'ASNCode', width: 70, align: 'left' }; cols.push(collast); var collast = { label: '采购订单号', name: 'POCode', width: 120, align: 'left' }; cols.push(collast);
var collast = { label: '检验结果', name: 'Result', width: 150, align: 'left' }; cols.push(collast); //var collast = { // label: '检验文件', name: 'FileName', width: 150, align: 'left', // formatter: function (cellvalue, options, rowObject) { // var html = ""; // if (cellvalue != "" && cellvalue != null) { // html = " <a href='../../../File/InspectionFile/" + cellvalue + "' download='" + cellvalue + "' style='color:blue;'>" + cellvalue + "</a>"; // } // return html; // } //}; //cols.push(collast); var collast = { label: '是否拒收', name: 'Rejected', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '检验时间', name: 'ProvingTime', width: 80, align: 'left' }; cols.push(collast); var collast = { label: '是否首次检验', name: 'IsFirstCK', width: 20, align: 'left' }; cols.push(collast);
var collast = { label: '是否打印', name: 'IsPrint', width: 20, align: 'left' }; cols.push(collast); var collast = { label: '箱号ID', name: 'ContainerID', hidden: true }; cols.push(collast); var collast = { label: '箱号', name: 'ContainerCode', width: 20, 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 == "ICSInspection") { var Code = data[i].TableCode + "_"+ data[i].Code; var Name = data[i].Name; var obj = new Array(); obj = { label: Name, name: Code, width: 80, align: "left", editable: true } cols.push(obj); DataCR.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); } } } _Closs = cols; //_Clos1 = cols1; }
}); } //委外来料检验 if (Type == '3') { var collast = { label: "主键", name: "ID", hidden: true, key: true }; cols.push(collast); var collast = { label: 'ID', name: 'ID', hidden: true }; cols.push(collast); var collast = { label: '到货ID', name: 'DHID', hidden: true }; cols.push(collast); var collast = { label: '检验ID', name: 'JYID', hidden: true }; cols.push(collast); var collast = { label: '操作', width: 200, align: 'left', formatter: btnLook }; cols.push(collast); var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '料品名称', name: 'InvName', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '规格型号', name: 'INVSTD', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '总数量', name: 'AllNumber', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '供应商名称', name: 'VenName', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '到货时间', name: 'CreateDateTime', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '是否加急', name: 'IsUrgent', width: 100, align: 'left', cellattr: TuChuShow_IsUrgent }; cols.push(collast); var collast = { label: '合格数量', name: 'YLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '抽样数量', name: 'SampleQuantity', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '不合格数量', name: 'NLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '特采数量', name: 'SpecialQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast);
var collast = { label: '不良代码值', name: 'BCCodeValue', hidden: true }; cols.push(collast); var collast = { label: '不良代码', name: 'BadDesc', width: 120, align: 'left', sortable: false, formatter: function (cellvalue, options, rowObject) { debugger; var html = ""; html += ' <select id="SelBC_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; html += ' </select>'; return cellvalue = html; } }; cols.push(collast); var collast = { label: '不良原因值', name: 'BRCodeValue', hidden: true }; cols.push(collast); var collast = { label: '不良原因', name: 'BadReasonDesc', width: 120, align: 'left', sortable: false, formatter: function (cellvalue, options, rowObject) { var html = ""; html += ' <select id="SelBR_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; html += ' </select>'; return cellvalue = html; } }; cols.push(collast); var collast = { label: '检验状态', name: 'TestState', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '条码', name: 'LotNo', width: 120, align: 'left' }; cols.push(collast); var collast = { label: '委外到货单号', name: 'DNCode', width: 120, align: 'left' }; cols.push(collast); var collast = { label: '委外送货单号', name: 'OASNCode', width: 120, align: 'left' }; cols.push(collast); var collast = { label: '委外采购订单号', name: 'OOCode', width: 120, align: 'left' }; cols.push(collast); var collast = { label: '箱号', name: 'ContainerID', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '供应商代码', name: 'VenCode', width: 150, align: 'left' }; cols.push(collast);
var collast = { label: '检验结果', name: 'Result', width: 150, align: 'left' }; cols.push(collast); //var collast = { // label: '检验文件', name: 'FileName', width: 150, align: 'left', // formatter: function (cellvalue, options, rowObject) { // var html = ""; // if (cellvalue != "" && cellvalue != null) { // html = " <a href='../../../File/InspectionFile/" + cellvalue + "' download='" + cellvalue + "' style='color:blue;'>" + cellvalue + "</a>"; // } // return html; // } //}; //cols.push(collast); var collast = { label: '检验人', name: 'Surveyor', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '检验时间', name: 'ProvingTime', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '是否首次检验', name: 'IsFirstCK', width: 100, align: 'left' }; cols.push(collast);
var collast = { label: '是否打印', name: 'IsPrint', 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 == "ICSInspection") { var Code = data[i].TableCode + "_" + data[i].Code; var Name = data[i].Name; var obj = new Array(); obj = { label: Name, name: Code, width: 80, align: "left", editable: true } cols.push(obj); DataCR.push(obj); } 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); } } } _Closs = cols; //_Clos1 = cols1; }
}); } //产成品检验 if (Type == '2') { var collast = { label: "主键", name: "ID", hidden: true, key: true }; cols.push(collast); var collast = { label: 'ID', name: 'ID', hidden: true }; cols.push(collast); var collast = { label: '工单ID', name: 'GDID', hidden: true }; cols.push(collast); var collast = { label: '检验ID', name: 'JYID', hidden: true }; cols.push(collast); var collast = { label: '操作', width: 200, align: 'left', formatter: btnLook }; cols.push(collast); var collast = { label: '工单单号', name: 'DNCode', width: 120, align: 'left' }; cols.push(collast); var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '条码', name: 'LotNo', width: 120, align: 'left' }; cols.push(collast); var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '料品名称', name: 'InvName', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '规格型号', name: 'INVSTD', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '料品描述', name: 'InvDesc', width: 100, align: 'left' }; cols.push(collast);
var collast = { label: '箱号', name: 'ContainerID', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '生产时间', name: 'ProductTime', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '总数量', name: 'AllNumber', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '合格数量', name: 'YLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '不合格数量', name: 'NLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '特采数量', name: 'SpecialQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '抽样数量', name: 'SampleQuantity', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '不良代码值', name: 'BCCodeValue', hidden: true }; cols.push(collast); var collast = { label: '不良代码', name: 'BadDesc', width: 120, align: 'left', sortable: false, formatter: function (cellvalue, options, rowObject) { debugger; var html = ""; html += ' <select id="SelBC_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; html += ' </select>'; return cellvalue = html; } }; cols.push(collast); var collast = { label: '不良原因值', name: 'BRCodeValue', hidden: true }; cols.push(collast); var collast = { label: '不良原因', name: 'BadReasonDesc', width: 120, align: 'left', sortable: false, formatter: function (cellvalue, options, rowObject) { var html = ""; html += ' <select id="SelBR_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; html += ' </select>'; return cellvalue = html; } }; cols.push(collast); var collast = { label: '检验状态', name: 'TestState', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '检验结果', name: 'Result', width: 150, align: 'left' }; cols.push(collast); //var collast = { // label: '检验文件', name: 'FileName', width: 150, align: 'left', // formatter: function (cellvalue, options, rowObject) { // var html = ""; // if (cellvalue != "" && cellvalue != null) { // html = " <a href='../../../File/InspectionFile/" + cellvalue + "' download='" + cellvalue + "' style='color:blue;'>" + cellvalue + "</a>"; // } // return html; // } //}; //cols.push(collast); var collast = { label: '检验人', name: 'Surveyor', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '检验时间', name: 'ProvingTime', width: 150, 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 == "ICSInspection") { var Code = data[i].TableCode + "_" + data[i].Code; var Name = data[i].Name; var obj = new Array(); obj = { label: Name, name: Code, width: 80, align: "left", editable: true } cols.push(obj); DataCR.push(obj); } 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); //cols1.push(obj); } } } _Closs = cols; //_Clos1 = cols1; }
}); } //其他入库 if (Type == '4') { var collast = { label: "主键", name: "ID", hidden: true, key: true }; cols.push(collast); var collast = { label: 'ID', name: 'ID', hidden: true }; cols.push(collast); var collast = { label: '工单ID', name: 'GDID', hidden: true }; cols.push(collast); var collast = { label: '检验ID', name: 'JYID', hidden: true }; cols.push(collast); var collast = { label: '操作', width: 200, align: 'left', formatter: btnLook }; cols.push(collast); var collast = { label: '杂收单号', name: 'DNCode', width: 120, align: 'left' }; cols.push(collast); var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '条码', name: 'LotNo', width: 280, align: 'left' }; cols.push(collast); var collast = { label: '料品编码', name: 'InvCode', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '料品名称', name: 'InvName', width: 400, align: 'left' }; cols.push(collast); var collast = { label: '规格型号', name: 'INVSTD', width: 400, align: 'left' }; cols.push(collast);
var collast = { label: '总数量', name: 'AllNumber', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '合格数量', name: 'YLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '不合格数量', name: 'NLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '特采数量', name: 'SpecialQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '抽样数量', name: 'SampleQuantity', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast);
var collast = { label: '不良代码值', name: 'BCCodeValue', hidden: true }; cols.push(collast); var collast = { label: '不良代码', name: 'BadDesc', width: 120, align: 'left', sortable: false, formatter: function (cellvalue, options, rowObject) { debugger; var html = ""; html += ' <select id="SelBC_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; html += ' </select>'; return cellvalue = html; } }; cols.push(collast); var collast = { label: '不良原因值', name: 'BRCodeValue', hidden: true }; cols.push(collast); var collast = { label: '不良原因', name: 'BadReasonDesc', width: 120, align: 'left', sortable: false, formatter: function (cellvalue, options, rowObject) { var html = ""; html += ' <select id="SelBR_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; html += ' </select>'; return cellvalue = html; } }; cols.push(collast); var collast = { label: '检验状态', name: 'TestState', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '检验结果', name: 'Result', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '箱号', name: 'ContainerID', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '生产时间', name: 'ProductTime', width: 150, align: 'left' }; cols.push(collast); //var collast = { // label: '检验文件', name: 'FileName', width: 150, align: 'left', // formatter: function (cellvalue, options, rowObject) { // var html = ""; // if (cellvalue != "" && cellvalue != null) { // html = " <a href='../../../File/InspectionFile/" + cellvalue + "' download='" + cellvalue + "' style='color:blue;'>" + cellvalue + "</a>"; // } // return html; // } //}; //cols.push(collast); var collast = { label: '检验人', name: 'Surveyor', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '检验时间', name: 'ProvingTime', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '是否首次检验', name: 'IsFirstCK', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '是否加急', name: 'IsUrgent', width: 100, align: 'left', cellattr: TuChuShow_IsUrgent }; cols.push(collast); var collast = { label: '是否打印', name: 'IsPrint', 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 == "ICSInspection") { var Code = data[i].TableCode + "_" + data[i].Code; var Name = data[i].Name; var obj = new Array(); obj = { label: Name, name: Code, width: 80, align: "left", editable: true } cols.push(obj); DataCR.push(obj); } if (TableCode == "ICSOtherIn") { 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); } } } _Closs = cols; //_Clos1 = cols1; }
}); } //生产退料 if (Type == '5') { var collast = { label: "主键", name: "ID", hidden: true, key: true }; cols.push(collast); var collast = { label: 'ID', name: 'ID', hidden: true }; cols.push(collast); var collast = { label: '工单ID', name: 'GDID', hidden: true }; cols.push(collast); var collast = { label: '检验ID', name: 'JYID', hidden: true }; cols.push(collast); var collast = { label: '操作', width: 200, align: 'left', formatter: btnLook }; cols.push(collast); var collast = { label: '退料申请单号', name: 'DNCode', width: 120, align: 'left' }; cols.push(collast); var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '条码', name: 'LotNo', width: 120, align: 'left' }; cols.push(collast); var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '料品名称', name: 'InvName', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '规格型号', name: 'INVSTD', width: 100, align: 'left' }; cols.push(collast);
var collast = { label: '箱号', name: 'ContainerID', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '生产时间', name: 'ProductTime', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '总数量', name: 'AllNumber', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '合格数量', name: 'YLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '不合格数量', name: 'NLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '特采数量', name: 'SpecialQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '抽样数量', name: 'SampleQuantity', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '不良代码值', name: 'BCCodeValue', hidden: true }; cols.push(collast); var collast = { label: '不良代码', name: 'BadDesc', width: 120, align: 'left', sortable: false, formatter: function (cellvalue, options, rowObject) { debugger; var html = ""; html += ' <select id="SelBC_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; html += ' </select>'; return cellvalue = html; } }; cols.push(collast); var collast = { label: '不良原因值', name: 'BRCodeValue', hidden: true }; cols.push(collast); var collast = { label: '不良原因', name: 'BadReasonDesc', width: 120, align: 'left', sortable: false, formatter: function (cellvalue, options, rowObject) { var html = ""; html += ' <select id="SelBR_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; html += ' </select>'; return cellvalue = html; } }; cols.push(collast); var collast = { label: '检验状态', name: 'TestState', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '检验结果', name: 'Result', width: 150, align: 'left' }; cols.push(collast); //var collast = { // label: '检验文件', name: 'FileName', width: 150, align: 'left', // formatter: function (cellvalue, options, rowObject) { // var html = ""; // if (cellvalue != "" && cellvalue != null) { // html = " <a href='../../../File/InspectionFile/" + cellvalue + "' download='" + cellvalue + "' style='color:blue;'>" + cellvalue + "</a>"; // } // return html; // } //}; //cols.push(collast); var collast = { label: '检验人', name: 'Surveyor', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '检验时间', name: 'ProvingTime', width: 150, 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 == "ICSInspection") { var Code = data[i].TableCode + "_" + data[i].Code; var Name = data[i].Name; var obj = new Array(); obj = { label: Name, name: Code, width: 80, align: "left", editable: true } cols.push(obj); DataCR.push(obj); } if (TableCode == "ICSMOApplyNeg") { 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); } } } _Closs = cols; //_Clos1 = cols1; }
}); } //委外退料 if (Type == '6') { var collast = { label: "主键", name: "ID", hidden: true, key: true }; cols.push(collast); var collast = { label: 'ID', name: 'ID', hidden: true }; cols.push(collast); var collast = { label: '工单ID', name: 'GDID', hidden: true }; cols.push(collast); var collast = { label: '检验ID', name: 'JYID', hidden: true }; cols.push(collast); var collast = { label: '操作', width: 200, align: 'left', formatter: btnLook }; cols.push(collast); var collast = { label: '委外退料申请单号', name: 'DNCode', width: 120, align: 'left' }; cols.push(collast); var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '条码', name: 'LotNo', width: 120, align: 'left' }; cols.push(collast); var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '料品名称', name: 'InvName', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '规格型号', name: 'INVSTD', width: 100, align: 'left' }; cols.push(collast);
var collast = { label: '箱号', name: 'ContainerID', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '生产时间', name: 'ProductTime', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '总数量', name: 'AllNumber', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '合格数量', name: 'YLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '不合格数量', name: 'NLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '特采数量', name: 'SpecialQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '抽样数量', name: 'SampleQuantity', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '不良代码值', name: 'BCCodeValue', hidden: true }; cols.push(collast); var collast = { label: '不良代码', name: 'BadDesc', width: 120, align: 'left', sortable: false, formatter: function (cellvalue, options, rowObject) { debugger; var html = ""; html += ' <select id="SelBC_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; html += ' </select>'; return cellvalue = html; } }; cols.push(collast); var collast = { label: '不良原因值', name: 'BRCodeValue', hidden: true }; cols.push(collast); var collast = { label: '不良原因', name: 'BadReasonDesc', width: 120, align: 'left', sortable: false, formatter: function (cellvalue, options, rowObject) { var html = ""; html += ' <select id="SelBR_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; html += ' </select>'; return cellvalue = html; } }; cols.push(collast); var collast = { label: '检验状态', name: 'TestState', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '检验结果', name: 'Result', width: 150, align: 'left' }; cols.push(collast); //var collast = { // label: '检验文件', name: 'FileName', width: 150, align: 'left', // formatter: function (cellvalue, options, rowObject) { // var html = ""; // if (cellvalue != "" && cellvalue != null) { // html = " <a href='../../../File/InspectionFile/" + cellvalue + "' download='" + cellvalue + "' style='color:blue;'>" + cellvalue + "</a>"; // } // return html; // } //}; //cols.push(collast); var collast = { label: '检验人', name: 'Surveyor', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '检验时间', name: 'ProvingTime', width: 150, 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 == "ICSInspection") { var Code = data[i].TableCode + "_" + data[i].Code; var Name = data[i].Name; var obj = new Array(); obj = { label: Name, name: Code, width: 80, align: "left", editable: true } cols.push(obj); DataCR.push(obj); } if (TableCode == "ICSOApplyNeg") { 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); } } } _Closs = cols; //_Clos1 = cols1; }
}); } //销售退货 if (Type == '7') { var collast = { label: "主键", name: "ID", hidden: true, key: true }; cols.push(collast); var collast = { label: 'ID', name: 'ID', hidden: true }; cols.push(collast); var collast = { label: '工单ID', name: 'GDID', hidden: true }; cols.push(collast); var collast = { label: '检验ID', name: 'JYID', hidden: true }; cols.push(collast); var collast = { label: '操作', width: 200, align: 'left', formatter: btnLook }; cols.push(collast); var collast = { label: '销售退货单号', name: 'DNCode', width: 120, align: 'left' }; cols.push(collast); var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '条码', name: 'LotNo', width: 120, align: 'left' }; cols.push(collast); var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '料品名称', name: 'InvName', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '规格型号', name: 'INVSTD', width: 100, align: 'left' }; cols.push(collast);
var collast = { label: '箱号', name: 'ContainerID', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '生产时间', name: 'ProductTime', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '总数量', name: 'AllNumber', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '合格数量', name: 'YLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '不合格数量', name: 'NLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '特采数量', name: 'SpecialQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '抽样数量', name: 'SampleQuantity', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '不良代码值', name: 'BCCodeValue', hidden: true }; cols.push(collast); var collast = { label: '不良代码', name: 'BadDesc', width: 120, align: 'left', sortable: false, formatter: function (cellvalue, options, rowObject) { debugger; var html = ""; html += ' <select id="SelBC_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; html += ' </select>'; return cellvalue = html; } }; cols.push(collast); var collast = { label: '不良原因值', name: 'BRCodeValue', hidden: true }; cols.push(collast); var collast = { label: '不良原因', name: 'BadReasonDesc', width: 120, align: 'left', sortable: false, formatter: function (cellvalue, options, rowObject) { var html = ""; html += ' <select id="SelBR_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; html += ' </select>'; return cellvalue = html; } }; cols.push(collast); var collast = { label: '检验状态', name: 'TestState', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '检验结果', name: 'Result', width: 150, align: 'left' }; cols.push(collast); //var collast = { // label: '检验文件', name: 'FileName', width: 150, align: 'left', // formatter: function (cellvalue, options, rowObject) { // var html = ""; // if (cellvalue != "" && cellvalue != null) { // html = " <a href='../../../File/InspectionFile/" + cellvalue + "' download='" + cellvalue + "' style='color:blue;'>" + cellvalue + "</a>"; // } // return html; // } //}; //cols.push(collast); var collast = { label: '检验人', name: 'Surveyor', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '检验时间', name: 'ProvingTime', width: 150, 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 == "ICSInspection") { var Code = data[i].TableCode + "_" + data[i].Code; var Name = data[i].Name; var obj = new Array(); obj = { label: Name, name: Code, width: 80, align: "left", editable: true } cols.push(obj); DataCR.push(obj); } if (TableCode == "ICSSDN") { 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); } } } _Closs = cols; //_Clos1 = cols1; }
}); } if (Type == '8') { var collast = { label: "主键", name: "ID", hidden: true, key: true }; cols.push(collast);
var collast = { label: 'ID', name: 'ID', hidden: true }; cols.push(collast); var collast = { label: '到货ID', name: 'DHID', hidden: true }; cols.push(collast); var collast = { label: '检验ID', name: 'JYID', hidden: true }; cols.push(collast); var collast = { label: '操作', width: 200, align: 'left', formatter: btnLook }; cols.push(collast); var collast = { label: '到货单号', name: 'DNCode', width: 120, align: 'left' }; cols.push(collast); var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '条码', name: 'LotNo', width: 120, align: 'left' }; cols.push(collast); var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '料品名称', name: 'InvName', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '规格型号', name: 'INVSTD', width: 100, align: 'left' }; cols.push(collast);
var collast = { label: '箱号', name: 'ContainerID', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '到货时间', name: 'CreateDateTime', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '供应商代码', name: 'VenCode', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '供应商名称', name: 'VenName', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '总数量', name: 'AllNumber', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '合格数量', name: 'YLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '不合格数量', name: 'NLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '特采数量', name: 'SpecialQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '抽样数量', name: 'SampleQuantity', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '不良代码值', name: 'BCCodeValue', hidden: true }; cols.push(collast); var collast = { label: '不良代码', name: 'BadDesc', width: 120, align: 'left', sortable: false, formatter: function (cellvalue, options, rowObject) { debugger; var html = ""; html += ' <select id="SelBC_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; html += ' </select>'; return cellvalue = html; } }; cols.push(collast); var collast = { label: '不良原因值', name: 'BRCodeValue', hidden: true }; cols.push(collast); var collast = { label: '不良原因', name: 'BadReasonDesc', width: 120, align: 'left', sortable: false, formatter: function (cellvalue, options, rowObject) { var html = ""; html += ' <select id="SelBR_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; html += ' </select>'; return cellvalue = html; } }; cols.push(collast); var collast = { label: '检验状态', name: 'TestState', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '检验结果', name: 'Result', width: 150, align: 'left', formatter: function (cellvalue, row, index, field) { if (cellvalue === "不合格") { // 返回一个带有样式标记的HTML字符串,将字体颜色设置为红色 return '<span style="color:red;">' + cellvalue + '</span>'; // 注意这里我们使用了"不合格"而不是"初始" } else { // 对于其他值,返回原值(如果需要的话,可以添加其他样式) return cellvalue; } } }; cols.push(collast);
//var collast = { // label: '检验文件', name: 'FileName', width: 150, align: 'left', // formatter: function (cellvalue, options, rowObject) { // var html = ""; // if (cellvalue != "" && cellvalue != null) { // html = " <a href='../../../File/InspectionFile/" + cellvalue + "' download='" + cellvalue + "' style='color:blue;'>" + cellvalue + "</a>"; // } // return html; // } //}; //cols.push(collast); var collast = { label: '检验人', name: 'Surveyor', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '检验时间', name: 'ProvingTime', width: 150, 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 == "ICSInspection") { debugger; var Code = data[i].TableCode + "_" + data[i].Code; var Name = data[i].Name; var obj = new Array(); obj = { label: Name, name: Code, width: 80, align: "left", editable: true } cols.push(obj); DataCR.push(obj); } //saveCode = []; //if (TableCode == "ICSInspection") { // var Code = data[i].Code; // var Name = data[i].Name; // var obj = new Array(); // obj = { // label: Name, // name: Code, // width: 80, // align: "left", // editable: true // } // cols.push(obj); // saveCode.push(Code); //} 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); }
} } _Closs = cols; //_Clos1 = cols1; }
}); } if (Type == '9') { var collast = { label: "主键", name: "ID", hidden: true, key: true }; cols.push(collast); var collast = { label: 'ID', name: 'ID', hidden: true }; cols.push(collast); var collast = { label: '到货ID', name: 'DHID', hidden: true }; cols.push(collast); var collast = { label: '检验ID', name: 'JYID', hidden: true }; cols.push(collast); var collast = { label: '操作', width: 200, align: 'left', formatter: btnLook }; cols.push(collast); var collast = { label: '委外到货单号', name: 'DNCode', width: 120, align: 'left' }; cols.push(collast); var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' }; cols.push(collast); //var collast = { label: '委外送货单号', name: 'OASNCode', width: 120, align: 'left' }; //cols.push(collast); //var collast = { label: '委外采购订单号', name: 'OOCode', width: 120, align: 'left' }; //cols.push(collast); var collast = { label: '条码', name: 'LotNo', width: 120, align: 'left' }; cols.push(collast); var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '料品名称', name: 'InvName', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '规格型号', name: 'INVSTD', width: 100, align: 'left' }; cols.push(collast);
var collast = { label: '箱号', name: 'ContainerID', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '到货时间', name: 'CreateDateTime', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '供应商代码', name: 'VenCode', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '供应商名称', name: 'VenName', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '总数量', name: 'AllNumber', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '合格数量', name: 'YLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '不合格数量', name: 'NLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '特采数量', name: 'SpecialQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '抽样数量', name: 'SampleQuantity', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '不良代码值', name: 'BCCodeValue', hidden: true }; cols.push(collast); var collast = { label: '不良代码', name: 'BadDesc', width: 120, align: 'left', sortable: false, formatter: function (cellvalue, options, rowObject) { debugger; var html = ""; html += ' <select id="SelBC_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; html += ' </select>'; return cellvalue = html; } }; cols.push(collast); var collast = { label: '不良原因值', name: 'BRCodeValue', hidden: true }; cols.push(collast); var collast = { label: '不良原因', name: 'BadReasonDesc', width: 120, align: 'left', sortable: false, formatter: function (cellvalue, options, rowObject) { var html = ""; html += ' <select id="SelBR_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; html += ' </select>'; return cellvalue = html; } }; cols.push(collast); var collast = { label: '检验状态', name: 'TestState', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '检验结果', name: 'Result', width: 150, align: 'left' }; cols.push(collast); //var collast = { // label: '检验文件', name: 'FileName', width: 150, align: 'left', // formatter: function (cellvalue, options, rowObject) { // var html = ""; // if (cellvalue != "" && cellvalue != null) { // html = " <a href='../../../File/InspectionFile/" + cellvalue + "' download='" + cellvalue + "' style='color:blue;'>" + cellvalue + "</a>"; // } // return html; // } //}; //cols.push(collast); var collast = { label: '检验人', name: 'Surveyor', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '检验时间', name: 'ProvingTime', width: 150, 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 == "ICSInspection") { var Code = data[i].TableCode + "_" + data[i].Code; var Name = data[i].Name; var obj = new Array(); obj = { label: Name, name: Code, width: 80, align: "left", editable: true } cols.push(obj); DataCR.push(obj); } 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); } } } _Closs = cols; //_Clos1 = cols1; }
}); } if (Type == '10') { var collast = { label: "主键", name: "ID", hidden: true, key: true }; cols.push(collast); var collast = { label: 'ID', name: 'ID', hidden: true }; cols.push(collast); var collast = { label: '工单ID', name: 'GDID', hidden: true }; cols.push(collast); var collast = { label: '检验ID', name: 'JYID', hidden: true }; cols.push(collast); var collast = { label: '操作', width: 200, align: 'left', formatter: btnLook }; cols.push(collast); var collast = { label: '工单单号', name: 'DNCode', width: 120, align: 'left' }; cols.push(collast); var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '条码', name: 'LotNo', width: 120, align: 'left' }; cols.push(collast); var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '料品名称', name: 'InvName', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '规格型号', name: 'INVSTD', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '料品描述', name: 'InvDesc', width: 100, align: 'left' }; cols.push(collast);
var collast = { label: '箱号', name: 'ContainerID', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '生产时间', name: 'ProductTime', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '总数量', name: 'AllNumber', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '合格数量', name: 'YLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '不合格数量', name: 'NLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '特采数量', name: 'SpecialQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '抽样数量', name: 'SampleQuantity', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '不良代码值', name: 'BCCodeValue', hidden: true }; cols.push(collast); var collast = { label: '不良代码', name: 'BadDesc', width: 120, align: 'left', sortable: false, formatter: function (cellvalue, options, rowObject) { debugger; var html = ""; html += ' <select id="SelBC_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; html += ' </select>'; return cellvalue = html; } }; cols.push(collast); var collast = { label: '不良原因值', name: 'BRCodeValue', hidden: true }; cols.push(collast); var collast = { label: '不良原因', name: 'BadReasonDesc', width: 120, align: 'left', sortable: false, formatter: function (cellvalue, options, rowObject) { var html = ""; html += ' <select id="SelBR_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; html += ' </select>'; return cellvalue = html; } }; cols.push(collast); var collast = { label: '检验状态', name: 'TestState', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '检验结果', name: 'Result', width: 150, align: 'left' }; cols.push(collast); //var collast = { // label: '检验文件', name: 'FileName', width: 150, align: 'left', // formatter: function (cellvalue, options, rowObject) { // var html = ""; // if (cellvalue != "" && cellvalue != null) { // html = " <a href='../../../File/InspectionFile/" + cellvalue + "' download='" + cellvalue + "' style='color:blue;'>" + cellvalue + "</a>"; // } // return html; // } //}; //cols.push(collast); var collast = { label: '检验人', name: 'Surveyor', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '检验时间', name: 'ProvingTime', width: 150, 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 == "ICSInspection") { var Code = data[i].TableCode + "_" + data[i].Code; var Name = data[i].Name; var obj = new Array(); obj = { label: Name, name: Code, width: 80, align: "left", editable: true } cols.push(obj); DataCR.push(obj); } 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); //cols1.push(obj); } } } _Closs = cols; //_Clos1 = cols1; }
}); } //在库检验 if (Type == '11') { var collast = { label: "主表ID", name: "ID", hidden: true, key: true }; cols.push(collast); var collast = { label: '子表ID', name: 'DetailID', hidden: true }; cols.push(collast); //var collast = { label: '操作', width: 200, align: 'left', formatter: btnLook }; //cols.push(collast); var collast = { label: '检验单号', name: 'DNCode', width: 140, align: 'left' }; cols.push(collast); var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '条码', name: 'LotNo', width: 200, align: 'left' }; cols.push(collast); var collast = { label: '检验类型', name: 'DocType', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '检验状态', name: 'TestState', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '料品名称', name: 'InvName', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '规格型号', name: 'INVSTD', width: 400, align: 'left' }; cols.push(collast); var collast = { label: '料品描述', name: 'InvDesc', width: 100, align: 'left' }; cols.push(collast);
var collast = { label: '箱号', name: 'ContainerID', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '生产时间', name: 'ProductTime', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '总数量', name: 'AllNumber', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '合格数量', name: 'YLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '不合格数量', name: 'NLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '不良代码值', name: 'BCCodeValue', hidden: true }; cols.push(collast); var collast = { label: '不良代码', name: 'BadDesc', width: 120, align: 'left', sortable: false, formatter: function (cellvalue, options, rowObject) { debugger; var html = ""; html += ' <select id="SelBC_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; html += ' </select>'; return cellvalue = html; } }; cols.push(collast); var collast = { label: '不良原因值', name: 'BRCodeValue', hidden: true }; cols.push(collast); var collast = { label: '不良原因', name: 'BadReasonDesc', width: 120, align: 'left', sortable: false, formatter: function (cellvalue, options, rowObject) { var html = ""; html += ' <select id="SelBR_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; html += ' </select>'; return cellvalue = html; } }; cols.push(collast); var collast = { label: '备注', name: 'Memo', width: 100, align: 'left', editable: true }; cols.push(collast); var collast = { label: '失效时间', name: 'ExpirationDate', width: 150, align: 'left', editable: true, editoptions: { dataInit: function (el) { $(el).click(function () { WdatePicker({ dateFmt: "yyyy-MM-dd"//时间显示格式 }); }) } } }; cols.push(collast); var collast = { label: '检验人', name: 'Surveyor', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '检验时间', name: 'ProvingTime', width: 150, 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 == "ICSInspect") { 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); } } } _Closs = cols; //_Clos1 = cols1; }
}); } if (Type == '22') {
var collast = { label: "主键", name: "ID", hidden: true, key: true }; cols.push(collast); var collast = { label: 'ID', name: 'ID', hidden: true }; cols.push(collast); var collast = { label: '到货ID', name: 'DHID', hidden: true }; cols.push(collast); var collast = { label: '检验ID', name: 'JYID', hidden: true }; cols.push(collast); var collast = { label: '操作', width: 200, align: 'left', formatter: btnLook }; cols.push(collast); var collast = { label: '采购入库单号', name: 'DNCode', width: 120, align: 'left' }; cols.push(collast); var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' }; cols.push(collast); //var collast = { label: '委外送货单号', name: 'OASNCode', width: 120, align: 'left' }; //cols.push(collast); //var collast = { label: '委外采购订单号', name: 'OOCode', width: 120, align: 'left' }; //cols.push(collast); var collast = { label: '条码', name: 'LotNo', width: 120, align: 'left' }; cols.push(collast); var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '料品名称', name: 'InvName', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '规格型号', name: 'INVSTD', width: 100, align: 'left' }; cols.push(collast);
var collast = { label: '箱号', name: 'ContainerID', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '到货时间', name: 'CreateDateTime', width: 150, align: 'left' }; cols.push(collast); //var collast = { label: '供应商代码', name: 'VenCode', width: 150, align: 'left' }; //cols.push(collast); //var collast = { label: '供应商名称', name: 'VenName', width: 150, align: 'left' }; //cols.push(collast); var collast = { label: '总数量', name: 'AllNumber', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '合格数量', name: 'YLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '不合格数量', name: 'NLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '特采数量', name: 'SpecialQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '抽样数量', name: 'SampleQuantity', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '不良代码值', name: 'BCCodeValue', hidden: true }; cols.push(collast); var collast = { label: '不良代码', name: 'BadDesc', width: 120, align: 'left', sortable: false, formatter: function (cellvalue, options, rowObject) { debugger; var html = ""; html += ' <select id="SelBC_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; html += ' </select>'; return cellvalue = html; } }; cols.push(collast); var collast = { label: '不良原因值', name: 'BRCodeValue', hidden: true }; cols.push(collast); var collast = { label: '不良原因', name: 'BadReasonDesc', width: 120, align: 'left', sortable: false, formatter: function (cellvalue, options, rowObject) { var html = ""; html += ' <select id="SelBR_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; html += ' </select>'; return cellvalue = html; } }; cols.push(collast); var collast = { label: '检验状态', name: 'TestState', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '检验结果', name: 'Result', width: 150, align: 'left' }; cols.push(collast); //var collast = { // label: '检验文件', name: 'FileName', width: 150, align: 'left', // formatter: function (cellvalue, options, rowObject) { // var html = ""; // if (cellvalue != "" && cellvalue != null) { // html = " <a href='../../../File/InspectionFile/" + cellvalue + "' download='" + cellvalue + "' style='color:blue;'>" + cellvalue + "</a>"; // } // return html; // } //}; //cols.push(collast); var collast = { label: '检验人', name: 'Surveyor', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '检验时间', name: 'ProvingTime', width: 150, 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 == "ICSInspection") { var Code = data[i].TableCode + "_" + data[i].Code; var Name = data[i].Name; var obj = new Array(); obj = { label: Name, name: Code, width: 80, align: "left", editable: true } cols.push(obj); DataCR.push(obj); } 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); } } } _Closs = cols; //_Clos1 = cols1; }
}); } if (Type == '23') {
var collast = { label: "主键", name: "ID", hidden: true, key: true }; cols.push(collast); var collast = { label: 'ID', name: 'ID', hidden: true }; cols.push(collast); var collast = { label: '到货ID', name: 'DHID', hidden: true }; cols.push(collast); var collast = { label: '检验ID', name: 'JYID', hidden: true }; cols.push(collast); var collast = { label: '操作', width: 200, align: 'left', formatter: btnLook }; cols.push(collast); var collast = { label: '委外入库单号', name: 'DNCode', width: 120, align: 'left' }; cols.push(collast); var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' }; cols.push(collast); //var collast = { label: '委外送货单号', name: 'OASNCode', width: 120, align: 'left' }; //cols.push(collast); //var collast = { label: '委外采购订单号', name: 'OOCode', width: 120, align: 'left' }; //cols.push(collast); var collast = { label: '条码', name: 'LotNo', width: 120, align: 'left' }; cols.push(collast); var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '料品名称', name: 'InvName', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '规格型号', name: 'INVSTD', width: 100, align: 'left' }; cols.push(collast);
var collast = { label: '箱号', name: 'ContainerID', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '到货时间', name: 'CreateDateTime', width: 150, align: 'left' }; cols.push(collast); //var collast = { label: '供应商代码', name: 'VenCode', width: 150, align: 'left' }; //cols.push(collast); //var collast = { label: '供应商名称', name: 'VenName', width: 150, align: 'left' }; //cols.push(collast); var collast = { label: '总数量', name: 'AllNumber', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '合格数量', name: 'YLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '不合格数量', name: 'NLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '特采数量', name: 'SpecialQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '抽样数量', name: 'SampleQuantity', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '不良代码值', name: 'BCCodeValue', hidden: true }; cols.push(collast); var collast = { label: '不良代码', name: 'BadDesc', width: 120, align: 'left', sortable: false, formatter: function (cellvalue, options, rowObject) { debugger; var html = ""; html += ' <select id="SelBC_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; html += ' </select>'; return cellvalue = html; } }; cols.push(collast); var collast = { label: '不良原因值', name: 'BRCodeValue', hidden: true }; cols.push(collast); var collast = { label: '不良原因', name: 'BadReasonDesc', width: 120, align: 'left', sortable: false, formatter: function (cellvalue, options, rowObject) { var html = ""; html += ' <select id="SelBR_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; html += ' </select>'; return cellvalue = html; } }; cols.push(collast); var collast = { label: '检验状态', name: 'TestState', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '检验结果', name: 'Result', width: 150, align: 'left' }; cols.push(collast); //var collast = { // label: '检验文件', name: 'FileName', width: 150, align: 'left', // formatter: function (cellvalue, options, rowObject) { // var html = ""; // if (cellvalue != "" && cellvalue != null) { // html = " <a href='../../../File/InspectionFile/" + cellvalue + "' download='" + cellvalue + "' style='color:blue;'>" + cellvalue + "</a>"; // } // return html; // } //}; //cols.push(collast); var collast = { label: '检验人', name: 'Surveyor', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '检验时间', name: 'ProvingTime', width: 150, 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 == "ICSInspection") { var Code = data[i].TableCode + "_" + data[i].Code; var Name = data[i].Name; var obj = new Array(); obj = { label: Name, name: Code, width: 80, align: "left", editable: true } cols.push(obj); DataCR.push(obj); } 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); } } } _Closs = cols; //_Clos1 = cols1; }
}); } //红字销售出库单检验 if (Type == '24') { var collast = { label: "主键", name: "ID", hidden: true, key: true }; cols.push(collast);
var collast = { label: 'ID', name: 'ID', hidden: true }; cols.push(collast); var collast = { label: '到货ID', name: 'DHID', hidden: true }; cols.push(collast); var collast = { label: '检验ID', name: 'JYID', hidden: true }; cols.push(collast); var collast = { label: '操作', width: 200, align: 'left', formatter: btnLook }; cols.push(collast); var collast = { label: '料品编码', name: 'InvCode', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '料品名称', name: 'InvName', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '规格型号', name: 'InvStd', width: 260, align: 'left' }; cols.push(collast); var collast = { label: '总数量', name: 'AllNumber', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '创建时间', name: 'CreateDateTime', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '是否加急', name: 'IsUrgent', width: 100, align: 'left', cellattr: TuChuShow_IsUrgent }; cols.push(collast); var collast = { label: '合格数量', name: 'YLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '抽样数量', name: 'SampleQuantity', width: 100, align: 'left', editable: true, editrules: { number: true }, }; cols.push(collast); var collast = { label: '不合格数量', name: 'NLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '特采数量', name: 'SpecialQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }; cols.push(collast); var collast = { label: '客户名称', name: 'CusName', width: 150, align: 'left' }; cols.push(collast); var collast = { label: 'Editable', name: 'Editable', width: 100, align: 'left', hidden: true }; cols.push(collast); var collast = { label: '不良代码值', name: 'BCCodeValue', hidden: true }; cols.push(collast); var collast = { label: '不良代码', name: 'BadDesc', width: 120, align: 'left', sortable: false, formatter: function (cellvalue, options, rowObject) { debugger; var html = ""; html += ' <select id="SelBC_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; html += ' </select>'; return cellvalue = html; } }; cols.push(collast); var collast = { label: '不良原因值', name: 'BRCodeValue', hidden: true }; cols.push(collast); var collast = { label: '不良原因', name: 'BadReasonDesc', width: 120, align: 'left', sortable: false, formatter: function (cellvalue, options, rowObject) { var html = ""; html += ' <select id="SelBR_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; html += ' </select>'; return cellvalue = html; } }; cols.push(collast); var collast = { label: '检验状态', name: 'TestState', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '条码', name: 'LotNo', width: 400, align: 'left' }; cols.push(collast); var collast = { label: '单号', name: 'SSDCode', width: 120, align: 'left' }; cols.push(collast); //var collast = { label: '送货单号', name: 'ASNCode', width: 120, align: 'left' }; //cols.push(collast); //var collast = { label: '采购订单号', name: 'POCode', width: 120, align: 'left' }; //cols.push(collast);
var collast = { label: '检验结果', name: 'Result', width: 150, align: 'left' }; cols.push(collast); //var collast = { // label: '检验文件', name: 'FileName', width: 150, align: 'left', // formatter: function (cellvalue, options, rowObject) { // var html = ""; // if (cellvalue != "" && cellvalue != null) { // html = " <a href='../../../File/InspectionFile/" + cellvalue + "' download='" + cellvalue + "' style='color:blue;'>" + cellvalue + "</a>"; // } // return html; // } //}; //cols.push(collast); var collast = { label: '检验人', name: 'Surveyor', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '检验时间', name: 'ProvingTime', width: 150, align: 'left' }; cols.push(collast); var collast = { label: '是否首次检验', name: 'IsFirstCK', width: 100, align: 'left' }; cols.push(collast);
var collast = { label: '是否打印', name: 'IsPrint', width: 100, align: 'left' }; cols.push(collast); var collast = { label: '箱号ID', name: 'ContainerID', hidden: true }; cols.push(collast); var collast = { label: '箱号', name: 'ContainerCode', width: 100, align: 'left' }; cols.push(collast);
var collast = { label: '客户代码', name: 'CusCode', width: 150, 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 == "ICSInspection") { var Code = data[i].TableCode + "_" + data[i].Code; var Name = data[i].Name; var obj = new Array(); obj = { label: Name, name: Code, width: 80, align: "left", editable: true } cols.push(obj); DataCR.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); } } } _Closs = cols; //_Clos1 = cols1; }
}); } 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); } } _Clos = cols; } }); }
function gridList() { document.getElementById("gridPanel").innerHTML = ' <table id="gridList"></table> <div id="gridPager"></div>';//重置grid var $gridList = $("#gridList"); debugger; var queryJson = { POCode: $("#txt_POCode").val(), ASNCode: $("#txt_ASNCode").val(), CaiGouCode: $("#txt_CaiGouCode").val(), VenCode: $("#txt_VenCode").val(), VenName: $("#txt_VenName").val(), InvCode: $("#txt_InvCode").val(), InvName: $("#txt_InvName").val(), InvStd: $("#txt_InvStd").val(), BatchCode: $("#txt_BatchCode").val(), ReleaseState: $("#selShow").val(), TimeFrom: $("#TimeFrom").val(), TimeArrive: $("#TimeArrive").val(), selEnableShow: $("#selEnableShow").val(), LotNO: $("#txt_LotNO").val(), selIsUrgent: $("#selIsUrgent").val(), selIsPrint: $("#selIsPrint").val(), Rejected: $("#F_Rejected").val(), selIsWH: $("#selIsWH").val()
} $gridList.dataGrid({ url: "/WMS/ICSRCVIQCs/GetICSInspection" + "?" + Math.random(), postData: { MenuID: _MenuID, queryJson: JSON.stringify(queryJson) }, height: $(window).height() - 250, width: $(window).width() - 300, cellEdit: true, colModel: _Clos, //colModel: [ // { label: "主键", name: "ID", hidden: true, key: true }, // { label: 'ID', name: 'ID', hidden: true }, // { label: '到货ID', name: 'DHID', hidden: true }, // { label: '检验ID', name: 'JYID', hidden: true }, // { label: '到货单号', name: 'DNCode', width: 120, align: 'left' }, // { label: '送货单号', name: 'ASNCode', width: 120, align: 'left' }, // { label: '采购订单号', name: 'POCode', width: 120, align: 'left' }, // { label: '条码', name: 'LotNo', width: 120, align: 'left' }, // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' }, // { label: '料品名称', name: 'InvName', width: 100, align: 'left' }, // { label: '规格型号', name: 'INVSTD', width: 100, align: 'left' }, // { label: '批次', name: 'BatchCode', width: 100, align: 'left' }, // { label: '箱号', name: 'ContainerID', width: 100, align: 'left' }, // { label: '到货时间', name: 'CreateDateTime', width: 150, align: 'left' }, // { label: '供应商代码', name: 'VenCode', width: 150, align: 'left' }, // { label: '供应商名称', name: 'VenName', width: 150, align: 'left' }, // { label: '总数量', name: 'AllNumber', width: 100, align: 'left' }, // { label: '合格数量', name: 'YLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }, // { label: '不合格数量', name: 'NLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }, // { label: '特采数量', name: 'SpecialQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }, // { label: '不良代码值', name: 'BCCodeValue', hidden: true }, // { // label: '不良代码', name: 'BadDesc', width: 120, align: 'left', sortable: false, // formatter: function (cellvalue, options, rowObject) { // debugger; // var html = ""; // html += ' <select id="SelBC_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; // html += ' </select>'; // return cellvalue = html; // } // }, // { label: '不良原因值', name: 'BRCodeValue', hidden: true }, // { // label: '不良原因', name: 'BadReasonDesc', width: 120, align: 'left', sortable: false, // formatter: function (cellvalue, options, rowObject) { // var html = ""; // html += ' <select id="SelBR_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; // html += ' </select>'; // return cellvalue = html; // } // }, // { label: '检验状态', name: 'TestState', width: 150, align: 'left' }, // { label: '检验人', name: 'Surveyor', width: 150, align: 'left' }, // { label: '检验时间', name: 'ProvingTime', width: 150, align: 'left' }, //], cellsubmit: "clientArray", shrinkToFit: false,//宽度自适应 autoWidth: true, gridComplete: function () { debugger; //设置select var RowDatas = $("#gridList").jqGrid('getDataIDs'); for (var j = 0; j < RowDatas.length; j++) { var InvCode = $("#gridList").jqGrid("getCell", RowDatas[j], "InvCode"); var ID = $("#gridList").jqGrid("getCell", RowDatas[j], "ID"); var BCCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BCCodeValue"); var BRCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BRCodeValue"); var Editable = $("#gridList").jqGrid("getCell", RowDatas[j], "Editable"); GetSelectICSBadCode(InvCode, ID, BCCodeValue); GetSelectPerson(InvCode, ID, BRCodeValue); if (Editable == "false") { $("#gridList").jqGrid('setCell', RowDatas[j], 'SampleQuantity', '', 'not-editable-cell'); } } var Quantity_total = $(this).getCol('AllNumber', false, 'sum'); var YLOTQTY_total = $(this).getCol('YLOTQTY', false, 'sum'); var NLOTQTY_total = $(this).getCol('NLOTQTY', false, 'sum'); var SpecialQTY_total = $(this).getCol('SpecialQTY', false, 'sum'); var SampleQuantity_total = $(this).getCol('SampleQuantity', false, 'sum'); $(this).footerData('set', { "AllNumber": Quantity_total,//声明需要汇总的列并写自定义函数endMoney_total "YLOTQTY": YLOTQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "NLOTQTY": NLOTQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "SpecialQTY": SpecialQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "SampleQuantity": SampleQuantity_total,//声明需要汇总的列并写自定义函数endMoney_total
}); $(this).footerData('set', { "LotNo": "合计:" });
}, pager: "#gridPager", sortorder: "desc", sortname: 'DNCode ', viewrecords: true, multiselect: true, footerrow: true,//启用底部行(对列汇总时要启用)第一步 subGrid: false, // (1)开启子表格支持 afterSaveCell: function (rowid, cellname, value) { debugger; var AllNumber = $gridList.jqGrid("getCell", rowid, 'AllNumber'); //总扣分数加其他扣分数 if (cellname === 'YLOTQTY') { var YLOTQTY = Number(value); if (YLOTQTY > AllNumber) { YLOTQTY = 0; } var str = Math.round((parseFloat(AllNumber) - parseFloat(YLOTQTY)) * 10) / 10; $gridList.jqGrid("setCell", rowid, 'NLOTQTY', str); $gridList.jqGrid("setCell", rowid, 'YLOTQTY', YLOTQTY); } if (cellname === 'NLOTQTY') { var NLOTQTY = Number(value); if (NLOTQTY > AllNumber) { NLOTQTY = 0; } var str = Math.round((parseFloat(AllNumber) - parseFloat(NLOTQTY)) * 10) / 10; $gridList.jqGrid("setCell", rowid, 'YLOTQTY', str); $gridList.jqGrid("setCell", rowid, 'NLOTQTY', NLOTQTY); } if (cellname === 'SampleQuantity') { var SampleQuantity = Number(value); if (SampleQuantity > AllNumber) { SampleQuantity = 0; } $gridList.jqGrid("setCell", rowid, 'SampleQuantity', SampleQuantity); } if (cellname === 'SpecialQTY') { var SpecialQTY = Number(value); if (SpecialQTY > AllNumber) { SpecialQTY = 0; } $gridList.jqGrid("setCell", rowid, 'SpecialQTY', SpecialQTY); }
},
});
$("#btn_search").click(function () { var warehouse = $("#warehouse a.active").attr('data-value'); var queryJson = { POCode: $("#txt_POCode").val(), ASNCode: $("#txt_ASNCode").val(), CaiGouCode: $("#txt_CaiGouCode").val(), VenCode: $("#txt_VenCode").val(), VenName: $("#txt_VenName").val(), InvCode: $("#txt_InvCode").val(), InvName: $("#txt_InvName").val(), InvStd: $("#txt_InvStd").val(), BatchCode: $("#txt_BatchCode").val(), ReleaseState: $("#selShow").val(), TimeFrom: $("#TimeFrom").val(), TimeArrive: $("#TimeArrive").val(), selEnableShow: $("#selEnableShow").val(), LotNO: $("#txt_LotNO").val(), selIsUrgent: $("#selIsUrgent").val(), selIsPrint: $("#selIsPrint").val(), Rejected: $("#F_Rejected").val(), selIsWH: $("#selIsWH").val() } $gridList.jqGrid('setGridParam', { postData: { queryJson: JSON.stringify(queryJson) }, }).trigger('reloadGrid', [{ page: 1 }]); }); }
function gridList2() { var $gridList = $("#gridList"); var queryJson = { POCode: $("#txt_POCode").val(), ASNCode: $("#txt_ASNCode").val(), CaiGouCode: $("#txt_CaiGouCode").val(), VenCode: $("#txt_VenCode").val(), VenName: $("#txt_VenName").val(), InvCode: $("#txt_InvCode").val(), InvName: $("#txt_InvName").val(), InvStd: $("#txt_InvStd").val(), BatchCode: $("#txt_BatchCode").val(), ReleaseState: $("#selShow").val(), TimeFrom: $("#TimeFrom").val(), TimeArrive: $("#TimeArrive").val(), selEnableShow: $("#selEnableShow").val(), LotNO: $("#txt_LotNO").val(), selIsUrgent: $("#selIsUrgent").val(), selIsPrint: $("#selIsPrint").val(), Rejected: $("#F_Rejected").val(), selIsWH: $("#selIsWH").val() } $gridList.dataGrid({ url: "/WMS/ICSRCVIQCs/GetICSInspection2" + "?" + Math.random(), postData: { MenuID: _MenuID, queryJson: JSON.stringify(queryJson) }, height: $(window).height() - 200, width: $(window).width() - 300, cellEdit: true, colModel: _Clos, //colModel: [ // { label: "主键", name: "ID", hidden: true, key: true }, // { label: 'ID', name: 'ID', hidden: true }, // { label: '到货ID', name: 'DHID', hidden: true }, // { label: '检验ID', name: 'JYID', hidden: true }, // { label: '委外到货单号', name: 'DNCode', width: 120, align: 'left' }, // { label: '委外送货单号', name: 'OASNCode', width: 120, align: 'left' }, // { label: '委外采购订单号', name: 'OOCode', width: 120, align: 'left' }, // { label: '条码', name: 'LotNo', width: 120, align: 'left' }, // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' }, // { label: '料品名称', name: 'InvName', width: 100, align: 'left' }, // { label: '规格型号', name: 'INVSTD', width: 100, align: 'left' }, // { label: '批次', name: 'BatchCode', width: 100, align: 'left' }, // { label: '箱号', name: 'ContainerID', width: 100, align: 'left' }, // { label: '到货时间', name: 'CreateDateTime', width: 150, align: 'left' }, // { label: '供应商代码', name: 'VenCode', width: 150, align: 'left' }, // { label: '供应商名称', name: 'VenName', width: 150, align: 'left' }, // { label: '总数量', name: 'AllNumber', width: 100, align: 'left' }, // { label: '合格数量', name: 'YLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }, // { label: '不合格数量', name: 'NLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }, // { label: '特采数量', name: 'SpecialQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }, // { label: '不良代码值', name: 'BCCodeValue', hidden: true }, // { // label: '不良代码', name: 'BadDesc', width: 120, align: 'left', sortable: false, // formatter: function (cellvalue, options, rowObject) { // debugger; // var html = ""; // html += ' <select id="SelBC_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; // html += ' </select>'; // return cellvalue = html; // } // }, // { label: '不良原因值', name: 'BRCodeValue', hidden: true }, // { // label: '不良原因', name: 'BadReasonDesc', width: 120, align: 'left', sortable: false, // formatter: function (cellvalue, options, rowObject) { // var html = ""; // html += ' <select id="SelBR_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; // html += ' </select>'; // return cellvalue = html; // } // }, // { label: '检验状态', name: 'TestState', width: 150, align: 'left' }, // { label: '检验人', name: 'Surveyor', width: 150, align: 'left' }, // { label: '检验时间', name: 'ProvingTime', width: 150, align: 'left' },
//], cellsubmit: "clientArray", shrinkToFit: false,//宽度自适应 autoWidth: true, gridComplete: function () { debugger; //设置select var RowDatas = $("#gridList").jqGrid('getDataIDs'); for (var j = 0; j < RowDatas.length; j++) { var InvCode = $("#gridList").jqGrid("getCell", RowDatas[j], "InvCode"); var ID = $("#gridList").jqGrid("getCell", RowDatas[j], "ID"); var BCCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BCCodeValue"); var BRCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BRCodeValue"); GetSelectICSBadCode(InvCode, ID, BCCodeValue); GetSelectPerson(InvCode, ID, BRCodeValue); } var Quantity_total = $(this).getCol('AllNumber', false, 'sum'); var YLOTQTY_total = $(this).getCol('YLOTQTY', false, 'sum'); var NLOTQTY_total = $(this).getCol('NLOTQTY', false, 'sum'); var SpecialQTY_total = $(this).getCol('SpecialQTY', false, 'sum'); var SampleQuantity_total = $(this).getCol('SampleQuantity', false, 'sum'); $(this).footerData('set', { "AllNumber": Quantity_total,//声明需要汇总的列并写自定义函数endMoney_total "YLOTQTY": YLOTQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "NLOTQTY": NLOTQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "SpecialQTY": SpecialQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "SampleQuantity": SampleQuantity_total,//声明需要汇总的列并写自定义函数endMoney_total
}); $(this).footerData('set', { "LotNo": "合计:" });
},
pager: "#gridPager", sortorder: "desc", sortname: 'DNCode ', viewrecords: true, footerrow: true,//启用底部行(对列汇总时要启用)第一步 multiselect: true, subGrid: false, // (1)开启子表格支持 afterSaveCell: function (rowid, cellname, value) { debugger; var AllNumber = $gridList.jqGrid("getCell", rowid, 'AllNumber'); //总扣分数加其他扣分数 if (cellname === 'YLOTQTY') { var YLOTQTY = Number(value); if (YLOTQTY > AllNumber) { YLOTQTY = 0; } var str = Math.round((parseFloat(AllNumber) - parseFloat(YLOTQTY)) * 10) / 10; $gridList.jqGrid("setCell", rowid, 'NLOTQTY', str); $gridList.jqGrid("setCell", rowid, 'YLOTQTY', YLOTQTY); } if (cellname === 'NLOTQTY') { var NLOTQTY = Number(value); if (NLOTQTY > AllNumber) { NLOTQTY = 0; } var str = Math.round((parseFloat(AllNumber) - parseFloat(NLOTQTY)) * 10) / 10; $gridList.jqGrid("setCell", rowid, 'YLOTQTY', str); $gridList.jqGrid("setCell", rowid, 'NLOTQTY', NLOTQTY); } if (cellname === 'SampleQuantity') { var SampleQuantity = Number(value); if (SampleQuantity > AllNumber) { SampleQuantity = 0; } $gridList.jqGrid("setCell", rowid, 'SampleQuantity', SampleQuantity); } if (cellname === 'SpecialQTY') { var SpecialQTY = Number(value); if (SpecialQTY > AllNumber) { SpecialQTY = 0; } $gridList.jqGrid("setCell", rowid, 'SpecialQTY', SpecialQTY); } if (cellname === 'BadReasonDesc') { $gridList.jqGrid("setCell", rowid, 'BRCodeValue', value); } if (cellname === 'BadDesc') { $gridList.jqGrid("setCell", rowid, 'BCCodeValue', value); } },
}); $("#btn_search").click(function () { var warehouse = $("#warehouse a.active").attr('data-value'); var queryJson = { POCode: $("#txt_POCode").val(), ASNCode: $("#txt_ASNCode").val(), CaiGouCode: $("#txt_CaiGouCode").val(), VenCode: $("#txt_VenCode").val(), VenName: $("#txt_VenName").val(), InvCode: $("#txt_InvCode").val(), InvName: $("#txt_InvName").val(), InvStd: $("#txt_InvStd").val(), BatchCode: $("#txt_BatchCode").val(), ReleaseState: $("#selShow").val(), TimeFrom: $("#TimeFrom").val(), TimeArrive: $("#TimeArrive").val(), selEnableShow: $("#selEnableShow").val(), LotNO: $("#txt_LotNO").val(), selIsUrgent: $("#selIsUrgent").val(), selIsPrint: $("#selIsPrint").val(), Rejected: $("#F_Rejected").val(), selIsWH: $("#selIsWH").val() } //$gridList.jqGrid('setGridParam', { // postData: { queryJson: JSON.stringify(queryJson) }, //}).trigger('reloadGrid'); $gridList.jqGrid('setGridParam', { postData: { queryJson: JSON.stringify(queryJson) }, }).trigger('reloadGrid', [{ page: 1 }]); }); }
function gridList3() { var $gridList = $("#gridList"); var queryJson = { POCode: $("#txt_POCode").val(), InvCode: $("#txt_InvCode").val(), InvName: $("#txt_InvName").val(), InvStd: $("#txt_InvStd").val(), BatchCode: $("#txt_BatchCode").val(), ReleaseState: $("#selShow").val(), selEnableShow: $("#selEnableShow").val(), LotNO: $("#txt_LotNO").val(), selIsWH: $("#selIsWH").val() } $gridList.dataGrid({ url: "/WMS/ICSRCVIQCs/GetICSInspection3" + "?" + Math.random(), postData: { MenuID: _MenuID, queryJson: JSON.stringify(queryJson) }, height: $(window).height() - 200, width: $(window).width() - 300, cellEdit: true, colModel: _Clos, //colModel: [ // { label: "主键", name: "ID", hidden: true, key: true }, // { label: 'ID', name: 'ID', hidden: true }, // { label: '工单ID', name: 'GDID', hidden: true }, // { label: '检验ID', name: 'JYID', hidden: true }, // { label: '工单单号', name: 'DNCode', width: 120, align: 'left' }, // { label: '条码', name: 'LotNo', width: 120, align: 'left' }, // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' }, // { label: '料品名称', name: 'InvName', width: 100, align: 'left' }, // { label: '规格型号', name: 'INVSTD', width: 100, align: 'left' }, // { label: '批次', name: 'BatchCode', width: 100, align: 'left' }, // { label: '箱号', name: 'ContainerID', width: 100, align: 'left' }, // { label: '生产时间', name: 'ProductTime', width: 150, align: 'left' }, // { label: '总数量', name: 'AllNumber', width: 100, align: 'left' }, // { label: '合格数量', name: 'YLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }, // { label: '不合格数量', name: 'NLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }, // { label: '特采数量', name: 'SpecialQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }, // { label: '不良代码值', name: 'BCCodeValue', hidden: true }, // { // label: '不良代码', name: 'BadDesc', width: 120, align: 'left', sortable: false, // formatter: function (cellvalue, options, rowObject) { // debugger; // var html = ""; // html += ' <select id="SelBC_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; // html += ' </select>'; // return cellvalue = html; // } // }, // { label: '不良原因值', name: 'BRCodeValue', hidden: true }, // { // label: '不良原因', name: 'BadReasonDesc', width: 120, align: 'left', sortable: false, // formatter: function (cellvalue, options, rowObject) { // var html = ""; // html += ' <select id="SelBR_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; // html += ' </select>'; // return cellvalue = html; // } // }, // { label: '检验状态', name: 'TestState', width: 150, align: 'left' }, // { label: '检验人', name: 'Surveyor', width: 150, align: 'left' }, // { label: '检验时间', name: 'ProvingTime', width: 150, align: 'left' }, //], cellsubmit: "clientArray", shrinkToFit: false,//宽度自适应 autoWidth: true, gridComplete: function () { debugger; //设置select var RowDatas = $("#gridList").jqGrid('getDataIDs'); for (var j = 0; j < RowDatas.length; j++) { var InvCode = $("#gridList").jqGrid("getCell", RowDatas[j], "InvCode"); var ID = $("#gridList").jqGrid("getCell", RowDatas[j], "ID"); var BCCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BCCodeValue"); var BRCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BRCodeValue"); GetSelectICSBadCode(InvCode, ID, BCCodeValue); GetSelectPerson(InvCode, ID, BRCodeValue); } var Quantity_total = $(this).getCol('AllNumber', false, 'sum'); var YLOTQTY_total = $(this).getCol('YLOTQTY', false, 'sum'); var NLOTQTY_total = $(this).getCol('NLOTQTY', false, 'sum'); var SpecialQTY_total = $(this).getCol('SpecialQTY', false, 'sum'); var SampleQuantity_total = $(this).getCol('SampleQuantity', false, 'sum'); $(this).footerData('set', { "AllNumber": Quantity_total,//声明需要汇总的列并写自定义函数endMoney_total "YLOTQTY": YLOTQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "NLOTQTY": NLOTQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "SpecialQTY": SpecialQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "SampleQuantity": SampleQuantity_total,//声明需要汇总的列并写自定义函数endMoney_total
}); $(this).footerData('set', { "LotNo": "合计:" }); },
pager: "#gridPager", sortorder: "desc", sortname: 'DNCode ', viewrecords: true, multiselect: true, footerrow: true,//启用底部行(对列汇总时要启用)第一步 afterSaveCell: function (rowid, cellname, value) { debugger; var AllNumber = $gridList.jqGrid("getCell", rowid, 'AllNumber'); //总扣分数加其他扣分数 if (cellname === 'YLOTQTY') { var YLOTQTY = Number(value); if (YLOTQTY > AllNumber) { YLOTQTY = 0; } var str = Math.round((parseFloat(AllNumber) - parseFloat(YLOTQTY)) * 10) / 10; $gridList.jqGrid("setCell", rowid, 'NLOTQTY', str); $gridList.jqGrid("setCell", rowid, 'YLOTQTY', YLOTQTY); } if (cellname === 'NLOTQTY') { var NLOTQTY = Number(value); if (NLOTQTY > AllNumber) { NLOTQTY = 0; } var str = Math.round((parseFloat(AllNumber) - parseFloat(NLOTQTY)) * 10) / 10; $gridList.jqGrid("setCell", rowid, 'YLOTQTY', str); $gridList.jqGrid("setCell", rowid, 'NLOTQTY', Number); } if (cellname === 'SampleQuantity') { var SampleQuantity = Number(value); if (SampleQuantity > AllNumber) { SampleQuantity = 0; } $gridList.jqGrid("setCell", rowid, 'SampleQuantity', SampleQuantity); } if (cellname === 'SpecialQTY') { var SpecialQTY = Number(value); if (SpecialQTY > AllNumber) { SpecialQTY = 0; } $gridList.jqGrid("setCell", rowid, 'SpecialQTY', SpecialQTY); } if (cellname === 'BadReasonDesc') { $gridList.jqGrid("setCell", rowid, 'BRCodeValue', value); } if (cellname === 'BadDesc') { $gridList.jqGrid("setCell", rowid, 'BCCodeValue', value); } }, });
$("#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(), InvStd: $("#txt_InvStd").val(), BatchCode: $("#txt_BatchCode").val(), ReleaseState: $("#selShow").val(), selEnableShow: $("#selEnableShow").val(), LotNO: $("#txt_LotNO").val(), selIsWH: $("#selIsWH").val() } $gridList.jqGrid('setGridParam', { postData: { queryJson: JSON.stringify(queryJson) }, }).trigger('reloadGrid', [{ page: 1 }]); });
}
function gridList4() {
var $gridList = $("#gridList"); var queryJson = { POCode: $("#txt_POCode").val(), ASNCode: $("#txt_ASNCode").val(), CaiGouCode: $("#txt_CaiGouCode").val(), VenCode: $("#txt_VenCode").val(), VenName: $("#txt_VenName").val(), InvCode: $("#txt_InvCode").val(), InvName: $("#txt_InvName").val(), InvStd: $("#txt_InvStd").val(), BatchCode: $("#txt_BatchCode").val(), ReleaseState: $("#selShow").val(), selEnableShow: $("#selEnableShow").val(), LotNO: $("#txt_LotNO").val(), selIsUrgent: $("#selIsUrgent").val(), selIsPrint: $("#selIsPrint").val(), selIsWH: $("#selIsWH").val() } $gridList.dataGrid({ url: "/WMS/ICSRCVIQCs/GetICSInspection4" + "?" + Math.random(), postData: { MenuID: _MenuID, queryJson: JSON.stringify(queryJson) }, height: $(window).height() - 200, width: $(window).width() - 300, cellEdit: true, colModel: _Clos, //colModel: [ // { label: "主键", name: "ID", hidden: true, key: true }, // { label: 'ID', name: 'ID', hidden: true }, // { label: '到货ID', name: 'DHID', hidden: true }, // { label: '检验ID', name: 'JYID', hidden: true }, // { label: '到货单号', name: 'DNCode', width: 120, align: 'left' }, // { label: '送货单号', name: 'ASNCode', width: 120, align: 'left' }, // { label: '采购订单号', name: 'POCode', width: 120, align: 'left' }, // { label: '条码', name: 'LotNo', width: 120, align: 'left' }, // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' }, // { label: '料品名称', name: 'InvName', width: 100, align: 'left' }, // { label: '规格型号', name: 'INVSTD', width: 100, align: 'left' }, // { label: '批次', name: 'BatchCode', width: 100, align: 'left' }, // { label: '箱号', name: 'ContainerID', width: 100, align: 'left' }, // { label: '到货时间', name: 'CreateDateTime', width: 150, align: 'left' }, // { label: '供应商代码', name: 'VenCode', width: 150, align: 'left' }, // { label: '供应商名称', name: 'VenName', width: 150, align: 'left' }, // { label: '总数量', name: 'AllNumber', width: 100, align: 'left' }, // { label: '合格数量', name: 'YLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }, // { label: '不合格数量', name: 'NLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }, // { label: '特采数量', name: 'SpecialQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }, // { label: '不良代码值', name: 'BCCodeValue', hidden: true }, // { // label: '不良代码', name: 'BadDesc', width: 120, align: 'left', sortable: false, // formatter: function (cellvalue, options, rowObject) { // debugger; // var html = ""; // html += ' <select id="SelBC_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; // html += ' </select>'; // return cellvalue = html; // } // }, // { label: '不良原因值', name: 'BRCodeValue', hidden: true }, // { // label: '不良原因', name: 'BadReasonDesc', width: 120, align: 'left', sortable: false, // formatter: function (cellvalue, options, rowObject) { // var html = ""; // html += ' <select id="SelBR_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; // html += ' </select>'; // return cellvalue = html; // } // }, // { label: '检验状态', name: 'TestState', width: 150, align: 'left' }, // { label: '检验人', name: 'Surveyor', width: 150, align: 'left' }, // { label: '检验时间', name: 'ProvingTime', width: 150, align: 'left' }, //], cellsubmit: "clientArray", shrinkToFit: false,//宽度自适应 autoWidth: true, footerrow: true,//启用底部行(对列汇总时要启用)第一步 gridComplete: function () { debugger; //设置select var RowDatas = $("#gridList").jqGrid('getDataIDs'); for (var j = 0; j < RowDatas.length; j++) { var InvCode = $("#gridList").jqGrid("getCell", RowDatas[j], "InvCode"); var ID = $("#gridList").jqGrid("getCell", RowDatas[j], "ID"); var BCCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BCCodeValue"); var BRCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BRCodeValue"); GetSelectICSBadCode(InvCode, ID, BCCodeValue); GetSelectPerson(InvCode, ID, BRCodeValue); } var Quantity_total = $(this).getCol('AllNumber', false, 'sum'); var YLOTQTY_total = $(this).getCol('YLOTQTY', false, 'sum'); var NLOTQTY_total = $(this).getCol('NLOTQTY', false, 'sum'); var SpecialQTY_total = $(this).getCol('SpecialQTY', false, 'sum'); var SampleQuantity_total = $(this).getCol('SampleQuantity', false, 'sum'); $(this).footerData('set', { "AllNumber": Quantity_total,//声明需要汇总的列并写自定义函数endMoney_total "YLOTQTY": YLOTQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "NLOTQTY": NLOTQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "SpecialQTY": SpecialQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "SampleQuantity": SampleQuantity_total,//声明需要汇总的列并写自定义函数endMoney_total
}); $(this).footerData('set', { "LotNo": "合计:" });
}, pager: "#gridPager", sortorder: "desc", sortname: 'DNCode ', viewrecords: true, multiselect: true, subGrid: false, // (1)开启子表格支持 afterSaveCell: function (rowid, cellname, value) { debugger; var AllNumber = $gridList.jqGrid("getCell", rowid, 'AllNumber'); //总扣分数加其他扣分数 if (cellname === 'YLOTQTY') { var YLOTQTY = Number(value); if (YLOTQTY > AllNumber) { YLOTQTY = 0; } var str = Math.round((parseFloat(AllNumber) - parseFloat(YLOTQTY)) * 10) / 10; $gridList.jqGrid("setCell", rowid, 'NLOTQTY', str); $gridList.jqGrid("setCell", rowid, 'YLOTQTY', YLOTQTY); } if (cellname === 'NLOTQTY') { var NLOTQTY = Number(value); if (NLOTQTY > AllNumber) { NLOTQTY = 0; } var str = Math.round((parseFloat(AllNumber) - parseFloat(NLOTQTY)) * 10) / 10; $gridList.jqGrid("setCell", rowid, 'YLOTQTY', str); $gridList.jqGrid("setCell", rowid, 'NLOTQTY', NLOTQTY); } if (cellname === 'SampleQuantity') { var SampleQuantity = Number(value); if (SampleQuantity > AllNumber) { SampleQuantity = 0; } $gridList.jqGrid("setCell", rowid, 'SampleQuantity', SampleQuantity); } if (cellname === 'SpecialQTY') { var SpecialQTY = Number(value); if (SpecialQTY > AllNumber) { SpecialQTY = 0; } $gridList.jqGrid("setCell", rowid, 'SpecialQTY', SpecialQTY); }
},
});
$("#btn_search").click(function () { var warehouse = $("#warehouse a.active").attr('data-value'); var queryJson = { POCode: $("#txt_POCode").val(), ASNCode: $("#txt_ASNCode").val(), CaiGouCode: $("#txt_CaiGouCode").val(), VenCode: $("#txt_VenCode").val(), VenName: $("#txt_VenName").val(), InvCode: $("#txt_InvCode").val(), InvName: $("#txt_InvName").val(), InvStd: $("#txt_InvStd").val(), BatchCode: $("#txt_BatchCode").val(), ReleaseState: $("#selShow").val(), selEnableShow: $("#selEnableShow").val(), LotNO: $("#txt_LotNO").val(), selIsUrgent: $("#selIsUrgent").val(), selIsPrint: $("#selIsPrint").val(), selIsWH: $("#selIsWH").val() } $gridList.jqGrid('setGridParam', { postData: { queryJson: JSON.stringify(queryJson) }, }).trigger('reloadGrid', [{ page: 1 }]); }); }
function gridList5() {
var $gridList = $("#gridList"); var queryJson = { POCode: $("#txt_POCode").val(), ASNCode: $("#txt_ASNCode").val(), CaiGouCode: $("#txt_CaiGouCode").val(), VenCode: $("#txt_VenCode").val(), VenName: $("#txt_VenName").val(), InvCode: $("#txt_InvCode").val(), InvName: $("#txt_InvName").val(), InvStd: $("#txt_InvStd").val(), BatchCode: $("#txt_BatchCode").val(), ReleaseState: $("#selShow").val(), selEnableShow: $("#selEnableShow").val(), LotNO: $("#txt_LotNO").val(), selIsWH: $("#selIsWH").val() } $gridList.dataGrid({ url: "/WMS/ICSRCVIQCs/GetICSInspection5" + "?" + Math.random(), postData: { MenuID: _MenuID, queryJson: JSON.stringify(queryJson) }, height: $(window).height() - 200, width: $(window).width() - 300, cellEdit: true, colModel: _Clos, //colModel: [ // { label: "主键", name: "ID", hidden: true, key: true }, // { label: 'ID', name: 'ID', hidden: true }, // { label: '到货ID', name: 'DHID', hidden: true }, // { label: '检验ID', name: 'JYID', hidden: true }, // { label: '到货单号', name: 'DNCode', width: 120, align: 'left' }, // { label: '送货单号', name: 'ASNCode', width: 120, align: 'left' }, // { label: '采购订单号', name: 'POCode', width: 120, align: 'left' }, // { label: '条码', name: 'LotNo', width: 120, align: 'left' }, // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' }, // { label: '料品名称', name: 'InvName', width: 100, align: 'left' }, // { label: '规格型号', name: 'INVSTD', width: 100, align: 'left' }, // { label: '批次', name: 'BatchCode', width: 100, align: 'left' }, // { label: '箱号', name: 'ContainerID', width: 100, align: 'left' }, // { label: '到货时间', name: 'CreateDateTime', width: 150, align: 'left' }, // { label: '供应商代码', name: 'VenCode', width: 150, align: 'left' }, // { label: '供应商名称', name: 'VenName', width: 150, align: 'left' }, // { label: '总数量', name: 'AllNumber', width: 100, align: 'left' }, // { label: '合格数量', name: 'YLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }, // { label: '不合格数量', name: 'NLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }, // { label: '特采数量', name: 'SpecialQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }, // { label: '不良代码值', name: 'BCCodeValue', hidden: true }, // { // label: '不良代码', name: 'BadDesc', width: 120, align: 'left', sortable: false, // formatter: function (cellvalue, options, rowObject) { // debugger; // var html = ""; // html += ' <select id="SelBC_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; // html += ' </select>'; // return cellvalue = html; // } // }, // { label: '不良原因值', name: 'BRCodeValue', hidden: true }, // { // label: '不良原因', name: 'BadReasonDesc', width: 120, align: 'left', sortable: false, // formatter: function (cellvalue, options, rowObject) { // var html = ""; // html += ' <select id="SelBR_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; // html += ' </select>'; // return cellvalue = html; // } // }, // { label: '检验状态', name: 'TestState', width: 150, align: 'left' }, // { label: '检验人', name: 'Surveyor', width: 150, align: 'left' }, // { label: '检验时间', name: 'ProvingTime', width: 150, align: 'left' }, //], cellsubmit: "clientArray", shrinkToFit: false,//宽度自适应 autoWidth: true, footerrow: true,//启用底部行(对列汇总时要启用)第一步 gridComplete: function () { debugger; //设置select var RowDatas = $("#gridList").jqGrid('getDataIDs'); for (var j = 0; j < RowDatas.length; j++) { var InvCode = $("#gridList").jqGrid("getCell", RowDatas[j], "InvCode"); var ID = $("#gridList").jqGrid("getCell", RowDatas[j], "ID"); var BCCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BCCodeValue"); var BRCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BRCodeValue"); GetSelectICSBadCode(InvCode, ID, BCCodeValue); GetSelectPerson(InvCode, ID, BRCodeValue); } var Quantity_total = $(this).getCol('AllNumber', false, 'sum'); var YLOTQTY_total = $(this).getCol('YLOTQTY', false, 'sum'); var NLOTQTY_total = $(this).getCol('NLOTQTY', false, 'sum'); var SpecialQTY_total = $(this).getCol('SpecialQTY', false, 'sum'); var SampleQuantity_total = $(this).getCol('SampleQuantity', false, 'sum'); $(this).footerData('set', { "AllNumber": Quantity_total,//声明需要汇总的列并写自定义函数endMoney_total "YLOTQTY": YLOTQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "NLOTQTY": NLOTQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "SpecialQTY": SpecialQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "SampleQuantity": SampleQuantity_total,//声明需要汇总的列并写自定义函数endMoney_total
}); $(this).footerData('set', { "LotNo": "合计:" });
}, pager: "#gridPager", sortorder: "desc", sortname: 'DNCode ', viewrecords: true, multiselect: true, subGrid: false, // (1)开启子表格支持 afterSaveCell: function (rowid, cellname, value) { debugger; var AllNumber = $gridList.jqGrid("getCell", rowid, 'AllNumber'); //总扣分数加其他扣分数 if (cellname === 'YLOTQTY') { var YLOTQTY = Number(value); if (YLOTQTY > AllNumber) { YLOTQTY = 0; } var str = Math.round((parseFloat(AllNumber) - parseFloat(YLOTQTY)) * 10) / 10; $gridList.jqGrid("setCell", rowid, 'NLOTQTY', str); $gridList.jqGrid("setCell", rowid, 'YLOTQTY', YLOTQTY); } if (cellname === 'NLOTQTY') { var NLOTQTY = Number(value); if (NLOTQTY > AllNumber) { NLOTQTY = 0; } var str = Math.round((parseFloat(AllNumber) - parseFloat(NLOTQTY)) * 10) / 10; $gridList.jqGrid("setCell", rowid, 'YLOTQTY', str); $gridList.jqGrid("setCell", rowid, 'NLOTQTY', NLOTQTY); } if (cellname === 'SampleQuantity') { var SampleQuantity = Number(value); if (SampleQuantity > AllNumber) { SampleQuantity = 0; } $gridList.jqGrid("setCell", rowid, 'SampleQuantity', SampleQuantity); } if (cellname === 'SpecialQTY') { var SpecialQTY = Number(value); if (SpecialQTY > AllNumber) { SpecialQTY = 0; } $gridList.jqGrid("setCell", rowid, 'SpecialQTY', SpecialQTY); }
},
});
$("#btn_search").click(function () { var warehouse = $("#warehouse a.active").attr('data-value'); var queryJson = { POCode: $("#txt_POCode").val(), ASNCode: $("#txt_ASNCode").val(), CaiGouCode: $("#txt_CaiGouCode").val(), VenCode: $("#txt_VenCode").val(), VenName: $("#txt_VenName").val(), InvCode: $("#txt_InvCode").val(), InvName: $("#txt_InvName").val(), InvStd: $("#txt_InvStd").val(), BatchCode: $("#txt_BatchCode").val(), ReleaseState: $("#selShow").val(), selEnableShow: $("#selEnableShow").val(), LotNO: $("#txt_LotNO").val(), selIsWH: $("#selIsWH").val() } $gridList.jqGrid('setGridParam', { postData: { queryJson: JSON.stringify(queryJson) }, }).trigger('reloadGrid', [{ page: 1 }]); }); }
function gridList6() {
var $gridList = $("#gridList"); var queryJson = { POCode: $("#txt_POCode").val(), ASNCode: $("#txt_ASNCode").val(), CaiGouCode: $("#txt_CaiGouCode").val(), VenCode: $("#txt_VenCode").val(), VenName: $("#txt_VenName").val(), InvCode: $("#txt_InvCode").val(), InvName: $("#txt_InvName").val(), InvStd: $("#txt_InvStd").val(), BatchCode: $("#txt_BatchCode").val(), ReleaseState: $("#selShow").val(), selEnableShow: $("#selEnableShow").val(), LotNO: $("#txt_LotNO").val(), selIsWH: $("#selIsWH").val() } $gridList.dataGrid({ url: "/WMS/ICSRCVIQCs/GetICSInspection6" + "?" + Math.random(), postData: { MenuID: _MenuID, queryJson: JSON.stringify(queryJson) }, height: $(window).height() - 200, width: $(window).width() - 300, cellEdit: true, colModel: _Clos, //colModel: [ // { label: "主键", name: "ID", hidden: true, key: true }, // { label: 'ID', name: 'ID', hidden: true }, // { label: '到货ID', name: 'DHID', hidden: true }, // { label: '检验ID', name: 'JYID', hidden: true }, // { label: '到货单号', name: 'DNCode', width: 120, align: 'left' }, // { label: '送货单号', name: 'ASNCode', width: 120, align: 'left' }, // { label: '采购订单号', name: 'POCode', width: 120, align: 'left' }, // { label: '条码', name: 'LotNo', width: 120, align: 'left' }, // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' }, // { label: '料品名称', name: 'InvName', width: 100, align: 'left' }, // { label: '规格型号', name: 'INVSTD', width: 100, align: 'left' }, // { label: '批次', name: 'BatchCode', width: 100, align: 'left' }, // { label: '箱号', name: 'ContainerID', width: 100, align: 'left' }, // { label: '到货时间', name: 'CreateDateTime', width: 150, align: 'left' }, // { label: '供应商代码', name: 'VenCode', width: 150, align: 'left' }, // { label: '供应商名称', name: 'VenName', width: 150, align: 'left' }, // { label: '总数量', name: 'AllNumber', width: 100, align: 'left' }, // { label: '合格数量', name: 'YLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }, // { label: '不合格数量', name: 'NLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }, // { label: '特采数量', name: 'SpecialQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }, // { label: '不良代码值', name: 'BCCodeValue', hidden: true }, // { // label: '不良代码', name: 'BadDesc', width: 120, align: 'left', sortable: false, // formatter: function (cellvalue, options, rowObject) { // debugger; // var html = ""; // html += ' <select id="SelBC_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; // html += ' </select>'; // return cellvalue = html; // } // }, // { label: '不良原因值', name: 'BRCodeValue', hidden: true }, // { // label: '不良原因', name: 'BadReasonDesc', width: 120, align: 'left', sortable: false, // formatter: function (cellvalue, options, rowObject) { // var html = ""; // html += ' <select id="SelBR_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; // html += ' </select>'; // return cellvalue = html; // } // }, // { label: '检验状态', name: 'TestState', width: 150, align: 'left' }, // { label: '检验人', name: 'Surveyor', width: 150, align: 'left' }, // { label: '检验时间', name: 'ProvingTime', width: 150, align: 'left' }, //], cellsubmit: "clientArray", shrinkToFit: false,//宽度自适应 autoWidth: true, footerrow: true,//启用底部行(对列汇总时要启用)第一步 gridComplete: function () { debugger; //设置select var RowDatas = $("#gridList").jqGrid('getDataIDs'); for (var j = 0; j < RowDatas.length; j++) { var InvCode = $("#gridList").jqGrid("getCell", RowDatas[j], "InvCode"); var ID = $("#gridList").jqGrid("getCell", RowDatas[j], "ID"); var BCCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BCCodeValue"); var BRCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BRCodeValue"); GetSelectICSBadCode(InvCode, ID, BCCodeValue); GetSelectPerson(InvCode, ID, BRCodeValue); } var Quantity_total = $(this).getCol('AllNumber', false, 'sum'); var YLOTQTY_total = $(this).getCol('YLOTQTY', false, 'sum'); var NLOTQTY_total = $(this).getCol('NLOTQTY', false, 'sum'); var SpecialQTY_total = $(this).getCol('SpecialQTY', false, 'sum'); var SampleQuantity_total = $(this).getCol('SampleQuantity', false, 'sum'); $(this).footerData('set', { "AllNumber": Quantity_total,//声明需要汇总的列并写自定义函数endMoney_total "YLOTQTY": YLOTQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "NLOTQTY": NLOTQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "SpecialQTY": SpecialQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "SampleQuantity": SampleQuantity_total,//声明需要汇总的列并写自定义函数endMoney_total
}); $(this).footerData('set', { "LotNo": "合计:" }); }, pager: "#gridPager", sortorder: "desc", sortname: 'DNCode ', viewrecords: true, multiselect: true, subGrid: false, // (1)开启子表格支持 afterSaveCell: function (rowid, cellname, value) { debugger; var AllNumber = $gridList.jqGrid("getCell", rowid, 'AllNumber'); //总扣分数加其他扣分数 if (cellname === 'YLOTQTY') { var YLOTQTY = Number(value); if (YLOTQTY > AllNumber) { YLOTQTY = 0; } var str = Math.round((parseFloat(AllNumber) - parseFloat(YLOTQTY)) * 10) / 10; $gridList.jqGrid("setCell", rowid, 'NLOTQTY', str); $gridList.jqGrid("setCell", rowid, 'YLOTQTY', YLOTQTY); } if (cellname === 'NLOTQTY') { var NLOTQTY = Number(value); if (NLOTQTY > AllNumber) { NLOTQTY = 0; } var str = Math.round((parseFloat(AllNumber) - parseFloat(NLOTQTY)) * 10) / 10; $gridList.jqGrid("setCell", rowid, 'YLOTQTY', str); $gridList.jqGrid("setCell", rowid, 'NLOTQTY', NLOTQTY); } if (cellname === 'SampleQuantity') { var SampleQuantity = Number(value); if (SampleQuantity > AllNumber) { SampleQuantity = 0; } $gridList.jqGrid("setCell", rowid, 'SampleQuantity', SampleQuantity); } if (cellname === 'SpecialQTY') { var SpecialQTY = Number(value); if (SpecialQTY > AllNumber) { SpecialQTY = 0; } $gridList.jqGrid("setCell", rowid, 'SpecialQTY', SpecialQTY); }
},
});
$("#btn_search").click(function () { var warehouse = $("#warehouse a.active").attr('data-value'); var queryJson = { POCode: $("#txt_POCode").val(), ASNCode: $("#txt_ASNCode").val(), CaiGouCode: $("#txt_CaiGouCode").val(), VenCode: $("#txt_VenCode").val(), VenName: $("#txt_VenName").val(), InvCode: $("#txt_InvCode").val(), InvName: $("#txt_InvName").val(), InvStd: $("#txt_InvStd").val(), BatchCode: $("#txt_BatchCode").val(), ReleaseState: $("#selShow").val(), selEnableShow: $("#selEnableShow").val(), LotNO: $("#txt_LotNO").val(), selIsWH: $("#selIsWH").val() } $gridList.jqGrid('setGridParam', { postData: { queryJson: JSON.stringify(queryJson) }, }).trigger('reloadGrid', [{ page: 1 }]); }); }
function gridList7() {
var $gridList = $("#gridList"); var queryJson = { POCode: $("#txt_POCode").val(), ASNCode: $("#txt_ASNCode").val(), CaiGouCode: $("#txt_CaiGouCode").val(), VenCode: $("#txt_VenCode").val(), VenName: $("#txt_VenName").val(), InvCode: $("#txt_InvCode").val(), InvName: $("#txt_InvName").val(), InvStd: $("#txt_InvStd").val(), BatchCode: $("#txt_BatchCode").val(), ReleaseState: $("#selShow").val(), selEnableShow: $("#selEnableShow").val(), LotNO: $("#txt_LotNO").val(), selIsWH: $("#selIsWH").val() } $gridList.dataGrid({ url: "/WMS/ICSRCVIQCs/GetICSInspection7" + "?" + Math.random(), postData: { MenuID: _MenuID, queryJson: JSON.stringify(queryJson) }, height: $(window).height() - 200, width: $(window).width() - 300, cellEdit: true, colModel: _Clos, //colModel: [ // { label: "主键", name: "ID", hidden: true, key: true }, // { label: 'ID', name: 'ID', hidden: true }, // { label: '到货ID', name: 'DHID', hidden: true }, // { label: '检验ID', name: 'JYID', hidden: true }, // { label: '到货单号', name: 'DNCode', width: 120, align: 'left' }, // { label: '送货单号', name: 'ASNCode', width: 120, align: 'left' }, // { label: '采购订单号', name: 'POCode', width: 120, align: 'left' }, // { label: '条码', name: 'LotNo', width: 120, align: 'left' }, // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' }, // { label: '料品名称', name: 'InvName', width: 100, align: 'left' }, // { label: '规格型号', name: 'INVSTD', width: 100, align: 'left' }, // { label: '批次', name: 'BatchCode', width: 100, align: 'left' }, // { label: '箱号', name: 'ContainerID', width: 100, align: 'left' }, // { label: '到货时间', name: 'CreateDateTime', width: 150, align: 'left' }, // { label: '供应商代码', name: 'VenCode', width: 150, align: 'left' }, // { label: '供应商名称', name: 'VenName', width: 150, align: 'left' }, // { label: '总数量', name: 'AllNumber', width: 100, align: 'left' }, // { label: '合格数量', name: 'YLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }, // { label: '不合格数量', name: 'NLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }, // { label: '特采数量', name: 'SpecialQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }, // { label: '不良代码值', name: 'BCCodeValue', hidden: true }, // { // label: '不良代码', name: 'BadDesc', width: 120, align: 'left', sortable: false, // formatter: function (cellvalue, options, rowObject) { // debugger; // var html = ""; // html += ' <select id="SelBC_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; // html += ' </select>'; // return cellvalue = html; // } // }, // { label: '不良原因值', name: 'BRCodeValue', hidden: true }, // { // label: '不良原因', name: 'BadReasonDesc', width: 120, align: 'left', sortable: false, // formatter: function (cellvalue, options, rowObject) { // var html = ""; // html += ' <select id="SelBR_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; // html += ' </select>'; // return cellvalue = html; // } // }, // { label: '检验状态', name: 'TestState', width: 150, align: 'left' }, // { label: '检验人', name: 'Surveyor', width: 150, align: 'left' }, // { label: '检验时间', name: 'ProvingTime', width: 150, align: 'left' }, //], cellsubmit: "clientArray", shrinkToFit: false,//宽度自适应 autoWidth: true, footerrow: true,//启用底部行(对列汇总时要启用)第一步 gridComplete: function () { debugger; //设置select var RowDatas = $("#gridList").jqGrid('getDataIDs'); for (var j = 0; j < RowDatas.length; j++) { var InvCode = $("#gridList").jqGrid("getCell", RowDatas[j], "InvCode"); var ID = $("#gridList").jqGrid("getCell", RowDatas[j], "ID"); var BCCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BCCodeValue"); var BRCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BRCodeValue"); GetSelectICSBadCode(InvCode, ID, BCCodeValue); GetSelectPerson(InvCode, ID, BRCodeValue); } var Quantity_total = $(this).getCol('AllNumber', false, 'sum'); var YLOTQTY_total = $(this).getCol('YLOTQTY', false, 'sum'); var NLOTQTY_total = $(this).getCol('NLOTQTY', false, 'sum'); var SpecialQTY_total = $(this).getCol('SpecialQTY', false, 'sum'); var SampleQuantity_total = $(this).getCol('SampleQuantity', false, 'sum'); $(this).footerData('set', { "AllNumber": Quantity_total,//声明需要汇总的列并写自定义函数endMoney_total "YLOTQTY": YLOTQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "NLOTQTY": NLOTQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "SpecialQTY": SpecialQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "SampleQuantity": SampleQuantity_total,//声明需要汇总的列并写自定义函数endMoney_total
}); $(this).footerData('set', { "LotNo": "合计:" });
}, pager: "#gridPager", sortorder: "desc", sortname: 'DNCode ', viewrecords: true, multiselect: true, subGrid: false, // (1)开启子表格支持 afterSaveCell: function (rowid, cellname, value) { debugger; var AllNumber = $gridList.jqGrid("getCell", rowid, 'AllNumber'); //总扣分数加其他扣分数 if (cellname === 'YLOTQTY') { var YLOTQTY = Number(value); if (YLOTQTY > AllNumber) { YLOTQTY = 0; } var str = Math.round((parseFloat(AllNumber) - parseFloat(YLOTQTY)) * 10) / 10; $gridList.jqGrid("setCell", rowid, 'NLOTQTY', str); $gridList.jqGrid("setCell", rowid, 'YLOTQTY', YLOTQTY); } if (cellname === 'NLOTQTY') { var NLOTQTY = Number(value); if (NLOTQTY > AllNumber) { NLOTQTY = 0; } var str = Math.round((parseFloat(AllNumber) - parseFloat(NLOTQTY)) * 10) / 10; $gridList.jqGrid("setCell", rowid, 'YLOTQTY', str); $gridList.jqGrid("setCell", rowid, 'NLOTQTY', NLOTQTY); } if (cellname === 'SampleQuantity') { var SampleQuantity = Number(value); if (SampleQuantity > AllNumber) { SampleQuantity = 0; } $gridList.jqGrid("setCell", rowid, 'SampleQuantity', SampleQuantity); } if (cellname === 'SpecialQTY') { var SpecialQTY = Number(value); if (SpecialQTY > AllNumber) { SpecialQTY = 0; } $gridList.jqGrid("setCell", rowid, 'SpecialQTY', SpecialQTY); }
},
});
$("#btn_search").click(function () { var warehouse = $("#warehouse a.active").attr('data-value'); var queryJson = { POCode: $("#txt_POCode").val(), ASNCode: $("#txt_ASNCode").val(), CaiGouCode: $("#txt_CaiGouCode").val(), VenCode: $("#txt_VenCode").val(), VenName: $("#txt_VenName").val(), InvCode: $("#txt_InvCode").val(), InvName: $("#txt_InvName").val(), InvStd: $("#txt_InvStd").val(), BatchCode: $("#txt_BatchCode").val(), ReleaseState: $("#selShow").val(), selEnableShow: $("#selEnableShow").val(), LotNO: $("#txt_LotNO").val(), selIsWH: $("#selIsWH").val() } $gridList.jqGrid('setGridParam', { postData: { queryJson: JSON.stringify(queryJson) }, }).trigger('reloadGrid', [{ page: 1 }]); }); } function gridList8() {
var $gridList = $("#gridList"); var queryJson = { POCode: $("#txt_POCode").val(), //ASNCode: $("#txt_ASNCode").val(), //CaiGouCode: $("#txt_CaiGouCode").val(), VenCode: $("#txt_VenCode").val(), VenName: $("#txt_VenName").val(), InvCode: $("#txt_InvCode").val(), InvName: $("#txt_InvName").val(), InvStd: $("#txt_InvStd").val(), BatchCode: $("#txt_BatchCode").val(), ReleaseState: $("#selShow").val(), selEnableShow: $("#selEnableShow").val(), LotNO: $("#txt_LotNO").val(), selIsWH: $("#selIsWH").val() } $gridList.dataGrid({ url: "/WMS/ICSRCVIQCs/GetICSInspection8" + "?" + Math.random(), postData: { MenuID: _MenuID, queryJson: JSON.stringify(queryJson) }, height: $(window).height() - 200, width: $(window).width() - 300, cellEdit: true, colModel: _Clos, //colModel: [ // { label: "主键", name: "ID", hidden: true, key: true }, // { label: 'ID', name: 'ID', hidden: true }, // { label: '到货ID', name: 'DHID', hidden: true }, // { label: '检验ID', name: 'JYID', hidden: true }, // { label: '到货单号', name: 'DNCode', width: 120, align: 'left' }, // { label: '送货单号', name: 'ASNCode', width: 120, align: 'left' }, // { label: '采购订单号', name: 'POCode', width: 120, align: 'left' }, // { label: '条码', name: 'LotNo', width: 120, align: 'left' }, // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' }, // { label: '料品名称', name: 'InvName', width: 100, align: 'left' }, // { label: '规格型号', name: 'INVSTD', width: 100, align: 'left' }, // { label: '批次', name: 'BatchCode', width: 100, align: 'left' }, // { label: '箱号', name: 'ContainerID', width: 100, align: 'left' }, // { label: '到货时间', name: 'CreateDateTime', width: 150, align: 'left' }, // { label: '供应商代码', name: 'VenCode', width: 150, align: 'left' }, // { label: '供应商名称', name: 'VenName', width: 150, align: 'left' }, // { label: '总数量', name: 'AllNumber', width: 100, align: 'left' }, // { label: '合格数量', name: 'YLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }, // { label: '不合格数量', name: 'NLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }, // { label: '特采数量', name: 'SpecialQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }, // { label: '不良代码值', name: 'BCCodeValue', hidden: true }, // { // label: '不良代码', name: 'BadDesc', width: 120, align: 'left', sortable: false, // formatter: function (cellvalue, options, rowObject) { // debugger; // var html = ""; // html += ' <select id="SelBC_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; // html += ' </select>'; // return cellvalue = html; // } // }, // { label: '不良原因值', name: 'BRCodeValue', hidden: true }, // { // label: '不良原因', name: 'BadReasonDesc', width: 120, align: 'left', sortable: false, // formatter: function (cellvalue, options, rowObject) { // var html = ""; // html += ' <select id="SelBR_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; // html += ' </select>'; // return cellvalue = html; // } // }, // { label: '检验状态', name: 'TestState', width: 150, align: 'left' }, // { label: '检验人', name: 'Surveyor', width: 150, align: 'left' }, // { label: '检验时间', name: 'ProvingTime', width: 150, align: 'left' }, //], cellsubmit: "clientArray", shrinkToFit: false,//宽度自适应 autoWidth: true, footerrow: true,//启用底部行(对列汇总时要启用)第一步 gridComplete: function () { debugger; //设置select var RowDatas = $("#gridList").jqGrid('getDataIDs'); for (var j = 0; j < RowDatas.length; j++) { var InvCode = $("#gridList").jqGrid("getCell", RowDatas[j], "InvCode"); var ID = $("#gridList").jqGrid("getCell", RowDatas[j], "ID"); var BCCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BCCodeValue"); var BRCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BRCodeValue"); GetSelectICSBadCode(InvCode, ID, BCCodeValue); GetSelectPerson(InvCode, ID, BRCodeValue); } var Quantity_total = $(this).getCol('AllNumber', false, 'sum'); var YLOTQTY_total = $(this).getCol('YLOTQTY', false, 'sum'); var NLOTQTY_total = $(this).getCol('NLOTQTY', false, 'sum'); var SpecialQTY_total = $(this).getCol('SpecialQTY', false, 'sum'); var SampleQuantity_total = $(this).getCol('SampleQuantity', false, 'sum'); $(this).footerData('set', { "AllNumber": Quantity_total,//声明需要汇总的列并写自定义函数endMoney_total "YLOTQTY": YLOTQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "NLOTQTY": NLOTQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "SpecialQTY": SpecialQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "SampleQuantity": SampleQuantity_total,//声明需要汇总的列并写自定义函数endMoney_total
}); $(this).footerData('set', { "LotNo": "合计:" }); }, pager: "#gridPager", sortorder: "desc", sortname: 'DNCode ', viewrecords: true, multiselect: true, subGrid: false, // (1)开启子表格支持 afterSaveCell: function (rowid, cellname, value) { debugger; var AllNumber = $gridList.jqGrid("getCell", rowid, 'AllNumber'); //总扣分数加其他扣分数 if (cellname === 'YLOTQTY') { var YLOTQTY = Number(value); if (YLOTQTY > AllNumber) { YLOTQTY = 0; } var str = Math.round((parseFloat(AllNumber) - parseFloat(YLOTQTY)) * 10) / 10; $gridList.jqGrid("setCell", rowid, 'NLOTQTY', str); $gridList.jqGrid("setCell", rowid, 'YLOTQTY', YLOTQTY); } if (cellname === 'NLOTQTY') { var NLOTQTY = Number(value); if (NLOTQTY > AllNumber) { NLOTQTY = 0; } var str = Math.round((parseFloat(AllNumber) - parseFloat(NLOTQTY)) * 10) / 10; $gridList.jqGrid("setCell", rowid, 'YLOTQTY', str); $gridList.jqGrid("setCell", rowid, 'NLOTQTY', NLOTQTY); } if (cellname === 'SampleQuantity') { var SampleQuantity = Number(value); if (SampleQuantity > AllNumber) { SampleQuantity = 0; } $gridList.jqGrid("setCell", rowid, 'SampleQuantity', SampleQuantity); } if (cellname === 'SpecialQTY') { var SpecialQTY = Number(value); if (SpecialQTY > AllNumber) { SpecialQTY = 0; } $gridList.jqGrid("setCell", rowid, 'SpecialQTY', SpecialQTY); }
},
});
$("#btn_search").click(function () { var warehouse = $("#warehouse a.active").attr('data-value'); var queryJson = { POCode: $("#txt_POCode").val(), //ASNCode: $("#txt_ASNCode").val(), //CaiGouCode: $("#txt_CaiGouCode").val(), VenCode: $("#txt_VenCode").val(), VenName: $("#txt_VenName").val(), InvCode: $("#txt_InvCode").val(), InvName: $("#txt_InvName").val(), InvStd: $("#txt_InvStd").val(), BatchCode: $("#txt_BatchCode").val(), ReleaseState: $("#selShow").val(), selEnableShow: $("#selEnableShow").val(), LotNO: $("#txt_LotNO").val(), selIsWH: $("#selIsWH").val() } $gridList.jqGrid('setGridParam', { postData: { queryJson: JSON.stringify(queryJson) }, }).trigger('reloadGrid', [{ page: 1 }]); }); } function gridList9() { var $gridList = $("#gridList"); var queryJson = { POCode: $("#txt_POCode").val(), //ASNCode: $("#txt_ASNCode").val(), //CaiGouCode: $("#txt_CaiGouCode").val(), VenCode: $("#txt_VenCode").val(), VenName: $("#txt_VenName").val(), InvCode: $("#txt_InvCode").val(), InvName: $("#txt_InvName").val(), InvStd: $("#txt_InvStd").val(), BatchCode: $("#txt_BatchCode").val(), ReleaseState: $("#selShow").val(), selEnableShow: $("#selEnableShow").val(), LotNO: $("#txt_LotNO").val(), selIsWH: $("#selIsWH").val() } $gridList.dataGrid({ url: "/WMS/ICSRCVIQCs/GetICSInspection9" + "?" + Math.random(), postData: { MenuID: _MenuID, queryJson: JSON.stringify(queryJson) }, height: $(window).height() - 200, width: $(window).width() - 300, cellEdit: true, colModel: _Clos, //colModel: [ // { label: "主键", name: "ID", hidden: true, key: true }, // { label: 'ID', name: 'ID', hidden: true }, // { label: '到货ID', name: 'DHID', hidden: true }, // { label: '检验ID', name: 'JYID', hidden: true }, // { label: '委外到货单号', name: 'DNCode', width: 120, align: 'left' }, // { label: '委外送货单号', name: 'OASNCode', width: 120, align: 'left' }, // { label: '委外采购订单号', name: 'OOCode', width: 120, align: 'left' }, // { label: '条码', name: 'LotNo', width: 120, align: 'left' }, // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' }, // { label: '料品名称', name: 'InvName', width: 100, align: 'left' }, // { label: '规格型号', name: 'INVSTD', width: 100, align: 'left' }, // { label: '批次', name: 'BatchCode', width: 100, align: 'left' }, // { label: '箱号', name: 'ContainerID', width: 100, align: 'left' }, // { label: '到货时间', name: 'CreateDateTime', width: 150, align: 'left' }, // { label: '供应商代码', name: 'VenCode', width: 150, align: 'left' }, // { label: '供应商名称', name: 'VenName', width: 150, align: 'left' }, // { label: '总数量', name: 'AllNumber', width: 100, align: 'left' }, // { label: '合格数量', name: 'YLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }, // { label: '不合格数量', name: 'NLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }, // { label: '特采数量', name: 'SpecialQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }, // { label: '不良代码值', name: 'BCCodeValue', hidden: true }, // { // label: '不良代码', name: 'BadDesc', width: 120, align: 'left', sortable: false, // formatter: function (cellvalue, options, rowObject) { // debugger; // var html = ""; // html += ' <select id="SelBC_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; // html += ' </select>'; // return cellvalue = html; // } // }, // { label: '不良原因值', name: 'BRCodeValue', hidden: true }, // { // label: '不良原因', name: 'BadReasonDesc', width: 120, align: 'left', sortable: false, // formatter: function (cellvalue, options, rowObject) { // var html = ""; // html += ' <select id="SelBR_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; // html += ' </select>'; // return cellvalue = html; // } // }, // { label: '检验状态', name: 'TestState', width: 150, align: 'left' }, // { label: '检验人', name: 'Surveyor', width: 150, align: 'left' }, // { label: '检验时间', name: 'ProvingTime', width: 150, align: 'left' },
//], cellsubmit: "clientArray", shrinkToFit: false,//宽度自适应 autoWidth: true, gridComplete: function () { debugger; //设置select var RowDatas = $("#gridList").jqGrid('getDataIDs'); for (var j = 0; j < RowDatas.length; j++) { var InvCode = $("#gridList").jqGrid("getCell", RowDatas[j], "InvCode"); var ID = $("#gridList").jqGrid("getCell", RowDatas[j], "ID"); var BCCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BCCodeValue"); var BRCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BRCodeValue"); GetSelectICSBadCode(InvCode, ID, BCCodeValue); GetSelectPerson(InvCode, ID, BRCodeValue); } var Quantity_total = $(this).getCol('AllNumber', false, 'sum'); var YLOTQTY_total = $(this).getCol('YLOTQTY', false, 'sum'); var NLOTQTY_total = $(this).getCol('NLOTQTY', false, 'sum'); var SpecialQTY_total = $(this).getCol('SpecialQTY', false, 'sum'); var SampleQuantity_total = $(this).getCol('SampleQuantity', false, 'sum'); $(this).footerData('set', { "AllNumber": Quantity_total,//声明需要汇总的列并写自定义函数endMoney_total "YLOTQTY": YLOTQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "NLOTQTY": NLOTQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "SpecialQTY": SpecialQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "SampleQuantity": SampleQuantity_total,//声明需要汇总的列并写自定义函数endMoney_total
}); $(this).footerData('set', { "LotNo": "合计:" });
},
pager: "#gridPager", sortorder: "desc", sortname: 'DNCode ', viewrecords: true, multiselect: true, footerrow: true,//启用底部行(对列汇总时要启用)第一步 subGrid: false, // (1)开启子表格支持 afterSaveCell: function (rowid, cellname, value) { debugger; var AllNumber = $gridList.jqGrid("getCell", rowid, 'AllNumber'); //总扣分数加其他扣分数 if (cellname === 'YLOTQTY') { var YLOTQTY = Number(value); if (YLOTQTY > AllNumber) { YLOTQTY = 0; } var str = Math.round((parseFloat(AllNumber) - parseFloat(YLOTQTY)) * 10) / 10; $gridList.jqGrid("setCell", rowid, 'NLOTQTY', str); $gridList.jqGrid("setCell", rowid, 'YLOTQTY', YLOTQTY); } if (cellname === 'NLOTQTY') { var NLOTQTY = Number(value); if (NLOTQTY > AllNumber) { NLOTQTY = 0; } var str = Math.round((parseFloat(AllNumber) - parseFloat(NLOTQTY)) * 10) / 10; $gridList.jqGrid("setCell", rowid, 'YLOTQTY', str); $gridList.jqGrid("setCell", rowid, 'NLOTQTY', NLOTQTY); } if (cellname === 'SampleQuantity') { var SampleQuantity = Number(value); if (SampleQuantity > AllNumber) { SampleQuantity = 0; } $gridList.jqGrid("setCell", rowid, 'SampleQuantity', SampleQuantity); } if (cellname === 'SpecialQTY') { var SpecialQTY = Number(value); if (SpecialQTY > AllNumber) { SpecialQTY = 0; } $gridList.jqGrid("setCell", rowid, 'SpecialQTY', SpecialQTY); } if (cellname === 'BadReasonDesc') { $gridList.jqGrid("setCell", rowid, 'BRCodeValue', value); } if (cellname === 'BadDesc') { $gridList.jqGrid("setCell", rowid, 'BCCodeValue', value); } },
}); $("#btn_search").click(function () { var warehouse = $("#warehouse a.active").attr('data-value'); var queryJson = { POCode: $("#txt_POCode").val(), //ASNCode: $("#txt_ASNCode").val(), //CaiGouCode: $("#txt_CaiGouCode").val(), VenCode: $("#txt_VenCode").val(), VenName: $("#txt_VenName").val(), InvCode: $("#txt_InvCode").val(), InvName: $("#txt_InvName").val(), InvStd: $("#txt_InvStd").val(), BatchCode: $("#txt_BatchCode").val(), ReleaseState: $("#selShow").val(), selEnableShow: $("#selEnableShow").val(), LotNO: $("#txt_LotNO").val(), selIsWH: $("#selIsWH").val() } $gridList.jqGrid('setGridParam', { postData: { queryJson: JSON.stringify(queryJson) }, }).trigger('reloadGrid', [{ page: 1 }]); }); } function gridList10() { var $gridList = $("#gridList"); var queryJson = { POCode: $("#txt_POCode").val(), //ASNCode: $("#txt_ASNCode").val(), //CaiGouCode: $("#txt_CaiGouCode").val(), VenCode: $("#txt_VenCode").val(), VenName: $("#txt_VenName").val(), InvCode: $("#txt_InvCode").val(), InvName: $("#txt_InvName").val(), InvStd: $("#txt_InvStd").val(), BatchCode: $("#txt_BatchCode").val(), ReleaseState: $("#selShow").val(), selEnableShow: $("#selEnableShow").val(), LotNO: $("#txt_LotNO").val(), selIsWH: $("#selIsWH").val() } $gridList.dataGrid({ url: "/WMS/ICSRCVIQCs/GetICSInspection10" + "?" + Math.random(), postData: { MenuID: _MenuID, queryJson: JSON.stringify(queryJson) }, height: $(window).height() - 200, width: $(window).width() - 300, cellEdit: true, colModel: _Clos, //colModel: [ // { label: "主键", name: "ID", hidden: true, key: true }, // { label: 'ID', name: 'ID', hidden: true }, // { label: '到货ID', name: 'DHID', hidden: true }, // { label: '检验ID', name: 'JYID', hidden: true }, // { label: '委外到货单号', name: 'DNCode', width: 120, align: 'left' }, // { label: '委外送货单号', name: 'OASNCode', width: 120, align: 'left' }, // { label: '委外采购订单号', name: 'OOCode', width: 120, align: 'left' }, // { label: '条码', name: 'LotNo', width: 120, align: 'left' }, // { label: '料品编码', name: 'InvCode', width: 100, align: 'left' }, // { label: '料品名称', name: 'InvName', width: 100, align: 'left' }, // { label: '规格型号', name: 'INVSTD', width: 100, align: 'left' }, // { label: '批次', name: 'BatchCode', width: 100, align: 'left' }, // { label: '箱号', name: 'ContainerID', width: 100, align: 'left' }, // { label: '到货时间', name: 'CreateDateTime', width: 150, align: 'left' }, // { label: '供应商代码', name: 'VenCode', width: 150, align: 'left' }, // { label: '供应商名称', name: 'VenName', width: 150, align: 'left' }, // { label: '总数量', name: 'AllNumber', width: 100, align: 'left' }, // { label: '合格数量', name: 'YLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }, // { label: '不合格数量', name: 'NLOTQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }, // { label: '特采数量', name: 'SpecialQTY', width: 100, align: 'left', editable: true, editrules: { number: true } }, // { label: '不良代码值', name: 'BCCodeValue', hidden: true }, // { // label: '不良代码', name: 'BadDesc', width: 120, align: 'left', sortable: false, // formatter: function (cellvalue, options, rowObject) { // debugger; // var html = ""; // html += ' <select id="SelBC_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; // html += ' </select>'; // return cellvalue = html; // } // }, // { label: '不良原因值', name: 'BRCodeValue', hidden: true }, // { // label: '不良原因', name: 'BadReasonDesc', width: 120, align: 'left', sortable: false, // formatter: function (cellvalue, options, rowObject) { // var html = ""; // html += ' <select id="SelBR_' + rowObject.ID.toString() + '" data-live-search ="true" Title=\"""\" class="selectpicker" data-width="85px">'; // html += ' </select>'; // return cellvalue = html; // } // }, // { label: '检验状态', name: 'TestState', width: 150, align: 'left' }, // { label: '检验人', name: 'Surveyor', width: 150, align: 'left' }, // { label: '检验时间', name: 'ProvingTime', width: 150, align: 'left' },
//], cellsubmit: "clientArray", shrinkToFit: false,//宽度自适应 autoWidth: true, footerrow: true,//启用底部行(对列汇总时要启用)第一步 gridComplete: function () { debugger; //设置select var RowDatas = $("#gridList").jqGrid('getDataIDs'); for (var j = 0; j < RowDatas.length; j++) { var InvCode = $("#gridList").jqGrid("getCell", RowDatas[j], "InvCode"); var ID = $("#gridList").jqGrid("getCell", RowDatas[j], "ID"); var BCCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BCCodeValue"); var BRCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BRCodeValue"); GetSelectICSBadCode(InvCode, ID, BCCodeValue); GetSelectPerson(InvCode, ID, BRCodeValue); } var Quantity_total = $(this).getCol('AllNumber', false, 'sum'); var YLOTQTY_total = $(this).getCol('YLOTQTY', false, 'sum'); var NLOTQTY_total = $(this).getCol('NLOTQTY', false, 'sum'); var SpecialQTY_total = $(this).getCol('SpecialQTY', false, 'sum'); var SampleQuantity_total = $(this).getCol('SampleQuantity', false, 'sum'); $(this).footerData('set', { "AllNumber": Quantity_total,//声明需要汇总的列并写自定义函数endMoney_total "YLOTQTY": YLOTQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "NLOTQTY": NLOTQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "SpecialQTY": SpecialQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "SampleQuantity": SampleQuantity_total,//声明需要汇总的列并写自定义函数endMoney_total
}); $(this).footerData('set', { "LotNo": "合计:" });
},
pager: "#gridPager", sortorder: "desc", sortname: 'DNCode ', viewrecords: true, multiselect: true, subGrid: false, // (1)开启子表格支持 afterSaveCell: function (rowid, cellname, value) { debugger; var AllNumber = $gridList.jqGrid("getCell", rowid, 'AllNumber'); //总扣分数加其他扣分数 if (cellname === 'YLOTQTY') { var YLOTQTY = Number(value); if (YLOTQTY > AllNumber) { YLOTQTY = 0; } var str = Math.round((parseFloat(AllNumber) - parseFloat(YLOTQTY)) * 10) / 10; $gridList.jqGrid("setCell", rowid, 'NLOTQTY', str); $gridList.jqGrid("setCell", rowid, 'YLOTQTY', YLOTQTY); } if (cellname === 'NLOTQTY') { var NLOTQTY = Number(value); if (NLOTQTY > AllNumber) { NLOTQTY = 0; } var str = Math.round((parseFloat(AllNumber) - parseFloat(NLOTQTY)) * 10) / 10; $gridList.jqGrid("setCell", rowid, 'YLOTQTY', str); $gridList.jqGrid("setCell", rowid, 'NLOTQTY', NLOTQTY); } if (cellname === 'SampleQuantity') { var SampleQuantity = Number(value); if (SampleQuantity > AllNumber) { SampleQuantity = 0; } $gridList.jqGrid("setCell", rowid, 'SampleQuantity', SampleQuantity); } if (cellname === 'SpecialQTY') { var SpecialQTY = Number(value); if (SpecialQTY > AllNumber) { SpecialQTY = 0; } $gridList.jqGrid("setCell", rowid, 'SpecialQTY', SpecialQTY); } if (cellname === 'BadReasonDesc') { $gridList.jqGrid("setCell", rowid, 'BRCodeValue', value); } if (cellname === 'BadDesc') { $gridList.jqGrid("setCell", rowid, 'BCCodeValue', value); } },
}); $("#btn_search").click(function () { var warehouse = $("#warehouse a.active").attr('data-value'); var queryJson = { POCode: $("#txt_POCode").val(), //ASNCode: $("#txt_ASNCode").val(), //CaiGouCode: $("#txt_CaiGouCode").val(), VenCode: $("#txt_VenCode").val(), VenName: $("#txt_VenName").val(), InvCode: $("#txt_InvCode").val(), InvName: $("#txt_InvName").val(), InvStd: $("#txt_InvStd").val(), BatchCode: $("#txt_BatchCode").val(), ReleaseState: $("#selShow").val(), selEnableShow: $("#selEnableShow").val(), LotNO: $("#txt_LotNO").val(), selIsWH: $("#selIsWH").val() } $gridList.jqGrid('setGridParam', { postData: { queryJson: JSON.stringify(queryJson) }, }).trigger('reloadGrid', [{ page: 1 }]); }); } //在库检验 function gridList11() { var $gridList = $("#gridList"); var queryJson = { POCode: $("#txt_POCode").val(), //ASNCode: $("#txt_ASNCode").val(), //CaiGouCode: $("#txt_CaiGouCode").val(), VenCode: $("#txt_VenCode").val(), VenName: $("#txt_VenName").val(), InvCode: $("#txt_InvCode").val(), InvName: $("#txt_InvName").val(), InvStd: $("#txt_InvStd").val(), BatchCode: $("#txt_BatchCode").val(), ReleaseState: $("#selShow").val(), selEnableShow: $("#selEnableShow").val(), LotNO: $("#txt_LotNO").val(), } $gridList.dataGrid({ url: "/WMS/ICSRCVIQCs/GetICSInspection11" + "?" + Math.random(), postData: { MenuID: _MenuID, queryJson: JSON.stringify(queryJson) }, height: $(window).height() - 200, width: $(window).width() - 300, cellEdit: true, colModel: _Clos, cellsubmit: "clientArray", shrinkToFit: false,//宽度自适应 autoWidth: true, footerrow: true,//启用底部行(对列汇总时要启用)第一步 gridComplete: function () { debugger; //设置select var RowDatas = $("#gridList").jqGrid('getDataIDs'); for (var j = 0; j < RowDatas.length; j++) { var InvCode = $("#gridList").jqGrid("getCell", RowDatas[j], "InvCode"); var ID = $("#gridList").jqGrid("getCell", RowDatas[j], "ID"); var BCCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BCCodeValue"); var BRCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BRCodeValue"); GetSelectICSBadCode(InvCode, ID, BCCodeValue); GetSelectPerson(InvCode, ID, BRCodeValue); } var Quantity_total = $(this).getCol('AllNumber', false, 'sum'); var YLOTQTY_total = $(this).getCol('YLOTQTY', false, 'sum'); var NLOTQTY_total = $(this).getCol('NLOTQTY', false, 'sum'); var SpecialQTY_total = $(this).getCol('SpecialQTY', false, 'sum'); var SampleQuantity_total = $(this).getCol('SampleQuantity', false, 'sum'); $(this).footerData('set', { "AllNumber": Quantity_total,//声明需要汇总的列并写自定义函数endMoney_total "YLOTQTY": YLOTQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "NLOTQTY": NLOTQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "SpecialQTY": SpecialQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "SampleQuantity": SampleQuantity_total,//声明需要汇总的列并写自定义函数endMoney_total
}); $(this).footerData('set', { "LotNo": "合计:" });
},
pager: "#gridPager", sortorder: "desc", sortname: 'DNCode ', viewrecords: true, multiselect: true, subGrid: false, // (1)开启子表格支持 afterSaveCell: function (rowid, cellname, value) { debugger; var AllNumber = $gridList.jqGrid("getCell", rowid, 'AllNumber'); //总扣分数加其他扣分数 if (cellname === 'YLOTQTY') { var YLOTQTY = Number(value); if (YLOTQTY > AllNumber) { YLOTQTY = 0; } var str = Math.round((parseFloat(AllNumber) - parseFloat(YLOTQTY)) * 10) / 10; $gridList.jqGrid("setCell", rowid, 'NLOTQTY', str); $gridList.jqGrid("setCell", rowid, 'YLOTQTY', YLOTQTY); } if (cellname === 'NLOTQTY') { var NLOTQTY = Number(value); if (NLOTQTY > AllNumber) { NLOTQTY = 0; } var str = Math.round((parseFloat(AllNumber) - parseFloat(NLOTQTY)) * 10) / 10; $gridList.jqGrid("setCell", rowid, 'YLOTQTY', str); $gridList.jqGrid("setCell", rowid, 'NLOTQTY', NLOTQTY); } if (cellname === 'SampleQuantity') { var SampleQuantity = Number(value); if (SampleQuantity > AllNumber) { SampleQuantity = 0; } $gridList.jqGrid("setCell", rowid, 'SampleQuantity', SampleQuantity); } if (cellname === 'SpecialQTY') { var SpecialQTY = Number(value); if (SpecialQTY > AllNumber) { SpecialQTY = 0; } $gridList.jqGrid("setCell", rowid, 'SpecialQTY', SpecialQTY); } if (cellname === 'BadReasonDesc') { $gridList.jqGrid("setCell", rowid, 'BRCodeValue', value); } if (cellname === 'BadDesc') { $gridList.jqGrid("setCell", rowid, 'BCCodeValue', value); } },
}); $("#btn_search").click(function () { var warehouse = $("#warehouse a.active").attr('data-value'); var queryJson = { POCode: $("#txt_POCode").val(), //ASNCode: $("#txt_ASNCode").val(), //CaiGouCode: $("#txt_CaiGouCode").val(), VenCode: $("#txt_VenCode").val(), VenName: $("#txt_VenName").val(), InvCode: $("#txt_InvCode").val(), InvName: $("#txt_InvName").val(), InvStd: $("#txt_InvStd").val(), BatchCode: $("#txt_BatchCode").val(), ReleaseState: $("#selShow").val(), selEnableShow: $("#selEnableShow").val(), LotNO: $("#txt_LotNO").val(), } $gridList.jqGrid('setGridParam', { postData: { queryJson: JSON.stringify(queryJson) }, }).trigger('reloadGrid', [{ page: 1 }]); }); } function gridList22() { var $gridList = $("#gridList"); var queryJson = { POCode: $("#txt_POCode").val(), //ASNCode: $("#txt_ASNCode").val(), //CaiGouCode: $("#txt_CaiGouCode").val(), //VenCode: $("#txt_VenCode").val(), //VenName: $("#txt_VenName").val(), InvCode: $("#txt_InvCode").val(), InvName: $("#txt_InvName").val(), InvStd: $("#txt_InvStd").val(), BatchCode: $("#txt_BatchCode").val(), ReleaseState: $("#selShow").val(), selEnableShow: $("#selEnableShow").val(), LotNO: $("#txt_LotNO").val(), selIsWH: $("#selIsWH").val() } $gridList.dataGrid({ url: "/WMS/ICSRCVIQCs/GetICSInspection22" + "?" + Math.random(), postData: { MenuID: _MenuID, queryJson: JSON.stringify(queryJson) }, height: $(window).height() - 200, width: $(window).width() - 300, cellEdit: true, colModel: _Clos, cellsubmit: "clientArray", shrinkToFit: false,//宽度自适应 autoWidth: true, gridComplete: function () { debugger; //设置select var RowDatas = $("#gridList").jqGrid('getDataIDs'); for (var j = 0; j < RowDatas.length; j++) { var InvCode = $("#gridList").jqGrid("getCell", RowDatas[j], "InvCode"); var ID = $("#gridList").jqGrid("getCell", RowDatas[j], "ID"); var BCCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BCCodeValue"); var BRCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BRCodeValue"); GetSelectICSBadCode(InvCode, ID, BCCodeValue); GetSelectPerson(InvCode, ID, BRCodeValue); } var Quantity_total = $(this).getCol('AllNumber', false, 'sum'); var YLOTQTY_total = $(this).getCol('YLOTQTY', false, 'sum'); var NLOTQTY_total = $(this).getCol('NLOTQTY', false, 'sum'); var SpecialQTY_total = $(this).getCol('SpecialQTY', false, 'sum'); var SampleQuantity_total = $(this).getCol('SampleQuantity', false, 'sum'); $(this).footerData('set', { "AllNumber": Quantity_total,//声明需要汇总的列并写自定义函数endMoney_total "YLOTQTY": YLOTQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "NLOTQTY": NLOTQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "SpecialQTY": SpecialQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "SampleQuantity": SampleQuantity_total,//声明需要汇总的列并写自定义函数endMoney_total
}); $(this).footerData('set', { "LotNo": "合计:" });
},
pager: "#gridPager", sortorder: "desc", sortname: 'DNCode ', viewrecords: true, multiselect: true, footerrow: true,//启用底部行(对列汇总时要启用)第一步 subGrid: false, // (1)开启子表格支持 afterSaveCell: function (rowid, cellname, value) { debugger; var AllNumber = $gridList.jqGrid("getCell", rowid, 'AllNumber'); //总扣分数加其他扣分数 if (cellname === 'YLOTQTY') { var YLOTQTY = Number(value); if (YLOTQTY > AllNumber) { YLOTQTY = 0; } var str = Math.round((parseFloat(AllNumber) - parseFloat(YLOTQTY)) * 10) / 10; $gridList.jqGrid("setCell", rowid, 'NLOTQTY', str); $gridList.jqGrid("setCell", rowid, 'YLOTQTY', YLOTQTY); } if (cellname === 'NLOTQTY') { var NLOTQTY = Number(value); if (NLOTQTY > AllNumber) { NLOTQTY = 0; } var str = Math.round((parseFloat(AllNumber) - parseFloat(NLOTQTY)) * 10) / 10; $gridList.jqGrid("setCell", rowid, 'YLOTQTY', str); $gridList.jqGrid("setCell", rowid, 'NLOTQTY', NLOTQTY); } if (cellname === 'SampleQuantity') { var SampleQuantity = Number(value); if (SampleQuantity > AllNumber) { SampleQuantity = 0; } $gridList.jqGrid("setCell", rowid, 'SampleQuantity', SampleQuantity); } if (cellname === 'SpecialQTY') { var SpecialQTY = Number(value); if (SpecialQTY > AllNumber) { SpecialQTY = 0; } $gridList.jqGrid("setCell", rowid, 'SpecialQTY', SpecialQTY); } if (cellname === 'BadReasonDesc') { $gridList.jqGrid("setCell", rowid, 'BRCodeValue', value); } if (cellname === 'BadDesc') { $gridList.jqGrid("setCell", rowid, 'BCCodeValue', value); } },
}); $("#btn_search").click(function () { var warehouse = $("#warehouse a.active").attr('data-value'); var queryJson = { POCode: $("#txt_POCode").val(), //ASNCode: $("#txt_ASNCode").val(), //CaiGouCode: $("#txt_CaiGouCode").val(), //VenCode: $("#txt_VenCode").val(), //VenName: $("#txt_VenName").val(), InvCode: $("#txt_InvCode").val(), InvName: $("#txt_InvName").val(), InvStd: $("#txt_InvStd").val(), BatchCode: $("#txt_BatchCode").val(), ReleaseState: $("#selShow").val(), selEnableShow: $("#selEnableShow").val(), LotNO: $("#txt_LotNO").val(), selIsWH: $("#selIsWH").val() } $gridList.jqGrid('setGridParam', { postData: { queryJson: JSON.stringify(queryJson) }, }).trigger('reloadGrid', [{ page: 1 }]); }); }
function gridList23() { var $gridList = $("#gridList"); var queryJson = { POCode: $("#txt_POCode").val(), //ASNCode: $("#txt_ASNCode").val(), //CaiGouCode: $("#txt_CaiGouCode").val(), //VenCode: $("#txt_VenCode").val(), //VenName: $("#txt_VenName").val(), InvCode: $("#txt_InvCode").val(), InvName: $("#txt_InvName").val(), InvStd: $("#txt_InvStd").val(), BatchCode: $("#txt_BatchCode").val(), ReleaseState: $("#selShow").val(), selEnableShow: $("#selEnableShow").val(), LotNO: $("#txt_LotNO").val(), selIsWH: $("#selIsWH").val() } $gridList.dataGrid({ url: "/WMS/ICSRCVIQCs/GetICSInspection23" + "?" + Math.random(), postData: { MenuID: _MenuID, queryJson: JSON.stringify(queryJson) }, height: $(window).height() - 200, width: $(window).width() - 300, cellEdit: true, colModel: _Clos, cellsubmit: "clientArray", shrinkToFit: false,//宽度自适应 autoWidth: true, gridComplete: function () { debugger; //设置select var RowDatas = $("#gridList").jqGrid('getDataIDs'); for (var j = 0; j < RowDatas.length; j++) { var InvCode = $("#gridList").jqGrid("getCell", RowDatas[j], "InvCode"); var ID = $("#gridList").jqGrid("getCell", RowDatas[j], "ID"); var BCCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BCCodeValue"); var BRCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BRCodeValue"); GetSelectICSBadCode(InvCode, ID, BCCodeValue); GetSelectPerson(InvCode, ID, BRCodeValue); } var Quantity_total = $(this).getCol('AllNumber', false, 'sum'); var YLOTQTY_total = $(this).getCol('YLOTQTY', false, 'sum'); var NLOTQTY_total = $(this).getCol('NLOTQTY', false, 'sum'); var SpecialQTY_total = $(this).getCol('SpecialQTY', false, 'sum'); var SampleQuantity_total = $(this).getCol('SampleQuantity', false, 'sum'); $(this).footerData('set', { "AllNumber": Quantity_total,//声明需要汇总的列并写自定义函数endMoney_total "YLOTQTY": YLOTQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "NLOTQTY": NLOTQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "SpecialQTY": SpecialQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "SampleQuantity": SampleQuantity_total,//声明需要汇总的列并写自定义函数endMoney_total
}); $(this).footerData('set', { "LotNo": "合计:" });
},
pager: "#gridPager", sortorder: "desc", sortname: 'DNCode ', viewrecords: true, multiselect: true, footerrow: true,//启用底部行(对列汇总时要启用)第一步 subGrid: false, // (1)开启子表格支持 afterSaveCell: function (rowid, cellname, value) { debugger; var AllNumber = $gridList.jqGrid("getCell", rowid, 'AllNumber'); //总扣分数加其他扣分数 if (cellname === 'YLOTQTY') { var YLOTQTY = Number(value); if (YLOTQTY > AllNumber) { YLOTQTY = 0; } var str = Math.round((parseFloat(AllNumber) - parseFloat(YLOTQTY)) * 10) / 10; $gridList.jqGrid("setCell", rowid, 'NLOTQTY', str); $gridList.jqGrid("setCell", rowid, 'YLOTQTY', YLOTQTY); } if (cellname === 'NLOTQTY') { var NLOTQTY = Number(value); if (NLOTQTY > AllNumber) { NLOTQTY = 0; } var str = Math.round((parseFloat(AllNumber) - parseFloat(NLOTQTY)) * 10) / 10; $gridList.jqGrid("setCell", rowid, 'YLOTQTY', str); $gridList.jqGrid("setCell", rowid, 'NLOTQTY', NLOTQTY); } if (cellname === 'SampleQuantity') { var SampleQuantity = Number(value); if (SampleQuantity > AllNumber) { SampleQuantity = 0; } $gridList.jqGrid("setCell", rowid, 'SampleQuantity', SampleQuantity); } if (cellname === 'SpecialQTY') { var SpecialQTY = Number(value); if (SpecialQTY > AllNumber) { SpecialQTY = 0; } $gridList.jqGrid("setCell", rowid, 'SpecialQTY', SpecialQTY); } if (cellname === 'BadReasonDesc') { $gridList.jqGrid("setCell", rowid, 'BRCodeValue', value); } if (cellname === 'BadDesc') { $gridList.jqGrid("setCell", rowid, 'BCCodeValue', value); } },
}); $("#btn_search").click(function () { var warehouse = $("#warehouse a.active").attr('data-value'); var queryJson = { POCode: $("#txt_POCode").val(), //ASNCode: $("#txt_ASNCode").val(), //CaiGouCode: $("#txt_CaiGouCode").val(), //VenCode: $("#txt_VenCode").val(), //VenName: $("#txt_VenName").val(), InvCode: $("#txt_InvCode").val(), InvName: $("#txt_InvName").val(), InvStd: $("#txt_InvStd").val(), BatchCode: $("#txt_BatchCode").val(), ReleaseState: $("#selShow").val(), selEnableShow: $("#selEnableShow").val(), LotNO: $("#txt_LotNO").val(), selIsWH: $("#selIsWH").val() } $gridList.jqGrid('setGridParam', { postData: { queryJson: JSON.stringify(queryJson) }, }).trigger('reloadGrid', [{ page: 1 }]); }); } function gridList24() { document.getElementById("gridPanel").innerHTML = ' <table id="gridList"></table> <div id="gridPager"></div>';//重置grid var $gridList = $("#gridList"); debugger; var queryJson = { POCode: $("#txt_POCode").val(), ASNCode: $("#txt_ASNCode").val(), CaiGouCode: $("#txt_CaiGouCode").val(), VenCode: $("#txt_VenCode").val(), VenName: $("#txt_VenName").val(), InvCode: $("#txt_InvCode").val(), InvName: $("#txt_InvName").val(), InvStd: $("#txt_InvStd").val(), BatchCode: $("#txt_BatchCode").val(), ReleaseState: $("#selShow").val(), TimeFrom: $("#TimeFrom").val(), TimeArrive: $("#TimeArrive").val(), selEnableShow: $("#selEnableShow").val(), LotNO: $("#txt_LotNO").val(), selIsUrgent: $("#selIsUrgent").val(), selIsPrint: $("#selIsPrint").val(), selIsWH: $("#selIsWH").val() } $gridList.dataGrid({ url: "/WMS/ICSRCVIQCs/GetICSSSDInspection" + "?" + Math.random(), postData: { MenuID: _MenuID, queryJson: JSON.stringify(queryJson) }, height: $(window).height() - 250, width: $(window).width() - 300, cellEdit: true, colModel: _Clos, cellsubmit: "clientArray", shrinkToFit: false,//宽度自适应 autoWidth: true, gridComplete: function () { debugger; //设置select var RowDatas = $("#gridList").jqGrid('getDataIDs'); for (var j = 0; j < RowDatas.length; j++) { var InvCode = $("#gridList").jqGrid("getCell", RowDatas[j], "InvCode"); var ID = $("#gridList").jqGrid("getCell", RowDatas[j], "ID"); var BCCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BCCodeValue"); var BRCodeValue = $("#gridList").jqGrid("getCell", RowDatas[j], "BRCodeValue"); var Editable = $("#gridList").jqGrid("getCell", RowDatas[j], "Editable"); GetSelectICSBadCode(InvCode, ID, BCCodeValue); GetSelectPerson(InvCode, ID, BRCodeValue); if (Editable == "false") { $("#gridList").jqGrid('setCell', RowDatas[j], 'SampleQuantity', '', 'not-editable-cell'); } } var Quantity_total = $(this).getCol('AllNumber', false, 'sum'); var YLOTQTY_total = $(this).getCol('YLOTQTY', false, 'sum'); var NLOTQTY_total = $(this).getCol('NLOTQTY', false, 'sum'); var SpecialQTY_total = $(this).getCol('SpecialQTY', false, 'sum'); var SampleQuantity_total = $(this).getCol('SampleQuantity', false, 'sum'); $(this).footerData('set', { "AllNumber": Quantity_total,//声明需要汇总的列并写自定义函数endMoney_total "YLOTQTY": YLOTQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "NLOTQTY": NLOTQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "SpecialQTY": SpecialQTY_total,//声明需要汇总的列并写自定义函数endMoney_total "SampleQuantity": SampleQuantity_total,//声明需要汇总的列并写自定义函数endMoney_total
}); $(this).footerData('set', { "LotNo": "合计:" });
}, pager: "#gridPager", sortorder: "desc", sortname: 'SSDCode ', viewrecords: true, multiselect: true, footerrow: true,//启用底部行(对列汇总时要启用)第一步 subGrid: false, // (1)开启子表格支持 afterSaveCell: function (rowid, cellname, value) { debugger; var AllNumber = $gridList.jqGrid("getCell", rowid, 'AllNumber'); //总扣分数加其他扣分数 if (cellname === 'YLOTQTY') { var YLOTQTY = Number(value); if (YLOTQTY > AllNumber) { YLOTQTY = 0; } var str = Math.round((parseFloat(AllNumber) - parseFloat(YLOTQTY)) * 10) / 10; $gridList.jqGrid("setCell", rowid, 'NLOTQTY', str); $gridList.jqGrid("setCell", rowid, 'YLOTQTY', YLOTQTY); } if (cellname === 'NLOTQTY') { var NLOTQTY = Number(value); if (NLOTQTY > AllNumber) { NLOTQTY = 0; } var str = Math.round((parseFloat(AllNumber) - parseFloat(NLOTQTY)) * 10) / 10; $gridList.jqGrid("setCell", rowid, 'YLOTQTY', str); $gridList.jqGrid("setCell", rowid, 'NLOTQTY', NLOTQTY); } if (cellname === 'SampleQuantity') { var SampleQuantity = Number(value); if (SampleQuantity > AllNumber) { SampleQuantity = 0; } $gridList.jqGrid("setCell", rowid, 'SampleQuantity', SampleQuantity); } if (cellname === 'SpecialQTY') { var SpecialQTY = Number(value); if (SpecialQTY > AllNumber) { SpecialQTY = 0; } $gridList.jqGrid("setCell", rowid, 'SpecialQTY', SpecialQTY); }
},
});
$("#btn_search").click(function () { var warehouse = $("#warehouse a.active").attr('data-value'); var queryJson = { POCode: $("#txt_POCode").val(), ASNCode: $("#txt_ASNCode").val(), CaiGouCode: $("#txt_CaiGouCode").val(), VenCode: $("#txt_VenCode").val(), VenName: $("#txt_VenName").val(), InvCode: $("#txt_InvCode").val(), InvName: $("#txt_InvName").val(), InvStd: $("#txt_InvStd").val(), BatchCode: $("#txt_BatchCode").val(), ReleaseState: $("#selShow").val(), TimeFrom: $("#TimeFrom").val(), TimeArrive: $("#TimeArrive").val(), selEnableShow: $("#selEnableShow").val(), LotNO: $("#txt_LotNO").val(), selIsUrgent: $("#selIsUrgent").val(), selIsPrint: $("#selIsPrint").val(), selIsWH: $("#selIsWH").val() } $gridList.jqGrid('setGridParam', { postData: { queryJson: JSON.stringify(queryJson) }, }).trigger('reloadGrid', [{ page: 1 }]); }); } //获取不良原因 function GetSelectPerson(InvCode, ID, BRCodeValue) { var str = ""; $.ajax({ url: "/WMS/ICSRCVIQCs/Select_ICSBadReason?InvCode=" + InvCode + "&" + Math.random(), dataType: "json", async: false, async: false, success: function (data) { if (data != null && data.length > 0) { $("#SelBR_" + ID + "").find("option").remove(); for (var i = 0; i < data.length; i++) { $("#SelBR_" + ID + "").append("<option value='" + data[i].BadReasonCode + "'>" + data[i].BadReasonDesc + "</option>"); } } } });
$("#SelBR_" + ID + "").selectpicker('refresh'); $("#SelBR_" + ID + "").selectpicker('val', BRCodeValue);
}
//获取不良代码 function GetSelectICSBadCode(InvCode, ID, BCCodeValue) { var str = ""; $.ajax({ url: "/WMS/ICSRCVIQCs/GetSelectICSBadCode?InvCode=" + InvCode + "&" + Math.random(), dataType: "json", async: false, async: false, success: function (data) { if (data != null && data.length > 0) { $("#SelBC_" + ID + "").find("option").remove(); for (var i = 0; i < data.length; i++) { $("#SelBC_" + ID + "").append("<option value='" + data[i].BadCode + "'>" + data[i].BadDesc + "</option>"); }
} } }); $("#SelBC_" + ID + "").selectpicker('refresh'); $("#SelBC_" + ID + "").selectpicker('val', BCCodeValue);
}
function btnSave() { debugger; $("#gridList").find($("td[aria-describedby='gridList_rn']")).click(); var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据 if (ids.length == 0) { $.modalAlertNew("WMS00004"); return; } var Result = 1; var IDlist = ""; var ICSInspection = []; var EATTRIBUTE2 = ""; var flag = ''; for (var i = 0; i < ids.length; i++) { var rowData = $("#gridList").jqGrid('getRowData', ids[i]); IDlist += "'" + rowData.ID + "',"; if (Type == "11" && rowData.TestState != "未检验") { $.modalAlertNew("WMS00119"); return; } if (rowData.NLOTQTY > 0) { Result = 0; if ($("#SelBC_" + rowData.ID + "").val() == '' || $("#SelBR_" + rowData.ID + "").val() == '') { $.modalAlertNew("WMS00081"); return; }
} else { Result = 1; } if (rowData.YLOTQTY < 0 || rowData.NLOTQTY < 0) { $.modalAlertNew("WMS00082"); return; } if ((rowData.SpecialQTY - 0) > (rowData.NLOTQTY - 0)) { $.modalAlertNew("WMS00083"); return; } //if (saveCode.length>0) { // for (var j = 0; j < saveCode.length; j++) { // if (saveCode[j] == "InspectionEATTRIBUTE2") // { // EATTRIBUTE2 = rowData.InspectionEATTRIBUTE2; // } // } //}
if (Type != 11) { //var obj = { // AllNumber: rowData.AllNumber,//总数量 // YLOTQTY: rowData.YLOTQTY,//合格数量 // NLOTQTY: rowData.NLOTQTY,//不合格数量 // SpecialQTY: rowData.SpecialQTY,//特采数量 // SampleQuantity: rowData.SampleQuantity,//特采数量 // LotNo: rowData.LotNo,//条码 // InvCode: rowData.InvCode,//物料编码 // BCCode: $("#SelBC_" + rowData.ID + "").val(),//不良代码 // BRCode: $("#SelBR_" + rowData.ID + "").val(),//不良原因 // Type: Type, // TestState: rowData.TestState, // JYID: rowData.JYID, // Result: Result, // EATTRIBUTE2: EATTRIBUTE2 //} var obj = { Quantity: rowData.AllNumber,//总数量 QualifiedQuantity: rowData.YLOTQTY,//合格数量 UnqualifiedQuantity: rowData.NLOTQTY,//不合格数量 WaiveQuantity: rowData.SpecialQTY,//特采数量 SampleQuantity: rowData.SampleQuantity,//特采数量 LotNo: rowData.LotNo,//条码 InvCode: rowData.InvCode,//物料编码 BCCode: $("#SelBC_" + rowData.ID + "").val(),//不良代码 BRCode: $("#SelBR_" + rowData.ID + "").val(),//不良原因 Type: Type, JYID: rowData.JYID, Result: Result, } for (var k = 0; k < DataCR.length; k++) { let str = DataCR[k].name; let parts = str.split("_"); // 分割字符串为数组 let result = parts[1]; // 获取分割后的第二部分 var DateCol = result;//列名 var DateColValue = rowData[str];//值 obj[DateCol] = DateColValue;
}
} else { var obj = { AllNumber: rowData.AllNumber,//总数量 YLOTQTY: rowData.YLOTQTY,//合格数量 NLOTQTY: rowData.NLOTQTY,//不合格数量 ExpirationDate: rowData.ExpirationDate,//失效日期 LotNo: rowData.LotNo,//条码 InvCode: rowData.InvCode,//物料编码 BCCode: $("#SelBC_" + rowData.ID + "").val(),//不良代码 BRCode: $("#SelBR_" + rowData.ID + "").val(),//不良原因 Type: Type, TestState: rowData.TestState, DNCode: rowData.DNCode, Result: Result, Memo: rowData.Memo } }
ICSInspection.push(obj); } if (Type != 11) { $.modalConfirm("确定保存吗?", function (r) { if (r) { $.submitForm({ url: "/WMS/ICSRCVIQCs/CreateICSInspection" + "?" + Math.random(), param: { keyValue: IDlist, ICSInspections: JSON.stringify(ICSInspection) }, success: function () { $.currentWindow().$("#gridList").trigger("reloadGrid"); } }) } }); } else { $.modalConfirm("确定保存吗?", function (r) { if (r) { $.submitForm({ url: "/WMS/ICSRCVIQCs/ICSWHLotInspection" + "?" + Math.random(), param: { keyValue: IDlist, ICSInspections: JSON.stringify(ICSInspection) }, success: function () { $.currentWindow().$("#gridList").trigger("reloadGrid"); } }) } }); }
} function btnSaveY() { debugger; $("#gridList").find($("td[aria-describedby='gridList_rn']")).click(); var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据 if (ids.length == 0) { $.modalAlertNew("WMS00004"); return; } var EATTRIBUTE2 = ""; var Result = 1; var IDlist = ""; var ICSInspection = []; var flag = ''; for (var i = 0; i < ids.length; i++) { var rowData = $("#gridList").jqGrid('getRowData', ids[i]); IDlist += "'" + rowData.ID + "',"; if (Type == "11" && rowData.TestState != "未检验") { $.modalAlertNew("WMS00119"); return; } //if (rowData.NLOTQTY > 0) { // Result = 0; // if ($("#SelBC_" + rowData.ID + "").val() == '' || $("#SelBR_" + rowData.ID + "").val() == '') { // $.modalAlertNew("WMS00081"); // return; // }
//} //else { // Result = 1; //}
if (rowData.YLOTQTY < 0 || rowData.NLOTQTY < 0) { $.modalAlertNew("WMS00082"); return; } if ((rowData.SpecialQTY - 0) > (rowData.NLOTQTY - 0)) { $.modalAlertNew("WMS00083"); return; } //if (saveCode.length > 0) { // for (var j = 0; j < saveCode.length; j++) { // if (saveCode[j] == "InspectionEATTRIBUTE2") { // EATTRIBUTE2 = rowData.InspectionEATTRIBUTE2; // } // } //} if (Type != 11) { var obj = {
Quantity: rowData.AllNumber,//总数量 QualifiedQuantity: rowData.AllNumber,//合格数量 UnqualifiedQuantity: 0,//不合格数量 WaiveQuantity: rowData.SpecialQTY,//特采数量 SampleQuantity: rowData.SampleQuantity,//特采数量 LotNo: rowData.LotNo,//条码 InvCode: rowData.InvCode,//物料编码 BCCode: $("#SelBC_" + rowData.ID + "").val(),//不良代码 BRCode: $("#SelBR_" + rowData.ID + "").val(),//不良原因 Type: Type, //TestState: rowData.TestState, JYID: rowData.JYID, Result: Result, //EATTRIBUTE2: EATTRIBUTE2 } for (var k = 0; k < DataCR.length; k++) { let str = DataCR[k].name; let parts = str.split("_"); // 分割字符串为数组 let result = parts[1]; // 获取分割后的第二部分 var DateCol = result;//列名 var DateColValue = rowData[str];//值 obj[DateCol] = DateColValue;
}
} else { var obj = { Quantity: rowData.AllNumber,//总数量 QualifiedQuantity: rowData.AllNumber,//合格数量 UnqualifiedQuantity: 0,//不合格数量 ExpirationDate: rowData.ExpirationDate,//失效日期 LotNo: rowData.LotNo,//条码 InvCode: rowData.InvCode,//物料编码 BCCode: $("#SelBC_" + rowData.ID + "").val(),//不良代码 BRCode: $("#SelBR_" + rowData.ID + "").val(),//不良原因 Type: Type, //TestState: rowData.TestState, DNCode: rowData.DNCode, Result: Result, Memo: rowData.Memo }
}
ICSInspection.push(obj); } if (Type != 11) { $.modalConfirm("确定保存吗?", function (r) { if (r) { $.submitForm({ url: "/WMS/ICSRCVIQCs/CreateICSInspection" + "?" + Math.random(), param: { keyValue: IDlist, ICSInspections: JSON.stringify(ICSInspection) }, success: function (data) {
debugger; if (data.state == "success") { $.currentWindow().$("#gridList").trigger("reloadGrid"); $.modalMsg(data.message, data.state); } else { $.modalAlert(data.message, data.state); } } }) } }); } else { $.modalConfirm("确定保存吗?", function (r) { if (r) { $.submitForm({ url: "/WMS/ICSRCVIQCs/ICSWHLotInspection" + "?" + Math.random(), param: { keyValue: IDlist, ICSInspections: JSON.stringify(ICSInspection) }, success: function () { $.currentWindow().$("#gridList").trigger("reloadGrid"); } }) } }); } } function btnSaveN() { debugger; $("#gridList").find($("td[aria-describedby='gridList_rn']")).click(); var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据 if (ids.length == 0) { $.modalAlertNew("WMS00004"); return; } var EATTRIBUTE2 = ""; var Result = 0; var IDlist = ""; var ICSInspection = []; var flag = ''; for (var i = 0; i < ids.length; i++) { var rowData = $("#gridList").jqGrid('getRowData', ids[i]); IDlist += "'" + rowData.ID + "',"; if (Type == "11" && rowData.TestState != "未检验") { $.modalAlertNew("WMS00119"); return; } //if (rowData.NLOTQTY > 0) { // Result = 0; //if ($("#SelBC_" + rowData.ID + "").val() == '' || $("#SelBR_" + rowData.ID + "").val() == '') { // $.modalAlertNew("WMS00081"); // return; //}
//} //else { // Result = 1; //} if (rowData.YLOTQTY < 0 || rowData.NLOTQTY < 0) { $.modalAlertNew("WMS00082"); return; } if ((rowData.SpecialQTY - 0) > (rowData.NLOTQTY - 0)) { $.modalAlertNew("WMS00083"); return; } //if (saveCode.length > 0) { // for (var j = 0; j < saveCode.length; j++) { // if (saveCode[j] == "InspectionEATTRIBUTE2") { // EATTRIBUTE2 = rowData.InspectionEATTRIBUTE2; // } // } //} if (Type != 11) { var obj = {
Quantity: rowData.AllNumber,//总数量 QualifiedQuantity: 0,//合格数量 UnqualifiedQuantity: rowData.AllNumber,//不合格数量 WaiveQuantity: rowData.SpecialQTY,//特采数量 SampleQuantity: rowData.SampleQuantity,//特采数量 LotNo: rowData.LotNo,//条码 InvCode: rowData.InvCode,//物料编码 BCCode: $("#SelBC_" + rowData.ID + "").val(),//不良代码 BRCode: $("#SelBR_" + rowData.ID + "").val(),//不良原因 Type: Type, //TestState: rowData.TestState, JYID: rowData.JYID, Result: Result, //EATTRIBUTE2: EATTRIBUTE2 } for (var k = 0; k < DataCR.length; k++) { let str = DataCR[k].name; let parts = str.split("_"); // 分割字符串为数组 let result = parts[1]; // 获取分割后的第二部分 var DateCol = result;//列名 var DateColValue = rowData[str];//值 obj[DateCol] = DateColValue;
} } else { var obj = { Quantity: rowData.AllNumber,//总数量 QualifiedQuantity: 0,//合格数量 UnqualifiedQuantity: rowData.AllNumber,//不合格数量 ExpirationDate: rowData.ExpirationDate,//失效日期 LotNo: rowData.LotNo,//条码 InvCode: rowData.InvCode,//物料编码 BCCode: $("#SelBC_" + rowData.ID + "").val(),//不良代码 BRCode: $("#SelBR_" + rowData.ID + "").val(),//不良原因 Type: Type, //TestState: rowData.TestState, DNCode: rowData.DNCode, Result: Result, Memo: rowData.Memo } } ICSInspection.push(obj); } if (Type != 11) { $.modalConfirm("确定保存吗?", function (r) { if (r) { $.submitForm({ url: "/WMS/ICSRCVIQCs/CreateICSInspection" + "?" + Math.random(), param: { keyValue: IDlist, ICSInspections: JSON.stringify(ICSInspection) }, success: function () { $.currentWindow().$("#gridList").trigger("reloadGrid"); } }) } }); } else { $.modalConfirm("确定保存吗?", function (r) { if (r) { $.submitForm({ url: "/WMS/ICSRCVIQCs/ICSWHLotInspection" + "?" + Math.random(), param: { keyValue: IDlist, ICSInspections: JSON.stringify(ICSInspection) }, success: function () { $.currentWindow().$("#gridList").trigger("reloadGrid"); } }) } }); } }
function btnApprove() { debugger; $("#gridList").find($("td[aria-describedby='gridList_rn']")).click(); var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据 if (ids.length == 0) { $.modalAlertNew("WMS00004"); return; } var Result = 1; var IDlist = ""; var ICSInspection = []; var flag = ''; for (var i = 0; i < ids.length; i++) { var rowData = $("#gridList").jqGrid('getRowData', ids[i]); IDlist += "'" + rowData.ID + "',"; if (rowData.TestState != "已检验") { $.modalAlertNew("WMS00118"); return; } var obj = { LotNo: rowData.LotNo,//条码 InvCode: rowData.InvCode,//物料编码 Type: Type, TestState: rowData.TestState, DNCode: rowData.DNCode, Result: Result, Memo: rowData.Memo } ICSInspection.push(obj); } $.modalConfirm("确定保存吗?", function (r) { if (r) { $.submitForm({ url: "/WMS/ICSRCVIQCs/ApproveWHLotInspection" + "?" + Math.random(), param: { keyValue: IDlist, ICSInspections: JSON.stringify(ICSInspection) }, success: function () { $.currentWindow().$("#gridList").trigger("reloadGrid"); } }) } }); }
function btnSecApprove() { debugger; $("#gridList").find($("td[aria-describedby='gridList_rn']")).click(); var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据 if (ids.length == 0) { $.modalAlertNew("WMS00004"); return; } var Result = 1; var IDlist = ""; var ICSInspection = []; var flag = ''; for (var i = 0; i < ids.length; i++) { var rowData = $("#gridList").jqGrid('getRowData', ids[i]); IDlist += "'" + rowData.ID + "',"; if (rowData.TestState != "已审核") { $.modalAlertNew("WMS00120"); return; } var obj = { AllNumber: rowData.AllNumber,//总数量 YLOTQTY: rowData.YLOTQTY,//合格数量 NLOTQTY: rowData.NLOTQTY,//不合格数量 ExpirationDate: rowData.ExpirationDate,//失效日期 LotNo: rowData.LotNo,//条码 InvCode: rowData.InvCode,//物料编码 BCCode: $("#SelBC_" + rowData.ID + "").val(),//不良代码 BRCode: $("#SelBR_" + rowData.ID + "").val(),//不良原因 Type: Type, TestState: rowData.TestState, DNCode: rowData.DNCode, Result: Result, Memo: rowData.Memo } ICSInspection.push(obj); } $.modalConfirm("确定复审吗?", function (r) { if (r) { $.submitForm({ url: "/WMS/ICSRCVIQCs/SecApproveWHLotInspection" + "?" + Math.random(), param: { keyValue: IDlist, ICSInspections: JSON.stringify(ICSInspection) }, success: function () { $.currentWindow().$("#gridList").trigger("reloadGrid"); } }) } }); }
//是否紧急 --字段:是:高亮显示 function TuChuShow_IsUrgent(rowId, val, rawObject, cm, rdata) { if (val == "是") { return "style='color:red'"; } } function btnLook(cellvalue, options, rowObject) { debugger; //var rowData = $("#gridList").jqGrid('getRowData', rowObject.ID); var rowData=$("#gridList").jqGrid('getRowData', rowObject.ID); var BCCode = $("#SelBC_" + rowObject.ID + "").val();//不良代码 var BRCode = $("#SelBR_" + rowObject.ID + "").val();//不良原因
return cellvalue = "<a class=\"btn btn-info dropdown-text\" onclick=\"SeachClick('" + rowObject.InvCode + "','" + rowObject.JYID + "','" + rowObject.ID +"','" + rowObject.Result + "','" + rowObject.LotNo + "')\">查看</ a><a class=\"btn btn-info dropdown-text\" onclick=\"UpLoadFiles('" + rowObject.JYID + "','" + rowObject.DNCode + "')\">上传</ a><a class=\"btn btn-info dropdown-text\" onclick=\"LookFiles('" + rowObject.JYID + "','" + rowObject.DNCode + "')\">文件查看</ a>"; } //查看 function SeachClick(InvCode, JYID,ID, Result, LotNo) { debugger; var rowData = $("#gridList").jqGrid('getRowData', ID); var AllNumber = rowData.AllNumber; var SampleQuantity = rowData.SampleQuantity; var WaiveQuantity = rowData.SpecialQTY; var YLOTQTY = rowData.YLOTQTY; var NLOTQTY = rowData.NLOTQTY; var BCCode = $("#SelBC_" + ID + "").val();//不良代码 var BRCode = $("#SelBR_" + ID + "").val();//不良原因 //if (JYID == ''||JYID == 'null') { // $.modalAlertNew("WMS00113"); // return; //} if (Result == "") { //$.modalOpen({ // id: "CheckInfo", // title: "查看信息", // url: "/WMS/ICSRCVIQCs/ICSInspectionDetail?InvCode=" + encodeURI(encodeURI(InvCode)) + "&JYID=" + encodeURI(encodeURI(JYID)) + "&" + Math.random() + "&SampleQuantity=" + SampleQuantity + "&Result=" + encodeURI(encodeURI(Result)), // width: "1000px", // height: "400px", // callBack: function (iframeId) { // top.frames[iframeId].submitForm(); // } //}); $.modalOpen2({ id: "CheckInfo", title: "查看信息", url: "/WMS/ICSRCVIQCs/ICSInspectionDetailNew?InvCode=" + encodeURI(encodeURI(InvCode)) + "&JYID=" + encodeURI(encodeURI(JYID)) + "&" + Math.random() + "&SampleQuantity=" + SampleQuantity + "&AllNumber=" + encodeURI(encodeURI(AllNumber)) + "&YLOTQTY=" + encodeURI(encodeURI(YLOTQTY)) + "&NLOTQTY=" + encodeURI(encodeURI(NLOTQTY)) + "&WaiveQuantity=" + encodeURI(encodeURI(WaiveQuantity)) + "&BCCode=" + encodeURI(encodeURI(BCCode)) + "&BRCode=" + encodeURI(encodeURI(BRCode)) + "&Result=" + encodeURI(encodeURI(Result)) + "&LotNo=" + encodeURI(encodeURI(LotNo)) + "&Type=" + encodeURI(encodeURI(Type)), width: "1500px", height: "1000px", callBack: function (iframeId) { top.frames[iframeId].submitForm(); }, cancelCallBack: function (iframeId) { top.frames[iframeId].StagingForm(); } }); } else { //$.modalOpenClean({ // id: "CheckInfo", // title: "查看信息", // url: "/WMS/ICSRCVIQCs/ICSInspectionDetail?InvCode=" + encodeURI(encodeURI(InvCode)) + "&JYID=" + encodeURI(encodeURI(JYID)) + "&" + Math.random() + "&SampleQuantity=" + SampleQuantity + "&Result=" + encodeURI(encodeURI(Result)), // width: "1000px", // height: "400px", // callBack: function (iframeId) { // top.frames[iframeId].submitForm(); // } //}); $.modalOpen2({ id: "CheckInfo", title: "查看信息", url: "/WMS/ICSRCVIQCs/ICSInspectionDetailNew?InvCode=" + encodeURI(encodeURI(InvCode)) + "&JYID=" + encodeURI(encodeURI(JYID)) + "&" + Math.random() + "&SampleQuantity=" + SampleQuantity + "&AllNumber=" + encodeURI(encodeURI(AllNumber)) + "&YLOTQTY=" + encodeURI(encodeURI(YLOTQTY)) + "&NLOTQTY=" + encodeURI(encodeURI(NLOTQTY)) + "&WaiveQuantity=" + encodeURI(encodeURI(WaiveQuantity)) + "&BCCode=" + encodeURI(encodeURI(BCCode)) + "&BRCode=" + encodeURI(encodeURI(BRCode)) + "&Result=" + encodeURI(encodeURI(Result)) + "&LotNo=" + encodeURI(encodeURI(LotNo)) + "&Type=" + encodeURI(encodeURI(Type)), width: "1500px", height: "1000px", callBack: function (iframeId) { top.frames[iframeId].submitForm(); }, cancelCallBack: function (iframeId) { top.frames[iframeId].StagingForm(); } }); } } function LookFiles(JYID) { debugger; $.modalOpenClean({ id: "CheckInfo", title: "查看信息", url: "/WMS/ICSRCVIQCs/ICSLookFiles?JYID=" + encodeURI(encodeURI(JYID)), width: "1000px", height: "400px", callBack: function (iframeId) { top.frames[iframeId].submitForm(); } }); }
//触发上传文件控件 function UpLoadFiles(JYID, DNCode) { if (JYID == "" || JYID == "null") { $.modalAlertNew("WMS000101"); return; } $("#FileUpBYRZ").click(); $("#FileUpBYRZID").val(JYID); $("#FileUpBYRZDNCode").val(DNCode); } //上传文件 function UpLoadFile(fileinfo) { debugger; var fileName = ''; var files = fileinfo.files; var ID = $("#FileUpBYRZID").val();
var DNCode = $("#FileUpBYRZDNCode").val(); for (var i = 0; i < files.length; i++) { fileName += "" + files[i].name + ""; if (fileName != null && fileName != "") { var data = new FormData(); jQuery.each(jQuery('#FileUpBYRZ')[0].files, function (i, file) { data.append('file-' + i, file); }); $.ajax({ url: "/WMS/ICSRCVIQCs/UpLoadFileImport" + "?" + Math.random() + "&ID=" + ID + "&DNCode=" + DNCode, type: "post", data: data, dataType: "json", contentType: false, processData: false, success: function (data) { if (data.state == "success") { $.currentWindow().$("#gridListVENDORCERTIFICATE").trigger("reloadGrid"); $.modalMsg(data.message, data.state); } else { $.modalAlert(data.message, data.state); }
}
}); } debugger; document.getElementById("FileUpBYRZ").value = ""; } }
//退回 function btnSendBack() { debugger; var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据 if (ids.length == 0) { $.modalAlertNew("WMS00004"); return; } var IDlist = ""; /* var selShow = $("#selShow").val();*/
for (var i = 0; i < ids.length; i++) { var rowData = $("#gridList").jqGrid('getRowData', ids[i]); var TestState = rowData.TestState; if (TestState != '已检验') { $.modalAlertNew("WMS00084"); return; } if (rowData.AllNumber == rowData.YLOTQTY) { $.modalAlertNew("WMS00085", rowData.LotNo); return; } IDlist += "'" + rowData.LotNo + "',"; } $.modalConfirm("确定退回吗?", function (r) { if (r) { $.submitForm({ url: "/WMS/ICSRCVIQCs/CreateRejection?Type=" + Type + "&" + Math.random(), param: { keyValue: IDlist }, success: function () { $.currentWindow().$("#gridList").trigger("reloadGrid"); } }) } }); } //打印库位 function btn_Print() { debugger; // var mold = 'FP0001'; //条码打印
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); if (Type == "11") { objArr += "'" + rowData.DNCode + "',"; } else { objArr += "'" + rowData.JYID + "',"; } } objArr = objArr.slice(0, objArr.length - 1); if (objArr == "") { $.modalAlertNew("WMS00003"); 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(); } }); }
</script>
<div class="topPanel" style="height:200px"> <div class="toolbar"> <div class="btn-group"> <a id="NF-Create" authorize="yes" class="btn btn-primary" onclick="btnSave()"><i class="fa fa-pencil-square-o"></i>保存检验结果</a> <a id="NF-CreateY" authorize="yes" class="btn btn-primary" onclick="btnSaveY()"><i class="fa fa-pencil-square-o"></i>批量合格</a> <a id="NF-CreateN" authorize="yes" class="btn btn-primary" onclick="btnSaveN()"><i class="fa fa-pencil-square-o"></i>批量不合格</a> <a id="NF-Approve" authorize="yes" class="btn btn-primary" onclick="btnApprove()" style="display:none"><i class="fa fa-pencil-square-o"></i>审核</a> <a id="NF-SecApprove" authorize="yes" class="btn btn-primary" onclick="btnSecApprove()" style="display:none"><i class="fa fa-pencil-square-o"></i>复审</a> <a id="NF-update" authorize="yes" class="btn btn-primary" onclick="btnSendBack()"><i class="fa fa-pencil-square-o"></i>生成拒收单</a> <a id="NF-Print" authorize="yes" class="btn btn-primary dropdown-text" onclick="btn_Print()"><i class="fa fa-print"></i>打印</a> @*<a id="NF-Delete" authorize="yes" class="btn btn-primary" onclick="btn_Delete()"><i class="fa fa-trash-o"></i>删除</a>*@ <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a> <input id='FileUpBYRZ' type='file' style="display: none" onchange="UpLoadFile(this)" multiple="multiple" /> <input id="FileUpBYRZID" hidden="hidden"> <input id="FileUpBYRZDNCode" hidden="hidden"> </div> <script>$('.toolbar').authorizeButton()</script> </div> <div class="search"> <table> <tr> <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: 105px;"> </div> </td>
<td class="HideTxt" style="text-align:right;"><label class="lglabel HideTxt" for="txt_ASNCode"> 送货单号</label>:</td> <td> <div class="input-group HideTxt"> <input id="txt_ASNCode" type="text" class="form-control HideTxt" style="width: 105px;"> </div> </td>
<td class="HideTxt" style="text-align:right;"><label class="lglabel HideTxt" for="txt_CaiGouCode"> 采购订单号</label>:</td> <td> <div class="input-group"> <input id="txt_CaiGouCode" type="text" class="form-control HideTxt" style="width: 105px;"> </div> </td> <td class="HideTxt" style="text-align:right;"><label class="lglabel HideTxt" for="txt_VenCode "> 供应商代码</label>:</td> <td> <div class="input-group HideTxt"> <input id="txt_VenCode" type="text" class="form-control HideTxt" style="width: 105px;"> </div> </td>
<td class="HideTxt" style="text-align:right;"><label class="lglabel HideTxt" for="txt_VenName"> 供应商名称</label>:</td> <td> <div class="input-group HideTxt"> <input id="txt_VenName" type="text" class="form-control HideTxt" style="width: 105px;"> </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: 105px;"> </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: 105px;"> </div> </td>
<td style="text-align:right;"><label class="lglabel" for="txt_InvStd"> 料品规格</label>:</td> <td> <div class="input-group"> <input id="txt_InvStd" type="text" class="form-control" style="width: 105px;"> </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: 105px;"> </div> </td>
<td> <label> 单据状态:</label> </td> <td> <div class="input-group"> <select id="selShow" name="F_Target" class="form-control" style="width: 105px;"> <option value="2">显示全部</option> <option value="1">已检验</option> <option value="0" selected="selected">未检验</option> </select> </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_LotNO" type="text" class="form-control" style="width: 105px;"> </div> </td> <td class="HideTxt" style="text-align:right;"><label class="lglabel HideTxt" for="TimeFrom "> 到货日期(从)</label>:</td> <td> <div class="input-group HideTxt"> <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 class="HideTxt" style="text-align:right;"><label class="lglabel HideTxt" for="TimeArrive"> 到货日期(到)</label>:</td> <td> <div class="input-group HideTxt"> <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 class="HideTxt2" style="text-align:right;"><label class="lglabel HideTxt2" for="selIsUrgent"> 是否急件</label>:</td> <td> <div class="input-group HideTxt2"> <select id="selIsUrgent" name="F_IsUrgent" class="form-control" style="width: 105px;"> <option value="" selected="selected">全部</option> <option value="是">是</option> <option value="否">否</option> </select> </div> </td> <td class="HideTxt3" style="text-align:right;"><label class="lglabel HideTxt3" for="selIsPrint"> 是否拒收</label>:</td> <td> <div class="input-group HideTxt3"> <select id="F_Rejected" name="F_Rejected" class="form-control" style="width: 105px;"> <option value="0" selected="selected">全部</option> <option value="1">是</option> <option value="2">否</option> </select> </div> </td> </tr> <tr> <td class="HideTxt2" style="text-align:right;"><label class="lglabel HideTxt2" for="selIsPrint"> 是否打印</label>:</td> <td> <div class="input-group HideTxt2"> <select id="selIsPrint" name="F_IsPringt" class="form-control" style="width: 105px;"> <option value="" selected="selected">全部</option> <option value="是">是</option> <option value="否">否</option> </select> </div> </td> <td class="HideTxt4" style="text-align:right;"><label class="lglabel HideTxt4" for="selIsWH"> 是否入库</label>:</td> <td> <div class="input-group HideTxt4"> <select id="selIsWH" name="F_IsWH" class="form-control" style="width: 105px;"> <option value="">全部</option> <option value="1">是</option> <option value="0" selected="selected">否</option> </select> </div> </td> <td> <label> 是否合格:</label> </td> <td> <div class="input-group"> <select id="selEnableShow" name="F_Enable" class="form-control" style="width: 105px;"> <option value="" selected="selected">全部</option> <option value="1">是</option> <option value="0">否</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" id="gridPanel"> <table id="gridList"></table> <div id="gridPager"></div></div>
|