Browse Source

발주관리-본사발주요청현황, 매장발주요청현황 요청금액 합계 추가

yhl88 2 years ago
parent
commit
b9a4ee396f

+ 4 - 0
src/main/webapp/app/pomng/POMNG02010.html

@@ -60,6 +60,10 @@
60
 						<div id="ITP_POMNG02010_jqGrid_list" class="itp_tb_list itp_gType1" data-total-cnt="${totalCnt}">
60
 						<div id="ITP_POMNG02010_jqGrid_list" class="itp_tb_list itp_gType1" data-total-cnt="${totalCnt}">
61
 							<div id="ITP_POMNG02010_jqGridView" class="itp_views fix"></div>
61
 							<div id="ITP_POMNG02010_jqGridView" class="itp_views fix"></div>
62
 							<button type="button" id="ITP_BTN_POMNG02010_EXCEL" class="btn btn-success btn-sm Excel" style="float:right;"><i class="glyphicon "></i>Excel</button>
62
 							<button type="button" id="ITP_BTN_POMNG02010_EXCEL" class="btn btn-success btn-sm Excel" style="float:right;"><i class="glyphicon "></i>Excel</button>
63
+								<div id="ITP_BTN_STINFO06010_CALCULATE_FORM" style="display:initial; float:right; position:relative; top:0px; margin-right:70px;">
64
+									<label>요청금액합계 :</label>
65
+									<input id="ITP_POMNG02010_REQ_TOTAL_AMT_SUM" style="width:100px; text-align: right;" maxlength="5" readonly="readonly">
66
+								</div>
63
 							<table id="ITP_POMNG02010_jqGrid"></table>
67
 							<table id="ITP_POMNG02010_jqGrid"></table>
64
 							<div id="ITP_POMNG02010_jqGridPager"></div>
68
 							<div id="ITP_POMNG02010_jqGridPager"></div>
65
 							<div id="ITP_POMNG02010_jqGridEmpty" class="itp_no_data"></div>
69
 							<div id="ITP_POMNG02010_jqGridEmpty" class="itp_no_data"></div>

+ 43 - 48
src/main/webapp/js/app/pomng/ITP_POMNG02010.js

@@ -630,6 +630,12 @@ let listObj = {
630
 				loadComplete: function(data) {
630
 				loadComplete: function(data) {
631
 					itp_fn_grid_load_complete(data, POMNG02010_GRID_ID, true, 'number', 'POMNG02010', listObj.itp_POMNG02010_search, listObj.empty, true, data.gridRecords, true);
631
 					itp_fn_grid_load_complete(data, POMNG02010_GRID_ID, true, 'number', 'POMNG02010', listObj.itp_POMNG02010_search, listObj.empty, true, data.gridRecords, true);
632
 					var ids = $(POMNG02010_GRID_ID).getDataIDs();
632
 					var ids = $(POMNG02010_GRID_ID).getDataIDs();
633
+					let pchReqTotalAmtSum = 0;
634
+					for (var i = 0; i < ids.length; i++) {
635
+						var rowData = $(POMNG02010_GRID_ID).jqGrid('getRowData', ids[i]);
636
+						pchReqTotalAmtSum = pchReqTotalAmtSum + Number(rowData.pchReqTotalAmt);
637
+					}
638
+					$('#ITP_POMNG02010_REQ_TOTAL_AMT_SUM').val(itp_fn_number_comma(pchReqTotalAmtSum));
633
 					$.each(ids, function(idx, rowId) {
639
 					$.each(ids, function(idx, rowId) {
634
 						$(POMNG02010_GRID_ID).jqGrid('setCell', rowId, 'pchReqUnqNo', '', ITP_GRID_COL_STYLE.link);
640
 						$(POMNG02010_GRID_ID).jqGrid('setCell', rowId, 'pchReqUnqNo', '', ITP_GRID_COL_STYLE.link);
635
 					});
641
 					});
@@ -674,7 +680,6 @@ let listObj = {
674
 		}
680
 		}
675
 	},
681
 	},
676
 	excelDown: function() {
682
 	excelDown: function() {
677
-		
678
 		var param = {
683
 		var param = {
679
 			'url': API_DETAIL_GRID_LIST,
684
 			'url': API_DETAIL_GRID_LIST,
680
 			'param': $('#ITP_FORM_POMNG02010_SEARCH').serializeObject(),
685
 			'param': $('#ITP_FORM_POMNG02010_SEARCH').serializeObject(),
@@ -736,7 +741,6 @@ let modifyObj = {
736
 	},
741
 	},
737
 	wishList: function() {
742
 	wishList: function() {
738
 		const key = {brandId:fn_make_user_info.get('brandId'),storeId:fn_make_user_info.get('storeId')};
743
 		const key = {brandId:fn_make_user_info.get('brandId'),storeId:fn_make_user_info.get('storeId')};
739
-			
740
 			fn_call_popup('biz', 'BIZPOP_WISH_LIST_ITEM', '#ITP_ASIDE', function(result) {
744
 			fn_call_popup('biz', 'BIZPOP_WISH_LIST_ITEM', '#ITP_ASIDE', function(result) {
741
 				
745
 				
742
 				grid=$(POMNG02010_DETAIL_GRID_ID);
746
 				grid=$(POMNG02010_DETAIL_GRID_ID);
@@ -763,47 +767,47 @@ let modifyObj = {
763
 			}, key, 'S');
767
 			}, key, 'S');
764
 	},
768
 	},
765
 	safeStck: function() {
769
 	safeStck: function() {
766
-			var popFn = function(rowDataPop) {
770
+		var popFn = function(rowDataPop) {
767
 				
771
 				
768
-				var exists = '';
769
-				const rowData = $(POMNG02010_DETAIL_GRID_ID).getRowData();
770
-				$.each(rowData, function(key, value) {
771
-					if (value.viewCd != "D") {
772
-						exists = exists + value.brandUnitUnqNo + ';';
773
-					}
774
-				});
775
-				$.each(rowDataPop, function(key, value) {
776
-					if (exists.indexOf(value.brandUnitUnqNo) < 0 && value.podrPssblDvsn == 'PO01') {
777
-						value.viewCd = "C";
778
-						$(POMNG02010_DETAIL_GRID_ID).jqGrid('addRowData', value.brandUnitUnqNo, value, 'last');
779
-					}
780
-				});
781
-				$(POMNG02010_DETAIL_GRID_EMPTY).hide();
782
-			};
783
-			
784
-			let authTpCd = fn_make_user_info.get('authTpCd');
785
-			let URL = '/api/whs/mng/pop-whs-search';
786
-			let param = {};
787
-			param.sbrandId = fn_make_user_info.get('brandId');
788
-			param.sstoreId = fn_make_user_info.get('storeId');
789
-			let firstWhsId, firstWhsNm;
790
-			if (authTpCd == 50) {
791
-				param.swhsDvsn = 'W02';
792
-				let answer = function(result) {
793
-					firstWhsId = result.gridRows[0].whsId;
794
-					firstWhsNm = result.gridRows[0].whsNm;
772
+			var exists = '';
773
+			const rowData = $(POMNG02010_DETAIL_GRID_ID).getRowData();
774
+			$.each(rowData, function(key, value) {
775
+				if (value.viewCd != "D") {
776
+					exists = exists + value.brandUnitUnqNo + ';';
795
 				}
777
 				}
796
-				fn_ajax_call(URL, JSON.stringify(param), answer, 'POST');
797
-			} else if (authTpCd == 40) {
798
-				param.swhsDvsn = 'W01';
799
-				let answer = function(result) {
800
-					firstWhsId = result.gridRows[0].whsId;
801
-					firstWhsNm = result.gridRows[0].whsNm;
778
+			});
779
+			$.each(rowDataPop, function(key, value) {
780
+				if (exists.indexOf(value.brandUnitUnqNo) < 0 && value.podrPssblDvsn == 'PO01') {
781
+					value.viewCd = "C";
782
+					$(POMNG02010_DETAIL_GRID_ID).jqGrid('addRowData', value.brandUnitUnqNo, value, 'last');
802
 				}
783
 				}
803
-				fn_ajax_call(URL, JSON.stringify(param), answer, 'POST');
784
+			});
785
+			$(POMNG02010_DETAIL_GRID_EMPTY).hide();
786
+		};
787
+		
788
+		let authTpCd = fn_make_user_info.get('authTpCd');
789
+		let URL = '/api/whs/mng/pop-whs-search';
790
+		let param = {};
791
+		param.sbrandId = fn_make_user_info.get('brandId');
792
+		param.sstoreId = fn_make_user_info.get('storeId');
793
+		let firstWhsId, firstWhsNm;
794
+		if (authTpCd == 50) {
795
+			param.swhsDvsn = 'W02';
796
+			let answer = function(result) {
797
+				firstWhsId = result.gridRows[0].whsId;
798
+				firstWhsNm = result.gridRows[0].whsNm;
804
 			}
799
 			}
805
-			const key = {brandId:fn_make_user_info.get('brandId'),storeId:fn_make_user_info.get('storeId'),whsId:firstWhsId};
806
-			fn_call_popup('biz', 'BIZPOP_SAFE_STCK_ITEM', '#ITP_ASIDE', popFn, key, 'S');  // ==>dwkim 추후 작업 진행  파라메타 설명필요
800
+			fn_ajax_call(URL, JSON.stringify(param), answer, 'POST');
801
+		} else if (authTpCd == 40) {
802
+			param.swhsDvsn = 'W01';
803
+			let answer = function(result) {
804
+				firstWhsId = result.gridRows[0].whsId;
805
+				firstWhsNm = result.gridRows[0].whsNm;
806
+			}
807
+			fn_ajax_call(URL, JSON.stringify(param), answer, 'POST');
808
+		}
809
+		const key = {brandId:fn_make_user_info.get('brandId'),storeId:fn_make_user_info.get('storeId'),whsId:firstWhsId};
810
+		fn_call_popup('biz', 'BIZPOP_SAFE_STCK_ITEM', '#ITP_ASIDE', popFn, key, 'S');  // ==>dwkim 추후 작업 진행  파라메타 설명필요
807
 	},
811
 	},
808
 	button: {
812
 	button: {
809
 		modify: function (param) {
813
 		modify: function (param) {
@@ -862,12 +866,9 @@ let modifyObj = {
862
 					
866
 					
863
 			if (loanDvsn != null && loanDvsn != "") {
867
 			if (loanDvsn != null && loanDvsn != "") {
864
 				if (loanDvsn != 'LD03' && arg == 'PR20' ) {
868
 				if (loanDvsn != 'LD03' && arg == 'PR20' ) {
865
-					
866
 					var mallId = $('#ITP_FORM_POMNG02010_DETAIL_MALL_ID').val();
869
 					var mallId = $('#ITP_FORM_POMNG02010_DETAIL_MALL_ID').val();
867
-					
868
 					if (parseInt(pchActAtm) < parseInt(pchReqAtm)) {
870
 					if (parseInt(pchActAtm) < parseInt(pchReqAtm)) {
869
 						dlvReqAmt = itp_fn_number_comma(String(parseInt(pchReqAtm) - parseInt(pchActAtm)));
871
 						dlvReqAmt = itp_fn_number_comma(String(parseInt(pchReqAtm) - parseInt(pchActAtm)));
870
-						
871
 						if (mallId == '') {
872
 						if (mallId == '') {
872
 							if (loanDvsn == 'LD01') {
873
 							if (loanDvsn == 'LD01') {
873
 								apprTypeCd = 'NPN';
874
 								apprTypeCd = 'NPN';
@@ -888,11 +889,8 @@ let modifyObj = {
888
 					dlvReqAmt = 0 ;
889
 					dlvReqAmt = 0 ;
889
 				}  
890
 				}  
890
 			}        
891
 			}        
891
-
892
 			if (itp_fn_form_event.isValid(formId)) {
892
 			if (itp_fn_form_event.isValid(formId)) {
893
-				
894
 				const rowData1 = $(POMNG02010_DETAIL_GRID_ID).getRowData();
893
 				const rowData1 = $(POMNG02010_DETAIL_GRID_ID).getRowData();
895
-				
896
 				var dataCnt = 0;
894
 				var dataCnt = 0;
897
 				var chkQtyYn = "N";
895
 				var chkQtyYn = "N";
898
 				$.each(rowData1, function(key, value) {
896
 				$.each(rowData1, function(key, value) {
@@ -1037,7 +1035,6 @@ let modifyObj = {
1037
 					}
1035
 					}
1038
 				}
1036
 				}
1039
 			});
1037
 			});
1040
-			
1041
 			//if (chkQtyYn == "Y") return;
1038
 			//if (chkQtyYn == "Y") return;
1042
 			
1039
 			
1043
 			let param = $(formId).serializeObject();
1040
 			let param = $(formId).serializeObject();
@@ -1115,5 +1112,3 @@ let modifyObj = {
1115
 	},
1112
 	},
1116
 	 
1113
 	 
1117
 };
1114
 };
1118
-
1119
-