yxj
2024-10-10 459c489f107917d3409125e74f8299735b58256e
考勤汇报单模块,职员系数、基本工时列增加按F6批量填充功能
2个文件已修改
130 ■■■■■ 已修改文件
WebTM/layuiadmin/Scripts/webConfig.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/工资管理/考勤汇报单/Pay_WorkTimesBillEdit.html 128 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/layuiadmin/Scripts/webConfig.js
@@ -8,7 +8,7 @@
    //var WEBURL = "http://localhost:8082/API/";    //杜贺本地配置
    /*var WEBURL = "http://localhost/API/";*/    //潘浙游本地配置  
    //var WEBURL = "http://localhost:8082/API/";    //张瑞广本地配置
    var WEBURL = "http://localhost:81/API/"    //翁涛涛本地配置
    //var WEBURL = "http://localhost:81/API/"    //翁涛涛本地配置
    //var WEBURL = "http://47.96.97.237/API/";          //智云服务器
    /*var WEBURL = "http://localhost:8082/LuBaoAPI/"; */  //余思杰本地配置
    //var WEBURL = "http://localhost:8088/ARAPI/";      //余思杰本地配置(安瑞)
WebTM/views/¹¤×ʹÜÀí/¿¼Çڻ㱨µ¥/Pay_WorkTimesBillEdit.html
@@ -446,10 +446,10 @@
                        , { field: 'HEmpID', title: 'HEmpID', width: 100, hide: true, style: 'background-color:#efefef4d;' }
                        , { field: 'HEmpNumber', title: '职员代码', width: 100, edit: 'text', event: "HEmpNumber" }                 //F7
                        , { field: 'HEmpName', title: '职员名称', width: 100, style: 'background-color:#efefef4d;' }
                        , { field: 'HEmpRate', title: '职员系数', width: 100, edit: 'text' }
                        , { field: 'HEmpRate', title: '职员系数', width: 100, edit: 'text', event: "HEmpRate" }
                        , { field: 'HAMTimes', title: '上午工时', width: 100, edit: 'text', totalRow: true }
                        , { field: 'HPMTimes', title: '下午工时', width: 100, edit: 'text', totalRow: true }
                        , { field: 'HBaseTimes', title: '基本工时', width: 100, edit: 'text', totalRow: true }
                        , { field: 'HBaseTimes', title: '基本工时', width: 100, edit: 'text', totalRow: true, event: "HBaseTimes" }
                        , { field: 'HBaseDays', title: '基本天数', width: 100, edit: 'text', totalRow: true }
                        , { field: 'HOverTimes', title: '加班工时', width: 100, edit: 'text', totalRow: true }
                        , { field: 'HOverDays', title: '加班天数', width: 100, edit: 'text', totalRow: true }
@@ -1188,9 +1188,93 @@
                                }
                            })
                        }
                        //obj.event = "";
                        return false;
                    }
                    //#region æ‰¹é‡å¡«å……
                    //数值格式校验工具
                    var ref = /^\d+(\.\d+)?$/;          //非负数正则表达式
                    var temp = "";
                    //操作行索引
                    var rowIndex = $(obj.tr).attr("data-index");
                    if (event.key == "F6") {
                        //职员系数
                        if (obj.event == "HEmpRate") {
                            var oldText = table.cache["mainTable"][rowIndex].HEmpRate;
                            var value = e.target.value; //得到修改后的值
                            //数据格式校验
                            temp = value + "";
                            if (!ref.test(temp) || temp == 0) {
                                //恢复数据到编辑前
                                option.data[rowIndex].HEmpRate = oldText;
                                table.render(option);
                                //刷新设置复选框状态
                                CheckedSet_tableSub();
                                layer.msg("所输入值必须为大于0的数字!");
                                return;
                            }
                            for (var i = rowIndex * 1; i < option.data.length; i++) {
                                //数据校验合格,重算记录
                                var HEmpRate = isNaN(value) ? 0 : value * 1;    //职员系数
                                //同步更新表格和缓存对应的值
                                option.data[i].HEmpRate = HEmpRate;
                            }
                            table.render(option);
                            //刷新设置复选框状态
                            CheckedSet_tableSub();
                        }
                        //基本工时
                        if (obj.event == "HBaseTimes") {
                            var oldText = table.cache["mainTable"][rowIndex].HBaseTimes;
                            var value = e.target.value; //得到修改后的值
                            //数据格式校验
                            temp = value + "";
                            if (!ref.test(temp) || temp == 0) {
                                //恢复数据到编辑前
                                option.data[rowIndex].HBaseTimes = oldText;
                                table.render(option);
                                //刷新设置复选框状态
                                CheckedSet_tableSub();
                                layer.msg("所输入值必须为大于0的数字!");
                                return;
                            }
                            for (var i = rowIndex * 1; i < option.data.length; i++) {
                                //数据校验合格,重算记录
                                var HBaseTimes = isNaN(value) ? 0 : value * 1;                                  //基本工时
                                var HAMTimes = HBaseTimes / 2;                                                  //上午工时
                                var HPMTimes = HBaseTimes / 2;                                                  //下午工时
                                var HPayMoney = isNaN(option.data[i].HPayMoney) ? 0 : option.data[i].HPayMoney; //小时工资
                                var HMoney = HPayMoney * HBaseTimes;                                            //工资=小时工资*基本工时
                                //同步更新表格和缓存对应的值
                                option.data[i].HBaseTimes = HBaseTimes;
                                option.data[i].HAMTimes = HAMTimes;
                                option.data[i].HPMTimes = HPMTimes;
                                option.data[i].HMoney = HMoney;
                            }
                            table.render(option);
                            //刷新设置复选框状态
                            CheckedSet_tableSub();
                        }
                        obj.event = "";
                        return false;
                    }
                    //#endregion
                })
            }
            //#endregion
@@ -1226,7 +1310,7 @@
                        }
                        //数据校验合格,重算记录
                        var HAMTimes = isNaN(value) ? 0 : value;                            //上午工时
                        var HAMTimes = isNaN(value) ? 0 : value * 1;                        //上午工时
                        var HPMTimes = isNaN(obj.data.HPMTimes) ? 0 : obj.data.HPMTimes;    //下午工时
                        var HBaseTimes = Number(HPMTimes) + Number(HAMTimes);               //基本工时=上午工时+下午工时
                        var HPayMoney = isNaN(obj.data.HPayMoney) ? 0 : obj.data.HPayMoney; //小时工资
@@ -1259,7 +1343,7 @@
                        }
                        //数据校验合格,重算记录
                        var HPMTimes = isNaN(value) ? 0 : value;                            //下午工时
                        var HPMTimes = isNaN(value) ? 0 : value * 1;                        //下午工时
                        var HAMTimes = isNaN(obj.data.HAMTimes) ? 0 : obj.data.HAMTimes;    //上午工时
                        var HBaseTimes = Number(HPMTimes) + Number(HAMTimes);               //基本工时=上午工时+下午工时
                        var HPayMoney = isNaN(obj.data.HPayMoney) ? 0 : obj.data.HPayMoney; //小时工资
@@ -1269,6 +1353,40 @@
                        obj.update({
                            HPMTimes: HPMTimes
                            , HBaseTimes: HBaseTimes
                            , HMoney: HMoney
                        });
                        table.render(option);
                        //刷新设置复选框状态
                        CheckedSet_tableSub();
                        break;
                    case "HBaseTimes":        //基本工时
                        //数据格式校验
                        temp = value + "";
                        if (!ref.test(temp) || temp == 0) {
                            //恢复数据到编辑前
                            obj.update({
                                HBaseTimes: oldText
                            });
                            table.render(option);
                            //刷新设置复选框状态
                            CheckedSet_tableSub();
                            layer.msg("所输入值必须为大于0的数字!");
                            return;
                        }
                        //数据校验合格,重算记录
                        var HBaseTimes = isNaN(value) ? 0 : value * 1;                      //基本工时
                        var HAMTimes = HBaseTimes / 2;                                      //上午工时
                        var HPMTimes = HBaseTimes / 2;                                      //下午工时
                        var HPayMoney = isNaN(obj.data.HPayMoney) ? 0 : obj.data.HPayMoney; //小时工资
                        var HMoney = HPayMoney * HBaseTimes;                                //工资=小时工资*基本工时
                        //同步更新表格和缓存对应的值
                        obj.update({
                            HBaseTimes: HBaseTimes
                            , HAMTimes: HAMTimes
                            , HPMTimes: HPMTimes
                            , HMoney: HMoney
                        });
                        table.render(option);
@@ -1292,7 +1410,7 @@
                        }
                        //数据校验合格,重算记录
                        var HPayMoney = isNaN(value) ? 0 : value;                               //小时工资
                        var HPayMoney = isNaN(value) ? 0 : value * 1;                           //小时工资
                        var HBaseTimes = isNaN(obj.data.HBaseTimes) ? 0 : obj.data.HBaseTimes;  //基本工时
                        var HMoney = HPayMoney * HBaseTimes;                                    //工资=小时工资*基本工时