|
@@ -41,25 +41,7 @@ const gridColModel = {
|
41
|
41
|
label: ITP_MSG_LOCALE.label.viewCd,
|
42
|
42
|
width: '10', fixed: false, align: 'center',
|
43
|
43
|
sortable: false, hidden: true
|
44
|
|
- },
|
45
|
|
- {
|
46
|
|
- index: 'STTL_MGNT_UNQ_NO', name: 'sttlMgntUnqNo',
|
47
|
|
- label: "정산관리고유번호",
|
48
|
|
- width: '0', fixed: false, align: 'center',
|
49
|
|
- sortable: false, hidden: true
|
50
|
|
- },
|
51
|
|
- {
|
52
|
|
- index: 'STTL_MGNT_DTL_NO', name: 'sttlMgntDtlNo',
|
53
|
|
- label: '정산관리상세번호',
|
54
|
|
- width: '10', fixed: false, align: 'center',
|
55
|
|
- sortable: false, hidden: true
|
56
|
|
- },
|
57
|
|
- {
|
58
|
|
- index: 'MGNT_UNQ_NO', name: 'mgntUnqNo',
|
59
|
|
- label: '관리고유번호',
|
60
|
|
- width: '10', fixed: false, align: 'center',
|
61
|
|
- sortable: false, hidden: true
|
62
|
|
- },
|
|
44
|
+ },
|
63
|
45
|
{
|
64
|
46
|
index: 'BRAND_NM', name: 'brandNm',
|
65
|
47
|
label: "브랜드",
|
|
@@ -73,15 +55,15 @@ const gridColModel = {
|
73
|
55
|
sortable: false, hidden: false
|
74
|
56
|
},
|
75
|
57
|
{
|
76
|
|
- index: 'LOAN_DVSN', name: 'loanDvsn',
|
77
|
|
- label: "정산타입",
|
78
|
|
- width: '8', fixed: false, align: 'center',
|
|
58
|
+ index: 'SPPLY_NM', name: 'spplyNm',
|
|
59
|
+ label: "공급사명",
|
|
60
|
+ width: '10', fixed: false, align: 'center',
|
79
|
61
|
sortable: false, hidden: true
|
80
|
62
|
},
|
81
|
63
|
{
|
82
|
|
- index: 'LOAN_DVSN_NM', name: 'loanDvsnNm',
|
83
|
|
- label: "정산타입",
|
84
|
|
- width: '8', fixed: false, align: 'center',
|
|
64
|
+ index: 'STTL_MGNT_UNQ_NO', name: 'sttlMgntUnqNo',
|
|
65
|
+ label: "정산번호",
|
|
66
|
+ width: '10', fixed: false, align: 'center',
|
85
|
67
|
sortable: false, hidden: false
|
86
|
68
|
},
|
87
|
69
|
{
|
|
@@ -93,92 +75,48 @@ const gridColModel = {
|
93
|
75
|
{
|
94
|
76
|
index: 'STTL_ST_NM', name: 'sttlStNm',
|
95
|
77
|
label: "정산상태",
|
96
|
|
- width: '8', fixed: false, align: 'center',
|
|
78
|
+ width: '10', fixed: false, align: 'center',
|
97
|
79
|
sortable: false, hidden: false
|
98
|
80
|
},
|
99
|
81
|
{
|
100
|
|
- index: 'ITEM_ID', name: 'itemId',
|
101
|
|
- label: "품목코드",
|
|
82
|
+ index: 'STTL_REQ_DT', name: 'sttlReqDt',
|
|
83
|
+ label: "정산요청일",
|
102
|
84
|
width: '10', fixed: false, align: 'center',
|
103
|
85
|
sortable: false, editable: false, edittype: 'text'
|
104
|
86
|
},
|
105
|
87
|
{
|
106
|
|
- index: 'ITEM_NM', name: 'itemNm',
|
107
|
|
- label: "품목명",
|
|
88
|
+ index: 'STTL_REQ_AMT', name: 'sttlReqAmt',
|
|
89
|
+ label: "정산요청금액",
|
108
|
90
|
width: '10', fixed: false, align: 'center',
|
109
|
|
- sortable: false, editable: false, edittype: 'text'
|
110
|
|
- },
|
111
|
|
- {
|
112
|
|
- index: 'UNIT', name: 'unit',
|
113
|
|
- label: "단위",
|
114
|
|
- width: '6', fixed: false, align: 'center',
|
115
|
|
- sortable: false, editable: false, edittype: 'text'
|
116
|
|
- },
|
117
|
|
- {
|
118
|
|
- index: 'UNIT_AMT', name: 'unitAmt',
|
119
|
|
- label: "단가",
|
120
|
|
- width: '7', fixed: false, align: 'center',
|
121
|
91
|
sortable: false, editable: false, edittype: 'text',
|
122
|
92
|
formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
|
123
|
|
- },
|
|
93
|
+ },
|
124
|
94
|
{
|
125
|
|
- index: 'PODR_QTY', name: 'podrQty',
|
126
|
|
- label: "발주수량",
|
127
|
|
- width: '7', fixed: false, align: 'center',
|
128
|
|
- sortable: false, editable: false, edittype: 'text',
|
129
|
|
- formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
|
|
95
|
+ index: 'STTL_DT', name: 'sttlDt',
|
|
96
|
+ label: "정산일",
|
|
97
|
+ width: '10', fixed: false, align: 'center',
|
|
98
|
+ sortable: false, editable: false, edittype: 'text'
|
130
|
99
|
},
|
131
|
100
|
{
|
132
|
|
- index: 'DLV_QTY', name: 'dlvQty',
|
133
|
|
- label: "납품수량",
|
134
|
|
- width: '7', fixed: false, align: 'center',
|
|
101
|
+ index: 'STTL_REQ_AMT', name: 'sttlAmt',
|
|
102
|
+ label: "정산금액",
|
|
103
|
+ width: '10', fixed: false, align: 'center',
|
135
|
104
|
sortable: false, editable: false, edittype: 'text',
|
136
|
105
|
formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
|
137
|
106
|
},
|
138
|
107
|
{
|
139
|
|
- index: 'WHS_COL_QTY', name: 'whsColQty',
|
140
|
|
- label: "입고/수거수량",
|
|
108
|
+ index: 'ACCT_BAL', name: 'acctBal',
|
|
109
|
+ label: "잔금",
|
141
|
110
|
width: '10', fixed: false, align: 'center',
|
142
|
111
|
sortable: false, editable: false, edittype: 'text',
|
143
|
112
|
formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
|
144
|
113
|
},
|
145
|
114
|
{
|
146
|
|
- index: 'WHS_COL_DT', name: 'whsColDt',
|
147
|
|
- label: "입고/수거일자",
|
148
|
|
- width: '10', fixed: false, align: 'center',
|
149
|
|
- sortable: false, editable: false, edittype: 'text'
|
150
|
|
- },
|
151
|
|
- {
|
152
|
|
- index: 'WHS_COL_AMT', name: 'whsColAmt',
|
153
|
|
- label: "입고/수거금액",
|
|
115
|
+ index: 'STTL_REG_MGR_NM', name: 'sttlRegMgrNm',
|
|
116
|
+ label: "등록자",
|
154
|
117
|
width: '10', fixed: false, align: 'center',
|
155
|
|
- sortable: false, editable: false, edittype: 'text',
|
156
|
|
- formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
|
157
|
|
- },
|
158
|
|
- {
|
159
|
|
- index: 'STTL_DVSN', name: 'sttlDvsn',
|
160
|
|
- label: "정산구분",
|
161
|
|
- width: '8', fixed: false, align: 'center',
|
162
|
|
- sortable: false, hidden: true
|
163
|
|
- },
|
164
|
|
- {
|
165
|
|
- index: 'STTL_DVSN_NM', name: 'sttlDvsnNm',
|
166
|
|
- label: "정산구분",
|
167
|
|
- width: '8', fixed: false, align: 'center',
|
168
|
|
- sortable: false, editable: false, edittype: 'text'
|
169
|
|
- },
|
170
|
|
- {
|
171
|
|
- index: 'PODR_UNQ_NO', name: 'podrUnqNo',
|
172
|
|
- label: "발주번호",
|
173
|
|
- width: '8', fixed: false, align: 'center',
|
174
|
118
|
sortable: false, editable: false, edittype: 'text'
|
175
|
|
- },
|
176
|
|
- {
|
177
|
|
- index: 'PODR_DTL_NO', name: 'podrDtlNo',
|
178
|
|
- label: "발주항번",
|
179
|
|
- width: '7', fixed: false, align: 'center',
|
180
|
|
- sortable: false, editable: false, edittype: 'text'
|
181
|
|
- }
|
|
119
|
+ }
|
182
|
120
|
],
|
183
|
121
|
view: [
|
184
|
122
|
{
|
|
@@ -343,6 +281,7 @@ let pageObj = {
|
343
|
281
|
event: {
|
344
|
282
|
init: function () {
|
345
|
283
|
this.button();
|
|
284
|
+ this.change();
|
346
|
285
|
},
|
347
|
286
|
button: function () {
|
348
|
287
|
// 버튼 클릭 이벤트
|
|
@@ -352,8 +291,8 @@ let pageObj = {
|
352
|
291
|
switch (id) {
|
353
|
292
|
case 'ITP_BTN_SETTMNG03010_SRH' : listObj.button.search(); break; // 조회 버튼 클릭
|
354
|
293
|
case 'ITP_BTN_SETTMNG03010_CANCELLIST' : modifyObj.button.cancel(); break; // 취소/목록 버튼
|
355
|
|
- case 'ITP_BTN_SETTMNG03010_NEWREG' : listObj.button.reqSttl(); break; // 정산요청 버튼
|
356
|
|
- case 'ITP_BTN_SETTMNG03010_REQUEST' : modifyObj.button.request(); break; // 요청 버튼
|
|
294
|
+ // case 'ITP_BTN_SETTMNG03010_NEWREG' : listObj.button.reqSttl(); break; // 정산요청 버튼
|
|
295
|
+ // case 'ITP_BTN_SETTMNG03010_REQUEST' : modifyObj.button.request(); break; // 요청 버튼
|
357
|
296
|
}
|
358
|
297
|
});
|
359
|
298
|
});
|
|
@@ -365,6 +304,29 @@ let pageObj = {
|
365
|
304
|
itp_fn_grid_reset_selection(e, last_row_id, gridId, 'SETTMNG03010_DETAIL');
|
366
|
305
|
});
|
367
|
306
|
|
|
307
|
+ },
|
|
308
|
+ change: function() {
|
|
309
|
+ $('#ITP_FORM_SETTMNG03010_SEARCH_STORE_SPPLY_GUBUN').on('change', function() {
|
|
310
|
+ var gubunVal = $('#ITP_FORM_SETTMNG03010_SEARCH_STORE_SPPLY_GUBUN').val();
|
|
311
|
+ if(gubunVal == '1') { // 매장
|
|
312
|
+ $('#ITP_FORM_SETTMNG03010_SEARCH_STORE_SPPLY_NM').attr('placeholder', '매장명');
|
|
313
|
+
|
|
314
|
+ $(SETTMNG03010_GRID_ID).jqGrid('hideCol', ["spplyNm"]);
|
|
315
|
+ $(SETTMNG03010_GRID_ID).jqGrid('showCol', ["storeNm"]);
|
|
316
|
+ // $(SETTMNG03010_GRID_ID).setColProp('spplyNm', {hidden: true});
|
|
317
|
+ // $(SETTMNG03010_GRID_ID).setColProp('storeNm', {hidden: false});
|
|
318
|
+
|
|
319
|
+ } else if(gubunVal == '2') { // 공급업체
|
|
320
|
+ $('#ITP_FORM_SETTMNG03010_SEARCH_STORE_SPPLY_NM').attr('placeholder', '공급사명');
|
|
321
|
+
|
|
322
|
+ $(SETTMNG03010_GRID_ID).jqGrid('hideCol', ["storeNm"]);
|
|
323
|
+ $(SETTMNG03010_GRID_ID).jqGrid('showCol', ["spplyNm"]);
|
|
324
|
+ // $(SETTMNG03010_GRID_ID).setColProp('storeNm', {hidden: true});
|
|
325
|
+ // $(SETTMNG03010_GRID_ID).setColProp('spplyNm', {hidden: false});
|
|
326
|
+ }
|
|
327
|
+ listObj.button.search();
|
|
328
|
+ // itp_fn_jqgrid_resize(SETTMNG03010_GRID_ID, SETTMNG03010_GRID_LIST, 'lg');
|
|
329
|
+ });
|
368
|
330
|
}
|
369
|
331
|
},
|
370
|
332
|
switchScreen: function(mode) {
|
|
@@ -415,68 +377,6 @@ let listObj = {
|
415
|
377
|
param.gridSize = $.jgrid.defaults.rowNum;
|
416
|
378
|
param.gridPage = $.jgrid.defaults.page;
|
417
|
379
|
$(SETTMNG03010_GRID_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
|
418
|
|
- },
|
419
|
|
- reqSttl: function() { // 정산요청
|
420
|
|
- // 매장선택 체크
|
421
|
|
- if($('#ITP_FORM_SETTMNG03010_SEARCH_STORE_ID').val() == '') {
|
422
|
|
- itp_fn_modal_alert_ajax('정산요청을 위한 매장을 선택하세요.');
|
423
|
|
- return;
|
424
|
|
- }
|
425
|
|
-
|
426
|
|
- // 그리드에서 최소1개는 선택해야 함
|
427
|
|
- const rowKey = $(SETTMNG03010_GRID_ID).getGridParam('selrow');
|
428
|
|
- if (!rowKey) {
|
429
|
|
- itp_fn_modal_alert_ajax(ITP_MSG_LOCALE.message.ajax.noData);
|
430
|
|
- return;
|
431
|
|
- }
|
432
|
|
-
|
433
|
|
- var selectedIds = $(SETTMNG03010_GRID_ID).getGridParam('selarrrow');
|
434
|
|
- let sttlReqDataList = [];
|
435
|
|
- var check = true;
|
436
|
|
- $.each(selectedIds, function(key, value) {
|
437
|
|
- var sttlMgntUnqNo = $(SETTMNG03010_GRID_ID).jqGrid('getRowData', value).sttlMgntUnqNo;
|
438
|
|
- var sttlMgntDtlNo = $(SETTMNG03010_GRID_ID).jqGrid('getRowData', value).sttlMgntDtlNo;
|
439
|
|
- var loanDvsn = $(SETTMNG03010_GRID_ID).jqGrid('getRowData', value).loanDvsn; // 여신구분
|
440
|
|
- var sttlStCd = $(SETTMNG03010_GRID_ID).jqGrid('getRowData', value).sttlStCd; // 정산상태코드
|
441
|
|
- var sttlDvsn = $(SETTMNG03010_GRID_ID).jqGrid('getRowData', value).sttlDvsn; // 정산구분
|
442
|
|
- var mgntUnqNo = $(SETTMNG03010_GRID_ID).jqGrid('getRowData', value).mgntUnqNo;
|
443
|
|
-
|
444
|
|
- if(sttlStCd == 'ST10' || sttlStCd == 'ST20') { // 정산요청 및 정산확정 건은 정산요청이 불가능
|
445
|
|
- check = false;
|
446
|
|
- }
|
447
|
|
- let data = {}
|
448
|
|
- data.sttlMgntUnqNo = sttlMgntUnqNo;
|
449
|
|
- data.sttlMgntDtlNo = sttlMgntDtlNo;
|
450
|
|
- data.loanDvsn = loanDvsn;
|
451
|
|
- data.sttlDvsn = sttlDvsn;
|
452
|
|
- data.mgntUnqNo = mgntUnqNo;
|
453
|
|
- sttlReqDataList.push(data);
|
454
|
|
- });
|
455
|
|
- if(!check) {
|
456
|
|
- itp_fn_modal_alert_ajax('정산요청 및 확정된 건은 정산 요청이 불가능합니다.');
|
457
|
|
- return;
|
458
|
|
- }
|
459
|
|
-
|
460
|
|
- let param = {};
|
461
|
|
- param.brandId = $('#ITP_FORM_SETTMNG03010_SEARCH_BRAND_ID').val();
|
462
|
|
- param.storeId = $('#ITP_FORM_SETTMNG03010_SEARCH_STORE_ID').val();
|
463
|
|
- param.sttlReqDataList = sttlReqDataList;
|
464
|
|
- fn_ajax_call(STTL_REQ_REQUEST_STTL, JSON.stringify(param), function(result) {
|
465
|
|
-
|
466
|
|
- // alert(JSON.stringify(result));
|
467
|
|
- // $('#ITP_FORM_SETTMNG03010_DETAIL_STTL_MGNT_UNQ_NO').val(result.sttlMgntUnqNo);
|
468
|
|
-
|
469
|
|
- const sttlMgntUnqNoVal = result.sttlMgntUnqNo;
|
470
|
|
- const key = {sttlMgntUnqNo: sttlMgntUnqNoVal, viewCd: 'R'};
|
471
|
|
- var param = $.param(key);
|
472
|
|
- modifyObj.init(param);
|
473
|
|
-
|
474
|
|
- }, 'POST');
|
475
|
|
-
|
476
|
|
- // pageObj.switchScreen('ADD');
|
477
|
|
- // itp_fn_form_clear_validate(null, '#ITP_FORM_SETTMNG03010_DETAIL');
|
478
|
|
- // 로케이션 리스트 조회
|
479
|
|
- // createObj.init();
|
480
|
380
|
}
|
481
|
381
|
},
|
482
|
382
|
empty: {
|
|
@@ -524,11 +424,10 @@ let listObj = {
|
524
|
424
|
param: param,
|
525
|
425
|
url: DOMAIN + STTL_STATE_DETAIL_GRID_LIST,
|
526
|
426
|
pager: SETTMNG03010_GRID_PAGER,
|
527
|
|
- multiselect: true,
|
528
|
427
|
onCellSelect: function(rowId, cellIdx, cellValue) {
|
529
|
428
|
var cm = $(this).jqGrid('getGridParam', 'colModel');
|
530
|
429
|
var colNm = cm[cellIdx].name;
|
531
|
|
- if (colNm == 'sttlReqDt') {
|
|
430
|
+ if (colNm == 'sttlMgntUnqNo') {
|
532
|
431
|
const sttlMgntUnqNoVal = $(this).jqGrid('getCell', rowId, 'sttlMgntUnqNo');
|
533
|
432
|
|
534
|
433
|
const key = {sttlMgntUnqNo: sttlMgntUnqNoVal, viewCd: 'R'};
|
|
@@ -541,7 +440,7 @@ let listObj = {
|
541
|
440
|
itp_fn_grid_load_complete(data, SETTMNG03010_GRID_ID, true, 'number', 'SETTMNG03010', listObj.itp_SETTMNG03010_search, listObj.empty, true, data.gridRecords, true);
|
542
|
441
|
var ids = $(SETTMNG03010_GRID_ID).getDataIDs();
|
543
|
442
|
$.each(ids, function(idx, rowId) {
|
544
|
|
- // $(SETTMNG03010_GRID_ID).jqGrid('setCell', rowId, 'sttlReqDt', '', ITP_GRID_COL_STYLE.link);
|
|
443
|
+ $(SETTMNG03010_GRID_ID).jqGrid('setCell', rowId, 'sttlMgntUnqNo', '', ITP_GRID_COL_STYLE.link);
|
545
|
444
|
});
|
546
|
445
|
},
|
547
|
446
|
onPaging: function(action) {
|
|
@@ -570,37 +469,6 @@ let modifyObj = {
|
570
|
469
|
button: {
|
571
|
470
|
cancel: function() {
|
572
|
471
|
listObj.grid.search();
|
573
|
|
- },
|
574
|
|
- request: function() {
|
575
|
|
-
|
576
|
|
- const formId = '#ITP_FORM_SETTMNG03010_DETAIL';
|
577
|
|
- itp_fn_form_clear_validate(null, formId);
|
578
|
|
-
|
579
|
|
- var vali_sttlReqDt = itp_fn_form_validate(formId, formId + '_STTL_REQ_DT', ['empty'], undefined); // 정산요청일자
|
580
|
|
-
|
581
|
|
- if (vali_sttlReqDt) {
|
582
|
|
- let sttlReqDataList = [];
|
583
|
|
- const rowData = $(SETTMNG03010_DETAIL_GRID_ID).getRowData();
|
584
|
|
- // const keyValue = $(formId + '_WHS_ID').val();
|
585
|
|
- $.each(rowData, function(key, value) {
|
586
|
|
- sttlReqDataList.push(value);
|
587
|
|
- });
|
588
|
|
- let param = $(formId).serializeObject();
|
589
|
|
- param.sttlReqDataList = sttlReqDataList;
|
590
|
|
-
|
591
|
|
- // console.log(JSON.stringify(param));
|
592
|
|
- var confirmFn= {
|
593
|
|
- callBack: function() {
|
594
|
|
- //
|
595
|
|
- var searhFn = function() {
|
596
|
|
- ITP_FORM_SETTMNG03010_DETAIL_IS_WRITING = false;
|
597
|
|
- listObj.grid.search();
|
598
|
|
- };
|
599
|
|
- fn_ajax_call(STTL_REQ_REQUEST_STTL_PROC, JSON.stringify(param), searhFn, 'POST');
|
600
|
|
- }
|
601
|
|
- };
|
602
|
|
- itp_fn_modal_confirm(ITP_MSG_LOCALE.message.form.procData, confirmFn, null);
|
603
|
|
- }
|
604
|
472
|
}
|
605
|
473
|
},
|
606
|
474
|
load: function(param) {
|