From fee5a335de05c5162ef754bfe80b6de39f4e8b69 Mon Sep 17 00:00:00 2001 From: zrg <z18737863051@163.com> Date: 星期二, 12 三月 2024 11:19:52 +0800 Subject: [PATCH] 其他应收单增加 数量和单价 --- WebTM/views/销售管理/其他应收单/YS_ReceiveOtherBillMain.html | 210 +++++++++++++++++++++++++--------------------------- WebTM/WebTM.csproj | 1 2 files changed, 101 insertions(+), 110 deletions(-) diff --git a/WebTM/WebTM.csproj b/WebTM/WebTM.csproj index f76e442..d5b3c12 100644 --- a/WebTM/WebTM.csproj +++ b/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" /> diff --git "a/WebTM/views/\351\224\200\345\224\256\347\256\241\347\220\206/\345\205\266\344\273\226\345\272\224\346\224\266\345\215\225/YS_ReceiveOtherBillMain.html" "b/WebTM/views/\351\224\200\345\224\256\347\256\241\347\220\206/\345\205\266\344\273\226\345\272\224\346\224\266\345\215\225/YS_ReceiveOtherBillMain.html" index fba5403..d3fbb3e 100644 --- "a/WebTM/views/\351\224\200\345\224\256\347\256\241\347\220\206/\345\205\266\344\273\226\345\272\224\346\224\266\345\215\225/YS_ReceiveOtherBillMain.html" +++ "b/WebTM/views/\351\224\200\345\224\256\347\256\241\347\220\206/\345\205\266\344\273\226\345\272\224\346\224\266\345\215\225/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鐨別lem:"#test" - // if (checkStatus.data.length === 0) { - // return layer.msg('璇烽�夋嫨鏁版嵁'); - // } - // $("#HDeptName").val(checkStatus.data[0].HName); - // $("#HDeptID").val(checkStatus.data[0].HItemID); - // layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨� - //} - //, 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鐨別lem:"#test" + if (checkStatus.data.length === 0) { + return layer.msg('璇烽�夋嫨鏁版嵁'); + } + $("#HDeptName").val(checkStatus.data[0].閮ㄩ棬鍚嶇О); + $("#HDeptID").val(checkStatus.data[0].HItemID); + layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨� + } + , 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鐨別lem:"#test" - // if (checkStatus.data.length === 0) { - // return layer.msg('璇烽�夋嫨鏁版嵁'); - // } - // $("#HEmpName").val(checkStatus.data[0].HName); - // $("#HEmpID").val(checkStatus.data[0].HItemID); - // layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨� - //} - //, 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鐨別lem:"#test" + if (checkStatus.data.length === 0) { + return layer.msg('璇烽�夋嫨鏁版嵁'); + } + $("#HEmpName").val(checkStatus.data[0].鑱屽憳鍚嶇О); + $("#HEmpID").val(checkStatus.data[0].HItemID); + layer.close(index); //瀹冭幏鍙栫殑濮嬬粓鏄渶鏂板脊鍑虹殑鏌愪釜灞傦紝鍊兼槸鐢眑ayer鍐呴儴鍔ㄦ�侀�掑璁$畻鐨� + } + , 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) //杩斿洖瀹㈡埛 //{ -- Gitblit v1.9.1