| | |
| | | <div class="layui-row layui-col-space15"> |
| | | <div class="layui-col-md12"> |
| | | <div class="layui-card"> |
| | | <form id="form0" class="layui-form" action=""> |
| | | <form id="form0" class="layui-form" action="" lay-filter="formData"> |
| | | <div class="layui-card-header"> |
| | | <div class="layui-btn-group"> |
| | | <button type="button" id="add-btn" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Saver">保存</button> |
| | | <button type="button" id="aduit-btn" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Aduit">审核</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="ChooseSource">选源单</button> |
| | | <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Print_Convenient">一键打印</button> |
| | | <button type="button" id="ChooseSource-btn" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="ChooseSource">选源单</button> |
| | | <!--<button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="BuildBarcode">生成条码</button>--> |
| | | <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="MergeBuildBarcode">合并生成条码</button> |
| | | <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Exit">退出</button> |
| | | </div> |
| | | </div> |
| | |
| | | <label class="layui-form-label">单 据 号:</label> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" name="HBillNo" lay-verify="HBillNo" id="HBillNo" readonly="readonly" autocomplete="off"> |
| | | <input class="layui-input" name="HInterID" lay-verify="HInterID" id="HInterID" readonly="readonly" autocomplete="off" style="display:none;"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-xs3"> |
| | |
| | | var linterid = params[params[0]]; |
| | | var lentryid = params[params[1]]; |
| | | var lSourceBillType = params[params[2]]; |
| | | var HType = params[params[3]]; |
| | | // debugger; |
| | | $.ajax({ |
| | | url: GetWEBURL() + "GetNewPOInStockBillNo", |
| | | type: "GET", |
| | | data: { "sMsg": linterid, "sMsg3": lSourceBillType }, |
| | | success: function (d) { |
| | | //console.log(d.data); |
| | | $("#HBillNo").val(d.data[0].HBillNo); |
| | | $("#HInnerBillNo").val(d.data[0].HInnerBillNo); |
| | | $("#HDate").val(d.data[0].HDate); |
| | | } |
| | | }); |
| | | $.ajax({ |
| | | url: GetWEBURL() + "GetNewPOInStockShowBillMain", |
| | | type: "GET", |
| | | data: { "sMsg": linterid, "sMsg3": lSourceBillType }, |
| | | success: function (d) { |
| | | //console.log(d.data); |
| | | //$("#HDate").val(d.) |
| | | $("#HInterID").val(d.data[0].HInterID); |
| | | //$("#HBillNo").val(d.data[0].HBillNo); |
| | | $("#HRemark").val(d.data[0].HRemark); |
| | | //$("#HDate").val(d.data[0].HDateForWeb); |
| | | $("#HMaker").val(sessionStorage["HUserName"]); |
| | | //$("#HMakerDate").val(d.data[0].HMakerDate) |
| | | //$("#HChecker").val(d.data[0].HChecker); |
| | | //$("#HCheckDate").val(d.data[0].HCheckDate); |
| | | $("#HSupID").val(d.data[0].HSupID); |
| | | $("#HSupName").val(d.data[0].HSupName); |
| | | $("#HDeptID").val(d.data[0].HDeptID); |
| | | $("#HDeptName").val(d.data[0].HDepName); |
| | | $("#HEmpID").val(d.data[0].HEmpID); |
| | | $("#HEmpName").val(d.data[0].HEmpName); |
| | | $("#HManagerID").val(d.data[0].HManagerID); |
| | | $("#HManagerName").val(d.data[0].HManagerName); |
| | | $("#HPURCHASEORGID").val(d.data[0].FPURCHASEORGID); |
| | | $("#HPURCHASEORGName").val(d.data[0].HOrgName); |
| | | $("#HReceiveGoodsMan").val(d.data[0].HReceiveGoodsMan); |
| | | $("#HAddress").val(d.data[0].HAddress); |
| | | //$("#HSendGoodsAddr").val(d.data[0].HPROVIDERADDRESS); |
| | | } |
| | | }); |
| | | |
| | | if (HType == "edit") { |
| | | //编辑 |
| | | |
| | | } else { |
| | | //新增 |
| | | $.ajax({ |
| | | url: GetWEBURL() + "GetNewPOInStockBillNo", |
| | | type: "GET", |
| | | data: { "sMsg": linterid, "sMsg3": lSourceBillType }, |
| | | async: false, |
| | | success: function (d) { |
| | | //console.log(d.data); |
| | | $("#HInterID").val(d.data[0].HInterID); |
| | | $("#HBillNo").val(d.data[0].HBillNo); |
| | | $("#HInnerBillNo").val(d.data[0].HInnerBillNo); |
| | | $("#HDate").val(d.data[0].HDate); |
| | | } |
| | | }); |
| | | $.ajax({ |
| | | url: GetWEBURL() + "GetNewPOInStockShowBillMain", |
| | | type: "GET", |
| | | data: { "sMsg": linterid, "sMsg3": lSourceBillType }, |
| | | success: function (d) { |
| | | //console.log(d.data); |
| | | //$("#HDate").val(d.) |
| | | //$("#HInterID").val(d.data[0].HInterID); |
| | | //$("#HBillNo").val(d.data[0].HBillNo); |
| | | $("#HRemark").val(d.data[0].HRemark); |
| | | //$("#HDate").val(d.data[0].HDateForWeb); |
| | | $("#HMaker").val(sessionStorage["HUserName"]); |
| | | //$("#HMakerDate").val(d.data[0].HMakerDate) |
| | | //$("#HChecker").val(d.data[0].HChecker); |
| | | //$("#HCheckDate").val(d.data[0].HCheckDate); |
| | | $("#HSupID").val(d.data[0].HSupID); |
| | | $("#HSupName").val(d.data[0].HSupName); |
| | | $("#HDeptID").val(d.data[0].HDeptID); |
| | | $("#HDeptName").val(d.data[0].HDepName); |
| | | $("#HEmpID").val(d.data[0].HEmpID); |
| | | $("#HEmpName").val(d.data[0].HEmpName); |
| | | $("#HManagerID").val(d.data[0].HManagerID); |
| | | $("#HManagerName").val(d.data[0].HManagerName); |
| | | $("#HPURCHASEORGID").val(d.data[0].FPURCHASEORGID); |
| | | $("#HPURCHASEORGName").val(d.data[0].HOrgName); |
| | | $("#HReceiveGoodsMan").val(d.data[0].HReceiveGoodsMan); |
| | | $("#HAddress").val(d.data[0].HAddress); |
| | | //$("#HSendGoodsAddr").val(d.data[0].HPROVIDERADDRESS); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | layui.config({ |
| | | base: '../../layuiadmin/' //静态资源所在路径 |
| | |
| | | laydate.render({ |
| | | elem: '#HDHDate' |
| | | }); |
| | | RoadHBillSub(); |
| | | |
| | | if (HType == "edit") { |
| | | //编辑 |
| | | RoadBillMain_Edit(linterid); |
| | | } else { |
| | | //新增 |
| | | RoadHBillSub(); |
| | | } |
| | | |
| | | layer.load(3) |
| | | |
| | | var HIsAduit = false; |
| | | |
| | | var HModName = "SRM_POInStockBill_Edit"; |
| | | var option = "" |
| | | window.HSubData = "";//全局变量 |
| | | var option = { |
| | | elem: '#mainTable' |
| | | , toolbar: '#toolbarDemo' |
| | | , cols: [[ |
| | | { type: 'checkbox', fixed: 'left' } |
| | | { type: 'checkbox', fixed: 'left', totalRowText: '合计' } |
| | | , { field: 'sorderid', title: '序号', width: 80, hide: true, fixed: true } |
| | | , { field: 'HMTONO', title: '计划跟踪单号', width: 100, fixed: true, edit: 'text', hide: true } |
| | | , { field: 'HMaterID', title: '物料ID', width: 100, hide: true } |
| | |
| | | , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true } |
| | | , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true } |
| | | , { field: 'FPrintCount', title: '打印条码数量', width: 120, hide: true } |
| | | , { field: 'HQty', title: '送货数量*', width: 100, edit: 'text', event: "inputHQty" } |
| | | , { field: 'HRQty', title: '剩余可发货数量', width: 100 } |
| | | , { field: 'HSQty', title: '源单数量', width: 100 } |
| | | , { field: 'HQty', title: '送货数量*', width: 100, edit: 'text', event: "inputHQty", totalRow: true} |
| | | , { field: 'HRQty', title: '剩余可发货数量', width: 100, totalRow: true } |
| | | , { field: 'HSQty', title: '源单数量', width: 100, totalRow: true } |
| | | , { field: 'HBatchNo', title: '批号', width: 120, edit: 'text' } |
| | | , { field: 'HBatchManager', title: '启用批次管理', width: 120, hide: true } |
| | | , { field: 'HOrderType', title: '订单类型', width: 120, hide: true } |
| | | , { field: 'HKFDate', title: '生产日期', align: 'center', width: 150, data_field: 'HKFDate', event: "chooseHKFDate" } |
| | | , { field: 'HKFPeriod', title: '保质期', width: 100, hide: true } |
| | | , { field: 'HDate', title: '预计到货日期', align: 'center', width: 150, data_field: 'HDate', event: "chooseHDate", hide: true } |
| | | , { field: 'HPrice', title: '单价', width: 100, hide: true } |
| | | , { field: 'HMoney', title: '金额', width: 100, hide: true } |
| | | , { field: 'HRemark', title: '备注', width: 200, edit: true } |
| | | , { field: 'HTAXPRICE_T', title: '含税重量单价/吨', width: 200, edit: true, hide: true} |
| | | , { field: 'HTAXPRICE_T', title: '含税重量单价/吨', width: 200, edit: true, hide: true } |
| | | //, { field: 'HRemark', title: '备注', width: 100 } |
| | | , { field: 'HPOOrderInterID', title: '采购订单主内码', width: 150, hide: true } |
| | | , { field: 'HPOOrderEntryID', title: '采购订单子内码', width: 150, hide: true } |
| | |
| | | // , data: [linterid] |
| | | // , page: true |
| | | , limit: 500 //每页默认显示的数量 |
| | | //, height: 500 |
| | | , totalRow: true |
| | | , height: 'full-1000' |
| | | , done: function () { |
| | | layer.closeAll("loading"); |
| | | } |
| | |
| | | $(obj.tr).find(".layui-table-edit").keyup(function () { |
| | | var $input = $(this), val = $input.val(); |
| | | if (!val) val = "0"; |
| | | $input.val(parseInt(val.replace(/[^\d*\.?\d*]/g, ''))); |
| | | }); |
| | | //$input.val(parseInt(val.replace(/[^\d*\.?\d*]/g, ''))); |
| | | $input.val(val.replace(/[^\d*\.?\d*]/g, '')); |
| | | }); |
| | | } |
| | | |
| | | }); |
| | |
| | | layer.msg("错误:" + "下推送货单,合计送货数量不能超过剩余可发货数量!", { icon: 5 }); |
| | | } |
| | | } |
| | | table.reload('mainTable');//刷新表格信息,合计数量 |
| | | } |
| | | |
| | | }); |
| | |
| | | success: function (result) { |
| | | if (result.count == 10000) { |
| | | for (let i = 0; i < result.data.length; i++) { |
| | | result.data[i].HBatchNo = result.data[i].HBatchNo.substring(0, 6); |
| | | if (sessionStorage["Organization"] == "事业一处") { |
| | | result.data[i].HBatchNo = result.data[i].HBatchNo.substring(0, 6); |
| | | } |
| | | } |
| | | ajaxReturnData = JSON.parse(JSON.stringify(result)).data; |
| | | HSubData = ajaxReturnData; |
| | |
| | | }; |
| | | form.on('submit(Saver)', function (data) {//保存 |
| | | //debugger; |
| | | |
| | | for (var i = 0; i < table.cache["mainTable"].length; i++) { |
| | | if (table.cache["mainTable"][i].HMaterName.indexOf("\"") != -1 || table.cache["mainTable"][i].HMaterName.indexOf(";") != -1) { |
| | | table.cache["mainTable"][i].HMaterName = table.cache["mainTable"][i].HMaterName.replace("\"", "”").replace(";", ";") |
| | | } |
| | | if (table.cache["mainTable"][i].HMaterModel.indexOf("\"") != -1 || table.cache["mainTable"][i].HMaterModel.indexOf(";") != -1) { |
| | | table.cache["mainTable"][i].HMaterModel = table.cache["mainTable"][i].HMaterModel.replace("\"", "”").replace(";", ";") |
| | | } |
| | | } |
| | | |
| | | var sMainStr = JSON.stringify(data.field); |
| | | var sSubStr = JSON.stringify(table.cache['mainTable']); |
| | | var sMainSub = sMainStr + ';' + sSubStr; |
| | | var sMainSub = sMainStr + ';' + sSubStr + ';' + HType; |
| | | |
| | | if (!AllowLoadData(sSubStr))//数据验证 |
| | | { |
| | |
| | | if (data.count == 1) { // 说明验证成功了, |
| | | layer.msg(data.Message, { icon: 1 }); |
| | | $('#add-btn').addClass("layui-btn-disabled").attr("disabled", true); |
| | | $('#ChooseSource-btn').addClass("layui-btn-disabled").attr("disabled", true); |
| | | } |
| | | else { |
| | | f_alert(data.Message); |
| | |
| | | if (data.count == 1) { // 说明验证成功了, |
| | | layer.open({ |
| | | type: 2 |
| | | , area: ['50%', '50%'] |
| | | , area: ['40%', '80%'] |
| | | , title: '打印模版选择' |
| | | , shade: 0.6 //遮罩透明度 |
| | | , maxmin: false //允许全屏最小化 |
| | |
| | | }); |
| | | }); |
| | | |
| | | //一键打印 |
| | | form.on('submit(Print_Convenient)', function (data) { |
| | | if (HIsAduit == false) { |
| | | layer.msg("请审核送货单后在进行打印( ´◔︎ ‸◔︎`)", { icon: 5 }); |
| | | return; |
| | | } |
| | | $.ajax({ |
| | | type: "GET", |
| | | url: GetWEBURL() + "/GetHinterID", //方法所在页面和方法名 |
| | | async: true, |
| | | data: { "HBillNo": $("#HBillNo").val() }, |
| | | dataType: "json", |
| | | success: function (data) { |
| | | if (data.count == 1) { // 说明验证成功了, |
| | | $.ajax({ |
| | | type: "get", |
| | | url: GetWEBURL() + "/Open_PrintTem/GetDefaultOpenTmp_Json", |
| | | async: true, |
| | | data: { "HNumber": 'SRM_POInStockBillList' }, |
| | | //data: { "Value": Value }, |
| | | success: function (result) { |
| | | if (result.count == 1) { |
| | | var OpenTmp = result.data[0].模板名称 |
| | | window.open("../../views/SRM/HBarPlanPrint.html?linterid=" + data.data.toString() + "&Type=SRM_POInStockBillList" + "&OpenTmp=" + OpenTmp.toString()); |
| | | } else { |
| | | layer.msg(result.Message); |
| | | } |
| | | }, |
| | | error: function (result) { |
| | | console.log(result); |
| | | } |
| | | }); |
| | | } |
| | | else { |
| | | f_alert(data.Message); |
| | | } |
| | | layer.closeAll("loading"); |
| | | }, |
| | | error: function (err) { |
| | | f_alert("错误:" + err); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | form.on('submit(ChooseSource)', function (data) { |
| | | var HOrderType = HSubData[0].HOrderType == undefined ? HSubData[0].订单类型 : HSubData[0].HOrderType |
| | | |
| | | layer.open({ |
| | | type: 2 |
| | | , area: ['95%', '95%'] |
| | |
| | | , shade: 0.6 //遮罩透明度 |
| | | , maxmin: false //允许全屏最小化 |
| | | , anim: 0 //0-6的动画形式,-1不开启 |
| | | , content: ['../../views/SRM/SRM_POOrderBillList.html?Type=AddRow', 'yes'] |
| | | , content: ['../../views/SRM/SRM_POOrderBillList.html?Type=AddRow&HSupName=' + $("#HSupName").val() + '&HOrderType=' + HOrderType, 'yes'] |
| | | , resize: false |
| | | //, cancel: function () { |
| | | // $(".layui-btn").removeClass("layui-btn-disabled"); |
| | | //} |
| | | }) |
| | | }); |
| | | |
| | | form.on('submit(MergeBuildBarcode)', function (data) { |
| | | if (HIsAduit == false) { |
| | | layer.msg("请审核送货单后在生成条码( ´◔︎ ‸◔︎`)", { icon: 5 }); |
| | | return; |
| | | } |
| | | layer.open({ |
| | | type: 2 |
| | | , area: ['95%', '95%'] |
| | | , title: '条码生成' |
| | | , shade: 0.6 //遮罩透明度 |
| | | , maxmin: false //允许全屏最小化 |
| | | , anim: 0 //0-6的动画形式,-1不开启 |
| | | , content: ['../../views/SRM/SRM_BarCodeBill.html?linterid=' + $("#HInterID").val() + '&lentryid=0' + '&type=0' + '&mergeTags=1', 'yes'] |
| | | , resize: false |
| | | //, done: function () { |
| | | // layer.closeAll("loading"); |
| | | //} |
| | | }) |
| | | }); |
| | |
| | | // layer.msg("明细记录第" + (i + 1) + "行,送货单数量不能超过已生成条码数量!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" }); |
| | | // return Result = false; |
| | | //} |
| | | //if (sSubStr[i].HBatchNo == "") { |
| | | // layer.msg("明细记录第" + (i + 1) + "行,批次为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" }); |
| | | // return Result = false; |
| | | //} |
| | | if (sSubStr[i].HBatchNo == "" && sSubStr[i].HBatchManager == "是") { |
| | | layer.msg("明细记录第" + (i + 1) + "行,物料启用批次管理,批次为空,请填写批次信息!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" }); |
| | | return Result = false; |
| | | } |
| | | if (sSubStr[i].HKFDate == "") { |
| | | //凯贝 |
| | | layer.msg("明细记录第" + (i + 1) + "行,生产日期为空!", { icon: 5, btn: ['确认'], time: 2000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" }); |
| | |
| | | return Result = true; |
| | | } |
| | | return Result; |
| | | } |
| | | |
| | | //编辑送货单加载表头表体数据 |
| | | function RoadBillMain_Edit(linterid) { |
| | | $.ajax({ |
| | | url: GetWEBURL() + "/Cg_POInStockBill/cx", |
| | | type: "GET", |
| | | data: { "HInterID": linterid }, |
| | | success: function (data) { |
| | | if (data.code == 1) { |
| | | var data = data.data; |
| | | |
| | | ajaxReturnData = JSON.parse(JSON.stringify(data)); |
| | | HSubData = ajaxReturnData; |
| | | |
| | | //主表 |
| | | form.val("formData", { //formTest 即 class="layui-form" 所在元素属性 lay-filter="" 对应的值 |
| | | "HInterID": data[0].hmainid |
| | | , "HBillNo": data[0].单据号 |
| | | , "HDate": Format(new Date(data[0].单据日期), "yyyy-MM-dd") |
| | | , "HSupName": data[0].供应商名称 |
| | | , "HSupID": data[0].HSupID |
| | | , "HDHDate": Format(new Date(data[0].预计到货日期), "yyyy-MM-dd") |
| | | , "HManagerName": data[0].主管名称 |
| | | , "HManagerID": data[0].HManagerID |
| | | , "HEmpName": data[0].业务员名称 |
| | | , "HEmpID": data[0].HEmpID |
| | | , "HDeptName": data[0].部门名称 |
| | | , "HDeptID": data[0].HDeptID |
| | | , "HPURCHASEORGName": data[0].采购组织名称 |
| | | , "HPURCHASEORGID": data[0].HPURCHASEORGID |
| | | , "HDeliveryNo": data[0].物流单号 |
| | | , "HExpressSupplier": data[0].物流公司 |
| | | , "HInnerBillNo": data[0].送货单号 |
| | | , "HReceiveGoodsMan": data[0].收货人 |
| | | , "HAddress": data[0].收获地址 |
| | | , "HReceiveGoodsLink": data[0].收货人联系方式 |
| | | , "HSendGoodsMan": data[0].送货人 |
| | | , "HSendGoodsAddr": data[0].送货地址 |
| | | , "HSendGoodsLink": data[0].送货人联系方式 |
| | | //其他信息 |
| | | //, "HMaker": data[0].制单人 |
| | | //, "HChecker": data[0]. |
| | | //, "HUpDater": data[0]. |
| | | //, "HMakeDate": data[0]. |
| | | //, "HCheckDate": data[0]. |
| | | //, "HUpDateDate": data[0]. |
| | | }); |
| | | //子表 赋值 |
| | | var rowdata = []; |
| | | for (var i = 0; i < data.length; i++) { |
| | | rowdata.push( |
| | | { |
| | | "sorderid": (i + 1),"HMTONO": data[i].计划跟踪单号, "HMaterID": data[i].HMaterID, "HMaterNumber": data[i].物料代码 |
| | | , "HOldMaterNumber": data[i].物料代码, "HMaterShortNumber": data[i].物料代码, "HMaterName": data[i].物料名称 |
| | | , "HMaterModel": data[i].规格型号, "HUnitName": data[i].计量单位名称, "HUnitNumber": data[i].计量单位代码 |
| | | , "HUnitID": data[i].HUnitID, "FPrintCount": data[i].打印条码数量, "HQty": data[i].送货数量 |
| | | , "HRQty": data[i].剩余可发货数量, "HSQty": data[i].源单数量, "HBatchNo": data[i].批号 |
| | | , "HBatchManager": data[i].启用批次管理, "HOrderType": data[i].订单类型, "HKFDate": Format(new Date(data[i].生产日期), "yyyy-MM-dd") |
| | | , "HKFPeriod": data[i].保质期, "HDate": data[i].子预计到货日期, "HPrice": data[i].单价 |
| | | , "HMoney": data[i].金额, "HRemark": data[i].子备注, "HTAXPRICE_T": data[i].含税重量单价吨 |
| | | , "HPOOrderInterID": data[i].HPOOrderInterID, "HPOOrderEntryID": data[i].HPOOrderEntryID |
| | | , "HPOOrderBillNo": data[i].采购订单号, "HWWOrderInterID": data[i].HWWOrderInterID |
| | | , "HWWOrderEntryID": data[i].HWWOrderEntryID, "HWWOrderBillNo": data[i].委外订单号, "HBillType": data[i].单据类型 |
| | | , "HSourceBillType": data[i].HSourceBillType, "HSourceBillNo": data[i].源单单号, "HSupMaterNumber": data[i].供应商料号 |
| | | , "HSupBatchNo": data[i].供应商批次, "HExpressNumberSub": data[i].子物流单号, "HExpressSupplierSub": data[i].子物流公司 |
| | | , "HPlanArrivalDate": data[i].到货日期, "HBoxNumber": data[i].箱号, "HSourceInterID": data[i].HSourceInterID |
| | | , "HSourceEntryID": data[i].HSourceEntryID, "FSHDD": "", "F_xbkf_Combo": "" |
| | | } |
| | | ) |
| | | } |
| | | //刷新表体数据 |
| | | table.reload('mainTable', { |
| | | data: rowdata |
| | | , height: 'full-10' |
| | | , loading: false |
| | | , done: function (index, res) { |
| | | layer.closeAll("loading"); |
| | | } |
| | | }); |
| | | |
| | | //option.data = rowdata; |
| | | //table.render(option); |
| | | } |
| | | else { |
| | | layer.msg(data.Message, { icon: 2, time: 3000 }); |
| | | } |
| | | |
| | | layer.closeAll("loading"); |
| | | }, |
| | | error: function (result) { |
| | | layer.closeAll("loading"); |
| | | layer.msg(data.Message, { icon: 2, time: 3000 }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | ////隐藏列设置 |
| | |
| | | }); |
| | | |
| | | function GetPoorderValue(obj) { |
| | | var Batchno = Format(new Date(), "yyyy-MM-dd").replaceAll('-', '').substr(2,6);//6位数当前日期 |
| | | |
| | | var Batchno = Format(new Date(), "yyyy-MM-dd").replaceAll('-', '').substr(2, 6);//6位数当前日期 |
| | | |
| | | var HSubLen = HSubData.length + 1; |
| | | var a = []; |
| | | var HOrderType = HSubData[0].订单类型 == undefined ? HSubData[0].HOrderType : HSubData[0].订单类型 |
| | | var HSupNum = HSubData[0].HOrderType |
| | | var HError = ""; |
| | | |
| | | //for (let i = 0; i < HSubData.length; i++) { |
| | | // if (obj[i].hmaterid == HSubData[i].HMaterID) { |
| | | // obj[i].HBatchNo = HSubData[i].HBatchNo |
| | | // Batchno = HSubData[i].HBatchNo |
| | | // break; |
| | | // } |
| | | //} |
| | | |
| | | var HData_Sub = table.cache["mainTable"];//将数据绑定到data上 |
| | | |
| | | for (let i = 0; i < obj.length; i++) { |
| | | for (let j = 0; j < HSubData.length; j++) { |
| | | if (obj[i].hmaterid == HSubData[j].HMaterID) { |
| | | obj[i].HBatchNo = HSubData[j].批号 |
| | | Batchno = HSubData[j].HBatchNo |
| | | } |
| | | } |
| | | } |
| | | |
| | | for (let i = 0; i < obj.length; i++) { |
| | | if (obj[i].订单类型 != HOrderType) { |
| | | HError += obj[i].订单类型; |
| | | } |
| | | var row_options = { |
| | | //"sorderid": HSubLen, "HPOOrderInterID": obj[i].hmainid, "HPOOrderEntryID": obj[i].hentryid, "HPOOrderBillNo": obj[i].单据号, "HWWOrderInterID": 0, |
| | | //"HWWOrderEntryID": 0, "HWWOrderDetaiLID": 0., "HWWOrderBillNo": '', "HBillType": "1102", "HBatchNo": obj[i].HBatchNo, "HMaterID": obj[i].hmaterid, |
| | |
| | | //"HMTONO": obj[i].HBatchNo, "F_xbkf_Combo": '', "FSHDD": '', "FPrintCount": obj[i].打印条码数量, "HPlanArrivalDate": new Date() |
| | | |
| | | "sorderid": HSubLen, "HPOOrderInterID": obj[i].hmainid, "HPOOrderEntryID": obj[i].hsubid, "HPOOrderBillNo": obj[i].订单单号, "HWWOrderInterID": 0, |
| | | "HWWOrderEntryID": 0, "HWWOrderDetaiLID": 0., "HWWOrderBillNo": '', "HBillType": "1102", "HBatchNo": Batchno, "HMaterID": obj[i].hmaterid, |
| | | "HWWOrderEntryID": 0, "HWWOrderDetaiLID": 0., "HWWOrderBillNo": '', "HBillType": "1102", "HBatchNo": obj[i].HBatchNo, "HMaterID": obj[i].hmaterid, |
| | | "HMaterNumber": obj[i].物料代码, "HOldMaterNumber": obj[i].旧物料编码, "HMaterShortNumber": obj[i].物料编码, "HMaterName": obj[i].物料名称, |
| | | "HMaterModel": obj[i].规格型号, "HUnitID": obj[i].hunitid, "HUnitNumber": obj[i].计量单位代码, "HUnitName": obj[i].采购单位, "HQty": obj[i].未关联数量, |
| | | "HRQty": obj[i].未关联数量, "HSQty": obj[i].采购数量, "HPrice": obj[i].单价, "HMoney": obj[i].金额, "HDate": Format(new Date(), "yyyy-MM-dd"), "HKFDate": '', |
| | | "HMaterModel": obj[i].规格型号, "HUnitID": obj[i].hunitid, "HUnitName": obj[i].计量单位, "HUnitNumber": obj[i].计量单位代码, "HUnitName": obj[i].采购单位, "HQty": obj[i].可发货数量, |
| | | "HRQty": obj[i].可发货数量, "HSQty": obj[i].采购数量, "HPrice": obj[i].单价, "HMoney": obj[i].金额, "HDate": Format(new Date(), "yyyy-MM-dd"), "HKFDate": new Date().toISOString().slice(0, 10), |
| | | "HKFPeriod": 0, "HSourceInterID": obj[i].hmainid, "HSourceEntryID": obj[i].hsubid, "HSourceBillType": "1102", "HSourceBillNo": obj[i].订单单号, |
| | | "HMTONO": obj[i].HBatchNo, "F_xbkf_Combo": '', "FSHDD": '', "FPrintCount": obj[i].打印条码数量, "HPlanArrivalDate": new Date(), |
| | | "HTAXPRICE_T": obj[i].含税重量单价吨 |
| | | }; |
| | | HSubData.push(row_options); |
| | | HData_Sub.push(row_options); |
| | | HSubLen++; |
| | | |
| | | //var NewRow = { |
| | |
| | | // "HUnitID": "0", "FPrintCount": "0", "HRQty": "0", "HSQty": "", "HBatchNo": "", "HKFDate": "", "HKFPeriod": "", "HDate": "", "HPrice": "", "HMoney": "", "HRemark": "", "HPOOrderInterID": "", "HPOOrderEntryID": "", "HPOOrderBillNo": "", "HWWOrderInterID": "", "HWWOrderEntryID": "", "HWWOrderBillNo": "", "HBillType": "", "HSourceBillType": "", "HSourceBillNo": "", "HSupMaterNumber": "", "HSupBatchNo": "", "HExpressNumberSub": "", "HExpressSupplierSub": "", "HPlanArrivalDate": "", "HBoxNumber": "", "HSourceInterID": "", "HSourceEntryID": "" |
| | | //}; |
| | | }; |
| | | if (HError != "") { |
| | | return layer.msg('采购订单订单类型不同,不允许合并下推生成送货单!') |
| | | } |
| | | table.reload('mainTable', { |
| | | data: HSubData |
| | | data: HData_Sub |
| | | , height: 'full-10' |
| | | , loading: false |
| | | , done: function (index, res) { |