智云SRM-LAYUI(夏宝服务器版本)
YL
2021-12-17 928efc9371c839b16d6de724eeb21dd29e4077e6
WebSRM/layuiAdmin.std-v1.2.1/src/views/SRM/SRM_BarCodeBill.html
@@ -106,7 +106,7 @@
                                    <script type="text/html" id="toolbarDemo">
                                        <div class="layui-btn-container">
                                            <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-normal">普通条码</button>-->
                                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-box">内外箱条码</button>
                                            <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-box">内外箱条码</button>-->
                                        </div>
                                    </script>
@@ -195,15 +195,25 @@
        var linterid = params[params[0]];
        var lentryid = params[params[1]];
        var type = params[params[2]];
        //原生成条码方法
        //原生成条码方法(送货单默认)
        var mainUrl = "GetHBarCodeShowBillMain"; //表头数据加载ajax
        var subUrl = "GetHBarCodeShowBillSub";//表体数据加载ajax
        var saveBarCode = "GetBarcodeSaveBillBox";//条码生成保存方法ajax
        var openTmpListType = "SRM_POInStockBillList"; //条码打印按钮 弹出界面
        //采购订单条码生成规则
        if (type == 'SRM_POOrderBillList') {
            mainUrl = 'GetHBarCodeShowBillMainBycg';
            subUrl = "GetHBarCodeShowBillSubBycg";
            saveBarCode = "GetBarcodeSaveBillBoxBycg";
            openTmpListType = 'SRM_POOrderBillList';
        }
        //委外订单
        else if (type == 'SRM_EntrustOrderBill') {
            mainUrl = 'GetHBarCodeShowBillMainBywy';
            subUrl = "GetHBarCodeShowBillSubBywy";
            saveBarCode = "GetBarcodeSaveBillBoxBycg";//调用采购数据
            openTmpListType = 'SRM_POOrderBillList';
        }
        // debugger;
        $.ajax({
@@ -517,7 +527,7 @@
                        , shade: 0.6 //遮罩透明度
                        , maxmin: false //允许全屏最小化
                        , anim: 0 //0-6的动画形式,-1不开启
                        , content: ['../../views/BaseSet/SRM_OpenTmpList.html?linterid=' + rows.toString() + '&HBarcode=' + rows2.toString() + '&Type=HBarCodePrint', 'yes']
                        , content: ['../../views/BaseSet/SRM_OpenTmpList.html?linterid=' + rows.toString() + '&HBarcode=&Type=' + openTmpListType, 'yes']
                        , resize: false
                        //, cancel: function () {
                        //    $(".layui-btn").removeClass("layui-btn-disabled");
@@ -559,17 +569,17 @@
                    , { field: 'HQty', title: '数量', width: 100 }
                    , { field: 'HMinQty', title: '内箱包装数', width: 100, edit: 'text' }
                    , { field: 'HBQty', title: '内箱数', width: 100 }
                    , { field: 'HWXQty', title: '外箱包装数', width: 100, edit: 'text' }
                    , { field: 'HWBQty', title: '外箱数', width: 100 }
                    , { field: 'HWXQty', title: '外箱包装数', width: 100 }
                    , { field: 'HWBQty', title: '外箱数', width: 100, edit: 'text' }
                    , { field: 'HPrice', title: '单价', width: 100, hide: true }
                    , { field: 'HMoney', title: '金额', width: 100, hide: true }
                    , { field: 'HMTONO', title: '计划跟踪单号', width: 100 }
                    , { field: 'HBatchNo', 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: 'HKFDate', title: '生产日期', align: 'center', width: 150, data_field: 'HKFDate', event: "chooseHKFDate"}//
                    , { field: 'HKFPeriod', title: '保质期', width: 100,  edit: 'text', event: "inputHKFPeriod"}//
                    , { field: 'HKFDQDate', title: '到期日期', align: 'center', width: 150, data_field: 'HKFDQDate', event: "chooseHKFDQDate"}//
                    , { field: 'HKFDate', title: '生产日期', align: 'center', width: 150, data_field: 'HKFDate', event: "chooseHKFDate" }//
                    , { field: 'HKFPeriod', title: '保质期', width: 100, edit: 'text', event: "inputHKFPeriod" }//
                    , { field: 'HKFDQDate', title: '到期日期', align: 'center', width: 150, data_field: 'HKFDQDate', event: "chooseHKFDQDate" }//
                    //, { field: 'HDate', title: '要求交货日期', width: 150 }
                    , { field: 'HPOOrderInterID', title: '采购订单主内码', width: 150, hide: true }
                    , { field: 'HPOOrderEntryID', title: '采购订单子内码', width: 150, hide: true }
@@ -583,6 +593,7 @@
                    , { 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 }
                ]]
                , done: function (res, curr, count) {
@@ -621,8 +632,8 @@
                                //, { field: 'HBeginDate', title: '生产日期', width: 120, data_field: 'HBeginDate', event: "chooseHBeginDate" }
                                //, { field: 'HEndDate', title: '失效日期', width: 120, data_field: 'HEndDate', event: "chooseHEndDate" }
                                , { field: 'HKFDate', title: '生产日期', align: 'center', width: 150, data_field: 'HKFDate', event: "chooseHKFDate" }
                                , { field: 'HKFPeriod', title: '保质期', width: 100, edit: 'text', event: "inputHKFPeriod"}
                                , { field: 'HKFDQDate', title: '到期日期', align: 'center', width: 150, data_field: 'HKFDQDate', event: "chooseHKFDQDate"}
                                , { field: 'HKFPeriod', title: '保质期', width: 100, edit: 'text', event: "inputHKFPeriod" }
                                , { field: 'HKFDQDate', title: '到期日期', align: 'center', width: 150, data_field: 'HKFDQDate', event: "chooseHKFDQDate" }
                                //, { field: 'HDate', title: '要求交货日期', width: 150 }
                                , { field: 'HPOOrderInterID', title: '采购订单主内码', width: 150, hide: true }
                                , { field: 'HPOOrderEntryID', title: '采购订单子内码', width: 150, hide: true }
@@ -778,6 +789,8 @@
                var HMinQty = 0;
                var HWXQty = 0;
                var HKFPeriod = 0;
                var HWBQty = 0;
                var HBQty = 0;
                if (obj.data.HMinQty != undefined) {
                    HMinQty = parseFloat(obj.data.HMinQty);
                }
@@ -787,56 +800,71 @@
                if (obj.data.HKFPeriod != undefined) {
                    HKFPeriod = parseFloat(obj.data.HKFPeriod);
                }
                HKFPeriod
                if (obj.data.HWBQty != undefined) {
                    HWBQty = parseFloat(obj.data.HWBQty);
                }
                if (obj.data.HBQty != undefined) {
                    HBQty = parseFloat(obj.data.HBQty);
                }
                switch (field) {
                    case "HMinQty":
                        if (HMinQty > 0) {
                            if (HWXQty >= 0) {
                                if (isPositiveIntegerTimes(parseFloat(obj.value), HWXQty)) //外箱包装数能被内箱包装数整除
                                {
                                    obj.update({
                                        HBQty: Math.ceil(parseFloat(obj.data.HQty) / parseFloat(obj.value)),
                                    });
                                }
                                else {
                                    //obj.update({
                                    //    HMinQty: 0,
                                    //});
                                    f_alert("外箱包装数必须是内箱包装数的整数倍!");
                                }
                            }
                        }
                        else {
                            //obj.update({
                            //    HMinQty: 0,
                            //});
                        if (HMinQty < 0) {
                            f_alert("内箱包装数不能为负数!");
                        }
                        else if (HWBQty > HBQty) {
                            f_alert("外箱数量不能超出内箱数量")
                            return;
                        }
                        else (HWXQty >= 0)
                        {
                            obj.update({
                                //外箱包装总数 =  内箱数量/外箱数量 * 内箱包装数量
                                HBQty: Math.ceil(parseFloat(obj.data.HQty) / parseFloat(obj.value)),
                                HWXQty: Math.ceil(parseFloat(obj.data.HBQty) / parseFloat(obj.data.HWBQty)) * parseFloat(obj.data.HMinQty),
                            });
                        }
                        break;
                    case "HWXQty":
                        if (HWXQty > 0) {
                            if (HMinQty >= 0) {
                                if (isPositiveIntegerTimes(HMinQty, parseFloat(obj.value))) //外箱包装数能被内箱包装数整除
                                {
                                    obj.update({
                                        HWBQty: Math.ceil(parseFloat(obj.data.HQty) / parseFloat(obj.value)),
                                    });
                                }
                                else {
                                    //obj.update({
                                    //    HWXQty: 0,
                                    //});
                                    f_alert("外箱包装数必须是内箱包装数的整数倍!");
                                }
                            }
                    case "HWBQty": //外箱个数发生变化
                        if (HWBQty < 0) {
                            f_alert("外箱数量不能为负数")
                            return;
                        }
                        else if (HWBQty > HBQty) {
                            f_alert("外箱数量不能超出内箱数量")
                            return;
                        }
                        else {
                            //obj.update({
                            //    HWXQty: 0,
                            //});
                            f_alert("外箱包装数不能为负数!");
                            obj.update({
                                //外箱包装总数 =  内箱数量/外箱数量 * 内箱包装数量
                                HWXQty: Math.ceil(parseFloat(obj.data.HBQty) / parseFloat(obj.data.HWBQty)) * parseFloat(obj.data.HMinQty),
                                //HWXQty: 12
                            });
                        }
                        break;
                    //case "HWXQty":
                    //    if (HWXQty > 0) {
                    //        if (HMinQty >= 0) {
                    //            if (isPositiveIntegerTimes(HMinQty, parseFloat(obj.value))) //外箱包装数能被内箱包装数整除
                    //            {
                    //                obj.update({
                    //                    HWBQty: Math.ceil(parseFloat(obj.data.HQty) / parseFloat(obj.value)),
                    //                });
                    //            }
                    //            else {
                    //                //obj.update({
                    //                //    HWXQty: 0,
                    //                //});
                    //                f_alert("外箱包装数必须是内箱包装数的整数倍!");
                    //            }
                    //        }
                    //    }
                    //    else {
                    //        //obj.update({
                    //        //    HWXQty: 0,
                    //        //});
                    //        f_alert("外箱包装数不能为负数!");
                    //    }
                    //    break;
                    case "HKFPeriod":
                        if (HKFPeriod >= 0) {
                            var sKFDQDate = addDate(obj.data.HKFDate, HKFPeriod);