zrg
2024-08-13 ba1fb184917b1651221a6decf1144911ff489f86
WebTM/views/ÏúÊÛ¹ÜÀí/ÏúÊÛºÏͬ/Add_Edit_Xs_ContractBillList.html
@@ -578,7 +578,10 @@
                //数值格式校验工具
                var ref = /^\d+(\.\d+)?$/;          //非负数正则表达式
                var 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 oldText = $(this).prev().text();
                var value = obj.value //得到修改后的值
@@ -606,7 +609,11 @@
                        var HTaxMoney = Number((HMoney * HTaxRate).toFixed(4));         //税额=金额*税率
                        var HlineTotal = HMoney + HTaxMoney;            //价税合计=金额+税额
                        var HExRate = $("#HExRate").val();                      //汇率
                        //数字精度
                        HQty = Number(HQty.toFixed(HQtyDec));
                        HPrice = Number(HPrice.toFixed(HPriceDec));
                        HMoney = Number(HMoney.toFixed(HMoneyDec));
                        HlineTotal = Number(HlineTotal.toFixed(HMoneyDec));
                        //同步更新表格和缓存对应的值
                        obj.update({
                            HQty: HQty
@@ -615,6 +622,7 @@
                            , HTaxMoney: HTaxMoney
                            , HlineTotal: HlineTotal
                        });
                        table.render(option)
                        break;
                    case "HPrice":                                         //单价
                        //数据格式校验
@@ -637,7 +645,11 @@
                        var HTaxMoney = Number((HMoney * HTaxRate).toFixed(4));         //税额=金额*税率
                        var HlineTotal = HMoney + HTaxMoney;            //价税合计=金额+税额
                        var HExRate = $("#HExRate").val();                      //汇率
                        //数字精度
                        HQty = Number(HQty.toFixed(HQtyDec));
                        HPrice = Number(HPrice.toFixed(HPriceDec));
                        HMoney = Number(HMoney.toFixed(HMoneyDec));
                        HlineTotal = Number(HlineTotal.toFixed(HMoneyDec));
                        //同步更新表格和缓存对应的值
                        obj.update({
                            HQty: HQty
@@ -646,6 +658,7 @@
                            , HTaxMoney: HTaxMoney
                            , HlineTotal: HlineTotal
                        });
                        table.render(option)
                        break;
                    case "HTaxRate":                                                       //数量
                        //数据格式校验
@@ -669,7 +682,11 @@
                        var HTaxMoney = Number((HMoney * HTaxRate).toFixed(4));         //税额=金额*税率
                        var HlineTotal = HMoney + HTaxMoney;            //价税合计=金额+税额
                        var HExRate = $("#HExRate").val();                       //汇率
                        //数字精度
                        HQty = Number(HQty.toFixed(HQtyDec));
                        HPrice = Number(HPrice.toFixed(HPriceDec));
                        HMoney = Number(HMoney.toFixed(HMoneyDec));
                        HlineTotal = Number(HlineTotal.toFixed(HMoneyDec));
                        //同步更新表格和缓存对应的值
                        obj.update({
                            HTaxRate: HTaxRate * 100
@@ -1496,6 +1513,31 @@
            }
            //#endregion
            //#region æ ¹æ®ç‰©æ–™ID获取精度
            function getDecByMaterID(HMaterID) {
                var resultData = {};
                $.ajax({  // å¼‚步请求
                    url: GetWEBURL() + "Gy_Material/getDecByID",  //请求地址
                    async: false,   //是否开启异步
                    type: "GET",   //请求类型
                    data: {   //定义发送到服务器的数据
                        "HMaterID": HMaterID     //  å°†hmaterid作为请求参数发送
                    },
                    success: function (result) {   // å½“请求成功时,执行这个函数
                        if (result.code == 1) { // å¦‚果服务器返回的数据中的`code字段等于1,这可能表示审核操作成功执行
                            var data = result.data; //声明data变量,并将其赋值为result对象中的data属性
                            resultData = data[0];   //将data数组(或类数组对象)的第一个元素赋值给变量resultData
                        }
                        //else {
                        //    layer.alert(result.Message, { icon: 5, btn: ['退出'], time: 100000, offset: 't' }); //result.msg对象,提示弹窗 ç±»åž‹ä¸º5, æŒ‰é’®ï¼Œå’ŒæŒ‰é’®çš„名称为退出  æ—¶é—´ ä¸º100秒,以及偏移量(`offset: 't'
                        //}
                    }, error: function () {
                        layer.alert("发生错误!", { icon: 5 });  //提示弹窗 å‘生错误 ï¼Œè­¦ç¤ºæ ‡å¿—为5的
                    }
                });
                return resultData;
            }
            //#endregion
            //#region ä¿å­˜åŽæµè§ˆæ–¹æ³•
            function ReRoadBillMain() {