From 69cd9f59a0fabf12f8c9147fcba7f69817a870b3 Mon Sep 17 00:00:00 2001 From: jiazx0107@163.com <jiazx0107@163.com> Date: 星期一, 06 十一月 2023 23:40:59 +0800 Subject: [PATCH] 更新仓内抓拍2 --- igds-inout/src/main/java/com/ld/igds/inout/view/InoutList.js | 148 +++++++++++++++---------------------------------- 1 files changed, 45 insertions(+), 103 deletions(-) diff --git a/igds-inout/src/main/java/com/ld/igds/inout/view/InoutList.js b/igds-inout/src/main/java/com/ld/igds/inout/view/InoutList.js index e8e3fad..b92b4da 100644 --- a/igds-inout/src/main/java/com/ld/igds/inout/view/InoutList.js +++ b/igds-inout/src/main/java/com/ld/igds/inout/view/InoutList.js @@ -23,16 +23,9 @@ printCheck = function(){ var data = view.get("#dataGridMain.currentEntity"); if(!data) return; - if("OUT" == data.get("type")){ - $alert("鍑哄簱鏁版嵁涓嶆敮鎸佹墦鍗帮紒"); - return; - } + if("DEL" == data.get("recordStatus")){ - $alert("鍒犻櫎鐨勬暟鎹笉鏀寔鎵撳嵃锛�"); - return; - } - if("ERROR" == data.get("recordStatus")){ - $alert("寮傚父缁堟鐨勬暟鎹笉鏀寔鎵撳嵃锛�"); + $alert("寮傚父澶勭悊鐨勪俊鎭笉鏀寔鎵撳嵃锛�"); return; } view.get("#ajaxPrintCheck").set("parameter",data).execute(function(result){ @@ -40,52 +33,13 @@ }); }; -/** - * 鎵归噺鎵撳嵃锛屽閫� - */ -printBatchCheck = function(){ - var datas = view.get("#dataGridMain").get("selection"); - if(datas){ - if(datas.length <= 0){ - $alert("灏氭湭閫夋嫨鏁版嵁锛�"); - return; - } - var LODOP = CLODOP; - LODOP.PRINT_INIT("绉伴噸鍗�"); - LODOP.SET_PRINT_PAGESIZE(1,2100,1400, "A4"); - datas.each(function(data){ - //console.log(data); - if("DEL" == data.get("recordStatus")){ - $notify("鍒犻櫎鐨勬暟鎹笉鏀寔鎵撳嵃锛�"); - return true; - } - if("ERROR" == data.get("recordStatus")){ - $notify("寮傚父缁堟鐨勬暟鎹笉鏀寔鎵撳嵃锛�"); - return true; - } - view.get("#ajaxPrintCheck").set("parameter",data).execute(function(result){ - LODOP.NewPage(); - LODOP.ADD_PRINT_HTM(0, 0, "100%","100%", result); - }); - }); - $notify("寮�濮嬭皟鐢ㄦ墦鍗版満绋嬪簭锛�"); - LODOP.PREVIEW(); - }else{ - $alert("璇峰嬀閫夋暟鎹紒"); - } -}; -//鎵撳嵃绉伴噸鍗� +//鎵撳嵃杩囩鍗� printWeight = function(){ var data = view.get("#dataGridMain.currentEntity"); if(!data) return; - if("DEL" == data.get("recordStatus")){ - $alert("鍒犻櫎鐨勬暟鎹笉鏀寔鎵撳嵃锛�"); - return; - } - if("ERROR" == data.get("recordStatus")){ - $alert("寮傚父缁堟鐨勬暟鎹笉鏀寔鎵撳嵃锛�"); + $alert("寮傚父澶勭悊鐨勪俊鎭笉鏀寔鎵撳嵃锛�"); return; } if("RECORD" != data.get("progress")){ @@ -106,12 +60,7 @@ printShipWeight = function(){ var data = view.get("#dataGridMain.currentEntity"); if(!data) return; - if("DEL" == data.get("recordStatus")){ - $alert("鍒犻櫎鐨勬暟鎹笉鏀寔鎵撳嵃锛�"); - return; - } - if("ERROR" == data.get("recordStatus")){ $alert("寮傚父缁堟鐨勬暟鎹笉鏀寔鎵撳嵃锛�"); return; } @@ -134,55 +83,48 @@ LODOP.PREVIEW(); }; -/** - * 鎵归噺鎵撳嵃锛屽閫� - */ -printBatchWeight = function(){ - var datas = view.get("#dataGridMain").get("selection"); - if(datas){ - if(datas.length <= 0){ - $alert("灏氭湭閫夋嫨鏁版嵁锛�"); - return; - } - var LODOP = CLODOP; - LODOP.PRINT_INIT("绉伴噸鍗�"); - var companyId = datas[0].get("companyId"); - if(companyId && companyId == "5016"){ - //澶ф咕鍖哄畾鍒� - LODOP.SET_PRINT_PAGESIZE(1,1050,1400, ""); - }else { - LODOP.SET_PRINT_PAGESIZE(1,2100,1400, "A4"); - } - - datas.each(function(data){ - //console.log(data); - if("DEL" == data.get("recordStatus")){ - $notify("鍒犻櫎鐨勬暟鎹笉鏀寔鎵撳嵃锛�"); - return true; - } - if("ERROR" == data.get("recordStatus")){ - $notify("寮傚父缁堟鐨勬暟鎹笉鏀寔鎵撳嵃锛�"); - return true; - } - if("RECORD" != data.get("progress")){ - $notify("娴佺▼鏈畬鎴愪笉鏀寔鎵撳嵃锛�"); - return true; - } - view.get("#ajaxPrint").set("parameter",data).execute(function(result){ - //console.log(result); - LODOP.NewPage(); - LODOP.ADD_PRINT_HTM(0, 0, "100%","100%", result); - }); - }); - $notify("寮�濮嬭皟鐢ㄦ墦鍗版満绋嬪簭锛�"); - LODOP.PREVIEW(); - }else{ - $alert("璇峰嬀閫夋暟鎹紒"); - } -}; - - //鎵撳嵃缁撶畻鍗� printPay = function(){ $alert("鎵撳嵃妯$増鏈畾涔夆�︹��"); +}; + + +/** + * 鑷姩璁$畻 + * @param name + */ +deAutoByWeight = function(name){ + + if(null == name) name = "1"; + + var curData = view.get("#dsMain.data:#"); + var fullWeight = curData.get("fullWeight"); + var emptyWeight = curData.get("emptyWeight"); + + if(fullWeight == 0 || emptyWeight == 0){ + return; + } + // 鍑�閲� + var netWeight = Number(fullWeight) - Number(emptyWeight); + + if (netWeight <= 0){ + $notify("鍑�閲嶅皬浜�0锛屽綋鍓嶇О閲嶅瓨鍦ㄩ�昏緫闂"); + return; + } + + //鎵i噸淇℃伅 + var deHandle = curData.get("deHandle"), deCheck = curData.get("deCheck"), dePackage = curData.get("dePackage"), addCheck = curData.get("addCheck"); + + var deSum = Number(deHandle) + Number(deCheck) + Number(dePackage); + + + /** 鍏ュ簱閲嶉噺 = 鍑�閲� - 鎬绘墸閲� */ + recordWeight = Number(netWeight) - Number(deSum); + + /** 缁撶畻閲嶉噺 = 鍑�閲� - 鎬绘墸閲� + 澧為噸 */ + settleWeight = Number(netWeight) - Number(deSum) + Number(addCheck); + + curData.set("netWeight",netWeight); + curData.set("settleWeight",settleWeight); + curData.set("recordWeight",recordWeight); }; \ No newline at end of file -- Gitblit v1.9.3