|
@@ -0,0 +1,467 @@
|
|
1
|
+require(['config'], function() {
|
|
2
|
+ require([
|
|
3
|
+ ], function($) {
|
|
4
|
+ pageObj.init();
|
|
5
|
+ });
|
|
6
|
+});
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+// 화면변수
|
|
10
|
+const ORDMNG01010_GRID_ID = '#ITP_ORDMNG01010_jqGrid';
|
|
11
|
+const ORDMNG01010_GRID_LIST = '#ITP_ORDMNG01010_jqGrid_list';
|
|
12
|
+const ORDMNG01010_GRID_PAGER = '#ITP_ORDMNG01010_jqGridPager';
|
|
13
|
+const ORDMNG01010_GRID_EMPTY = '#ITP_ORDMNG01010_jqGridEmpty';
|
|
14
|
+
|
|
15
|
+const ORDMNG01010_VIEW_GRID_ID = '#ITP_ORDMNG01010_VIEW_jqGrid';
|
|
16
|
+const ORDMNG01010_VIEW_GRID_LIST = '#ITP_ORDMNG01010_VIEW_jqGrid_list';
|
|
17
|
+const ORDMNG01010_VIEW_GRID_PAGER = '#ITP_ORDMNG01010_VIEW_jqGridPager';
|
|
18
|
+const ORDMNG01010_VIEW_GRID_EMPTY = '#ITP_ORDMNG01010_VIEW_jqGridEmpty';
|
|
19
|
+
|
|
20
|
+let ITP_COMMON_PCH_ODR_ST_CD = fn_make_common_cd_list(CODE_LIST, 'PCH_ODR_ST_CD', true, '발주상태코드');
|
|
21
|
+
|
|
22
|
+//API URL
|
|
23
|
+let API_POMNG_PO_SPPLY_PO_GRID_LIST = '/api/pomng/po/spply-po-grid-list';
|
|
24
|
+let API_POMNG_PO_INFO_SPPLY_PCHORD = '/api/pomng/po/info-spply-pchOdr';
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+//화면 grid ColModel
|
|
28
|
+const gridColModel = {
|
|
29
|
+ list:[
|
|
30
|
+ {
|
|
31
|
+ index: 'VIEW_CD', name: 'viewCd',
|
|
32
|
+ label: ITP_MSG_LOCALE.label.viewCd,
|
|
33
|
+ width: '10', fixed: false, align: 'center',
|
|
34
|
+ sortable: false, hidden: true
|
|
35
|
+ },
|
|
36
|
+ {
|
|
37
|
+ index: 'BRAND_ID', name: 'brandId',
|
|
38
|
+ label: ITP_MSG_LOCALE.label.brandId,
|
|
39
|
+ width: '10', fixed: false, align: 'center',
|
|
40
|
+ sortable: false, hidden: true
|
|
41
|
+ },
|
|
42
|
+ {
|
|
43
|
+ index: 'PODR_MGR_NM', name: 'podrMgrNm',
|
|
44
|
+ label: ITP_MSG_LOCALE.label.podrMgrNm,
|
|
45
|
+ width: '10', fixed: false, align: 'center',
|
|
46
|
+ sortable: false, hidden: true
|
|
47
|
+ },
|
|
48
|
+ {
|
|
49
|
+ index: 'BRAND_NM', name: 'brandNm',
|
|
50
|
+ label: ITP_MSG_LOCALE.label.brandNm, // 브랜드명
|
|
51
|
+ width: '7', fixed: false, align: 'center',
|
|
52
|
+ sortable: false, hidden: false
|
|
53
|
+ },
|
|
54
|
+ {
|
|
55
|
+ index: 'PCH_PODR_UNQ_NO', name: 'pchPodrUnqNo',
|
|
56
|
+ label: ITP_MSG_LOCALE.label.pchPodrUnqNo, // 발주번호
|
|
57
|
+ width: '7', fixed: false, align: 'center',
|
|
58
|
+ sortable: false, hidden: false
|
|
59
|
+ },
|
|
60
|
+ {
|
|
61
|
+ index: 'PCH_ORD_ST_CD', name: 'pchOdrStCd',
|
|
62
|
+ label: ITP_MSG_LOCALE.label.pchOdrStNm, // 발주상태
|
|
63
|
+ width: '7', fixed: false, align: 'center',
|
|
64
|
+ sortable: false, formatter: 'select',
|
|
65
|
+ editoptions: {value: ITP_COMMON_PCH_ODR_ST_CD}
|
|
66
|
+ },
|
|
67
|
+ {
|
|
68
|
+ index: 'PODR_DT', name: 'podrDt',
|
|
69
|
+ label: ITP_MSG_LOCALE.label.podrDt, // 발주일자
|
|
70
|
+ width: '8', fixed: false, align: 'center',
|
|
71
|
+ sortable: false, hidden: false
|
|
72
|
+ },
|
|
73
|
+ {
|
|
74
|
+ index: 'DIV_REQ_DT', name: 'dlvReqDt',
|
|
75
|
+ label: ITP_MSG_LOCALE.label.dlvReqDt, // 납품요청일
|
|
76
|
+ width: '8', fixed: false, align: 'center',
|
|
77
|
+ sortable: false, hidden: false
|
|
78
|
+ },
|
|
79
|
+ {
|
|
80
|
+ index: 'WHS_NM', name: 'whsNm',
|
|
81
|
+ label: ITP_MSG_LOCALE.label.whsNm, // 납품장소
|
|
82
|
+ width: '7', fixed: false, align: 'center',
|
|
83
|
+ sortable: false, hidden: false
|
|
84
|
+ },
|
|
85
|
+ {
|
|
86
|
+ index: 'PODR_TOTAL_AMT', name: 'podrTotalAmt',
|
|
87
|
+ label: ITP_MSG_LOCALE.label.podrTotalAmt, // 총 발주금액
|
|
88
|
+ width: '7', fixed: false, align: 'center',
|
|
89
|
+ sortable: false, hidden: false,
|
|
90
|
+ formatter: 'integer', formatoptions: {thousandsSeparator: ','}
|
|
91
|
+ },
|
|
92
|
+ {
|
|
93
|
+ index: 'SPPLY_ITME_ID', name: 'podrItemQty',
|
|
94
|
+ label: ITP_MSG_LOCALE.label.podrItemQty, // 발주품목수
|
|
95
|
+ width: '8', fixed: false, align: 'center',
|
|
96
|
+ sortable: false, hidden: false
|
|
97
|
+ },
|
|
98
|
+ {
|
|
99
|
+ index: 'PODR_MGR_NM', name: 'podrMgrNm',
|
|
100
|
+ label: ITP_MSG_LOCALE.label.podrMgrNm, // 발주 담당자
|
|
101
|
+ width: '8', fixed: false, align: 'center',
|
|
102
|
+ sortable: false, hidden: false
|
|
103
|
+ }
|
|
104
|
+ ],
|
|
105
|
+ view: [
|
|
106
|
+ {
|
|
107
|
+ index: 'PCH_PODR_DTL_NO', name: 'pchPodrDtlNo',
|
|
108
|
+ label: ITP_MSG_LOCALE.label.pchPodrDtlNo, // 항번
|
|
109
|
+ width: '10', fixed: false, align: 'center',
|
|
110
|
+ sortable: false, hidden: false
|
|
111
|
+ },
|
|
112
|
+ {
|
|
113
|
+ index: 'ITEM_ID', name: 'itemId',
|
|
114
|
+ label: ITP_MSG_LOCALE.label.itemId, // 품목번호
|
|
115
|
+ width: '10', fixed: false, align: 'center',
|
|
116
|
+ sortable: false, hidden: false
|
|
117
|
+ },
|
|
118
|
+ {
|
|
119
|
+ index: 'ITEM_NM', name: 'itemNm',
|
|
120
|
+ label: ITP_MSG_LOCALE.label.itemNm, // 품목명
|
|
121
|
+ width: '8', fixed: false, align: 'center',
|
|
122
|
+ sortable: false, hidden: false
|
|
123
|
+ },
|
|
124
|
+ {
|
|
125
|
+ index: 'UNIT_AMT', name: 'unitAmt',
|
|
126
|
+ label: ITP_MSG_LOCALE.label.unitAmt, // 단가
|
|
127
|
+ width: '8', fixed: false, align: 'center',
|
|
128
|
+ sortable: false, hidden: false,
|
|
129
|
+ formatter: 'integer', formatoptions: {thousandsSeparator: ','}
|
|
130
|
+ },
|
|
131
|
+ {
|
|
132
|
+ index: 'UNIT', name: 'unit',
|
|
133
|
+ label: ITP_MSG_LOCALE.label.unit, // 기본단위
|
|
134
|
+ width: '8', fixed: false, align: 'center',
|
|
135
|
+ sortable: false, hidden: false
|
|
136
|
+ },
|
|
137
|
+ {
|
|
138
|
+ index: 'PODR_QTY', name: 'podrQty',
|
|
139
|
+ label: ITP_MSG_LOCALE.label.podrQty, // 발주수량
|
|
140
|
+ width: '8', fixed: false, align: 'center',
|
|
141
|
+ sortable: false, hidden: false
|
|
142
|
+ },
|
|
143
|
+ {
|
|
144
|
+ index: 'PODR_AMT', name: 'podrAmt',
|
|
145
|
+ label: ITP_MSG_LOCALE.label.podrAmt, // 발주금액
|
|
146
|
+ width: '8', fixed: false, align: 'center',
|
|
147
|
+ sortable: false, hidden: false,
|
|
148
|
+ formatter: 'integer', formatoptions: {thousandsSeparator: ','}
|
|
149
|
+ }
|
|
150
|
+ ],
|
|
151
|
+ detail: []
|
|
152
|
+};
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+/*화면공통 Object*/
|
|
156
|
+let pageObj = {
|
|
157
|
+ init: function() {
|
|
158
|
+ this.ui.init();
|
|
159
|
+ this.event.init();
|
|
160
|
+ },
|
|
161
|
+ ui: {
|
|
162
|
+ init: function() {
|
|
163
|
+ this.view();
|
|
164
|
+ this.grid();
|
|
165
|
+ this.ready();
|
|
166
|
+ },
|
|
167
|
+ view: function() {
|
|
168
|
+ // 버튼 권한설정
|
|
169
|
+ fn_proc_btn_auth('ORDMNG01010');
|
|
170
|
+ // 공통코드 표시
|
|
171
|
+ $('select').each(function() {
|
|
172
|
+ if($(this).data('select-code')) {
|
|
173
|
+ fn_make_select(CODE_LIST, $(this).data('select-code'), $(this).attr('id'));
|
|
174
|
+ }
|
|
175
|
+ });
|
|
176
|
+ // 조회일자 지정
|
|
177
|
+ var now = new Date();
|
|
178
|
+ $('#ITP_TAB_ORDMNG01010 .input-group.date').datepicker(ITP_DATE_LANGUAGE);
|
|
179
|
+
|
|
180
|
+ $('#ITP_FORM_ORDMNG01010_SEARCH_FROM_DT').datepicker('setDate', '2022.10.01');
|
|
181
|
+ $('#ITP_FORM_ORDMNG01010_SEARCH_TO_DT').datepicker('setDate', '2024.10.01');
|
|
182
|
+ },
|
|
183
|
+ grid: function() {
|
|
184
|
+ itp_fn_jqgrid_resize(ORDMNG01010_GRID_ID, ORDMNG01010_GRID_LIST, 'lg');
|
|
185
|
+ listObj.empty.init();
|
|
186
|
+ itp_fn_fire_window_resize();
|
|
187
|
+ },
|
|
188
|
+ ready: function() {
|
|
189
|
+ listObj.init();
|
|
190
|
+ }
|
|
191
|
+ },
|
|
192
|
+ event: {
|
|
193
|
+ init: function() {
|
|
194
|
+ this.button();
|
|
195
|
+ },
|
|
196
|
+ button: function() {
|
|
197
|
+ // 버튼 클릭 이벤트
|
|
198
|
+ $('button').each(function() {
|
|
199
|
+ var id = $(this).attr('id');
|
|
200
|
+ $(this).on('click', function() {
|
|
201
|
+ switch (id) {
|
|
202
|
+ case 'ITP_BTN_ORDMNG01010_SRH' : listObj.button.search(); break; // 조회 버튼 클릭
|
|
203
|
+ case 'ITP_BTN_ORDMNG01010_NEWREG' : listObj.button.create(); break; // 신규등록 버튼
|
|
204
|
+ case 'ITP_BTN_ORDMNG01010_MODIFY' : modifyObj.button.modify(); break; // 수정 버튼
|
|
205
|
+ case 'ITP_BTN_ORDMNG01010_CANCELLIST' : viewObj.button.cancel(); break; // 취소/목록 버튼
|
|
206
|
+ case 'ITP_BTN_ORDMNG01010_DELETE' : break; // 삭제 버튼
|
|
207
|
+ case 'ITP_BTN_ORDMNG01010_SAVE' : createObj.button.save(); break; // 저장 버튼
|
|
208
|
+ case 'ITP_FORM_ORDMNG01010_VIEW_DUP' : createObj.button.duplicate(); break; // 중복체크
|
|
209
|
+ case 'ITP_BTN_ORDMNG01010_RESET_PW' : createObj.button.resetPass(); break; // 상세:비밀번호 초기화
|
|
210
|
+ case 'ITP_BTN_ORDMNG01010_VIEW_ADDROW' : pageObj.grid.button.addRow(); break; // 상세:추가버튼
|
|
211
|
+ case 'ITP_BTN_ORDMNG01010_VIEW_DELROW' : pageObj.grid.button.delRow(); break; // 상세:삭제버튼
|
|
212
|
+ }
|
|
213
|
+ });
|
|
214
|
+ });
|
|
215
|
+ }
|
|
216
|
+ },
|
|
217
|
+ switchScreen: function(mode) {
|
|
218
|
+ $('.itp_det_head').find('button[id^="ITP_BTN_ORDMNG01010_"]').each(function(i) {
|
|
219
|
+ $(this).hide();
|
|
220
|
+ });
|
|
221
|
+ $('#ITP_TAB_ORDMNG01010').find('div[id$="_CONTAINER"]').each(function(i) {
|
|
222
|
+ $(this).hide();
|
|
223
|
+ });
|
|
224
|
+ if(mode == 'LIST') { // 목록
|
|
225
|
+ fn_show_btn_auth_array(['#ITP_BTN_ORDMNG01010_SRH', '#ITP_BTN_ORDMNG01010_NEWREG']);
|
|
226
|
+ $('#ITP_AJAX_ORDMNG01010_LIST_CONTAINER').show();
|
|
227
|
+ $('#ITP_FORM_ORDMNG01010_SEARCH #ITP_FORM_ORDMNG01010_SEARCH_BRAND_ID').val(fn_make_user_info.get('brandId'));
|
|
228
|
+ } else if(mode == 'ADD') { // 등록
|
|
229
|
+ $('#ITP_AJAX_ORDMNG01010_DETAIL_CONTAINER').show();
|
|
230
|
+ fn_show_btn_auth_array(['#ITP_BTN_ORDMNG01010_CANCELLIST', '#ITP_BTN_ORDMNG01010_SAVE']);
|
|
231
|
+
|
|
232
|
+ $('#ITP_FORM_ORDMNG01010_DETAIL').find('input, textarea, select, checkbox').each(function(i, elem) {
|
|
233
|
+ $(this).attr('id') === 'ITP_FORM_ORDMNG01010_DETAIL_VIEW_CD' ? $(this).val('C') : $(this).val('');
|
|
234
|
+ if(elem.type === 'select') {
|
|
235
|
+ $(this).val('').prop('selected', true);
|
|
236
|
+ }
|
|
237
|
+ });
|
|
238
|
+ $('#ITP_FORM_ORDMNG01010_DETAIL #ITP_FORM_ORDMNG01010_DETAIL_FILE_NO').val('');
|
|
239
|
+ $('#ITP_FORM_ORDMNG01010_DETAIL_BRAND_ID').removeAttr('readonly');
|
|
240
|
+ $('#ITP_FORM_ORDMNG01010_DETAIL_BRAND_NM').removeAttr('readonly');
|
|
241
|
+ $('#ITP_FORM_ORDMNG01010_DETAIL_BSNS_REG_NO').removeAttr('readonly');
|
|
242
|
+ $('#ITP_FORM_ORDMNG01010_DETAIL_CORP_REG_NO').removeAttr('readonly');
|
|
243
|
+ // $('#ITP_FORM_ORDMNG01010_DETAIL_SEARCH_AFFL_SHOP').removeAttr('disabled');
|
|
244
|
+ // $('#ITP_FORM_ORDMNG01010_DETAIL_DELETE_AFFL_SHOP').removeAttr('disabled');
|
|
245
|
+ $('#ITP_FORM_ORDMNG01010_DETAIL_SEARCH_AFFL_SHOP').show();
|
|
246
|
+ $('#ITP_FORM_ORDMNG01010_DETAIL_DELETE_AFFL_SHOP').show();
|
|
247
|
+ $('#ITP_FORM_ORDMNG01010_DETAIL .itp_form_info').hide();
|
|
248
|
+ $('#ITP_FORM_ORDMNG01010_DETAIL .itp_form_change').show();
|
|
249
|
+
|
|
250
|
+ $('#ITP_FORM_ORDMNG01010_DETAIL #ITP_FORM_ORDMNG01010_DETAIL_AFFL_SHOP_ID').val(fn_make_user_info.get('afflShopId'));
|
|
251
|
+ $('#ITP_FORM_ORDMNG01010_DETAIL #ITP_FORM_ORDMNG01010_DETAIL_BRAND_ID').val(fn_make_user_info.get('brandId'));
|
|
252
|
+
|
|
253
|
+ $('.fnBrandId').text('(자동부여)');
|
|
254
|
+ } else if(mode == 'MODIFY') { // 수정
|
|
255
|
+ $('#ITP_AJAX_ORDMNG01010_DETAIL_CONTAINER').show();
|
|
256
|
+ fn_show_btn_auth_array(['#ITP_BTN_ORDMNG01010_CANCELLIST', '#ITP_BTN_ORDMNG01010_SAVE']);
|
|
257
|
+
|
|
258
|
+ $('#ITP_FORM_ORDMNG01010_DETAIL_BRAND_ID').attr('readonly', true);
|
|
259
|
+ $('#ITP_FORM_ORDMNG01010_DETAIL_BRAND_NM').attr('readonly', true);
|
|
260
|
+ $('#ITP_FORM_ORDMNG01010_DETAIL_BSNS_REG_NO').attr('readonly', true);
|
|
261
|
+ $('#ITP_FORM_ORDMNG01010_DETAIL_CORP_REG_NO').attr('readonly', true);
|
|
262
|
+ // $('#ITP_FORM_ORDMNG01010_DETAIL_SEARCH_AFFL_SHOP').attr('disabled', true);
|
|
263
|
+ // $('#ITP_FORM_ORDMNG01010_DETAIL_DELETE_AFFL_SHOP').attr('disabled', true);
|
|
264
|
+ $('#ITP_FORM_ORDMNG01010_DETAIL_SEARCH_AFFL_SHOP').hide();
|
|
265
|
+ $('#ITP_FORM_ORDMNG01010_DETAIL_DELETE_AFFL_SHOP').hide();
|
|
266
|
+ $('#ITP_FORM_ORDMNG01010_DETAIL .itp_form_info').show();
|
|
267
|
+ $('#ITP_FORM_ORDMNG01010_DETAIL .itp_form_change').hide();
|
|
268
|
+
|
|
269
|
+ $('#ITP_FORM_ORDMNG01010_DETAIL #ITP_FORM_ORDMNG01010_DETAIL_BRAND_ID').val(fn_make_user_info.get('brandId'));
|
|
270
|
+ } else if(mode == 'VIEW') { // 보기
|
|
271
|
+ $('#ITP_AJAX_ORDMNG01010_VIEW_CONTAINER').show();
|
|
272
|
+ fn_show_btn_auth_array(['#ITP_BTN_ORDMNG01010_MODIFY', '#ITP_BTN_ORDMNG01010_CANCELLIST']);
|
|
273
|
+ }
|
|
274
|
+ }
|
|
275
|
+};
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+/*목록화면 Object*/
|
|
279
|
+let listObj = {
|
|
280
|
+ init: function() {
|
|
281
|
+ this.grid.init();
|
|
282
|
+ },
|
|
283
|
+ itp_ORDMNG01010_param: {},
|
|
284
|
+ itp_ORDMNG01010_search: false,
|
|
285
|
+ button: {
|
|
286
|
+ search: function() {
|
|
287
|
+ listObj.itp_ORDMNG01010_search = true;
|
|
288
|
+ let param = $('#ITP_FORM_ORDMNG01010_SEARCH').serializeObject();
|
|
289
|
+ param.gridSize = $.jgrid.defaults.rowNum;
|
|
290
|
+ param.gridPage = $.jgrid.defaults.page;
|
|
291
|
+ console.log(JSON.stringify(param));
|
|
292
|
+ $(ORDMNG01010_GRID_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
|
|
293
|
+ }
|
|
294
|
+ },
|
|
295
|
+ empty: {
|
|
296
|
+ init: function() {
|
|
297
|
+ var _this = this;
|
|
298
|
+ this.push();
|
|
299
|
+ $(ORDMNG01010_GRID_EMPTY).on('click', function() {
|
|
300
|
+ _this.back();
|
|
301
|
+ listObj.itp_ORDMNG01010_param.gridSize = $.jgrid.defaults.rowNum;
|
|
302
|
+ $(ORDMNG01010_GRID_ID).setGridParam({'postData': JSON.stringify(listObj.itp_ORDMNG01010_param)}).trigger('reloadGrid');
|
|
303
|
+ });
|
|
304
|
+ },
|
|
305
|
+ push: function() {
|
|
306
|
+ let param = $('#ITP_FORM_ORDMNG01010_SEARCH').serializeObject();
|
|
307
|
+ listObj.itp_ORDMNG01010_param = param;
|
|
308
|
+ },
|
|
309
|
+ back: function() {
|
|
310
|
+ $('#ITP_FORM_ORDMNG01010_SERVICE_BRAND_TYPE').val(listObj.itp_ORDMNG01010_param.brandType);
|
|
311
|
+ $('#ITP_FORM_ORDMNG01010_SERVICE_ST_CD').val(listObj.itp_ORDMNG01010_param.stCd);
|
|
312
|
+ $('#ITP_FORM_ORDMNG01010_SEARCH_BRAND_NM').val(listObj.itp_ORDMNG01010_param.brandNm);
|
|
313
|
+ }
|
|
314
|
+ },
|
|
315
|
+ grid: {
|
|
316
|
+ init: function() {
|
|
317
|
+ // 데이터 없을때
|
|
318
|
+ listObj.empty.push();
|
|
319
|
+ this.search();
|
|
320
|
+ },
|
|
321
|
+ colModel: gridColModel.list,
|
|
322
|
+ search: function() {
|
|
323
|
+ pageObj.switchScreen('LIST');
|
|
324
|
+ this.unload();
|
|
325
|
+ this.load();
|
|
326
|
+ },
|
|
327
|
+ load: function() {
|
|
328
|
+ let param = $('#ITP_FORM_ORDMNG01010_SEARCH').serializeObject();
|
|
329
|
+ param.gridSize = $.jgrid.defaults.rowNum;
|
|
330
|
+ param.sbrandId = LOGIN_USER_INFO.brandId;
|
|
331
|
+ param.sspplyId = LOGIN_USER_INFO.spplyId;
|
|
332
|
+ param.sidx = '0';
|
|
333
|
+ console.log(JSON.stringify(param));
|
|
334
|
+ var option = {
|
|
335
|
+ gridId: ORDMNG01010_GRID_ID,
|
|
336
|
+ colModel: gridColModel.list,
|
|
337
|
+ param: param,
|
|
338
|
+ url: DOMAIN + API_POMNG_PO_SPPLY_PO_GRID_LIST,
|
|
339
|
+ pager: ORDMNG01010_GRID_PAGER,
|
|
340
|
+ onCellSelect: function(rowId, cellIdx, cellValue) {
|
|
341
|
+ var cm = $(this).jqGrid('getGridParam', 'colModel');
|
|
342
|
+ var colNm = cm[cellIdx].name;
|
|
343
|
+ if (colNm === 'pchPodrUnqNo') {
|
|
344
|
+ const pchPodrUnqNoVal = $(this).jqGrid('getCell', rowId, 'pchPodrUnqNo');
|
|
345
|
+ const brandIdVal = $(this).jqGrid('getCell', rowId, 'brandId');
|
|
346
|
+ const spplyIdVal = LOGIN_USER_INFO.spplyId;
|
|
347
|
+ const key = {pchPodrUnqNo: pchPodrUnqNoVal, brandId: brandIdVal, spplyId: spplyIdVal};
|
|
348
|
+ var param = $.param(key);
|
|
349
|
+ viewObj.init(param);
|
|
350
|
+ }
|
|
351
|
+ },
|
|
352
|
+ loadComplete: function(data) {
|
|
353
|
+ console.log(data);
|
|
354
|
+ itp_fn_grid_load_complete(data, ORDMNG01010_GRID_ID, true, 'number', 'ORDMNG01010', listObj.itp_ORDMNG01010_search, listObj.empty, true, data.gridRecords, true);
|
|
355
|
+ var ids = $(ORDMNG01010_GRID_ID).getDataIDs();
|
|
356
|
+ $.each(ids, function(idx, rowId) {
|
|
357
|
+ $(ORDMNG01010_GRID_ID).jqGrid('setCell', rowId, 'pchPodrUnqNo', '', ITP_GRID_COL_STYLE.link);
|
|
358
|
+ });
|
|
359
|
+ },
|
|
360
|
+ onPaging: function(action) {
|
|
361
|
+ itp_fn_grid_paging(ORDMNG01010_GRID_ID, action, param);
|
|
362
|
+ }
|
|
363
|
+ };
|
|
364
|
+ itp_fn_grid_make_remote(option);
|
|
365
|
+ },
|
|
366
|
+ clearData: function() {
|
|
367
|
+ $(ORDMNG01010_GRID_ID).jqGrid('clearGridData', true);
|
|
368
|
+ $(ORDMNG01010_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
|
|
369
|
+ $(ORDMNG01010_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
|
|
370
|
+ $(ORDMNG01010_GRID_EMPTY).show();
|
|
371
|
+ },
|
|
372
|
+ unload: function() {
|
|
373
|
+ $.jgrid.gridUnload(ORDMNG01010_GRID_ID);
|
|
374
|
+ }
|
|
375
|
+ }
|
|
376
|
+};
|
|
377
|
+
|
|
378
|
+/*상세화면 Object*/
|
|
379
|
+let viewObj = {
|
|
380
|
+ init: function(param) {
|
|
381
|
+ console.log(param);
|
|
382
|
+ this.load(param);
|
|
383
|
+ },
|
|
384
|
+ itp_ORDMNG01010_param: {},
|
|
385
|
+ itp_ORDMNG01010_search: false,
|
|
386
|
+ button: {
|
|
387
|
+ cancel: function() {
|
|
388
|
+ listObj.grid.search();
|
|
389
|
+ }
|
|
390
|
+ },
|
|
391
|
+ empty: {
|
|
392
|
+ init: function() {
|
|
393
|
+ var _this = this;
|
|
394
|
+ this.push();
|
|
395
|
+ $(ORDMNG01010_VIEW_GRID_EMPTY).on('click', function() {
|
|
396
|
+ _this.back();
|
|
397
|
+ viewObj.itp_ORDMNG01010_param.gridSize = $.jgrid.defaults.rowNum;
|
|
398
|
+ $(ORDMNG01010_GRID_ID).setGridParam({'postData': JSON.stringify(viewObj.itp_ORDMNG01010_param)}).trigger('reloadGrid');
|
|
399
|
+ });
|
|
400
|
+ },
|
|
401
|
+ push: function() {
|
|
402
|
+ let param = $('#ITP_FORM_ORDMNG01010_VIEW').serializeObject();
|
|
403
|
+ viewObj.itp_ORDMNG01010_param = param;
|
|
404
|
+ },
|
|
405
|
+ back: function() {
|
|
406
|
+ $('#ITP_FORM_ORDMNG01010_SERVICE_BRAND_TYPE').val(viewObj.itp_ORDMNG01010_param.brandType);
|
|
407
|
+ $('#ITP_FORM_ORDMNG01010_SERVICE_ST_CD').val(viewObj.itp_ORDMNG01010_param.stCd);
|
|
408
|
+ $('#ITP_FORM_ORDMNG01010_SEARCH_BRAND_NM').val(viewObj.itp_ORDMNG01010_param.brandNm);
|
|
409
|
+ }
|
|
410
|
+ },
|
|
411
|
+ load: function(param) {
|
|
412
|
+ fn_ajax_call(API_POMNG_PO_INFO_SPPLY_PCHORD, param, this.callback, 'GET');
|
|
413
|
+ },
|
|
414
|
+ callback: function(result) {
|
|
415
|
+ console.log(result);
|
|
416
|
+
|
|
417
|
+ function convertTel(value){
|
|
418
|
+ answer = (value.startsWith('0')) ? value.replace(/[^0-9]/g, "")
|
|
419
|
+ .replace(/(^02|^0505|^1[0-9]{3}|^0[0-9]{2})([0-9]+)?([0-9]{4})$/,"$1-$2-$3")
|
|
420
|
+ .replace("--", "-") : '';
|
|
421
|
+ return answer;
|
|
422
|
+ }
|
|
423
|
+ let telNo = convertTel(result.podrMgrTelNo);
|
|
424
|
+
|
|
425
|
+ pageObj.switchScreen('VIEW');
|
|
426
|
+ $('#ITP_FORM_ORDMNG01010_VIEW #ITP_FORM_ORDMNG01010_VIEW_AFFL_SHOP_ID').val(result.afflShopId);
|
|
427
|
+ $('#ITP_FORM_ORDMNG01010_VIEW .fnBrandNm').text(result.brandNm); // 브랜드명
|
|
428
|
+ $('#ITP_FORM_ORDMNG01010_VIEW .fnPchPodrUnqNo').text(result.pchPodrUnqNo);
|
|
429
|
+ $('#ITP_FORM_ORDMNG01010_VIEW .fnPodrDt').text(result.podrDt);
|
|
430
|
+ $('#ITP_FORM_ORDMNG01010_VIEW .fnPchOdrStCd').text(result.pchOdrStNm);
|
|
431
|
+ $('#ITP_FORM_ORDMNG01010_VIEW .fnPodrTotalAmt').text(result.podrTotalAmt.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ','));
|
|
432
|
+ $('#ITP_FORM_ORDMNG01010_VIEW .fnPodrMgrNm').text(result.podrMgrNm + ' (' + telNo + ')');
|
|
433
|
+ $('#ITP_FORM_ORDMNG01010_VIEW .fnDlvReqDt').text(result.dlvReqDt);
|
|
434
|
+
|
|
435
|
+ viewObj.grid.init('VIEW', result.pchOdrDtlList)
|
|
436
|
+ },
|
|
437
|
+ grid: {
|
|
438
|
+ init: function(mode, gridData) {
|
|
439
|
+ this.mode = mode;
|
|
440
|
+ this.gridId = (mode === 'VIEW') ? ORDMNG01010_VIEW_GRID_ID : ORDMNG01010_DETAIL_GRID_ID;
|
|
441
|
+ this.gridList = (mode === 'VIEW') ? ORDMNG01010_VIEW_GRID_LIST : ORDMNG01010_DETAIL_GRID_LIST;
|
|
442
|
+ this.gridEmpty = (mode === 'VIEW') ? ORDMNG01010_VIEW_GRID_EMPTY : ORDMNG01010_DETAIL_GRID_EMPTY;
|
|
443
|
+ this.unload();
|
|
444
|
+ this.load(mode, gridData);
|
|
445
|
+ },
|
|
446
|
+ mode: '',
|
|
447
|
+ colModel: gridColModel.view,
|
|
448
|
+ load: function(mode, gridData) {
|
|
449
|
+ var _this = this;
|
|
450
|
+ var option = {
|
|
451
|
+ gridId: _this.gridId,
|
|
452
|
+ colModel: gridColModel.view,
|
|
453
|
+ data: gridData,
|
|
454
|
+ multiselect: true,
|
|
455
|
+ loadComplete: function(data) {
|
|
456
|
+ console.log(data);
|
|
457
|
+ itp_fn_grid_load_complete(data, ORDMNG01010_VIEW_GRID_ID, true, 'number', 'ORDMNG01010', viewObj.itp_ORDMNG01010_search, viewObj.empty, true, data.gridRecords, true);
|
|
458
|
+ }
|
|
459
|
+ };
|
|
460
|
+ itp_fn_grid_make_local(option);
|
|
461
|
+ },
|
|
462
|
+ unload: function() {
|
|
463
|
+ $.jgrid.gridUnload(this.gridId);
|
|
464
|
+ }
|
|
465
|
+ }
|
|
466
|
+
|
|
467
|
+};
|