You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
756 lines
35 KiB
756 lines
35 KiB
@{
|
|
ViewBag.Title = "Index";
|
|
Layout = "~/Views/Shared/_Index.cshtml";
|
|
}
|
|
<script>
|
|
debugger;
|
|
var _Clos = new Array();
|
|
var Type = $.request("Type");
|
|
var Name = "单据号";
|
|
var ColModelMain = [];
|
|
var ColModelSub = [];
|
|
$(function () {
|
|
SetCols();
|
|
if (Type == '3' ) {
|
|
$(".HideItems").css('display', 'none');
|
|
}
|
|
$("#POCodeShowLable").text(Name);
|
|
if (Type != '3') {
|
|
$("#GDLX").css('display', 'none');
|
|
$("#GDLX2").css('display', 'none');
|
|
|
|
}
|
|
if (Type == '3') {
|
|
$(".GDLX").css('display', 'block');
|
|
Select_SelGDLX();
|
|
gridList3();
|
|
|
|
}
|
|
//副产品
|
|
if (Type == '18') {
|
|
gridList18();
|
|
}
|
|
})
|
|
|
|
function SetCols() {
|
|
$.ajax({
|
|
url: "/Print/SelectColumnName?" + Math.random(),
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
var cols = new Array();
|
|
var cols1 = new Array();
|
|
|
|
if (Type == '3') {
|
|
var collast = { label: "主键", name: "ID", hidden: true, key: true };
|
|
cols.push(collast);
|
|
var collast = { label: '工单号', name: 'MOCode', width: 120, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: '工单行号', name: 'Sequence', width: 50, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: '工单类型', name: 'MoType', width: 100, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: 'ERP工单行ID', name: 'MODetailID', hidden: true };
|
|
cols.push(collast);
|
|
var collast = { label: '已入库数量', name: 'RCVQuantity', hidden: true, };
|
|
cols.push(collast);
|
|
var collast = { label: '料品编码', name: 'InvCode', width: 100, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: '料品名称', name: 'InvName', width: 60, align: 'left', };
|
|
cols.push(collast);
|
|
var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = {
|
|
label: "状态", name: "MOStatus", width: 60, align: "left",
|
|
formatter: function (cellvalue) {
|
|
if (cellvalue == "1") {
|
|
return "初始";
|
|
} else if (cellvalue == "2") {
|
|
return "下发";
|
|
}
|
|
else if (cellvalue == "3") {
|
|
return "关单";
|
|
}
|
|
else { return ""; }
|
|
}
|
|
};
|
|
cols.push(collast);
|
|
var collast = { label: '规格型号', name: 'InvStd', width: 60, align: 'left', };
|
|
cols.push(collast);
|
|
var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
|
|
cols.push(collast);
|
|
//var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
|
|
//cols.push(collast);
|
|
var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
|
|
cols.push(collast);
|
|
//var collast = { label: '可入库数量', name: 'ERPNum', width: 100, align: 'left' };
|
|
//cols.push(collast);
|
|
var collast = { label: '工单备注', name: 'MOMemo', width: 100, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: '类型值', name: 'MoTypeValue', hidden: true };
|
|
cols.push(collast);
|
|
var collast = { label: '料品是否启用辅计量', name: 'AmountEnable', hidden: true };
|
|
cols.push(collast);
|
|
|
|
$.ajax({
|
|
url: "/Print/SelectTableColumnName?" + Math.random(),
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
if (data != null && data.length > 0) {
|
|
DateList = data;
|
|
for (var i = 0; i < data.length; i++) {
|
|
var TableCode = data[i].TableCode;
|
|
if (TableCode == "ICSMO") {
|
|
var Code = data[i].Code;
|
|
var Name = data[i].Name;
|
|
var obj = new Array();
|
|
obj = {
|
|
label: Name,
|
|
name: Code,
|
|
width: 80,
|
|
align: "left"
|
|
}
|
|
cols.push(obj);
|
|
}
|
|
if (TableCode == "ICSInventory") {
|
|
var Code = data[i].Code;
|
|
var Name = data[i].Name;
|
|
var obj = new Array();
|
|
obj = {
|
|
label: Name,
|
|
name: Code,
|
|
width: 80,
|
|
align: "left"
|
|
}
|
|
cols.push(obj);
|
|
//cols1.push(obj);
|
|
}
|
|
}
|
|
}
|
|
_Clos = cols;
|
|
//_Clos1 = cols1;
|
|
}
|
|
|
|
});
|
|
}
|
|
|
|
//副产品生成条码
|
|
if (Type == '18') {
|
|
var collast = { label: "主键", name: "ID", hidden: true, key: true };
|
|
cols.push(collast);
|
|
var collast = { label: '工单号', name: 'MOCode', width: 120, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: '工单子件行号', name: 'Sequence', width: 50, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: '工单类型', name: 'MoType', width: 100, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: '备料表ID', name: 'PickID', hidden: true, };
|
|
cols.push(collast);
|
|
var collast = { label: '料品编码(子)', name: 'ZInvCode', width: 100, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: '料品编码(母)', name: 'MInvCode', width: 100, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: '料品名称', name: 'InvName', width: 60, align: 'left', };
|
|
cols.push(collast);
|
|
var collast = { label: '数量', name: 'Quantity', width: 100, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: '辅计量数量', name: 'Amount', width: 150, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: '已发数量', name: 'IssueQuantity', width: 100, align: 'left' };
|
|
cols.push(collast);
|
|
var collast = { label: '规格型号', name: 'InvStd', width: 60, align: 'left', };
|
|
cols.push(collast);
|
|
var collast = { label: '单位', name: 'InvUnit', width: 100, align: 'left' };
|
|
cols.push(collast);
|
|
//var collast = { label: '批次', name: 'BatchCode', width: 100, align: 'left' };
|
|
//cols.push(collast);
|
|
var collast = { label: '已生成数量', name: 'LOTQTY', width: 60, align: 'left', };
|
|
cols.push(collast);
|
|
var collast = { label: '工单关联ID', name: 'MODetailID', hidden: true };
|
|
cols.push(collast);
|
|
var collast = { label: '类型值', name: 'MoTypeValue', hidden: true };
|
|
cols.push(collast);
|
|
var collast = { label: '料品是否启用辅计量', name: 'AmountEnable', hidden: true };
|
|
cols.push(collast);
|
|
|
|
//var collast = { label: '批次', name: 'BatchCode', 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 == "ICSMOPick") {
|
|
var Code = data[i].Code;
|
|
var Name = data[i].Name;
|
|
var obj = new Array();
|
|
obj = {
|
|
label: Name,
|
|
name: Code,
|
|
width: 80,
|
|
align: "left"
|
|
}
|
|
cols.push(obj);
|
|
}
|
|
if (TableCode == "ICSInventory") {
|
|
var Code = data[i].Code;
|
|
var Name = data[i].Name;
|
|
var obj = new Array();
|
|
obj = {
|
|
label: Name,
|
|
name: Code,
|
|
width: 80,
|
|
align: "left"
|
|
}
|
|
cols.push(obj);
|
|
//cols1.push(obj);
|
|
}
|
|
}
|
|
}
|
|
_Clos = cols;
|
|
//_Clos1 = cols1;
|
|
}
|
|
|
|
});
|
|
}
|
|
|
|
|
|
var cols1 = new Array();
|
|
var collast1 = { label: "主键", name: "ID", hidden: true, key: true };
|
|
cols1.push(collast1);
|
|
var collast1 = { label: "来源单据号", name: "TransCode", width: 150, align: 'left' };
|
|
cols1.push(collast1);
|
|
var collast1 = { label: '来源单据行', name: 'TransSequence', width: 80, align: 'left' };
|
|
cols1.push(collast1);
|
|
var collast1 = { label: '条码', name: 'LotNo', width: 200, align: 'left' };
|
|
cols1.push(collast1);
|
|
var collast1 = { label: '条码数量', name: 'Quantity', width: 80, align: 'left' };
|
|
cols1.push(collast1);
|
|
var collast1 = { label: '辅计量数量', name: 'Amount', width: 80, align: 'left' };
|
|
cols1.push(collast1);
|
|
var collast1 = { label: '生产日期', name: 'ProductDate', width: 80, align: 'left' };
|
|
cols1.push(collast1);
|
|
var collast1 = { label: '失效日期', name: 'ExpirationDate', width: 80, align: 'left' };
|
|
cols1.push(collast1);
|
|
var collast1 = { label: '有效期天数', name: 'EffectiveDays', width: 80, align: 'left' };
|
|
cols1.push(collast1);
|
|
|
|
var collast1 = { label: '是否入库', name: 'isStorage', width: 100, align: 'left' };
|
|
cols1.push(collast1);
|
|
var collast1 = { label: '是否检验', name: 'isInspection', width: 100, align: 'left' };
|
|
cols1.push(collast1);
|
|
var collast1 = { label: '是否免检', name: 'isExemption', width: 100, align: 'left' };
|
|
cols1.push(collast1);
|
|
var collast1 = { label: '操作人', name: 'MUSERName', width: 100, align: 'left' };
|
|
cols1.push(collast1);
|
|
var collast1 = { label: '操作时间', name: 'MTIME', width: 150, align: 'left' };
|
|
cols1.push(collast1);
|
|
|
|
|
|
if (data != null && data.length > 0) {
|
|
DateList = data;
|
|
for (var i = 0; i < data.length; i++) {
|
|
var ColName = data[i].ColName;
|
|
var ColCode = data[i].ColCode;
|
|
var obj = new Array();
|
|
obj = {
|
|
label: ColName,
|
|
name: ColCode,
|
|
width: 80,
|
|
align: "left"
|
|
}
|
|
cols.push(obj);
|
|
cols1.push(obj);
|
|
}
|
|
}
|
|
_Clos = cols;
|
|
_Clos1 = cols1;
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
//成品
|
|
function gridList3() {
|
|
var $gridList = $("#gridList");
|
|
var queryJson = {
|
|
POCode: $("#txt_POCode").val(),
|
|
InvCode: $("#txt_InvCode").val(),
|
|
InvName: $("#txt_InvName").val(),
|
|
BatchCode: $("#txt_BatchCode").val(),
|
|
POStatus: $("#selShow").val(),
|
|
SelGDLX: $("#SelGDLX option:checked").val(),
|
|
}
|
|
$gridList.dataGrid({
|
|
url: "/OMAY/ICSMoCreateLot/GetGridJsonChengPing" + "?" + Math.random(),
|
|
postData: { queryJson: JSON.stringify(queryJson) },
|
|
height: $(window).height() - 200,
|
|
width: $(window).width() - 300,
|
|
colModel: _Clos,
|
|
width: "100%",
|
|
autowidth: true,
|
|
gridComplete: function () {
|
|
},
|
|
pager: "#gridPager",
|
|
sortname: "MOCode,REPLICATE('0',10-len(Sequence))+Sequence ",
|
|
sortorder: "asc",
|
|
viewrecords: true,
|
|
multiselect: true,
|
|
|
|
subGrid: true, // (1)开启子表格支持
|
|
subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
|
|
$("#gridList").jqGrid("setSelection", rowid, false);
|
|
bindSubGrid3(subgrid_id, rowid)
|
|
}
|
|
});
|
|
|
|
$("#warehouse a.btn-default").click(function () {
|
|
$("#warehouse a.btn-default").removeClass("active");
|
|
$(this).addClass("active");
|
|
$('#btn_search').trigger("click");
|
|
});
|
|
$("#btn_search").click(function () {
|
|
var warehouse = $("#warehouse a.active").attr('data-value');
|
|
var queryJson = {
|
|
POCode: $("#txt_POCode").val(),
|
|
InvCode: $("#txt_InvCode").val(),
|
|
InvName: $("#txt_InvName").val(),
|
|
BatchCode: $("#txt_BatchCode").val(),
|
|
POStatus: $("#selShow").val(),
|
|
SelGDLX: $("#SelGDLX option:checked").val(),
|
|
|
|
}
|
|
$gridList.jqGrid('setGridParam', {
|
|
postData: { queryJson: JSON.stringify(queryJson) },
|
|
}).trigger('reloadGrid');
|
|
});
|
|
|
|
}
|
|
|
|
function bindSubGrid3(subgrid_id, rowid) {
|
|
$("#gridList").jqGrid("setSelection", rowid, false);
|
|
var subgrid_table_id;
|
|
subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
|
|
|
|
var subgrid_pager_id;
|
|
subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
|
|
|
|
// (5)动态添加子报表的table和pager
|
|
$("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
|
|
var MOCode = $("#gridList").jqGrid('getRowData', rowid).MOCode;
|
|
var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
|
|
// (6)创建jqGrid对象
|
|
$("#" + subgrid_table_id).dataGrid({
|
|
cellEdit: true,
|
|
url: "/OMAY/ICSMoCreateLot/GetSubGridJson?ApplyNegCode=" + MOCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
|
|
colModel: _Clos1,
|
|
//colModel: ColModelSub,
|
|
shrinkToFit: true,//宽度自适应
|
|
multiselect: true,
|
|
prmNames: { search: "search" },
|
|
viewrecords: true,
|
|
height: "100%",
|
|
rowNum: 20,
|
|
pager: subgrid_pager_id,
|
|
|
|
});
|
|
}
|
|
|
|
|
|
function gridList18() {
|
|
var $gridList = $("#gridList");
|
|
var queryJson = {
|
|
POCode: $("#txt_POCode").val(),
|
|
InvCode: $("#txt_InvCode").val(),
|
|
InvName: $("#txt_InvName").val(),
|
|
BatchCode: $("#txt_BatchCode").val(),
|
|
POStatus: $("#selShow").val()
|
|
}
|
|
$gridList.dataGrid({
|
|
url: "/OMAY/ICSMoCreateLot/GetGridJsonFCP" + "?" + Math.random(),
|
|
postData: { queryJson: JSON.stringify(queryJson) },
|
|
height: $(window).height() - 200,
|
|
width: $(window).width() - 300,
|
|
colModel: _Clos,
|
|
width: "100%",
|
|
autowidth: true,
|
|
//shrinkToFit: true,
|
|
gridComplete: function () {
|
|
},
|
|
pager: "#gridPager",
|
|
// sortname: 'MOCode,cast(Sequence as int)',
|
|
sortname: "MOCode,REPLICATE('0',10-len(Sequence))+Sequence ",
|
|
sortorder: "asc",
|
|
viewrecords: true,
|
|
multiselect: true,
|
|
//beforeSelectRow: function (rowid, e) {
|
|
// $("#gridList").jqGrid('resetSelection');
|
|
// return (true);
|
|
//},
|
|
subGrid: true, // (1)开启子表格支持
|
|
subGridRowExpanded: function (subgrid_id, rowid) { // (2)子表格容器的id和需要展开子表格的行id,将传入此事件函数
|
|
$("#gridList").jqGrid("setSelection", rowid, false);
|
|
bindSubGrid18(subgrid_id, rowid)
|
|
}
|
|
});
|
|
|
|
$("#warehouse a.btn-default").click(function () {
|
|
$("#warehouse a.btn-default").removeClass("active");
|
|
$(this).addClass("active");
|
|
$('#btn_search').trigger("click");
|
|
});
|
|
$("#btn_search").click(function () {
|
|
var warehouse = $("#warehouse a.active").attr('data-value');
|
|
var queryJson = {
|
|
POCode: $("#txt_POCode").val(),
|
|
InvCode: $("#txt_InvCode").val(),
|
|
InvName: $("#txt_InvName").val(),
|
|
BatchCode: $("#txt_BatchCode").val(),
|
|
POStatus: $("#selShow").val()
|
|
}
|
|
$gridList.jqGrid('setGridParam', {
|
|
postData: { queryJson: JSON.stringify(queryJson) },
|
|
}).trigger('reloadGrid');
|
|
});
|
|
|
|
}
|
|
|
|
function bindSubGrid18(subgrid_id, rowid) {
|
|
$("#gridList").jqGrid("setSelection", rowid, false);
|
|
var subgrid_table_id;
|
|
subgrid_table_id = subgrid_id + "_t"; // (3)根据subgrid_id定义对应的子表格的table的id
|
|
|
|
var subgrid_pager_id;
|
|
subgrid_pager_id = subgrid_id + "_pgr" // (4)根据subgrid_id定义对应的子表格的pager的id
|
|
|
|
// (5)动态添加子报表的table和pager
|
|
$("#" + subgrid_id).html("<table id='" + subgrid_table_id + "' class='scroll'></table><div id='" + subgrid_pager_id + "' class='scroll'></div>");
|
|
var MOCode = $("#gridList").jqGrid('getRowData', rowid).MOCode;
|
|
var Sequence = $("#gridList").jqGrid('getRowData', rowid).Sequence;
|
|
// (6)创建jqGrid对象
|
|
$("#" + subgrid_table_id).dataGrid({
|
|
cellEdit: true,
|
|
url: "/OMAY/ICSMoCreateLot/GetSubGridJson?ApplyNegCode=" + MOCode + "&Sequence=" + Sequence + "&Type=" + Type + "&" + Math.random(), // (7)子表格数据对应的url,注意传入的contact.id参数
|
|
colModel: _Clos1,
|
|
//colModel: ColModelSub,
|
|
shrinkToFit: true,//宽度自适应
|
|
multiselect: true,
|
|
prmNames: { search: "search" },
|
|
viewrecords: true,
|
|
height: "100%",
|
|
rowNum: 20,
|
|
pager: subgrid_pager_id,
|
|
|
|
});
|
|
}
|
|
|
|
function btnDelete() {
|
|
var objArr = '';
|
|
var obj = $("#gridList").jqGrid("getRowData");
|
|
for (var i = 0; i < obj.length; i++) {
|
|
var $SubGird = $("#gridList_" + obj[i].ID + "_t");
|
|
var rowData = $SubGird.jqGrid('getGridParam', 'selarrrow');
|
|
if (rowData != "undefined" && rowData != null) {
|
|
for (var j = 0; j < rowData.length; j++) {
|
|
objArr += "'" + rowData[j] + "',";
|
|
}
|
|
}
|
|
}
|
|
if (objArr == "") {
|
|
$.modalAlertNew("WMS00099");
|
|
return;
|
|
}
|
|
$.deleteForm({
|
|
url: "/WMS/WMSCreateItemLot/DeleteItemLot",
|
|
param: { keyValue: JSON.stringify(objArr) },
|
|
success: function () {
|
|
$.currentWindow().$("#gridList").trigger("reloadGrid");
|
|
}
|
|
})
|
|
}
|
|
|
|
|
|
|
|
|
|
function dateChange(num, date) {
|
|
if (!date) {
|
|
date = new Date();//没有传入值时,默认是当前日期
|
|
date = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
|
|
}
|
|
date += " 00:00:00";//设置为当天凌晨12点
|
|
date = Date.parse(new Date(date)) / 1000;//转换为时间戳
|
|
date += (86400) * num;//修改后的时间戳
|
|
var newDate = new Date(parseInt(date) * 1000);//转换为时间
|
|
return newDate.getFullYear() + '-' + (newDate.getMonth() + 1) + '-' + newDate.getDate();
|
|
}
|
|
|
|
|
|
|
|
function btnCreate() {
|
|
debugger;
|
|
var PoStatus;
|
|
var jsonData = '';
|
|
var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow'); //获取 多行数据
|
|
if (ids.length != 1) {
|
|
$.modalAlertNew("WMS00100");
|
|
return;
|
|
}
|
|
var POCode = "";
|
|
var PORow = "";
|
|
if (Type == '3') {
|
|
for (var i in ids) {
|
|
MODetailID = $("#gridList").jqGrid('getRowData', ids[i]).MODetailID;
|
|
MOCode = $("#gridList").jqGrid('getRowData', ids[i]).MOCode;
|
|
Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
|
|
InvCode = $("#gridList").jqGrid('getRowData', ids[i]).InvCode;
|
|
MoTypeValue = $("#gridList").jqGrid('getRowData', ids[i]).MoTypeValue;
|
|
AmountEnable = $("#gridList").jqGrid('getRowData', ids[i]).AmountEnable;
|
|
}
|
|
$.modalOpen({
|
|
id: "FormAddItemLot",
|
|
title: "成品条码产生",
|
|
url: "/OMAY/ICSMoCreateLot/From?MOCode=" + encodeURI(encodeURI(MOCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 3 + "&MODetailID=" + MODetailID + "&MoTypeValue=" + MoTypeValue + "&AmountEnable=" + AmountEnable + "&" + Math.random(),
|
|
width: "550px",
|
|
height: "1000px",
|
|
callBack: function (iframeId) {
|
|
top.frames[iframeId].submitForm();
|
|
}
|
|
});
|
|
}
|
|
else if (Type == '18') {
|
|
for (var i in ids) {
|
|
FCPMOCode = $("#gridList").jqGrid('getRowData', ids[i]).MOCode;
|
|
Sequence = $("#gridList").jqGrid('getRowData', ids[i]).Sequence;
|
|
MODetailID = $("#gridList").jqGrid('getRowData', ids[i]).MODetailID;
|
|
InvCode = $("#gridList").jqGrid('getRowData', ids[i]).ZInvCode;
|
|
MoTypeValue = $("#gridList").jqGrid('getRowData', ids[i]).MoTypeValue;
|
|
AmountEnable = $("#gridList").jqGrid('getRowData', ids[i]).AmountEnable;
|
|
}
|
|
$.modalOpen({
|
|
id: "FormAddItemLot",
|
|
title: "副产品生成条码",
|
|
url: "/OMAY/ICSMoCreateLot/From?FCPMOCode=" + encodeURI(encodeURI(FCPMOCode)) + "&Sequence=" + Sequence + "&InvCode=" + InvCode + "&Type=" + 18 + "&MODetailID=" + MODetailID + "&MoTypeValue=" + MoTypeValue + "&AmountEnable=" + AmountEnable + "&" + Math.random(),
|
|
width: "550px",
|
|
height: "1000px",
|
|
callBack: function (iframeId) {
|
|
top.frames[iframeId].submitForm();
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
function fullscreen() {
|
|
var docElm = document.documentElement;
|
|
if (docElm.requestFullscreen) {
|
|
docElm.requestFullscreen();
|
|
} else if (docElm.mozRequestFullScreen) {
|
|
docElm.mozRequestFullScreen();
|
|
} else if (docElm.webkitRequestFullScreen) {
|
|
docElm.webkitRequestFullScreen();
|
|
} else if (docElm.msRequestFullscreen) {
|
|
docElm.msRequestFullscreen();
|
|
}
|
|
$(window).bind('resize', function () {
|
|
$("#gridList").setGridWidth($(window).width());
|
|
}).trigger('resize');
|
|
$(window).bind('resize', function () {
|
|
$("#gridList").setGridHeight($(window).height());
|
|
}).trigger('resize');
|
|
}
|
|
|
|
|
|
function btnPrint() {
|
|
debugger;
|
|
var mold = '';
|
|
if (Type == '3') { mold = '00003'; }//工单成品生成条码
|
|
if (Type == '18') { mold = 'FCP00001'; }//副产品生成条码
|
|
var objArr = '';
|
|
var arr = [];
|
|
var obj = $("#gridList").jqGrid("getRowData");
|
|
for (var i = 0; i < obj.length; i++) {
|
|
var $SubGird = $("#gridList_" + obj[i].ID + "_t");
|
|
var rowData = $SubGird.jqGrid('getGridParam', 'selarrrow');
|
|
if (rowData != "undefined" && rowData != null && rowData.length != 0) {
|
|
for (var j = 0; j < rowData.length; j++) {
|
|
objArr += "'" + rowData[j] + "',";
|
|
}
|
|
objArr = objArr.slice(0, objArr.length - 1);
|
|
objArr = "" + objArr + "|";
|
|
arr.push(objArr);
|
|
}
|
|
}
|
|
if (objArr == "") {
|
|
$.modalAlertNew("WMS00101");
|
|
return;
|
|
}
|
|
$.modalOpen({
|
|
id: "PrintLot",
|
|
title: "打印",
|
|
url: "/WMS/Print/PrintView?Arguments=" + encodeURI(encodeURI(arr)) + "&mold=" + mold + "&" + Math.random(),
|
|
width: "550px",
|
|
height: "1000px",
|
|
callBack: function (iframeId) {
|
|
top.frames[iframeId].submitForm();
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
function btn_ExportAll() {
|
|
debugger;
|
|
var objArr = '';
|
|
var ids = $("#gridList").jqGrid('getGridParam', 'selarrrow');
|
|
for (var i in ids) {
|
|
objArr += "'" + $("#gridList").jqGrid('getRowData', ids[i]).ID + "',";
|
|
}
|
|
if (objArr=="") {
|
|
$.modalAlert("请选择单据后导出!");
|
|
return;
|
|
}
|
|
var postData = "&Type=" + Type + "";
|
|
//postData += "&ID=" + ID
|
|
|
|
postData += "&ID=" + objArr;
|
|
$.download("/WMS/WMSCreateItemLot/StatementExportAll" + "?" + Math.random(), postData, 'post');
|
|
}
|
|
function Select_SelGDLX() {
|
|
$("#SelGDLX").find("option").remove();
|
|
var DeptName = $("#SelGDLX option:checked").text();
|
|
$("#SelGDLX").append("<option value=''>--请选择--</option>");
|
|
$.ajax({
|
|
url: "/WMS/WMSCreateItemLot/SelGDLX" + "?" + Math.random(),
|
|
dataType: "json",
|
|
async: false,
|
|
success: function (data) {
|
|
if (data != null && data.length > 0) {
|
|
for (var i = 0; i < data.length; i++) {
|
|
$("#SelGDLX").append("<option value='" + data[i].Code + "'>" + data[i].Name + "</option>");
|
|
}
|
|
}
|
|
}
|
|
});
|
|
$("#SelGDLX option:checked").val('');
|
|
}
|
|
|
|
|
|
</script>
|
|
<iframe id="ifrm" src="" width="0" height="0"></iframe>
|
|
<script>
|
|
|
|
</script>
|
|
|
|
<div class="topPanel" style="height:100px;">
|
|
<div class="toolbar">
|
|
<div class="btn-group">
|
|
<a id="NF-Create" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnCreate()"><i class="fa fa-pencil-square-o"></i>生成条码</a>
|
|
<a id="NF-Delete" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnDelete()"><i class="fa fa-pencil-square-o"></i>删除条码</a>
|
|
<a id="NF-Print" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btnPrint()"><i class="fa fa-pencil-square-o"></i>打印</a>
|
|
@*<a id="NF-ExportAll" authorize="yes" style="margin-left:3px;" class="btn btn-primary" onclick="btn_ExportAll()"><i class="fa fa-pencil-square-o"></i>导出</a>*@
|
|
@*<a id="NF-ExportAll" authorize="yes" class="btn btn-default" onclick="btn_ExportAll()"><i class="fa fa-download"></i>导出</a>*@
|
|
<a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
|
|
|
|
</div>
|
|
<div class="btn-group" style="display:block;padding-left:2px;">
|
|
<a class="btn btn-primary" id="downPrintControl" href="~/PrintActivex.exe" style="display:none">点击下载打印组件</a>
|
|
</div>
|
|
<script>$('.toolbar').authorizeButton()</script>
|
|
</div>
|
|
<div class="search">
|
|
<table>
|
|
<tr>
|
|
<td class="POCodeShow" style="text-align:right;"><label class="lglabel " id="POCodeShowLable" for="txt_POCode"> </label>:</td>
|
|
<td class="POCodeShow">
|
|
<div class="input-group">
|
|
<input id="txt_POCode" type="text" class="form-control" style="width: 100px;">
|
|
</div>
|
|
</td>
|
|
<td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_VenCode"> 供应商代码</label>:</td>
|
|
<td class="HideItems">
|
|
<div class="input-group HideItems">
|
|
<input id="txt_VenCode" type="text" class="form-control HideItems" style="width: 100px;">
|
|
</div>
|
|
</td>
|
|
|
|
<td class="HideItems" style="text-align:right;"><label class="lglabel HideItems" for="txt_VenName"> 供应商名称</label>:</td>
|
|
<td class="HideItems">
|
|
<div class="input-group HideItems">
|
|
<input id="txt_VenName" type="text" class="form-control HideItems" style="width: 100px;">
|
|
</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: 100px;">
|
|
</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: 100px;">
|
|
</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: 100px;">
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<label> 是否全部生成: </label>
|
|
</td>
|
|
<td>
|
|
<div class="input-group">
|
|
<select id="selShow" name="F_Target" class="form-control" style="width: 100px;">
|
|
<option value="0">显示全部</option>
|
|
<option value="1">已全部生成</option>
|
|
<option value="2" selected="selected">未全部生成</option>
|
|
</select>
|
|
</div>
|
|
</td>
|
|
<td id="GDLX">
|
|
<label> 工单类型: </label>
|
|
</td>
|
|
<td id="GDLX2">
|
|
<div class="input-group">
|
|
<select id="SelGDLX" name="SelShow" class="form-control" style="width: 100px;"></select>
|
|
</div>
|
|
</td>
|
|
@*<td class="GDLX" style="display:none">
|
|
<label> 工单类型: </label>
|
|
</td>
|
|
<td class="GDLX" style="display:none">
|
|
<div class="input-group">
|
|
<select id="selShow" name="F_Target" class="form-control" style="width: 100px;">
|
|
<option value="0">显示全部</option>
|
|
<option value="1">已全部生成</option>
|
|
<option value="2" selected="selected">未全部生成</option>
|
|
</select>
|
|
</div>
|
|
</td>*@
|
|
<td>
|
|
<span class="input-group-btn">
|
|
<button id="btn_search" type="button" class="btn btn-primary"><i class="fa fa-search"></i></button>
|
|
</span>
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="gridPanel">
|
|
<table id="gridList"></table>
|
|
<div id="gridPager"></div>
|
|
</div>
|