From 459c489f107917d3409125e74f8299735b58256e Mon Sep 17 00:00:00 2001 From: yxj <yxj@hz-kingdee.com> Date: 星期四, 10 十月 2024 10:36:04 +0800 Subject: [PATCH] 考勤汇报单模块,职员系数、基本工时列增加按F6批量填充功能 --- WebTM/views/工资管理/考勤汇报单/Pay_WorkTimesBillEdit.html | 128 +++++++++++++++++++++++++++++++++++++++++- WebTM/layuiadmin/Scripts/webConfig.js | 2 2 files changed, 124 insertions(+), 6 deletions(-) diff --git a/WebTM/layuiadmin/Scripts/webConfig.js b/WebTM/layuiadmin/Scripts/webConfig.js index ab0e759..75b6582 100644 --- a/WebTM/layuiadmin/Scripts/webConfig.js +++ b/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/"; //浣欐�濇澃鏈湴閰嶇疆(瀹夌憺) diff --git "a/WebTM/views/\345\267\245\350\265\204\347\256\241\347\220\206/\350\200\203\345\213\244\346\261\207\346\212\245\345\215\225/Pay_WorkTimesBillEdit.html" "b/WebTM/views/\345\267\245\350\265\204\347\256\241\347\220\206/\350\200\203\345\213\244\346\261\207\346\212\245\345\215\225/Pay_WorkTimesBillEdit.html" index 82adad2..cd9c57c 100644 --- "a/WebTM/views/\345\267\245\350\265\204\347\256\241\347\220\206/\350\200\203\345\213\244\346\261\207\346\212\245\345\215\225/Pay_WorkTimesBillEdit.html" +++ "b/WebTM/views/\345\267\245\350\265\204\347\256\241\347\220\206/\350\200\203\345\213\244\346\261\207\346\212\245\345\215\225/Pay_WorkTimesBillEdit.html" @@ -446,10 +446,10 @@ , { field: 'HEmpID', title: 'HEmpID', width: 100, hide: true, style: 'background-color:#efefef4d;' } , { field: 'HEmpNumber', title: '鑱屽憳浠g爜', 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; //宸ヨ祫=灏忔椂宸ヨ祫*鍩烘湰宸ユ椂 -- Gitblit v1.9.1