zrg
2024-03-12 fee5a335de05c5162ef754bfe80b6de39f4e8b69
其他应收单增加 数量和单价
2个文件已修改
211 ■■■■ 已修改文件
WebTM/WebTM.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/销售管理/其他应收单/YS_ReceiveOtherBillMain.html 210 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/WebTM.csproj
@@ -267,6 +267,7 @@
    <Content Include="views\WMS扫码模块\销售出库\Kf_SellOutBill_QiaoYi_PDA.html" />
    <Content Include="views\人事管理\异常反馈单\OA_ErrMsgBackBillList_PDA.html" />
    <Content Include="views\人事管理\异常反馈单\OA_ErrMsgBackBill_PDA.html" />
    <Content Include="views\仓存管理\分步式调入单\Fb_StepFoldinBillEdit.html" />
    <Content Include="views\仓存管理\条码库存\KF_PonderationBillMain_Temp.html" />
    <Content Include="views\仓存管理\条码报表\Kf_MaterOutInReport.html" />
    <Content Include="views\仓存管理\条码报表\Kf_ICInventory_Mater.html" />
WebTM/views/ÏúÊÛ¹ÜÀí/ÆäËûÓ¦ÊÕµ¥/YS_ReceiveOtherBillMain.html
@@ -454,6 +454,8 @@
                    , "HTypeSub": ""
                    , "HMoney": "0"
                    , "HTaxRate": "0"
                    , "HQty": "0"
                    , "HPrice": "0"
                    , "HSumMoney": "0"
                };
                switch (obj.event) {
@@ -517,116 +519,94 @@
                switch (field) {
                    case "HMoney":                   //不含税金额
                    case "HQty":                   //数量
                        //数据格式校验
                        temp = value + "";
                        if (!ref.test(temp) || temp == 0) {
                            //恢复数据到编辑前
                            obj.update({
                                HMoney: oldText
                                HQty: oldText
                            });
                            table.render(option);
                         
                            layer.msg("不含税金额请输入大于0的数字!");
                            layer.msg("数量请输入大于0的数字!");
                            return;
                        }
                        //数据校验合格,重算记录
                        var HMoney = value * 1;                           //不含税金额
                        var HQty = value * 1;                           //数量
                        var HPrice = obj.data.HPrice * 1;           //单价
                        var HTaxRate = obj.data.HTaxRate * 1;           //税率
                        var HSumMoney = HMoney * (1 + (HTaxRate * 0.01));    //总金额=不含税金额*(1+(税率*0.01))
                        var HSumMoney = HQty * HPrice * (1 + (HTaxRate * 0.01));    //总金额=数量*单价*(1+(税率*0.01))
                        var HMoney = HQty * HPrice; //不含税金额=数量*单据
                        //设置数据小数位数
                        HMoney = dealDoubleToFixed(HMoney, 2);
                        HQty = dealDoubleToFixed(HQty, 2);;
                        HTaxRate = HTaxRate;
                        HPrice = dealDoubleToFixed(HPrice, 2);;
                        HSumMoney = dealDoubleToFixed(HSumMoney, 2);
                        //同步更新表格和缓存对应的值
                        obj.update({
                            HMoney: HMoney
                            HQty: HQty
                            , HPrice: HPrice
                            ,HMoney: HMoney
                            , HTaxRate: HTaxRate
                            , HSumMoney: HSumMoney
                        });
                        break;
                    case "HTaxRate":                                                       //单价
                    case "HPrice":                                                       //单价
                        //数据格式校验
                        temp = value + "";
                        if (!ref.test(temp) || temp == 0) {
                            //恢复数据到编辑前
                            obj.update({
                                HTaxRate: oldText
                                HPrice: oldText
                            });
                            table.render(option);
                            
                            layer.msg("税率请输入大于0的数字!");
                            layer.msg("单价请输入大于0的数字!");
                            return;
                        }
                        //数据校验合格,重算记录
                        var HTaxRate = value * 1;                           //税率
                        var HMoney = obj.data.HMoney * 1;           //不含税金额
                        var HSumMoney = HMoney * (1 + (HTaxRate * 0.01));    //总金额=不含税金额*(1+(税率*0.01))
                        var HPrice = value * 1;                  //单价
                        var HQty = obj.data.HQty * 1;           //数量
                        var HTaxRate = obj.data.HTaxRate * 1;           //税率
                        var HSumMoney = HPrice * HQty * (1 + (HTaxRate * 0.01));    //总金额=单价*数量*(1+(税率*0.01))
                        var HMoney = HQty * HPrice; //不含税金额=数量*单据
                        //设置数据小数位数
                        HMoney = dealDoubleToFixed(HMoney, 2);
                        HQty = dealDoubleToFixed(HQty, 2);;
                        HTaxRate = HTaxRate;
                        HPrice = dealDoubleToFixed(HPrice, 2);;
                        HSumMoney = dealDoubleToFixed(HSumMoney, 2);
                        //同步更新表格和缓存对应的值
                        obj.update({
                            HMoney: HMoney
                            HQty: HQty
                            , HPrice: HPrice
                            , HMoney: HMoney
                            , HTaxRate: HTaxRate
                            , HSumMoney: HSumMoney
                        });
                        break;
                    case "HSumMoney":                                                       //数量
                        //数据格式校验
                        temp = value + "";
                        if (!ref.test(temp)) {
                            //恢复数据到编辑前
                            obj.update({
                                HSumMoney: oldText
                            });
                            layer.msg("税率请输入不小于0的数字!");
                            return;
                        }
                        //数据校验合格,重算记录
                        var HSumMoney = value * 1;                           //总金额
                        var HTaxRate = obj.data.HTaxRate * 1;           //税率
                        var HMoney = HSumMoney / (1 + (HTaxRate * 0.01));
                        //设置数据小数位数
                        HMoney = dealDoubleToFixed(HMoney, 2);
                        HTaxRate = HTaxRate;
                        HSumMoney = dealDoubleToFixed(HSumMoney, 2);
                        //同步更新表格和缓存对应的值
                        obj.update({
                            HMoney: HMoney
                            , HTaxRate: HTaxRate
                            , HSumMoney: HSumMoney
                        });
                    default:
                }
            });
            //#endregion
            //#region è¡¨æ ¼è¡Œé€‰æ‹©å¤„理(是否取库存)
            //#region è¡¨æ ¼è¡Œé€‰æ‹©å¤„理
            form.on('select(HTypeSub)', function (data) {
                //获取下拉框选中的值
                var elem = data.othis.parents('tr');
@@ -885,7 +865,9 @@
                        , { field: 'HTypeSub', title: '发票类型', hide: true, templet: '#HTypeSub' }
                        , { field: 'HMoney', title: '不含税金额', hide: true, edit: 'text', style: 'background-color: #f9f9f9;' }
                        , { field: 'HTaxRate', title: '税率', hide: true, edit: 'text', style: 'background-color: #f9f9f9;' }
                        , { field: 'HSumMoney', title: '总金额', edit: 'text', style: 'background-color: #f9f9f9;' }
                        , { field: 'HQty', title: '数量',  edit: 'text', style: 'background-color: #f9f9f9;' }
                        , { field: 'HPrice', title: '单价', edit: 'text', style: 'background-color: #f9f9f9;' }
                        , { field: 'HSumMoney', title: '总金额', style: 'background-color: #f9f9f9;' }
                        , { fixed: 'right', title: '操作', toolbar: '#barDemo' }
                    ]]
                }
@@ -897,6 +879,8 @@
                        , "HTypeSub": ""
                        , "HMoney": "0"
                        , "HTaxRate": "0"
                        , "HQty": "0"
                        , "HPrice": "0"
                        , "HSumMoney": "0"
                    }
                ];
@@ -973,19 +957,19 @@
                    , area: ['90%', '90%']//大小
                    , title: '销售部门列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../Baseset/基础资料/Gy_DepartmentList.html', 'yes']
                    //, btn: ['确定', '取消']
                    //, btn1: function (index, layero) {//按钮【按钮一】的回调
                    //    var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                    //    var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                    //    if (checkStatus.data.length === 0) {
                    //        return layer.msg('请选择数据');
                    //    }
                    //    $("#HDeptName").val(checkStatus.data[0].HName);
                    //    $("#HDeptID").val(checkStatus.data[0].HItemID);
                    //    layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    //}
                    //, btn2: function (index, layero) { }
                    , content: ['../../基础资料/公用基础资料/Gy_DepartmentList.html', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        $("#HDeptName").val(checkStatus.data[0].部门名称);
                        $("#HDeptID").val(checkStatus.data[0].HItemID);
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) { }
                })
            }
            //#endregion
@@ -998,19 +982,19 @@
                    , area: ['90%', '90%']//大小
                    , title: '销售员列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../Baseset/基础资料/Gy_EmployeeList.html?Type=HEmp', 'yes']
                    //, btn: ['确定', '取消']
                    //, btn1: function (index, layero) {//按钮【按钮一】的回调
                    //    var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                    //    var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                    //    if (checkStatus.data.length === 0) {
                    //        return layer.msg('请选择数据');
                    //    }
                    //    $("#HEmpName").val(checkStatus.data[0].HName);
                    //    $("#HEmpID").val(checkStatus.data[0].HItemID);
                    //    layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    //}
                    //, btn2: function (index, layero) { }
                    , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        $("#HEmpName").val(checkStatus.data[0].职员名称);
                        $("#HEmpID").val(checkStatus.data[0].HItemID);
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) { }
                })
            }
            //#endregion
@@ -1049,7 +1033,7 @@
                    , area: ['90%', '90%']//大小
                    , title: '业务客户列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../Baseset/基础资料/Gy_CustomerList.html', 'yes']
                    , content: ['../../基础资料/销售基础资料/Gy_Customer.html', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -1058,7 +1042,7 @@
                            return layer.msg('请选择数据');
                        }
                        $("#HCusName").val(checkStatus.data[0].HName);
                        $("#HCusName").val(checkStatus.data[0].客户名称);
                        $("#HCusID").val(checkStatus.data[0].HItemID);
                        var HCusID = $("#HCusID").val();
                        getHTaxRateByCusID(HCusID);//根据客户获取客户对应税率
@@ -1116,6 +1100,11 @@
            //#region éžç©ºéªŒè¯
            function AllowLoadData(data) {
                //数值格式校验工具
                var ref = /^\d+(\.\d+)?$/;          //非负数正则表达式
                var temp = "";
                //#region è¡¨å¤´æ•°æ®æ£€éªŒ
                if ($("#HBillNo").val() == "") {
                    layer.msg("单据号不能为空!");
@@ -1133,37 +1122,38 @@
                    layer.msg("客户不能为空!");
                    return false;
                }
                //if ($("#HProjectMoneyID").val() == "0") {
                //    layer.msg("费用项目未选择!");
                //    return false;
                //}
                //if ($("#HType").val() == "") {
                //    layer.msg("发票类型未选择!");
                //    return false;
                //}
                if ($("#HEmpID").val() == "0") {
                    layer.msg("经手人未选择!");
                    return false;
                }
                //if ($("#HMoney").val() == "0") {
                //    layer.msg("不含税金额不能为零");
                //    return false;
                //}
                //if ($("#HTaxRate").val() == "") {
                //    layer.msg("税率不能为空");
                //    return false;
                //}
                //if ($("#HSumMoney").val() == "0") {
                //    layer.msg("总金额不能为零");
                //    return false;
                //}
                //#endregion
                //#region å­è¡¨æ ¡éªŒ
                for (var i = 0; i < option.data.length; i++) {
                    //费用项目校验
                    if (option.data[i].HProjectMoneyID == "0") {
                        layer.msg("第" + (i+1) + "行:请选择费用项目!");
                        return false;
                    }
                    //数量格式校验
                    temp = option.data[i]["HQty"] + "";
                    if (temp == "0") {
                        layer.msg("第" + (i + 1) + "行:数量不能为0!");
                        return false;
                    } else if (!ref.test(temp)) {
                        layer.msg("第" + (i + 1) + "行:数量请输入大于0的数字!");
                        return false;
                    }
                    //单价格式校验
                    temp = option.data[i]["HPrice"] + "";
                    if (temp == "0") {
                        layer.msg("第" + (i + 1) + "行:单价不能为0!");
                        return false;
                    } else if (!ref.test(temp)) {
                        layer.msg("第" + (i + 1) + "行:单价请输入大于0的数字!");
                        return false;
                    }
@@ -1448,17 +1438,17 @@
        });
        function GetHDeptNameValue(obj)  //返回部门
        {
            $("#HDeptName").val(obj[0].HName);
            $("#HDeptID").val(obj[0].HItemID);
        }
        //function GetHDeptNameValue(obj)  //返回部门
        //{
        //    $("#HDeptName").val(obj[0].HName);
        //    $("#HDeptID").val(obj[0].HItemID);
        //}
        function GetHEmpValue(obj)  //返回经手人
        {
            $("#HEmpName").val(obj[0].HName);
            $("#HEmpID").val(obj[0].HItemID);
        }
        //function GetHEmpValue(obj)  //返回经手人
        //{
        //    $("#HEmpName").val(obj[0].HName);
        //    $("#HEmpID").val(obj[0].HItemID);
        //}
                //function GetHSupValue(obj)  //返回客户
                //{