dwkim 2 år sedan
förälder
incheckning
f73f477f29

+ 1 - 1
src/main/webapp/app/inoutmng/INOUTMNG01010.html

@@ -51,7 +51,7 @@
51 51
 											<button type="button" id="ITP_FORM_INOUTMNG01010_DELETE_WHS_NM" class="btn btn-primary btn-sm SHOW" style="display: inline-block;"><i class="glyphicon glyphicon-erase"></i></button>
52 52
 						                </div>
53 53
 										<div class="col-xs-4 itp_ip itp_noMar">
54
-											<input type="text" id="ITP_FORM_INOUTMNG01010_SEARCH_ITEM_NM" class="form-control itp_input" name="sItemNm" placeholder="품목번호 or 품목명" />
54
+											<input type="text" id="ITP_FORM_INOUTMNG01010_SEARCH_ITEM_NM" class="form-control itp_input" name="sitemNm" placeholder="품목번호 or 품목명" />
55 55
 										</div>
56 56
 									</div>
57 57
 								</form>

+ 31 - 26
src/main/webapp/app/inoutmng/INOUTMNG03010.html

@@ -4,7 +4,9 @@
4 4
 			<div class="itp_det_head fix">
5 5
 				<h2 class="pull-left itp_det_tit"><i class="glyphicon glyphicon-chevron-right"></i><strong>수거지시</strong></h2>
6 6
 				<div class="pull-right itp_cicon">
7
-					<button type="button" id="ITP_BTN_INOUTMNG03010_SRH" class="btn btn-success btn-sm CUD" style="display: inline-block;"><i class="glyphicon "></i>&nbsp;&nbsp;수거지시&nbsp;&nbsp;</button>
7
+					<button type="button" id="ITP_BTN_INOUTMNG03010_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_INOUTMNG03010_CUC" class="btn btn-success btn-sm CUC" style="display: inline-block;"><i class="glyphicon "></i>&nbsp;&nbsp;수거생성&nbsp;&nbsp;</button>
9
+					<button type="button" id="ITP_BTN_INOUTMNG03010_CUD" class="btn btn-success btn-sm CUD" style="display: inline-block;"><i class="glyphicon "></i>&nbsp;&nbsp;수거지시&nbsp;&nbsp;</button>
8 10
 					<button type="button" id="ITP_BTN_INOUTMNG03010_CANCELLIST" class="btn btn-warning btn-sm PRB"><i class="glyphicon "></i>&nbsp;&nbsp;취소/목록&nbsp;&nbsp;</button>
9 11
 				</div>
10 12
 			</div>
@@ -14,6 +16,7 @@
14 16
 						<div class="itp_srh_border fix">
15 17
 							<div class="col-xs-12">
16 18
 								<form id="ITP_FORM_INOUTMNG03010_SEARCH" class="form-horizontal">
19
+									<input type="hidden" id="ITP_FORM_INOUTMNG03010_DETAIL_SBRAND_ID" class="form-control itp_input" name="sbrandId" />
17 20
 									<div class="form-group">
18 21
 										<div class="col-xs-2 itp_ip itp_noMar">
19 22
 											<select id="ITP_FORM_INOUTMNG03010_SERVICE_COL_REQ_DT" class="form-control itp_input" name="servicecolReqDt">
@@ -22,32 +25,33 @@
22 25
 										</div>
23 26
 										<div class="col-xs-3 itp_ip itp_noMar">
24 27
 											<div class="input-daterange input-group date">
25
-												<input type="text" id="ITP_FORM_INOUTMNG03010_SEARCH_COL_REQ_DT" class="form-control itp_input" name="colReqDt" value="">
28
+												<input type="text" id="ITP_FORM_INOUTMNG03010_SEARCH_FROM_DT" class="form-control itp_input" name="fromDt" value="">
26 29
 												<span class="input-group-addon itp_date_to">~</span>
27
-												<input type="text" id="ITP_FORM_INOUTMNG03010_SEARCH_COL_DT" class="form-control itp_input" name="colDt" value="">
30
+												<input type="text" id="ITP_FORM_INOUTMNG03010_SEARCH_TO_DT" class="form-control itp_input" name="toDt" value="">
28 31
 											</div>
29 32
 										</div>
30 33
 										<div class="col-xs-2 itp_ip itp_noMar">
31
-											<select id="ITP_FORM_INOUTMNG03010_SEARCH_COL_DVSN" class="form-control itp_input" name="sColDvsn">
32
-												<option value="A">수거구분</option>											
33
-											</select>
34
-										</div>
35
-										<div class="col-xs-2 itp_ip itp_noMar">
36
-											<select id="ITP_FORM_INOUTMNG03010_SEARCH_RTN_WHS_ID" class="form-control itp_input" name="sRtnWhsId">
37
-												<option value="A">반품입고창고</option>											
38
-											</select>
34
+											<input type="text" id="ITP_FORM_INOUTMNG03010_SEARCH_SWHS_NM" class="form-control itp_input" name="swhsNm" placeholder="반품입고창고" />
35
+											<input type="hidden" id="ITP_FORM_INOUTMNG03010_SEARCH_SWHS_ID" class="form-control itp_input" name="swhsId"  />
39 36
 										</div>
37
+										<div class="col-xs-1 itp_in" style="padding:0px; width:10%;">
38
+											<button type="button" id="ITP_FORM_INOUTMNG03010_SEARCH_WHS_NM" class="btn btn-success btn-sm SHOW" style="display: inline-block;"><i class="glyphicon glyphicon-search"></i></button>
39
+											<button type="button" id="ITP_FORM_INOUTMNG03010_DELETE_WHS_NM" class="btn btn-primary btn-sm SHOW" style="display: inline-block;"><i class="glyphicon glyphicon-erase"></i></button>
40
+						                </div>
41
+										
42
+										
40 43
 									</div>
41 44
 									<div class="form-group" style="padding-top: 10px; border-top: 1px dotted #ccc;">
42 45
 										<div class="col-xs-2 itp_ip itp_noMar">
43
-											<input type="text" id="ITP_FORM_INOUTMNG03010_SEARCH_COL_PLACE" class="form-control itp_input" name="sColPlace" placeholder="수거매장" />
46
+											<input type="text" id="ITP_FORM_INOUTMNG03010_SEARCH_SRTN_WHS_NM" class="form-control itp_input" name="srtnWhsNm" placeholder="수거창고" />
47
+											<input type="hidden" id="ITP_FORM_INOUTMNG03010_SEARCH_SRTN_WHS_ID" class="form-control itp_input" name="srtnWhsId"  />
44 48
 										</div>
45 49
 										<div class="col-xs-1 itp_in" style="width:11%; padding:0px;">
46
-											<button type="button" id="ITP_BTN_INOUTMNG03010_SEARCH_SRH" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-search"></i></button>
47
-											<button type="button" id="ITP_BTN_INOUTMNG03010_SEARCH_MODIFY" class="btn btn-primary btn-sm UPB" style="display: inline-block;"><i class="glyphicon glyphicon-erase"></i></button>
50
+											<button type="button" id="ITP_FORM_INOUTMNG03010_SEARCH_RTN_WHS_NM" class="btn btn-success btn-sm SHOW" style="display: inline-block;"><i class="glyphicon glyphicon-search"></i></button>
51
+											<button type="button" id="ITP_FORM_INOUTMNG03010_DELETE_RTN_WHS_NM" class="btn btn-primary btn-sm SHOW" style="display: inline-block;"><i class="glyphicon glyphicon-erase"></i></button>
48 52
 						                </div>
49 53
 										<div class="col-xs-3 itp_ip itp_noMar">
50
-											<input type="text" id="ITP_FORM_INOUTMNG03010_SEARCH_ITEM_NM" class="form-control itp_input" name="sItemNm" placeholder="품목번호 or 품목명" />
54
+											<input type="text" id="ITP_FORM_INOUTMNG03010_SEARCH_ITEM_NM" class="form-control itp_input" name="sitemNm" placeholder="품목번호 or 품목명" />
51 55
 										</div>
52 56
 									</div>
53 57
 								</form>
@@ -63,11 +67,12 @@
63 67
 						</div>
64 68
 					</div>
65 69
 				</div>
66
-				<div id="ITP_AJAX_INOUTMNG03010_VIEW_CONTAINER" >
70
+				<div id="ITP_AJAX_INOUTMNG03010_DETAIL_CONTAINER" >
67 71
 					<div class="itp_form itp_type1 fix">
68 72
 						<div class="col-xs-12">
69
-							<form id="ITP_FORM_INOUTMNG03010_VIEW" class="form-horizontal">
70
-								<input type="hidden" id="ITP_FORM_INOUTMNG03010_VIEW_" name="" value="">
73
+							<form id="ITP_FORM_INOUTMNG03010_DETAIL" class="form-horizontal">
74
+								<input type="hidden" id="ITP_FORM_INOUTMNG03010_DETAIL_" name="" value="">
75
+								<input type="hidden" id="ITP_FORM_INOUTMNG03010_DETAIL_BRAND_ID" class="form-control itp_input" name="brandId" />
71 76
 								<section class="itp_form_sec">
72 77
 									<h4 class="itp_form_tit">수거지시 기본정보</h4>
73 78
 									<div class="itp_form_in">
@@ -82,7 +87,7 @@
82 87
 											<div class="col-xs-4 itp_ip">
83 88
 												<div class="col-xs-7 itp_in">
84 89
 													<div class="input-daterange input-group date">
85
-														<input type="text" id="ITP_FORM_INOUTMNG03010_VIEW_COL_CMD_DT" data-check-required="empty" class="form-control itp_input" name="colDt" value="">
90
+														<input type="text" id="ITP_FORM_INOUTMNG03010_DETAIL_COL_SCH_DT" data-check-required="empty" class="form-control itp_input" name="colSchDt" value="">
86 91
 													</div>
87 92
 												</div>
88 93
 											</div>
@@ -91,13 +96,13 @@
91 96
 											<label class="col-xs-2 itp_lb">수거담당자 *</label>
92 97
 											<div class="col-xs-4 itp_ip">
93 98
 												<div class="col-xs-7 itp_in">
94
-													<input type="text" id="ITP_FORM_INOUTMNG03010_VIEW_COL_REQ_MGR_NM" data-check-required="empty" class="form-control itp_input" name="colReqMgrNm" value="">
99
+													<input type="text" id="ITP_FORM_INOUTMNG03010_DETAIL_PICK_MGR_NM" data-check-required="empty" class="form-control itp_input" name="pickMgrNm" value="">
95 100
 												</div>
96 101
 											</div>
97 102
 											<label class="col-xs-2 itp_lb">수거담당자 전화번호*</label>
98 103
 											<div class="col-xs-4 itp_ip">
99 104
 												<div class="col-xs-7 itp_in">
100
-													<input type="text" id="ITP_FORM_INOUTMNG03010_VIEW_COL_REQ_MGR_TEL_NO" data-check-required="empty" class="form-control itp_input" name="colReqMgrTelNo" value="">
105
+													<input type="text" id="ITP_FORM_INOUTMNG03010_DETAIL_PICK_MGR_TEL_NO" data-check-required="empty" class="form-control itp_input" name="pickMgrTelNo" value="">
101 106
 												</div>
102 107
 											</div>
103 108
 										</div>
@@ -110,11 +115,11 @@
110 115
 						<div class="itp_table_head fix" style="background:#f5f5f5;">
111 116
 							<h4 class="itp_table_tit">수거지시 품목</h4>
112 117
 						</div>
113
-						<div id="ITP_INOUTMNG03010_VIEW_jqGrid_list" class="itp_tb_list">
114
-							<div id="ITP_INOUTMNG03010_VIEW_jqGridView" class="itp_views fix"></div>
115
-							<table id="ITP_INOUTMNG03010_VIEW_jqGrid"></table>
116
-							<div id="ITP_INOUTMNG03010_VIEW_jqGridPager"></div>
117
-							<div id="ITP_INOUTMNG03010_VIEW_jqGridEmpty" class="itp_no_data"></div>
118
+						<div id="ITP_INOUTMNG03010_DETAIL_jqGrid_list" class="itp_tb_list">
119
+							<div id="ITP_INOUTMNG03010_DETAIL_jqGridView" class="itp_views fix"></div>
120
+							<table id="ITP_INOUTMNG03010_DETAIL_jqGrid"></table>
121
+							<div id="ITP_INOUTMNG03010_DETAIL_jqGridPager"></div>
122
+							<div id="ITP_INOUTMNG03010_DETAIL_jqGridEmpty" class="itp_no_data"></div>
118 123
 						</div>
119 124
 					</div>
120 125
 				</div>

+ 702 - 0
src/main/webapp/js/app/inoutmng/ITP_INOUTMNG03010.js

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

+ 4 - 1
src/main/webapp/js/app/locales/locale-ko.js

@@ -257,7 +257,10 @@ const ITP_MSG_LOCALE = (function() {
257 257
 			"rtnRsnDvsnNm": "반품사유구분",
258 258
 			"colReqAmt": "수거금액",
259 259
 			"pickMgrNm": "수거담당자",
260
-			"pickMgrTelNo": "수거담당자연락처"
260
+			"pickMgrTelNo": "수거담당자연락처",
261
+			"rtnOdrQty": "반품발주수량",
262
+			"rtnWhsNm": "반품창고",
263
+			"colQty": "수거수량"
261 264
 		},
262 265
 		"table": {
263 266
 			"brandId": "브랜드ID",