Browse Source

출하지시 임시저장

dwkim 2 years ago
parent
commit
5311ac2925
1 changed files with 57 additions and 69 deletions
  1. 57 69
      src/main/webapp/js/app/inoutmng/ITP_INOUTMNG01010.js

+ 57 - 69
src/main/webapp/js/app/inoutmng/ITP_INOUTMNG01010.js

@@ -27,19 +27,12 @@ let INOUTMNG01010_LAST_ROW_ID;
27
 
27
 
28
 
28
 
29
 /*API URL*/
29
 /*API URL*/
30
-let API_DETAIL_GRID_LIST 		= '/api/pomng/inoutmng/target-grid-list';	// 목록
30
+let API_DETAIL_GRID_LIST = '/api/pomng/inoutmng/target-grid-list';	// 목록
31
 
31
 
32
 
32
 
33
 /*화면 Grid ColModel*/
33
 /*화면 Grid ColModel*/
34
 const gridColModel = {
34
 const gridColModel = {
35
 	list: [
35
 	list: [
36
-		{
37
-			index: 'SEL_CHK', name: 'selChk',
38
-			label: ITP_MSG_LOCALE.label.selChk, //브랜드아이디
39
-			width: '13', fixed: false, align: 'center',
40
-			sortable: false, hidden: false,editable: true,
41
-			formatter: 'checkbox', edittype:"checkbox", editoptions :{value:'Y:N', defaultValue:'N'}
42
-		},
43
 		{
36
 		{
44
 			index: 'BRAND_ID', name: 'brandId',
37
 			index: 'BRAND_ID', name: 'brandId',
45
 			label: ITP_MSG_LOCALE.label.brandId, //브랜드아이디
38
 			label: ITP_MSG_LOCALE.label.brandId, //브랜드아이디
@@ -99,29 +92,29 @@ const gridColModel = {
99
 			label: ITP_MSG_LOCALE.label.unitAmt, //단가
92
 			label: ITP_MSG_LOCALE.label.unitAmt, //단가
100
 			width: '6', fixed: false, align: 'right',
93
 			width: '6', fixed: false, align: 'right',
101
 			sortable: false, hidden: false,
94
 			sortable: false, hidden: false,
102
-			formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
95
+			formatter: 'integer', formatoptions: { defaultValue: '', thousandsSeparator: ',' }
103
 		},
96
 		},
104
 		{
97
 		{
105
 			index: 'PODR_QTY', name: 'podrQty',
98
 			index: 'PODR_QTY', name: 'podrQty',
106
 			label: ITP_MSG_LOCALE.label.podrQty, //발주수량
99
 			label: ITP_MSG_LOCALE.label.podrQty, //발주수량
107
 			width: '10', fixed: false, align: 'right',
100
 			width: '10', fixed: false, align: 'right',
108
 			sortable: false, hidden: false,
101
 			sortable: false, hidden: false,
109
-			formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
102
+			formatter: 'integer', formatoptions: { defaultValue: '', thousandsSeparator: ',' }
110
 		},
103
 		},
111
 		{
104
 		{
112
 			index: 'SHMT_QTY', name: 'shmtQty',
105
 			index: 'SHMT_QTY', name: 'shmtQty',
113
 			label: ITP_MSG_LOCALE.label.shmtQty, //출고수량
106
 			label: ITP_MSG_LOCALE.label.shmtQty, //출고수량
114
 			width: '10', fixed: false, align: 'right',
107
 			width: '10', fixed: false, align: 'right',
115
 			sortable: true, editable: true, edittype: 'text',
108
 			sortable: true, editable: true, edittype: 'text',
116
-			editrules: {required: true, number:true},
117
-			formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
109
+			editrules: { required: true, number: true },
110
+			formatter: 'integer', formatoptions: { defaultValue: '', thousandsSeparator: ',' }
118
 		},
111
 		},
119
 		{
112
 		{
120
 			index: 'STCK_QTY', name: 'stckQty',
113
 			index: 'STCK_QTY', name: 'stckQty',
121
 			label: ITP_MSG_LOCALE.label.stckQty, //현 재고
114
 			label: ITP_MSG_LOCALE.label.stckQty, //현 재고
122
 			width: '10', fixed: false, align: 'right',
115
 			width: '10', fixed: false, align: 'right',
123
 			sortable: false, hidden: false,
116
 			sortable: false, hidden: false,
124
-			formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
117
+			formatter: 'integer', formatoptions: { defaultValue: '', thousandsSeparator: ',' }
125
 		},
118
 		},
126
 		{
119
 		{
127
 			index: 'EXPRY_YN', name: 'expryYn',
120
 			index: 'EXPRY_YN', name: 'expryYn',
@@ -140,15 +133,15 @@ const gridColModel = {
140
 			label: ITP_MSG_LOCALE.label.expryDate, //유통일자
133
 			label: ITP_MSG_LOCALE.label.expryDate, //유통일자
141
 			width: '20', fixed: false, align: 'center',
134
 			width: '20', fixed: false, align: 'center',
142
 			sortable: false, hidden: false,
135
 			sortable: false, hidden: false,
143
-			editable:true, sorttype:"date", 
144
-			editoptions : { dataInit : function(e) { $(e).datepicker( ITP_DATE_LANGUAGE ); } }
136
+			editable: true, sorttype: "date",
137
+			editoptions: { dataInit: function(e) { $(e).datepicker(ITP_DATE_LANGUAGE); } }
145
 		},
138
 		},
146
 		{
139
 		{
147
 			index: 'PODR_AMT', name: 'podrAmt',
140
 			index: 'PODR_AMT', name: 'podrAmt',
148
 			label: ITP_MSG_LOCALE.label.podrAmt, //발주금액
141
 			label: ITP_MSG_LOCALE.label.podrAmt, //발주금액
149
 			width: '10', fixed: false, align: 'right',
142
 			width: '10', fixed: false, align: 'right',
150
 			sortable: false, hidden: false,
143
 			sortable: false, hidden: false,
151
-			formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
144
+			formatter: 'integer', formatoptions: { defaultValue: '', thousandsSeparator: ',' }
152
 		},
145
 		},
153
 		{
146
 		{
154
 			index: 'DLV_REQ_DT', name: 'dlvReqDt',
147
 			index: 'DLV_REQ_DT', name: 'dlvReqDt',
@@ -181,7 +174,7 @@ const gridColModel = {
181
 
174
 
182
 /*목록화면 Object*/
175
 /*목록화면 Object*/
183
 let listObj = {
176
 let listObj = {
184
-	init: function () {
177
+	init: function() {
185
 		this.view();
178
 		this.view();
186
 		this.action();
179
 		this.action();
187
 		this.event.init();
180
 		this.event.init();
@@ -193,17 +186,17 @@ let listObj = {
193
 
186
 
194
 		// 공통코드 표시
187
 		// 공통코드 표시
195
 		$('select').each(function() {
188
 		$('select').each(function() {
196
-			if($(this).data('select-code')) {
189
+			if ($(this).data('select-code')) {
197
 				fn_make_select(CODE_LIST, $(this).data('select-code'), $(this).attr('id'));
190
 				fn_make_select(CODE_LIST, $(this).data('select-code'), $(this).attr('id'));
198
 			}
191
 			}
199
 		});
192
 		});
200
-		
193
+
201
 		var now = new Date();
194
 		var now = new Date();
202
 		$('#ITP_TAB_INOUTMNG01010 .input-group.date').datepicker(ITP_DATE_LANGUAGE);
195
 		$('#ITP_TAB_INOUTMNG01010 .input-group.date').datepicker(ITP_DATE_LANGUAGE);
203
 		$('#ITP_FORM_INOUTMNG01010_SEARCH_FROM_DT').datepicker('setDate', new Date(now.setDate(now.getDate())));
196
 		$('#ITP_FORM_INOUTMNG01010_SEARCH_FROM_DT').datepicker('setDate', new Date(now.setDate(now.getDate())));
204
-		$('#ITP_FORM_INOUTMNG01010_SEARCH_TO_DT').datepicker('setDate', new Date(now.setDate(now.getDate()+30)));
205
-		
206
-		
197
+		$('#ITP_FORM_INOUTMNG01010_SEARCH_TO_DT').datepicker('setDate', new Date(now.setDate(now.getDate() + 30)));
198
+
199
+
207
 	},
200
 	},
208
 	itp_INOUTMNG01010_search: false,
201
 	itp_INOUTMNG01010_search: false,
209
 	button: {
202
 	button: {
@@ -214,29 +207,22 @@ let listObj = {
214
 			param.gridSize = $.jgrid.defaults.rowNum;
207
 			param.gridSize = $.jgrid.defaults.rowNum;
215
 			param.gridPage = $.jgrid.defaults.page;
208
 			param.gridPage = $.jgrid.defaults.page;
216
 			param.sbrandId = fn_make_user_info.get('brandId');
209
 			param.sbrandId = fn_make_user_info.get('brandId');
217
-			$(INOUTMNG01010_GRID_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
210
+			$(INOUTMNG01010_GRID_ID).setGridParam({ 'postData': JSON.stringify(param) }).trigger('reloadGrid');
218
 		},
211
 		},
219
 		shmtout: function() {
212
 		shmtout: function() {
220
-			
221
-			
222
-			
223
-			
224
-			
213
+
225
 			console.log("search event");
214
 			console.log("search event");
226
 			listObj.itp_INOUTMNG01010_search = true;
215
 			listObj.itp_INOUTMNG01010_search = true;
227
 			let param = $('#ITP_FORM_INOUTMNG01010_SEARCH').serializeObject();
216
 			let param = $('#ITP_FORM_INOUTMNG01010_SEARCH').serializeObject();
228
 			param.gridSize = $.jgrid.defaults.rowNum;
217
 			param.gridSize = $.jgrid.defaults.rowNum;
229
 			param.gridPage = $.jgrid.defaults.page;
218
 			param.gridPage = $.jgrid.defaults.page;
230
 			param.sbrandId = fn_make_user_info.get('brandId');
219
 			param.sbrandId = fn_make_user_info.get('brandId');
231
-			$(INOUTMNG01010_GRID_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
232
-			
233
-			
234
-			
235
-			
236
-			
220
+			$(INOUTMNG01010_GRID_ID).setGridParam({ 'postData': JSON.stringify(param) }).trigger('reloadGrid');
221
+
222
+
237
 		}
223
 		}
238
 	},
224
 	},
239
-	action: function () {
225
+	action: function() {
240
 		var _this = this;
226
 		var _this = this;
241
 		// 출하창고 조회 버튼 클릭
227
 		// 출하창고 조회 버튼 클릭
242
 		$('#ITP_FORM_INOUTMNG01010_SEARCH_SHMT_WHS_NM').on('click', function() {
228
 		$('#ITP_FORM_INOUTMNG01010_SEARCH_SHMT_WHS_NM').on('click', function() {
@@ -248,9 +234,9 @@ let listObj = {
248
 			console.log("=================================");
234
 			console.log("=================================");
249
 			$('#ITP_FORM_INOUTMNG01010_SEARCH_SSHMT_WHS_NM').val('');
235
 			$('#ITP_FORM_INOUTMNG01010_SEARCH_SSHMT_WHS_NM').val('');
250
 			$('#ITP_FORM_INOUTMNG01010_SEARCH_SSHMTWHS_ID').val('');
236
 			$('#ITP_FORM_INOUTMNG01010_SEARCH_SSHMTWHS_ID').val('');
251
-			
237
+
252
 		});
238
 		});
253
-		
239
+
254
 		// 납품장소 조회 버튼 클릭
240
 		// 납품장소 조회 버튼 클릭
255
 		$('#ITP_FORM_INOUTMNG01010_SEARCH_WHS_NM').on('click', function() {
241
 		$('#ITP_FORM_INOUTMNG01010_SEARCH_WHS_NM').on('click', function() {
256
 			console.log("=================================");
242
 			console.log("=================================");
@@ -262,55 +248,55 @@ let listObj = {
262
 			$('#ITP_FORM_INOUTMNG01010_SEARCH_SWHS_NM').val('');
248
 			$('#ITP_FORM_INOUTMNG01010_SEARCH_SWHS_NM').val('');
263
 			$('#ITP_FORM_INOUTMNG01010_SEARCH_SWHS_ID').val('');
249
 			$('#ITP_FORM_INOUTMNG01010_SEARCH_SWHS_ID').val('');
264
 		});
250
 		});
265
-		
251
+
266
 	},
252
 	},
267
-	popup: function (arg) {
268
-		var popFn ;
253
+	popup: function(arg) {
254
+		var popFn;
269
 		// 팝업
255
 		// 팝업
270
 		if (arg == "S") {
256
 		if (arg == "S") {
271
 			popFn = this.callback.shmtwhs;
257
 			popFn = this.callback.shmtwhs;
272
 		} else {
258
 		} else {
273
 			popFn = this.callback.whs;
259
 			popFn = this.callback.whs;
274
 		}
260
 		}
275
-		
261
+
276
 		var whsDvsn = "";
262
 		var whsDvsn = "";
277
-		
263
+
278
 		if (arg == "S") {
264
 		if (arg == "S") {
279
 			whsDvsn = "W01";
265
 			whsDvsn = "W01";
280
 		} else {
266
 		} else {
281
 			whsDvsn = "W02";
267
 			whsDvsn = "W02";
282
 		}
268
 		}
283
-		
284
-		const key = {brandId:fn_make_user_info.get('brandId'),storeId:fn_make_user_info.get('storeId'), whsDvsn: whsDvsn};
285
-		
286
-		
287
-		 
269
+
270
+		const key = { brandId: fn_make_user_info.get('brandId'), storeId: fn_make_user_info.get('storeId'), whsDvsn: whsDvsn };
271
+
272
+
273
+
288
 		fn_call_popup('biz', 'BIZPOP_WHS_LOCATION', '#ITP_ASIDE', popFn, key, 'S');
274
 		fn_call_popup('biz', 'BIZPOP_WHS_LOCATION', '#ITP_ASIDE', popFn, key, 'S');
289
-		
275
+
290
 	},
276
 	},
291
 	callback: {
277
 	callback: {
292
 		shmtwhs: function(rowDataPop) {
278
 		shmtwhs: function(rowDataPop) {
293
 			console.log(rowDataPop);
279
 			console.log(rowDataPop);
294
-			if(rowDataPop) {
280
+			if (rowDataPop) {
295
 				$('#ITP_FORM_INOUTMNG01010_SEARCH_SSHMT_WHS_NM').val(rowDataPop.whsNm);
281
 				$('#ITP_FORM_INOUTMNG01010_SEARCH_SSHMT_WHS_NM').val(rowDataPop.whsNm);
296
 				$('#ITP_FORM_INOUTMNG01010_SEARCH_SSHMTWHS_ID').val(rowDataPop.whsId);
282
 				$('#ITP_FORM_INOUTMNG01010_SEARCH_SSHMTWHS_ID').val(rowDataPop.whsId);
297
 			}
283
 			}
298
-			
284
+
299
 		},
285
 		},
300
 		whs: function(rowDataPop) {
286
 		whs: function(rowDataPop) {
301
 			console.log(rowDataPop);
287
 			console.log(rowDataPop);
302
-			if(rowDataPop) {
288
+			if (rowDataPop) {
303
 				$('#ITP_FORM_INOUTMNG01010_SEARCH_SWHS_NM').val(rowDataPop.whsNm);
289
 				$('#ITP_FORM_INOUTMNG01010_SEARCH_SWHS_NM').val(rowDataPop.whsNm);
304
 				$('#ITP_FORM_INOUTMNG01010_SEARCH_SWHS_ID').val(rowDataPop.whsId);
290
 				$('#ITP_FORM_INOUTMNG01010_SEARCH_SWHS_ID').val(rowDataPop.whsId);
305
 			}
291
 			}
306
-			
292
+
307
 		}
293
 		}
308
 	},
294
 	},
309
 	event: {
295
 	event: {
310
-		init: function () {
296
+		init: function() {
311
 			this.button();
297
 			this.button();
312
 		},
298
 		},
313
-		button: function () {
299
+		button: function() {
314
 			// 버튼 클릭 이벤트
300
 			// 버튼 클릭 이벤트
315
 			$('button').each(function() {
301
 			$('button').each(function() {
316
 				var id = $(this).attr('id');
302
 				var id = $(this).attr('id');
@@ -318,22 +304,22 @@ let listObj = {
318
 					console.log("button");
304
 					console.log("button");
319
 					console.log(id);
305
 					console.log(id);
320
 					switch (id) {
306
 					switch (id) {
321
-						case 'ITP_BTN_INOUTMNG01010_SRH'					: listObj.button.search();		break;	// 조회 버튼 클릭
322
-						case 'ITP_BTN_INOUTMNG01010_OUT'					: listObj.button.shmtout();	break;	// 출하지시 버튼
323
-						
307
+						case 'ITP_BTN_INOUTMNG01010_SRH': listObj.button.search(); break;	// 조회 버튼 클릭
308
+						case 'ITP_BTN_INOUTMNG01010_OUT': listObj.button.shmtout(); break;	// 출하지시 버튼
309
+
324
 					}
310
 					}
325
 				});
311
 				});
326
 			});
312
 			});
327
-			
313
+
328
 			$('body').on('click', function(e) {
314
 			$('body').on('click', function(e) {
329
 				var gridId = INOUTMNG01010_GRID_ID.replace('#', '');
315
 				var gridId = INOUTMNG01010_GRID_ID.replace('#', '');
330
 				var rids = $(INOUTMNG01010_GRID_ID).jqGrid('getDataIDs');
316
 				var rids = $(INOUTMNG01010_GRID_ID).jqGrid('getDataIDs');
331
 				var last_row_id = rids[rids.length - 1];
317
 				var last_row_id = rids[rids.length - 1];
332
-				
333
-				itp_fn_grid_reset_selection(e, last_row_id, gridId, 'INOUTMNG01010');	
318
+
319
+				itp_fn_grid_reset_selection(e, last_row_id, gridId, 'INOUTMNG01010');
334
 			});
320
 			});
335
 
321
 
336
-			
322
+
337
 		}
323
 		}
338
 	},
324
 	},
339
 	empty: {
325
 	empty: {
@@ -343,7 +329,7 @@ let listObj = {
343
 			$(INOUTMNG01010_GRID_EMPTY).on('click', function() {
329
 			$(INOUTMNG01010_GRID_EMPTY).on('click', function() {
344
 				_this.back();
330
 				_this.back();
345
 				_this.itp_INOUTMNG01010_param.gridSize = $.jgrid.defaults.rowNum;
331
 				_this.itp_INOUTMNG01010_param.gridSize = $.jgrid.defaults.rowNum;
346
-				$(INOUTMNG01010_GRID_ID).setGridParam({'postData': JSON.stringify(_this.itp_INOUTMNG01010_param)}).trigger('reloadGrid');
332
+				$(INOUTMNG01010_GRID_ID).setGridParam({ 'postData': JSON.stringify(_this.itp_INOUTMNG01010_param) }).trigger('reloadGrid');
347
 			});
333
 			});
348
 		},
334
 		},
349
 		itp_INOUTMNG01010_param: {},
335
 		itp_INOUTMNG01010_param: {},
@@ -360,13 +346,13 @@ let listObj = {
360
 		}
346
 		}
361
 	},
347
 	},
362
 	grid: {
348
 	grid: {
363
-		init: function () {
349
+		init: function() {
364
 			// 데이터 없을때
350
 			// 데이터 없을때
365
 			listObj.empty.push();
351
 			listObj.empty.push();
366
 			itp_fn_jqgrid_resize(INOUTMNG01010_GRID_ID, INOUTMNG01010_GRID_LIST, 'lg');
352
 			itp_fn_jqgrid_resize(INOUTMNG01010_GRID_ID, INOUTMNG01010_GRID_LIST, 'lg');
367
 			itp_fn_fire_window_resize();
353
 			itp_fn_fire_window_resize();
368
 			this.search();
354
 			this.search();
369
-			
355
+
370
 		},
356
 		},
371
 		colModel: gridColModel.list,
357
 		colModel: gridColModel.list,
372
 		search: function() {
358
 		search: function() {
@@ -377,16 +363,18 @@ let listObj = {
377
 			let param = $('#ITP_FORM_INOUTMNG01010_SEARCH').serializeObject();
363
 			let param = $('#ITP_FORM_INOUTMNG01010_SEARCH').serializeObject();
378
 			param.gridSize = $.jgrid.defaults.rowNum;
364
 			param.gridSize = $.jgrid.defaults.rowNum;
379
 			param.sbrandId = fn_make_user_info.get('brandId');
365
 			param.sbrandId = fn_make_user_info.get('brandId');
380
-			
366
+
381
 			var option = {
367
 			var option = {
382
-				multiselect: false,
368
+				multiselect: true,
383
 				autowidth: true,
369
 				autowidth: true,
370
+				//cellEdit: true,
384
 				gridId: INOUTMNG01010_GRID_ID,
371
 				gridId: INOUTMNG01010_GRID_ID,
385
 				colModel: gridColModel.list,
372
 				colModel: gridColModel.list,
373
+				//viewrecords:false,
386
 				param: param,
374
 				param: param,
387
 				url: DOMAIN + API_DETAIL_GRID_LIST,
375
 				url: DOMAIN + API_DETAIL_GRID_LIST,
388
 				pager: INOUTMNG01010_GRID_PAGER,
376
 				pager: INOUTMNG01010_GRID_PAGER,
389
-				
377
+
390
 				onCellSelect: function(rowid, cellIdx, cellValue) {
378
 				onCellSelect: function(rowid, cellIdx, cellValue) {
391
 					INOUTMNG01010_LAST_ROW_ID = itp_fn_set_data_editable(rowid, cellIdx, INOUTMNG01010_LAST_ROW_ID, INOUTMNG01010_GRID_ID, ['pchPodrUnqNo']);
379
 					INOUTMNG01010_LAST_ROW_ID = itp_fn_set_data_editable(rowid, cellIdx, INOUTMNG01010_LAST_ROW_ID, INOUTMNG01010_GRID_ID, ['pchPodrUnqNo']);
392
 				},
380
 				},
@@ -401,10 +389,10 @@ let listObj = {
401
 		},
389
 		},
402
 		button: {
390
 		button: {
403
 		},
391
 		},
404
-		unload : function() {
392
+		unload: function() {
405
 			$.jgrid.gridUnload(INOUTMNG01010_GRID_ID);
393
 			$.jgrid.gridUnload(INOUTMNG01010_GRID_ID);
406
 		},
394
 		},
407
-		clearData : function() {
395
+		clearData: function() {
408
 			$(INOUTMNG01010_GRID_ID).jqGrid('clearGridData', true);
396
 			$(INOUTMNG01010_GRID_ID).jqGrid('clearGridData', true);
409
 			$(INOUTMNG01010_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
397
 			$(INOUTMNG01010_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
410
 			$(INOUTMNG01010_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
398
 			$(INOUTMNG01010_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);