Parcourir la source

납품서 출력 부분 수정... 인쇄하기 기능 추가 해야함

dwkim il y a 2 ans
Parent
commit
d3960267f1
1 fichiers modifiés avec 169 ajouts et 141 suppressions
  1. 169 141
      src/main/webapp/js/app/popup/biz/ITP_BIZPOP_DLV_STTMT_PRN.js

+ 169 - 141
src/main/webapp/js/app/popup/biz/ITP_BIZPOP_DLV_STTMT_PRN.js

@@ -6,71 +6,26 @@ require(['config'], function() {
6 6
 	});
7 7
 });
8 8
 
9
-let ITP_POP_GRID_LIST = '/api/pomng/inoutmng/info-inv';
10
-let ITP_POP_INFO_INV  = '/api/pomng/inoutmng/info-inv';	// 상세
11
-
9
+let API_POP_INV_INFO = '/api/pomng/inoutmng/info-inv';
12 10
 
11
+const THIS_FORM_ID = '#ITP_FORM_BIZPOP_DLV_STTMT_PRN';
12
+const THIS_GIRD_ID = '#ITP_BIZPOP_DLV_STTMT_PRN_jqGrid';
13
+const THIS_GIRD_LIST = '#ITP_BIZPOP_DLV_STTMT_PRN_jqGrid_list';
14
+const THIS_GIRD_PAGER = '#ITP_BIZPOP_DLV_STTMT_PRN_jqGridPager';
15
+const THIS_GIRD_EMPTY = '#ITP_BIZPOP_DLV_STTMT_PRN_jqGridEmpty';
13 16
 
14 17
 function itp_fn_BIZPOP_DLV_STTMT_PRN(parentPopFn, args, returnType) {
15
-	// 공통코드
16
-	// fn_make_select(CODE_LIST, 'CMPY_TYPE_CD', 'ITP_FORM_BIZPOP_DLV_STTMT_PRN_CMPY_TYPE_CD', true, '가맹점타입 선택');
18
+	
19
+	
17 20
 	let itp_BIZPOP_DLV_STTMT_PRN_param = args;
18 21
 	let itp_BIZPOP_DLV_STTMT_PRN_search = false;
19 22
 
20
-	const THIS_FORM_ID = '#ITP_FORM_BIZPOP_DLV_STTMT_PRN';
21
-	const THIS_GIRD_ID = '#ITP_BIZPOP_DLV_STTMT_PRN_jqGrid';
22
-	const THIS_GIRD_PAGER = '#ITP_BIZPOP_DLV_STTMT_PRN_jqGridPager';
23
-
24
-//	var infoParam = args;
25
-//	viewObj.init(infoParam);
26
-	$('#ITP_FORM_ITP_BIZPOP_DLV_STTMT_PRN_BRAND_ID').val(fn_make_user_info.get('brandId'));
23
+	
24
+	$('#ITP_FORM_ITP_BIZPOP_DLV_STTMT_PRN_BRAND_ID').val(args.brandId);
27 25
 	$('#ITP_FORM_ITP_BIZPOP_DLV_STTMT_PRN_DLV_STTMT_UNQ_NO').val(args.dlvSttmtUnqNo);
28
-	if(args) {
29
-		$('#ITP_FORM_BIZPOP_DLV_STTMT_PRN_CMPY_NM').val(args.brandNm);
30
-		$('#ITP_FORM_ITP_BIZPOP_DLV_STTMT_PRN_FORM_DT').val(args.fromDt);
31
-		$('#ITP_FORM_ITP_BIZPOP_DLV_STTMT_PRN_TO_DT').val(args.toDt);
32
-	}
33
-	let pageObj = {
34
-		switchScreen: function(mode) {
35
-			if(mode == 'VIEW') { // 보기
36
-				$('#ITP_FORM_BIZPOP_DLV_STTMT_PRN').show();
37
-			}
38
-		},
39
-	}
40
-	let viewObj = {
41
-			init: function (param) {
42
-				this.load(param);
43
-				this.infoParam;
44
-			},
45
-			load: function(param) {
46
-				fn_ajax_call(ITP_POP_INFO_INV, param, this.callback, 'POST');
47
-			},
48
-			callback: function (result) {
49
-				console.log(result);
50
-				
51
-				$('#ITP_BIZPOP_DLV_STTMT_PRN .fnDlvSttmtUnqNo').text(result.dlvSttmtUnqNo);
52
-				$('#ITP_BIZPOP_DLV_STTMT_PRN .fnDlvRegDt').text(result.dlvRegDt);
53
-				
54
-				$('#ITP_BIZPOP_DLV_STTMT_PRN .fnDlvMgrNm').text(result.dlvMgrNm);
55
-				$('#ITP_BIZPOP_DLV_STTMT_PRN .fnDlvAddr').text(result.dlvAddr);
56
-				$('#ITP_BIZPOP_DLV_STTMT_PRN .fnWhsMgrTelNo').text(result.whsMgrTelNo);
57
-				
58
-				$('#ITP_BIZPOP_DLV_STTMT_PRN .fnDlvBsnsRegno').text(result.dlvBsnsRegno);
59
-				$('#ITP_BIZPOP_DLV_STTMT_PRN .fnDlvNm').text(result.dlvNm);
60
-				$('#ITP_BIZPOP_DLV_STTMT_PRN .fnDlvOwnerNm').text(result.dlvOwnerNm);
61
-				$('#ITP_BIZPOP_DLV_STTMT_PRN .fnDlvAddr').text(result.dlvAddr);
62
-				
63
-				$('#ITP_BIZPOP_DLV_STTMT_PRN .fnPoBsnsRegno').text(result.poBsnsRegno);
64
-				$('#ITP_BIZPOP_DLV_STTMT_PRN .fnPoNm').text(result.poNm);
65
-				$('#ITP_BIZPOP_DLV_STTMT_PRN .fnPoOwnerNm').text(result.poOwnerNm);
66
-				$('#ITP_BIZPOP_DLV_STTMT_PRN .fnPoAddr').text(result.poAddr);
67
-				
68
-				$('#ITP_BIZPOP_DLV_STTMT_PRN .fnDlvQty').text(result.dlvQty);
69
-				
70
-			},	
71
-			
72
-	};
73 26
 	
27
+	
28
+
74 29
 	$('#ITP_BIZPOP_DLV_STTMT_PRN').one('shown.bs.modal', function(e) {
75 30
 		itp_fn_jqgrid_resize(THIS_GIRD_ID, '#ITP_BIZPOP_DLV_STTMT_PRN_jqGrid_list', '');
76 31
 		itp_fn_fire_window_resize();
@@ -78,108 +33,181 @@ function itp_fn_BIZPOP_DLV_STTMT_PRN(parentPopFn, args, returnType) {
78 33
 		$('#ITP_BIZPOP_DLV_STTMT_PRN').remove();
79 34
 	}).modal('show');
80 35
 
81
-	
82
-	
83
-	
84
-	$('#ITP_BIZPOP_DLV_STTMT_PRN_BTN_SELECT').on('click', function() {		
85
-		$('#ITP_BIZPOP_DLV_STTMT_PRN').modal('hide'); // 팝업닫기
36
+
37
+	$('#ITP_BIZPOP_DLV_STTMT_PRN_BTN_SEARCH').on('click', function() {
38
+		//인쇄부분 여기에 추가함
39
+	});
40
+/*	
41
+	$('#ITP_BIZPOP_PO_REJECT_BTN_CANCEL').on('click', function() {
42
+		let transParm = {pchReqUnqNo: $('#ITP_FORM_ITP_BIZPOP_PO_REJECT_PCH_REQ_UNQ_NO').val(),pchReqRjctRsn: '', retVal:'N', storeId:$('#ITP_FORM_ITP_BIZPOP_PO_REJECT_STORE_ID').val()}
43
+		parentPopFn(transParm);
44
+		$('#ITP_BIZPOP_PO_REJECT').modal('hide'); // 팝업닫기
86 45
 	});
46
+*/
87 47
 
88 48
 	$('#ITP_BIZPOP_DLV_STTMT_PRN_jqGridEmpty').on('click', function() {
89 49
 		itp_fn_BIZPOP_DLV_STTMT_PRN_empty.back();
90
-//		itp_BIZPOP_DLV_STTMT_PRN_param.gridSize = 10;
50
+		//itp_BIZPOP_PO_REJECT_param.gridSize = 10;
91 51
 		$(THIS_GIRD_ID).setGridParam({'postData': JSON.stringify(itp_BIZPOP_DLV_STTMT_PRN_param)}).trigger('reloadGrid');
92 52
 	});
93 53
 
94 54
 	var itp_fn_BIZPOP_DLV_STTMT_PRN_empty = {
95 55
 		push: function() {
96
-			let param = {
97
-							dlvSttmtUnqNo: $('#ITP_FORM_ITP_BIZPOP_DLV_STTMT_PRN_DLV_STTMT_UNQ_NO').val() ,
98
-							brandId: $('#ITP_FORM_ITP_BIZPOP_DLV_STTMT_PRN_BRAND_ID').val()
99
-						};			
56
+			let param = {brandId: $('#ITP_FORM_ITP_BIZPOP_DLV_STTMT_PRN_BRAND_ID').val(), dlvSttmtUnqNo: $('#ITP_FORM_ITP_BIZPOP_DLV_STTMT_PRN_DLV_STTMT_UNQ_NO').val() };
100 57
 			itp_BIZPOP_DLV_STTMT_PRN_param = param;
101
-			console.log(param);
102 58
 		},
103 59
 		back: function() {
104
-//			$(THIS_FORM_ID + '_CMPY_CD').val(itp_BIZPOP_DLV_STTMT_PRN_param.scmpyCd);
105
-//			$(THIS_FORM_ID + '_CMPY_NM').val(itp_BIZPOP_DLV_STTMT_PRN_param.scmpyNm);
106
-//			$(THIS_FORM_ID + '_CMPY_TYPE_CD').val(itp_BIZPOP_DLV_STTMT_PRN_param.scmpyTypeCd);
107 60
 		}
108 61
 	};
109 62
 
110 63
 	itp_fn_BIZPOP_DLV_STTMT_PRN_empty.push();
111
-	let param = {
112
-			dlvSttmtUnqNo: $('#ITP_FORM_ITP_BIZPOP_DLV_STTMT_PRN_DLV_STTMT_UNQ_NO').val() ,
113
-			brandId: $('#ITP_FORM_ITP_BIZPOP_DLV_STTMT_PRN_BRAND_ID').val()
114
-			};
64
+	let param = {brandId: $('#ITP_FORM_ITP_BIZPOP_DLV_STTMT_PRN_BRAND_ID').val(), dlvSttmtUnqNo: $('#ITP_FORM_ITP_BIZPOP_DLV_STTMT_PRN_DLV_STTMT_UNQ_NO').val() };
65
+	console.log(JSON.stringify(param));
115 66
 	
116
-//	let param = $('#ITP_FORM_BIZPOP_DLV_STTMT_PRN').serializeObject();
117
-	console.log(param);
118
-//	param.gridSize = 10;
119
-	$('#ITP_FORM_ORDMNG03010_SSEARCH_SWHS_NM').on('click', function() {
120
-		_this.popup('SW');
121
-	});
122
-	$(THIS_GIRD_ID).jqGrid({
123
-		colModel: [
67
+	const gridColModel = {
68
+		detail: [
124 69
 			{
125
-				index: 'PCH_PODR_UNQ_NO', name: 'pchPodrUnqNo',
126
-				label: '발주번호', //
127
-				width: '10', fixed: false, align: 'center',
128
-				sortable: false, hidden: false
129
-			},
130
-			{
131
-				index: 'ITEM_ID', name: 'itemId',
132
-				label: '품목번호', //
133
-				width: '10', fixed: false, align: 'center',
134
-				sortable: false, hidden: false
135
-			},
136
-			{
137
-				index: 'ITEM_NM', name: 'itemNm',
138
-				label: '품목명', //
139
-				width: '10', fixed: false, align: 'center',
140
-				sortable: false, hidden: false
141
-			},
142
-			{
143
-				index: 'PODR_QTY', name: 'podrQty',
144
-				label: '발주수량', //
145
-				width: '5', fixed: false, align: 'center',
146
-				sortable: false, hidden: false
147
-			},
148
-			{
149
-				index: 'DLV_QTY', name: 'dlvQty',
150
-				label: '납품서수량', //
151
-				width: '5', fixed: false, align: 'center',
152
-				sortable: false, hidden: false
153
-			},
154
-			{
155
-				index: 'EXPRY_DATE', name: 'expryDate',
156
-				label: '유통기한', //
157
-				width: '10', fixed: false, align: 'center',
158
-				sortable: false, hidden: false
159
-			}
160
-		],
161
-		loadBeforeSend: function(jqXHR) {
162
-		    jqXHR.setRequestHeader('X-AUTH-TOKEN', CONN_KEY);
70
+					index: 'PCH_PODR_UNQ_NO', name: 'pchPodrUnqNo',
71
+					label: '발주번호', //
72
+					width: '10', fixed: false, align: 'center',
73
+					sortable: false, hidden: false
74
+				},
75
+				{
76
+					index: 'ITEM_ID', name: 'itemId',
77
+					label: '품목번호', //
78
+					width: '10', fixed: false, align: 'center',
79
+					sortable: false, hidden: false
80
+				},
81
+				{
82
+					index: 'ITEM_NM', name: 'itemNm',
83
+					label: '품목명', //
84
+					width: '10', fixed: false, align: 'center',
85
+					sortable: false, hidden: false
86
+				},
87
+				{
88
+					index: 'PODR_QTY', name: 'podrQty',
89
+					label: '발주수량', //
90
+					width: '5', fixed: false, align: 'center',
91
+					sortable: false, hidden: false
92
+				},
93
+				{
94
+					index: 'DLV_QTY', name: 'dlvQty',
95
+					label: '납품서수량', //
96
+					width: '5', fixed: false, align: 'center',
97
+					sortable: false, hidden: false
98
+				},
99
+				{
100
+					index: 'EXPRY_DATE', name: 'expryDate',
101
+					label: '유통기한', //
102
+					width: '10', fixed: false, align: 'center',
103
+					sortable: false, hidden: false
104
+				}
105
+		]
106
+	};
107
+	
108
+	pageObj.call(param);
109
+	
110
+};
111
+
112
+
113
+let pageObj = {
114
+	call: function( param) {
115
+		
116
+		fn_ajax_call(API_POP_INV_INFO, JSON.stringify(param), this.callback, 'POST');
117
+	},
118
+	callback: function (result) {
119
+		console.log(result);
120
+		$('#ITP_BIZPOP_DLV_STTMT_PRN .fnDlvSttmtUnqNo').text(result.dlvSttmtUnqNo);
121
+		$('#ITP_BIZPOP_DLV_STTMT_PRN .fnDlvRegDt').text(result.dlvRegDt);
122
+		
123
+		$('#ITP_BIZPOP_DLV_STTMT_PRN .fnDlvMgrNm').text(result.dlvMgrNm);
124
+		$('#ITP_BIZPOP_DLV_STTMT_PRN .fnDlvAddr').text(result.dlvAddr);
125
+		$('#ITP_BIZPOP_DLV_STTMT_PRN .fnWhsMgrTelNo').text(result.whsMgrTelNo);
126
+		
127
+		$('#ITP_BIZPOP_DLV_STTMT_PRN .fnDlvBsnsRegno').text(result.dlvBsnsRegno);
128
+		$('#ITP_BIZPOP_DLV_STTMT_PRN .fnDlvNm').text(result.dlvNm);
129
+		$('#ITP_BIZPOP_DLV_STTMT_PRN .fnDlvOwnerNm').text(result.dlvOwnerNm);
130
+		$('#ITP_BIZPOP_DLV_STTMT_PRN .fnDlvAddr').text(result.dlvAddr);
131
+		
132
+		$('#ITP_BIZPOP_DLV_STTMT_PRN .fnPoBsnsRegno').text(result.poBsnsRegno);
133
+		$('#ITP_BIZPOP_DLV_STTMT_PRN .fnPoNm').text(result.poNm);
134
+		$('#ITP_BIZPOP_DLV_STTMT_PRN .fnPoOwnerNm').text(result.poOwnerNm);
135
+		$('#ITP_BIZPOP_DLV_STTMT_PRN .fnPoAddr').text(result.poAddr);
136
+		
137
+		$('#ITP_BIZPOP_DLV_STTMT_PRN .fnDlvQty').text(result.dlvQty);
138
+		
139
+		// 품목  리스트 조회
140
+		pageObj.grid.init(result.invDtlInfoList);
141
+	},
142
+	grid: {
143
+		init: function( gridRows) {
144
+			this.gridRows = gridRows;
145
+			this.unload();
146
+			this.load(gridRows);
147
+		
163 148
 		},
164
-		postData: JSON.stringify(param),
165
-		url: DOMAIN + ITP_POP_GRID_LIST,
166
-		pager: THIS_GIRD_PAGER,
167
-		multiselect: false,
168
-		rownumbers: false,
169
-		loadComplete: function(data) {
170
-			//여기 데이터 
171
-			data:[];
172
-			console.log(data);
173
-			itp_fn_grid_load_complete(data.invDtlInfoList,THIS_GIRD_ID,true, undefined, 'BIZPOP_DLV_STTMT_PRN',false ,false, true, data.invDtlInfoList, false);
174
-//			itp_fn_grid_load_complete(data, gridId, paging, rn, menuId, isSrh, emptyFn, isView, totCnt, totPage, emptyMsg, helpMsg, excelDownloadId, excelUploadId)
175
-			
176
-			console.log(data.invDtlInfoList);
149
+		gridId: '#ITP_BIZPOP_DLV_STTMT_PRN_jqGrid',
150
+		gridList: '#ITP_BIZPOP_DLV_STTMT_PRN_jqGrid',
151
+		gridEmpty: '#ITP_BIZPOP_DLV_STTMT_PRN_jqGridEmpty',
152
+		gridRows: '',
153
+		load : function(gridRows) {
154
+			var _this = this;
155
+			var option = {
156
+				gridId: _this.gridId,
157
+				colModel: [
158
+						{
159
+								index: 'PCH_PODR_UNQ_NO', name: 'pchPodrUnqNo',
160
+								label: '발주번호', //
161
+								width: '10', fixed: false, align: 'center',
162
+								sortable: false, hidden: false
163
+							},
164
+							{
165
+								index: 'ITEM_ID', name: 'itemId',
166
+								label: '품목번호', //
167
+								width: '10', fixed: false, align: 'center',
168
+								sortable: false, hidden: false
169
+							},
170
+							{
171
+								index: 'ITEM_NM', name: 'itemNm',
172
+								label: '품목명', //
173
+								width: '10', fixed: false, align: 'center',
174
+								sortable: false, hidden: false
175
+							},
176
+							{
177
+								index: 'PODR_QTY', name: 'podrQty',
178
+								label: '발주수량', //
179
+								width: '5', fixed: false, align: 'center',
180
+								sortable: false, hidden: false
181
+							},
182
+							{
183
+								index: 'DLV_QTY', name: 'dlvQty',
184
+								label: '납품서수량', //
185
+								width: '5', fixed: false, align: 'center',
186
+								sortable: false, hidden: false
187
+							},
188
+							{
189
+								index: 'EXPRY_DATE', name: 'expryDate',
190
+								label: '유통기한', //
191
+								width: '10', fixed: false, align: 'center',
192
+								sortable: false, hidden: false
193
+							}
194
+					],
195
+				data: gridRows,
196
+				multiselect: false,
197
+				loadComplete: function(data) {
198
+					$('#ITP_BIZPOP_DLV_STTMT_PRN_jqGrid').find('.ui-jqgrid .ui-jqgrid-bdiv').css('overflow-x', 'hidden');
199
+					data.records === 0 ? _this.clearData() : $('#ITP_BIZPOP_DLV_STTMT_PRN_jqGridEmpty').hide();
200
+				},
201
+				onCellSelect: function(rowid, cellIdx, cellValue) {
202
+				}
203
+			};
204
+			itp_fn_grid_make_local(option);
177 205
 		},
178
-	    loadError: function(jqXHR, textStatus, errorThrown) {
179
-	    	itp_fn_grid_load_error(jqXHR, textStatus, errorThrown);
180
-	    },
181
-	    onPaging: function(action) {
182
-	    	itp_fn_grid_paging(THIS_GIRD_ID, action, param);
183
-	    }
184
-	}).navGrid(THIS_GIRD_PAGER, ITP_GRID_NAV_DEFAULTS.navGrid);
206
+		unload : function() {
207
+			$.jgrid.gridUnload(this.gridId);
208
+		}
209
+	}
185 210
 };
211
+
212
+
213
+