Browse Source

운영관리-서비스변경 작성-2

yhl88 2 years ago
parent
commit
0ac6ace377

+ 4 - 4
src/main/webapp/app/oper/OPER07010.html

@@ -34,14 +34,14 @@
34
 							</div>
34
 							</div>
35
 						</div>
35
 						</div>
36
 					</div>
36
 					</div>
37
-					<div class="pull-right itp_cicon">
38
-						<div class="col-xs-4 itp_ip itp_noMar">
37
+					<div class="pull-right itp_cicon"  style="margin-right: 20px;">
38
+						<div class="col-xs-9 itp_ip itp_noMar">
39
 							<select id="ITP_FORM_OPER07010_SEARCH_SHMT_COL_PROC_TYPE" data-select-code="SHMT_COL_PROC_TYPE" class="form-control itp_input" name="shmtColProcType"></select>
39
 							<select id="ITP_FORM_OPER07010_SEARCH_SHMT_COL_PROC_TYPE" data-select-code="SHMT_COL_PROC_TYPE" class="form-control itp_input" name="shmtColProcType"></select>
40
 						</div>
40
 						</div>
41
 						<button type="button" id="ITP_BTN_OPER07010_MODIFY" class="btn btn-success btn-sm UPB" style="display: inline-block;"><i class="glyphicon"></i>&nbsp;&nbsp;수정&nbsp;&nbsp;</button>
41
 						<button type="button" id="ITP_BTN_OPER07010_MODIFY" class="btn btn-success btn-sm UPB" style="display: inline-block;"><i class="glyphicon"></i>&nbsp;&nbsp;수정&nbsp;&nbsp;</button>
42
 					</div>
42
 					</div>
43
 					<div class="itp_table fix">
43
 					<div class="itp_table fix">
44
-						<h3 class="itp_table_tit">브랜드 진행정보</h3>
44
+						<h1 class="itp_table_tit">브랜드 진행정보</h1>
45
 						<div id="ITP_OPER07010_brand_jqGrid_list" class="itp_tb_list itp_gType1" data-total-cnt="${totalCnt}">
45
 						<div id="ITP_OPER07010_brand_jqGrid_list" class="itp_tb_list itp_gType1" data-total-cnt="${totalCnt}">
46
 							<div id="ITP_OPER07010_jqGridView_brand" class="itp_views fix"></div>
46
 							<div id="ITP_OPER07010_jqGridView_brand" class="itp_views fix"></div>
47
 							<table id="ITP_OPER07010_brand_jqGrid"></table>
47
 							<table id="ITP_OPER07010_brand_jqGrid"></table>
@@ -50,7 +50,7 @@
50
 						</div>
50
 						</div>
51
 					</div>
51
 					</div>
52
 					<div class="itp_table fix">
52
 					<div class="itp_table fix">
53
-						<h3 class="itp_table_tit">매장 진행정보</h3>
53
+						<h1 class="itp_table_tit">매장 진행정보</h1>
54
 						<div id="ITP_OPER07010_store_jqGrid_list" class="itp_tb_list itp_gType1" data-total-cnt="${totalCnt}">
54
 						<div id="ITP_OPER07010_store_jqGrid_list" class="itp_tb_list itp_gType1" data-total-cnt="${totalCnt}">
55
 							<div id="ITP_OPER07010_jqGridView_store" class="itp_views fix"></div>
55
 							<div id="ITP_OPER07010_jqGridView_store" class="itp_views fix"></div>
56
 							<table id="ITP_OPER07010_store_jqGrid"></table>
56
 							<table id="ITP_OPER07010_store_jqGrid"></table>

+ 87 - 27
src/main/webapp/js/app/oper/ITP_OPER07010.js

@@ -5,7 +5,6 @@ require(['config'], function() {
5
     });
5
     });
6
 });
6
 });
7
 
7
 
8
-console.log(CONN_KEY);
9
 /********************************************************
8
 /********************************************************
10
  --------------------------------------------------------
9
  --------------------------------------------------------
11
  - Object 목록								            -
10
  - Object 목록								            -
@@ -30,9 +29,6 @@ const OPER07010_STORE_GRID_LIST = '#ITP_OPER07010_store_jqGrid_list';
30
 const OPER07010_STORE_GRID_PAGER = '#ITP_OPER07010_store_jqGridPager';
29
 const OPER07010_STORE_GRID_PAGER = '#ITP_OPER07010_store_jqGridPager';
31
 const OPER07010_STORE_GRID_EMPTY = '#ITP_OPER07010_store_jqGridEmpty';
30
 const OPER07010_STORE_GRID_EMPTY = '#ITP_OPER07010_store_jqGridEmpty';
32
 
31
 
33
-let ITP_COMMON_LOAN_DVSN = fn_make_common_cd_list(CODE_LIST, 'LOAN_DVSN', true, '여신구분');
34
-let OPER07010_STORE_GRID_LAST_ROW_ID;
35
-
36
 
32
 
37
 /*API URL*/
33
 /*API URL*/
38
 let API_BRAND_BRAND_ING_INFO = '/api/brand/brand-ing-info';
34
 let API_BRAND_BRAND_ING_INFO = '/api/brand/brand-ing-info';
@@ -40,6 +36,60 @@ let API_BRAND_STORE_ING_INFO = '/api/brand/store-ing-list';
40
 let API_BRAND_CHANGE_BRAND_SHCO = '/api/brand/change-brand-shco';
36
 let API_BRAND_CHANGE_BRAND_SHCO = '/api/brand/change-brand-shco';
41
 let API_STORE_CHANGE_STORE_LOAN = '/api/store/change-store-loan';
37
 let API_STORE_CHANGE_STORE_LOAN = '/api/store/change-store-loan';
42
 
38
 
39
+/*변수*/
40
+let ITP_COMMON_LOAN_DVSN = fn_make_common_cd_list(CODE_LIST, 'LOAN_DVSN', true, '여신구분');
41
+let OPER07010_STORE_GRID_LAST_ROW_ID;
42
+
43
+let editStoreNum = 0;
44
+
45
+function editBButton (cellvalue, options, rowObject) {
46
+	editStoreNum ++;
47
+	if (cellvalue == 'N') {
48
+		return '<span>변경불가</span>';
49
+	} else {
50
+		let storeId = '';
51
+		storeId = rowObject.storeId;		
52
+		return '<input type="button" id="'+editStoreNum+'_checkEdit" value="변경" onclick="test('+editStoreNum+')" name="'+storeId+'">'
53
+	}
54
+};
55
+
56
+function test(num) {
57
+	let ids = $(OPER07010_STORE_GRID_ID).jqGrid('getDataIDs');
58
+	for (var i = 0; i < ids.length; i++) {
59
+		if ((num - 1) == i) {
60
+			let rowData = $(OPER07010_STORE_GRID_ID).jqGrid('getRowData', ids[i]);
61
+			if (rowData.loanDvsn == '') {
62
+				itp_fn_modal_alert_ajax('변경할 사항의 입력을 완료해야합니다.');
63
+				return false;
64
+			} else if (rowData.loanDvsn != 'LD02' && rowData.credtLimtAmt.length > 0) {
65
+				itp_fn_modal_alert_ajax('후불상태만 한도를 입력할 수 있습니다');
66
+				return false;
67
+			} else if (rowData.loanDvsn == 'LD02' && rowData.credtLimtAmt == '') {
68
+				itp_fn_modal_alert_ajax('후불상태는 한도값을 입력해야합니다');
69
+				return false;
70
+			}
71
+			
72
+			/*
73
+			let loanDvsnId = '#' + num + '_loanDvsn';
74
+			let creditId = '#' + num + '_credtLimtAmt';
75
+			if ($(loanDvsnId).val() != 'LD02') {				
76
+				$(creditId).attr("readonly",true);
77
+			} else {
78
+				$(creditId).removeAttr("readonly"); 
79
+			}*/
80
+			
81
+			var searchFn = function() {
82
+				let param = $('#ITP_FORM_OPER07010_SEARCH').serializeObject();
83
+	        	param.gridSize = $.jgrid.defaults.rowNum;
84
+				$(OPER07010_STORE_GRID_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
85
+				editStoreNum = 0;
86
+			}
87
+    		fn_ajax_call(API_STORE_CHANGE_STORE_LOAN, JSON.stringify(rowData), searchFn, 'POST');
88
+		}
89
+	}
90
+	editStoreNum = 0;
91
+}
92
+
43
 
93
 
44
 /*화면 Grid Object*/
94
 /*화면 Grid Object*/
45
 const gridColModel = {
95
 const gridColModel = {
@@ -71,37 +121,37 @@ const gridColModel = {
71
         {
121
         {
72
             index: 'PCH_CNT', name: 'pchCnt',
122
             index: 'PCH_CNT', name: 'pchCnt',
73
             label: '발주요청건수',
123
             label: '발주요청건수',
74
-            width: '10', fixed: false, align: 'center',
124
+            width: '10', fixed: false, align: 'right',
75
             sortable: false, hidden: false
125
             sortable: false, hidden: false
76
         },
126
         },
77
         {
127
         {
78
             index: 'PODR_CNT', name: 'podrCnt',
128
             index: 'PODR_CNT', name: 'podrCnt',
79
             label: '발주진행건수',
129
             label: '발주진행건수',
80
-            width: '10', fixed: false, align: 'center',
130
+            width: '10', fixed: false, align: 'right',
81
             sortable: false, hidden: false
131
             sortable: false, hidden: false
82
         },
132
         },
83
         {
133
         {
84
             index: 'DLV_CNT', name: 'dlvCnt',
134
             index: 'DLV_CNT', name: 'dlvCnt',
85
             label: '입고대기건수',
135
             label: '입고대기건수',
86
-            width: '10', fixed: false, align: 'center',
136
+            width: '10', fixed: false, align: 'right',
87
             sortable: false, hidden: false
137
             sortable: false, hidden: false
88
         },
138
         },
89
         {
139
         {
90
             index: 'RPCH_CNT', name: 'rpchCnt',
140
             index: 'RPCH_CNT', name: 'rpchCnt',
91
             label: '반품요청건수',
141
             label: '반품요청건수',
92
-            width: '10', fixed: false, align: 'center',
142
+            width: '10', fixed: false, align: 'right',
93
             sortable: false, hidden: false
143
             sortable: false, hidden: false
94
         },
144
         },
95
         {
145
         {
96
             index: 'RODR_CNT', name: 'rodrCnt',
146
             index: 'RODR_CNT', name: 'rodrCnt',
97
             label: '반품진행건수',
147
             label: '반품진행건수',
98
-            width: '10', fixed: false, align: 'center',
148
+            width: '10', fixed: false, align: 'right',
99
             sortable: false, hidden: false
149
             sortable: false, hidden: false
100
         },
150
         },
101
         {
151
         {
102
             index: 'PICK_CNT', name: 'pickCnt',
152
             index: 'PICK_CNT', name: 'pickCnt',
103
             label: '수거대기건수',
153
             label: '수거대기건수',
104
-            width: '10', fixed: false, align: 'center',
154
+            width: '10', fixed: false, align: 'right',
105
             sortable: false, hidden: false
155
             sortable: false, hidden: false
106
         },
156
         },
107
         {
157
         {
@@ -133,69 +183,71 @@ const gridColModel = {
133
         {
183
         {
134
             index: 'STORE_NM', name: 'storeNm',
184
             index: 'STORE_NM', name: 'storeNm',
135
             label: '매장명',
185
             label: '매장명',
136
-            width: '10', fixed: false, align: 'center',
186
+            width: '11', fixed: false, align: 'center',
137
             sortable: false, hidden: false, classes: 'ui-ellipsis'
187
             sortable: false, hidden: false, classes: 'ui-ellipsis'
138
         },
188
         },
139
         {
189
         {
140
             index: 'LOAN_DVSN_NM', name: 'loanDvsnNm',
190
             index: 'LOAN_DVSN_NM', name: 'loanDvsnNm',
141
             label: '여신구분',
191
             label: '여신구분',
142
-            width: '10', fixed: false, align: 'center',
192
+            width: '8', fixed: false, align: 'center',
143
             sortable: false, hidden: false
193
             sortable: false, hidden: false
144
         },
194
         },
145
         {
195
         {
146
             index: 'PCH_CNT', name: 'pchCnt',
196
             index: 'PCH_CNT', name: 'pchCnt',
147
             label: '발주요청건수',
197
             label: '발주요청건수',
148
-            width: '10', fixed: false, align: 'center',
198
+            width: '10', fixed: false, align: 'right',
149
             sortable: false, hidden: false
199
             sortable: false, hidden: false
150
         },
200
         },
151
         {
201
         {
152
             index: 'PODR_CNT', name: 'podrCnt',
202
             index: 'PODR_CNT', name: 'podrCnt',
153
             label: '발주진행건수',
203
             label: '발주진행건수',
154
-            width: '10', fixed: false, align: 'center',
204
+            width: '10', fixed: false, align: 'right',
155
             sortable: false, hidden: false
205
             sortable: false, hidden: false
156
         },
206
         },
157
         {
207
         {
158
             index: 'DLV_CNT', name: 'dlvCnt',
208
             index: 'DLV_CNT', name: 'dlvCnt',
159
             label: '입고대기건수',
209
             label: '입고대기건수',
160
-            width: '10', fixed: false, align: 'center',
210
+            width: '10', fixed: false, align: 'right',
161
             sortable: false, hidden: false
211
             sortable: false, hidden: false
162
         },
212
         },
163
         {
213
         {
164
             index: 'RPCH_CNT', name: 'rpchCnt',
214
             index: 'RPCH_CNT', name: 'rpchCnt',
165
             label: '반품요청건수',
215
             label: '반품요청건수',
166
-            width: '10', fixed: false, align: 'center',
216
+            width: '10', fixed: false, align: 'right',
167
             sortable: false, hidden: false
217
             sortable: false, hidden: false
168
         },
218
         },
169
         {
219
         {
170
             index: 'RODR_CNT', name: 'rodrCnt',
220
             index: 'RODR_CNT', name: 'rodrCnt',
171
             label: '반품진행건수',
221
             label: '반품진행건수',
172
-            width: '10', fixed: false, align: 'center',
222
+            width: '10', fixed: false, align: 'right',
173
             sortable: false, hidden: false
223
             sortable: false, hidden: false
174
         },
224
         },
175
         {
225
         {
176
             index: 'PICK_CNT', name: 'pickCnt',
226
             index: 'PICK_CNT', name: 'pickCnt',
177
             label: '수거대기건수',
227
             label: '수거대기건수',
178
-            width: '10', fixed: false, align: 'center',
228
+            width: '10', fixed: false, align: 'right',
179
             sortable: false, hidden: false
229
             sortable: false, hidden: false
180
         },
230
         },
181
         {
231
         {
182
             index: 'LOAN_DVSN', name: 'loanDvsn',
232
             index: 'LOAN_DVSN', name: 'loanDvsn',
183
-            label: '여신구분코드',
184
-            width: '10', fixed: false, align: 'center',
233
+            label: '여신변경선택',
234
+            width: '11', fixed: false, align: 'center',
185
             sortable: false, editable: true, formatter: 'select', edittype: 'select',
235
             sortable: false, editable: true, formatter: 'select', edittype: 'select',
186
 			editoptions: {value: ITP_COMMON_LOAN_DVSN}
236
 			editoptions: {value: ITP_COMMON_LOAN_DVSN}
187
         },
237
         },
188
         {
238
         {
189
             index: 'CREDT_LIMT_AMT', name: 'credtLimtAmt',
239
             index: 'CREDT_LIMT_AMT', name: 'credtLimtAmt',
190
             label: '후불한도',
240
             label: '후불한도',
191
-            width: '10', fixed: false, align: 'center',
192
-            sortable: false, hidden: false, editable: true, edittype: 'text'
241
+            width: '10', fixed: false, align: 'right',
242
+            sortable: false, hidden: false, editable: true, edittype: 'text',
243
+            editoptions: {"onKeyup": "this.value=this.value.replace(/[^0-9]/g,'');", maxlength: 10}, 
244
+			formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
193
         },
245
         },
194
         {
246
         {
195
             index: 'CHG_PASS_YN', name: 'chgPassYn',
247
             index: 'CHG_PASS_YN', name: 'chgPassYn',
196
             label: '변경여부',
248
             label: '변경여부',
197
-            width: '10', fixed: false, align: 'center',
198
-            sortable: false, hidden: false
249
+            width: '8', fixed: false, align: 'center',
250
+            sortable: false, hidden: false, formatter: editBButton
199
         }
251
         }
200
     ]
252
     ]
201
 };
253
 };
@@ -287,7 +339,8 @@ let pageObj = {
287
 /*목록화면 Object*/
339
 /*목록화면 Object*/
288
 let listObj = {
340
 let listObj = {
289
     init: function () {
341
     init: function () {
290
-        //this.grid_brand.init();
342
+    	let param = $('#ITP_FORM_OPER07010_SEARCH').serializeObject();
343
+    	listObj.load(param);
291
         this.grid_store.init();
344
         this.grid_store.init();
292
     },
345
     },
293
     button: {
346
     button: {
@@ -298,15 +351,22 @@ let listObj = {
298
     		param.gridSize = $.jgrid.defaults.rowNum;
351
     		param.gridSize = $.jgrid.defaults.rowNum;
299
 			param.gridPage = $.jgrid.defaults.page;
352
 			param.gridPage = $.jgrid.defaults.page;
300
 			// console.log(JSON.stringify(param));
353
 			// console.log(JSON.stringify(param));
354
+			if (!('brandId' in param)) {
355
+				param.brandId = '';
356
+			}
301
 			listObj.load(param);
357
 			listObj.load(param);
302
 			// $(OPER07010_BRAND_GRID_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
358
 			// $(OPER07010_BRAND_GRID_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
303
 			$(OPER07010_STORE_GRID_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
359
 			$(OPER07010_STORE_GRID_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
360
+			editStoreNum = 0;
304
 		},
361
 		},
305
 		modify: function() {
362
 		modify: function() {
306
 			listObj.grid_store.itp_OPER07010_search = true;
363
 			listObj.grid_store.itp_OPER07010_search = true;
307
     		let param = $('#ITP_FORM_OPER07010_SEARCH').serializeObject();
364
     		let param = $('#ITP_FORM_OPER07010_SEARCH').serializeObject();
308
     		param.shmtColProcType = $('#ITP_FORM_OPER07010_SEARCH_SHMT_COL_PROC_TYPE').val();
365
     		param.shmtColProcType = $('#ITP_FORM_OPER07010_SEARCH_SHMT_COL_PROC_TYPE').val();
309
-    		console.log(param);
366
+    		// console.log(param);
367
+    		if (param.shmtColProcType == '' || param.shmtColProcType.length == 0) {
368
+				return false;
369
+			}
310
     		var searchFn = function() {
370
     		var searchFn = function() {
311
     			listObj.load(param);
371
     			listObj.load(param);
312
     			$(OPER07010_STORE_GRID_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
372
     			$(OPER07010_STORE_GRID_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
@@ -347,7 +407,7 @@ let listObj = {
347
         		colModel: gridColModel.brand,
407
         		colModel: gridColModel.brand,
348
         		data: gridData,
408
         		data: gridData,
349
         		loadComplete: function(data) {
409
         		loadComplete: function(data) {
350
-        			console.log(data);
410
+        			// console.log(data);
351
         			$(_this.gridList).find('.ui-jqgrid .ui-jqgrid-bdiv').css('overflow-x', 'hidden');
411
         			$(_this.gridList).find('.ui-jqgrid .ui-jqgrid-bdiv').css('overflow-x', 'hidden');
352
 					(Array.isArray(data.rows) && data.rows.length === 0) ? $(_this.gridEmpty).show() : $(_this.gridEmpty).hide();
412
 					(Array.isArray(data.rows) && data.rows.length === 0) ? $(_this.gridEmpty).show() : $(_this.gridEmpty).hide();
353
 				}
413
 				}