Browse Source

납품서 현황 수정중

whakdo963 2 years ago
parent
commit
4bed8cc394

+ 2 - 2
src/main/webapp/app/ordmng/ORDMNG03010.html

@@ -24,9 +24,9 @@
24 24
 										</div>										
25 25
 										<div class="col-xs-3 itp_ip itp_noMar">
26 26
 											<div class="input-daterange input-group date">
27
-												<input type="text" id="ITP_FORM_ORDMNG03010_SEARCH_DLV_REQ_DT" class="form-control itp_input" name="fromDt" value="2022.01.01">
27
+												<input type="text" id="ITP_FORM_ORDMNG03010_SEARCH_DLV_REQ_DT" class="form-control itp_input" name="fromDt" value="2022.01.01" readonly>
28 28
 												<span class="input-group-addon itp_date_to">~</span>
29
-												<input type="text" id="ITP_FORM_ORDMNG03010_SEARCH_DLV_CMPLT_DT" class="form-control itp_input" name="toDt" value="2022.12.31">
29
+												<input type="text" id="ITP_FORM_ORDMNG03010_SEARCH_DLV_CMPLT_DT" class="form-control itp_input" name="toDt" value="2022.12.31" readonly>
30 30
 											</div>
31 31
 										</div>
32 32
 										<div class="col-xs-2 itp_in itp_noMar">

+ 17 - 14
src/main/webapp/app/pomng/POMNG05010.html

@@ -4,7 +4,7 @@
4 4
 			<div class="itp_det_head fix">
5 5
 				<h2 class="pull-left itp_det_tit"><i class="glyphicon glyphicon-chevron-right"></i> <strong>납품서 현황-팝업있음</strong></h2>
6 6
 				<div class="pull-right itp_cicon">
7
-					<button type="button" id="ITP_BTN_POMNG05010_MODIFY" class="btn btn-primary btn-sm IVP" style="display: inline-block;"><i class="glyphicon "></i>&nbsp;납품서출력&nbsp;</button>
7
+					<button type="button" id="ITP_BTN_POMNG05010_PRT" class="btn btn-primary btn-sm IVP" style="display: inline-block;"><i class="glyphicon "></i>&nbsp;납품서출력&nbsp;</button>
8 8
 					<button type="button" id="ITP_BTN_POMNG05010_SRH" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon "></i>&nbsp;&nbsp;조회&nbsp;&nbsp;</button>
9 9
 				</div>
10 10
 			</div>
@@ -25,32 +25,35 @@
25 25
 										</div>
26 26
 										<div class="col-xs-3 itp_ip itp_noMar">
27 27
 											<div class="input-daterange input-group date">
28
-												<input type="text" id="ITP_FORM_POMNG05010_SEARCH_FROM_DT" class="form-control itp_input" name="fromDt" value="2022.01.01">
28
+												<input type="text" id="ITP_FORM_POMNG05010_SEARCH_FROM_DT" class="form-control itp_input" name="fromDt" value="" readonly>
29 29
 												<span class="input-group-addon itp_date_to">~</span>
30
-												<input type="text" id="ITP_FORM_POMNG05010_SEARCH_TO_DT" class="form-control itp_input" name="toDt" value="2022.12.31">
30
+												<input type="text" id="ITP_FORM_POMNG05010_SEARCH_TO_DT" class="form-control itp_input" name="toDt" value="" readonly>
31 31
 											</div>
32 32
 										</div>
33 33
 									</div>
34 34
 									<div class="form-group" style="padding-top: 10px; border-top: 1px dotted #ccc;">
35 35
 										<div class="col-xs-2 itp_ip itp_noMar">
36
-											<select id="ITP_FORM_POMNG05010_SEARCH_DLV_DTL_ST_CD" class="form-control itp_input" name="sdlvDtlStCd">
37
-												<option value="A">납품상태</option>											
36
+											<select id="ITP_FORM_POMNG05010_SEARCH_DLV_DTL_ST_CD" data-select-code="DLV_DTL_ST_CD" class="form-control itp_input" name="sdlvDtlStCd">
37
+												<option value="A"></option>											
38 38
 											</select>
39 39
 										</div>
40 40
 										<div class="col-xs-2 itp_ip itp_noMar">
41 41
 											<input type="text" id="ITP_FORM_POMNG05010_SEARCH_SPPLY_NM" class="form-control itp_input" name="sspplyNm" placeholder="공급업체" />
42
+											<input type="hidden" id="ITP_FORM_POMNG05010_SEARCH_SPPLY_ID" class="form-control itp_input" name="sspplyId" />
43
+										</div>
44
+										<div class="col-xs-1 itp_in" style="padding:0px; width:8%;">
45
+											<button type="button" id="ITP_BTN_POMNG05010_SEARCH_SPPLY_NM" class="btn btn-success btn-sm SHOW" style="display: inline-block;"><i class="glyphicon glyphicon-search"></i></button>
46
+											<button type="button" id="ITP_BTN_POMNG05010_DELETE_SPPLY_NM" class="btn btn-primary btn-sm SHOW" style="display: inline-block;"><i class="glyphicon glyphicon-erase"></i></button>
42 47
 										</div>
43
-										<div class="col-xs-1 itp_in" style="width:8%; padding:0px;">
44
-											<button type="button" id="ITP_BTN_POMNG05010_SEARCH_SRH" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-search"></i></button>
45
-											<button type="button" id="ITP_BTN_POMNG05010_SEARCH_MODIFY" class="btn btn-primary btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-erase"></i></button>
46
-						                </div>
47 48
 										<div class="col-xs-2 itp_ip itp_noMar">
48
-											<input type="text" id="ITP_FORM_POMNG05010_SEARCH_DLV_PLACE" class="form-control itp_input" name="sdlvPlace" placeholder="매장/창고" />
49
+											<input type="text" id="ITP_FORM_POMNG05010_SEARCH_WHS_NM" class="form-control itp_input" name="swhsNm" placeholder="매장/창고" />
50
+											<input type="hidden" id="ITP_FORM_POMNG05010_SEARCH_WHS_ID" class="form-control itp_input" name="swhsId"  />
51
+										</div>
52
+										<div class="col-xs-1 itp_in" style="padding:0px; width:10%;">
53
+											<button type="button" id="ITP_BTN_POMNG05010_SEARCH_SWHS_NM" class="btn btn-success btn-sm SHOW" style="display: inline-block;"><i class="glyphicon glyphicon-search"></i></button>
54
+											<button type="button" id="ITP_BTN_POMNG05010_DELETE_SWHS_NM" class="btn btn-primary btn-sm SHOW" style="display: inline-block;"><i class="glyphicon glyphicon-erase"></i></button>
49 55
 										</div>
50
-										<div class="col-xs-1 itp_in" style="width:11%; padding:0px;">
51
-											<button type="button" id="ITP_BTN_POMNG05010_SEARCH_SRH" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-search"></i></button>
52
-											<button type="button" id="ITP_BTN_POMNG05010_SEARCH_MODIFY" class="btn btn-primary btn-sm UPB" style="display: inline-block;"><i class="glyphicon glyphicon-erase"></i></button>
53
-						                </div>
56
+										
54 57
 										<div class="col-xs-3 itp_ip itp_noMar">
55 58
 											<input type="text" id="ITP_FORM_POMNG05010_SEARCH_ITEM_NM" class="form-control itp_input" name="sitemNm" placeholder="품목번호 or 품목명" />
56 59
 										</div>

+ 7 - 2
src/main/webapp/js/app/ordmng/ITP_ORDMNG03010.js

@@ -146,6 +146,11 @@ let pageObj = {
146 146
 		view: function() {
147 147
 			// 버튼 권한설정
148 148
 			fn_proc_btn_auth('ORDMNG03010');
149
+			// 조회일자 달력 팝업 불러오기
150
+			var now = new Date();
151
+			$('#ITP_TAB_ORDMNG03010 .input-group.date').datepicker(ITP_DATE_LANGUAGE);
152
+			$('#ITP_FORM_ORDMNG03010_SEARCH_DLV_REQ_DT').datepicker('setDate', new Date(now.setMonth(now.getMonth() - 1)));
153
+			$('#ITP_FORM_ORDMNG03010_SEARCH_DLV_CMPLT_DT').datepicker('setDate', new Date());
149 154
 		}
150 155
 	},
151 156
 	action: function () {
@@ -185,7 +190,7 @@ let pageObj = {
185 190
 				$(this).on('click', function() {
186 191
 					switch (id) {
187 192
 						case 'ITP_BTN_ORDMNG03010_SRH'		: listObj.button.search();	break;	// 조회 버튼 클릭
188
-						case 'ITP_BTN_ORDMNG03010_POPUP'	: listObj.button.create(); 			// 납품서출력 팝업
193
+						case 'ITP_BTN_ORDMNG03010_POPUP'	: listObj.button.print(); 			// 납품서출력 팝업
189 194
 					}
190 195
 				});
191 196
 			});
@@ -213,7 +218,7 @@ let listObj = {
213 218
 			/*물어봐야할것들*/
214 219
 			$(ORDMNG03010_GRID_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
215 220
 		},
216
-		create: function() {
221
+		print: function() {
217 222
 			if(!fn_make_user_info.isEmpty()) { //fn_make_user_info 가 있다면
218 223
 				const rowKey = $(ORDMNG03010_GRID_ID).getGridParam('selrow'); // 그리드 셀 선택
219 224
 				if (!rowKey) {//선택 안했을시

+ 133 - 67
src/main/webapp/js/app/pomng/ITP_POMNG05010.js

@@ -140,6 +140,7 @@ let pageObj = {
140 140
 	init: function () {
141 141
 		this.ui.init();
142 142
 		this.event.init();
143
+		this.action();
143 144
 	},
144 145
 	ui: {
145 146
 		init: function () {
@@ -150,14 +151,72 @@ let pageObj = {
150 151
 			// 버튼 권한설정
151 152
 			fn_proc_btn_auth('POMNG05010');
152 153
 
153
-			// 공통코드 표시
154
+			// 공통코드 표시        sfasfdasfafas
154 155
 			$('select').each(function() {
155 156
 				if($(this).data('select-code')) {
156 157
 					fn_make_select(CODE_LIST, $(this).data('select-code'), $(this).attr('id'));
157 158
 				}
158 159
 			});
160
+			// 조회일자 지정
161
+			var now = new Date();
162
+			$('#ITP_TAB_POMNG05010 .input-group.date').datepicker(ITP_DATE_LANGUAGE);
163
+			$('#ITP_FORM_POMNG05010_SEARCH_FROM_DT').datepicker('setDate', new Date(now.setMonth(now.getMonth() - 1)));
164
+			$('#ITP_FORM_POMNG05010_SEARCH_TO_DT').datepicker('setDate', new Date());
159 165
 		},
160 166
 	},
167
+	action: function () {
168
+		var _this = this;
169
+		// 검색 공급사 
170
+		$('#ITP_BTN_POMNG05010_SEARCH_SPPLY_NM').on('click', function() {
171
+			_this.popup('SS');
172
+		});
173
+		// 검색 텍스트 삭제 버튼 클릭
174
+		$('#ITP_BTN_POMNG05010_DELETE_SPPLY_NM').on('click', function() {
175
+			$('#ITP_FORM_POMNG05010_SEARCH_SPPLY_NM').val('');
176
+			$('#ITP_FORM_POMNG05010_SEARCH_SPPLY_ID').val('');
177
+		});
178
+		// 검색 납품장소
179
+		$('#ITP_BTN_POMNG05010_SEARCH_SWHS_NM').on('click', function() {
180
+			_this.popup('SW');
181
+		});
182
+		// 검색 납품장소 텍스트 삭제 버튼 클릭
183
+		$('#ITP_BTN_POMNG05010_DELETE_SWHS_NM').on('click', function() {
184
+			$('#ITP_FORM_POMNG05010_SEARCH_WHS_NM').val('');
185
+			$('#ITP_FORM_POMNG05010_SEARCH_WHS_ID').val('');
186
+   		});
187
+	},
188
+	popup: function (arg) {
189
+		var popFn ;
190
+		// 팝업
191
+		if (arg == "SW") {
192
+			popFn = this.callback.searWhs;
193
+		} else if (arg == "SS") {
194
+			popFn = this.callback.searSpply;
195
+		} 
196
+		
197
+		const key = {brandId:fn_make_user_info.get('brandId'),storeId:fn_make_user_info.get('storeId')};
198
+		
199
+		if (arg == "SW" ) {
200
+			const keya = {brandId:fn_make_user_info.get('brandId'),storeId:fn_make_user_info.get('storeId'), whsDvsn:""};
201
+			fn_call_popup('biz', 'BIZPOP_WHS_LOCATION', '#ITP_ASIDE', popFn, keya, 'S');
202
+		} else if (arg == "SS") {
203
+			fn_call_popup('biz', 'BIZPOP_STORE_SPPLY', '#ITP_ASIDE', popFn, key, 'S');
204
+		}
205
+	},
206
+	callback: {
207
+		searSpply: function(rowDataPop) {
208
+			if(rowDataPop) {
209
+				$('#ITP_FORM_POMNG05010_SEARCH_SPPLY_NM').val(rowDataPop.spplyNm);
210
+				$('#ITP_FORM_POMNG05010_SEARCH_SPPLY_ID').val(rowDataPop.spplyId);
211
+			}
212
+		},
213
+		searWhs: function(rowDataPop) {
214
+			if(rowDataPop) {
215
+				$('#ITP_FORM_POMNG05010_SEARCH_WHS_NM').val(rowDataPop.whsNm);
216
+				$('#ITP_FORM_POMNG05010_SEARCH_WHS_ID').val(rowDataPop.whsId);
217
+			}
218
+		}
219
+	},
161 220
 	event: {
162 221
 		init: function () {
163 222
 				this.button();
@@ -168,8 +227,8 @@ let pageObj = {
168 227
 				var id = $(this).attr('id');
169 228
 				$(this).on('click', function() {
170 229
 					switch (id) {
171
-						case 'ITP_BTN_POMNG05010_SRH'				: listObj.button.search();		break;	// 조회 버튼 클릭
172
-						case 'ITP_BTN_POMNG05010_NEWREG'			: listObj.button.create(); 		break;	// 신규등록 버튼
230
+						case 'ITP_BTN_POMNG05010_SRH'	: listObj.button.search();	break;	// 조회 버튼 클릭
231
+						case 'ITP_BTN_POMNG05010_PRT'	: listObj.button.print(); 		// 납품서출력 버튼
173 232
 					}
174 233
 				});
175 234
 			});
@@ -184,78 +243,85 @@ let pageObj = {
184 243
 /*목록화면 Object*/
185 244
 let listObj = {
186 245
 	init: function () {
187
-			this.grid.init();
246
+		this.grid.init();
188 247
 	},
189 248
 	itp_POMNG05010_search: false,
190 249
 	button: {
191
-			search: function() {
192
-					listObj.itp_POMNG05010_search = true;
193
-					let param = $('#ITP_FORM_POMNG05010_SEARCH').serializeObject();
194
-					param.gridSize = $.jgrid.defaults.rowNum;
195
-					param.gridPage = $.jgrid.defaults.page;
196
-					$(POMNG05010_GRID_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
197
-			},
198
-			create: function() {
199
-					if(!fn_make_user_info.isEmpty()) {
200
-					}
250
+		search: function() {
251
+			listObj.itp_POMNG05010_search = true;
252
+			let param = $('#ITP_FORM_POMNG05010_SEARCH').serializeObject();
253
+			param.gridSize = $.jgrid.defaults.rowNum;
254
+			param.gridPage = $.jgrid.defaults.page;
255
+			$(POMNG05010_GRID_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
256
+		},
257
+		print: function() {
258
+			if(!fn_make_user_info.isEmpty()) {
259
+				const rowKey = $(POMNG05010_GRID_ID).getGridParam('selrow'); // 그리드 셀 선택
260
+				if (!rowKey) {//선택 안했을시
261
+					alert("납품서를 선택해주세요 (대표 납품서번호)") ; //출력
262
+					return; //리턴
263
+				}
264
+				var selectedIds = $(POMNG05010_GRID_ID).getGridParam('selarrrow');
265
+				if(selectedIds.length > 1) { // 1이상 선택시
266
+				   alert("납품서 하나만 선택해주세요 (대표 납품서번호)") ;//출력
267
+					return; //리턴
268
+				} 
269
+				var selRowData ; //변수선언
270
+				
271
+				for (var i=selectedIds.length-1; i>=0; i--) {//1개만 선택시
272
+					selRowData = $(POMNG05010_GRID_ID).jqGrid('getRowData', selectedIds[i]);//cell 선택
273
+				}
274
+				const key = {brandId :fn_make_user_info.get('brandId'), dlvSttmtUnqNo : selRowData.dlvSttmtUnqNo}; //popup key 값 설정
275
+				fn_call_popup('biz', 'BIZPOP_DLV_STTMT_PRN', '#ITP_ASIDE',null, key, 'S'); //config 참고 421줄  팝업 이름,키
201 276
 			}
277
+		}
202 278
 	},
203 279
 	empty: {
204
-			init: function() {
205
-					var _this = this;
206
-					this.push();
207
-					$(POMNG05010_GRID_EMPTY).on('click', function() {
208
-							_this.back();
209
-							_this.itp_POMNG05010_param.gridSize = $.jgrid.defaults.rowNum;
210
-							$(POMNG05010_GRID_ID).setGridParam({'postData': JSON.stringify(_this.itp_POMNG05010_param)}).trigger('reloadGrid');
211
-					});
212
-			},
213
-			itp_POMNG05010_param: {},
214
-			push: function() {
215
-					let param = $('#ITP_FORM_POMNG05010_SEARCH').serializeObject();
216
-					listObj.itp_POMNG05010_param = param;
217
-			},
218
-			back: function() {
219
-					$('#ITP_FORM_POMNG05010_SERVICE_ST_CD').val(this.itp_POMNG05010_param.sitemStCd);
220
-					$('#ITP_FORM_POMNG05010_SEARCH_PODR_PSSBL_DVSN').val(this.itp_POMNG05010_param.spodrPssblDvsn);
221
-					$('#ITP_FORM_POMNG05010_SEARCH_SPPLY_NM').val(this.itp_POMNG05010_param.sspplyNm);
222
-					$('#ITP_FORM_POMNG05010_SEARCH_DLV_PLACE').val(this.itp_POMNG05010_param.sdlvPlace);
223
-					$('#ITP_FORM_POMNG05010_SEARCH_ITEM_NM').val(this.itp_POMNG05010_param.sitemNm);
224
-					
225
-			}
280
+		init: function() {
281
+			var _this = this;
282
+			this.push();
283
+			$(POMNG05010_GRID_EMPTY).on('click', function() {
284
+				_this.back();
285
+				_this.itp_POMNG05010_param.gridSize = $.jgrid.defaults.rowNum;
286
+				$(POMNG05010_GRID_ID).setGridParam({'postData': JSON.stringify(_this.itp_POMNG05010_param)}).trigger('reloadGrid');
287
+			});
288
+		},
289
+		itp_POMNG05010_param: {},
290
+		push: function() {
291
+			let param = $('#ITP_FORM_POMNG05010_SEARCH').serializeObject();
292
+			listObj.itp_POMNG05010_param = param;
293
+		},
226 294
 	},
227 295
 	grid: {
228
-			init: function () {
229
-					// 데이터 없을때
230
-					listObj.empty.push();
231
-					this.search();
232
-			},
233
-			colModel: gridColModel.list,
234
-			search: function() {
235
-				pageObj.screen();
236
-				this.load();
237
-			},
238
-			load: function() {
239
-					let param = $('#ITP_FORM_POMNG05010_SEARCH').serializeObject();
240
-					param.gridSize = $.jgrid.defaults.rowNum;
241
-					param.sbrandId = fn_make_user_info.get('brandId');
242
-
243
-					var option = {
244
-							gridId: POMNG05010_GRID_ID,
245
-							colModel: gridColModel.list,
246
-							param: param,
247
-							url: DOMAIN + API_DETAIL_GRID_LIST,
248
-							pager: POMNG05010_GRID_PAGER,
249
-							multiselect: true, 
250
-							loadComplete: function(data) {
251
-									itp_fn_grid_load_complete(data, POMNG05010_GRID_ID, true, 'number', 'POMNG05010', listObj.itp_POMNG05010_search, listObj.empty, true, data.gridRecords, true);
252
-							},
253
-							onPaging: function(action) {
254
-									itp_fn_grid_paging(POMNG05010_GRID_ID, action, param);
255
-							}
256
-					};
257
-					itp_fn_grid_make_remote(option);
258
-			}
296
+		init: function () {
297
+			listObj.empty.push();
298
+			this.search();
299
+		},
300
+		colModel: gridColModel.list,
301
+		search: function() {
302
+			pageObj.screen();
303
+			this.load();
304
+		},
305
+		load: function() {
306
+			let param = $('#ITP_FORM_POMNG05010_SEARCH').serializeObject();
307
+			param.gridSize = $.jgrid.defaults.rowNum;
308
+			param.sbrandId = fn_make_user_info.get('brandId');
309
+			var option = {
310
+				gridId: POMNG05010_GRID_ID,
311
+				colModel: gridColModel.list,
312
+				param: param,
313
+				url: DOMAIN + API_DETAIL_GRID_LIST,
314
+				pager: POMNG05010_GRID_PAGER,
315
+				multiselect: true, 
316
+				loadComplete: function(data) {
317
+					itp_fn_grid_load_complete(data, POMNG05010_GRID_ID, true, 'number', 'POMNG05010', listObj.itp_POMNG05010_search, listObj.empty, true, data.gridRecords, true);
318
+				},
319
+				onPaging: function(action) {
320
+					itp_fn_grid_paging(POMNG05010_GRID_ID, action, param);
321
+				}
322
+			};
323
+			itp_fn_grid_make_remote(option);
324
+		}
259 325
 	}
260 326
 };
261 327