Переглянути джерело

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

yhl88 2 роки тому
батько
коміт
0ac6ace377

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

@@ -34,14 +34,14 @@
34 34
 							</div>
35 35
 						</div>
36 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 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 40
 						</div>
41 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 42
 					</div>
43 43
 					<div class="itp_table fix">
44
-						<h3 class="itp_table_tit">브랜드 진행정보</h3>
44
+						<h1 class="itp_table_tit">브랜드 진행정보</h1>
45 45
 						<div id="ITP_OPER07010_brand_jqGrid_list" class="itp_tb_list itp_gType1" data-total-cnt="${totalCnt}">
46 46
 							<div id="ITP_OPER07010_jqGridView_brand" class="itp_views fix"></div>
47 47
 							<table id="ITP_OPER07010_brand_jqGrid"></table>
@@ -50,7 +50,7 @@
50 50
 						</div>
51 51
 					</div>
52 52
 					<div class="itp_table fix">
53
-						<h3 class="itp_table_tit">매장 진행정보</h3>
53
+						<h1 class="itp_table_tit">매장 진행정보</h1>
54 54
 						<div id="ITP_OPER07010_store_jqGrid_list" class="itp_tb_list itp_gType1" data-total-cnt="${totalCnt}">
55 55
 							<div id="ITP_OPER07010_jqGridView_store" class="itp_views fix"></div>
56 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 10
  - Object 목록								            -
@@ -30,9 +29,6 @@ const OPER07010_STORE_GRID_LIST = '#ITP_OPER07010_store_jqGrid_list';
30 29
 const OPER07010_STORE_GRID_PAGER = '#ITP_OPER07010_store_jqGridPager';
31 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 33
 /*API URL*/
38 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 36
 let API_BRAND_CHANGE_BRAND_SHCO = '/api/brand/change-brand-shco';
41 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 94
 /*화면 Grid Object*/
45 95
 const gridColModel = {
@@ -71,37 +121,37 @@ const gridColModel = {
71 121
         {
72 122
             index: 'PCH_CNT', name: 'pchCnt',
73 123
             label: '발주요청건수',
74
-            width: '10', fixed: false, align: 'center',
124
+            width: '10', fixed: false, align: 'right',
75 125
             sortable: false, hidden: false
76 126
         },
77 127
         {
78 128
             index: 'PODR_CNT', name: 'podrCnt',
79 129
             label: '발주진행건수',
80
-            width: '10', fixed: false, align: 'center',
130
+            width: '10', fixed: false, align: 'right',
81 131
             sortable: false, hidden: false
82 132
         },
83 133
         {
84 134
             index: 'DLV_CNT', name: 'dlvCnt',
85 135
             label: '입고대기건수',
86
-            width: '10', fixed: false, align: 'center',
136
+            width: '10', fixed: false, align: 'right',
87 137
             sortable: false, hidden: false
88 138
         },
89 139
         {
90 140
             index: 'RPCH_CNT', name: 'rpchCnt',
91 141
             label: '반품요청건수',
92
-            width: '10', fixed: false, align: 'center',
142
+            width: '10', fixed: false, align: 'right',
93 143
             sortable: false, hidden: false
94 144
         },
95 145
         {
96 146
             index: 'RODR_CNT', name: 'rodrCnt',
97 147
             label: '반품진행건수',
98
-            width: '10', fixed: false, align: 'center',
148
+            width: '10', fixed: false, align: 'right',
99 149
             sortable: false, hidden: false
100 150
         },
101 151
         {
102 152
             index: 'PICK_CNT', name: 'pickCnt',
103 153
             label: '수거대기건수',
104
-            width: '10', fixed: false, align: 'center',
154
+            width: '10', fixed: false, align: 'right',
105 155
             sortable: false, hidden: false
106 156
         },
107 157
         {
@@ -133,69 +183,71 @@ const gridColModel = {
133 183
         {
134 184
             index: 'STORE_NM', name: 'storeNm',
135 185
             label: '매장명',
136
-            width: '10', fixed: false, align: 'center',
186
+            width: '11', fixed: false, align: 'center',
137 187
             sortable: false, hidden: false, classes: 'ui-ellipsis'
138 188
         },
139 189
         {
140 190
             index: 'LOAN_DVSN_NM', name: 'loanDvsnNm',
141 191
             label: '여신구분',
142
-            width: '10', fixed: false, align: 'center',
192
+            width: '8', fixed: false, align: 'center',
143 193
             sortable: false, hidden: false
144 194
         },
145 195
         {
146 196
             index: 'PCH_CNT', name: 'pchCnt',
147 197
             label: '발주요청건수',
148
-            width: '10', fixed: false, align: 'center',
198
+            width: '10', fixed: false, align: 'right',
149 199
             sortable: false, hidden: false
150 200
         },
151 201
         {
152 202
             index: 'PODR_CNT', name: 'podrCnt',
153 203
             label: '발주진행건수',
154
-            width: '10', fixed: false, align: 'center',
204
+            width: '10', fixed: false, align: 'right',
155 205
             sortable: false, hidden: false
156 206
         },
157 207
         {
158 208
             index: 'DLV_CNT', name: 'dlvCnt',
159 209
             label: '입고대기건수',
160
-            width: '10', fixed: false, align: 'center',
210
+            width: '10', fixed: false, align: 'right',
161 211
             sortable: false, hidden: false
162 212
         },
163 213
         {
164 214
             index: 'RPCH_CNT', name: 'rpchCnt',
165 215
             label: '반품요청건수',
166
-            width: '10', fixed: false, align: 'center',
216
+            width: '10', fixed: false, align: 'right',
167 217
             sortable: false, hidden: false
168 218
         },
169 219
         {
170 220
             index: 'RODR_CNT', name: 'rodrCnt',
171 221
             label: '반품진행건수',
172
-            width: '10', fixed: false, align: 'center',
222
+            width: '10', fixed: false, align: 'right',
173 223
             sortable: false, hidden: false
174 224
         },
175 225
         {
176 226
             index: 'PICK_CNT', name: 'pickCnt',
177 227
             label: '수거대기건수',
178
-            width: '10', fixed: false, align: 'center',
228
+            width: '10', fixed: false, align: 'right',
179 229
             sortable: false, hidden: false
180 230
         },
181 231
         {
182 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 235
             sortable: false, editable: true, formatter: 'select', edittype: 'select',
186 236
 			editoptions: {value: ITP_COMMON_LOAN_DVSN}
187 237
         },
188 238
         {
189 239
             index: 'CREDT_LIMT_AMT', name: 'credtLimtAmt',
190 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 247
             index: 'CHG_PASS_YN', name: 'chgPassYn',
196 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 339
 /*목록화면 Object*/
288 340
 let listObj = {
289 341
     init: function () {
290
-        //this.grid_brand.init();
342
+    	let param = $('#ITP_FORM_OPER07010_SEARCH').serializeObject();
343
+    	listObj.load(param);
291 344
         this.grid_store.init();
292 345
     },
293 346
     button: {
@@ -298,15 +351,22 @@ let listObj = {
298 351
     		param.gridSize = $.jgrid.defaults.rowNum;
299 352
 			param.gridPage = $.jgrid.defaults.page;
300 353
 			// console.log(JSON.stringify(param));
354
+			if (!('brandId' in param)) {
355
+				param.brandId = '';
356
+			}
301 357
 			listObj.load(param);
302 358
 			// $(OPER07010_BRAND_GRID_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
303 359
 			$(OPER07010_STORE_GRID_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
360
+			editStoreNum = 0;
304 361
 		},
305 362
 		modify: function() {
306 363
 			listObj.grid_store.itp_OPER07010_search = true;
307 364
     		let param = $('#ITP_FORM_OPER07010_SEARCH').serializeObject();
308 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 370
     		var searchFn = function() {
311 371
     			listObj.load(param);
312 372
     			$(OPER07010_STORE_GRID_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
@@ -347,7 +407,7 @@ let listObj = {
347 407
         		colModel: gridColModel.brand,
348 408
         		data: gridData,
349 409
         		loadComplete: function(data) {
350
-        			console.log(data);
410
+        			// console.log(data);
351 411
         			$(_this.gridList).find('.ui-jqgrid .ui-jqgrid-bdiv').css('overflow-x', 'hidden');
352 412
 					(Array.isArray(data.rows) && data.rows.length === 0) ? $(_this.gridEmpty).show() : $(_this.gridEmpty).hide();
353 413
 				}