瀏覽代碼

반품발주 현황

marseyes 2 年之前
父節點
當前提交
542de79ca2
共有 2 個文件被更改,包括 616 次插入38 次删除
  1. 35 38
      src/main/webapp/app/rtnmng/RTNMNG04010.html
  2. 581 0
      src/main/webapp/js/app/rtnmng/ITP_RTNMNG04010.js

+ 35 - 38
src/main/webapp/app/rtnmng/RTNMNG04010.html

@@ -5,8 +5,7 @@
5 5
 				<h2 class="pull-left itp_det_tit"><i class="glyphicon glyphicon-chevron-right"></i> <strong>반품발주 현황</strong></h2>
6 6
 				<div class="pull-right itp_cicon">
7 7
 					<button type="button" id="ITP_BTN_RTNMNG04010_SRH" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon "></i>&nbsp;&nbsp;조회&nbsp;&nbsp;</button>
8
-					<button type="button" id="ITP_BTN_RTNMNG04010_NEWREG" class="btn btn-primary btn-sm RPO" style="display: inline-block;"><i class="glyphicon "></i>&nbsp;&nbsp;반품발주&nbsp;&nbsp;</button>
9
-					<button type="button" id="ITP_BTN_RTNMNG04010_CANCELLIST" class="btn btn-warning btn-sm RCPO"><i class="glyphicon "></i>&nbsp;&nbsp;반품취소&nbsp;&nbsp;</button>
8
+					<button type="button" id="ITP_BTN_RTNMNG04010_RTNCANCEL" class="btn btn-warning btn-sm RPO"><i class="glyphicon "></i>&nbsp;&nbsp;반품취소&nbsp;&nbsp;</button>
10 9
 					<button type="button" id="ITP_BTN_RTNMNG04010_CANCELLIST" class="btn btn-warning btn-sm PRB"><i class="glyphicon "></i>&nbsp;&nbsp;취소/목록&nbsp;&nbsp;</button>
11 10
 				</div>
12 11
 			</div>
@@ -16,53 +15,62 @@
16 15
 						<div class="itp_srh_border fix">
17 16
 							<div class="col-xs-12">
18 17
 								<form id="ITP_FORM_RTNMNG04010_SEARCH" class="form-horizontal">
18
+									<input type="hidden" id="ITP_FORM_RTNMNG04010_SEARCH_BRAND_ID" name="sbrandId" value="">
19
+									<input type="hidden" id="ITP_FORM_RTNMNG04010_SEARCH_SWHS_ID" name="swhsId" value="">			<!-- 수거창고 -->
20
+									<input type="hidden" id="ITP_FORM_RTNMNG04010_SEARCH_SRTN_WHS_ID" name="srtnWhsId" value="">	<!-- 반품창고 -->
21
+									<input type="hidden" id="ITP_FORM_RTNMNG04010_SEARCH_SSPPLY_ID" name="sspplyId" value="">		<!-- 수거공급사 -->
22
+								
19 23
 									<div class="form-group">
20 24
 										<div class="col-xs-2 itp_ip itp_noMar">
21
-											<select id="ITP_FORM_RTNMNG04010_SEARCH_" class="form-control itp_input" name="">
25
+											<select id="ITP_FORM_RTNMNG04010_SEARCH_" class="form-control itp_input">
22 26
 												<option value="A">반품발주일자</option>											
23 27
 											</select>
24 28
 										</div>										
25 29
 										<div class="col-xs-3 itp_ip itp_noMar">
26 30
 											<div class="input-daterange input-group date">
27
-												<input type="text" id="ITP_FORM_RTNMNG04010_SEARCH_" class="form-control itp_input" name="" value="">
31
+												<input type="text" id="ITP_FORM_RTNMNG04010_SEARCH_FROM_DT" class="form-control itp_input" name="fromDt" value="">
28 32
 												<span class="input-group-addon itp_date_to">~</span>
29
-												<input type="text" id="ITP_FORM_RTNMNG04010_SEARCH_" class="form-control itp_input" name="" value="">
33
+												<input type="text" id="ITP_FORM_RTNMNG04010_SEARCH_TO_DT" class="form-control itp_input" name="toDt" value="">
30 34
 											</div>
31 35
 										</div>
32 36
 										<div class="col-xs-2 itp_ip itp_noMar" style="width:12%"></div>
33 37
 										<div class="col-xs-2 itp_ip itp_noMar">
34
-											<select id="ITP_FORM_RTNMNG04010_SEARCH_RTN_ODR_ST_CD" class="form-control itp_input" name="sRtnOdrStCd">
38
+											<select id="ITP_FORM_RTNMNG04010_SEARCH_RTN_ODR_ST_CD" data-select-code="RTN_ODR_ST_CD" class="form-control itp_input" name="srtnOdrStCd">
35 39
 												<option value="A">반품상태</option>											
36 40
 											</select>
37 41
 										</div>
38 42
 										<div class="col-xs-2 itp_ip itp_noMar">
39
-											<input type="text" id="ITP_FORM_RTNMNG04010_SEARCH_STORE_NM" class="form-control itp_input" name="sStoreNm" placeholder="수거창고/매장" />
43
+											<input type="text" id="ITP_FORM_RTNMNG04010_SEARCH_SWHS_NM" class="form-control itp_input" placeholder="수거창고/매장" readonly="readonly" />
40 44
 										</div>
41 45
 										<div class="col-xs-1 itp_in" style="padding: 0px; width:8%;">
42
-											<button type="button" id="ITP_BTN_RTNMNG04010_SEARCH_SRH" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-search"></i></button>
43
-											<button type="button" id="ITP_BTN_RTNMNG04010_SEARCH_MODIFY" class="btn btn-primary btn-sm UPB" style="display: inline-block;"><i class="glyphicon glyphicon-erase"></i></button>
46
+											<button type="button" id="ITP_BTN_RTNMNG04010_SEARCH_POP_SWHS_NM" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-search"></i></button>
47
+											<button type="button" id="ITP_BTN_RTNMNG04010_SEARCH_DEL_SWHS_NM" class="btn btn-primary btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-erase"></i></button>
44 48
 						                </div>
45 49
 									</div>
46 50
 									<div class="form-group" style="padding-top: 10px; border-top: 1px dotted #ccc;">
47 51
 										<div class="col-xs-2 itp_ip itp_noMar">
48
-											<select id="ITP_FORM_RTNMNG04010_SEARCH_COL_DVSN" class="form-control itp_input" name="sColDvsn">
52
+											<select id="ITP_FORM_RTNMNG04010_SEARCH_COL_DVSN" data-select-code="COL_DVSN" class="form-control itp_input" name="scolDvsn">
49 53
 												<option value="A">수거구분</option>											
50 54
 											</select>
51 55
 										</div>
56
+										
52 57
 										<div class="col-xs-2 itp_ip itp_noMar">
53
-											<select id="ITP_FORM_RTNMNG04010_SEARCH_" class="form-control itp_input" name="">
54
-												<option value="A">반품입고창고</option>											
55
-											</select>
58
+											<input type="text" id="ITP_FORM_RTNMNG04010_SEARCH_SRTN_WHS_NM" class="form-control itp_input" placeholder="반품입고 창고" readonly="readonly" />
56 59
 										</div>
60
+										<div class="col-xs-1 itp_in" style="padding: 0px; width:8%;">
61
+											<button type="button" id="ITP_BTN_RTNMNG04010_SEARCH_POP_SRTN_WHS_NM" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-search"></i></button>
62
+											<button type="button" id="ITP_BTN_RTNMNG04010_SEARCH_DEL_SRTN_WHS_NM" class="btn btn-primary btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-erase"></i></button>
63
+						                </div>										
64
+										
57 65
 										<div class="col-xs-2 itp_ip itp_noMar">
58
-											<input type="text" id="ITP_FORM_RTNMNG04010_SEARCH_" class="form-control itp_input" name="" placeholder="반품입고 공급업체" />
66
+											<input type="text" id="ITP_FORM_RTNMNG04010_SEARCH_SSPPLY_NM" class="form-control itp_input" placeholder="반품입고 공급업체" readonly="readonly" />
59 67
 										</div>
60 68
 										<div class="col-xs-1 itp_in" style="padding: 0px; width:10%;">
61
-											<button type="button" id="ITP_BTN_RTNMNG04010_SEARCH_SRH" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-search"></i></button>
62
-											<button type="button" id="ITP_BTN_RTNMNG04010_SEARCH_MODIFY" class="btn btn-primary btn-sm UPB" style="display: inline-block;"><i class="glyphicon glyphicon-erase"></i></button>
69
+											<button type="button" id="ITP_BTN_RTNMNG04010_SEARCH_POP_SSPPLY_NM" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-search"></i></button>
70
+											<button type="button" id="ITP_BTN_RTNMNG04010_SEARCH_DEL_SSPPLY_NM" class="btn btn-primary btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-erase"></i></button>
63 71
 						                </div>
64
-										<div class="col-xs-4 itp_ip itp_noMar">
65
-											<input type="text" id="ITP_FORM_RTNMNG04010_SEARCH_ITEM_NM" class="form-control itp_input" name="sItemNm" placeholder="반품발주번호/품목번호 /품목명" />
72
+										<div class="col-xs-2 itp_ip itp_noMar">
73
+											<input type="text" id="ITP_FORM_RTNMNG04010_SEARCH_ITEM_NM" class="form-control itp_input" name="sitemNm" placeholder="반품발주번호/품목번호 /품목명" />
66 74
 										</div>
67 75
 									</div>
68 76
 								</form>
@@ -83,16 +91,19 @@
83 91
 						<div class="col-xs-12">
84 92
 							<form id="ITP_FORM_RTNMNG04010_DETAIL" class="form-horizontal">
85 93
 								<input type="hidden" id="ITP_FORM_RTNMNG04010_DETAIL_VIEW_CD" name="viewCd" value="C">
94
+								<input type="hidden" id="ITP_FORM_RTNMNG04010_DETAIL_BRAND_ID" name="brandId" value="">
95
+								<input type="hidden" id="ITP_FORM_RTNMNG04010_DETAIL_RTN_PODR_UNQ_NO" name="rtnPodrUnqNo" value="">
96
+								<input type="hidden" id="ITP_FORM_RTNMNG04010_DETAIL_RTN_ODR_ST_CD" name="rtnOdrStCd" value="">
86 97
 					
87 98
 								<section class="itp_form_sec">
88
-									<h4 class="itp_form_tit">반품발주상세</h4>
99
+									<h4 class="itp_form_tit">반품 발주 상세</h4>
89 100
 									<div class="itp_form_in">	
90 101
 										<div class="form-group">
91 102
 											<label class="col-xs-2 itp_lb">브랜드 *</label>
92 103
 											<div class="col-xs-4 itp_ip fnBrandNm"></div>
93 104
 											<label class="col-xs-2 itp_lb">반품발주번호</label>
94 105
 											<div class="col-xs-4 itp_ip">
95
-												<div class="col-xs-3 itp_in">
106
+												<div class="col-xs-10 itp_in">
96 107
 													<div class="input-group fnRtnPodrUnqNo"></div>
97 108
 												</div>
98 109
 											</div>
@@ -103,7 +114,7 @@
103 114
 											<label class="col-xs-2 itp_lb">공급업체명</label>
104 115
 											<div class="col-xs-4 itp_ip fnSpplyNm"></div>
105 116
 											<label class="col-xs-2 itp_lb">반품발주일자</label>
106
-											<div class="col-xs-4 itp_ip "></div>
117
+											<div class="col-xs-4 itp_ip fnRtnOdrRegDt"></div>
107 118
 										</div>
108 119
 									</div>
109 120
 									<div class="itp_form_in">	
@@ -125,28 +136,14 @@
125 136
 									<div class="itp_form_in">	
126 137
 										<div class="form-group">
127 138
 											<label class="col-xs-2 itp_lb">수거구분</label>
128
-											<div class="col-xs-4 itp_ip">
129
-												<div class="col-xs-7 itp_in">
130
-													<select id="ITP_FORM_RTNMNG03010_DETAIL_COL_DVSN" class="form-control itp_input" name="colDvsn">
131
-														<option value="A">본사수거/공급사수거</option>											
132
-													</select>
133
-												</div>
134
-											</div>
139
+											<div class="col-xs-4 itp_ip fnColDvsnNm"></div>
135 140
 											<label class="col-xs-2 itp_lb">반품입고창고</label>
136
-											<div class="col-xs-4 itp_ip">
137
-												<div class="col-xs-5 itp_in">
138
-													<input type="text" id="ITP_FORM_RTNMNG03010_DETAIL_WHS_NM" class="form-control itp_input" name="whsNm" placeholder="창고/공급사" />
139
-												</div>
140
-												<div class="col-xs-5 itp_in" style="padding-left:3px; ">
141
-													<button type="button" id="ITP_BTN_RTNMNG03010_DETAIL_SRH" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-search"></i></button>
142
-													<button type="button" id="ITP_BTN_RTNMNG03010_DETAIL_MODIFY" class="btn btn-primary btn-sm UPB" style="display: inline-block;"><i class="glyphicon glyphicon-erase"></i></button>
143
-								                </div>
144
-											</div>
141
+											<div class="col-xs-4 itp_ip fnWhsNm"></div>
145 142
 										</div>
146 143
 									</div>
147 144
 									<div class="itp_form_in">
148 145
 										<div class="itp_table_head fix" style="background:#f5f5f5;">
149
-											<h4 class="itp_table_tit">발주 품목</h4>
146
+											<h4 class="itp_table_tit">반품 발주 품목</h4>
150 147
 										</div>
151 148
 										<div id="ITP_RTNMNG04010_DETAIL_jqGrid_list" class="itp_tb_list">
152 149
 										  <div id="ITP_RTNMNG04010_DETAIL_jqGridView" class="itp_views fix"></div>

+ 581 - 0
src/main/webapp/js/app/rtnmng/ITP_RTNMNG04010.js

@@ -0,0 +1,581 @@
1
+require(['config'], function() {
2
+    require([
3
+    ], function($) {
4
+        pageObj.init();
5
+    });
6
+});
7
+
8
+//화면변수
9
+const RTNMNG04010_GRID_ID = '#ITP_RTNMNG04010_jqGrid';
10
+const RTNMNG04010_GRID_LIST = '#ITP_RTNMNG04010_jqGrid_list';
11
+const RTNMNG04010_GRID_PAGER = '#ITP_RTNMNG04010_jqGridPager';
12
+const RTNMNG04010_GRID_EMPTY = '#ITP_RTNMNG04010_jqGridEmpty';
13
+
14
+const RTNMNG04010_DETAIL_GRID_ID = '#ITP_RTNMNG04010_DETAIL_jqGrid';
15
+const RTNMNG04010_DETAIL_GRID_LIST = '#ITP_RTNMNG04010_DETAIL_jqGrid_list';
16
+const RTNMNG04010_DETAIL_GRID_PAGER = '#ITP_RTNMNG04010_DETAIL_jqGridPager';
17
+const RTNMNG04010_DETAIL_GRID_EMPTY = '#ITP_RTNMNG04010_DETAIL_jqGridEmpty';
18
+
19
+let ITP_PODR_DTL_ST_CD = fn_make_common_cd_list(CODE_LIST, 'PODR_DTL_ST_CD', true, '구매발주상세상태코드');
20
+
21
+//API URL
22
+let API_RTNMNG_RTN_DETAIL_GRID_LIST =  '/api/rtnmng/rtn/detail-grid-list';
23
+let API_RTNMNG_RTN_INFO_RTNODR =  '/api/rtnmng/rtn/info-rtnOdr'; 
24
+let API_RTNMNG_RTN_CANCEL_RTNPO =  '/api/rtnmng/rtn/cancel-rtnPo';
25
+
26
+//화면 grid ColModel
27
+const gridColModel = {
28
+	list:[
29
+		{
30
+			index: 'VIEW_CD', name: 'viewCd',
31
+			label: ITP_MSG_LOCALE.label.viewCd,
32
+			width: '10', fixed: false, align: 'center',
33
+			sortable: false, hidden: true
34
+		},
35
+		{
36
+			index: 'BRAND_NM', name: 'brandNm',
37
+			label: ITP_MSG_LOCALE.label.brandNm,			// 브랜드명
38
+			width: '10', fixed: false, align: 'center',
39
+			sortable: false, hidden: false
40
+		},
41
+		{
42
+			index: 'RTN_PODR_UNQ_NO', name: 'rtnPodrUnqNo',
43
+			label: '반품발주번호', 
44
+			width: '10', fixed: false, align: 'center',
45
+			sortable: false, hidden: false
46
+		},
47
+		{
48
+			index: 'RTN_ODR_ST_NM', name: 'rtnOdrStNm',
49
+			label: '발주상태', 
50
+			width: '10', fixed: false, align: 'center',
51
+			sortable: false, hidden: false
52
+		},
53
+		{
54
+			index: 'RTN_ODR_REG_DT', name: 'rtnOdrRegDt',
55
+			label: '반품발주일자', 
56
+			width: '10', fixed: false, align: 'center',
57
+			sortable: false, hidden: false
58
+		},
59
+		{
60
+			index: 'RTN_WHS_NM', name: 'rtnWhsNm',
61
+			label: '수거처', 
62
+			width: '10', fixed: false, align: 'center',
63
+			sortable: false, hidden: false
64
+		},
65
+		{
66
+			index: 'SPPLY_NM', name: 'spplyNm',
67
+			label: ITP_MSG_LOCALE.label.spplyNm, 			// 공급업체명
68
+			width: '10', fixed: false, align: 'center',
69
+			sortable: false, hidden: false
70
+		},
71
+		{
72
+			index: 'RTN_DODR_TOTAL_AMT', name: 'rtnDodrTotalAmt',
73
+			label: '총 반품발주금액', 
74
+			width: '8', fixed: false, align: 'center',
75
+			sortable: false, hidden: false,
76
+			formatter: 'integer', formatoptions: {thousandsSeparator: ','}
77
+		},
78
+		{
79
+			index: 'rtn_Dodr_Item_Qty', name: 'rtnDodrItemQty',
80
+			label: '반품발주품목수', 
81
+			width: '7', fixed: false, align: 'center',
82
+			sortable: false, hidden: false, 
83
+			formatter: 'integer', formatoptions: {thousandsSeparator: ','}
84
+		},
85
+		{
86
+			index: 'COL_REQ_DT', name: 'colReqDt',
87
+			label: '수거요청일', 
88
+			width: '10', fixed: false, align: 'center',
89
+			sortable: false, hidden: false
90
+		},
91
+		{
92
+			index: 'col_Dvsn_Nm', name: 'colDvsnNm',
93
+			label: '수거구분', 
94
+			width: '10', fixed: false, align: 'center',
95
+			sortable: false, hidden: false
96
+		}
97
+	],
98
+	view: [],
99
+	detail: [
100
+		{
101
+			index: 'VIEW_CD', name: 'viewCd',
102
+			label: ITP_MSG_LOCALE.label.viewCd,
103
+			width: '10', fixed: false, align: 'center',
104
+			sortable: false, hidden: true
105
+		},
106
+		{
107
+			index: 'RTN_PODR_DTL_NO', name: 'rtnPodrDtlNo',
108
+			label: ITP_MSG_LOCALE.label.pchPodrDtlNo, 		// 발주항번
109
+			width: '5', 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: '5', 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: '5', fixed: false, align: 'left',
122
+			sortable: false, hidden: false
123
+		},
124
+		{
125
+			index: 'RODR_DTL_ST_NM', name: 'rodrDtlStNm',
126
+			label: '발주상세상태', 
127
+			width: '5', fixed: false, align: 'center',
128
+			sortable: false, hidden: false
129
+		},
130
+		{
131
+			index: 'UNIT_AMT', name: 'unitAmt',
132
+			label: ITP_MSG_LOCALE.label.unitAmt, 			// 단가
133
+			width: '5', fixed: false, align: 'center',
134
+			sortable: false, hidden: false,
135
+			formatter: 'integer', formatoptions: {thousandsSeparator: ','}
136
+		},
137
+		{
138
+			index: 'UNIT', name: 'unit',
139
+			label: ITP_MSG_LOCALE.label.unit, 				// 기본단위
140
+			width: '5', fixed: false, align: 'center',
141
+			sortable: false, hidden: false
142
+		},
143
+		{
144
+			index: 'RTN_REQ_QTY', name: 'rtnReqQty',
145
+			label: '반품요청수량', 
146
+			width: '5', fixed: false, align: 'center',
147
+			sortable: false, hidden: false, 
148
+			formatter: 'integer', formatoptions: {thousandsSeparator: ','}
149
+		},
150
+		{
151
+			index: 'RTN_ODR_QTY', name: 'rtnOdrQty',
152
+			label: '반품발주수량', 
153
+			width: '5', fixed: false, align: 'center',
154
+			sortable: false, hidden: false, 
155
+			formatter: 'integer', formatoptions: {thousandsSeparator: ','}
156
+		},
157
+		{
158
+			index: 'RTN_ODR_AMT', name: 'rtnOdrAmt',
159
+			label: ITP_MSG_LOCALE.label.podrAmt, 			// 발주금액
160
+			width: '5', fixed: false, align: 'center',
161
+			sortable: false, hidden: false,
162
+			formatter: 'integer', formatoptions: {thousandsSeparator: ','}
163
+		}
164
+	]
165
+};
166
+
167
+
168
+/*화면공통 Object*/
169
+let pageObj = {
170
+	init: function() {
171
+		this.ui.init();
172
+		this.event.init();
173
+	},
174
+	ui: {
175
+		init: function() {
176
+			this.view();
177
+			this.grid();
178
+			this.ready();
179
+		},
180
+		view: function() {
181
+			// 버튼 권한설정
182
+			fn_proc_btn_auth('RTNMNG04010');
183
+			// 공통코드 표시
184
+			$('select').each(function() {
185
+				if($(this).data('select-code')) {
186
+					fn_make_select(CODE_LIST, $(this).data('select-code'), $(this).attr('id'));
187
+				}
188
+			});
189
+			// 조회일자 지정	
190
+			var now = new Date();
191
+			var defaultToDate = new Date(now);
192
+			defaultToDate.setDate(now.getDate() + 10);
193
+			$('#ITP_TAB_RTNMNG04010 .input-group.date').datepicker(ITP_DATE_LANGUAGE);
194
+			$('#ITP_FORM_RTNMNG04010_SEARCH_FROM_DT').datepicker('setDate', now);
195
+			$('#ITP_FORM_RTNMNG04010_SEARCH_TO_DT').datepicker('setDate', defaultToDate);
196
+		},
197
+		grid: function() {
198
+			itp_fn_jqgrid_resize(RTNMNG04010_GRID_ID, RTNMNG04010_GRID_LIST, 'lg');
199
+			listObj.empty.init();
200
+			itp_fn_fire_window_resize();
201
+		},
202
+		ready: function() {
203
+			listObj.init();
204
+		}
205
+	},
206
+	event: {
207
+		init: function() {
208
+			this.button();
209
+		},
210
+		button: function() {
211
+			// 버튼 클릭 이벤트
212
+			$('button').each(function() {
213
+				var id = $(this).attr('id');
214
+				$(this).on('click', function() {
215
+					switch (id) {
216
+						case 'ITP_BTN_RTNMNG04010_SRH'				: listObj.button.search();		break;	// 조회 버튼 클릭
217
+						case 'ITP_BTN_RTNMNG04010_NEWREG'			: listObj.button.create(); 		break;	// 신규등록 버튼
218
+						case 'ITP_BTN_RTNMNG04010_MODIFY'			: modifyObj.button.modify();	break;	// 수정 버튼
219
+						case 'ITP_BTN_RTNMNG04010_CANCELLIST'		: modifyObj.button.cancel(); 	break;	// 취소/목록 버튼
220
+						case 'ITP_BTN_RTNMNG04010_RTNCANCEL'		: modifyObj.button.del();		break;	// 발주 취소 버튼(예정)
221
+					}
222
+				});
223
+			});
224
+		}
225
+	},
226
+	switchScreen: function(mode) {
227
+        $('.itp_det_head').find('button[id^="ITP_BTN_RTNMNG04010_"]').each(function(i) {
228
+            $(this).hide();
229
+        });
230
+        $('#ITP_TAB_RTNMNG04010').find('div[id$="_CONTAINER"]').each(function(i) {
231
+            $(this).hide();
232
+        });
233
+        if(mode == 'LIST') { // 목록
234
+            fn_show_btn_auth_array(['#ITP_BTN_RTNMNG04010_SRH', '#ITP_BTN_RTNMNG04010_NEWREG']);
235
+            $('#ITP_AJAX_RTNMNG04010_LIST_CONTAINER').show();
236
+            $('#ITP_FORM_RTNMNG04010_SEARCH #ITP_FORM_RTNMNG04010_SEARCH_BRAND_ID').val(fn_make_user_info.get('brandId'));
237
+            $('#ITP_BTN_RTNMNG04010_SEARCH_SPPLY_ID').show();
238
+            $('#ITP_BTN_RTNMNG04010_DELETE_SPPLY_ID').show();
239
+            $('#ITP_BTN_RTNMNG04010_SEARCH_WHS_ID').show();
240
+            $('#ITP_BTN_RTNMNG04010_DELETE_WHS_ID').show();
241
+            
242
+        } else if(mode == 'MODIFY') { // 수정
243
+            $('#ITP_AJAX_RTNMNG04010_DETAIL_CONTAINER').show();
244
+            fn_show_btn_auth_array(['#ITP_BTN_RTNMNG04010_CANCELLIST', '#ITP_BTN_RTNMNG04010_RTNCANCEL']);
245
+
246
+            $('#ITP_BTN_RTNMNG04010_CANCELLIST').show();
247
+            $('#ITP_BTN_RTNMNG04010_DELETE').show();
248
+            
249
+            $('#ITP_FORM_RTNMNG04010_DETAIL_BRAND_ID').attr('readonly', true);
250
+            $('#ITP_FORM_RTNMNG04010_DETAIL_BRAND_NM').attr('readonly', true);
251
+            $('#ITP_FORM_RTNMNG04010_DETAIL_BSNS_REG_NO').attr('readonly', true);
252
+            $('#ITP_FORM_RTNMNG04010_DETAIL_CORP_REG_NO').attr('readonly', true);
253
+            $('#ITP_FORM_RTNMNG04010_DETAIL_SEARCH_AFFL_SHOP').hide();
254
+            $('#ITP_FORM_RTNMNG04010_DETAIL_DELETE_AFFL_SHOP').hide();
255
+			$('#ITP_FORM_RTNMNG04010_DETAIL .itp_form_info').show();
256
+			$('#ITP_FORM_RTNMNG04010_DETAIL .itp_form_change').hide();
257
+
258
+            $('#ITP_FORM_RTNMNG04010_DETAIL #ITP_FORM_RTNMNG04010_DETAIL_BRAND_ID').val(fn_make_user_info.get('brandId'));
259
+        } 
260
+    }
261
+};
262
+
263
+
264
+/*목록화면 Object*/
265
+let listObj = {
266
+	init: function() {
267
+		this.grid.init();
268
+		this.action();
269
+	},
270
+	itp_RTNMNG04010_param: {},
271
+	itp_RTNMNG04010_search: false,
272
+	button: {
273
+		search: function() {
274
+			listObj.itp_RTNMNG04010_search = true;
275
+			let param = $('#ITP_FORM_RTNMNG04010_SEARCH').serializeObject();
276
+			param.gridSize = $.jgrid.defaults.rowNum;
277
+            param.gridPage = $.jgrid.defaults.page;
278
+            param.sidx = '0';
279
+            console.log(JSON.stringify(param));
280
+            $(RTNMNG04010_GRID_ID).setGridParam({'postData': JSON.stringify(param)}).trigger('reloadGrid');
281
+        }
282
+	},
283
+	empty: {
284
+		init: function() {
285
+			var _this = this;
286
+            this.push();
287
+            $(RTNMNG04010_GRID_EMPTY).on('click', function() {
288
+                _this.back();
289
+                listObj.itp_RTNMNG04010_param.gridSize = $.jgrid.defaults.rowNum;
290
+                $(RTNMNG04010_GRID_ID).setGridParam({'postData': JSON.stringify(listObj.itp_RTNMNG04010_param)}).trigger('reloadGrid');
291
+            });
292
+		},
293
+		push: function() {
294
+            let param = $('#ITP_FORM_RTNMNG04010_SEARCH').serializeObject();
295
+            listObj.itp_RTNMNG04010_param = param;
296
+            param.sidx = '0';
297
+        },
298
+        back: function() {
299
+            $('#ITP_FORM_RTNMNG04010_SERVICE_BRAND_TYPE').val(listObj.itp_RTNMNG04010_param.brandType);
300
+            $('#ITP_FORM_RTNMNG04010_SERVICE_ST_CD').val(listObj.itp_RTNMNG04010_param.stCd);
301
+            $('#ITP_FORM_RTNMNG04010_SEARCH_BRAND_NM').val(listObj.itp_RTNMNG04010_param.brandNm);
302
+        }
303
+	},
304
+	grid: {
305
+		init: function() {
306
+			// 데이터 없을때
307
+            listObj.empty.push();
308
+            this.search();
309
+		},
310
+		colModel: gridColModel.list,
311
+		search: function() {
312
+			pageObj.switchScreen('LIST');
313
+			this.unload();
314
+			this.load();
315
+		},
316
+		load: function() {
317
+            let param = $('#ITP_FORM_RTNMNG04010_SEARCH').serializeObject();
318
+            param.gridSize = $.jgrid.defaults.rowNum;
319
+            param.sidx = '0';
320
+            console.log(JSON.stringify(param));
321
+            var option = {
322
+            	gridId: RTNMNG04010_GRID_ID,
323
+            	colModel: gridColModel.list,
324
+            	param: param,
325
+            	url: DOMAIN + API_RTNMNG_RTN_DETAIL_GRID_LIST,
326
+            	pager: RTNMNG04010_GRID_PAGER,
327
+            	onCellSelect: function(rowId, cellIdx, cellValue) {
328
+                    var cm = $(this).jqGrid('getGridParam', 'colModel');
329
+                    var colNm = cm[cellIdx].name;
330
+                    if (colNm === 'rtnPodrUnqNo') {
331
+                        const rtnPodrUnqNoVal = $(this).jqGrid('getCell', rowId, 'rtnPodrUnqNo');
332
+                        const brandIdVal = $(this).jqGrid('getCell', rowId, 'brandId');
333
+                        const key = {rtnPodrUnqNo: rtnPodrUnqNoVal, brandId: brandIdVal};
334
+                        var param = $.param(key);
335
+                        modifyObj.init(param);
336
+                    }
337
+				},
338
+				loadComplete: function(data) {
339
+					console.log(data);
340
+                    itp_fn_grid_load_complete(data, RTNMNG04010_GRID_ID, true, 'number', 'RTNMNG04010', listObj.itp_RTNMNG04010_search, listObj.empty, true, data.gridRecords, true);
341
+                    var ids = $(RTNMNG04010_GRID_ID).getDataIDs();
342
+                    $.each(ids, function(idx, rowId) {
343
+                        $(RTNMNG04010_GRID_ID).jqGrid('setCell', rowId, 'rtnPodrUnqNo', '', ITP_GRID_COL_STYLE.link);
344
+                    });
345
+				},
346
+				onPaging: function(action) {
347
+                    itp_fn_grid_paging(RTNMNG04010_GRID_ID, action, param);
348
+                }
349
+            };
350
+            itp_fn_grid_make_remote(option);
351
+		},
352
+		clearData: function() {
353
+			$(RTNMNG04010_GRID_ID).jqGrid('clearGridData', true);
354
+            $(RTNMNG04010_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
355
+            $(RTNMNG04010_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
356
+            $(RTNMNG04010_GRID_EMPTY).show();
357
+		},
358
+		unload: function() {
359
+			$.jgrid.gridUnload(RTNMNG04010_GRID_ID);
360
+		}
361
+	},
362
+	action: function() {
363
+		var _this = this;
364
+		// 매장/창고 조회 버튼 클릭
365
+		$('#ITP_BTN_RTNMNG04010_SEARCH_POP_SWHS_NM').on('click', function() {
366
+			_this.popup('whs');
367
+		});
368
+		// 매장/창고 텍스트 삭제 버튼 클릭
369
+		$('#ITP_BTN_RTNMNG04010_SEARCH_DEL_SWHS_NM').on('click', function() {
370
+			$('#ITP_FORM_RTNMNG04010_SEARCH_SWHS_NM').val('');
371
+			$('#ITP_FORM_RTNMNG04010_SEARCH_SWHS_ID').val('');
372
+		});
373
+		
374
+		// 매장/창고 조회 버튼 클릭
375
+		$('#ITP_BTN_RTNMNG04010_SEARCH_POP_SRTN_WHS_NM').on('click', function() {
376
+			_this.popup('rwhs');
377
+		});
378
+		// 매장/창고 텍스트 삭제 버튼 클릭
379
+		$('#ITP_BTN_RTNMNG04010_SEARCH_DEL_SRTN_WHS_NM').on('click', function() {
380
+			$('#ITP_FORM_RTNMNG04010_SEARCH_SRTN_WHS_NM').val('');
381
+			$('#ITP_FORM_RTNMNG04010_SEARCH_SRTN_WHS_ID').val('');
382
+		});
383
+		
384
+		// 공급업체 조회 버튼 클릭
385
+		$('#ITP_BTN_RTNMNG04010_SEARCH_POP_SSPPLY_NM').on('click', function() {
386
+			_this.popup('spply');
387
+		});
388
+		// 공급업체 텍스트 삭제 버튼 클릭
389
+		$('#ITP_BTN_RTNMNG04010_SEARCH_DEL_SSPPLY_NM').on('click', function() {
390
+			$('#ITP_FORM_RTNMNG04010_SEARCH_SSPPLY_NM').val('');
391
+			$('#ITP_FORM_RTNMNG04010_SEARCH_SSPPLY_ID').val('');
392
+		});
393
+		
394
+	},
395
+	popup: function(keyword) {
396
+		if(keyword === 'spply'){
397
+			var popFn = this.callback.spply;
398
+			const key = {brandId:fn_make_user_info.get('brandId'),storeId:fn_make_user_info.get('storeId')};
399
+			fn_call_popup('biz', 'BIZPOP_STORE_SPPLY', '#ITP_ASIDE', popFn, key, 'S');
400
+		} else if(keyword === 'whs'){
401
+			var popFn = this.callback.whs;
402
+			const key1 = {brandId:fn_make_user_info.get('brandId'),storeId:fn_make_user_info.get('storeId'), whsDvsn:""};
403
+			fn_call_popup('biz', 'BIZPOP_WHS_LOCATION', '#ITP_ASIDE', popFn, key1, 'S');
404
+		} else if(keyword === 'rwhs'){
405
+			var popFn = this.callback.rwhs;
406
+			const key1 = {brandId:fn_make_user_info.get('brandId'),storeId:fn_make_user_info.get('storeId'), whsDvsn:""};
407
+			fn_call_popup('biz', 'BIZPOP_WHS_LOCATION', '#ITP_ASIDE', popFn, key1, 'S');
408
+		}
409
+	},
410
+	callback: {
411
+		whs: function(rowDataPop) {
412
+			$('#ITP_FORM_RTNMNG04010_SEARCH_SWHS_NM').val(rowDataPop.whsNm);
413
+			$('#ITP_FORM_RTNMNG04010_SEARCH_SWHS_ID').val(rowDataPop.whsId);
414
+		}, 
415
+		rwhs: function(rowDataPop) {
416
+			$('#ITP_FORM_RTNMNG04010_SEARCH_SRTN_WHS_NM').val(rowDataPop.whsNm);
417
+			$('#ITP_FORM_RTNMNG04010_SEARCH_SRTN_WHS_ID').val(rowDataPop.whsId);
418
+		},
419
+		spply: function(rowDataPop) {
420
+			$('#ITP_FORM_RTNMNG04010_SEARCH_SSPPLY_NM').val(rowDataPop.spplyNm);
421
+			$('#ITP_FORM_RTNMNG04010_SEARCH_SSPPLY_ID').val(rowDataPop.spplyId);
422
+		}
423
+	}
424
+};
425
+
426
+
427
+/*수정화면 Object*/
428
+let modifyObj = {
429
+	init: function(param) {
430
+		this.load(param);
431
+	},
432
+	itp_RTNMNG04010_param: {},
433
+	itp_RTNMNG04010_search: false,
434
+	button: {
435
+		cancel: function() {
436
+			listObj.grid.search();
437
+		},
438
+		del: function() {
439
+			
440
+			var modalFn = {
441
+				callBack: () => {
442
+
443
+					var param = {brandId: $('#ITP_FORM_RTNMNG04010_DETAIL_BRAND_ID').val(), rtnPodrUnqNo: $('#ITP_FORM_RTNMNG04010_DETAIL_RTN_PODR_UNQ_NO').val()};
444
+					var searhFn = function () {
445
+						listObj.grid.search();
446
+					}
447
+					fn_ajax_call(API_RTNMNG_RTN_CANCEL_RTNPO, JSON.stringify(param), searhFn, 'POST');
448
+				}
449
+			};
450
+			itp_fn_modal_confirm('반품발주를 취소 하시겠습니까?', modalFn);
451
+		}
452
+	},
453
+	empty: {
454
+		init: function() {
455
+            var _this = this;
456
+            this.push();
457
+            $(RTNMNG04010_VIEW_GRID_EMPTY).on('click', function() {
458
+                _this.back();
459
+                viewObj.itp_RTNMNG04010_param.gridSize = $.jgrid.defaults.rowNum;
460
+                $(RTNMNG04010_GRID_ID).setGridParam({'postData': JSON.stringify(viewObj.itp_RTNMNG04010_param)}).trigger('reloadGrid');
461
+            });
462
+        },
463
+        push: function() {
464
+            let param = $('#ITP_FORM_RTNMNG04010_DETAIL').serializeObject();
465
+            viewObj.itp_RTNMNG04010_param = param;
466
+        },
467
+        back: function() {
468
+            $('#ITP_FORM_RTNMNG04010_SERVICE_BRAND_TYPE').val(viewObj.itp_RTNMNG04010_param.brandType);
469
+            $('#ITP_FORM_RTNMNG04010_SERVICE_ST_CD').val(viewObj.itp_RTNMNG04010_param.stCd);
470
+            $('#ITP_FORM_RTNMNG04010_SEARCH_BRAND_NM').val(viewObj.itp_RTNMNG04010_param.brandNm);
471
+        }
472
+	},
473
+	load: function(param) {
474
+		fn_ajax_call(API_RTNMNG_RTN_INFO_RTNODR, param, this.callback, 'GET');
475
+	},
476
+	callback: function(result) {
477
+		// console.log('>>>> ' + JSON.stringify(result));
478
+		
479
+		// 그리드 전화번호 '-' 함수
480
+		let telNo = '';
481
+		if(result.rtnMgrTelNo != '') {
482
+			function convertTel(value){
483
+				answer = (value.startsWith('0')) ? value.replace(/[^0-9]/g, "")
484
+						.replace(/(^02|^0505|^1[0-9]{3}|^0[0-9]{2})([0-9]+)?([0-9]{4})$/,"$1-$2-$3")
485
+						.replace("--", "-") : '';
486
+				return answer;
487
+			}				
488
+			telNo = convertTel(result.rtnMgrTelNo);	
489
+		}
490
+		
491
+		pageObj.switchScreen('MODIFY');
492
+		$('#ITP_FORM_RTNMNG04010_DETAIL #ITP_FORM_RTNMNG04010_DETAIL_BRAND_ID').val(result.brandId);
493
+		$('#ITP_FORM_RTNMNG04010_DETAIL #ITP_FORM_RTNMNG04010_DETAIL_RTN_PODR_UNQ_NO').val(result.rtnPodrUnqNo);
494
+		$('#ITP_FORM_RTNMNG04010_DETAIL #ITP_FORM_RTNMNG04010_DETAIL_RTN_ODR_ST_CD').val(result.rtnOdrStCd);
495
+		
496
+		$('#ITP_FORM_RTNMNG04010_DETAIL .fnBrandNm').text(result.brandNm);				
497
+		$('#ITP_FORM_RTNMNG04010_DETAIL .fnRtnPodrUnqNo').text(result.rtnPodrUnqNo + ' / ' + result.rtnOdrStNm);
498
+		$('#ITP_FORM_RTNMNG04010_DETAIL .fnColPlace').text(result.rtnWhsNm + ' - ' + result.rtnLocationNm);
499
+		$('#ITP_FORM_RTNMNG04010_DETAIL .fnWhsNm').text(result.whsNm + ' - ' + result.locationNm);
500
+		$('#ITP_FORM_RTNMNG04010_DETAIL .fnSpplyNm').text(result.spplyNm);
501
+		$('#ITP_FORM_RTNMNG04010_DETAIL .fnRtnOdrRegDt').text(result.rtnOdrRegDt);
502
+		$('#ITP_FORM_RTNMNG04010_DETAIL .fnPodrMgrNm').text(result.rtnMgrNm);
503
+		$('#ITP_FORM_RTNMNG04010_DETAIL .fnPodrMgrTelNo').text(telNo);
504
+		$('#ITP_FORM_RTNMNG04010_DETAIL .fnColDvsnNm').text(result.colDvsnNm);
505
+		$('#ITP_FORM_RTNMNG04010_DETAIL .fnRtnDodrTotalAmt').text(itp_fn_number_comma(result.rtnDodrTotalAmt));
506
+		
507
+		if('RO20' == result.rtnOdrStCd) { // 반품발주요청
508
+			$('#ITP_BTN_RTNMNG04010_RTNCANCEL').show();
509
+		} else {
510
+			$('#ITP_BTN_RTNMNG04010_RTNCANCEL').hide();
511
+		}
512
+		
513
+		modifyObj.grid.init('MODIFY', result.rtnOdrDtlList)
514
+		
515
+	},
516
+	grid: {
517
+		init: function(mode, gridData) {
518
+			this.mode = mode;
519
+			this.gridId = (mode === 'VIEW') ? RTNMNG04010_VIEW_GRID_ID : RTNMNG04010_DETAIL_GRID_ID;
520
+			this.gridList = (mode === 'VIEW') ? RTNMNG04010_VIEW_GRID_LIST : RTNMNG04010_DETAIL_GRID_LIST;
521
+			this.gridEmpty = (mode === 'VIEW') ? RTNMNG04010_VIEW_GRID_EMPTY : RTNMNG04010_DETAIL_GRID_EMPTY;
522
+			this.unload();
523
+			this.load(mode, gridData);
524
+		},
525
+		mode: '',
526
+		colModel: gridColModel.view,
527
+		load: function(mode, gridData) {
528
+			var _this = this;
529
+			var option = {
530
+				gridId: _this.gridId,
531
+				colModel: gridColModel.detail,
532
+				data: gridData,
533
+				// multiselect: true,
534
+				onSelectRow: function(index, status) {
535
+					if(index) {
536
+						var row = $(RTNMNG04010_DETAIL_GRID_ID).jqGrid('getRowData', index);
537
+						if(row.podrDtlStCd == 'POD2') {
538
+							$("#jqg_ITP_RTNMNG04010_DETAIL_jqGrid_" + index).prop("checked", false);
539
+						}
540
+					}
541
+				},
542
+				onSelectAll: function(rowIds, status) {
543
+					for(let i = 0; i < rowIds.length; i++){
544
+						let podrDtlStCd = $(RTNMNG04010_DETAIL_GRID_ID).getCell(rowIds[i], 'podrDtlStCd');
545
+						if(podrDtlStCd == 'POD2') {
546
+							$("#jqg_ITP_RTNMNG04010_DETAIL_jqGrid_" + rowIds[i]).prop("checked", false);
547
+						} else {
548
+							$("#jqg_ITP_RTNMNG04010_DETAIL_jqGrid_" + rowIds[i]).prop("checked", status);
549
+						}
550
+					}
551
+				},
552
+				loadComplete: function(data) {
553
+					console.log(data);
554
+					let datas = data.rows;
555
+					for(let i = 0; i < datas.length; i++) {
556
+						let podrDtlStCd = datas[i].podrDtlStCd;
557
+						if(podrDtlStCd == 'POD2') {
558
+							$('#jqg_ITP_RTNMNG04010_DETAIL_jqGrid_' + (i + 1)).attr('disabled', true);
559
+						}
560
+					}
561
+					itp_fn_grid_load_complete(data, RTNMNG04010_DETAIL_GRID_ID, true, 'number', 'RTNMNG04010', modifyObj.itp_RTNMNG04010_search, modifyObj.empty, true, data.gridRecords, true);
562
+				}
563
+			};
564
+			itp_fn_grid_make_local(option);
565
+		},
566
+		unload: function() {
567
+			$.jgrid.gridUnload(this.gridId);
568
+		}
569
+	},
570
+	isValid: function(formId) {
571
+		var isValid = false;
572
+		$(formId).find('input, select, checkbox, textarea').each(function(k) {
573
+			if($(this).data('check-required')) {
574
+				var arry = $(this).data('check-required').split(',');
575
+				isValid = itp_fn_form_validate(formId, '#' + $(this).attr('id'), arry, undefined);
576
+				if(!isValid) return false;
577
+			}
578
+		});
579
+		return isValid;
580
+	},
581
+};