duhe
2023-10-30 6dea1627b77c43bd6693592b2a37be894e7d5bb6
发货通知单:子表公式重算、退出按钮优化
2个文件已修改
84 ■■■■■ 已修改文件
WebTM/Properties/PublishProfiles/JFTM.pubxml.user 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/销售管理/发货通知单/Add_Edit_Xs_SeOutStockBillList.html 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/Properties/PublishProfiles/JFTM.pubxml.user
@@ -4578,7 +4578,7 @@
      <publishTime>10/26/2023 20:16:37</publishTime>
    </File>
    <File Include="views/销售管理/发货通知单/Add_Edit_Xs_SeOutStockBillList.html">
      <publishTime>10/07/2023 09:12:15</publishTime>
      <publishTime>10/30/2023 19:07:36</publishTime>
    </File>
    <File Include="views/销售管理/发货通知单/Xs_SeOutStockBillList.html">
      <publishTime>10/07/2023 09:12:15</publishTime>
WebTM/views/ÏúÊÛ¹ÜÀí/·¢»õ֪ͨµ¥/Add_Edit_Xs_SeOutStockBillList.html
@@ -439,7 +439,11 @@
            //退出按钮
            form.on('submit(Exit)', function () {
                Pub_Close(1);
                if (params[1] != null) {
                    Pub_Close(1);
                } else if (params[1] == null) {
                    Pub_Close(2);
                }
            })
            //选择业务员按钮
@@ -500,6 +504,80 @@
                    });
                }
            });
            //#region ç›‘听单元格编辑  å•元格编辑后 å˜æ›´
            table.on('edit(mainTable)', function (obj) {
                //数值格式校验工具
                var ref = /^\d+(\.\d+)?$/;          //非负数正则表达式
                var temp = "";
                // å•元格编辑之前的值
                var oldText = $(this).prev().text();
                var value = obj.value //得到修改后的值
                    , data = obj.data //得到所在行所有键值
                    , field = obj.field; //得到字段
                //layer.msg('[ID: ' + data.id + '] ' + field + ' å­—段更改为:' + value);
                switch (field) {
                    case "HQty":                                                       //实发数量
                        //数据格式校验
                        temp = value + "";
                        if (!ref.test(temp) || temp == 0) {
                            //恢复数据到编辑前
                            obj.update({
                                HQty: oldText
                            });
                            table.render(option);
                            layer.msg("实发数量请输入大于0的数字!");
                            return;
                        }
                        //数据校验合格,重算记录
                        var HQty = value * 1;                           //实发数量
                        var HPrice = obj.data.HPrice * 1;               //单价
                        var HMoney = HQty * HPrice;                     //金额=实发数量*单价
                        //同步更新表格和缓存对应的值
                        obj.update({
                            HQty: HQty
                            , HPrice: HPrice
                            , HMoney: HMoney
                        });
                        table.render(option);
                        break;
                    case "HPrice":                                                       //单价
                        //数据格式校验
                        temp = value + "";
                        if (!ref.test(temp) || temp == 0) {
                            //恢复数据到编辑前
                            obj.update({
                                HPrice: oldText
                            });
                            table.render(option);
                            layer.msg("单价请输入大于0的数字!");
                            return;
                        }
                        //数据校验合格,重算记录
                        var HQty = obj.data.HQty * 1;                   //实发数量
                        var HPrice = value * 1;                         //单价
                        var HMoney = HQty * HPrice;                     //金额=实发数量*单价
                        //同步更新表格和缓存对应的值
                        obj.update({
                            HQty: HQty
                            , HPrice: HPrice
                            , HMoney: HMoney
                        });
                        table.render(option);
                        break;
                    default:
                }
            });
            //#endregion
            //#endregion
@@ -535,7 +613,7 @@
                        , { field: '发货仓库', title: '发货仓库', width: 100, edit: 'text', event: "HWHID" }//f7
                        , { field: 'HQty', title: '数量', width: 100, edit: 'text' }
                        , { field: 'HPrice', title: '单价', width: 100, edit: 'text' }
                        , { field: 'HMoney', title: '金额', width: 100, edit: 'text' }
                        , { field: 'HMoney', title: '金额', width: 100 }
                        , { field: 'HRemark', title: '备注', width: 100, edit: 'text' }
                        , { fixed: 'right', title: '操作', toolbar: '#barDemo', width: 70 }
                    ]]