|
@@ -94,13 +94,13 @@ const gridColModel = {
|
94
|
94
|
sortable: false, hidden: true
|
95
|
95
|
},
|
96
|
96
|
{
|
97
|
|
- index: 'USER_ID', name: 'userId',
|
|
97
|
+ index: 'BRAND_ID', name: 'userId',
|
98
|
98
|
label: ITP_MSG_LOCALE.label.userId,
|
99
|
99
|
width: '20', fixed: false, align: 'center',
|
100
|
100
|
sortable: false, editable: false, edittype: 'text'
|
101
|
101
|
},
|
102
|
102
|
{
|
103
|
|
- index: 'USER_NM', name: 'userNm',
|
|
103
|
+ index: 'BRAND_NM', name: 'userNm',
|
104
|
104
|
label: ITP_MSG_LOCALE.label.userName,
|
105
|
105
|
width: '30', fixed: false, align: 'center',
|
106
|
106
|
sortable: false, editable: false, edittype: 'text'
|
|
@@ -179,8 +179,6 @@ let pageObj = {
|
179
|
179
|
this.ui.init();
|
180
|
180
|
this.event.init();
|
181
|
181
|
},
|
182
|
|
- itp_OPER02010_param: {},
|
183
|
|
- itp_OPER02010_search: false,
|
184
|
182
|
ui: {
|
185
|
183
|
init: function () {
|
186
|
184
|
this.button();
|
|
@@ -265,6 +263,14 @@ let pageObj = {
|
265
|
263
|
// $('#ITP_FORM_OPER02010_DETAIL_TARGET_CD').val('');
|
266
|
264
|
$('#ITP_FORM_OPER02010_FROM_DT').datepicker('setDate', new Date());
|
267
|
265
|
$('#ITP_FORM_OPER02010_TO_DT').datepicker('setDate', new Date());
|
|
266
|
+
|
|
267
|
+ $('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DETAIL_SEARCH_AFFL_SHOP_ID').val('');
|
|
268
|
+ $('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DETAIL_SEARCH_AFFL_SHOP_NM').val('');
|
|
269
|
+ $('#ITP_FORM_OPER02010_DETAIL_SEARCH_AFFL_SHOP').removeAttr('disabled');
|
|
270
|
+ $('#ITP_FORM_OPER02010_DETAIL_DELETE_AFFL_SHOP').removeAttr('disabled');
|
|
271
|
+ $('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DETAIL_SEARCH_BRAND_ID option').remove();
|
|
272
|
+ $('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DETAIL_SEARCH_AFFL_SHOP_NM').removeAttr('readonly');
|
|
273
|
+ $('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DETAIL_SEARCH_BRAND_ID').removeAttr('readonly');
|
268
|
274
|
} else if(mode == 'MODIFY') { // 수정
|
269
|
275
|
$('#ITP_BTN_OPER02010_SRH').hide();
|
270
|
276
|
$('#ITP_BTN_OPER02010_MODIFY').hide();
|
|
@@ -276,6 +282,11 @@ let pageObj = {
|
276
|
282
|
$('#ITP_AJAX_OPER02010_LIST_CONTAINER').hide();
|
277
|
283
|
$('#ITP_AJAX_OPER02010_DETAIL_CONTAINER').show();
|
278
|
284
|
$('#ITP_AJAX_OPER02010_VIEW_CONTAINER').hide();
|
|
285
|
+
|
|
286
|
+ $('#ITP_FORM_OPER02010_DETAIL_SEARCH_AFFL_SHOP').attr('disabled', true);
|
|
287
|
+ $('#ITP_FORM_OPER02010_DETAIL_DELETE_AFFL_SHOP').attr('disabled', true);
|
|
288
|
+ $('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DETAIL_SEARCH_AFFL_SHOP_NM').attr('readonly', true);
|
|
289
|
+ $('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DETAIL_SEARCH_BRAND_ID').attr('readonly', true);
|
279
|
290
|
} else if(mode == 'VIEW') { // 보기
|
280
|
291
|
$('#ITP_BTN_OPER02010_SRH').hide();
|
281
|
292
|
$('#ITP_BTN_OPER02010_NEWREG').hide();
|
|
@@ -373,7 +384,7 @@ let listObj = {
|
373
|
384
|
},
|
374
|
385
|
button: {
|
375
|
386
|
search: function () {
|
376
|
|
- pageObj.itp_OPER02010_search = true;
|
|
387
|
+ listObj.grid.itp_OPER02010_search = true;
|
377
|
388
|
let param = $('#ITP_FORM_OPER02010_SEARCH').serializeObject();
|
378
|
389
|
param.gridSize = $.jgrid.defaults.rowNum;
|
379
|
390
|
param.gridPage = $.jgrid.defaults.page;
|
|
@@ -393,12 +404,14 @@ let listObj = {
|
393
|
404
|
itp_fn_fire_window_resize();
|
394
|
405
|
this.search();
|
395
|
406
|
},
|
|
407
|
+ itp_OPER02010_param: {},
|
|
408
|
+ itp_OPER02010_search: false,
|
|
409
|
+ colModel: gridColModel.list,
|
396
|
410
|
search: function() {
|
397
|
411
|
pageObj.switchScreen('LIST');
|
398
|
412
|
this.unload();
|
399
|
413
|
this.load();
|
400
|
414
|
},
|
401
|
|
- colModel: gridColModel.list,
|
402
|
415
|
load: function() {
|
403
|
416
|
var _this = this;
|
404
|
417
|
let param = $('#ITP_FORM_OPER02010_SEARCH').serializeObject();
|
|
@@ -421,10 +434,11 @@ let listObj = {
|
421
|
434
|
},
|
422
|
435
|
loadComplete: function(data) {
|
423
|
436
|
//console.log(JSON.stringify(data));
|
424
|
|
- itp_fn_grid_load_complete(data, OPER02010_GRID_ID, true, 'number', 'OPER02010', pageObj.itp_OPER02010_search, _this.itp_fn_OPER02010_empty, true, data.gridRecords, true);
|
|
437
|
+ itp_fn_grid_load_complete(data, OPER02010_GRID_ID, true, 'number', 'OPER02010', listObj.grid.itp_OPER02010_search, _this.itp_fn_OPER02010_empty, true, data.gridRecords, true);
|
425
|
438
|
var ids = $(OPER02010_GRID_ID).getDataIDs();
|
426
|
439
|
$.each(ids, function(idx, rowId) {
|
427
|
440
|
$(OPER02010_GRID_ID).jqGrid('setCell', rowId, 'nticeTitl', '', ITP_GRID_COL_STYLE.link);
|
|
441
|
+ // $(OPER02010_GRID_ID).jqGrid('setCell', rowId, 'afflShopNm', '', ITP_GRID_COL_STYLE.link);
|
428
|
442
|
});
|
429
|
443
|
|
430
|
444
|
if ($('#ITP_CONTAINER').data('openYn') == 'Y') {
|
|
@@ -433,10 +447,6 @@ let listObj = {
|
433
|
447
|
var paramNew = $.param(keyNew);
|
434
|
448
|
viewObj.init(paramNew);
|
435
|
449
|
}
|
436
|
|
- var ids = $(OPER02010_GRID_ID).getDataIDs();
|
437
|
|
- $.each(ids, function(idx, rowId) {
|
438
|
|
- $(OPER02010_GRID_ID).jqGrid('setCell', rowId, 'afflShopNm', '', ITP_GRID_COL_STYLE.link);
|
439
|
|
- });
|
440
|
450
|
}
|
441
|
451
|
};
|
442
|
452
|
itp_fn_grid_make_remote(option);
|
|
@@ -444,26 +454,24 @@ let listObj = {
|
444
|
454
|
itp_fn_OPER02010_empty: {
|
445
|
455
|
push: function() {
|
446
|
456
|
let param = $('#ITP_FORM_OPER02010_SEARCH').serializeObject();
|
447
|
|
- itp_OPER02010_param = param;
|
|
457
|
+ listObj.grid.itp_OPER02010_param = param;
|
448
|
458
|
},
|
449
|
459
|
back: function() {
|
450
|
|
- $('#ITP_FORM_OPER02010_DEVI_TP_CD').val(itp_OPER02010_param.deviTpCd);
|
451
|
|
- $('#ITP_FORM_OPER02010_ORDER_YN').val(itp_OPER02010_param.orderYn);
|
452
|
|
- $('#ITP_FORM_OPER02010_ADT_AUTH_CD').val(itp_OPER02010_param.adtAuthCd);
|
453
|
|
- $('#ITP_FORM_OPER02010_EMAIL_RCV_YN').val(itp_OPER02010_param.emailRcvYn);
|
454
|
|
- $('#ITP_FORM_OPER02010_SMS_RCV_YN').val(itp_OPER02010_param.smsRcvYn);
|
455
|
|
- $('#ITP_FORM_OPER02010_MEMB_EXIT_DT').val(itp_OPER02010_param.membExitDt);
|
456
|
|
- $('#ITP_FORM_OPER02010_FROM_DT').val(itp_OPER02010_param.fromDt);
|
457
|
|
- $('#ITP_FORM_OPER02010_TO_DT').val(itp_OPER02010_param.toDt);
|
458
|
|
- $('#ITP_FORM_OPER02010_KEYWORD').val(itp_OPER02010_param.keyword);
|
|
460
|
+ var _this = listObj.grid;
|
|
461
|
+ $('#ITP_FORM_OPER02010_DEVI_TP_CD').val(_this.itp_OPER02010_param.safflShopId);
|
|
462
|
+ $('#ITP_FORM_OPER02010_ORDER_YN').val(_this.itp_OPER02010_param.safflShopNm);
|
|
463
|
+ $('#ITP_FORM_OPER02010_ADT_AUTH_CD').val(_this.itp_OPER02010_param.sbrandId);
|
|
464
|
+ $('#ITP_FORM_OPER02010_EMAIL_RCV_YN').val(_this.itp_OPER02010_param.snticeTitl);
|
|
465
|
+ $('#ITP_FORM_OPER02010_FROM_DT').val(_this.itp_OPER02010_param.fromDt);
|
|
466
|
+ $('#ITP_FORM_OPER02010_TO_DT').val(_this.itp_OPER02010_param.toDt);
|
459
|
467
|
}
|
460
|
468
|
},
|
461
|
469
|
reload : function() {
|
462
|
470
|
var _this = this;
|
463
|
471
|
$(OPER02010_GRID_EMPTY).off('click').on('click', function() {
|
464
|
472
|
_this.itp_fn_OPER02010_empty.back();
|
465
|
|
- pageObj.itp_OPER02010_param.gridSize = $.jgrid.defaults.rowNum;
|
466
|
|
- $(OPER02010_GRID_ID).setGridParam({'postData': JSON.stringify(pageObj.itp_OPER02010_param)}).trigger('reloadGrid');
|
|
473
|
+ _this.itp_OPER02010_param.gridSize = $.jgrid.defaults.rowNum;
|
|
474
|
+ $(OPER02010_GRID_ID).setGridParam({'postData': JSON.stringify(_this.itp_OPER02010_param)}).trigger('reloadGrid');
|
467
|
475
|
});
|
468
|
476
|
},
|
469
|
477
|
clearData : function() {
|
|
@@ -583,11 +591,128 @@ let viewObj = {
|
583
|
591
|
/*수정화면 Object*/
|
584
|
592
|
let modifyObj = {
|
585
|
593
|
init: function (param) {
|
586
|
|
- this.load(param);
|
587
|
594
|
},
|
588
|
595
|
button: {
|
589
|
596
|
modify: function () {
|
|
597
|
+ itp_fn_form_clear_validate(null, '#ITP_FORM_OPER02010_DETAIL');
|
|
598
|
+ const nticeNoVal = $('#ITP_FORM_OPER02010_VIEW_USER_ID').val();
|
|
599
|
+ const key = {nticeNo: nticeNoVal, viewCd: 'R'};
|
|
600
|
+ var param = $.param(key);
|
|
601
|
+ modifyObj.load(param);
|
|
602
|
+ }
|
|
603
|
+ },
|
|
604
|
+ load: function(param) {
|
|
605
|
+ fn_ajax_call(NTICE_INFO_NTICE, param, this.callback, 'GET');
|
|
606
|
+ },
|
|
607
|
+ callback: function (result) {
|
|
608
|
+ console.log(result);
|
|
609
|
+ pageObj.switchScreen('MODIFY');
|
|
610
|
+ $('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DETAIL_VIEW_CD').val('U');
|
|
611
|
+ $('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DETAIL_NTICE_NO').val(result.nticeNo);
|
|
612
|
+ $('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DETAIL_NTICE_TITL').val(result.nticeTitl);
|
|
613
|
+ $('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_FROM_DT').val(result.notiStDay);
|
|
614
|
+ $('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_TO_DT').val(result.notiEdDay);
|
|
615
|
+ $('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DEL_YN').val(result.delYn);
|
|
616
|
+ $('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DETAIL_NTICE_DESC').val(result.nticeDesc);
|
|
617
|
+ $('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DETAIL_TARGET_CD').val(result.targetCd);
|
|
618
|
+ $('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DETAIL_BRAND').prop('checked', result.brandChk === 'Y');
|
|
619
|
+ $('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DETAIL_STORE').prop('checked', result.shopChk === 'Y');
|
|
620
|
+ $('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DETAIL_SPPLY').prop('checked', result.supplyChk === 'Y');
|
|
621
|
+ $('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DETAIL_BRAND_CHK').val(result.brandChk);
|
|
622
|
+ $('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DETAIL_STORE_CHK').val(result.shopChk);
|
|
623
|
+ $('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DETAIL_SPPLY_CHK').val(result.supplyChk);
|
|
624
|
+ $('#ITP_FORM_OPER02010_DETAIL_FILE_NO').val(result.fileNo); //파일번호 셋팅
|
|
625
|
+
|
|
626
|
+ // 가맹점 셋팅
|
|
627
|
+ $('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DETAIL_SEARCH_AFFL_SHOP_ID').val(result.afflShopId);
|
|
628
|
+ $('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DETAIL_SEARCH_AFFL_SHOP_NM').val(result.afflShopNm);
|
|
629
|
+ // $('#ITP_FORM_OPER02010_DETAIL_SEARCH_AFFL_SHOP').attr('disabled', true);
|
|
630
|
+ // $('#ITP_FORM_OPER02010_DETAIL_DELETE_AFFL_SHOP').attr('disabled', true);
|
|
631
|
+ // $('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DETAIL_SEARCH_AFFL_SHOP_NM').attr('readonly', true);
|
|
632
|
+ // $('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DETAIL_SEARCH_BRAND_ID').attr('readonly', true);
|
|
633
|
+ if(result.brandId && result.brandId != '') {
|
|
634
|
+ var brandList = [{'brandId':result.brandId, 'brandNm':result.brandNm}];
|
|
635
|
+ fn_make_select_brand(brandList, 'ITP_FORM_OPER02010_DETAIL_SEARCH_BRAND_ID');
|
|
636
|
+ }
|
590
|
637
|
|
|
638
|
+ let targetIndex = $('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DETAIL_TARGET_CD option').index($('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DETAIL_TARGET_CD option:selected'));
|
|
639
|
+ // if(targetIndex > 0) {
|
|
640
|
+ if(result.targetCd && result.targetCd != '') {
|
|
641
|
+ $('#ITP_BTN_OPER02010_DETAIL_ADDROW').attr('disabled', false);
|
|
642
|
+ $('#ITP_BTN_OPER02010_DETAIL_DELROW').attr('disabled', false);
|
|
643
|
+ }
|
|
644
|
+
|
|
645
|
+ //파일업로드(수정화면)
|
|
646
|
+ $('#ITP_OPER02010_DETAIL_UPLOAD').empty();
|
|
647
|
+ const fileArgs = {
|
|
648
|
+ 'fileNo': $('#ITP_FORM_OPER02010_DETAIL_FILE_NO').val(),
|
|
649
|
+ 'viewCd': $('#ITP_FORM_OPER02010_DETAIL_VIEW_CD').val(),
|
|
650
|
+ 'showYn': $('#ITP_OPER02010_DETAIL_UPLOAD').attr('data-show-yn'),
|
|
651
|
+ 'fileId': '#ITP_FORM_OPER02010_DETAIL_FILE_NO' //파일번호를 서버에서 받아서 넣을 파일번호 인풋박스 아이디
|
|
652
|
+ };
|
|
653
|
+ itp_fn_set_file_upload('ITP_OPER02010_DETAIL_UPLOAD', 'notice', true, false, 'OPERATION02010', fileArgs);
|
|
654
|
+
|
|
655
|
+ // 리스트 조회
|
|
656
|
+ createObj.form.init();
|
|
657
|
+ modifyObj.grid.init();
|
|
658
|
+ },
|
|
659
|
+ grid: {
|
|
660
|
+ init: function() {
|
|
661
|
+ this.unload();
|
|
662
|
+ this.load();
|
|
663
|
+ },
|
|
664
|
+ load : function() {
|
|
665
|
+ let param = $('#ITP_FORM_OPER02010_DETAIL').serializeObject();
|
|
666
|
+ param.gridSize = $.jgrid.defaults.rowNum;
|
|
667
|
+ param.pagingYn = false; // 페이지안함
|
|
668
|
+
|
|
669
|
+ var option = {
|
|
670
|
+ gridId: OPER02010_DETAIL_GRID_ID,
|
|
671
|
+ colModel: gridColModel.detail,
|
|
672
|
+ param: JSON.stringify(param),
|
|
673
|
+ url: DOMAIN + NTICE_TARGET_GRID_LIST,
|
|
674
|
+ pager: OPER02010_DETAIL_GRID_PAGER,
|
|
675
|
+ multiselect: true,
|
|
676
|
+ loadComplete: function(data) {
|
|
677
|
+ itp_fn_grid_load_complete(data, OPER02010_DETAIL_GRID_ID, true, undefined, 'OPER02010_DETAIL');
|
|
678
|
+ },
|
|
679
|
+ onPaging: function(action) {
|
|
680
|
+ var pagingFn = {
|
|
681
|
+ callBack: function(args) {
|
|
682
|
+ $(args).trigger('reloadGrid');
|
|
683
|
+ }
|
|
684
|
+ };
|
|
685
|
+ if (itp_fn_check_grid_is_writing(OPER02010_DETAIL_GRID_ID)) {
|
|
686
|
+ itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.cancelData, pagingFn, OPER02010_DETAIL_GRID_ID);
|
|
687
|
+ return 'stop';
|
|
688
|
+ } else {
|
|
689
|
+ itp_fn_grid_paging(OPER02010_DETAIL_GRID_ID, action, param);
|
|
690
|
+ }
|
|
691
|
+ },
|
|
692
|
+ onSortCol: function(index, columnIndex, sortOrder) {
|
|
693
|
+ var sortingFn = {
|
|
694
|
+ callBack: function(args) {
|
|
695
|
+ $(args).trigger('reloadGrid');
|
|
696
|
+ }
|
|
697
|
+ };
|
|
698
|
+ if (itp_fn_check_grid_is_writing(OPER02010_DETAIL_GRID_ID)) {
|
|
699
|
+ itp_fn_modal_confirm(ITP_MSG_LOCALE.message.ajax.cancelData, sortingFn, OPER02010_DETAIL_GRID_ID);
|
|
700
|
+ return 'stop';
|
|
701
|
+ } else {
|
|
702
|
+ itp_fn_grid_sorting(OPER02010_DETAIL_GRID_ID, index, sortOrder);
|
|
703
|
+ }
|
|
704
|
+ }
|
|
705
|
+ };
|
|
706
|
+ itp_fn_grid_make_remote(option);
|
|
707
|
+ },
|
|
708
|
+ clearData : function() {
|
|
709
|
+ $(OPER02010_DETAIL_GRID_ID).jqGrid('clearGridData', true);
|
|
710
|
+ $(OPER02010_DETAIL_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
|
|
711
|
+ $(OPER02010_DETAIL_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
|
|
712
|
+ $(OPER02010_DETAIL_GRID_EMPTY).show();
|
|
713
|
+ },
|
|
714
|
+ unload : function() {
|
|
715
|
+ $.jgrid.gridUnload(OPER02010_DETAIL_GRID_ID);
|
591
|
716
|
}
|
592
|
717
|
}
|
593
|
718
|
};
|