소스 검색

모바일 공통 작업

juney 2 년 전
부모
커밋
ec5d86e6e4

+ 4 - 3
src/main/webapp/mobile/app/main.html

@@ -178,9 +178,10 @@
178 178
 				</div>
179 179
 			</div>
180 180
 			<div id="ITP_CONTAINER" class="fix">
181
-<section>
182
-  
183
-</section>
181
+				<div class="itp_mobile_contents">
182
+
183
+				</div>
184
+			</div>
184 185
 		</div>
185 186
 	</body>
186 187
 </html>

+ 91 - 73
src/main/webapp/mobile/app/mpomng/MPOMNG01010.html

@@ -1,120 +1,138 @@
1
-<section id="MPOMNG01010">
2
-  <div class="popup" style="display: none;">
1
+<section id="ITP_MOBILE_MPOMNG01010">
2
+  <div id="ITP_POP_MPOMNG01010_REQ_CONFIRM" class="popup mobile-pop-close" style="display: none;">
3 3
     <div class="pop">
4 4
       <div class="pop_line">
5 5
         <label>납품요청일 &nbsp;&nbsp;:</label>
6
-        <div class="fn">2022.09.30</div>
6
+        <div class="fnPopDlvReqDt">2022.09.30</div>
7 7
       </div>
8 8
       <div class="pop_line">
9 9
         <label>품목수&nbsp;&nbsp; :</label>
10
-        <div class="fn">2개</div>
10
+        <div class="fnPop">2개</div>
11 11
       </div>
12 12
       <div class="pop_line">
13 13
         <label>구매금액 &nbsp;&nbsp;:</label>
14
-        <div class="fn">2022.09.30원</div>
14
+        <div class="fnPop">2022.09.30원</div>
15 15
       </div>
16 16
       <label class="pop_label">구매요청 하시겠습니까?</label>
17 17
       <div class="popup_btn">
18
-        <button id="ITP_BTN_MPOMNG01010" class="cancel btn-gray CLB">취소</button>
19
-        <button id="ITP_BTN_MPOMNG01010" class="ok btn-primary COK">확인</button>
18
+        <button id="ITP_BTN_MPOMNG01010_POP_CANCEL" class="cancel btn-gray CLB">취소</button>
19
+        <button id="ITP_BTN_MPOMNG01010_POP_CONFIRM" class="ok btn-primary COK">확인</button>
20 20
       </div>
21 21
     </div>
22 22
   </div>
23
-  <div class="popup2" style="display: none;">
23
+  <div id="ITP_POP_MPOMNG01010_WHS_NM" class="popup2 mobile-pop-close" style="display: none;">
24 24
     <div class="pop">
25 25
       <div class="header">
26 26
         <div class="header_left">
27 27
           <label>> 납품장소</label>
28 28
         </div>
29 29
         <div class="header_right">
30
-          <button id="ITP_BTN_MPOMNG01010"><img src="../img/close.png"></button>
30
+          <button type="button" id="ITP_BTN_MPOMNG01010_POP_CLOSE"><img src="../img/close.png"></button>
31 31
         </div>
32 32
       </div>
33 33
       <div class="search_bar">
34
-        <input id="ITP_FORM_MPOMNG01010" type="text" placeholder="납품장소명">
35
-        <button id="ITP_BTN_MPOMNG01010"><img src="../img/search.png"></button>
34
+        <form id="ITP_FORM_MPOMNG01010_POPUP" class="form-horizontal" onsubmit="return false;">
35
+          <input id="ITP_FORM_MPOMNG01010_POP_KEYWORD" type="text" placeholder="납품장소명">
36
+          <button id="ITP_BTN_MPOMNG01010_POP_SEARCH"><img src="../img/search.png"></button>
37
+        </form>
36 38
       </div>
37 39
       <div class="search_bar">
38
-        <button id="ITP_BTN_MPOMNG01010" class="btn_blue">납품장소▼</button>
40
+        <button id="ITP_BTN_MPOMNG01010_POP_WHS_NM" class="btn_blue">납품장소▼</button>
39 41
       </div>
40 42
       <div class="popup_scroll">
41
-        <li>
42
-          <div class="scroll_left">
43
-            <div class="fn">브랜드 창고 명A</div>
44
-            <div class="fn">(상세위치내용)</div>
45
-          </div>
46
-          <div class="scroll_right">
47
-            <button id="ITP_BTN_MPOMNG01010">선택</button>
48
-          </div>
49
-        </li>
50
-        <li>
43
+        <ul id="ITP_LIST_MPOMNG01010_POP_ROWS" class="panel-group itp_nav"></ul>
44
+        <div id="ITP_LIST_MPOMNG01010_POP_ROWCOPY" style="display:none;">
45
+          <li>
46
+            <div class="scroll_left">
47
+              <div class="fn">브랜드 창고 명A</div>
48
+              <div class="fn">(상세위치내용)</div>
49
+            </div>
50
+            <div class="scroll_right">
51
+              <button id="ITP_BTN_MPOMNG01010_POP_CHOICE">선택</button>
52
+            </div>
53
+          </li>
54
+        </div>
55
+        <!--<li>
51 56
           <div class="scroll_left">
52 57
             <div class="fn">브랜드 창고 명A</div>
53 58
             <div class="fn">(상세위치내용)</div>
54 59
           </div>
55 60
           <div class="scroll_right">
56
-            <button id="ITP_BTN_MPOMNG01010">선택</button>
61
+            <button id="ITP_BTN_MPOMNG01010_POP_CHOICE">선택</button>
57 62
           </div>
58
-        </li>
63
+        </li>-->
59 64
       </div>
60 65
     </div>
61 66
   </div>
62
-	
67
+
63 68
   <div id="ITP_AJAX_MPOMNG01010_VIEW_CONTAINER">
64
-    <div class="content">
65
-      <div class="line">
66
-        <label>납기요청일</label>
67
-        <input id="ITP_FORM_MPOMNG01010" class="date" type="date" placeholder="">
68
-      </div>
69
-      <div class="line">
70
-        <label>구매요청금액</label>
71
-        <div class="line_right">
72
-          <div class="fn">424,000원</div>
69
+    <form id="ITP_FORM_MPOMNG01010_DETAIL" class="form-horizontal" onsubmit="return false;">
70
+      <input type="hidden" id="ITP_FORM_MPOMNG01010_DETAIL_VIEW_CD" name="viewCd" value="C">
71
+      <input type="hidden" id="ITP_FORM_MPOMNG01010_DETAIL_BRAND_ID" name="brandId" value="">
72
+      <input type="hidden" id="ITP_FORM_MPOMNG01010_DETAIL_STORE_ID" name="storeId" value="">
73
+      <input type="hidden" id="ITP_FORM_MPOMNG01010_DETAIL_LOAN_DVSN" name="loanDvsn" value="">
74
+      <input type="hidden" id="ITP_FORM_MPOMNG01010_DETAIL_LOAN_MGNT_UNQ_NO" name="loanMgntUnqNo" value="">
75
+      <input type="hidden" id="ITP_FORM_MPOMNG01010_DETAIL_PCH_REQ_DVSN" name="pchReqDvsn" value="">
76
+      <div class="content">
77
+        <div class="line">
78
+          <label>납기요청일</label>
79
+          <input id="ITP_FORM_MPOMNG01010_DETAIL_DLV_REQ_DT" name="dlvReqDt" class="date" type="date" placeholder="">
73 80
         </div>
74
-      </div>
75
-      <div class="line">
76
-        <label>납품장소</label>
77
-        <div class="search_nm">
78
-          <div class="float_left">
79
-            <input id="ITP_FORM_MPOMNG01010" class="" type="text" placeholder="A매장명">
80
-          </div>
81
-          <div class="float_left_btn">
82
-            <button id="ITP_BTN_MPOMNG01010"><img src="../img/search.png" alt=""></button>
83
-            <button id="ITP_BTN_MPOMNG01010"><img src="../img/delete.png" alt=""></button>
81
+        <div class="line">
82
+          <label>구매요청금액</label>
83
+          <div class="line_right">
84
+            <div class="fn">424,000원</div>
84 85
           </div>
85 86
         </div>
86
-      </div>
87
-      <div class="line">
88
-        <div class="table_header">
89
-          <h1>>구매 품목</h1>
90
-          <button id="ITP_BTN_MPOMNG01010" class="btn-primary btn-sm ADB">품목추가</button>
91
-        </div>
92
-      </div>  
93
-    </div>
94
-    <div class="scroll_area row-1">
95
-      <li>
96
-        <div class="left_info">
97
-          <div class="thick">
98
-            <div class="fnItemNm">품목명</div>
99
-            <div>-</div>
100
-            <div class="fnUnit">2EA</div>
87
+        <div class="line">
88
+          <label>납품장소</label>
89
+          <div class="search_nm">
90
+            <div class="float_left">
91
+              <input type="text" id="ITP_FORM_MPOMNG01010_DETAIL_WHS_NM" class="" name="whsNm" placeholder="매장명" />
92
+            </div>
93
+            <div class="float_left_btn">
94
+              <button id="ITP_BTN_MPOMNG01010_DETAIL_SEARCH_WHS_NM" data-call-popup="ITP_POP_MPOMNG01010_WHS_NM"><img src="../img/search.png" alt=""></button>
95
+              <button id="ITP_BTN_MPOMNG01010_DETAIL_DELETE_WHS_NM"><img src="../img/delete.png" alt=""></button>
96
+            </div>
101 97
           </div>
102
-          <div class="thick">
103
-            <label class="space0">구매가 :</label>
104
-            <div class="fnPchActAmt">1,120,000</div>
98
+        </div>
99
+        <div class="line">
100
+          <div class="table_header">
101
+            <h1>>구매 품목</h1>
102
+            <button type="button" id="ITP_BTN_MPOMNG01010_DETAIL_DELROW" class="btn-primary btn-sm ADB">품목삭제</button>
103
+            <button type="button" id="ITP_BTN_MPOMNG01010_DETAIL_ADDROW" class="btn-primary btn-sm ADB">품목추가</button>
105 104
           </div>
106 105
         </div>
107
-        <div class="right">
108
-          <button id="ITP_BTN_MPOMNG01010"><</button>
109
-          <div class="num fnNum">2</div>
110
-          <button id="ITP_BTN_MPOMNG01010">></button>
106
+      </div>
107
+      <div class="scroll_area row-1">
108
+        <ul id="ITP_LIST_MPOMNG01010_DETAIL_ROWS"></ul>
109
+        <div id="ITP_LIST_MPOMNG01010_DETAIL_ROWCOPY" style="display:none;">
110
+          <li>
111
+            <div class="left_info">
112
+              <div class="thick">
113
+                <div class="fnItemNm">품목명</div>
114
+                <div>-</div>
115
+                <div class="fnUnit">2EA</div>
116
+              </div>
117
+              <div class="thick">
118
+                <label class="space0">구매가 :</label>
119
+                <div class="fnPchActAmt">1,120,000</div>
120
+              </div>
121
+            </div>
122
+            <div class="right">
123
+              <button id="ITP_BTN_MPOMNG01010_DETAIL_MINUS">-</button>
124
+              <div class="num fnNum">2</div>
125
+              <button id="ITP_BTN_MPOMNG01010_DETAIL_PLUS">+</button>
126
+            </div>
127
+          </li>
111 128
         </div>
112
-      </li>
113
-    </div>
114
-    <div class="button_bar">
115
-      <button id="ITP_BTN_MPOMNG01010" class="col_3 btn-primary REQ">구매요청</button>
116
-      <button id="ITP_BTN_MPOMNG01010" class="col_3 btn-gray TSA">임시저장</button>
117
-      <button id="ITP_BTN_MPOMNG01010" class="col_3 btn-gray CLB">취소</button>
118
-    </div>
129
+      </div>
130
+      <div class="button_bar">
131
+        <button id="ITP_BTN_MPOMNG01010_DETAIL_REQ_ORDER" data-call-popup="ITP_POP_MPOMNG01010_REQ_CONFIRM" class="col_3 btn-primary REQ">구매요청</button>
132
+        <button id="ITP_BTN_MPOMNG01010_DETAIL_TEMP_SAVE" class="col_3 btn-gray TSA">임시저장</button>
133
+        <button id="ITP_BTN_MPOMNG01010_DETAIL_CANCEL" class="col_3 btn-gray CLB">취소</button>
134
+      </div>
135
+    </form>
119 136
   </div>
137
+  <div id="ITP_MOBILE_JS"></div>
120 138
 </section>

+ 37 - 361
src/main/webapp/mobile/js/app/mpomng/ITP_MPOMNG01010.js

@@ -1,205 +1,23 @@
1 1
 require(['config'], function() {
2 2
 	require([
3 3
 	], function($) {
4
-		pageObj.init();
4
+		contentPageObj.init();
5 5
 	});
6 6
 });
7 7
 
8
-/********************************************************
9
- --------------------------------------------------------
10
- - Object 목록								            -
11
- --------------------------------------------------------
12
- * const gridColModel = {}	: 화면 Grid Object			*
13
- * let pageObj = {}			: 화면공통 Object			*
14
- * let listObj = {}			: 목록화면 Object			*
15
- * let viewObj = {}			: 상세화면 Object			*
16
- * let modifyObj = {}		: 수정화면 Object			*
17
- * let createObj = {}		: 신규화면 Object			*
18
- *******************************************************/
19
-
20
-/*화면 변수*/
21
-/*
22
-const POMNG01010_GRID_ID = '#ITP_POMNG01010_jqGrid';
23
-const POMNG01010_GRID_LIST = '#ITP_POMNG01010_jqGrid_list';
24
-const POMNG01010_GRID_PAGER = '#ITP_POMNG01010_jqGridPager';
25
-const POMNG01010_GRID_EMPTY = '#ITP_POMNG01010_jqGridEmpty';
26
-
27
-const POMNG01010_VIEW_GRID_ID = '#ITP_POMNG01010_VIEW_jqGrid';
28
-const POMNG01010_VIEW_GRID_LIST = '#ITP_POMNG01010_VIEW_jqGrid_list';
29
-const POMNG01010_VIEW_GRID_PAGER = '#ITP_POMNG01010_VIEW_jqGridPager';
30
-const POMNG01010_VIEW_GRID_EMPTY = '#ITP_POMNG01010_VIEW_jqGridEmpty';
31
-*/
32
-const POMNG01010_DETAIL_GRID_ID = '#ITP_POMNG01010_DETAIL_jqGrid';
33
-const POMNG01010_DETAIL_GRID_LIST = '#ITP_POMNG01010_DETAIL_jqGrid_list';
34
-const POMNG01010_DETAIL_GRID_PAGER = '#ITP_POMNG01010_DETAIL_jqGridPager';
35
-const POMNG01010_DETAIL_GRID_EMPTY = '#ITP_POMNG01010_DETAIL_jqGridEmpty';  // ==>dwkim html확인필요
36
-
37
-/*
38
-let ITP_FORM_POMNG01010_DETAIL_IS_DUPLICATE = false;
39
-let ITP_FORM_POMNG01010_DETAIL_IS_WRITING = false;
40
-*/
41
-
42 8
 /*API URL*/
43
-let API_DETAIL_INIT_INFO = '/api/pomng/init-pchReq'
44
-//let API_DETAIL_GRID_LIST = '/api/affl/detail-grid-list';
45
-//let API_DETAIL_INFO = '/api/affl/info-affl';
46
-//let COMPANY_INFO_COMPANY = '/api/affl/info-affl';
47
-let API_DETAIL_SAVE = '/api/pomng/save-pchReq';
48
-//let API_CHECK_DUPLICATE = '/api/affl/check-duplicate';
49
-//let API_INTI_USERPW = '/api/user/inti-userpw';
50
-
51
-/*화면 Grid ColModel   ==>선택박스 항목 추가 부분  */
52
-const gridColModel = {
53
-	detail: [
54
-		{
55
-			index: 'VIEW_CD', name: 'viewCd',
56
-			label: ITP_MSG_LOCALE.label.viewCd,
57
-			width: '10', fixed: false, align: 'center',
58
-			sortable: false, hidden: true
59
-		},
60
-		{
61
-			index: 'ITEM_ID', name: 'itemId',
62
-			label: ITP_MSG_LOCALE.label.itemId,
63
-			width: '20', fixed: false, align: 'center',
64
-			sortable: false, editable: false, edittype: 'text',
65
-			editrules: { required: true }
66
-		},
67
-		{
68
-			index: 'ITEM_NM', name: 'itemNm',
69
-			label: ITP_MSG_LOCALE.label.itemNm,
70
-			width: '30', fixed: false, align: 'center',
71
-			sortable: true, editable: false, edittype: 'text',
72
-			editrules: { required: true }
73
-		},
74
-		{
75
-			index: 'UNIT', name: 'unit',
76
-			label: ITP_MSG_LOCALE.label.unit,
77
-			width: '10', fixed: false, align: 'center',
78
-			sortable: false, editable: false, edittype: 'text'
79
-		},
80
-		{
81
-			index: 'UNIT_AMT', name: 'unitAmt',
82
-			label: ITP_MSG_LOCALE.label.unitAmt,
83
-			width: '10', fixed: false, align: 'center',
84
-			sortable: false, editable: false, edittype: 'text', hidden: false
85
-		},
86
-		{
87
-			index: 'PCH_REQ_QTY', name: 'pchReqQty',
88
-			label: ITP_MSG_LOCALE.label.pchReqQty, //단가
89
-			width: '10', fixed: false, align: 'right',
90
-			sortable: true, editable: true, edittype: 'text',
91
-			editrules: { number:true}
92
-		},
93
-		{
94
-			index: 'PCH_REQ_AMT', name: 'pchReqAmt',
95
-			label: ITP_MSG_LOCALE.label.pchReqAmt,
96
-			width: '10', fixed: false, align: 'right',
97
-			sortable: false, editable: false, edittype: 'text', hidden: false
98
-		},
9
+const API_MOBILE_INIT_INFO	= '/api/pomng/init-pchReq';
10
+const API_MOBILE_SAVE		= '/api/pomng/save-pchReq';
11
+const API_POP_SEARCH_LIST	= '/api/whs/mng/pop-whs-search';
99 12
 
100
-		{
101
-			index: 'BRAND_UNIT_UNQ_NO', name: 'brandUnitUnqNo',
102
-			label: ITP_MSG_LOCALE.label.brandUnitUnqNo,
103
-			width: '10', fixed: false, align: 'center',
104
-			sortable: false, editable: false, edittype: 'text', hidden: true
105
-		},
106
-		{
107
-			index: 'STORE_UNIT_UNQ_NO', name: 'storeUnitUnqNo',
108
-			label: ITP_MSG_LOCALE.label.storeUnitUnqNo,
109
-			width: '10', fixed: false, align: 'center',
110
-			sortable: false, editable: false, edittype: 'text', hidden: true
111
-		},
112
-		{
113
-			index: 'UNIT_GUBUN', name: 'unitGubun',
114
-			label: ITP_MSG_LOCALE.label.unitGubun,
115
-			width: '10', fixed: false, align: 'center',
116
-			sortable: false, editable: false, edittype: 'text', hidden: true
117
-		}
118
-	]
119
-};
120
-
121
-/*화면공통 Object*/
122
-let pageObj = {
123
-	init: function() {
13
+let contentPageObj = {
14
+	init: function () {
124 15
 		this.ui.init();
125 16
 		this.event.init();
126
-		this.action();
127
-	},
128
-	action: function () {
129
-		var _this = this;
130
-		// 납품장소 조회 버튼 클릭
131
-		$('#ITP_FORM_POMNG01010_SEARCH_WHS_NM').on('click', function() {
132
-			_this.popup();
133
-		});
134
-		// 납품장소 텍스트 삭제 버튼 클릭
135
-		$('#ITP_FORM_POMNG01010_DELETE_WHS_NM').on('click', function() {
136
-			$('#ITP_FORM_POMNG01010_DETAIL_WHS_NM').val('');
137
-			$('#ITP_FORM_POMNG01010_DETAIL_WHS_ID').val('');
138
-			$('#ITP_FORM_POMNG01010_DETAIL_LOCATION_NM').val('');
139
-			$('#ITP_FORM_POMNG01010_DETAIL_LOCATION').val('');
140
-			
141
-		});
142
-	},
143
-	popup: function () {
144
-		// 팝업
145
-		var popFn = this.callback.create;
146
-		const key = {brandId:fn_make_user_info.get('brandId'),storeId:fn_make_user_info.get('storeId')};
147
-		fn_call_popup('biz', 'BIZPOP_WHS_LOCATION', '#ITP_ASIDE', popFn, key, 'S');
148
-		
149 17
 	},
150
-	callback: {
151
-		create: function(rowDataPop) {
152
-			console.log(rowDataPop);
153
-			if(rowDataPop) {
154
-				$('#ITP_FORM_POMNG01010_DETAIL_WHS_NM').val(rowDataPop.whsNm);
155
-				$('#ITP_FORM_POMNG01010_DETAIL_WHS_ID').val(rowDataPop.whsId);
156
-				$('#ITP_FORM_POMNG01010_DETAIL_LOCATION_NM').val(rowDataPop.locationNm);
157
-				$('#ITP_FORM_POMNG01010_DETAIL_LOCATION').val(rowDataPop.location);
158
-			}
159
-		}
160
-	},
161
-	itp_POMNG01010_param: {},  // ==>dwkim 
162
-	itp_POMNG01010_search: false,  // ==>dwkim 
163 18
 	ui: {
164
-		init: function() {
165
-			this.view();
166
-			this.grid();
167
-			this.ready();
168
-		},
169
-		view: function() {
170
-			// 버튼 권한설정
171
-			fn_proc_btn_auth('POMNG01010');
172
-			
173
-			// 공통코드 표시
174
-			$('select').each(function() {
175
-				if ($(this).data('select-code')) {
176
-					fn_make_select(CODE_LIST, $(this).data('select-code'), $(this).attr('id'));
177
-				}
178
-			});
19
+		init: function () {
179 20
 
180
-			// 조회일자 지정
181
-			var now = new Date();
182
-			$('#ITP_FORM_POMNG01010_DETAIL_DLV_REQ_DT').datepicker('dlvReqDt', new Date(now.setDate(now.getDate() + 5)));
183
-			
184
-			//납품장소 필드 readonly
185
-			$('#ITP_FORM_POMNG01010_DETAIL_WHS_NM').attr('readonly', true);
186
-			$('#ITP_FORM_POMNG01010_DETAIL_LOCATION_NM').attr('readonly', true);
187
-			// form alert message 주입
188
-			/*
189
-			$('input[data-alert-required="ONLYCHK"]').each(function() {
190
-				if($(this).data('alert-msg') === 'address') {
191
-					$(this).data('alert-msg', ITP_MSG_LOCALE.message.form.emptyAddr);
192
-				}
193
-			});
194
-			*/
195
-		},
196
-		grid: function() {
197
-			itp_fn_jqgrid_resize(POMNG01010_DETAIL_GRID_ID, POMNG01010_DETAIL_GRID_LIST, 'lg');
198
-			//listObj.empty.init();
199
-			itp_fn_fire_window_resize();
200
-		},
201
-		ready: function() {
202
-			createObj.init();
203 21
 		}
204 22
 	},
205 23
 	event: {
@@ -207,188 +25,46 @@ let pageObj = {
207 25
 			this.button();
208 26
 		},
209 27
 		button: function() {
210
-			// 버튼 클릭 이벤트
211
-			$('button').each(function() {
212
-				var id = $(this).attr('id');
213
-				$(this).on('click', function() {
28
+			$('button[id^="ITP_BTN_MPOMNG01010_DETAIL"]').on('click', function() {
29
+				if($(this).is('[data-call-popup]')) {
30
+					contentPopObj.show($(this).data('call-popup'));
31
+				} else {
32
+					var id = $(this).attr('id');
214 33
 					switch (id) {
215
-						case 'ITP_BTN_POMNG01010_SRH': modifyObj.button.save(); break;	// 구매요청
216
-						case 'ITP_BTN_POMNG01010_NEWREG': modifyObj.button.newReg(); break;	// 임시저장
217
-						case 'ITP_BTN_POMNG01010_DETAIL_ADDROW': pageObj.grid.button.addRow(); break;	// 품목추가
218
-						case 'ITP_BTN_POMNG01010_DETAIL_DELROW': pageObj.grid.button.delRow(); break;	// 품목삭제
34
+						case 'ITP_BTN_MPOMNG01010_DETAIL_TEMP_SAVE': break;
35
+						case 'ITP_BTN_MPOMNG01010_DETAIL_CANCEL':break;
219 36
 					}
220
-				});
221
-			});
222
-
223
-			$('body').on('click', function(e) {
224
-				// afflUserObj.grid.resetGrid(e);
225
-			});
226
-
227
-		}
228
-	},
229
-	grid: {
230
-		init: function(mode, gridData) {
231
-			this.mode = mode;
232
-			this.gridId = POMNG01010_DETAIL_GRID_ID;
233
-			this.unload();  // ==>dwkim 
234
-			this.load(gridData);
235
-		},
236
-		mode: 'DETAIL',
237
-		gridId: '',
238
-		button: {
239
-			addRow: function() {
240
-				// 팝업
241
-				var popFn = function(rowDataPop) {
242
-					console.log(rowDataPop);
243
-					// 기존등록 데이터
244
-					var exists = '';
245
-					const rowData = $(POMNG01010_DETAIL_GRID_ID).getRowData();
246
-					$.each(rowData, function(key, value) {
247
-						//exists = exists + value.itemId + ';';
248
-						exists = exists + value.brandUnitUnqNo + ';';
249
-					});
250
-
251
-					$.each(rowDataPop, function(key, value) {
252
-						// if (exists.indexOf(value.itemId) < 0 && value.podrPssblDvsn == 'PO01') {
253
-						if (exists.indexOf(value.brandUnitUnqNo) < 0 && value.podrPssblDvsn == 'PO01') {
254
-							value['viewCd'] = "C";
255
-							$(POMNG01010_DETAIL_GRID_ID).jqGrid('addRowData', value.brandUnitUnqNo, value, 'last');
256
-						}
257
-					});
258
-					$(POMNG01010_DETAIL_GRID_EMPTY).hide();
259
-				};
260
-				const key = {brandId:fn_make_user_info.get('brandId'),storeId:fn_make_user_info.get('storeId')};
261
-				fn_call_popup('biz', 'BIZPOP_ITEM', '#ITP_ASIDE', popFn, key, 'S');  // ==>dwkim 추후 작업 진행  파라메타 설명필요
262
-			},
263
-			delRow: function() {
264
-				itp_fn_grid_del_row(POMNG01010_DETAIL_GRID_ID);
265
-				// 그리드 포문으로 금액 재계산후 구매요청금액에 넣어줌
266
-				this.load.recal();  //==>dwkim 왜 호출이 안될까요
267
-			}
268
-		},
269
-		load: function(gridData) {  // ==>dwkim  오픈시 데이타 가져오는 부분 넣으면 되는건지 여부 gird가 아님
270
-			var _this = this;
271
-			var option = {
272
-				gridId: this.gridId,
273
-				colModel: gridColModel.detail,
274
-				data: gridData,
275
-				multiselect: true,
276
-				cellEdit: true,
277
-				loadComplete: function(data) {
278
-					_this.clearData();
279
-				},
280
-				afterSaveCell: function(rowid,name,val,iRow,iCol) {
281
-					// 구매요청금액 계산 (기존금액과 )
282
-					var unitAmt = jQuery(POMNG01010_DETAIL_GRID_ID).jqGrid('getCell',rowid,iCol-1);
283
-					jQuery(POMNG01010_DETAIL_GRID_ID).jqGrid('setRowData',rowid,{pchReqAmt: parseInt(val)*parseInt(unitAmt)});
284
-					// 그리드 포문으로 금액 재계산후 구매요청금액에 넣어줌
285
-					_this.recal();
286
-				}
287
-			};
288
-			itp_fn_grid_make_local(option);
289
-		},
290
-		clearData: function() {
291
-			console.log(this.gridId);
292
-			$(POMNG01010_DETAIL_GRID_ID).jqGrid('clearGridData', true);
293
-			$(POMNG01010_DETAIL_GRID_LIST).find('.ui-jqgrid .ui-jqgrid-bdiv').css('overflow-x', 'hidden');
294
-			$(POMNG01010_DETAIL_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
295
-			$(POMNG01010_DETAIL_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
296
-			$(POMNG01010_DETAIL_GRID_EMPTY).show();
297
-		},
298
-		recal: function() {
299
-			//PCH_REQ_AMT
300
-			const rowData = $(POMNG01010_DETAIL_GRID_ID).getRowData();
301
-			var pchReqAmt = 0 ;
302
-			$.each(rowData, function(key, value) {
303
-				if (value.pchReqAmt != null && value.pchReqAmt != "") {
304
-					pchReqAmt = pchReqAmt + parseInt(value.pchReqAmt) ;
305 37
 				}
306
-				
38
+				return false;
307 39
 			});
308
-			$('#ITP_FORM_POMNG01010_DETAIL .fnPchReqAmt').text(pchReqAmt);
309
-		},
310
-		unload: function() {
311
-			$.jgrid.gridUnload(this.gridId);
312 40
 		}
313 41
 	}
314 42
 };
315 43
 
316
-/*신규화면 Object*/
317
-let createObj = {
318
-	init: function() {
319
-		$('#ITP_FORM_POMNG01010_DETAIL_BRAND_ID').val(fn_make_user_info.get('brandId'));
320
-		$('#ITP_FORM_POMNG01010_DETAIL_STORE_ID').val(fn_make_user_info.get('storeId'));
321
-		//let param = 'brandId=' + LOGIN_USER_INFO.brandId + "&spplyId=" + LOGIN_USER_INFO.spplyId;
322
-		this.load();
44
+let contentPopObj = {
45
+	show: function(id, args, fn) {
46
+		this.button();
47
+		console.log(id);
48
+		$('#' + id).show();
323 49
 	},
324
-	button: {
325
-		save: function() {
326
-			const formId = '#ITP_FORM_POMNG01010_DETAIL';
327
-			itp_fn_form_clear_validate(null, formId);
328
-
329
-			// if (vali_cmpyCd && vali_cmpyStatCd && vali_cmpyTypeCd && vali_cmpyNm && vali_bossNm && vali_mainTel && vali_mainEmail) {
330
-			if (itp_fn_form_event.isValid(formId)) {
331
-
332
-				// if($('#ITP_FORM_POMNG01010_DETAIL_CMPY_ZIPNO').val() === '' || $('#ITP_FORM_POMNG01010_DETAIL_CMPY_ADRES').val() === '') {
333
-				// 	itp_fn_modal_alert('주소 검색을 통해 회사 주소를 입력하세요.');
334
-				// 	return;
335
-				// }
336
-
337
-				if (ITP_FORM_POMNG01010_DETAIL_IS_DUPLICATE) {
338
-					itp_fn_modal_duplicate('회사코드 중복체크를 해주세요.', formId + '_AFFL_SHOP_ID');
339
-				} else {
340
-					let gridInsertData = [];
341
-					let gridUpdateData = [];
342
-					let gridDeleteData = [];
343
-					const rowData = $(POMNG01010_DETAIL_GRID_ID).getRowData();
344
-					const keyValue = $(formId + '_AFFL_SHOP_ID').val();
345
-					$.each(rowData, function(key, value) {
346
-						if (value.viewCd !== 'R') {
347
-							value.afflShopId = keyValue;
348
-							if (value.viewCd === 'C') {
349
-								gridInsertData.push(value);
350
-							} else if (value.viewCd === 'U') {
351
-								gridUpdateData.push(value);
352
-							} else if (value.viewCd === 'D') {
353
-								gridDeleteData.push(value);
354
-							}
355
-						}
356
-					});
357
-
358
-					let param = $(formId).serializeObject();
359
-					param.gridInsertData = gridInsertData;
360
-					param.gridUpdateData = gridUpdateData;
361
-					param.gridDeleteData = gridDeleteData;
362
-					console.log(JSON.stringify(param));
363
-					var searhFn = function() {
364
-						ITP_FORM_POMNG01010_DETAIL_IS_WRITING = false;
365
-						viewObj.init();
366
-					};
367
-					fn_ajax_call(API_DETAIL_SAVE, JSON.stringify(param), searhFn, 'POST');
368
-				}
50
+	button: function() {
51
+		var _this = this;
52
+		$('button[id^="ITP_BTN_MPOMNG01010_POP"]').off('click').on('click', function() {
53
+			var id = $(this).attr('id');
54
+			if(id.indexOf('POP_CLOSE') > -1) {
55
+				_this.hide(id);
56
+				return;
369 57
 			}
370
-		}
371
-	},
372
-	load: function() {
373
-		fn_ajax_call(API_DETAIL_INIT_INFO, '', this.callback, 'GET');
58
+			switch (id) {
59
+				case 'ITP_BTN_MPOMNG01010_POP_CANCEL': _this.hide(id); break;
60
+				case 'ITP_BTN_MPOMNG01010_POP_CONFIRM': break;
61
+				case 'ITP_BTN_MPOMNG01010_POP_SEARCH':
62
+					break;
63
+			}
64
+			return false;
65
+		});
374 66
 	},
375
-	callback: function(result) {
376
-		console.log(result);
377
-
378
-		$('#ITP_FORM_POMNG01010_DETAIL #ITP_FORM_POMNG01010_DETAIL_VIEW_CD').val('C');
379
-
380
-		$('#ITP_FORM_POMNG01010_DETAIL #ITP_FORM_POMNG01010_DETAIL_BRAND_ID').val(result.brandId);
381
-		$('#ITP_FORM_POMNG01010_DETAIL #ITP_FORM_POMNG01010_DETAIL_STORE_ID').val(result.storeId);
382
-		$('#ITP_FORM_POMNG01010_DETAIL #ITP_FORM_POMNG01010_DETAIL_LOAN_DVSN').val(result.loanDvsn);
383
-		$('#ITP_FORM_POMNG01010_DETAIL #ITP_FORM_POMNG01010_DETAIL_LOAN_MGNT_UNQ_NO').val(result.loanMgntUnqNo);
384
-		$('#ITP_FORM_POMNG01010_DETAIL #ITP_FORM_POMNG01010_DETAIL_PCH_REQ_DVSN').val(result.pchReqDvsn);
385
-		$('#ITP_FORM_POMNG01010_DETAIL .fnBrandNm').text(result.brandNm);
386
-		$('#ITP_FORM_POMNG01010_DETAIL .fnPchReqDept').text(result.reqDept);
387
-		$('#ITP_FORM_POMNG01010_DETAIL .fnPchReqMgrNm').text(result.userNm);
388
-		$('#ITP_FORM_POMNG01010_DETAIL .fnPchReqAmt').text("0");
389
-		$('#ITP_FORM_POMNG01010_DETAIL .fnLoanDvsnNm').text(result.loanDvsnNm);
390
-		$('#ITP_FORM_POMNG01010_DETAIL .fnPchActAmt').text(result.ordUseAmt);
391
-
392
-		pageObj.grid.init();
67
+	hide: function(id) {
68
+		$('#' + id).closest('.mobile-pop-close').hide();
393 69
 	}
394 70
 };

+ 67 - 59
src/main/webapp/mobile/js/config.js

@@ -41,63 +41,7 @@ require([
41 41
 ], function($) {
42 42
 	history.pushState(null, null, location.href);
43 43
 
44
-	$.fn.serializeObject = function() {
45
-		var result = {};
46
-		var extend = function(i, element) {
47
-			var node = result[element.name];
48
-			if ('undefined' !== typeof node && node !== null) {
49
-				if ($.isArray(node)) {
50
-					node.push($.trim(element.value));
51
-				} else {
52
-					result[element.name] = [node, $.trim(element.value)];
53
-				}
54
-			} else {
55
-				result[element.name] = $.trim(element.value);
56
-			}
57
-		}
58
-		$.each(this.serializeArray(), extend);
59
-		return result;
60
-	};
61
-
62
-	$.fn.extend({
63
-		treed: function(o) {
64
-			var openedClass = 'glyphicon-minus text-primary';
65
-			var closedClass = 'glyphicon-plus text-primary';
66
-
67
-			if (typeof o != 'undefined') {
68
-				if (typeof o.openedClass != 'undefined') {
69
-					openedClass = o.openedClass;
70
-				}
71
-				if (typeof o.closedClass != 'undefined') {
72
-					closedClass = o.closedClass;
73
-				}
74
-			};
75
-
76
-			var tree = $(this);
77
-			tree.addClass('tree');
78
-			tree.find('li').has('ul').each(function() {
79
-				var branch = $(this);
80
-				branch.find('.list-group-item').first().prepend('<i class="indicator glyphicon ' + closedClass + '"></i>');
81
-				branch.addClass('branch');
82
-				branch.on('click', function(e) {
83
-					if (this == e.target) {
84
-						var icon = $(this).find('.list-group-item').first().children('i:first');
85
-						icon.toggleClass(openedClass + ' ' + closedClass);
86
-						$(this).children('ul').children().toggle();
87
-					}
88
-				});
89
-				branch.children('ul').children().toggle();
90
-				//branch.children('ul').children().show();
91
-			});
92
-
93
-			tree.find('.branch .indicator').each(function() {
94
-				$(this).on('click', function() {
95
-					$(this).closest('li').click();
96
-					return false;
97
-				});
98
-			});
99
-		}
100
-	});
44
+	CommonObj.init();
101 45
 
102 46
 	$('#ITP_BTN_HOME').on('click', function() {
103 47
 		location.replace(MOBILE_CONTEXTPATH + '/app/main.html');
@@ -272,10 +216,11 @@ var fn_make_slide_menu = {
272 216
 			complete: function() {
273 217
 			},
274 218
 			success: function(html) {
275
-				$('#ITP_CONTAINER .content').empty().append(html);
219
+				$('#ITP_CONTAINER div.itp_mobile_contents').empty().append(html);
276 220
 				//JS파일적용
277 221
 				const js = "<script src=\"../js/app/"+id.substring(0, id.length - 5).toLowerCase()+"/ITP_"+id+".js?version="+js_version+"\"></script>";
278
-				$('#ITP_CONTAINER #ITP_TAB_'+id+' #ITP_TAP_JS').append(js);
222
+				console.log(js);
223
+				$('#ITP_CONTAINER #ITP_MOBILE_'+id+' #ITP_MOBILE_JS').append(js);
279 224
 				$('#ITP_MENU').toggle();
280 225
 			},
281 226
 			error: function(xhr, status, error) {
@@ -708,3 +653,66 @@ let itp_fn_form_event = {
708 653
 		return isValid;
709 654
 	}
710 655
 };
656
+
657
+let CommonObj = {
658
+	init: function() {
659
+		$.fn.serializeObject = function() {
660
+			var result = {};
661
+			var extend = function(i, element) {
662
+				var node = result[element.name];
663
+				if ('undefined' !== typeof node && node !== null) {
664
+					if ($.isArray(node)) {
665
+						node.push($.trim(element.value));
666
+					} else {
667
+						result[element.name] = [node, $.trim(element.value)];
668
+					}
669
+				} else {
670
+					result[element.name] = $.trim(element.value);
671
+				}
672
+			}
673
+			$.each(this.serializeArray(), extend);
674
+			return result;
675
+		};
676
+
677
+		$.fn.extend({
678
+			treed: function(o) {
679
+				var openedClass = 'glyphicon-minus text-primary';
680
+				var closedClass = 'glyphicon-plus text-primary';
681
+
682
+				if (typeof o != 'undefined') {
683
+					if (typeof o.openedClass != 'undefined') {
684
+						openedClass = o.openedClass;
685
+					}
686
+					if (typeof o.closedClass != 'undefined') {
687
+						closedClass = o.closedClass;
688
+					}
689
+				};
690
+
691
+				var tree = $(this);
692
+				tree.addClass('tree');
693
+				tree.find('li').has('ul').each(function() {
694
+					var branch = $(this);
695
+					branch.find('.list-group-item').first().prepend('<i class="indicator glyphicon ' + closedClass + '"></i>');
696
+					branch.addClass('branch');
697
+					branch.on('click', function(e) {
698
+						if (this == e.target) {
699
+							var icon = $(this).find('.list-group-item').first().children('i:first');
700
+							icon.toggleClass(openedClass + ' ' + closedClass);
701
+							$(this).children('ul').children().toggle();
702
+						}
703
+					});
704
+					branch.children('ul').children().toggle();
705
+					//branch.children('ul').children().show();
706
+				});
707
+
708
+				tree.find('.branch .indicator').each(function() {
709
+					$(this).on('click', function() {
710
+						$(this).closest('li').click();
711
+						return false;
712
+					});
713
+				});
714
+			}
715
+		});
716
+
717
+	}
718
+};