| | |
| | | <!--<button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="HBarcodeSaverPZ">生成品种码</button> |
| | | <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="HBarcodeSaverWY">生成唯一码</button>--> |
| | | <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="HBarcodeSaverBox" id="HBarcodeSaverBox">生成内外箱条码</button> |
| | | <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Print">条码打印</button> |
| | | <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Print">内外箱条码打印</button> |
| | | <!--<button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Print_nx">内箱条码打印</button> |
| | | <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Print_wx">外箱条码打印</button>--> |
| | | <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="set_Print_NX_Convenient">内箱条码打印</button> |
| | | <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="set_Print_WX_Convenient">外箱条码打印</button> |
| | | <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Exit">退出</button> |
| | | |
| | | </div> |
| | |
| | | layer.msg("明细记录第" + (i + 1) + "行,生产日期不能为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" }); |
| | | return Result = false; |
| | | } |
| | | if (_sSubStr[i].HBatchManager == "是" && _sSubStr[i].HBatchNo == "") { |
| | | layer.msg("明细记录第" + (i + 1) + "行,物料启用批次管理,批次为空,请填写批次信息!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" }); |
| | | return Result = false; |
| | | } |
| | | //获取下标 |
| | | index = findIndex(_sSubStr[i].HMaterNumber, _sSubStr[i].HMaterModel, newArray); |
| | | if (index === -1 || _sSubStr[i].HIsSplit == 0) { |
| | |
| | | }); |
| | | return false; |
| | | }); |
| | | form.on('submit(Print)', function (data) {//打印 |
| | | |
| | | //内外箱打印 |
| | | form.on('submit(Print)', function (data) { |
| | | var data1 = layui.table.cache["subTable"] |
| | | , data2 = layui.table.cache["subTable2"]; |
| | | var rows = ''; |
| | |
| | | for (var i = 0; i < data1.length; i++) { |
| | | rows += data1[i].HItemID.toString() + ','; |
| | | rows2 += data1[i].HBarCode.toString() + ','; |
| | | } |
| | | for (var j = 0; j < data2.length; j++) { |
| | | rows += data2[j].HItemID.toString() + ','; |
| | | rows2 += data2[j].HBarCode.toString() + ','; |
| | | } |
| | | rows = rows.substring(rows.length - 1, 0); |
| | | rows2 = rows2.substring(rows2.length - 1, 0); |
| | | if (rows == "") { |
| | | layer.msg("没有需要打印的数据!") |
| | | return; |
| | | } |
| | | else { |
| | | var url = "linteridSession"; |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: GetWEBURL() + url, //方法所在页面和方法名 |
| | | async: true, |
| | | data: { "linterid": rows.toString(), "HUserName": sessionStorage["HUserName"] }, |
| | | dataType: "json", |
| | | success: function (data) { |
| | | layer.closeAll("loading"); |
| | | }, |
| | | error: function (err) { |
| | | layer.alert("错误:" + err, { icon: 5 }); |
| | | } |
| | | }); |
| | | sessionStorage["linterid"] = rows.toString(); |
| | | layer.open({ |
| | | type: 2 |
| | | , area: ['80%', '80%'] |
| | | , title: '打印模版选择' |
| | | , shade: 0.6 //遮罩透明度 |
| | | , maxmin: false //允许全屏最小化 |
| | | , anim: 0 //0-6的动画形式,-1不开启 |
| | | , content: ['../../views/BaseSet/SRM_OpenTmpList.html?linterid=' + sessionStorage["linterid"] + '&HBarcode=&Type=SRM_POOrderBillList', 'yes'] |
| | | , resize: false |
| | | //, cancel: function () { |
| | | // $(".layui-btn").removeClass("layui-btn-disabled"); |
| | | //} |
| | | }) |
| | | } |
| | | }); |
| | | |
| | | //内箱打印 |
| | | form.on('submit(Print_nx)', function (data) { |
| | | var data2 = layui.table.cache["subTable2"];//内箱条码 |
| | | |
| | | var rows = ''; |
| | | var rows2 = ''; |
| | | if (data2 == undefined) { |
| | | layer.msg("请先生成内箱条码!") |
| | | return; |
| | | } |
| | | for (var j = 0; j < data2.length; j++) { |
| | | rows += data2[j].HItemID.toString() + ','; |
| | |
| | | }) |
| | | } |
| | | }); |
| | | |
| | | //外箱打印 |
| | | form.on('submit(Print_wx)', function (data) { |
| | | var data1 = layui.table.cache["subTable"]//外箱条码 |
| | | var rows = ''; |
| | | var rows2 = ''; |
| | | if (data1 == undefined) { |
| | | layer.msg("请先生成外箱条码!") |
| | | return; |
| | | } |
| | | for (var i = 0; i < data1.length; i++) { |
| | | rows += data1[i].HItemID.toString() + ','; |
| | | rows2 += data1[i].HBarCode.toString() + ','; |
| | | } |
| | | |
| | | rows = rows.substring(rows.length - 1, 0); |
| | | rows2 = rows2.substring(rows2.length - 1, 0); |
| | | if (rows == "") { |
| | | layer.msg("没有需要打印的数据!") |
| | | return; |
| | | } |
| | | else { |
| | | var url = "linteridSession"; |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: GetWEBURL() + url, //方法所在页面和方法名 |
| | | async: true, |
| | | data: { "linterid": rows.toString(), "HUserName": sessionStorage["HUserName"] }, |
| | | dataType: "json", |
| | | success: function (data) { |
| | | layer.closeAll("loading"); |
| | | }, |
| | | error: function (err) { |
| | | layer.alert("错误:" + err, { icon: 5 }); |
| | | } |
| | | }); |
| | | sessionStorage["linterid"] = rows.toString(); |
| | | |
| | | layer.open({ |
| | | type: 2 |
| | | , area: ['50%', '50%'] |
| | | , title: '打印模版选择' |
| | | , shade: 0.6 //遮罩透明度 |
| | | , maxmin: false //允许全屏最小化 |
| | | , anim: 0 //0-6的动画形式,-1不开启 |
| | | , content: ['../../views/BaseSet/SRM_OpenTmpList.html?linterid=' + sessionStorage["linterid"] + '&HBarcode=&Type=SRM_POOrderBillList', 'yes'] |
| | | , resize: false |
| | | //, cancel: function () { |
| | | // $(".layui-btn").removeClass("layui-btn-disabled"); |
| | | //} |
| | | }) |
| | | } |
| | | }); |
| | | |
| | | //一键打印内箱 |
| | | form.on('submit(set_Print_NX_Convenient)', function (data) { |
| | | var data2 = layui.table.cache["subTable2"];//内箱条码 |
| | | |
| | | var rows = ''; |
| | | var rows2 = ''; |
| | | if (data2 == undefined) { |
| | | layer.msg("请先生成内箱条码!") |
| | | return; |
| | | } |
| | | for (var j = 0; j < data2.length; j++) { |
| | | rows += data2[j].HItemID.toString() + ','; |
| | | rows2 += data2[j].HBarCode.toString() + ','; |
| | | } |
| | | rows = rows.substring(rows.length - 1, 0); |
| | | rows2 = rows2.substring(rows2.length - 1, 0); |
| | | if (rows == "") { |
| | | layer.msg("没有需要打印的数据!") |
| | | return; |
| | | } |
| | | else { |
| | | var url = "linteridSession"; |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: GetWEBURL() + url, //方法所在页面和方法名 |
| | | async: true, |
| | | data: { "linterid": rows.toString(), "HUserName": sessionStorage["HUserName"] }, |
| | | dataType: "json", |
| | | success: function (data) { |
| | | layer.closeAll("loading"); |
| | | }, |
| | | error: function (err) { |
| | | layer.alert("错误:" + err, { icon: 5 }); |
| | | } |
| | | }); |
| | | sessionStorage["linterid"] = rows.toString(); |
| | | |
| | | $.ajax({ |
| | | type: "get", |
| | | url: GetWEBURL() + "/Open_PrintTem/GetDefaultOpenTmp_Json", |
| | | async: true, |
| | | data: { "HNumber": 'SRM_POOrderBillList' }, |
| | | //data: { "Value": Value }, |
| | | success: function (result) { |
| | | if (result.count == 1) { |
| | | var OpenTmp = result.data[0].模板名称 |
| | | window.open("../../views/SRM/HBarPlanPrint.html?linterid=" + sessionStorage["linterid"].toString() + "&Type=SRM_POOrderBillList" + "&OpenTmp=" + OpenTmp.toString()); |
| | | } else { |
| | | layer.msg(result.Message); |
| | | } |
| | | }, |
| | | error: function (result) { |
| | | console.log(result); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | //一键打印外箱 |
| | | form.on('submit(set_Print_WX_Convenient)', function (data) { |
| | | var data1 = layui.table.cache["subTable"]//外箱条码 |
| | | var rows = ''; |
| | | var rows2 = ''; |
| | | if (data1 == undefined) { |
| | | layer.msg("请先生成外箱条码!") |
| | | return; |
| | | } |
| | | for (var i = 0; i < data1.length; i++) { |
| | | rows += data1[i].HItemID.toString() + ','; |
| | | rows2 += data1[i].HBarCode.toString() + ','; |
| | | } |
| | | |
| | | rows = rows.substring(rows.length - 1, 0); |
| | | rows2 = rows2.substring(rows2.length - 1, 0); |
| | | if (rows == "") { |
| | | layer.msg("没有需要打印的数据!") |
| | | return; |
| | | } |
| | | else { |
| | | var url = "linteridSession"; |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: GetWEBURL() + url, //方法所在页面和方法名 |
| | | async: true, |
| | | data: { "linterid": rows.toString(), "HUserName": sessionStorage["HUserName"] }, |
| | | dataType: "json", |
| | | success: function (data) { |
| | | layer.closeAll("loading"); |
| | | }, |
| | | error: function (err) { |
| | | layer.alert("错误:" + err, { icon: 5 }); |
| | | } |
| | | }); |
| | | sessionStorage["linterid"] = rows.toString(); |
| | | |
| | | $.ajax({ |
| | | type: "get", |
| | | url: GetWEBURL() + "/Open_PrintTem/GetDefaultOpenTmp_Json", |
| | | async: true, |
| | | data: { "HNumber": 'SRM_POOrderBillList' }, |
| | | //data: { "Value": Value }, |
| | | success: function (result) { |
| | | if (result.count == 1) { |
| | | var OpenTmp = result.data[0].模板名称 |
| | | window.open("../../views/SRM/HBarPlanPrint.html?linterid=" + sessionStorage["linterid"].toString() + "&Type=SRM_POOrderBillList" + "&OpenTmp=" + OpenTmp.toString()); |
| | | } else { |
| | | layer.msg(result.Message); |
| | | } |
| | | }, |
| | | error: function (result) { |
| | | console.log(result); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | form.on('submit(Exit)', function (data) {//退出 |
| | | var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引 |
| | | parent.layer.close(index); //再执行关闭 |
| | |
| | | //} |
| | | } |
| | | }); |
| | | //进入页面查询表体物料信息 |
| | | layer.load(3) |
| | | table.render({ |
| | | elem: '#mainTable' |
| | |
| | | { type: 'checkbox', fixed: 'left' } |
| | | , { field: 'HMaterID', title: '物料ID', width: 100, hide: true } |
| | | , { field: 'HMaterNumber', title: '物料编码', width: 120 } |
| | | , { field: 'HOldMaterNumber', title: '旧物料编码', width: 120, hide: true } |
| | | , { field: 'HOldMaterNumber', title: '旧物料编码', width: 120, hide: true } |
| | | , { field: 'HMaterShortNumber', title: '物料代码', width: 120, hide: true } |
| | | , { field: 'HSubjoin', title: '物料代码', width: 120, hide: true } |
| | | , { field: 'HSubjoin', title: '物料代码', width: 120, hide: true } |
| | | , { field: 'HMaterName', title: '物料名称', width: 120 } |
| | | , { field: 'HMaterModel', title: '规格型号', width: 120 } |
| | | , { field: 'HUnitName', title: '计量单位', width: 100 } |
| | | , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true } |
| | | , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true } |
| | | , { field: 'HDDQty', title: '订单数量', width: 100 } |
| | | , { field: 'HMrbQty', title: '退料数量', width: 100, hide: true} |
| | | , { field: 'HMrbQty', title: '退料数量', width: 100, hide: true } |
| | | , { field: 'HBarcodeCount', title: '已生成条码数量', width: 135 } |
| | | , { field: 'HNotBarcodeCount', title: '可生成条码数量', width: 135 } |
| | | , { field: 'HQty', title: '本次生成条码数量', width: 135, edit: 'text', event: "inputHQty" } |
| | |
| | | , { field: 'HMoney', title: '金额', width: 100, hide: true } |
| | | , { field: 'HMTONO', title: '计划跟踪单号', width: 100, hide: true } |
| | | , { field: 'HBatchNo', title: '批号', width: 100, edit: 'text' } |
| | | , { field: 'HBatchManager', title: '启用批号', width: 100, hide: true } |
| | | , { field: 'HISKFPERIOD', title: '是否启用保质期', width: 100, edit: 'text', hide: true } |
| | | , { field: 'HEXPUNIT', title: '保质期单位', width: 100, edit: 'text', hide: true } |
| | | , { field: 'HKFDate', title: '生产日期', align: 'center', width: 150, data_field: 'HKFDate', event: "chooseHKFDate" }//, event: "chooseHKFDate" |