Pārlūkot izejas kodu

납품서생성 작업-1

yhl88 2 gadi atpakaļ
vecāks
revīzija
bb8ab4e682

+ 31 - 16
src/main/webapp/app/ordmng/ORDMNG02010.html

@@ -6,7 +6,7 @@
6 6
 				<div class="pull-right itp_cicon">
7 7
 					<button type="button" id="ITP_BTN_ORDMNG02010_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_ORDMNG02010_NEWREG" class="btn btn-primary btn-sm IVC" style="display: inline-block;"><i class="glyphicon "></i>&nbsp;&nbsp;납품서생성&nbsp;&nbsp;</button>
9
-					<button type="button" id="ITP_BTN_ORDMNG02010_CANCELLIST" class="btn btn-warning btn-sm CRT"><i class="glyphicon "></i>&nbsp;&nbsp;생성&nbsp;&nbsp;</button>
9
+					<button type="button" id="ITP_BTN_ORDMNG02010_SAVE" class="btn btn-warning btn-sm CRT"><i class="glyphicon "></i>&nbsp;&nbsp;생성&nbsp;&nbsp;</button>
10 10
 					<button type="button" id="ITP_BTN_ORDMNG02010_CANCELLIST" class="btn btn-warning btn-sm PRB"><i class="glyphicon "></i>&nbsp;&nbsp;취소/목록&nbsp;&nbsp;</button>
11 11
 				</div>
12 12
 				<div style="top:0px; text-align:center; font-size:20px;">
@@ -21,28 +21,29 @@
21 21
 						<div class="itp_srh_border fix">
22 22
 							<div class="col-xs-12">
23 23
 								<form id="ITP_FORM_ORDMNG02010_SEARCH" class="form-horizontal">
24
+								<input type="hidden" id="ITP_FORM_ORDMNG02010_SEARCH_BRAND_ID" name="sbrandId" value="">
25
+								<input type="hidden" id="ITP_FORM_ORDMNG02010_SEARCH_SPPLY_ID" name="sspplyId" value="">
24 26
 									<div class="form-group">
25 27
 										<div class="col-xs-2 itp_ip itp_noMar">
26
-											<select id="ITP_FORM_ORDMNG02010_SERVICE_" class="form-control itp_input" name="">
27
-												<option value="A">반품발주일자</option>											
28
-											</select>
28
+											<label>납품요청일 *</label>
29 29
 										</div>										
30 30
 										<div class="col-xs-3 itp_ip itp_noMar">
31 31
 											<div class="input-daterange input-group date">
32
-												<input type="text" id="ITP_FORM_ORDMNG02010_SEARCH_" class="form-control itp_input" name="" value="">
32
+												<input type="text" id="ITP_FORM_ORDMNG02010_SEARCH_FROM_DT" class="form-control itp_input" name="fromDt" value="">
33 33
 												<span class="input-group-addon itp_date_to">~</span>
34
-												<input type="text" id="ITP_FORM_ORDMNG02010_SEARCH_" class="form-control itp_input" name="" value="">
34
+												<input type="text" id="ITP_FORM_ORDMNG02010_SEARCH_TO_DT" class="form-control itp_input" name="toDt" value="">
35 35
 											</div>
36 36
 										</div>
37 37
 										<div class="col-xs-2 itp_in itp_noMar">
38
-											<input type="text" id="ITP_FORM_ORDMNG02010_SEARCH_DLV_PLACE" class="form-control itp_input" name="sDlvPlace" placeholder="수거창고/매장" />
38
+											<input type="text" id="ITP_FORM_ORDMNG02010_SEARCH_WHS_NM" class="form-control itp_input" name="swhsNm" placeholder="수거창고/매장" readonly/>
39
+											<input type="hidden" id="ITP_FORM_ORDMNG02010_SEARCH_WHS_ID" class="form-control itp_input" name="swhsId"/>
39 40
 										</div>
40 41
 										<div class="col-xs-1 itp_in" style="padding: 0px; width:8%;">
41
-											<button type="button" id="ITP_BTN_ORDMNG02010_SEARCH_SRH" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-search"></i></button>
42
-											<button type="button" id="ITP_BTN_ORDMNG02010_SEARCH_MODIFY" class="btn btn-primary btn-sm UPB" style="display: inline-block;"><i class="glyphicon glyphicon-erase"></i></button>
42
+											<button type="button" id="ITP_BTN_ORDMNG02010_SEARCH_WHS_ID" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-search"></i></button>
43
+											<button type="button" id="ITP_BTN_ORDMNG02010_DELETE_WHS_ID" class="btn btn-primary btn-sm UPB" style="display: inline-block;"><i class="glyphicon glyphicon-erase"></i></button>
43 44
 						                </div>
44 45
 										<div class="col-xs-4 itp_ip itp_noMar">
45
-											<input type="text" id="ITP_FORM_ORDMNG02010_SEARCH_ITEM_NM" class="form-control itp_input" name="fnItemNm" placeholder="발주번호/품목번호 /품목명" />
46
+											<input type="text" id="ITP_FORM_ORDMNG02010_SEARCH_ITEM_NM" class="form-control itp_input" name="sitemNm" placeholder="발주번호/품목번호 /품목명" />
46 47
 										</div>
47 48
 									</div>
48 49
 								</form>
@@ -85,9 +86,23 @@
85 86
 									<div class="itp_form_in">	
86 87
 										<div class="form-group">
87 88
 											<label class="col-xs-2 itp_lb">납품장소</label>
88
-											<div class="col-xs-4 itp_ip fnDlvPlace"></div>
89
+											<div class="col-xs-4 itp_ip fnWhsNm"></div>
89 90
 											<label class="col-xs-2 itp_lb">납품장소연락처</label>
90
-											<div class="col-xs-4 itp_ip fnVndrTelNo"></div>
91
+											<div class="col-xs-4 itp_ip fnDeliTelNo"></div>
92
+										</div>
93
+									</div>
94
+									<div class="itp_form_in">	
95
+										<div class="form-group">
96
+											<label class="col-xs-2 itp_lb">납품예정일</label>
97
+											<div class="input-daterange input-group date">
98
+												<div class="col-xs-4 itp_ip">
99
+													<div class="col-xs-7 itp_in">
100
+													<input type="text" id="ITP_FORM_ORDMNG02010_DETAIL_DLV_SCH_DT" class="form-control itp_input" name="dlvSchDt" value="">
101
+													</div>
102
+												</div>
103
+											</div>											
104
+											<label class="col-xs-2 itp_lb">납품요청일</label>
105
+											<div class="col-xs-4 itp_ip fnDlvRegDt"></div>
91 106
 										</div>
92 107
 									</div>
93 108
 									<div class="itp_form_in">	
@@ -111,10 +126,10 @@
111 126
 											<h4 class="itp_table_tit">발주 품목</h4>
112 127
 										</div>
113 128
 										<div id="ITP_ORDMNG02010_DETAIL_jqGrid_list" class="itp_tb_list">
114
-										  <div id="ITP_ORDMNG02010_DETAIL_jqGridView" class="itp_views fix"></div>
115
-										  <table id="ITP_ORDMNG02010_DETAIL_jqGrid"></table>
116
-										  <div id="ITP_ORDMNG02010_DETAIL_jqGridPager"></div>
117
-										  <div id="ITP_ORDMNG02010_DETAIL_jqGridEmpty" class="itp_no_data"></div>
129
+											<div id="ITP_ORDMNG02010_DETAIL_jqGridView" class="itp_views fix"></div>
130
+											<table id="ITP_ORDMNG02010_DETAIL_jqGrid"></table>
131
+											<div id="ITP_ORDMNG02010_DETAIL_jqGridPager"></div>
132
+											<div id="ITP_ORDMNG02010_DETAIL_jqGridEmpty" class="itp_no_data"></div>
118 133
 										</div>
119 134
 									</div>
120 135
 								</section>												

+ 530 - 0
src/main/webapp/js/app/ordmng/ITP_ORDMNG02010.js

@@ -0,0 +1,530 @@
1
+require(['config'], function() {
2
+	require([
3
+	], function($) {
4
+		pageObj.init();
5
+	});
6
+});
7
+
8
+
9
+/*화면 변수*/
10
+const ORDMNG02010_GRID_ID = '#ITP_ORDMNG02010_jqGrid';
11
+const ORDMNG02010_GRID_LIST = '#ITP_ORDMNG02010_jqGrid_list';
12
+const ORDMNG02010_GRID_PAGER = '#ITP_ORDMNG02010_jqGridPager';
13
+const ORDMNG02010_GRID_EMPTY = '#ITP_ORDMNG02010_jqGridEmpty';
14
+
15
+const ORDMNG02010_DETAIL_GRID_ID = '#ITP_ORDMNG02010_DETAIL_jqGrid';
16
+const ORDMNG02010_DETAIL_GRID_LIST = '#ITP_ORDMNG02010_DETAIL_jqGrid_list';
17
+const ORDMNG02010_DETAIL_GRID_PAGER = '#ITP_ORDMNG02010_DETAIL_jqGridPager';
18
+const ORDMNG02010_DETAIL_GRID_EMPTY = '#ITP_ORDMNG02010_DETAIL_jqGridEmpty';
19
+
20
+let ORDMNG02010_GRID_LAST_ROW_ID;
21
+
22
+//let shmtQtyValue;
23
+
24
+/*API URL*/
25
+let API_POMNG_INOUTMNG_SPPLY_TARGET_GRID_LIST = '/api/pomng/inoutmng/spply-target-grid-list';	// 공급사 납품 대상리스트 그리 리스트
26
+let API_POMNG_INOUTMNG_INIT_SPPLY_INV = '/api/pomng/inoutmng/init-spply-inv'; 					// 공급사 발주데이타 납품서 생성 초기데이타
27
+let API_POMNG_INOUTMNG_SAVE_SPPLY_INV = '/api/pomng/inoutmng/save-spply-inv'					//공급사 납품서 생성 저장 저장
28
+
29
+
30
+/*화면 Grid ColModel*/
31
+const gridColModel = {
32
+	list: [
33
+		{
34
+			index: 'VIEW_CD', name: 'viewCd',
35
+			label: ITP_MSG_LOCALE.label.viewCd,
36
+			width: '10', fixed: false, align: 'center',
37
+			sortable: false, hidden: true
38
+		},
39
+		{
40
+			index: 'BRAND_ID', name: 'brandId',
41
+			label: ITP_MSG_LOCALE.label.brandId, 			//브랜드ID
42
+			width: '10', fixed: false, align: 'center',
43
+			sortable: false, hidden: true
44
+		},
45
+		{
46
+			index: 'BRAND_NM', name: 'brandNm',
47
+			label: ITP_MSG_LOCALE.label.brandNm, 			//브랜드명
48
+			width: '10', fixed: false, align: 'center',
49
+			sortable: false, hidden: false
50
+		},
51
+		{
52
+			index: 'PCH_PODR_UNQ_NO', name: 'pchPodrUnqNo',
53
+			label: ITP_MSG_LOCALE.label.pchPodrUnqNo, 		//발주번호
54
+			width: '10', fixed: false, align: 'center',
55
+			sortable: false, hidden: false
56
+		},
57
+		{
58
+			index: 'PCH_PODR_DTL_NO', name: 'pchPodrDtlNo',
59
+			label: ITP_MSG_LOCALE.label.pchPodrDtlNo, 		//발주항번
60
+			width: '7', fixed: false, align: 'center',
61
+			sortable: false, hidden: false
62
+		},
63
+		{
64
+			index: 'DLV_REQ_DT', name: 'dlvReqDt',
65
+			label: ITP_MSG_LOCALE.label.dlvReqDt, 			//납품요청일
66
+			width: '9', fixed: false, align: 'center',
67
+			sortable: false, hidden: false
68
+		},
69
+		{
70
+			index: 'WHS_NM', name: 'whsNm',
71
+			label: ITP_MSG_LOCALE.label.whsNm, 				//납품장소
72
+			width: '10', fixed: false, align: 'center',
73
+			sortable: false, hidden: false
74
+		},
75
+		{
76
+			index: 'ITEM_ID', name: 'itemId',
77
+			label: ITP_MSG_LOCALE.label.itemId, 			//품목번호
78
+			width: '10', fixed: false, align: 'center',
79
+			sortable: false, hidden: false
80
+		},
81
+		{
82
+			index: 'ITEM_NM', name: 'itemNm',
83
+			label: ITP_MSG_LOCALE.label.itemNm, 			//품목명
84
+			width: '8', fixed: false, align: 'center',
85
+			sortable: false, hidden: false
86
+		},
87
+		{
88
+			index: 'PODR_QTY', name: 'podrQty',
89
+			label: ITP_MSG_LOCALE.label.podrQty, 			//발주수량
90
+			width: '7', fixed: false, align: 'center',
91
+			sortable: false, hidden: false
92
+		},
93
+		{
94
+			index: 'UNIT_AMT', name: 'unitAmt',
95
+			label: ITP_MSG_LOCALE.label.unitAmt, 			//단가
96
+			width: '6', fixed: false, align: 'center',
97
+			sortable: false, hidden: false
98
+		},
99
+		{
100
+			index: 'PODR_AMT', name: 'podrAmt',
101
+			label: ITP_MSG_LOCALE.label.podrAmt, 			//발주금액
102
+			width: '8', fixed: false, align: 'center',
103
+			sortable: false, hidden: false
104
+		}
105
+	],
106
+	view: [],
107
+	detail: [
108
+		{
109
+			index: 'PCH_PODR_DTL_NO', name: 'pchPodrDtlNo',
110
+			label: ITP_MSG_LOCALE.label.pchPodrDtlNo,  		//발주항번
111
+			width: '20', fixed: false, align: 'center',
112
+			sortable: false, hidden: false, edittype: 'text',
113
+			editable: false
114
+		},
115
+		{
116
+			index: 'ITEM_ID', name: 'itemId',
117
+			label: ITP_MSG_LOCALE.label.itemId, 			//품목번호
118
+			width: '20', fixed: false, align: 'center',
119
+			sortable: false, hidden: false, edittype: 'text',
120
+			editable: false
121
+		},
122
+		{
123
+			index: 'ITEM_NM', name: 'itemNm',
124
+			label: ITP_MSG_LOCALE.label.itemNm,  			//품목명
125
+			width: '20', fixed: false, align: 'center',
126
+			sortable: false, hidden: false, edittype: 'text',
127
+			editable: false
128
+		},
129
+		{
130
+			index: 'UNIT', name: 'unit',
131
+			label: ITP_MSG_LOCALE.label.unit,  				//기본단위
132
+			width: '20', fixed: false, align: 'center',
133
+			sortable: false, hidden: false, edittype: 'text',
134
+			editable: false
135
+		},
136
+		{
137
+			index: 'PODR_QTY', name: 'podrQty',
138
+			label: ITP_MSG_LOCALE.label.podrQty,  			//발주수량
139
+			width: '20', fixed: false, align: 'center',
140
+			sortable: false, hidden: false, edittype: 'text',
141
+			editable: false
142
+		},
143
+		{
144
+			index: 'SHMT_QTY', name: 'shmtQty',
145
+			label: ITP_MSG_LOCALE.label.shmtQty, 	 		//출하수량
146
+			width: '20', fixed: false, align: 'center',
147
+			sortable: false, hidden: false, edittype: 'text',
148
+			editable: true, /*editrules: {custom: true, custom_func: shmtQtyValue}*/
149
+		},
150
+		{
151
+			index: 'EXPRY_YN', name: 'expryYn',
152
+			label: ITP_MSG_LOCALE.label.expryYn,  			//유통기한여부
153
+			width: '20', fixed: false, align: 'center',
154
+			sortable: false, hidden: false, edittype: 'text',
155
+			editable: false
156
+		},
157
+		{
158
+			index: 'EXPRY_DATE', name: 'expryDate',
159
+			label: ITP_MSG_LOCALE.label.expryDate,  		//유통기한일자
160
+			width: '20', fixed: false, align: 'center',
161
+			sortable: false, hidden: false, edittype: 'date',
162
+			editable: true
163
+		},
164
+		{
165
+			index: 'REMARK', name: 'remark',
166
+			label: ITP_MSG_LOCALE.label.remark,  			//비고
167
+			width: '20', fixed: false, align: 'center',
168
+			sortable: false, hidden: false, edittype: 'text',
169
+			editable: true
170
+		}
171
+	]
172
+};
173
+
174
+
175
+/*화면공통 Object*/
176
+let pageObj = {
177
+	init: function() {
178
+		this.ui.init();
179
+		this.event.init();
180
+	},
181
+	ui: {
182
+		init: function() {
183
+			this.view();
184
+			this.grid();
185
+			this.ready();
186
+		},
187
+		view: function() {
188
+			// 버튼 권한설정
189
+			fn_proc_btn_auth('ORDMNG02010');
190
+			// 공통코드 표시
191
+			$('select').each(function() {
192
+				if($(this).data('select-code')) {
193
+					fn_make_select(CODE_LIST, $(this).data('select-code'), $(this).attr('id'));
194
+				}
195
+			});
196
+			// 조회일자 지정	
197
+			var now = new Date();
198
+			var defaultToDate = new Date(now);
199
+			defaultToDate.setDate(now.getDate() + 7);
200
+			$('#ITP_TAB_ORDMNG02010 .input-group.date').datepicker(ITP_DATE_LANGUAGE);
201
+			$('#ITP_FORM_ORDMNG02010_SEARCH_FROM_DT').datepicker('setDate', '2022.10.01'/*now*/);
202
+			$('#ITP_FORM_ORDMNG02010_SEARCH_TO_DT').datepicker('setDate', '2024.10.01'/*defaultToDate*/);
203
+		},
204
+		grid: function() {
205
+			itp_fn_jqgrid_resize(ORDMNG02010_GRID_ID, ORDMNG02010_GRID_LIST, 'lg');
206
+			listObj.empty.init();
207
+			itp_fn_fire_window_resize();
208
+		},
209
+		ready: function() {
210
+			listObj.init();
211
+		}
212
+	},
213
+	event: {
214
+		init: function() {
215
+			this.button();
216
+		},
217
+		button: function() {
218
+			// 버튼 클릭 이벤트
219
+			$('button').each(function() {
220
+				var id = $(this).attr('id');
221
+				$(this).on('click', function() {
222
+					switch (id) {
223
+						case 'ITP_BTN_ORDMNG02010_SRH'				: listObj.button.search();		break;	// 조회 버튼 클릭
224
+						case 'ITP_BTN_ORDMNG02010_NEWREG'			: listObj.button.create(); 		break;	// 신규등록 버튼
225
+						case 'ITP_BTN_ORDMNG02010_CANCELLIST'		: modifyObj.button.cancel(); 	break;	// 취소/목록 버튼
226
+						case 'ITP_BTN_ORDMNG02010_SAVE'				: modifyObj.button.save();		break;	// 발주 취소 버튼(예정)
227
+					}
228
+				});
229
+			});
230
+			
231
+			$('body').on('click', function(e) {
232
+				var gridId = ORDMNG02010_DETAIL_GRID_ID.replace('#', '');
233
+				itp_fn_grid_reset_selection(e, ORDMNG02010_GRID_LAST_ROW_ID, gridId, 'ORDMNG02010');
234
+			})
235
+		}
236
+	},
237
+	switchScreen: function(mode) {
238
+		$('.itp_det_head').find('button[id^="ITP_BTN_ORDMNG02010_"]').each(function(i) {
239
+			$(this).hide();
240
+		});
241
+		$('#ITP_TAB_ORDMNG02010').find('div[id$="_CONTAINER"]').each(function(i) {
242
+			$(this).hide();
243
+		});
244
+		if(mode === 'LIST') { // 목록
245
+			$('#ITP_AJAX_ORDMNG02010_LIST_CONTAINER').show();
246
+			fn_show_btn_auth_array(['#ITP_BTN_ORDMNG02010_SRH', '#ITP_BTN_ORDMNG02010_NEWREG']);
247
+			$('#ITP_FORM_ORDMNG02010_SEARCH #ITP_FORM_ORDMNG02010_SEARCH_BRAND_ID').val(fn_make_user_info.get('brandId'));
248
+            $('#ITP_FORM_ORDMNG02010_SEARCH #ITP_FORM_ORDMNG02010_SEARCH_SPPLY_ID').val(fn_make_user_info.get('spplyId'));
249
+            $('#ITP_BTN_ORDMNG02010_SEARCH_WHS_ID').show();
250
+            $('#ITP_BTN_ORDMNG02010_DELETE_WHS_ID').show();
251
+		}/* else if(mode == 'ADD') { // 등록
252
+			$('#ITP_AJAX_ORDMNG02010_DETAIL_CONTAINER').show();
253
+			fn_show_btn_auth_array(['#ITP_BTN_ORDMNG02010_CANCELLIST', '#ITP_BTN_ORDMNG02010_SAVE']);
254
+
255
+			$('#ITP_FORM_ORDMNG02010_DETAIL').find('input, textarea, select, checkbox').each(function(i, elem) {
256
+				$(this).attr('id') === 'ITP_FORM_ORDMNG02010_DETAIL_VIEW_CD' ? $(this).val('C') : $(this).val('');
257
+				if(elem.type === 'select') {
258
+					$(this).val('').prop('selected', true);
259
+				}
260
+			});
261
+
262
+			$('#ITP_FORM_ORDMNG02010_DETAIL_USER_ID').removeAttr('readonly');
263
+			$('#ITP_FORM_ORDMNG02010_DETAIL_DUP').removeAttr('disabled');
264
+			$('#ITP_FORM_ORDMNG02010_DETAIL_SEARCH_BRAND_ID option').remove();
265
+			$('#ITP_FORM_ORDMNG02010_DETAIL_SEARCH_AFFL_SHOP').show();
266
+			$('#ITP_FORM_ORDMNG02010_DETAIL_DELETE_AFFL_SHOP').show();
267
+		}*/ else if(mode === 'MODIFY') { // 수정
268
+			$('#ITP_AJAX_ORDMNG02010_DETAIL_CONTAINER').show();
269
+			fn_show_btn_auth_array(['#ITP_BTN_ORDMNG02010_CANCELLIST', '#ITP_BTN_ORDMNG02010_SAVE', '#ITP_BTN_ORDMNG02010_RESET_PW']);
270
+
271
+			$('#ITP_FORM_ORDMNG02010_DETAIL_USER_ID').attr('readonly', true);
272
+			$('#ITP_FORM_ORDMNG02010_DETAIL_DUP').attr('disabled', true);
273
+			$('#ITP_FORM_ORDMNG02010_DETAIL_SEARCH_AFFL_SHOP_NM').attr('readonly', true);
274
+			$('#ITP_FORM_ORDMNG02010_DETAIL_USER_NM').attr('readonly', true);
275
+			$('#ITP_FORM_ORDMNG02010_DETAIL_SEARCH_AFFL_SHOP').hide();
276
+			$('#ITP_FORM_ORDMNG02010_DETAIL_DELETE_AFFL_SHOP').hide();
277
+			$('#ITP_BTN_ORDMNG02010_CANCELLIST').show();
278
+            $('#ITP_BTN_ORDMNG02010_SAVE').show();
279
+		} /*else if(mode === 'VIEW') { // 보기
280
+			$('#ITP_AJAX_ORDMNG02010_VIEW_CONTAINER').show();
281
+			fn_show_btn_auth_array(['#ITP_BTN_ORDMNG02010_MODIFY', '#ITP_BTN_ORDMNG02010_CANCELLIST']);
282
+		}*/
283
+	}
284
+};
285
+
286
+
287
+/*목록화면 Object*/
288
+let listObj = {
289
+	init: function() {
290
+		this.grid.init();
291
+		this.action();
292
+	},
293
+	itp_ORDMNG02010_param: {},
294
+	itp_ORDMNG02010_search: false,
295
+	button: {
296
+		search: function() {
297
+			listObj.itp_ORDMNG02010_search = true;
298
+			let param = $('#ITP_FORM_ORDMNG02010_SEARCH').serializeObject();
299
+			param.gridSize = $.jgrid.defaults.rowNum;
300
+            param.gridPage = $.jgrid.defaults.page;
301
+            console.log(1234);
302
+            console.log(JSON.stringify(param));
303
+            $(ORDMNG02010_GRID_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
304
+        },
305
+        create: function() {
306
+        	var selectedIds = $(ORDMNG02010_GRID_ID).getGridParam('selarrrow');
307
+    		if(selectedIds.length > 1) { // 1이상 선택시
308
+    			alert("납품서 하나만 선택해주세요 (대표 납품서번호)") ;//출력
309
+    			return; //리턴
310
+    		}
311
+    		var selRowData ; //변수선언		
312
+    		for (var i=selectedIds.length-1; i>=0; i--) {		//1개만 선택시
313
+    			selRowData = $(ORDMNG02010_GRID_ID).jqGrid('getRowData', selectedIds[i]);		//cell 선택
314
+    		}
315
+    		let param = {brandId: selRowData.brandId, pchPodrUnqNo: selRowData.pchPodrUnqNo};
316
+    		param.spplyId = fn_make_user_info.get('spplyId');
317
+    		pageObj.switchScreen('MODIFY');
318
+			itp_fn_form_clear_validate(null, '#ITP_FORM_POMNG03010_DETAIL');
319
+			modifyObj.init(param);
320
+		}
321
+	},
322
+	empty: {
323
+		init: function() {
324
+			var _this = this;
325
+            this.push();
326
+            $(ORDMNG02010_GRID_EMPTY).on('click', function() {
327
+                _this.back();
328
+                listObj.itp_ORDMNG02010_param.gridSize = $.jgrid.defaults.rowNum;
329
+                $(ORDMNG02010_GRID_ID).setGridParam({'postData': JSON.stringify(listObj.itp_ORDMNG02010_param)}).trigger('reloadGrid');
330
+            });
331
+		},
332
+		push: function() {
333
+            let param = $('#ITP_FORM_ORDMNG02010_SEARCH').serializeObject();
334
+            listObj.itp_ORDMNG02010_param = param;
335
+        },
336
+        back: function() {
337
+            $('#ITP_FORM_ORDMNG02010_SERVICE_BRAND_TYPE').val(listObj.itp_ORDMNG02010_param.brandType);
338
+            $('#ITP_FORM_ORDMNG02010_SERVICE_ST_CD').val(listObj.itp_ORDMNG02010_param.stCd);
339
+            $('#ITP_FORM_ORDMNG02010_SEARCH_BRAND_NM').val(listObj.itp_ORDMNG02010_param.brandNm);
340
+        }
341
+	},
342
+	grid: {
343
+		init: function() {
344
+			// 데이터 없을때
345
+            listObj.empty.push();
346
+            this.search();
347
+		},
348
+		colModel: gridColModel.list,
349
+		search: function() {
350
+			pageObj.switchScreen('LIST');
351
+			this.unload();
352
+			this.load();
353
+		},
354
+		load: function() {
355
+            let param = $('#ITP_FORM_ORDMNG02010_SEARCH').serializeObject();
356
+            param.gridSize = $.jgrid.defaults.rowNum;
357
+            console.log(JSON.stringify(param));
358
+            var option = {
359
+            	gridId: ORDMNG02010_GRID_ID,
360
+            	colModel: gridColModel.list,
361
+            	param: param,
362
+            	url: DOMAIN + API_POMNG_INOUTMNG_SPPLY_TARGET_GRID_LIST,
363
+            	pager: ORDMNG02010_GRID_PAGER,
364
+            	multiselect: true,
365
+				multiboxonly : false,
366
+				rownumbers: false,/*
367
+            	onCellSelect: function(rowId, cellIdx, cellValue) {
368
+                    var cm = $(this).jqGrid('getGridParam', 'colModel');
369
+                    var colNm = cm[cellIdx].name;
370
+                    if (colNm === 'pchPodrUnqNo') {
371
+                        const pchPodrUnqNoVal = $(this).jqGrid('getCell', rowId, 'pchPodrUnqNo');
372
+                        const brandIdVal = $(this).jqGrid('getCell', rowId, 'brandId');
373
+                        const key = {pchPodrUnqNo: pchPodrUnqNoVal, brandId: brandIdVal};
374
+                        var param = $.param(key);
375
+                        modifyObj.init(param);
376
+                    }
377
+				},*/
378
+				loadComplete: function(data) {
379
+					console.log(data);
380
+                    itp_fn_grid_load_complete(data, ORDMNG02010_GRID_ID, true, 'number', 'ORDMNG02010', listObj.itp_ORDMNG02010_search, listObj.empty, true, data.gridRecords, true);
381
+				},
382
+				onPaging: function(action) {
383
+                    itp_fn_grid_paging(ORDMNG02010_GRID_ID, action, param);
384
+                }
385
+            };
386
+            itp_fn_grid_make_remote(option);
387
+		},
388
+		clearData: function() {
389
+			$(ORDMNG02010_GRID_ID).jqGrid('clearGridData', true);
390
+            $(ORDMNG02010_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
391
+            $(ORDMNG02010_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
392
+            $(ORDMNG02010_GRID_EMPTY).show();
393
+		},
394
+		unload: function() {
395
+			$.jgrid.gridUnload(ORDMNG02010_GRID_ID);
396
+		}
397
+	},
398
+	action: function() {
399
+		var _this = this;
400
+		// 출하창고 조회 버튼 클릭
401
+		$('#ITP_BTN_ORDMNG02010_SEARCH_WHS_ID').on('click', function() {
402
+			_this.popup();
403
+		});
404
+		// 출하창고 텍스트 삭제 버튼 클릭
405
+		$('#ITP_BTN_ORDMNG02010_DELETE_WHS_ID').on('click', function() {
406
+			$('#ITP_FORM_ORDMNG02010_SEARCH_WHS_NM').val('');
407
+			$('#ITP_FORM_ORDMNG02010_SEARCH_WHS_ID').val('');
408
+		});
409
+	},
410
+	popup: function() {
411
+		var popFn = this.callback.create;
412
+		
413
+		const key = {brandId:fn_make_user_info.get('brandId'),storeId:fn_make_user_info.get('storeId'),whsDvsn: ''};
414
+		fn_call_popup('biz', 'BIZPOP_WHS_LOCATION', '#ITP_ASIDE', popFn, key, 'S');
415
+	},
416
+	callback: {
417
+		create: function(rowDataPop) {
418
+			console.log(rowDataPop);
419
+			$('#ITP_FORM_ORDMNG02010_SEARCH_WHS_ID').val(rowDataPop.whsId);
420
+			$('#ITP_FORM_ORDMNG02010_SEARCH_WHS_NM').val(rowDataPop.whsNm);
421
+		}
422
+	}
423
+};
424
+
425
+
426
+/*수정화면 Object*/
427
+let modifyObj = {
428
+	init: function(param) {
429
+		console.log(param);
430
+		this.load(param);
431
+	},
432
+	itp_ORDMNG02010_param: {},
433
+	itp_ORDMNG02010_search: false,
434
+	button: {
435
+		cancel: function() {
436
+			listObj.grid.search();
437
+		}
438
+	},
439
+	empty: {
440
+		init: function() {
441
+            var _this = this;
442
+            this.push();
443
+            $(ORDMNG02010_VIEW_GRID_EMPTY).on('click', function() {
444
+                _this.back();
445
+                modifyObj.itp_ORDMNG02010_param.gridSize = $.jgrid.defaults.rowNum;
446
+                $(ORDMNG02010_DETAIL_GRID_ID).setGridParam({'postData': JSON.stringify(modifyObj.itp_ORDMNG02010_param)}).trigger('reloadGrid');
447
+            });
448
+        },
449
+        push: function() {
450
+            let param = $('#ITP_FORM_ORDMNG02010_DETAIL').serializeObject();
451
+            modifyObj.itp_ORDMNG02010_param = param;
452
+        },
453
+        back: function() {
454
+            $('#ITP_FORM_ORDMNG02010_SERVICE_BRAND_TYPE').val(modifyObj.itp_ORDMNG02010_param.brandType);
455
+            $('#ITP_FORM_ORDMNG02010_SERVICE_ST_CD').val(modifyObj.itp_ORDMNG02010_param.stCd);
456
+            $('#ITP_FORM_ORDMNG02010_SEARCH_BRAND_NM').val(modifyObj.itp_ORDMNG02010_param.brandNm);
457
+        }
458
+	},
459
+	load: function(param) {
460
+		fn_ajax_call(API_POMNG_INOUTMNG_INIT_SPPLY_INV, param, this.callback, 'GET');
461
+	},
462
+	callback: function(result) {
463
+		console.log(result);
464
+		pageObj.switchScreen('MODIFY');
465
+		$('#ITP_FORM_ORDMNG02010_DETAIL .fnBrandNm').text(result.brandNm);										// 브랜드
466
+		$('#ITP_FORM_ORDMNG02010_DETAIL .fnPchPodrUnqNo').text(result.invPoInfoList[0].pchPodrUnqNo);			// 발주번호
467
+		$('#ITP_FORM_ORDMNG02010_DETAIL .fnDlvRegDt').text(result.dlvRegDt);									// 납품서생성일자
468
+		$('#ITP_FORM_ORDMNG02010_DETAIL .fnPodrTotalAmt').text(result.podrTotalAmt);							// 발주총금액
469
+		$('#ITP_FORM_ORDMNG02010_DETAIL .fnWhsNm').text(result.whsNm);											// 발주총금액
470
+		$('#ITP_FORM_ORDMNG02010_DETAIL .fnDeliTelNo').text(result.deliTelNo);									// 납품장소연락처
471
+		$('#ITP_FORM_ORDMNG02010_DETAIL #ITP_FORM_ORDMNG02010_DETAIL_DLV_SCH_DT').val(result.dlvSchDt);			// 납품예정일
472
+		$('#ITP_FORM_ORDMNG02010_DETAIL .fnDlvRegDt').text(result.dlvRegDt);									// 납품요청일
473
+		$('#ITP_FORM_ORDMNG02010_DETAIL #ITP_FORM_ORDMNG02010_DETAIL_DLV_MGR_NM').val(result.dlvMgrNm);			// 납품담당자
474
+		$('#ITP_FORM_ORDMNG02010_DETAIL #ITP_FORM_ORDMNG02010_DETAIL_DLV_MGR_TEL_NO').val(result.dlvMgrTelNo);	// 납품담당자연락처
475
+
476
+		/*shmtQtyValue = function(value, colname) {
477
+			for(let i = 0; i < result.invPoInfoList.length; i++){
478
+				let podrQty = result.invPoInfoList[i].podrQty;
479
+				if(value > podrDty) {
480
+					return [false, '발주수량 이하 값 입력'];
481
+				} else {
482
+					return [true, ''];
483
+				}
484
+			}
485
+		};*/
486
+		
487
+		modifyObj.grid.init('MODIFY', result.invPoInfoList);
488
+		
489
+	},
490
+	grid: {
491
+		init: function(mode, gridData) {
492
+			this.mode = mode;
493
+			this.gridId = ORDMNG02010_DETAIL_GRID_ID;
494
+			this.gridList = ORDMNG02010_DETAIL_GRID_LIST;
495
+			this.gridEmpty = ORDMNG02010_DETAIL_GRID_EMPTY;
496
+			this.unload();
497
+			this.load(gridData);
498
+		},
499
+		mode: '',
500
+		colModel: gridColModel.detail,
501
+		load: function(gridData) {
502
+			var _this = this;
503
+			var option = {
504
+				gridId: _this.gridId,
505
+				colModel: gridColModel.detail,
506
+				data: gridData,
507
+				multiselect: true,
508
+				loadComplete: function(data) {
509
+					console.log(data);
510
+					itp_fn_grid_load_complete(data, ORDMNG02010_DETAIL_GRID_ID, true, 'number', 'ORDMNG02010', modifyObj.itp_ORDMNG02010_search, modifyObj.empty, true, data.gridRecords, true);
511
+				},
512
+				onCellSelect: function(rowId, cellIdx, cellValue) {
513
+					ORDMNG02010_GRID_LAST_ROW_ID = itp_fn_set_data_editable(rowId, cellIdx, ORDMNG02010_GRID_LAST_ROW_ID, ORDMNG02010_DETAIL_GRID_ID, ['actionId']);
514
+					itp_fn_form_event.onKeyup(ORDMNG02010_DETAIL_GRID_ID);
515
+				}
516
+			};
517
+			itp_fn_grid_make_local(option);
518
+		},
519
+		unload: function() {
520
+			$.jgrid.gridUnload(this.gridId);
521
+		}
522
+	}/*,
523
+	changeRows: function(gridRows) {
524
+		var modifyRows = [];
525
+		var chkColums = ['podrQty', 'expryDate', 'remark'];
526
+		$.each(this.rows, function(index, item) {
527
+			var row = gridRows[index];
528
+		});
529
+	}*/
530
+};

+ 2 - 2
src/main/webapp/js/app/vendinfo/ITP_VENDINFO01010.js

@@ -266,8 +266,8 @@ let pageObj = {
266 266
 					});
267 267
 					modifyObj.rows = data.gridRows;
268 268
 				},
269
-				onCellSelect: function(rowid, cellIdx, cellValue) {
270
-					VENDINFO01010_GRID_LAST_ROW_ID = itp_fn_set_data_editable(rowid, cellIdx, VENDINFO01010_GRID_LAST_ROW_ID, VENDINFO01010_DETAIL_GRID_ID, ['actionId']);
269
+				onCellSelect: function(rowId, cellIdx, cellValue) {
270
+					VENDINFO01010_GRID_LAST_ROW_ID = itp_fn_set_data_editable(rowId, cellIdx, VENDINFO01010_GRID_LAST_ROW_ID, VENDINFO01010_DETAIL_GRID_ID, ['actionId']);
271 271
 					itp_fn_form_event.onKeyup(VENDINFO01010_DETAIL_GRID_ID);
272 272
 				},
273 273
 			};