1
pzy
2024-08-13 4f4a5a073bed3688ddead42557829fc8610db86b
WebTM/views/ÏúÊÛ¹ÜÀí/ÏúÊÛ¶©µ¥/Add_Edit_Xs_SeOrderBillList.html
@@ -2574,13 +2574,17 @@
                                    var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//获取选中的数据
                                    var rowIndex = $(obj.tr).attr("data-index") * 1;
                                    var Dec = getDecByMaterID(obj.data.HMaterID) //获取精度
                                    var HQtyDec = (Dec["HQtyDec"] == null || Dec["HQtyDec"] == 0) ? 4 : Dec["HQtyDec"];  //数量精度
                                    var HPriceDec = (Dec["HPriceDec"] == null || Dec["HPriceDec"] == 0) ? 4 : Dec["HPriceDec"];  //单价精度
                                    var HMoneyDec = (Dec["HMoneyDec"] == null || Dec["HMoneyDec"] == 0) ? 2 : Dec["HMoneyDec"];  //金额精度
                                    for (var i = 0; i < checkStatus.data.length; i++) {
                                        if (rowIndex + i >= option.data.length) {
                                            var NewRow = {
                                                "HMaterID": "0", "物料代码": "", "物料名称": "", "规格型号": "", "HUnitID": "0", "计量单位": "", "HQty": "0", "HPrice": "0", "HTaxPrice": "0"
                                                , "HMoney": "0", "HDiscountRate": "0", "HRelTaxPrice": "0", "HTaxRate": "0", "HTaxMoney": "0", "HlineTotal": "0", "HlineTotalBB": "0"
                                                , "HDate": Format(new Date(), 'yyyy-MM-dd'), "HOutStockQty": "0", "HInvoiceQty": "0", "HRemark": "", "HCusMaterNumber": "",
                                                "HCusModel": "","HCusMaterName": ""
                                                "HCusModel": "", "HCusMaterName": ""
                                            }
                                            btnAddLine(NewRow);
                                        }
@@ -2603,8 +2607,8 @@
                                        }
                                        //数据校验合格,重算记录
                                        var HQty = option.data[rowIndex + i].HQty;                  //数量
                                        var HPrice = option.data[rowIndex + i].HPrice;              //单价
                                        var HQty = option.data[rowIndex + i].HQty * 1;                  //数量
                                        var HPrice = option.data[rowIndex + i].HPrice * 1;              //单价
                                        var HTaxRate = value * 0.01;                                //税率
                                        /*var HDiscountRate = obj.data.HDiscountRate * 1;           //折扣率*/
                                        var HTaxPrice = HPrice * (1 + HTaxRate);                    //含税单价=单价*(1+税率)
@@ -2613,7 +2617,13 @@
                                        var HMoney = HQty * HPrice;                                 //金额=数量*单价
                                        var HTaxMoney = HMoney * HTaxRate;                          //税额=金额*税率
                                        var HlineTotal = HMoney + HTaxMoney;                        //价税合计=金额+税额
                                        //数字精度
                                        HQty = Number(HQty.toFixed(HQtyDec));
                                        HPrice = Number(HPrice.toFixed(HPriceDec));
                                        HMoney = Number(HMoney.toFixed(HMoneyDec));
                                        HTaxMoney = Number(HTaxMoney.toFixed(HMoneyDec));
                                        HlineTotal = Number(HlineTotal.toFixed(HMoneyDec));
                                        HTaxPrice = Number(HTaxPrice.toFixed(HPriceDec));
                                        option.data[rowIndex + i].HMaterID = resultData.HItemID;
                                        option.data[rowIndex + i].物料代码 = resultData.物料代码;
@@ -2643,6 +2653,42 @@
                                }
                                , end: function () {
                                    if (typeof (HDataEmp.HItemID) != "undefined") {
                                        var value = subHTaxRate;
                                        //数值格式校验工具
                                        var ref = /^\d+(\.\d+)?$/;
                                        //税率数据格式校验,若根据客户获取的税率不合法,则使用记录中原有的税率,并提示
                                        temp = value + "";
                                        if (ref.test(temp)) {
                                            var Dec = getDecByMaterID(obj.data.HMaterID) //获取精度
                                            var HQtyDec = (Dec["HQtyDec"] == null || Dec["HQtyDec"] == 0) ? 4 : Dec["HQtyDec"];  //数量精度
                                            var HPriceDec = (Dec["HPriceDec"] == null || Dec["HPriceDec"] == 0) ? 4 : Dec["HPriceDec"];  //单价精度
                                            var HMoneyDec = (Dec["HMoneyDec"] == null || Dec["HMoneyDec"] == 0) ? 2 : Dec["HMoneyDec"];  //金额精度
                                            //数据校验合格,重算记录
                                            var HQty = obj.data.HQty * 1;                           //数量
                                            var HPrice = obj.data.HPrice * 1;               //单价
                                            var HTaxRate = value * 0.01;           //税率
                                            var HTaxPrice = HPrice * (1 + HTaxRate);        //含税单价=单价*(1+税率)
                                            var HMoney = HQty * HPrice;                     //金额=数量*单价
                                            var HTaxMoney = HMoney * HTaxRate;              //税额=金额*税率
                                            var HlineTotal = HMoney + HTaxMoney;            //价税合计=金额+税额
                                            //数字精度
                                            HQty = Number(HQty.toFixed(HQtyDec));
                                            HPrice = Number(HPrice.toFixed(HPriceDec));
                                            HMoney = Number(HMoney.toFixed(HMoneyDec));
                                            HlineTotal = Number(HlineTotal.toFixed(HMoneyDec));
                                            HTaxPrice = Number(HPrice.toFixed(HPriceDec));
                                            //同步更新表格和缓存对应的值
                                            obj.update({
                                                HQty: HQty
                                                , HPrice: HPrice
                                                , HTaxRate: HTaxRate * 100
                                                , HTaxPrice: HTaxPrice
                                                , HMoney: HMoney
                                                , HlineTotal: HlineTotal
                                            });
                                        }
                                        //更新表格缓存的数据
                                        obj.update({
                                            "HMaterID": HDataEmp.HItemID
@@ -3165,6 +3211,10 @@
                            var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//获取选中的数据
                            var rowIndex = $(obj.tr).attr("data-index") * 1;
                            var Dec = getDecByMaterID(obj.data.HMaterID) //获取精度
                            var HQtyDec = (Dec["HQtyDec"] == null || Dec["HQtyDec"] == 0) ? 4 : Dec["HQtyDec"];  //数量精度
                            var HPriceDec = (Dec["HPriceDec"] == null || Dec["HPriceDec"] == 0) ? 4 : Dec["HPriceDec"];  //单价精度
                            var HMoneyDec = (Dec["HMoneyDec"] == null || Dec["HMoneyDec"] == 0) ? 2 : Dec["HMoneyDec"];  //金额精度
                            for (var i = 0; i < checkStatus.data.length; i++) {
                                if (rowIndex + i >= option.data.length) {
                                    var NewRow = {
@@ -3194,8 +3244,8 @@
                                }
                                //数据校验合格,重算记录
                                var HQty = option.data[rowIndex + i].HQty;                  //数量
                                var HPrice = option.data[rowIndex + i].HPrice;              //单价
                                var HQty = option.data[rowIndex + i].HQty * 1;                  //数量
                                var HPrice = option.data[rowIndex + i].HPrice * 1;              //单价
                                var HTaxRate = value * 0.01;                                //税率
                                /*var HDiscountRate = obj.data.HDiscountRate * 1;           //折扣率*/
                                var HTaxPrice = HPrice * (1 + HTaxRate);                    //含税单价=单价*(1+税率)
@@ -3204,7 +3254,13 @@
                                var HMoney = HQty * HPrice;                                 //金额=数量*单价
                                var HTaxMoney = HMoney * HTaxRate;                          //税额=金额*税率
                                var HlineTotal = HMoney + HTaxMoney;                        //价税合计=金额+税额
                                //数字精度
                                HQty = Number(HQty.toFixed(HQtyDec));
                                HPrice = Number(HPrice.toFixed(HPriceDec));
                                HMoney = Number(HMoney.toFixed(HMoneyDec));
                                HTaxMoney = Number(HTaxMoney.toFixed(HMoneyDec));
                                HlineTotal = Number(HlineTotal.toFixed(HMoneyDec));
                                HTaxPrice = Number(HTaxPrice.toFixed(HPriceDec));
                                option.data[rowIndex + i].HMaterID = resultData.HItemID;
                                option.data[rowIndex + i].物料代码 = resultData.物料代码;
@@ -3234,6 +3290,42 @@
                        }
                        , end: function () {
                            if (typeof (HDataEmp.HItemID) != "undefined") {
                                var value = subHTaxRate;
                                //数值格式校验工具
                                var ref = /^\d+(\.\d+)?$/;
                                //税率数据格式校验,若根据客户获取的税率不合法,则使用记录中原有的税率,并提示
                                temp = value + "";
                                if (ref.test(temp)) {
                                    var Dec = getDecByMaterID(obj.data.HMaterID) //获取精度
                                    var HQtyDec = (Dec["HQtyDec"] == null || Dec["HQtyDec"] == 0) ? 4 : Dec["HQtyDec"];  //数量精度
                                    var HPriceDec = (Dec["HPriceDec"] == null || Dec["HPriceDec"] == 0) ? 4 : Dec["HPriceDec"];  //单价精度
                                    var HMoneyDec = (Dec["HMoneyDec"] == null || Dec["HMoneyDec"] == 0) ? 2 : Dec["HMoneyDec"];  //金额精度
                                    //数据校验合格,重算记录
                                    var HQty = obj.data.HQty * 1;                           //数量
                                    var HPrice = obj.data.HPrice * 1;               //单价
                                    var HTaxRate = value * 0.01;           //税率
                                    var HTaxPrice = HPrice * (1 + HTaxRate);        //含税单价=单价*(1+税率)
                                    var HMoney = HQty * HPrice;                     //金额=数量*单价
                                    var HTaxMoney = HMoney * HTaxRate;              //税额=金额*税率
                                    var HlineTotal = HMoney + HTaxMoney;            //价税合计=金额+税额
                                    //数字精度
                                    HQty = Number(HQty.toFixed(HQtyDec));
                                    HPrice = Number(HPrice.toFixed(HPriceDec));
                                    HMoney = Number(HMoney.toFixed(HMoneyDec));
                                    HlineTotal = Number(HlineTotal.toFixed(HMoneyDec));
                                    HTaxPrice = Number(HPrice.toFixed(HPriceDec));
                                    //同步更新表格和缓存对应的值
                                    obj.update({
                                        HQty: HQty
                                        , HPrice: HPrice
                                        , HTaxRate: HTaxRate * 100
                                        , HTaxPrice: HTaxPrice
                                        , HMoney: HMoney
                                        , HlineTotal: HlineTotal
                                    });
                                }
                                //更新表格缓存的数据
                                obj.update({
                                    "HMaterID": HDataEmp.HItemID