1
pzy
2024-09-30 c6576d875f3f55813b2812d6dc37d87a045f8a6b
WebSRM/layuiAdmin.std-v1.2.1/src/views/SRM/SRM_BarCodeBill.html
@@ -291,6 +291,7 @@
        var linterid = params[params[0]];
        var lentryid = params[params[1]];
        var type = params[params[2]];
        var mergeTags = params[params[3]];
        //原生成条码方法(送货单默认)
        var mainUrl = "GetHBarCodeShowBillMain"; //表头数据加载ajax
        var subUrl = "GetHBarCodeShowBillSub";//表体数据加载ajax h_v_SRM_POInStockBillSub_ForWeb2
@@ -346,6 +347,68 @@
                , layer = layui.layer
                , laydate = layui.laydate
                , element = layui.element; //Tab的切换功能,切换事件监听等,需要依赖element模块
            var option;
            option = {
                elem: '#mainTable'
                , toolbar: '#toolbarDemo'
                , limit: 500
                , height: 500
                , loading: false
                , cols: [[
                    { 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: 'HMaterShortNumber', 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: 'HBarcodeCount', title: '已生成条码数量', width: 135 }
                    , { field: 'HNotBarcodeCount', title: '可生成条码数量', width: 135 }
                    , { field: 'HQty', title: '本次生成条码数量', width: 135, edit: 'text', event: "inputHQty" }
                    , { field: 'HMinQty', title: '内箱包装数', width: 100, edit: 'text', event: "inputHMinQty" }
                    , { field: 'HBQty', title: '内箱数', width: 100 }
                    , { field: 'HWXQty', title: '外箱包装数', width: 100, edit: 'text', event: "inputHWXQty" }
                    , { field: 'HWBQty', title: '外箱数', width: 100 }
                    , { field: 'HPrice', title: '单价', width: 100, hide: true }
                    , { 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"
                    , { field: 'HKFPeriod', title: '保质期', width: 100 }//
                    , { field: 'HKFDQDate', title: '到期日期', align: 'center', width: 150, data_field: 'HKFDQDate' }//, event: "chooseHKFDQDate"
                    , { field: 'HSupMaterNumber', title: '供应商料号', width: 100, edit: 'text' }
                    , { field: 'HSupBatchNo', title: '供应商批次', width: 100, edit: 'text' }
                    //, { field: 'HBeginDate', title: '生产日期', width: 120, data_field: 'HBeginDate', event: "chooseHBeginDate" }
                    //, { field: 'HEndDate', title: '失效日期', width: 120, data_field: 'HEndDate', event: "chooseHEndDate" }
                    //, { field: 'HDate', title: '要求交货日期', width: 150 }
                    , { field: 'HPOOrderInterID', title: '采购订单主内码', width: 150, hide: true }
                    , { field: 'HPOOrderEntryID', title: '采购订单子内码', width: 150, hide: true }
                    , { field: 'HPOOrderBillNo', title: '采购订单号', width: 200 }
                    , { field: 'HWWOrderInterID', title: '委外订单主内码', width: 150, hide: true }
                    , { field: 'HWWOrderEntryID', title: '委外订单子内码', width: 150, hide: true }
                    , { field: 'HWWOrderDetaiLID   ', title: '委外订单明细内码', width: 150, hide: true }
                    , { field: 'HWWOrderBillNo', title: '委外订单单号', width: 200, hide: true }
                    , { field: 'HSourceBillType', title: '源单类型', width: 100 }
                    , { field: 'HSourceBillNo', title: '源单单号', width: 200 }
                    , { field: 'HSourceEntryID', title: '源单子内码', width: 150, hide: true }
                    , { field: 'HSourceInterID', title: '源单主内码', width: 150, hide: true }
                    , { field: 'HSupID', title: '供应商ID', width: 150, hide: true }
                    , { field: 'HSupName', title: '供应商名称', width: 150, hide: true }
                    , { field: 'HIsSplit', title: '是否拆分', width: 150, hide: true } //0否,1是
                ]]
            }
            //生成品种码
            form.on('submit(HBarcodeSaverPZ)', function (data) {//保存
@@ -938,69 +1001,121 @@
            });
            //进入页面查询表体物料信息
            layer.load(3)
            table.render({
                elem: '#mainTable'
                , url: GetWEBURL() + subUrl
                , toolbar: '#toolbarDemo' //开启头部工具栏,并为其绑定左侧模板
                , defaultToolbar: ['filter', 'exports']
                , where: { sMsg: linterid, sMsg2: lentryid }
                , cols: [[
                    { 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: 'HMaterShortNumber', 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: 'HBarcodeCount', title: '已生成条码数量', width: 135 }
                    , { field: 'HNotBarcodeCount', title: '可生成条码数量', width: 135 }
                    , { field: 'HQty', title: '本次生成条码数量', width: 135, edit: 'text', event: "inputHQty" }
                    , { field: 'HMinQty', title: '内箱装箱数', width: 100, edit: 'text', event: "inputHMinQty" }
                    , { field: 'HBQty', title: '内箱数', width: 100 }
                    , { field: 'HWXQty', title: '外箱装箱数', width: 100, edit: 'text', event: "inputHWXQty" }
                    , { field: 'HWBQty', title: '外箱数', width: 100 }
                    , { field: 'HPrice', title: '单价', width: 100, hide: true }
                    , { 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"
                    , { field: 'HKFPeriod', title: '保质期', width: 100 }//
                    , { field: 'HKFDQDate', title: '到期日期', align: 'center', width: 150, data_field: 'HKFDQDate' }//, event: "chooseHKFDQDate"
                    , { field: 'HSupMaterNumber', title: '供应商料号', width: 100, edit: 'text' }
                    , { field: 'HSupBatchNo', title: '供应商批次', width: 100, edit: 'text' }
                    //, { field: 'HBeginDate', title: '生产日期', width: 120, data_field: 'HBeginDate', event: "chooseHBeginDate" }
                    //, { field: 'HEndDate', title: '失效日期', width: 120, data_field: 'HEndDate', event: "chooseHEndDate" }
                    //, { field: 'HDate', title: '要求交货日期', width: 150 }
                    , { field: 'HPOOrderInterID', title: '采购订单主内码', width: 150, hide: true }
                    , { field: 'HPOOrderEntryID', title: '采购订单子内码', width: 150, hide: true }
                    , { field: 'HPOOrderBillNo', title: '采购订单号', width: 200 }
                    , { field: 'HWWOrderInterID', title: '委外订单主内码', width: 150, hide: true }
                    , { field: 'HWWOrderEntryID', title: '委外订单子内码', width: 150, hide: true }
                    , { field: 'HWWOrderDetaiLID   ', title: '委外订单明细内码', width: 150, hide: true }
                    , { field: 'HWWOrderBillNo', title: '委外订单单号', width: 200, hide: true }
                    , { field: 'HSourceBillType', title: '源单类型', width: 100 }
                    , { field: 'HSourceBillNo', title: '源单单号', width: 200 }
                    , { field: 'HSourceEntryID', title: '源单子内码', width: 150, hide: true }
                    , { field: 'HSourceInterID', title: '源单主内码', width: 150, hide: true }
                    , { field: 'HSupID', title: '供应商ID', width: 150, hide: true }
                    , { field: 'HSupName', title: '供应商名称', width: 150, hide: true }
                    , { field: 'HIsSplit', title: '是否拆分', width: 150, hide: true } //0否,1是
                ]]
                , done: function (res, curr, count) {
                    layer.closeAll("loading");
                },
            });
            if (mergeTags != 1) {
                layer.load(3)
                table.render({
                    elem: '#mainTable'
                    , url: GetWEBURL() + subUrl
                    , toolbar: '#toolbarDemo' //开启头部工具栏,并为其绑定左侧模板
                    , defaultToolbar: ['filter', 'exports']
                    , where: { sMsg: linterid, sMsg2: lentryid }
                    , cols: [[
                        { 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: 'HMaterShortNumber', 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: 'HBarcodeCount', title: '已生成条码数量', width: 135 }
                        , { field: 'HNotBarcodeCount', title: '可生成条码数量', width: 135 }
                        , { field: 'HQty', title: '本次生成条码数量', width: 135, edit: 'text', event: "inputHQty" }
                        , { field: 'HMinQty', title: '内箱包装数', width: 100, edit: 'text', event: "inputHMinQty" }
                        , { field: 'HBQty', title: '内箱数', width: 100 }
                        , { field: 'HWXQty', title: '外箱包装数', width: 100, edit: 'text', event: "inputHWXQty" }
                        , { field: 'HWBQty', title: '外箱数', width: 100 }
                        , { field: 'HPrice', title: '单价', width: 100, hide: true }
                        , { 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"
                        , { field: 'HKFPeriod', title: '保质期', width: 100 }//
                        , { field: 'HKFDQDate', title: '到期日期', align: 'center', width: 150, data_field: 'HKFDQDate' }//, event: "chooseHKFDQDate"
                        , { field: 'HSupMaterNumber', title: '供应商料号', width: 100, edit: 'text' }
                        , { field: 'HSupBatchNo', title: '供应商批次', width: 100, edit: 'text' }
                        //, { field: 'HBeginDate', title: '生产日期', width: 120, data_field: 'HBeginDate', event: "chooseHBeginDate" }
                        //, { field: 'HEndDate', title: '失效日期', width: 120, data_field: 'HEndDate', event: "chooseHEndDate" }
                        //, { field: 'HDate', title: '要求交货日期', width: 150 }
                        , { field: 'HPOOrderInterID', title: '采购订单主内码', width: 150, hide: true }
                        , { field: 'HPOOrderEntryID', title: '采购订单子内码', width: 150, hide: true }
                        , { field: 'HPOOrderBillNo', title: '采购订单号', width: 200 }
                        , { field: 'HWWOrderInterID', title: '委外订单主内码', width: 150, hide: true }
                        , { field: 'HWWOrderEntryID', title: '委外订单子内码', width: 150, hide: true }
                        , { field: 'HWWOrderDetaiLID   ', title: '委外订单明细内码', width: 150, hide: true }
                        , { field: 'HWWOrderBillNo', title: '委外订单单号', width: 200, hide: true }
                        , { field: 'HSourceBillType', title: '源单类型', width: 100 }
                        , { field: 'HSourceBillNo', title: '源单单号', width: 200 }
                        , { field: 'HSourceEntryID', title: '源单子内码', width: 150, hide: true }
                        , { field: 'HSourceInterID', title: '源单主内码', width: 150, hide: true }
                        , { field: 'HSupID', title: '供应商ID', width: 150, hide: true }
                        , { field: 'HSupName', title: '供应商名称', width: 150, hide: true }
                        , { field: 'HIsSplit', title: '是否拆分', width: 150, hide: true } //0否,1是
                    ]]
                    , done: function (res, curr, count) {
                        layer.closeAll("loading");
                    }
                });
            }
            else
            {
                layer.load(3)
                $.ajax({
                    type: "GET",
                    url: GetWEBURL() + "/GetHBarCodeShowBillSub_Merge",
                    async: true,
                    data: { HInterID: linterid },
                    dataType: "json",
                    success: function (data) {
                        if (data.count == 10000) {
                            var data = data.data;
                            var rowdata = [];
                            for (var i = 0; i < data.length; i++) {
                                rowdata.push({
                                    "HMaterID": data[i].HMaterID, "HMaterNumber": data[i].HMaterNumber, "HOldMaterNumber": ""
                                    , "HMaterShortNumber": "", "HSubjoin": "", "HMaterName": data[i].HMaterName
                                    , "HMaterModel": data[i].HMaterModel, "HUnitName": data[i].HUnitName, "HUnitNumber": data[i].HUnitNumber
                                    , "HUnitID": data[i].HUnitID, "HDDQty": data[i].HDDQty, "HMrbQty": 0, "HBarcodeCount": data[i].HBarcodeCount
                                    , "HNotBarcodeCount": data[i].HNotBarcodeCount, "HQty": data[i].HQty, "HMinQty": data[i].HMinQty, "HBQty": data[i].HBQty
                                    , "HWXQty": data[i].HWXQty, "HWBQty": data[i].HWBQty, "HPrice": data[i].HPrice, "HMoney": data[i].HMoney, "HMTONO": ""
                                    , "HBatchNo": data[i].HBatchNo, "HBatchManager": data[i].HBatchManager, "HISKFPERIOD": data[i].HISKFPERIOD
                                    , "HEXPUNIT": data[i].HEXPUNIT, "HKFDate": data[i].HKFDate, "HKFPeriod": data[i].HKFPeriod, "HKFDQDate": data[i].HKFDQDate
                                    , "HSupMaterNumber": data[i].HSupMaterNumber, "HSupBatchNo": data[i].HSupBatchNo, "HPOOrderInterID": data[i].HPOOrderInterID
                                    , "HPOOrderEntryID": data[i].HPOOrderEntryID, "HPOOrderBillNo": data[i].HPOOrderBillNo, "HWWOrderInterID": data[i].HWWOrderInterID
                                    , "HWWOrderEntryID": data[i].HWWOrderEntryID, "HWWOrderDetaiLID": data[i].HWWOrderDetaiLID, "HWWOrderBillNo": data[i].HWWOrderBillNo
                                    , "HSourceBillType": data[i].HSourceBillType, "HSourceBillNo": data[i].HSourceBillNo, "HSourceEntryID": data[i].HSourceEntryID
                                    , "HSourceInterID": data[i].HSourceInterID, "HSupID": data[i].HSupID, "HSupName": "", "HIsSplit": data[i].HIsSplit
                                });
                            }
                            option.data = rowdata;
                            table.render(option);
                        }
                        else {
                            // $("#verifycode").click();
                            f_alert(data.Message);
                        }
                        layer.closeAll("loading");
                    },
                    error: function (err) {
                        f_alert("错误:" + err);
                        layer.closeAll("loading");
                    }
                });
            }
            //头工具栏事件
            table.on('toolbar(mainTable)', function (obj) {
                var checkStatus = table.checkStatus(obj.config.id);