Przeglądaj źródła

수거현황 완료

yhl88 2 lat temu
rodzic
commit
7b6f63c26c

+ 16 - 17
src/main/webapp/app/collmng/COLLMNG01010.html

@@ -7,11 +7,7 @@
7 7
 					<button type="button" id="ITP_BTN_COLLMNG01010_SRH" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon "></i>&nbsp;&nbsp;조회&nbsp;&nbsp;</button>
8 8
 					<button type="button" id="ITP_BTN_COLLMNG01010_CANCELLIST" class="btn btn-warning btn-sm PRB"><i class="glyphicon "></i> &nbsp;&nbsp;취소/목록&nbsp;&nbsp;</button>
9 9
 				</div>
10
-				<div style="top:0px; text-align:center; font-size:20px;">
11
-					<span style="text-decoration:underline; font-weight:600;">테스트공급업체</span>
12
-					<button type="button" id="ITP_BTN_COLLMNG01010_SRH" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-search"></i></button>
13
-					<button type="button" id="ITP_BTN_COLLMNG01010_MODIFY" class="btn btn-primary btn-sm UPB" style="display: inline-block;"><i class="glyphicon glyphicon-erase"></i></button>
14
-				</div>
10
+				<div style="top:0px; text-align:center; font-size:20px;"></div>
15 11
 			</div>
16 12
 			<div class="itp_det_in">
17 13
 				<div id="ITP_AJAX_COLLMNG01010_LIST_CONTAINER">
@@ -19,6 +15,8 @@
19 15
 						<div class="itp_srh_border fix">
20 16
 							<div class="col-xs-12">
21 17
 								<form id="ITP_FORM_COLLMNG01010_SEARCH" class="form-horizontal">
18
+								<input type="hidden" id="ITP_FORM_COLLMNG01010_SEARCH_BRAND_ID" name="sbrandId" value="">
19
+								<input type="hidden" id="ITP_FORM_COLLMNG01010_SEARCH_SPPLY_ID" name="sspplyId" value="">
22 20
 									<div class="form-group">
23 21
 										<div class="col-xs-2 itp_ip itp_noMar">
24 22
 											<label>수거 일자 *</label>
@@ -33,16 +31,17 @@
33 31
 									</div>
34 32
 									<div class="form-group" style="padding-top: 10px; border-top: 1px dotted #ccc;">
35 33
 										<div class="col-xs-2 itp_ip itp_noMar">
36
-											<select id="ITP_FORM_COLLMNG01010_SEARCH_ST_CD" class="form-control itp_input" name="sStCd">
37
-												<option value="A">수거상태</option>											
34
+											<select id="ITP_FORM_COLLMNG01010_SEARCH_RTN_ODR_ST_CD" data-select-code="RTN_ODR_ST_CD" class="form-control itp_input" name="srtnOdrStCd">
35
+												<option value="">수거상태</option>											
38 36
 											</select>
39 37
 										</div>
40 38
 										<div class="col-xs-3 itp_ip itp_noMar">
41
-											<input type="text" id="ITP_FORM_COLLMNG01010_SEARCH_DLV_PLACE" class="form-control itp_input" name="sDlvPlace" placeholder="수거장소 (매장/창고)" />
39
+											<input type="text" id="ITP_FORM_COLLMNG01010_DETAIL_RTN_WHS_NM" class="form-control itp_input" name="sDlvPlace" placeholder="수거장소 (매장/창고)" />
40
+											<input type="hidden" id="ITP_FORM_COLLMNG01010_DETAIL_RTN_WHS_ID" class="form-control itp_input" name="swhsId"/>
42 41
 										</div>
43 42
 										<div class="col-xs-1 itp_in" style="padding-left: 5px; width:10%;">
44
-											<button type="button" id="ITP_BTN_COLLMNG01010_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_COLLMNG01010_SEARCH_MODIFY" class="btn btn-primary btn-sm UPB" style="display: inline-block;"><i class="glyphicon glyphicon-erase"></i></button>
43
+											<button type="button" id="ITP_BTN_COLLMNG01010_SEARCH_WHS_NM" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-search"></i></button>
44
+											<button type="button" id="ITP_BTN_COLLMNG01010_DELETE_WHS_NM" class="btn btn-primary btn-sm UPB" style="display: inline-block;"><i class="glyphicon glyphicon-erase"></i></button>
46 45
 						                </div>
47 46
 										<div class="col-xs-5 itp_ip itp_noMar">
48 47
 											<input type="text" id="ITP_FORM_COLLMNG01010_SEARCH_ITEM_NM" class="form-control itp_input" name="sItemNm" placeholder="발주번호/품목번호/품목명" />
@@ -74,33 +73,33 @@
74 73
 											<label class="col-xs-2 itp_lb">브랜드 *</label>
75 74
 											<div class="col-xs-4 itp_ip fnBrandNm"></div>
76 75
 											<label class="col-xs-2 itp_lb">발주번호</label>
77
-											<div class="col-xs-4 itp_ip fnPchPodrUnqNo"></div>
76
+											<div class="col-xs-4 itp_ip fnRtnPodrUnqNo"></div>
78 77
 										</div>
79 78
 									</div>
80 79
 									<div class="itp_form_in">
81 80
 										<div class="form-group">
82 81
 											<label class="col-xs-2 itp_lb">수거일자</label>
83
-											<div class="col-xs-4 itp_ip fnColDt"></div>
82
+											<div class="col-xs-4 itp_ip fnRtnOdrRegDt"></div>
84 83
 											<label class="col-xs-2 itp_lb">수거상태</label>
85
-											<div class="col-xs-4 itp_ip fnColCmdStCd"></div>
84
+											<div class="col-xs-4 itp_ip fnRtnOdrStNm"></div>
86 85
 										</div>
87 86
 									</div>
88 87
 									<div class="itp_form_in">	
89 88
 										<div class="form-group">
90 89
 											<label class="col-xs-2 itp_lb">수거장소</label>
91 90
 											<div class="col-xs-4 itp_ip">
92
-												<div class="col-xs-3 itp_in fnColPlace"></div>
91
+												<div class="col-xs-3 itp_in fnRtnWhsNm"></div>
93 92
 											</div>
94 93
 											<label class="col-xs-2 itp_lb">수거 총 금액</label>
95
-											<div class="col-xs-4 itp_ip fnColAmt"></div>
94
+											<div class="col-xs-4 itp_ip fnRtnDodrTotalAmt"></div>
96 95
 										</div>
97 96
 									</div>
98 97
 									<div class="itp_form_in">	
99 98
 										<div class="form-group">
100 99
 											<label class="col-xs-2 itp_lb">발주담당자</label>
101
-											<div class="col-xs-4 itp_ip fnPodrMgrNm"></div>
100
+											<div class="col-xs-4 itp_ip fnRtnMgrNm"></div>
102 101
 											<label class="col-xs-2 itp_lb">발주담당자연락처</label>
103
-											<div class="col-xs-4 itp_ip fnPodrMgrTelNo"></div>
102
+											<div class="col-xs-4 itp_ip fnRtnMgrTelNo"></div>
104 103
 										</div>
105 104
 									</div>
106 105
 									<div class="itp_form_in">

+ 128 - 17
src/main/webapp/js/app/collmng/ITP_COLLMNG01010.js

@@ -167,8 +167,8 @@ let pageObj = {
167 167
 			var defaultToDate = new Date(now);
168 168
 			defaultToDate.setDate(now.getDate()+7);
169 169
 			$('#ITP_TAB_COLLMNG01010 .input-group.date').datepicker(ITP_DATE_LANGUAGE);
170
-			$('#ITP_FORM_COLLMNG01010_SEARCH_FROM_DT').datepicker('setDate', '2022.10.01');
171
-			$('#ITP_FORM_COLLMNG01010_SEARCH_TO_DT').datepicker('setDate', '2022.12.01');
170
+			$('#ITP_FORM_COLLMNG01010_SEARCH_FROM_DT').datepicker('setDate', now);
171
+			$('#ITP_FORM_COLLMNG01010_SEARCH_TO_DT').datepicker('setDate', defaultToDate);
172 172
 		},
173 173
 		grid: function() {
174 174
 			itp_fn_jqgrid_resize(COLLMNG01010_GRID_ID, COLLMNG01010_GRID_LIST, 'lg');
@@ -213,7 +213,7 @@ let pageObj = {
213 213
             $('#ITP_FORM_COLLMNG01010_SEARCH #ITP_FORM_COLLMNG01010_SEARCH_SPPLY_ID').val(fn_make_user_info.get('spplyId'));
214 214
             $('#ITP_BTN_COLLMNG01010_SEARCH_WHS_NM').show();
215 215
             $('#ITP_BTN_COLLMNG01010_DELETE_WHS_NM').show();
216
-        } else if(mode == 'ADD') { // 등록
216
+        } /*else if(mode == 'ADD') { // 등록
217 217
             $('#ITP_AJAX_COLLMNG01010_DETAIL_CONTAINER').show();
218 218
             fn_show_btn_auth_array(['#ITP_BTN_COLLMNG01010_CANCELLIST', '#ITP_BTN_COLLMNG01010_SAVE']);
219 219
 
@@ -239,7 +239,7 @@ let pageObj = {
239 239
             $('#ITP_FORM_COLLMNG01010_DETAIL #ITP_FORM_COLLMNG01010_DETAIL_BRAND_ID').val(fn_make_user_info.get('brandId'));
240 240
 
241 241
             $('.fnBrandId').text('(자동부여)');
242
-        } else if(mode == 'MODIFY') { // 수정
242
+        } */else if(mode == 'MODIFY') { // 수정
243 243
             $('#ITP_AJAX_COLLMNG01010_DETAIL_CONTAINER').show();
244 244
             fn_show_btn_auth_array(['#ITP_BTN_COLLMNG01010_CANCELLIST', '#ITP_BTN_COLLMNG01010_SAVE']);
245 245
 
@@ -267,6 +267,7 @@ let pageObj = {
267 267
 let listObj = {
268 268
 	init: function() {
269 269
 		this.grid.init();
270
+		this.action();
270 271
 	},
271 272
 	itp_COLLMNG01010_param: {},
272 273
 	itp_COLLMNG01010_search: false,
@@ -276,9 +277,8 @@ let listObj = {
276 277
 			let param = $('#ITP_FORM_COLLMNG01010_SEARCH').serializeObject();
277 278
 			param.gridSize = $.jgrid.defaults.rowNum;
278 279
             param.gridPage = $.jgrid.defaults.page;
279
-            param.sbrandId = LOGIN_USER_INFO.sbrandId;            
280
-            param.sspplyId = LOGIN_USER_INFO.spplyId;
281
-            param.sidx = '0';
280
+            //param.sbrandId = 'BRD221100002';            
281
+            //param.sspplyId = 'SPY221100004';
282 282
             console.log(JSON.stringify(param));
283 283
             $(COLLMNG01010_GRID_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
284 284
         }
@@ -296,13 +296,13 @@ let listObj = {
296 296
         push: function() {
297 297
             let param = $('#ITP_FORM_COLLMNG01010_SEARCH').serializeObject();
298 298
             listObj.itp_COLLMNG01010_param = param;
299
-            listObj.itp_COLLMNG01010_param.sidx = '0';
299
+            //listObj.itp_COLLMNG01010_param.sbrandId = 'BRD221100002';            
300
+            //listObj.itp_COLLMNG01010_param.sspplyId = 'SPY221100004';
300 301
         },
301 302
         back: function() {
302 303
             $('#ITP_FORM_COLLMNG01010_SERVICE_BRAND_TYPE').val(listObj.itp_COLLMNG01010_param.brandType);
303 304
             $('#ITP_FORM_COLLMNG01010_SERVICE_ST_CD').val(listObj.itp_COLLMNG01010_param.stCd);
304 305
             $('#ITP_FORM_COLLMNG01010_SEARCH_BRAND_NM').val(listObj.itp_COLLMNG01010_param.brandNm);
305
-        	console.log('here');
306 306
         	console.log(listObj.itp_COLLMNG01010_param);            
307 307
         }
308 308
 	},
@@ -321,9 +321,8 @@ let listObj = {
321 321
 		load: function() {
322 322
             let param = $('#ITP_FORM_COLLMNG01010_SEARCH').serializeObject();
323 323
             param.gridSize = $.jgrid.defaults.rowNum;
324
-            param.sbrandId = 'BRD221100002';            
325
-            param.sspplyId = 'SPY221100004';
326
-            param.sidx = '0';
324
+            //param.sbrandId = 'BRD221100002';            
325
+            //param.sspplyId = 'SPY221100004';
327 326
             console.log(JSON.stringify(param));
328 327
             var option = {
329 328
             	gridId: COLLMNG01010_GRID_ID,
@@ -334,11 +333,11 @@ let listObj = {
334 333
             	onCellSelect: function(rowId, cellIdx, cellValue) {
335 334
                     var cm = $(this).jqGrid('getGridParam', 'colModel');
336 335
                     var colNm = cm[cellIdx].name;
337
-                    if (colNm === 'pchPodrUnqNo') {
338
-                        const pchPodrUnqNoVal = $(this).jqGrid('getCell', rowId, 'pchPodrUnqNo');
336
+                    if (colNm === 'rtnPodrUnqNo') {
337
+                        const rtnPodrUnqNoVal = $(this).jqGrid('getCell', rowId, 'rtnPodrUnqNo');
339 338
                         const brandIdVal = $(this).jqGrid('getCell', rowId, 'brandId');
340 339
                         const spplyIdVal = fn_make_user_info.get('spplyId'); 
341
-                        const key = {pchPodrUnqNo: pchPodrUnqNoVal, brandId: brandIdVal, spplyId: spplyIdVal};
340
+                        const key = {rtnPodrUnqNo: rtnPodrUnqNoVal, brandId: brandIdVal, spplyId: spplyIdVal};
342 341
                         var param = $.param(key);
343 342
                         viewObj.init(param);
344 343
                     }
@@ -348,7 +347,7 @@ let listObj = {
348 347
                     itp_fn_grid_load_complete(data, COLLMNG01010_GRID_ID, true, 'number', 'COLLMNG01010', listObj.itp_COLLMNG01010_search, listObj.empty, true, data.gridRecords, true);
349 348
                     var ids = $(COLLMNG01010_GRID_ID).getDataIDs();
350 349
                     $.each(ids, function(idx, rowId) {
351
-                        $(COLLMNG01010_GRID_ID).jqGrid('setCell', rowId, 'pchPodrUnqNo', '', ITP_GRID_COL_STYLE.link);
350
+                        $(COLLMNG01010_GRID_ID).jqGrid('setCell', rowId, 'rtnPodrUnqNo', '', ITP_GRID_COL_STYLE.link);
352 351
                     });
353 352
 				},
354 353
 				onPaging: function(action) {
@@ -366,5 +365,117 @@ let listObj = {
366 365
 		unload: function() {
367 366
 			$.jgrid.gridUnload(COLLMNG01010_GRID_ID);
368 367
 		}
368
+	},
369
+	action: function() {
370
+		var _this = this;
371
+		// 납품장소 조회 버튼 클릭
372
+		$('#ITP_BTN_COLLMNG01010_SEARCH_WHS_NM').on('click', function() {
373
+			_this.popup();
374
+		});
375
+		// 납품장소 텍스트 삭제 버튼 클릭
376
+		$('#ITP_BTN_COLLMNG01010_DELETE_WHS_NM').on('click', function() {
377
+			$('#ITP_FORM_COLLMNG01010_DETAIL_RTN_WHS_NM').val('');
378
+			$('#ITP_FORM_COLLMNG01010_DETAIL_RTN_WHS_ID').val('');
379
+		});
380
+	},
381
+	popup: function() {
382
+		// 팝업
383
+		var popFn = this.callback.create;
384
+		const key = {brandId:fn_make_user_info.get('brandId'),storeId:fn_make_user_info.get('storeId'), whsDvsn:""};
385
+		fn_call_popup('biz', 'BIZPOP_WHS_LOCATION', '#ITP_ASIDE', popFn, key, 'S');
386
+	},
387
+	callback: {
388
+		create: function(rowDataPop) {
389
+			if(rowDataPop) {
390
+				$('#ITP_FORM_COLLMNG01010_DETAIL_RTN_WHS_NM').val(rowDataPop.whsNm);
391
+				$('#ITP_FORM_COLLMNG01010_DETAIL_RTN_WHS_ID').val(rowDataPop.whsId);
392
+			}
393
+		}
394
+	}
395
+}
396
+
397
+
398
+/*상세화면 Object*/
399
+let viewObj = {
400
+	init: function(param) {
401
+		this.load(param);
402
+	},
403
+	itp_COLLMNG01010_param: {},
404
+	itp_COLLMNG01010_search: false,
405
+	button: {
406
+		cancel: function() {
407
+			listObj.grid.search();
408
+		}
409
+	},
410
+	empty: {
411
+		init: function() {
412
+            var _this = this;
413
+            this.push();
414
+            $(COLLMNG01010_VIEW_GRID_EMPTY).on('click', function() {
415
+                _this.back();
416
+                viewObj.itp_COLLMNG01010_param.gridSize = $.jgrid.defaults.rowNum;
417
+                $(COLLMNG01010_DETAIL_GRID_ID).setGridParam({'postData': JSON.stringify(viewObj.itp_COLLMNG01010_param)}).trigger('reloadGrid');
418
+            });
419
+        },
420
+        push: function() {
421
+            let param = $('#ITP_FORM_COLLMNG01010_DETAIL').serializeObject();
422
+            viewObj.itp_COLLMNG01010_param = param;
423
+        },
424
+        back: function() {
425
+            $('#ITP_FORM_COLLMNG01010_SERVICE_BRAND_TYPE').val(viewObj.itp_COLLMNG01010_param.brandType);
426
+            $('#ITP_FORM_COLLMNG01010_SERVICE_ST_CD').val(viewObj.itp_COLLMNG01010_param.stCd);
427
+            $('#ITP_FORM_COLLMNG01010_SEARCH_BRAND_NM').val(viewObj.itp_COLLMNG01010_param.brandNm);
428
+        }
429
+	},
430
+	load: function(param) {
431
+		fn_ajax_call(API_RTNMNG_RTN_INFO_INFO_RTNODR, param, this.callback, 'GET');
432
+	},
433
+	callback: function(result) {
434
+		console.log(result);
435
+		
436
+		pageObj.switchScreen('MODIFY');
437
+		$('#ITP_FORM_COLLMNG01010_DETAIL .fnBrandNm').text(result.brandNm);							// 브랜드명
438
+		$('#ITP_FORM_COLLMNG01010_DETAIL .fnRtnPodrUnqNo').text(result.rtnPodrUnqNo);				// 발주번호
439
+		$('#ITP_FORM_COLLMNG01010_DETAIL .fnRtnOdrRegDt').text(result.rtnOdrRegDt);					// 수거일자
440
+		$('#ITP_FORM_COLLMNG01010_DETAIL .fnRtnOdrStNm').text(result.rtnOdrStNm);					// 수거상태
441
+		$('#ITP_FORM_COLLMNG01010_DETAIL .fnRtnWhsNm').text(result.rtnWhsNm);						// 수거장소
442
+		$('#ITP_FORM_COLLMNG01010_DETAIL .fnRtnDodrTotalAmt').text(result.rtnDodrTotalAmt);			// 수거 총 금액
443
+		$('#ITP_FORM_COLLMNG01010_DETAIL .fnRtnMgrNm').text(result.rtnMgrNm);						// 발주담당자
444
+		$('#ITP_FORM_COLLMNG01010_DETAIL .fnRtnMgrTelNo').text(result.rtnMgrTelNo);					// 발주담당자연락처
445
+		
446
+		for(var i = 0; i < result.rtnOdrDtlList.length; i++){
447
+			result.rtnOdrDtlList[i].colReqDt = result.colReqDt;
448
+		}
449
+		
450
+		viewObj.grid.init(result.rtnOdrDtlList);
451
+	},
452
+	grid: {
453
+		init: function(gridData) {
454
+			this.mode = 'MODIFY';
455
+			this.gridId = COLLMNG01010_DETAIL_GRID_ID;
456
+			this.gridList = COLLMNG01010_DETAIL_GRID_LIST;
457
+			this.gridEmpty = COLLMNG01010_DETAIL_GRID_EMPTY;
458
+			this.unload();
459
+			this.load(gridData);
460
+		},
461
+		mode: '',
462
+		colModel: gridColModel.detail,
463
+		load: function(gridData) {
464
+			var _this = this;
465
+			var option = {
466
+				gridId: _this.gridId,
467
+				colModel: gridColModel.detail,
468
+				data: gridData,
469
+				multiselect: true,
470
+				loadComplete: function(data) {
471
+					console.log(data);
472
+					itp_fn_grid_load_complete(data, COLLMNG01010_DETAIL_GRID_ID, true, 'number', 'COLLMNG01010', viewObj.itp_COLLMNG01010_search, viewObj.empty, true, data.gridRecords, true);
473
+				}
474
+			};
475
+			itp_fn_grid_make_local(option);
476
+		},
477
+		unload: function() {
478
+			$.jgrid.gridUnload(this.gridId);
479
+		}
369 480
 	}
370
-}
481
+};