Browse Source

출하지시 개발

dwkim 2 years ago
parent
commit
f28a8abd89

+ 16 - 12
src/main/webapp/app/inoutmng/INOUTMNG01010.html

@@ -5,6 +5,7 @@
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 7
 					<button type="button" id="ITP_BTN_INOUTMNG01010_SRH" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon "></i>&nbsp;&nbsp;조회&nbsp;&nbsp;</button>
8
+					<button type="button" id="ITP_BTN_INOUTMNG01010_OUC" class="btn btn-success btn-sm OUC" style="display: inline-block;"><i class="glyphicon "></i>&nbsp;&nbsp;출하생성&nbsp;&nbsp;</button>
8 9
 					<button type="button" id="ITP_BTN_INOUTMNG01010_OUT" class="btn btn-success btn-sm OUD" style="display: inline-block;"><i class="glyphicon "></i>&nbsp;&nbsp;출하지시&nbsp;&nbsp;</button>
9 10
 					<button type="button" id="ITP_BTN_INOUTMNG01010_CANCELLIST" class="btn btn-warning btn-sm PRB"><i class="glyphicon "></i>&nbsp;&nbsp;취소/목록&nbsp;&nbsp;</button>
10 11
 				</div>
@@ -15,6 +16,8 @@
15 16
 						<div class="itp_srh_border fix">
16 17
 							<div class="col-xs-12">
17 18
 								<form id="ITP_FORM_INOUTMNG01010_SEARCH" class="form-horizontal">
19
+								   <input type="hidden" id="ITP_FORM_INOUTMNG01010_DETAIL_SBRAND_ID" class="form-control itp_input" name="sbrandId" />
20
+								
18 21
 									<div class="form-group">
19 22
 										<div class="col-xs-2 itp_ip itp_noMar">
20 23
 											<select id="ITP_FORM_INOUTMNG01010_SEARCH_DLV_REQ_DT" class="form-control itp_input" name="serviceDlvReqDt">
@@ -64,11 +67,12 @@
64 67
 						</div>
65 68
 					</div>
66 69
 				</div>
67
-				<div id="ITP_AJAX_INOUTMNG01010_VIEW_CONTAINER" >
70
+				<div id="ITP_AJAX_INOUTMNG01010_DETAIL_CONTAINER" >
68 71
 					<div class="itp_form itp_type1 fix">
69 72
 						<div class="col-xs-12">
70
-							<form id="ITP_FORM_INOUTMNG01010_VIEW" class="form-horizontal">
71
-								<input type="hidden" id="ITP_FORM_INOUTMNG01010_VIEW_" name="" value="">
73
+							<form id="ITP_FORM_INOUTMNG01010_DETAIL" class="form-horizontal">
74
+								<input type="hidden" id="ITP_FORM_INOUTMNG01010_DETAIL_" name="" value="">
75
+								<input type="hidden" id="ITP_FORM_INOUTMNG01010_DETAIL_BRAND_ID" class="form-control itp_input" name="brandId" />
72 76
 								<section class="itp_form_sec">
73 77
 									<h4 class="itp_form_tit">출하지시 기본정보</h4>
74 78
 									<div class="itp_form_in">
@@ -81,8 +85,8 @@
81 85
 											</div>
82 86
 											<label class="col-xs-2 itp_lb">납품일자 *</label>
83 87
 											<div class="col-xs-4 itp_ip">
84
-												<div class="col-xs-7 itp_in">
85
-													<input type="date" id="ITP_FORM_INOUTMNG01010_VIEW_DLV_DT" data-check-required="empty" class="form-control itp_input" name="dlvDt" value="">
88
+												<div class="input-daterange input-group date">
89
+													<input type="text" id="ITP_FORM_INOUTMNG01010_DETAIL_DLV_SCH_DT" class="form-control itp_input" name="dlvSchDt" value="">
86 90
 												</div>
87 91
 											</div>
88 92
 										</div>
@@ -90,13 +94,13 @@
90 94
 											<label class="col-xs-2 itp_lb">납품담당자 *</label>
91 95
 											<div class="col-xs-4 itp_ip">
92 96
 												<div class="col-xs-7 itp_in">
93
-													<input type="text" id="ITP_FORM_INOUTMNG01010_VIEW_DLV_MGR_NM" data-check-required="empty" class="form-control itp_input" name="dlvMgrNm" value="">
97
+													<input type="text" id="ITP_FORM_INOUTMNG01010_DETAIL_DLV_MGR_NM" data-check-required="empty" class="form-control itp_input" name="dlvMgrNm" value="">
94 98
 												</div>
95 99
 											</div>
96 100
 											<label class="col-xs-2 itp_lb">납품담당자 전화번호*</label>
97 101
 											<div class="col-xs-4 itp_ip">
98 102
 												<div class="col-xs-7 itp_in">
99
-													<input type="text" id="ITP_FORM_INOUTMNG01010_VIEW_DLV_MGR_TEL_NO" data-check-required="empty" class="form-control itp_input" name="dlvMgrTelNo" value="">
103
+													<input type="text" id="ITP_FORM_INOUTMNG01010_DETAIL_DLV_MGR_TEL_NO" data-check-required="empty" class="form-control itp_input" name="dlvMgrTelNo" value="">
100 104
 												</div>
101 105
 											</div>
102 106
 										</div>
@@ -109,11 +113,11 @@
109 113
 						<div class="itp_table_head fix" style="background:#f5f5f5;">
110 114
 							<h4 class="itp_table_tit">출하지시 품목</h4>
111 115
 						</div>
112
-						<div id="ITP_INOUTMNG01010_VIEW_jqGrid_list" class="itp_tb_list">
113
-							<div id="ITP_INOUTMNG01010_VIEW_jqGridView" class="itp_views fix"></div>
114
-							<table id="ITP_INOUTMNG01010_VIEW_jqGrid"></table>
115
-							<div id="ITP_INOUTMNG01010_VIEW_jqGridPager"></div>
116
-							<div id="ITP_INOUTMNG01010_VIEW_jqGridEmpty" class="itp_no_data"></div>
116
+						<div id="ITP_INOUTMNG01010_DETAIL_jqGrid_list" class="itp_tb_list">
117
+							<div id="ITP_INOUTMNG01010_DETAIL_jqGridView" class="itp_views fix"></div>
118
+							<table id="ITP_INOUTMNG01010_DETAIL_jqGrid"></table>
119
+							<div id="ITP_INOUTMNG01010_DETAIL_jqGridPager"></div>
120
+							<div id="ITP_INOUTMNG01010_DETAIL_jqGridEmpty" class="itp_no_data"></div>
117 121
 						</div>
118 122
 					</div>
119 123
 				</div>

+ 398 - 87
src/main/webapp/js/app/inoutmng/ITP_INOUTMNG01010.js

@@ -1,6 +1,6 @@
1 1
 require(['config'], function() {
2 2
 	require([], function($) {
3
-		listObj.init();
3
+		pageObj.init();
4 4
 	});
5 5
 });
6 6
 
@@ -11,9 +11,8 @@ require(['config'], function() {
11 11
  * const gridColModel = {}	: 화면 Grid Object			*
12 12
  * let pageObj = {}			: 화면공통 Object			*
13 13
  * let listObj = {}			: 목록화면 Object			*
14
- * let viewObj = {}			: 상세화면 Object			*
15 14
  * let modifyObj = {}		: 수정화면 Object			*
16
- * let createObj = {}		: 신규화면 Object			*
15
+ 
17 16
  *******************************************************/
18 17
 
19 18
 /*화면 변수*/
@@ -22,17 +21,158 @@ const INOUTMNG01010_GRID_LIST = '#ITP_INOUTMNG01010_jqGrid_list';
22 21
 const INOUTMNG01010_GRID_PAGER = '#ITP_INOUTMNG01010_jqGridPager';
23 22
 const INOUTMNG01010_GRID_EMPTY = '#ITP_INOUTMNG01010_jqGridEmpty';
24 23
 
25
-let ITP_FORM_INOUTMNG01010_DETAIL_IS_WRITING = false;
26
-let INOUTMNG01010_LAST_ROW_ID;
24
+const INOUTMNG01010_DETAIL_GRID_ID = '#ITP_INOUTMNG01010_DETAIL_jqGrid';
25
+const INOUTMNG01010_DETAIL_GRID_LIST = '#ITP_INOUTMNG01010_DETAIL_jqGrid_list';
26
+const INOUTMNG01010_DETAIL_GRID_PAGER = '#ITP_INOUTMNG01010_DETAIL_jqGridPager';
27
+const INOUTMNG01010_DETAIL_GRID_EMPTY = '#ITP_INOUTMNG01010_DETAIL_jqGridEmpty';
28
+
29
+
30
+//let ITP_FORM_INOUTMNG01010_DETAIL_IS_WRITING = false;
31
+let INOUTMNG01010_GRID_LAST_ROW_ID;
27 32
 
28 33
 
29 34
 /*API URL*/
30 35
 let API_DETAIL_GRID_LIST = '/api/pomng/inoutmng/target-grid-list';	// 목록
31
-
36
+let API_DETAIL_SAVE 	 = '/api/pomng/inoutmng/save-inst-shmt';			// 출하지시
32 37
 
33 38
 /*화면 Grid ColModel*/
34 39
 const gridColModel = {
35 40
 	list: [
41
+		{
42
+			index: 'BRAND_ID', name: 'brandId',
43
+			label: ITP_MSG_LOCALE.label.brandId, //브랜드아이디
44
+			width: '13', fixed: false, align: 'center',
45
+			sortable: false, hidden: true
46
+		},
47
+		{
48
+			index: 'BRAND_NM', name: 'brandNm',
49
+			label: ITP_MSG_LOCALE.label.brandNm, //브랜드명
50
+			width: '10', fixed: false, align: 'center',
51
+			sortable: false, hidden: false
52
+		},
53
+		{
54
+			index: 'PCH_PODR_UNQ_NO', name: 'pchPodrUnqNo',
55
+			label: ITP_MSG_LOCALE.label.pchPodrUnqNo, //구매발주번호
56
+			width: '10', fixed: false, align: 'center',
57
+			sortable: false, hidden: false
58
+		},
59
+		{
60
+			index: 'PCH_PODR_DTL_NO', name: 'pchPodrDtlNo',
61
+			label: ITP_MSG_LOCALE.label.pchPodrDtlNo, //구매발주항번
62
+			width: '10', fixed: false, align: 'center',
63
+			sortable: false, hidden: false
64
+		},
65
+		{
66
+			index: 'ITEM_ID', name: 'itemId',
67
+			label: ITP_MSG_LOCALE.label.itemId, //품목아이디
68
+			width: '10', fixed: false, align: 'center',
69
+			sortable: false, hidden: false
70
+		},
71
+		{
72
+			index: 'ITEM_NM', name: 'itemNm',
73
+			label: ITP_MSG_LOCALE.label.itemNm, //품목명
74
+			width: '10', fixed: false, align: 'left',
75
+			sortable: false, hidden: false
76
+		},
77
+		{
78
+			index: 'WHS_ID', name: 'whsId',
79
+			label: ITP_MSG_LOCALE.label.whsId, //납품창고아이디
80
+			width: '13', fixed: false, align: 'center',
81
+			sortable: false, hidden: true
82
+		},
83
+		{
84
+			index: 'WHS_NM', name: 'whsNm',
85
+			label: ITP_MSG_LOCALE.label.whsNm, //납품창고명
86
+			width: '15', fixed: false, align: 'left',
87
+			sortable: false, hidden: false
88
+		},
89
+		{
90
+			index: 'LOCATION', name: 'location',
91
+			label: ITP_MSG_LOCALE.label.location, //납품LOCATION
92
+			width: '15', fixed: false, align: 'center',
93
+			sortable: false, hidden: true
94
+		},
95
+		{
96
+			index: 'UNIT_AMT', name: 'unitAmt',
97
+			label: ITP_MSG_LOCALE.label.unitAmt, //단가
98
+			width: '6', fixed: false, align: 'right',
99
+			sortable: false, hidden: false,
100
+			formatter: 'integer', formatoptions: { defaultValue: '', thousandsSeparator: ',' }
101
+		},
102
+		{
103
+			index: 'PODR_QTY', name: 'podrQty',
104
+			label: ITP_MSG_LOCALE.label.podrQty, //발주수량
105
+			width: '10', fixed: false, align: 'right',
106
+			sortable: false, hidden: false,
107
+			formatter: 'integer', formatoptions: { defaultValue: '', thousandsSeparator: ',' }
108
+		},
109
+		{
110
+			index: 'SHMT_QTY', name: 'shmtQty',
111
+			label: ITP_MSG_LOCALE.label.shmtQty, //출고수량
112
+			width: '10', fixed: false, align: 'right',
113
+			sortable: true, editable: false, edittype: 'text',
114
+			hidden: true
115
+		},
116
+		{
117
+			index: 'STCK_QTY', name: 'stckQty',
118
+			label: ITP_MSG_LOCALE.label.stckQty, //현 재고
119
+			width: '10', fixed: false, align: 'right',
120
+			sortable: false, hidden: false,
121
+			formatter: 'integer', formatoptions: { defaultValue: '', thousandsSeparator: ',' }
122
+		},
123
+		{
124
+			index: 'EXPRY_YN', name: 'expryYn',
125
+			label: ITP_MSG_LOCALE.label.expryYn, //유통기한여부
126
+			width: '10', fixed: false, align: 'center',
127
+			sortable: false, hidden: false
128
+		},
129
+		{
130
+			index: 'EXPRY_PERIOD', name: 'expryPeriod',
131
+			label: ITP_MSG_LOCALE.label.expryPeriod, //유통기한기간
132
+			width: '10', fixed: false, align: 'center',
133
+			sortable: false, hidden: true
134
+		},
135
+		{
136
+			index: 'EXPRY_DATE', name: 'expryDate',
137
+			label: ITP_MSG_LOCALE.label.expryDate, //유통일자
138
+			width: '20', fixed: false, align: 'center',
139
+			sortable: false, hidden: true,
140
+			editable: false, sorttype: "date",
141
+			editoptions: { dataInit: function(e) { $(e).datepicker(ITP_DATE_LANGUAGE); } }
142
+		},
143
+		{
144
+			index: 'PODR_AMT', name: 'podrAmt',
145
+			label: ITP_MSG_LOCALE.label.podrAmt, //발주금액
146
+			width: '10', fixed: false, align: 'right',
147
+			sortable: false, hidden: false,
148
+			formatter: 'integer', formatoptions: { defaultValue: '', thousandsSeparator: ',' }
149
+		},
150
+		{
151
+			index: 'DLV_REQ_DT', name: 'dlvReqDt',
152
+			label: ITP_MSG_LOCALE.label.dlvReqDt, //납품요청일
153
+			width: '10', fixed: false, align: 'center',
154
+			sortable: false, hidden: false
155
+		},
156
+		{
157
+			index: 'SHMT_WHS_ID', name: 'shmtWhsId',
158
+			label: ITP_MSG_LOCALE.label.shmtWhsId, //출고창고아이디
159
+			width: '10', fixed: false, align: 'right',
160
+			sortable: false, hidden: true
161
+		},
162
+		{
163
+			index: 'SHMT_LOCATION', name: 'shmtLocation',
164
+			label: ITP_MSG_LOCALE.label.shmtLocation, //출고LOCATION
165
+			width: '10', fixed: false, align: 'center',
166
+			sortable: false, hidden: true
167
+		},
168
+		{
169
+			index: 'SHMT_WHS_NM', name: 'shmtWhsNm',
170
+			label: ITP_MSG_LOCALE.label.shmtWhsNm, //출고창고명
171
+			width: '10', fixed: false, align: 'center',
172
+			sortable: false, hidden: false
173
+		}
174
+	],
175
+	detail: [
36 176
 		{
37 177
 			index: 'BRAND_ID', name: 'brandId',
38 178
 			label: ITP_MSG_LOCALE.label.brandId, //브랜드아이디
@@ -170,68 +310,53 @@ const gridColModel = {
170 310
 	]
171 311
 };
172 312
 
173
-
174
-
175
-/*목록화면 Object*/
176
-let listObj = {
177
-	init: function() {
178
-		this.view();
179
-		this.action();
313
+/*화면공통 Object*/
314
+let pageObj = {
315
+	init: function () {
316
+		this.ui.init();
180 317
 		this.event.init();
181
-		this.grid.init();
182
-	},
183
-	view: function() {
184
-		// 버튼 권한설정
185
-		fn_proc_btn_auth('INOUTMNG01010');
186
-
187
-		// 공통코드 표시
188
-		$('select').each(function() {
189
-			if ($(this).data('select-code')) {
190
-				fn_make_select(CODE_LIST, $(this).data('select-code'), $(this).attr('id'));
191
-			}
192
-		});
193
-
194
-		var now = new Date();
195
-		$('#ITP_TAB_INOUTMNG01010 .input-group.date').datepicker(ITP_DATE_LANGUAGE);
196
-		$('#ITP_FORM_INOUTMNG01010_SEARCH_FROM_DT').datepicker('setDate', new Date(now.setDate(now.getDate())));
197
-		$('#ITP_FORM_INOUTMNG01010_SEARCH_TO_DT').datepicker('setDate', new Date(now.setDate(now.getDate() + 30)));
198
-
199
-
318
+		this.action();
200 319
 	},
201
-	itp_INOUTMNG01010_search: false,
202
-	button: {
203
-		search: function() {
204
-			console.log("search event");
205
-			listObj.itp_INOUTMNG01010_search = true;
206
-			let param = $('#ITP_FORM_INOUTMNG01010_SEARCH').serializeObject();
207
-			param.gridSize = $.jgrid.defaults.rowNum;
208
-			param.gridPage = $.jgrid.defaults.page;
209
-			param.sbrandId = fn_make_user_info.get('brandId');
210
-			$(INOUTMNG01010_GRID_ID).setGridParam({ 'postData': JSON.stringify(param) }).trigger('reloadGrid');
320
+	ui: {
321
+		init: function () {
322
+			this.view();
323
+			this.grid();
324
+			this.ready();
211 325
 		},
212
-		shmtout: function() {
213
-
214
-			console.log("search event");
215
-			listObj.itp_INOUTMNG01010_search = true;
216
-			let param = $('#ITP_FORM_INOUTMNG01010_SEARCH').serializeObject();
217
-			param.gridSize = $.jgrid.defaults.rowNum;
218
-			param.gridPage = $.jgrid.defaults.page;
219
-			param.sbrandId = fn_make_user_info.get('brandId');
220
-			$(INOUTMNG01010_GRID_ID).setGridParam({ 'postData': JSON.stringify(param) }).trigger('reloadGrid');
221
-
326
+		view: function() {
327
+			// 버튼 권한설정
328
+			fn_proc_btn_auth('INOUTMNG01010');
329
+
330
+			// 공통코드 표시
331
+			$('select').each(function() {
332
+				if($(this).data('select-code')) {
333
+					fn_make_select(CODE_LIST, $(this).data('select-code'), $(this).attr('id'));
334
+				}
335
+			});
222 336
 
337
+			// 조회일자 지정
338
+			var now = new Date();
339
+			$('#ITP_TAB_INOUTMNG01010 .input-group.date').datepicker(ITP_DATE_LANGUAGE);
340
+			$('#ITP_FORM_INOUTMNG01010_SEARCH_FROM_DT').datepicker('setDate', new Date(now.setDate(now.getDate())));
341
+			$('#ITP_FORM_INOUTMNG01010_SEARCH_TO_DT').datepicker('setDate', new Date(now.setDate(now.getDate() + 30)));
342
+		},
343
+		grid: function() {
344
+			itp_fn_jqgrid_resize(INOUTMNG01010_GRID_ID, INOUTMNG01010_GRID_LIST, 'lg');
345
+			listObj.empty.init();
346
+			itp_fn_fire_window_resize();
347
+		},
348
+		ready: function() {
349
+			listObj.init();
223 350
 		}
224 351
 	},
225
-	action: function() {
352
+	action: function () {
226 353
 		var _this = this;
227 354
 		// 출하창고 조회 버튼 클릭
228 355
 		$('#ITP_FORM_INOUTMNG01010_SEARCH_SHMT_WHS_NM').on('click', function() {
229
-			console.log("=================================");
230 356
 			_this.popup('S');
231 357
 		});
232 358
 		// 출하창고 텍스트 삭제 버튼 클릭
233 359
 		$('#ITP_FORM_INOUTMNG01010_DELETE_SHMT_WHS_NM').on('click', function() {
234
-			console.log("=================================");
235 360
 			$('#ITP_FORM_INOUTMNG01010_SEARCH_SSHMT_WHS_NM').val('');
236 361
 			$('#ITP_FORM_INOUTMNG01010_SEARCH_SSHMTWHS_ID').val('');
237 362
 
@@ -239,18 +364,15 @@ let listObj = {
239 364
 
240 365
 		// 납품장소 조회 버튼 클릭
241 366
 		$('#ITP_FORM_INOUTMNG01010_SEARCH_WHS_NM').on('click', function() {
242
-			console.log("=================================");
243 367
 			_this.popup('W');
244 368
 		});
245 369
 		// 납품장소 텍스트 삭제 버튼 클릭
246 370
 		$('#ITP_FORM_INOUTMNG01010_DELETE_WHS_NM').on('click', function() {
247
-			console.log("=================================");
248 371
 			$('#ITP_FORM_INOUTMNG01010_SEARCH_SWHS_NM').val('');
249 372
 			$('#ITP_FORM_INOUTMNG01010_SEARCH_SWHS_ID').val('');
250 373
 		});
251
-
252 374
 	},
253
-	popup: function(arg) {
375
+	popup: function (arg) {
254 376
 		var popFn;
255 377
 		// 팝업
256 378
 		if (arg == "S") {
@@ -272,11 +394,11 @@ let listObj = {
272 394
 
273 395
 
274 396
 		fn_call_popup('biz', 'BIZPOP_WHS_LOCATION', '#ITP_ASIDE', popFn, key, 'S');
275
-
397
+		
398
+		
276 399
 	},
277 400
 	callback: {
278 401
 		shmtwhs: function(rowDataPop) {
279
-			console.log(rowDataPop);
280 402
 			if (rowDataPop) {
281 403
 				$('#ITP_FORM_INOUTMNG01010_SEARCH_SSHMT_WHS_NM').val(rowDataPop.whsNm);
282 404
 				$('#ITP_FORM_INOUTMNG01010_SEARCH_SSHMTWHS_ID').val(rowDataPop.whsId);
@@ -284,7 +406,6 @@ let listObj = {
284 406
 
285 407
 		},
286 408
 		whs: function(rowDataPop) {
287
-			console.log(rowDataPop);
288 409
 			if (rowDataPop) {
289 410
 				$('#ITP_FORM_INOUTMNG01010_SEARCH_SWHS_NM').val(rowDataPop.whsNm);
290 411
 				$('#ITP_FORM_INOUTMNG01010_SEARCH_SWHS_ID').val(rowDataPop.whsId);
@@ -293,33 +414,147 @@ let listObj = {
293 414
 		}
294 415
 	},
295 416
 	event: {
296
-		init: function() {
417
+		init: function () {
297 418
 			this.button();
298 419
 		},
299
-		button: function() {
420
+		button: function () {
300 421
 			// 버튼 클릭 이벤트
301 422
 			$('button').each(function() {
302 423
 				var id = $(this).attr('id');
303 424
 				$(this).on('click', function() {
304
-					console.log("button");
305
-					console.log(id);
306 425
 					switch (id) {
307
-						case 'ITP_BTN_INOUTMNG01010_SRH': listObj.button.search(); break;	// 조회 버튼 클릭
308
-						case 'ITP_BTN_INOUTMNG01010_OUT': listObj.button.shmtout(); break;	// 출하지시 버튼
309
-
426
+						case 'ITP_BTN_INOUTMNG01010_SRH'				: listObj.button.search();			break;	// 조회 버튼 클릭
427
+						case 'ITP_BTN_INOUTMNG01010_OUC'				: listObj.button.shmtcreat();		break;	// 출하생성 버튼
428
+						case 'ITP_BTN_INOUTMNG01010_OUT'				: modifyObj.button.save(); 			break;	// 출하지시 버튼
429
+						case 'ITP_BTN_INOUTMNG01010_CANCELLIST'			: modifyObj.button.cancel(); 		break;	// 취소/목록 버튼
310 430
 					}
311 431
 				});
312 432
 			});
313
-
433
+			
314 434
 			$('body').on('click', function(e) {
315
-				var gridId = INOUTMNG01010_GRID_ID.replace('#', '');
316
-				var rids = $(INOUTMNG01010_GRID_ID).jqGrid('getDataIDs');
435
+				
436
+				var gridId = (INOUTMNG01010_DETAIL_GRID_ID).replace('#', '');
437
+				var rids = $(INOUTMNG01010_DETAIL_GRID_ID).jqGrid('getDataIDs');
317 438
 				var last_row_id = rids[rids.length - 1];
318
-
319
-				itp_fn_grid_reset_selection(e, last_row_id, gridId, 'INOUTMNG01010');
439
+				
440
+				itp_fn_grid_reset_selection(e, last_row_id, gridId, 'INOUTMNG01010_DETAIL');	
320 441
 			});
321 442
 
443
+		}
444
+	},
445
+	switchScreen: function(mode) {
446
+		$('.itp_det_head').find('button[id^="ITP_BTN_INOUTMNG01010_"]').each(function(i) {
447
+			$(this).hide();
448
+		});
449
+		$('#ITP_TAB_INOUTMNG01010').find('div[id$="_CONTAINER"]').each(function(i) {
450
+			$(this).hide();
451
+		});
452
+		if(mode == 'LIST') { // 목록
453
+			$('#ITP_AJAX_INOUTMNG01010_LIST_CONTAINER').show();
454
+			fn_show_btn_auth_array(['#ITP_BTN_INOUTMNG01010_SRH', '#ITP_BTN_INOUTMNG01010_OUC']);
455
+			$('#ITP_FORM_INOUTMNG01010_DETAIL_SBRAND_ID').val(fn_make_user_info.get('brandId'));
456
+		} else if(mode == 'DETAIL') { // 출하지시 상세
457
+			$('#ITP_AJAX_INOUTMNG01010_DETAIL_CONTAINER').show();
458
+			fn_show_btn_auth_array(['#ITP_BTN_INOUTMNG01010_OUT', '#ITP_BTN_INOUTMNG01010_CANCELLIST']);
459
+			$('#ITP_FORM_INOUTMNG01010_DETAIL_BRAND_ID').val(fn_make_user_info.get('brandId'));
460
+			
461
+			//pageObj.grid.init(param);
462
+		} 
463
+	},
464
+	grid: {
465
+		init: function(param) {
466
+			this.gridId = INOUTMNG01010_DETAIL_GRID_ID;
467
+			this.gridList = INOUTMNG01010_DETAIL_GRID_LIST;
468
+			this.gridEmpty = INOUTMNG01010_DETAIL_GRID_EMPTY;
469
+			var now = new Date();
470
+			$('#ITP_TAB_INOUTMNG01010 .input-group.date').datepicker(ITP_DATE_LANGUAGE);
471
+			$('#ITP_FORM_INOUTMNG01010_DETAIL_DLV_SCH_DT').datepicker('setDate', new Date(param.dlvSchDt));
472
+			$('#ITP_FORM_INOUTMNG01010_DETAIL .fnBrandNm').text(param.brandNm);
473
+			
474
+			this.gridRows = param.recordData;
475
+			this.unload();
476
+			this.load(param.recordData);
477
+			
478
+		},
479
+		gridId: '',
480
+		button: {},
481
+		gridList: '',
482
+		gridEmpty: '',
483
+		gridRows: '',
484
+		load: function(gridRows) {
485
+			
486
+			var _this = this;
487
+			var option = {
488
+				gridId: _this.gridId,
489
+				colModel: gridColModel.detail,
490
+				data: gridRows,
491
+				loadComplete: function(data) {
492
+					$(INOUTMNG01010_DETAIL_GRID_LIST).find('.ui-jqgrid .ui-jqgrid-bdiv').css('overflow-x', 'hidden');
493
+					data.records === 0 ? _this.clearData(mode) : $(INOUTMNG01010_DETAIL_GRID_EMPTY).hide();
494
+					
495
+				},
496
+				onCellSelect: function(rowid, cellIdx, cellValue) {
497
+					INOUTMNG01010_GRID_LAST_ROW_ID = itp_fn_set_data_editable(rowid, cellIdx, INOUTMNG01010_GRID_LAST_ROW_ID, _this.gridId, ['pchReqDtlNo']);
498
+				}
499
+			};
500
+			itp_fn_grid_make_local(option);
501
+		},
502
+		clearData : function(mode) {
503
+			$(INOUTMNG01010_DETAIL_GRID_ID).jqGrid('clearGridData', true);
504
+			$(INOUTMNG01010_DETAIL_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
505
+			$(INOUTMNG01010_DETAIL_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
506
+			$(INOUTMNG01010_DETAIL_GRID_EMPTY).show();
507
+		},
508
+		unload : function() {
509
+			$.jgrid.gridUnload(this.gridId);
510
+		}
511
+	}
512
+};
322 513
 
514
+/*목록화면 Object*/
515
+let listObj = {
516
+	init: function () {
517
+		this.grid.init();
518
+	},
519
+	itp_INOUTMNG01010_search: false,
520
+	button: {
521
+		search: function() {
522
+			listObj.itp_INOUTMNG01010_search = true;
523
+			let param = $('#ITP_FORM_INOUTMNG01010_SEARCH').serializeObject();
524
+			param.gridSize = $.jgrid.defaults.rowNum;
525
+			param.gridPage = $.jgrid.defaults.page;
526
+			$(INOUTMNG01010_GRID_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
527
+		},
528
+		shmtcreat: function() {
529
+			//선택되어진 row 값 전송할예정
530
+			let gridUpdateData = [];
531
+			const rowKey = $(INOUTMNG01010_GRID_ID).getGridParam('selrow');
532
+			if (!rowKey) {
533
+				return;
534
+		    }
535
+
536
+			var selectedIds = $(INOUTMNG01010_GRID_ID).getGridParam('selarrrow');
537
+			
538
+			var brandNm = "";
539
+			var maxDlvSchDt = "";
540
+			
541
+			for (var i=selectedIds.length-1; i>=0; i--) {
542
+				var rowData = $(INOUTMNG01010_GRID_ID).jqGrid('getRowData', selectedIds[i]);
543
+				
544
+				if (rowData.)
545
+				
546
+				gridUpdateData.push(rowData);	
547
+				if (rowData.dlvReqDt > maxDlvSchDt) {
548
+					maxDlvSchDt = rowData.dlvReqDt;
549
+				}
550
+				sbrandNm =rowData.brandNm;
551
+			}
552
+			
553
+			let param = {brandNm: sbrandNm, dlvSchDt: maxDlvSchDt };
554
+			param.recordData = gridUpdateData;
555
+			pageObj.switchScreen('DETAIL');
556
+			itp_fn_form_clear_validate(null, '#ITP_FORM_INOUTMNG01010_DETAIL');
557
+			pageObj.grid.init(param);
323 558
 		}
324 559
 	},
325 560
 	empty: {
@@ -329,7 +564,7 @@ let listObj = {
329 564
 			$(INOUTMNG01010_GRID_EMPTY).on('click', function() {
330 565
 				_this.back();
331 566
 				_this.itp_INOUTMNG01010_param.gridSize = $.jgrid.defaults.rowNum;
332
-				$(INOUTMNG01010_GRID_ID).setGridParam({ 'postData': JSON.stringify(_this.itp_INOUTMNG01010_param) }).trigger('reloadGrid');
567
+				$(INOUTMNG01010_GRID_ID).setGridParam({'postData': JSON.stringify(_this.itp_INOUTMNG01010_param)}).trigger('reloadGrid');
333 568
 			});
334 569
 		},
335 570
 		itp_INOUTMNG01010_param: {},
@@ -341,43 +576,39 @@ let listObj = {
341 576
 			$('#ITP_FORM_INOUTMNG01010_SEARCH_FROM_DT').val(this.itp_INOUTMNG01010_param.fromDt);
342 577
 			$('#ITP_FORM_INOUTMNG01010_SEARCH_TO_DT').val(this.itp_INOUTMNG01010_param.toDt);
343 578
 			$('#ITP_FORM_INOUTMNG01010_SEARCH_SSHMTWHS_ID').val(this.itp_INOUTMNG01010_param.sshmtWhsId);
579
+			$('#ITP_FORM_INOUTMNG01010_SEARCH_SSHMT_WHS_NM').val(this.itp_INOUTMNG01010_param.sshmtWhsNm);
580
+			$('#ITP_FORM_INOUTMNG01010_SEARCH_SWHS_NM').val(this.itp_INOUTMNG01010_param.swhsNm);
344 581
 			$('#ITP_FORM_INOUTMNG01010_SEARCH_SWHS_ID').val(this.itp_INOUTMNG01010_param.swhsId);
345 582
 			$('#ITP_FORM_INOUTMNG01010_SEARCH_ITEM_NM').val(this.itp_INOUTMNG01010_param.sItemNm);
346 583
 		}
347 584
 	},
348 585
 	grid: {
349
-		init: function() {
586
+		init: function () {
350 587
 			// 데이터 없을때
351 588
 			listObj.empty.push();
352 589
 			itp_fn_jqgrid_resize(INOUTMNG01010_GRID_ID, INOUTMNG01010_GRID_LIST, 'lg');
353 590
 			itp_fn_fire_window_resize();
354 591
 			this.search();
355
-
592
+			
356 593
 		},
357 594
 		colModel: gridColModel.list,
358 595
 		search: function() {
596
+			pageObj.switchScreen('LIST');
359 597
 			this.unload();
360 598
 			this.load();
361 599
 		},
362 600
 		load: function() {
363 601
 			let param = $('#ITP_FORM_INOUTMNG01010_SEARCH').serializeObject();
364 602
 			param.gridSize = $.jgrid.defaults.rowNum;
365
-			param.sbrandId = fn_make_user_info.get('brandId');
366
-
603
+			
367 604
 			var option = {
368 605
 				multiselect: true,
369 606
 				autowidth: true,
370
-				//cellEdit: true,
371 607
 				gridId: INOUTMNG01010_GRID_ID,
372 608
 				colModel: gridColModel.list,
373
-				//viewrecords:false,
374 609
 				param: param,
375 610
 				url: DOMAIN + API_DETAIL_GRID_LIST,
376 611
 				pager: INOUTMNG01010_GRID_PAGER,
377
-
378
-				onCellSelect: function(rowid, cellIdx, cellValue) {
379
-					INOUTMNG01010_LAST_ROW_ID = itp_fn_set_data_editable(rowid, cellIdx, INOUTMNG01010_LAST_ROW_ID, INOUTMNG01010_GRID_ID, ['pchPodrUnqNo']);
380
-				},
381 612
 				loadComplete: function(data) {
382 613
 					itp_fn_grid_load_complete(data, INOUTMNG01010_GRID_ID, true, 'number', 'INOUTMNG01010', listObj.itp_INOUTMNG01010_search, listObj.empty, true, data.gridRecords, true);
383 614
 				},
@@ -389,10 +620,10 @@ let listObj = {
389 620
 		},
390 621
 		button: {
391 622
 		},
392
-		unload: function() {
623
+		unload : function() {
393 624
 			$.jgrid.gridUnload(INOUTMNG01010_GRID_ID);
394 625
 		},
395
-		clearData: function() {
626
+		clearData : function() {
396 627
 			$(INOUTMNG01010_GRID_ID).jqGrid('clearGridData', true);
397 628
 			$(INOUTMNG01010_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
398 629
 			$(INOUTMNG01010_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
@@ -401,4 +632,84 @@ let listObj = {
401 632
 	}
402 633
 };
403 634
 
635
+/*수정화면 Object*/
636
+let modifyObj = {
637
+	init: function (param) {
638
+		this.load(param);
639
+	},
640
+	button: {
641
+		modify: function (param) {
642
+			itp_fn_form_clear_validate(null, '#ITP_FORM_INOUTMNG01010_DETAIL');
643
+			//const selectVal = $('#ITP_FORM_INOUTMNG01010_VIEW_STORE_ID').val();
644
+			//const key = {brandId:fn_make_user_info.get('brandId'), storeId: selectVal, viewCd: 'R'};
645
+			//var param = $.param(key);
646
+			//modifyObj.load(param);
647
+		},
648
+		cancel: function() {
649
+			document.getElementById('ITP_FORM_INOUTMNG01010_DETAIL').reset();
650
+			listObj.grid.search();
651
+		},
652
+		save: function() {
653
+			$('body').trigger('click');
654
+			const formId = ('#ITP_FORM_INOUTMNG01010_DETAIL');
655
+			itp_fn_form_clear_validate(null, formId);
656
+
657
+			if (itp_fn_form_event.isValid(formId)) {
658
+				
659
+				var modalFn = {
660
+					callBack: () => {
661
+						itp_fn_form_event.removeChar('#ITP_FORM_OPER03010_DETAIL');
662
+						var chkQtyYn = "N";
663
+						let gridInsertData = [];
664
+						const rowData = $(INOUTMNG01010_DETAIL_GRID_ID).getRowData();
665
+						
666
+						$.each(rowData, function(key, value) {
667
+							
668
+							if (value.shmtQty == '' || value.shmtQty < 1 ) {
669
+								alert("출고수량을 입력해주세요!");
670
+								chkQtyYn = "Y";
671
+								return false;
672
+							}
673
+							
674
+							if (value.stckQty < valus.shmtQty) {
675
+								alert("출고지시할 수량이 부족합니다.");
676
+								chkQtyYn = "Y";
677
+								return false;
678
+							}
679
+							
680
+							
681
+							if (value.podrQty > value.shmtQty ) {
682
+								 alert("출고수량이 발주수량보다 클수 없습니다!");
683
+								chkQtyYn = "Y";
684
+								return false;
685
+							}
686
+							
687
+							gridInsertData.push(value);
688
+						});
689
+						
690
+						if (chkQtyYn == "Y") return;
691
+						
692
+						let param = $(formId).serializeObject();
693
+						param.viewCd = "C";
694
+						param.gridInsertData = gridInsertData;
695
+						console.log(JSON.stringify(param));
696
+						var searhFn = function () {
697
+							//ITP_FORM_INOUTMNG01010_DETAIL_IS_WRITING = false;
698
+							pageObj.grid.clearData();
699
+							modifyObj.button.cancel();
700
+						}
701
+						fn_ajax_call(API_DETAIL_SAVE, JSON.stringify(param), searhFn, 'POST');
702
+					}
703
+				};
704
+				itp_fn_modal_confirm('출하지시 하시겠습니까?', modalFn);
705
+			}
706
+		}
707
+	},
708
+	
709
+	load: function(param) {
710
+		//console.log(param);
711
+		//pageObj.grid.load("DETAIL",param);
712
+	}
713
+};
714
+
404 715