|
@@ -51,12 +51,6 @@ let API_DETAIL_PASSQTY = '/api/stock/mng/whs-passqty-list'; // 창고선
|
51
|
51
|
/*화면 Grid ColModel*/
|
52
|
52
|
const gridColModel = {
|
53
|
53
|
list: [
|
54
|
|
- {
|
55
|
|
- index: 'PCH_REQ_UNQ_NO', name: 'pchReqUnqNo',
|
56
|
|
- label: ITP_MSG_LOCALE.label.pchReqUnqNo, //구매요청고유번호
|
57
|
|
- width: '10', fixed: false, align: 'center',
|
58
|
|
- sortable: false, hidden: true
|
59
|
|
- },
|
60
|
54
|
{
|
61
|
55
|
index: 'PCH_REQ_DTL_NO', name: 'pchReqDtlNo',
|
62
|
56
|
label: ITP_MSG_LOCALE.label.pchReqDtlNo, //구매요청상세번호
|
|
@@ -75,6 +69,24 @@ const gridColModel = {
|
75
|
69
|
width: '10', fixed: false, align: 'center',
|
76
|
70
|
sortable: false, hidden: false
|
77
|
71
|
},
|
|
72
|
+ {
|
|
73
|
+ index: 'DLV_DVSN', name: 'dlvDvsn',
|
|
74
|
+ label: ITP_MSG_LOCALE.label.dlvDvsnNm, //배송구분
|
|
75
|
+ width: '10', fixed: false, align: 'center',
|
|
76
|
+ sortable: false, hidden: true
|
|
77
|
+ },
|
|
78
|
+ {
|
|
79
|
+ index: 'PCH_REQ_UNQ_NO', name: 'pchReqUnqNo',
|
|
80
|
+ label: ITP_MSG_LOCALE.label.pchReqUnqNo, //구매요청고유번호
|
|
81
|
+ width: '10', fixed: false, align: 'center',
|
|
82
|
+ sortable: false, hidden: false
|
|
83
|
+ },
|
|
84
|
+ {
|
|
85
|
+ index: 'DLV_DVSN_NM', name: 'dlvDvsnNm',
|
|
86
|
+ label: ITP_MSG_LOCALE.label.dlvDvsnNm, //배송구분
|
|
87
|
+ width: '10', fixed: false, align: 'center',
|
|
88
|
+ sortable: false, hidden: false
|
|
89
|
+ },
|
78
|
90
|
{
|
79
|
91
|
index: 'STORE_ID', name: 'storeId',
|
80
|
92
|
label: ITP_MSG_LOCALE.label.storeId, //매장아이디
|
|
@@ -139,19 +151,22 @@ const gridColModel = {
|
139
|
151
|
index: 'UNIT_AMT', name: 'unitAmt',
|
140
|
152
|
label: ITP_MSG_LOCALE.label.unitAmt, //구매요청단가
|
141
|
153
|
width: '10', fixed: false, align: 'right',
|
142
|
|
- sortable: false, hidden: true
|
|
154
|
+ sortable: false, hidden: true,
|
|
155
|
+ formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
|
143
|
156
|
},
|
144
|
157
|
{
|
145
|
158
|
index: 'PO_UNIT_AMT', name: 'poUnitAmt',
|
146
|
159
|
label: ITP_MSG_LOCALE.label.poUnitAmt, //발주단가
|
147
|
160
|
width: '10', fixed: false, align: 'right',
|
148
|
|
- sortable: false, hidden: true
|
|
161
|
+ sortable: false, hidden: true,
|
|
162
|
+ formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
|
149
|
163
|
},
|
150
|
164
|
{
|
151
|
165
|
index: 'PCH_REQ_QTY', name: 'pchReqQty',
|
152
|
166
|
label: ITP_MSG_LOCALE.label.pchReqQty, //구매요청수량
|
153
|
167
|
width: '10', fixed: false, align: 'right',
|
154
|
|
- sortable: false, hidden: false
|
|
168
|
+ sortable: false, hidden: false,
|
|
169
|
+ formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
|
155
|
170
|
},
|
156
|
171
|
{
|
157
|
172
|
index: 'DLV_REQ_DT', name: 'dlvReqDt',
|
|
@@ -163,13 +178,15 @@ const gridColModel = {
|
163
|
178
|
index: 'PCH_REQ_AMT', name: 'pchReqAmt',
|
164
|
179
|
label: ITP_MSG_LOCALE.label.pchReqAmt, //납품요청금액
|
165
|
180
|
width: '10', fixed: false, align: 'right',
|
166
|
|
- sortable: false, hidden: false
|
|
181
|
+ sortable: false, hidden: false,
|
|
182
|
+ formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
|
167
|
183
|
},
|
168
|
184
|
{
|
169
|
185
|
index: 'PCH_ORD_AMT', name: 'pchOrdAmt',
|
170
|
186
|
label: ITP_MSG_LOCALE.label.pchOrdSpplyAmt, //본사납품금액
|
171
|
187
|
width: '10', fixed: false, align: 'right',
|
172
|
|
- sortable: false, hidden: false
|
|
188
|
+ sortable: false, hidden: false,
|
|
189
|
+ formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
|
173
|
190
|
},
|
174
|
191
|
{
|
175
|
192
|
index: 'LEAD_TIME', name: 'leadTime',
|
|
@@ -183,13 +200,13 @@ const gridColModel = {
|
183
|
200
|
index: 'VIEW_CD', name: 'viewCd',
|
184
|
201
|
label: ITP_MSG_LOCALE.label.viewCd,
|
185
|
202
|
width: '10', fixed: false, align: 'center',
|
186
|
|
- sortable: false, hidden: false
|
|
203
|
+ sortable: false, hidden: true
|
187
|
204
|
},
|
188
|
205
|
{
|
189
|
206
|
index: 'PCH_REQ_UNQ_NO', name: 'pchReqUnqNo',
|
190
|
207
|
label: ITP_MSG_LOCALE.label.pchReqUnqNo, //구매요청번호
|
191
|
208
|
width: '20', fixed: false, align: 'center',
|
192
|
|
- sortable: false, hidden: true, edittype: 'text',
|
|
209
|
+ sortable: false, hidden: false, edittype: 'text',
|
193
|
210
|
editable: false
|
194
|
211
|
},
|
195
|
212
|
{
|
|
@@ -218,7 +235,8 @@ const gridColModel = {
|
218
|
235
|
label: ITP_MSG_LOCALE.label.unitAmt, //단가
|
219
|
236
|
width: '10', fixed: false, align: 'right',
|
220
|
237
|
sortable: false, editable: false, edittype: 'text',
|
221
|
|
- hidden: false
|
|
238
|
+ hidden: false,
|
|
239
|
+ formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
|
222
|
240
|
},
|
223
|
241
|
{
|
224
|
242
|
index: 'UNIT', name: 'unit',
|
|
@@ -232,21 +250,24 @@ const gridColModel = {
|
232
|
250
|
label: ITP_MSG_LOCALE.label.pchReqQty, //구매요청수량
|
233
|
251
|
width: '10', fixed: false, align: 'right',
|
234
|
252
|
sortable: false, editable: false, edittype: 'text',
|
235
|
|
- hidden: false
|
|
253
|
+ hidden: false,
|
|
254
|
+ formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
|
236
|
255
|
},
|
237
|
256
|
{
|
238
|
257
|
index: 'PODR_QTY', name: 'podrQty',
|
239
|
258
|
label: ITP_MSG_LOCALE.label.podrQty, //발주수량
|
240
|
259
|
width: '10', fixed: false, align: 'right',
|
241
|
260
|
sortable: false, editable: true, edittype: 'text',
|
242
|
|
- editrules: {required: true}, hidden: false
|
|
261
|
+ editrules: {required: true}, hidden: false,
|
|
262
|
+ formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
|
243
|
263
|
},
|
244
|
264
|
{
|
245
|
265
|
index: 'PODR_AMT', name: 'podrAmt',
|
246
|
266
|
label: ITP_MSG_LOCALE.label.podrAmt, //발주금액
|
247
|
267
|
width: '10', fixed: false, align: 'right',
|
248
|
268
|
sortable: false, editable: false, edittype: 'text',
|
249
|
|
- hidden: false
|
|
269
|
+ hidden: false,
|
|
270
|
+ formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
|
250
|
271
|
},
|
251
|
272
|
{
|
252
|
273
|
index: 'DLV_REQ_DT', name: 'dlvReqDt',
|
|
@@ -260,7 +281,8 @@ const gridColModel = {
|
260
|
281
|
label: ITP_MSG_LOCALE.label.whsPassQty, //출고가능수량
|
261
|
282
|
width: '10', fixed: false, align: 'right',
|
262
|
283
|
sortable: false, editable: false, edittype: 'text',
|
263
|
|
- hidden: false
|
|
284
|
+ hidden: false,
|
|
285
|
+ formatter:'integer',formatoptions: { defaultValue: '', thousandsSeparator: ',' }
|
264
|
286
|
},
|
265
|
287
|
{
|
266
|
288
|
index: 'BRAND_UNIT_UNQ_NO', name: 'brandUnitUnqNo',
|
|
@@ -445,9 +467,9 @@ let pageObj = {
|
445
|
467
|
for (var i=selectedIds.length-1; i>=0; i--) {
|
446
|
468
|
selRowData = $(POMNG03010_GRID_ID).jqGrid('getRowData', selectedIds[i]);
|
447
|
469
|
}
|
448
|
|
- console.log(selRowData);
|
|
470
|
+
|
449
|
471
|
const key1 = {pchReqUnqNo:selRowData.pchReqUnqNo, storeId:selRowData.storeId};
|
450
|
|
- //console.log(key);
|
|
472
|
+
|
451
|
473
|
fn_call_popup('biz', 'BIZPOP_PO_REJECT', '#ITP_ASIDE', popFn, key1, 'S');
|
452
|
474
|
}
|
453
|
475
|
|
|
@@ -470,16 +492,14 @@ let pageObj = {
|
470
|
492
|
},
|
471
|
493
|
searNSpply: function(rowDataPop) {
|
472
|
494
|
if(rowDataPop) {
|
473
|
|
- //console.log(rowDataPop);
|
|
495
|
+
|
474
|
496
|
var pspplyId = $('#ITP_FORM_POMNG03010_NDETAIL_SPPLY_ID').val();
|
475
|
|
- //console.log(pspplyId);
|
|
497
|
+
|
476
|
498
|
if (pspplyId == "") {
|
477
|
|
- // console.log("null");
|
|
499
|
+
|
478
|
500
|
$('#ITP_FORM_POMNG03010_NDETAIL_SPPLY_NM').val(rowDataPop.spplyNm);
|
479
|
501
|
$('#ITP_FORM_POMNG03010_NDETAIL_SPPLY_ID').val(rowDataPop.spplyId);
|
480
|
502
|
} else {
|
481
|
|
- //$('#Table_ID').getGridParam('reccount');
|
482
|
|
- // console.log("cpzm");
|
483
|
503
|
var records = $(POMNG03010_NDETAIL_GRID_ID).getGridParam('reccount')
|
484
|
504
|
if (records != 0) {
|
485
|
505
|
if (pspplyId != rowDataPop.spplyId ) {
|
|
@@ -526,7 +546,6 @@ let pageObj = {
|
526
|
546
|
},
|
527
|
547
|
poRej: function(rowDataPop) {
|
528
|
548
|
if(rowDataPop) {
|
529
|
|
- console.log(rowDataPop);
|
530
|
549
|
|
531
|
550
|
if (rowDataPop.retVal == "Y") {
|
532
|
551
|
modifyObj.button.rejectSave(rowDataPop);
|
|
@@ -559,6 +578,16 @@ let pageObj = {
|
559
|
578
|
}
|
560
|
579
|
});
|
561
|
580
|
});
|
|
581
|
+
|
|
582
|
+ $('body').on('click', function(e) {
|
|
583
|
+
|
|
584
|
+ var gridId = ((SCREEN_MODE === 'NPC') ? POMNG03010_NDETAIL_GRID_ID : POMNG03010_DETAIL_GRID_ID).replace('#', '');
|
|
585
|
+ var rids = $( (SCREEN_MODE === 'NPC') ? POMNG03010_NDETAIL_GRID_ID : POMNG03010_DETAIL_GRID_ID).jqGrid('getDataIDs');
|
|
586
|
+ var last_row_id = rids[rids.length - 1];
|
|
587
|
+
|
|
588
|
+ itp_fn_grid_reset_selection(e, last_row_id, gridId, (SCREEN_MODE === 'NPC') ? 'POMNG03010_NDETAIL' : 'POMNG03010_DETAIL');
|
|
589
|
+ pageObj.grid.recal();
|
|
590
|
+ });
|
562
|
591
|
|
563
|
592
|
}
|
564
|
593
|
},
|
|
@@ -654,8 +683,7 @@ let pageObj = {
|
654
|
683
|
});
|
655
|
684
|
|
656
|
685
|
if (diffchk == "Y") return;
|
657
|
|
- //console.log(chkSpplyNm);
|
658
|
|
- //console.log(diffchk);
|
|
686
|
+
|
659
|
687
|
if (spplyId == "" ) {
|
660
|
688
|
$('#ITP_FORM_POMNG03010_NDETAIL_SPPLY_ID').val(chkSpplyId);
|
661
|
689
|
$('#ITP_FORM_POMNG03010_NDETAIL_SPPLY_NM').val(chkSpplyNm);
|
|
@@ -717,7 +745,7 @@ let pageObj = {
|
717
|
745
|
gridId: _this.gridId,
|
718
|
746
|
colModel: gridColModel.detail,
|
719
|
747
|
data: gridRows,
|
720
|
|
- cellEdit: true,
|
|
748
|
+ //cellEdit: true,
|
721
|
749
|
multiselect: (mode === 'NPC'),
|
722
|
750
|
loadComplete: function(data) {
|
723
|
751
|
$(mode === 'NPC' ? POMNG03010_NDETAIL_GRID_LIST : POMNG03010_DETAIL_GRID_LIST).find('.ui-jqgrid .ui-jqgrid-bdiv').css('overflow-x', 'hidden');
|
|
@@ -726,36 +754,41 @@ let pageObj = {
|
726
|
754
|
|
727
|
755
|
},
|
728
|
756
|
onCellSelect: function(rowid, cellIdx, cellValue) {
|
729
|
|
- //POMNG03010_GRID_LAST_ROW_ID = itp_fn_set_data_editable(rowid, cellIdx, POMNG03010_GRID_LAST_ROW_ID, _this.gridId, ['actionId']);
|
730
|
|
- },
|
731
|
|
- afterSaveCell: function(rowid,name,val,iRow,iCol) {
|
732
|
|
- // 구매요청금액 계산 (기존금액과 )
|
733
|
|
- var unitAmt = jQuery(_this.gridId).jqGrid('getCell',rowid,iCol-3);
|
734
|
|
- jQuery(_this.gridId).jqGrid('setRowData',rowid,{podrAmt: parseInt(val)*parseInt(unitAmt)});
|
735
|
|
-
|
736
|
|
- // 그리드 포문으로 금액 재계산후 구매요청금액에 넣어줌
|
737
|
|
- pageObj.grid.recal( mode,_this.gridId);
|
|
757
|
+ POMNG03010_GRID_LAST_ROW_ID = itp_fn_set_data_editable(rowid, cellIdx, POMNG03010_GRID_LAST_ROW_ID, _this.gridId, ['pchReqDtlNo']);
|
738
|
758
|
}
|
739
|
759
|
};
|
740
|
760
|
itp_fn_grid_make_local(option);
|
741
|
761
|
},
|
742
|
|
- recal: function(mode, gridId) {
|
|
762
|
+ recal: function() {
|
743
|
763
|
//PCH_REQ_AMT
|
744
|
|
- const rowData = $(gridId).getRowData();
|
745
|
|
- var podrAmt = 0 ;
|
746
|
|
- $.each(rowData, function(key, value) {
|
747
|
|
- if (value.podrAmt != null && value.podrAmt != "" && value.viewCd != "D") {
|
748
|
|
- podrAmt = podrAmt + parseInt(value.podrAmt) ;
|
749
|
|
- }
|
|
764
|
+ if (SCREEN_MODE == 'NPC' || SCREEN_MODE === 'POC') {
|
|
765
|
+ var ids = $((SCREEN_MODE === 'NPC') ? POMNG03010_NDETAIL_GRID_ID : POMNG03010_DETAIL_GRID_ID).getDataIDs();
|
|
766
|
+ $.each(ids, function(idx, rowId) {
|
|
767
|
+ var viewCd = jQuery(SCREEN_MODE === 'NPC' ? POMNG03010_NDETAIL_GRID_ID : POMNG03010_DETAIL_GRID_ID).jqGrid('getCell', rowId, 'viewCd');
|
|
768
|
+ var unitAmt = jQuery(SCREEN_MODE === 'NPC' ? POMNG03010_NDETAIL_GRID_ID : POMNG03010_DETAIL_GRID_ID).jqGrid('getCell', rowId, 'unitAmt');
|
|
769
|
+ var podrQty = jQuery(SCREEN_MODE === 'NPC' ? POMNG03010_NDETAIL_GRID_ID : POMNG03010_DETAIL_GRID_ID).jqGrid('getCell', rowId, 'podrQty');
|
|
770
|
+
|
|
771
|
+ if(viewCd != 'D' && unitAmt != null && unitAmt != '' && podrQty != null && podrQty != '') {
|
|
772
|
+
|
|
773
|
+ jQuery(SCREEN_MODE === 'NPC' ? POMNG03010_NDETAIL_GRID_ID : POMNG03010_DETAIL_GRID_ID).jqGrid('setRowData',rowId,{podrAmt: parseInt(unitAmt)*parseInt(podrQty)});
|
|
774
|
+ }
|
|
775
|
+ });
|
750
|
776
|
|
751
|
|
- });
|
|
777
|
+ const rowData = $((SCREEN_MODE == 'NPC') ? POMNG03010_NDETAIL_GRID_ID : POMNG03010_DETAIL_GRID_ID).getRowData();
|
|
778
|
+ var podrAmt = 0 ;
|
|
779
|
+ $.each(rowData, function(key, value) {
|
|
780
|
+ if (value.podrAmt != null && value.podrAmt != "" && value.viewCd != "D") {
|
|
781
|
+ podrAmt = podrAmt + parseInt(value.podrAmt) ;
|
|
782
|
+ }
|
|
783
|
+
|
|
784
|
+ });
|
752
|
785
|
|
753
|
|
- if (mode == 'NPC') {
|
754
|
|
- $('#ITP_FORM_POMNG03010_NDETAIL .fnPodrAmt').text(podrAmt);
|
755
|
|
- } else {
|
756
|
|
- $('#ITP_FORM_POMNG03010_DETAIL .fnPodrAmt').text(podrAmt);
|
|
786
|
+ if (SCREEN_MODE == 'NPC') {
|
|
787
|
+ $('#ITP_FORM_POMNG03010_NDETAIL .fnPodrAmt').text(podrAmt);
|
|
788
|
+ } else {
|
|
789
|
+ $('#ITP_FORM_POMNG03010_DETAIL .fnPodrAmt').text(podrAmt);
|
|
790
|
+ }
|
757
|
791
|
}
|
758
|
|
-
|
759
|
792
|
},
|
760
|
793
|
clearData : function(mode) {
|
761
|
794
|
$(mode === 'NPC' ? POMNG03010_NDETAIL_GRID_ID : POMNG03010_DETAIL_GRID_ID).jqGrid('clearGridData', true);
|
|
@@ -920,7 +953,7 @@ let modifyObj = {
|
920
|
953
|
listObj.grid.search();
|
921
|
954
|
},
|
922
|
955
|
rejectSave: function(param) {
|
923
|
|
- console.log(param);
|
|
956
|
+
|
924
|
957
|
var modalFn = {
|
925
|
958
|
callBack: () => {
|
926
|
959
|
var searhFn = function () {
|
|
@@ -934,7 +967,7 @@ let modifyObj = {
|
934
|
967
|
itp_fn_modal_confirm('구매요청 반려 하시겠습니까?', modalFn);
|
935
|
968
|
},
|
936
|
969
|
save: function() {
|
937
|
|
-
|
|
970
|
+ $('body').trigger('click');
|
938
|
971
|
const formId = (SCREEN_MODE == 'NPC' ? '#ITP_FORM_POMNG03010_NDETAIL' : '#ITP_FORM_POMNG03010_DETAIL');
|
939
|
972
|
itp_fn_form_clear_validate(null, formId);
|
940
|
973
|
|
|
@@ -943,16 +976,16 @@ let modifyObj = {
|
943
|
976
|
|
944
|
977
|
if (SCREEN_MODE == 'NPC') {
|
945
|
978
|
const rowData1 = $(POMNG03010_NDETAIL_GRID_ID).getRowData();
|
946
|
|
- //console.log("stsrt");
|
|
979
|
+
|
947
|
980
|
var dataCnt = 0;
|
948
|
981
|
$.each(rowData1, function(key, value) {
|
949
|
982
|
console.log(value.viewCd);
|
950
|
983
|
if (value.viewCd != 'D') {
|
951
|
|
- console.log("count");
|
|
984
|
+
|
952
|
985
|
dataCnt = dataCnt + 1;
|
953
|
986
|
}
|
954
|
987
|
});
|
955
|
|
- //console.log(dataCnt);
|
|
988
|
+
|
956
|
989
|
|
957
|
990
|
if (dataCnt == 0) {
|
958
|
991
|
alert( "발주 생성할 품목내역이 없습니다.");
|
|
@@ -1011,6 +1044,7 @@ let modifyObj = {
|
1011
|
1044
|
pageObj.grid.clearData();
|
1012
|
1045
|
modifyObj.button.cancel();
|
1013
|
1046
|
}
|
|
1047
|
+ console.log(JSON.stringify(param));
|
1014
|
1048
|
fn_ajax_call(API_DETAIL_SAVE, JSON.stringify(param), searhFn, 'POST');
|
1015
|
1049
|
}
|
1016
|
1050
|
};
|
|
@@ -1040,7 +1074,7 @@ let modifyObj = {
|
1040
|
1074
|
$('#ITP_FORM_POMNG03010_DETAIL #ITP_FORM_POMNG03010_DETAIL_PODR_MGR_TEL_NO').val(result.podrMgrTelNo);
|
1041
|
1075
|
$('#ITP_FORM_POMNG03010_DETAIL #ITP_FORM_POMNG03010_DETAIL_DLV_DVSN').val(result.dlvDvsn);
|
1042
|
1076
|
//$('#ITP_FORM_POMNG03010_DETAIL #ITP_FORM_POMNG03010_DETAIL_').val(result.dlvDvsnNm);
|
1043
|
|
- $('#ITP_FORM_POMNG03010_DETAIL .fnPodrAmt').text(result.podrTotalAmt);
|
|
1077
|
+ $('#ITP_FORM_POMNG03010_DETAIL .fnPodrAmt').text(itp_fn_number_comma(result.podrTotalAmt));
|
1044
|
1078
|
$('#ITP_FORM_POMNG03010_DETAIL #ITP_FORM_POMNG03010_DETAIL_DLV_REQ_DT').val(result.dlvReqDt);
|
1045
|
1079
|
$('#ITP_FORM_POMNG03010_DETAIL #ITP_FORM_POMNG03010_DETAIL_SHMT_WHS_ID').val(result.shmtWhsId);
|
1046
|
1080
|
$('#ITP_FORM_POMNG03010_DETAIL #ITP_FORM_POMNG03010_DELETE_SHMT_WHS_NM').val(result.shmtWhsNm + " - " + result.shmtLocationNm );
|
|
@@ -1057,8 +1091,6 @@ let modifyObj = {
|
1057
|
1091
|
},
|
1058
|
1092
|
passQtyCallback: function (result) {
|
1059
|
1093
|
|
1060
|
|
- console.log(result);
|
1061
|
|
- console.log(result.size());
|
1062
|
1094
|
|
1063
|
1095
|
/*
|
1064
|
1096
|
if ($(gridId).jqGrid('getCell', rowId, 'viewCd') === 'R') {
|