|
@@ -5,22 +5,12 @@ require(['config'], function() {
|
5
|
5
|
pageObj.init();
|
6
|
6
|
});
|
7
|
7
|
});
|
8
|
|
-console.log(CONN_KEY);
|
|
8
|
+// console.log(CONN_KEY);
|
9
|
9
|
const OPER02010_GRID_ID = '#ITP_OPER02010_jqGrid';
|
10
|
10
|
const OPER02010_GRID_LIST = '#ITP_OPER02010_jqGrid_list';
|
11
|
11
|
const OPER02010_GRID_PAGER = '#ITP_OPER02010_jqGridPager';
|
12
|
12
|
const OPER02010_GRID_EMPTY = '#ITP_OPER02010_jqGridEmpty';
|
13
|
13
|
|
14
|
|
-// const OPER02010_VIEW_GRID_ID = '#ITP_OPER02010_VIEW_jqGrid';
|
15
|
|
-// const OPER02010_VIEW_GRID_LIST = '#ITP_OPER02010_VIEW_jqGrid_list';
|
16
|
|
-// const OPER02010_VIEW_GRID_PAGER = '#ITP_OPER02010_VIEW_jqGridPager';
|
17
|
|
-// const OPER02010_VIEW_GRID_EMPTY = '#ITP_OPER02010_VIEW_jqGridEmpty';
|
18
|
|
-//
|
19
|
|
-// const OPER02010_DETAIL_GRID_ID = '#ITP_OPER02010_DETAIL_jqGrid';
|
20
|
|
-// const OPER02010_DETAIL_GRID_LIST = '#ITP_OPER02010_DETAIL_jqGrid_list';
|
21
|
|
-// const OPER02010_DETAIL_GRID_PAGER = '#ITP_OPER02010_DETAIL_jqGridPager';
|
22
|
|
-// const OPER02010_DETAIL_GRID_EMPTY = '#ITP_OPER02010_DETAIL_jqGridEmpty';
|
23
|
|
-
|
24
|
14
|
let ITP_FORM_OPER02010_DETAIL_IS_WRITING = false;
|
25
|
15
|
|
26
|
16
|
let NTICE_SAVE_NTICE = '/api/ntice/save-ntice';
|
|
@@ -29,7 +19,6 @@ let NTICE_INFO_NTICE = '/api/ntice/info-ntice';
|
29
|
19
|
let NTICE_TARGET_GRID_LIST = '/api/ntice/target-grid-list';
|
30
|
20
|
let BRAND_POP_GRID_LIST = '/api/brand/pop-grid-list';
|
31
|
21
|
|
32
|
|
-
|
33
|
22
|
//공지사항 텍스트 제한
|
34
|
23
|
$(document).ready(function() {
|
35
|
24
|
$('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DETAIL_NTICE_DESC').on('keyup', function() {
|
|
@@ -94,53 +83,7 @@ const gridColModel = {
|
94
|
83
|
width: '10', fixed: false, align: 'center',
|
95
|
84
|
sortable: false, hidden: false
|
96
|
85
|
}
|
97
|
|
- ]/*,
|
98
|
|
- detail: [
|
99
|
|
- {
|
100
|
|
- index: 'VIEW_CD', name: 'viewCd',
|
101
|
|
- label: ITP_MSG_LOCALE.label.viewCd,
|
102
|
|
- width: '10', fixed: false, align: 'center',
|
103
|
|
- sortable: false, hidden: true
|
104
|
|
- },
|
105
|
|
- {
|
106
|
|
- index: 'NTICE_NO', name: 'nticeNo',
|
107
|
|
- label: ITP_MSG_LOCALE.label.notiNo,
|
108
|
|
- width: '10', fixed: false, align: 'center',
|
109
|
|
- sortable: false, hidden: true
|
110
|
|
- },
|
111
|
|
- {
|
112
|
|
- index: 'BRAND_ID', name: 'brandId',
|
113
|
|
- label: ITP_MSG_LOCALE.label.brandId,
|
114
|
|
- width: '20', fixed: false, align: 'center',
|
115
|
|
- sortable: false, editable: false, edittype: 'text'
|
116
|
|
- },
|
117
|
|
- {
|
118
|
|
- index: 'BRAND_NM', name: 'brandNm',
|
119
|
|
- label: ITP_MSG_LOCALE.label.brandNm,
|
120
|
|
- width: '30', fixed: false, align: 'center',
|
121
|
|
- sortable: false, editable: false, edittype: 'text'
|
122
|
|
- }
|
123
|
|
- ],
|
124
|
|
- brand: [
|
125
|
|
- {
|
126
|
|
- index: 'VIEW_CD', name: 'viewCd',
|
127
|
|
- label: ITP_MSG_LOCALE.label.viewCd,
|
128
|
|
- width: '10', fixed: false, align: 'center',
|
129
|
|
- sortable: false, hidden: true
|
130
|
|
- },
|
131
|
|
- {
|
132
|
|
- index: 'BRAND_ID', name: 'brandId',
|
133
|
|
- label: ITP_MSG_LOCALE.table.brandId,
|
134
|
|
- width: '20', fixed: false, align: 'center',
|
135
|
|
- sortable: false, editable: false, edittype: 'text'
|
136
|
|
- },
|
137
|
|
- {
|
138
|
|
- index: 'BRAND_NM', name: 'brandNm',
|
139
|
|
- label: ITP_MSG_LOCALE.table.brandNm,
|
140
|
|
- width: '30', fixed: false, align: 'center',
|
141
|
|
- sortable: false, editable: false, edittype: 'text'
|
142
|
|
- }
|
143
|
|
- ]*/
|
|
86
|
+ ]
|
144
|
87
|
};
|
145
|
88
|
|
146
|
89
|
/********************************************************
|
|
@@ -210,8 +153,6 @@ let pageObj = {
|
210
|
153
|
var _this = this;
|
211
|
154
|
var afflShopId = '#ITP_FORM_OPER02010_' + (pageObj.pageMode === 'LIST' ? 'SEARCH' : 'DETAIL') + '_AFFL_SHOP_ID';
|
212
|
155
|
var afflShopNm = '#ITP_FORM_OPER02010_' + (pageObj.pageMode === 'LIST' ? 'SEARCH' : 'DETAIL') + '_AFFL_SHOP_NM';
|
213
|
|
- // var afflShopId = '#ITP_FORM_OPER02010_' + (pageObj.pageMode === 'ADD' ? 'DETAIL' : 'SEARCH') + '_AFFL_SHOP_ID';
|
214
|
|
- // var afflShopNm = '#ITP_FORM_OPER02010_' + (pageObj.pageMode === 'ADD' ? 'DETAIL' : 'SEARCH') + '_AFFL_SHOP_NM';
|
215
|
156
|
$(afflShopId).val(_this.afflShopId);
|
216
|
157
|
$(afflShopNm).val(_this.afflShopNm);
|
217
|
158
|
$(afflShopNm).attr('readonly', true);
|
|
@@ -263,8 +204,6 @@ let pageObj = {
|
263
|
204
|
case 'ITP_BTN_OPER02010_CANCELLIST' : createObj.button.cancel(); break; // 취소/목록 버튼
|
264
|
205
|
case 'ITP_BTN_OPER00210_DELETE' : break; // 삭제 버튼
|
265
|
206
|
case 'ITP_BTN_OPER02010_SAVE' : createObj.button.save(); break; // 저장 버튼
|
266
|
|
- // case 'ITP_BTN_OPER02010_DETAIL_ADDROW' : pageObj.grid.button.addRow(); break; // 상세:추가버튼
|
267
|
|
- // case 'ITP_BTN_OPER02010_DETAIL_DELROW' : pageObj.grid.button.delRow(); break; // 상세:삭제버튼
|
268
|
207
|
}
|
269
|
208
|
});
|
270
|
209
|
});
|
|
@@ -461,35 +400,8 @@ let viewObj = {
|
461
|
400
|
fn_ajax_call(NTICE_INFO_NTICE, param, this.callback, 'GET');
|
462
|
401
|
},
|
463
|
402
|
callback: function (result) {
|
464
|
|
- /*
|
465
|
403
|
pageObj.switchScreen('VIEW');
|
466
|
|
- $('#ITP_FORM_OPER02010_VIEW #ITP_FORM_OPER02010_VIEW_NTICE_NO').val(result.nticeNo);
|
467
|
|
- $('#ITP_FORM_OPER02010_VIEW #ITP_FORM_OPER02010_VIEW_USER_ID').val(fn_make_user_info.get('userId'));
|
468
|
|
- $('#ITP_FORM_OPER02010_VIEW #ITP_FORM_OPER02010_VIEW_ADD_ID').val(result.addId);
|
469
|
|
- $('#ITP_FORM_OPER02010_VIEW .fnNticeTitl').text(result.nticeTitl);
|
470
|
|
- $('#ITP_FORM_OPER02010_VIEW .fnNotiDay').text(result.notiStDay+' ~ '+result.notiEdDay);
|
471
|
|
- $('#ITP_FORM_OPER02010_VIEW .fnDelYn').text(result.delYn);
|
472
|
|
- $('#ITP_FORM_OPER02010_VIEW .fnNticeDesc').html(result.nticeDesc.replace(/(\n|\r\n)/g, '<br>'));
|
473
|
|
- $('#ITP_FORM_OPER02010_VIEW .fnTargetNm').text(result.targetNm);
|
474
|
|
- $('#ITP_FORM_OPER02010_VIEW_FILE_NO').val(result.fileNo); //파일번호 셋팅
|
475
|
|
- $('#ITP_FORM_OPER02010_VIEW .fnAddId').text(result.addId);
|
476
|
|
- $('#ITP_FORM_OPER02010_VIEW .fnAddNm').text(result.addNm);
|
477
|
|
-
|
478
|
|
- itp_fn_attach_file.view('ITP_OPER02010_VIEW_UPLOAD', result.fileNoList
|
479
|
|
- , 'form-control itp_input', 'border:none; top:0px; left:12px; height:100px; width:125px; position:absolute;');
|
480
|
|
-
|
481
|
|
- // if(result.addId === fn_make_user_info.get('userId')) {
|
482
|
|
- if(fn_make_user_info.get('authTpCd') === '10' || result.addId === fn_make_user_info.get('userId')) {
|
483
|
|
- fn_show_btn_auth_array(['#ITP_BTN_OPER02010_MODIFY', '#ITP_BTN_OPER02010_CANCELLIST']);
|
484
|
|
- } else {
|
485
|
|
- fn_show_btn_auth_array(['#ITP_BTN_OPER02010_CANCELLIST']);
|
486
|
|
- }
|
487
|
404
|
|
488
|
|
- // 권한정보 리스트 조회
|
489
|
|
- // pageObj.grid.init('VIEW');
|
490
|
|
- */
|
491
|
|
- pageObj.switchScreen('VIEW');
|
492
|
|
- console.log(result.brandId);
|
493
|
405
|
$('#ITP_FORM_OPER02010_VIEW #ITP_FORM_OPER02010_VIEW_NTICE_NO').val(result.nticeNo);
|
494
|
406
|
$('#ITP_FORM_OPER02010_VIEW #ITP_FORM_OPER02010_VIEW_BRAND_ID').val(result.brandId);
|
495
|
407
|
$('#ITP_FORM_OPER02010_VIEW #ITP_FORM_OPER02010_VIEW_NTICE_TITL').val(result.nticeTitl);
|
|
@@ -499,15 +411,13 @@ let viewObj = {
|
499
|
411
|
$('#ITP_FORM_OPER02010_VIEW #ITP_FORM_OPER02010_VIEW_TARGET_CD').val(result.targetCd);
|
500
|
412
|
$('#ITP_FORM_OPER02010_VIEW #ITP_FORM_OPER02010_VIEW_FILE_NO').val(result.fileNo); //파일번호 셋팅
|
501
|
413
|
|
502
|
|
- // 브랜드그룹 셋팅
|
503
|
414
|
$('#ITP_FORM_OPER02010_VIEW #ITP_FORM_OPER02010_VIEW_AFFL_SHOP_ID').val(result.afflShopId);
|
504
|
|
- $('#ITP_FORM_OPER02010_VIEW #ITP_FORM_OPER02010_VIEW_AFFL_SHOP_NM').val(result.afflShopNm);
|
505
|
|
-
|
506
|
|
- pageObj.ui.afflInfo.init();
|
507
|
|
- if(result.brandId && result.brandId !== '') {
|
508
|
|
- var brandList = [{'brandId':result.brandId, 'brandNm':result.brandNm}];
|
509
|
|
- fn_make_select_brand(brandList, 'ITP_FORM_OPER02010_VIEW_SEARCH_BRAND_ID');
|
510
|
|
- }
|
|
415
|
+ $('#ITP_FORM_OPER02010_VIEW .fnAfflShopNm').text(result.afflShopNm);
|
|
416
|
+ $('#ITP_FORM_OPER02010_VIEW .fnBrandNm').text(result.brandNm);
|
|
417
|
+ $('#ITP_FORM_OPER02010_VIEW .fnNticeTitl').text(result.nticeTitl);
|
|
418
|
+ $('#ITP_FORM_OPER02010_VIEW .fnNticeDesc').html(result.nticeDesc.replace(/(\n|\r\n)/g, '<br>'));
|
|
419
|
+ $('#ITP_FORM_OPER02010_VIEW .fnTargetCd').text(result.targetNm);
|
|
420
|
+ $('#ITP_FORM_OPER02010_VIEW .fnNotiDay').text(result.notiStDay + ' ~ ' + result.notiEdDay);
|
511
|
421
|
|
512
|
422
|
pageObj.event.notiTarget(result.afflShopId === '');
|
513
|
423
|
//파일업로드(수정화면)
|
|
@@ -607,41 +517,28 @@ let modifyObj = {
|
607
|
517
|
pageObj.switchScreen('MODIFY');
|
608
|
518
|
console.log(result);
|
609
|
519
|
$('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DETAIL_VIEW_CD').val('U');
|
610
|
|
- $('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DETAIL_NTICE_NO').val(result.nticeNo);
|
611
|
|
- $('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DETAIL_BRAND_ID').val(result.brandId);
|
|
520
|
+ $('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DETAIL_NTICE_NO').val(result.nticeNo);
|
612
|
521
|
$('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DETAIL_NTICE_TITL').val(result.nticeTitl);
|
613
|
522
|
$('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_FROM_DT').val(result.notiStDay);
|
614
|
523
|
$('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_TO_DT').val(result.notiEdDay);
|
615
|
524
|
$('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DEL_YN').val(result.delYn);
|
616
|
525
|
$('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DETAIL_NTICE_DESC').val(result.nticeDesc);
|
617
|
526
|
$('#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
|
527
|
$('#ITP_FORM_OPER02010_DETAIL_FILE_NO').val(result.fileNo); //파일번호 셋팅
|
625
|
528
|
|
626
|
529
|
// 브랜드그룹 셋팅
|
627
|
530
|
$('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DETAIL_AFFL_SHOP_ID').val(result.afflShopId);
|
628
|
531
|
$('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DETAIL_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
|
532
|
|
634
|
533
|
pageObj.ui.afflInfo.init();
|
635
|
534
|
if(result.brandId && result.brandId !== '') {
|
636
|
535
|
var brandList = [{'brandId':result.brandId, 'brandNm':result.brandNm}];
|
637
|
536
|
fn_make_select_brand(brandList, 'ITP_FORM_OPER02010_DETAIL_SEARCH_BRAND_ID');
|
638
|
537
|
}
|
|
538
|
+
|
|
539
|
+ $('#ITP_FORM_OPER02010_DETAIL #ITP_FORM_OPER02010_DETAIL_BRAND_ID').val(result.brandId);
|
639
|
540
|
|
640
|
541
|
pageObj.event.notiTarget(result.afflShopId === '');
|
641
|
|
- // if(result.targetCd && result.targetCd != '') {
|
642
|
|
- // $('#ITP_BTN_OPER02010_DETAIL_ADDROW').attr('disabled', false);
|
643
|
|
- // $('#ITP_BTN_OPER02010_DETAIL_DELROW').attr('disabled', false);
|
644
|
|
- // }
|
645
|
542
|
|
646
|
543
|
//파일업로드(수정화면)
|
647
|
544
|
pageObj.fileUpload();
|
|
@@ -649,6 +546,13 @@ let modifyObj = {
|
649
|
546
|
// 리스트 조회
|
650
|
547
|
// createObj.form.init();
|
651
|
548
|
// pageObj.grid.init('DETAIL');
|
|
549
|
+
|
|
550
|
+ if(fn_make_user_info.get('authTpCd') === '30') { // 브랜드그룹
|
|
551
|
+ $('#ITP_FORM_OPER02010_DETAIL_TARGET_CD').attr('disabled',true);
|
|
552
|
+ } else {
|
|
553
|
+ $('#ITP_FORM_OPER02010_DETAIL_TARGET_CD').attr('disabled',false);
|
|
554
|
+ }
|
|
555
|
+
|
652
|
556
|
}
|
653
|
557
|
};
|
654
|
558
|
|
|
@@ -657,38 +561,26 @@ let createObj = {
|
657
|
561
|
init: function () {
|
658
|
562
|
pageObj.fileUpload();
|
659
|
563
|
|
|
564
|
+ if(fn_make_user_info.get('authTpCd') === '30') { // 브랜드그룹
|
|
565
|
+ $('#ITP_FORM_OPER02010_DETAIL_TARGET_CD').attr('disabled',true);
|
|
566
|
+ } else {
|
|
567
|
+ $('#ITP_FORM_OPER02010_DETAIL_TARGET_CD').attr('disabled',false);
|
|
568
|
+ }
|
|
569
|
+
|
660
|
570
|
},
|
661
|
571
|
button: {
|
662
|
572
|
save: function() {
|
663
|
573
|
const formId = '#ITP_FORM_OPER02010_DETAIL';
|
664
|
574
|
itp_fn_form_clear_validate(null, formId);
|
665
|
575
|
|
666
|
|
- $('#ITP_FORM_OPER02010_DETAIL_TARGET_CD').attr('disabled', false);
|
667
|
|
- console.log(('authTpCd') == '30');
|
|
576
|
+ // $('#ITP_FORM_OPER02010_DETAIL_TARGET_CD').attr('disabled', false);
|
|
577
|
+ // console.log(('authTpCd') == '30');
|
668
|
578
|
|
669
|
579
|
if (itp_fn_form_event.isValid(formId)) {
|
670
|
|
- // let gridInsertData = [];
|
671
|
|
- // let gridUpdateData = [];
|
672
|
|
- // let gridDeleteData = [];
|
673
|
|
- // const rowData = $(OPER02010_DETAIL_GRID_ID).getRowData();
|
674
|
|
- // const keyValue = $(formId + '_USER_ID').val();
|
675
|
|
- // $.each(rowData, function(key, value) {
|
676
|
|
- // if (value.viewCd != 'R') {
|
677
|
|
- // value.nticeNo = keyValue;
|
678
|
|
- // if (value.viewCd == 'C') {
|
679
|
|
- // gridInsertData.push(value);
|
680
|
|
- // } else if (value.viewCd == 'U') {
|
681
|
|
- // gridUpdateData.push(value);
|
682
|
|
- // } else if (value.viewCd == 'D') {
|
683
|
|
- // gridDeleteData.push(value);
|
684
|
|
- // }
|
685
|
|
- // }
|
686
|
|
- // });
|
687
|
580
|
let param = $(formId).serializeObject();
|
688
|
|
- // param.gridInsertData = gridInsertData;
|
689
|
|
- // param.gridUpdateData = gridUpdateData;
|
690
|
|
- // param.gridDeleteData = gridDeleteData;
|
691
|
|
- console.log(JSON.stringify(param));
|
|
581
|
+ param.targetCd = $('#ITP_FORM_OPER02010_DETAIL_TARGET_CD').val();
|
|
582
|
+
|
|
583
|
+ // console.log(JSON.stringify(param));
|
692
|
584
|
var searhFn = function() {
|
693
|
585
|
ITP_FORM_OPER02010_DETAIL_IS_WRITING = false;
|
694
|
586
|
listObj.grid.search();
|