Browse Source

모바일 구매요청현황 작업

juney 2 years ago
parent
commit
31671e2453

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

@@ -3,15 +3,15 @@
3 3
     <div class="pop">
4 4
       <div class="pop_line">
5 5
         <label>납품요청일 &nbsp;&nbsp;:</label>
6
-        <div class="fnPopDlvReqDt">2022.09.30</div>
6
+        <div class="fnPopDlvReqDt"></div>
7 7
       </div>
8 8
       <div class="pop_line">
9 9
         <label>품목수&nbsp;&nbsp; :</label>
10
-        <div class="fnItemQty">2개</div>
10
+        <div class="fnItemQty">개</div>
11 11
       </div>
12 12
       <div class="pop_line">
13 13
         <label>구매금액 &nbsp;&nbsp;:</label>
14
-        <div class="fnOrdAmt">2022.09.30원</div>
14
+        <div class="fnOrdAmt">원</div>
15 15
       </div>
16 16
       <label class="pop_label msg_save">구매요청 하시겠습니까?</label>
17 17
       <div class="popup_btn">

+ 275 - 72
src/main/webapp/mobile/app/mpomng/MPOMNG02010.html

@@ -1,18 +1,21 @@
1
-<section>
1
+<section id="ITP_MOBILE_MPOMNG02010">
2 2
   <div id="ITP_AJAX_MPOMNG02010_VIEW_CONTAINER" style="display: none;">
3 3
     <div class="content">
4
+      <form id="ITP_FORM_MPOMNG02010_SEARCH" class="form-horizontal" onsubmit="return false;">
5
+        <input type="hidden" id="ITP_FORM_MPOMNG02010_SEARCH_BRAND_ID" name="sbrandId" value="">
6
+        <input type="hidden" id="ITP_FORM_MPOMNG02010_SEARCH_STORE_ID" name="sstoreId" value="">
4 7
         <div class="line">
5 8
           <label>구매요청일</label>
6
-        <div class="date_to">
7
-          <input id="ITP_FORM_MPOMNG02010_VIEW" class="year" type="date">
9
+        <div class="input-group date_to date">
10
+          <input type="date" id="ITP_FORM_MPOMNG02010_SEARCH_FROM_DT" name="fromDt" pattern="\d{4}.\d{2}.\d{2}">
8 11
           <div class="at">~</div>
9
-          <input id="ITP_FORM_MPOMNG02010_VIEW" class="year" type="date">
12
+          <input type="date" id="ITP_FORM_MPOMNG02010_SEARCH_TO_DT" name="toDt" pattern="\d{4}.\d{2}.\d{2}">
10 13
         </div>
11 14
       </div>
12 15
       <div class="line">
13 16
         <label>구매요청상태</label>
14 17
         <div class="line_right">
15
-          <select id="ITP_FORM_MPOMNG02010_VIEW" class="stcd" name="">
18
+          <select id="ITP_FORM_MPOMNG02010_SEARCH_PCH_REQ_ST_CD" data-select-code="PCH_REQ_ST_CD" class="stcd" name="spchReqStCd">
16 19
             <option value="">상태</option>
17 20
           </select>
18 21
         </div>
@@ -21,126 +24,326 @@
21 24
         <label>납품장소</label>
22 25
         <div class="search_wrap">
23 26
 	        <div class="float_left">
24
-	          <input id="ITP_FORM_MPOMNG02010_VIEW" class="" type="text" placeholder="A매장명">
27
+	          <input id="ITP_FORM_MPOMNG02010_SEARCH_WHS_NM" class="" name="swhsNm" type="text" placeholder="납품창고" readonly>
28
+              <input type="hidden" id="ITP_FORM_MPOMNG02010_SEARCH_WHS_ID" name="swhsId" value="">
25 29
 	        </div>
26 30
 	        <div class="float_left_btn">
27
-	          <button id="ITP_BTN_MPOMNG02010"><img src="../img/search.png" alt=""></button>
28
-	          <button id="ITP_BTN_MPOMNG02010"><img src="../img/delete.png" alt=""></button>
31
+	          <button id="ITP_BTN_MPOMNG02010_SEARCH_WHS_NM"><img src="../img/search.png" alt=""></button>
32
+	          <button id="ITP_BTN_MPOMNG02010_DELETE_WHS_NM"><img src="../img/delete.png" alt=""></button>
29 33
 	        </div>
30 34
         </div>
31 35
       </div>
32 36
       <div class="line" style="height:50px;">
33 37
         <div class="search">
34
-          <button id="ITP_BTN_MPOMNG02010" class="btn-primary btn-sm ADB">검색</button>
38
+          <button id="ITP_BTN_MPOMNG02010_SEARCH" class="btn-primary btn-sm ADB">검색</button>
35 39
         </div>
36 40
       </div>
37 41
       <div class="table_header">
38 42
         <h1>>구매 요청 내역</h1>
39 43
       </div>
44
+      </form>
40 45
     </div>
41
-    <div class="scroll_area row-1-1">
42
-      <li class="history_list">
43
-        <div class="left">
44
-          <div class="nomal">
45
-            <label>구매요청일 </label>
46
-            <span>:</span>
47
-            <div class="history">
48
-              <div class="fndate">2022.10.01</div> 
49
-              (<div class="fnOwnerNm">홍길동 점주</div>)
46
+    <div id="ITP_LIST_MPOMNG02010_LIST_AREA" class="scroll_area row-1-1">
47
+      <ul id="ITP_LIST_MPOMNG02010_LIST_ROWS" class="panel-group"></ul>
48
+      <div id="ITP_LIST_MPOMNG02010_LIST_ROWCOPY" style="display:none;">
49
+        <li class="history_list list-row">
50
+          <div class="left">
51
+            <div class="nomal">
52
+              <label>구매요청일 </label>
53
+              <span>:</span>
54
+              <div class="history">
55
+                <div class="fnPchReqDt">2022.10.01</div>
56
+                (<div class="fnPchReqMgrNm">홍길동 점주</div>)
57
+              </div>
50 58
             </div>
51 59
           </div>
52
-        </div>
53
-        <div class="left">
54
-          <div class="nomal">
55
-          	<div class="half">
56
-	            <label>구매상태</label>
57
-	            <span>:</span>
58
-	            <div class="history">
59
-	              <div class="fn">대기</div>
60
-	            </div>
61
-            </div>
62
-          	<div class="half">
63
-	            <label>납품장소명 </label>
64
-	            <span>:</span>
65
-	            <div class="history">
66
-	              <div class="fn">A매장내</div>
67
-	            </div>
60
+          <div class="left">
61
+            <div class="nomal">
62
+              <div class="half">
63
+                  <label>구매상태</label>
64
+                  <span>:</span>
65
+                  <div class="history">
66
+                    <div class="fnPchReqStNm">대기</div>
67
+                  </div>
68
+              </div>
69
+              <div class="half">
70
+                  <label>납품장소명 </label>
71
+                  <span>:</span>
72
+                  <div class="history">
73
+                    <div class="fnWhsLocationNm">A매장내</div>
74
+                  </div>
75
+              </div>
68 76
             </div>
69 77
           </div>
70
-        </div>
71
-        <div class="left">
72
-          <div class="nomal">
73
-            <label style="width: 127px;">구매요청 정보</label>
74
-            <span>:</span>
75
-            <div class="history">
76
-              <div class="fn">품목수(3)</div> 
77
-              <i>- </i>
78
-              <div class="fn">1,200,000</div>
78
+          <div class="left">
79
+            <div class="nomal">
80
+              <label style="width: 127px;">구매요청 정보</label>
81
+              <span>:</span>
82
+              <div class="history">
83
+                <div class="fnPchReqItemQty">품목수(3)</div>
84
+                <i>- </i>
85
+                <div class="fnPchReqTotalAmt"></div>
86
+              </div>
79 87
             </div>
80 88
           </div>
81
-        </div>
82
-        <div class="left">
83
-          <div class="nomal">
84
-            <label>결재정보 </label>
85
-            <span>:</span>
86
-            <div class="history">
87
-              <div class="fn">미납</div> 
89
+          <div class="left">
90
+            <div class="nomal">
91
+              <label>결재정보 </label>
92
+              <span>:</span>
93
+              <div class="history">
94
+                <div class="fnPchReqRjctNm"></div>
95
+              </div>
88 96
             </div>
89 97
           </div>
90
-        </div>
91
-      </li>
98
+        </li>
99
+      </div>
92 100
     </div>
93 101
   </div>
94
-  <div id="ITP_AJAX_MPOMNG02010_DETAIL_CONTAINER" style="display: block;">
102
+  <div id="ITP_AJAX_MPOMNG02010_DETAIL_CONTAINER" style="display: none;">
95 103
     <div class="content">
96 104
       <div class="line">
97 105
         <label>납기요청일</label>
98 106
         <div class="line_right">
99
-          <div class="fn">2022.10.10</div>
107
+          <div class="fnDlvReqDt"></div>
100 108
         </div>      
101 109
       </div>
102 110
       <div class="line">
103 111
         <label>구매요청금액</label>
104 112
         <div class="line_right">
105
-          <div class="fn">424,000원</div>
113
+          <div class="fnPchReqTotalAmt">424,000원</div>
106 114
         </div>
107 115
       </div>
108 116
       <div class="line">
109 117
         <label>납품장소</label>
110 118
         <div class="line_right">
111
-          <div class="fn">A매장내</div>
119
+          <div class="fnLocationNm">A매장내</div>
112 120
         </div>
113 121
       </div>
114 122
       <div class="line">
115 123
         <label>결재정보</label>
116 124
         <div class="line_right">
117
-          <div class="fn">(미납)0원</div>
125
+          <div class="fnPchApprNm">(미납)0원</div>
118 126
         </div>
119 127
       </div>
120 128
       <div class="table_header">
121 129
         <h1>>구매 품목</h1>
122 130
       </div>
123 131
     </div>
124
-    <div class="scroll_area row-2">
125
-      <li>
126
-        <div class="left_info">
127
-          <div class="thick">
128
-            <div class="fnItemNm">품목명</div>
129
-            <div>-</div>
130
-            <div class="fnUnit">2EA</div>
132
+    <div id="ITP_LIST_MPOMNG02010_DETAIL_AREA" class="scroll_area row-2">
133
+      <ul id="ITP_LIST_MPOMNG02010_DETAIL_ROWS" class="panel-group"></ul>
134
+      <div id="ITP_LIST_MPOMNG02010_DETAIL_ROWCOPY" style="display:none;">
135
+        <li class="list-row">
136
+          <div class="left_info">
137
+            <div class="thick">
138
+              <div class="fnItemNm">품목명</div>
139
+              <div>-</div>
140
+              <div class="fnUnit">2EA</div>
141
+            </div>
142
+            <div class="thick">
143
+              <label class="space0">구매가 :</label>
144
+              <div class="fnPchReqAmt">1,120,000</div>
145
+            </div>
131 146
           </div>
132
-          <div class="thick">
133
-            <label class="space0">구매가 :</label>
134
-            <div class="fnPchActAmt">1,120,000</div>
147
+          <div class="right">
148
+            <div class="fnPchReqQty">2</div>
135 149
           </div>
150
+        </li>
151
+      </div>
152
+    </div>
153
+    <div class="button_bar">
154
+      <button id="ITP_BTN_MPOMNG02010_CANCEL_LIST" class="col_12 btn-gray CLB">취소</button>
155
+    </div>
156
+  </div>
157
+  <div id="ITP_AJAX_MPOMNG02010_MODIFY_CONTAINER" style="display: none;">
158
+    <form id="ITP_FORM_MPOMNG02010_MODIFY" class="form-horizontal" onsubmit="return false;">
159
+      <input type="hidden" id="ITP_FORM_MPOMNG02010_MODIFY_VIEW_CD" name="viewCd" value="C">
160
+      <input type="hidden" id="ITP_FORM_MPOMNG02010_MODIFY_BRAND_ID" name="brandId" value="">
161
+      <input type="hidden" id="ITP_FORM_MPOMNG02010_MODIFY_STORE_ID" name="storeId" value="">
162
+      <input type="hidden" id="ITP_FORM_MPOMNG02010_MODIFY_LOAN_DVSN" name="loanDvsn" value="">
163
+      <input type="hidden" id="ITP_FORM_MPOMNG02010_MODIFY_LOAN_MGNT_UNQ_NO" name="loanMgntUnqNo" value="">
164
+      <input type="hidden" id="ITP_FORM_MPOMNG02010_MODIFY_PCH_REQ_DVSN" name="pchReqDvsn" value="">
165
+      <input type="hidden" id="ITP_FORM_MPOMNG02010_MODIFY_PCH_REQ_ST_CD" name="pchReqStCd" value="">
166
+      <div class="content">
167
+        <div class="line">
168
+          <label>납기요청일</label>
169
+          <input id="ITP_FORM_MPOMNG02010_MODIFY_DLV_REQ_DT" name="dlvReqDt" class="date fnDlvReqDt" data-check-required="empty" type="date" placeholder="">
136 170
         </div>
137
-        <div class="right">
138
-          <div class="fnNum">2</div>
171
+        <div class="line">
172
+          <label>구매요청금액</label>
173
+          <div class="line_right">
174
+            <div class="fnPchReqTotalAmt">0원</div>
175
+          </div>
176
+        </div>
177
+        <div class="line">
178
+          <label>구매가능금액</label>
179
+          <div class="line_right">
180
+            <div class="fnOrdUseAmt">0원</div>
181
+          </div>
182
+        </div>
183
+        <div class="line">
184
+          <label>납품장소</label>
185
+          <div class="search_nm">
186
+            <div class="float_left">
187
+              <input type="text" id="ITP_FORM_MPOMNG02010_MODIFY_WHS_NM" class="" name="whsNm" data-check-required="empty" placeholder="매장명" readonly />
188
+              <input type="hidden" id="ITP_FORM_MPOMNG02010_MODIFY_WHS_ID" class="form-control itp_input" name="whsId" value="" />
189
+              <input type="hidden" id="ITP_FORM_MPOMNG02010_MODIFY_LOCATION" class="form-control itp_input" name="location" value="" />
190
+            </div>
191
+            <div class="float_left_btn">
192
+              <button id="ITP_BTN_MPOMNG02010_MODIFY_SEARCH_WHS_NM"><img src="../img/search.png" alt=""></button>
193
+              <button id="ITP_BTN_MPOMNG02010_MODIFY_DELETE_WHS_NM"><img src="../img/delete.png" alt=""></button>
194
+            </div>
195
+          </div>
196
+        </div>
197
+        <div class="line">
198
+          <div class="table_header">
199
+            <h1>>구매 품목</h1>
200
+            <button type="button" id="ITP_BTN_MPOMNG02010_MODIFY_DEL_ROW" class="btn-primary btn-sm ADB">품목삭제</button>
201
+            <button type="button" id="ITP_BTN_MPOMNG02010_MODIFY_ADD_ROW" class="btn-primary btn-sm ADB">품목추가</button>
202
+          </div>
203
+        </div>
204
+      </div>
205
+      <div id="ITP_LIST_MPOMNG02010_MODIFY_AREA" class="scroll_area row-1-1">
206
+        <ul id="ITP_LIST_MPOMNG02010_MODIFY_ROWS" class="panel-group"></ul>
207
+        <div id="ITP_LIST_MPOMNG02010_MODIFY_ROWCOPY" style="display:none;">
208
+          <li class="list-row">
209
+            <div class="left_info">
210
+              <div class="check_box"><!-- class 변경 -->
211
+                <div><input type="checkbox" name="brandUnitUnqNo" class="fnBrandUnitUnqNo" /></div>
212
+              </div>
213
+              <div class="thick">
214
+                <div class="fnItemNm">품목명</div>
215
+                <div>-</div>
216
+                <div class="fnUnit">EA</div>
217
+              </div>
218
+              <div class="thick">
219
+                <label class="space0">구매가 :</label>
220
+                <div class="fnUnitAmt"></div>
221
+              </div>
222
+            </div>
223
+            <div class="right">
224
+              <button id="ITP_BTN_MPOMNG02010_MODIFY_MINUS" class="DETAIL_ITEM_MINUS">-</button>
225
+              <div class="num fnPchReqQty">1</div>
226
+              <button id="ITP_BTN_MPOMNG02010_MODIFY_PLUS" class="DETAIL_ITEM_PLUS">+</button>
227
+            </div>
228
+          </li>
139 229
         </div>
140
-      </li>
230
+      </div>
231
+      <div class="button_bar">
232
+        <button id="ITP_BTN_MPOMNG02010_MODIFY_REQ_ORDER" class="col_3 btn-primary REQ">구매요청</button>
233
+        <button id="ITP_BTN_MPOMNG02010_MODIFY_TEMP_SAVE" class="col_3 btn-gray TSA">임시저장</button>
234
+        <button id="ITP_BTN_MPOMNG02010_MODIFY_CANCEL" class="col_3 btn-gray CLB">취소</button>
235
+      </div>
236
+    </form>
237
+  </div>
238
+  <div id="ITP_POP_MPOMNG02010_REQ_AREA" class="popup mobile-pop-close" style="display: none;">
239
+    <div class="pop">
240
+      <div class="pop_line">
241
+        <label>납품요청일 &nbsp;&nbsp;:</label>
242
+        <div class="fnPopDlvReqDt"></div>
243
+      </div>
244
+      <div class="pop_line">
245
+        <label>품목수&nbsp;&nbsp; :</label>
246
+        <div class="fnItemQty">개</div>
247
+      </div>
248
+      <div class="pop_line">
249
+        <label>구매금액 &nbsp;&nbsp;:</label>
250
+        <div class="fnOrdAmt">원</div>
251
+      </div>
252
+      <label class="pop_label msg_save">구매요청 하시겠습니까?</label>
253
+      <div class="popup_btn">
254
+        <button id="ITP_BTN_MPOMNG02010_POP_REQ_CLOSE" class="cancel btn-gray CLB btn-pop-close">취소</button>
255
+        <button id="ITP_BTN_MPOMNG02010_POP_REQ_CONFIRM" class="ok btn-primary COK">확인</button>
256
+      </div>
141 257
     </div>
142
-    <div class="button_bar">
143
-      <button id="" class="col_12 btn-gray CLB">취소</button>
258
+  </div>
259
+  <div id="ITP_POP_MPOMNG02010_WHS_AREA" class="popup2 mobile-pop-close" style="display: none;">
260
+    <div class="pop">
261
+      <div class="header">
262
+        <div class="header_left">
263
+          <label>> 납품장소</label>
264
+        </div>
265
+        <div class="header_right">
266
+          <button type="button" id="ITP_BTN_MPOMNG02010_POP_WHS_CLOSE" class="btn-pop-close"><img src="../img/close.png"></button>
267
+        </div>
268
+      </div>
269
+      <div class="search_bar">
270
+        <form id="ITP_FORM_MPOMNG02010_POP_WHS" class="form-horizontal" onsubmit="return false;">
271
+          <input type="hidden" id="ITP_FORM_MPOMNG02010_WHS_ITEM_BRAND_ID" name="sbrandId" value="">
272
+          <input type="hidden" id="ITP_FORM_MPOMNG02010_WHS_ITEM_STORE_ID" name="sstoreId" value="">
273
+          <input id="ITP_FORM_MPOMNG02010_POP_WHS_KEYWORD" type="text" name="swhsNm" placeholder="납품장소명">
274
+          <button id="ITP_BTN_MPOMNG02010_POP_WHS_SEARCH"><img src="../img/search.png"></button>
275
+        </form>
276
+      </div>
277
+      <div class="search_bar">
278
+        <button id="ITP_BTN_MPOMNG02010_POP_WHS_NM" class="btn_blue">납품장소▼</button>
279
+      </div>
280
+      <div id="ITP_LIST_MPOMNG02010_POP_WHS_AREA" class="popup_scroll">
281
+        <ul id="ITP_LIST_MPOMNG02010_POP_WHS_ROWS" class="panel-group itp_nav"></ul>
282
+        <div id="ITP_LIST_MPOMNG02010_POP_WHS_ROWCOPY" style="display:none;">
283
+          <li class="row_2">
284
+            <div class="scroll_left">
285
+              <div class="fnWhsNm">브랜드 창고 명A</div>
286
+              <div class="fnLocationNm">(상세위치내용)</div>
287
+            </div>
288
+            <div class="scroll_right">
289
+              <button id="ITP_BTN_MPOMNG02010_POP_WHS_CHOICE" class="fnWhsId" data-whs-id="">선택</button>
290
+            </div>
291
+          </li>
292
+        </div>
293
+      </div>
294
+    </div>
295
+  </div>
296
+  <div id="ITP_POP_MPOMNG02010_ITEM_AREA" class="popup2 mobile-pop-close" style="display: none;">
297
+    <div class="pop">
298
+      <div class="header">
299
+        <div class="header_left">
300
+          <label>> 품목 검색</label>
301
+        </div>
302
+        <div class="header_right">
303
+          <button type="button" id="ITP_BTN_MPOMNG02010_POP_ITEM_CLOSE" class="btn-pop-close"><img src="../img/close.png"></button>
304
+        </div>
305
+      </div>
306
+      <form id="ITP_FORM_MPOMNG02010_POPUP_ITEM" class="form-horizontal" onsubmit="return false;">
307
+        <input type="hidden" id="ITP_FORM_MPOMNG02010_POPUP_ITEM_BRAND_ID" name="sbrandId" value="">
308
+        <input type="hidden" id="ITP_FORM_MPOMNG02010_POPUP_ITEM_STORE_ID" name="sstoreId" value="">
309
+        <div class="search_bar">
310
+          <input id="ITP_FORM_MPOMNG02010_POP_ITEM_KEYWORD" name="sitemNm" type="text" placeholder="품목명/품목번호" />
311
+          <button id="ITP_BTN_MPOMNG02010_POP_ITEM_SEARCH"><img src="../img/search.png"></button>
312
+        </div>
313
+        <div class="search_bar">
314
+          <button id="ITP_BTN_MPOMNG02010_POP_ITEM_NM" class="btn_blue">품목명▼</button>
315
+        </div>
316
+      </form>
317
+      <div id="ITP_LIST_MPOMNG02010_POP_ITEM_AREA" class="popup_scroll">
318
+        <ul id="ITP_LIST_MPOMNG02010_POP_ITEM_ROWS" class="panel-group"></ul>
319
+        <div id="ITP_LIST_MPOMNG02010_POP_ITEM_ROWCOPY" style="display:none;">
320
+          <li class="row_2">
321
+            <div class="left" style="width:180px;">
322
+              <!--<div class="check_box">
323
+                  <input type="checkbox" id="ITP_FORM_MPOMNG02010_POP_ITEM_CHECKBOX" name="itemId" />
324
+              </div>-->
325
+              <div class="thick">
326
+                <div class="fnItemNm">품목명</div>
327
+                <div>-</div>
328
+                <div class="fnUnit">EA</div>
329
+              </div>
330
+              <div class="thick" style="font-weight:100;">
331
+                <div class="space">구매가 :</div>
332
+                <div class="fnUnitAmt">0</div>
333
+              </div>
334
+            </div>
335
+            <div class="right">
336
+              <button id="ITP_BTN_MPOMNG02010_POP_ITEM_MINUS" class="POP_ITEM_MINUS">-</button>
337
+              <div class="num fnPchReqQty">1</div>
338
+              <button id="ITP_BTN_MPOMNG02010_POP_ITEM_PLUS" class="POP_ITEM_PLUS">+</button>
339
+            </div>
340
+            <div class="add">
341
+              <button id="ITP_BTN_MPOMNG02010_POP_ITEM_ADD" class="POP_ITEM_ADD">추가</button>
342
+            </div>
343
+          </li>
344
+        </div>
345
+      </div>
144 346
     </div>
145 347
   </div>
348
+  <div id="ITP_MOBILE_JS"></div>
146 349
 </section>

+ 8 - 1
src/main/webapp/mobile/js/app/main.js

@@ -4,11 +4,18 @@ require(['config'], function() {
4 4
 	], function($) {
5 5
 
6 6
 		setTimeout(function() {
7
+			mobMainObj.init();
7 8
 		}, 100);
8 9
 
9 10
 	});
10 11
 });
11 12
 
13
+var mobMainObj = {
14
+	init: function () {
15
+
16
+	}
17
+};
18
+
12 19
 var itp_fn_barcode = {
13 20
 	init: function () {
14 21
 		this.event();
@@ -19,6 +26,6 @@ var itp_fn_barcode = {
19 26
 		});
20 27
 	},
21 28
 	callback: function (barcode) {
22
-		itp_fn_modal_alert_ajax(barcode);
29
+		alert(barcode);
23 30
 	}
24 31
 };

+ 13 - 11
src/main/webapp/mobile/js/app/mpomng/ITP_MPOMNG01010.js

@@ -19,6 +19,8 @@ const PCH_REQ_ST_CD_TEMP_SAVE		="PR00";
19 19
 const PCH_REQ_ST_CD_REQUEST_SAVE	="PR20";
20 20
 
21 21
 let mobPageObj = {
22
+	isPrevPage: false,
23
+	pageParam: null,
22 24
 	init: function () {
23 25
 		this.ui.init();
24 26
 		this.event.init();
@@ -44,13 +46,10 @@ let mobPageObj = {
44 46
 				} else {
45 47
 					var id = $(this).attr('id');
46 48
 					switch (id) {
47
-						case 'ITP_BTN_MPOMNG01010_DETAIL_DELROW'		: mobContObj.list.delRow(); 	break;
48
-						case 'ITP_BTN_MPOMNG01010_DETAIL_SEARCH_WHS_NM'	: mobPopObj.popWhsNm.init(); 	break;
49
-						case 'ITP_BTN_MPOMNG01010_DETAIL_DELETE_WHS_NM'	: mobPopObj.popWhsNm.delete();	break;
50
-						case 'ITP_BTN_MPOMNG01010_DETAIL_TEMP_SAVE'		: break;
51
-						case 'ITP_BTN_MPOMNG01010_DETAIL_CANCEL'		: $(location).attr('href', MOBILE_CONTEXTPATH + '/app/main.html'); break;
52
-						case 'ITP_BTN_MPOMNG01010_DETAIL_PLUS'			: mobContObj.list.actPlus($(this));	break;
53
-						case 'ITP_BTN_MPOMNG01010_DETAIL_MINUS'			: break;
49
+						case 'ITP_BTN_MPOMNG01010_DETAIL_DELROW'		: mobContObj.list.delRow(); 		break;
50
+						case 'ITP_BTN_MPOMNG01010_DETAIL_SEARCH_WHS_NM'	: mobPopObj.popWhsNm.init(); 		break;
51
+						case 'ITP_BTN_MPOMNG01010_DETAIL_DELETE_WHS_NM'	: mobPopObj.popWhsNm.delete();		break;
52
+						case 'ITP_BTN_MPOMNG01010_DETAIL_CANCEL'		: mobContObj.cancel();				break;
54 53
 					}
55 54
 				}
56 55
 				return false;
@@ -89,7 +88,7 @@ let mobContObj = {
89 88
 				$('#ITP_FORM_MPOMNG01010_DETAIL #ITP_FORM_MPOMNG01010_DETAIL_LOAN_MGNT_UNQ_NO').val(result.loanMgntUnqNo);
90 89
 				$('#ITP_FORM_MPOMNG01010_DETAIL #ITP_FORM_MPOMNG01010_DETAIL_PCH_REQ_DVSN').val(result.pchReqDvsn);
91 90
 
92
-				$('#ITP_FORM_MPOMNG01010_DETAIL .fnOrdUseAmt').text(itp_fn_set_comma(result.ordUseAmt) + '원');
91
+				$('#ITP_FORM_MPOMNG01010_DETAIL .fnOrdUseAmt').text(CommonObj.currency.add(result.ordUseAmt));
93 92
 			};
94 93
 			const param = {brandId:fn_make_user_info.get('brandId'), storeId:fn_make_user_info.get('storeId')};
95 94
 			fn_ajax_call(API_MOBILE_INIT_INFO, param, callbackFn, 'GET');
@@ -121,7 +120,7 @@ let mobContObj = {
121 120
 				$li.find('.fnBrandUnitUnqNo').val(item.brandUnitUnqNo);
122 121
 				$li.find('.fnItemNm').text(item.itemNm);
123 122
 				$li.find('.fnPchReqQty').text(item.pchReqQty);
124
-				$li.find('.fnUnitAmt').text(itp_fn_set_comma(item.unitAmt));
123
+				$li.find('.fnUnitAmt').text(CommonObj.currency.add(item.unitAmt));
125 124
 				this.pchReqAmtTot();
126 125
 			}
127 126
 		},
@@ -162,8 +161,11 @@ let mobContObj = {
162 161
 				var amt = item.unitAmt;
163 162
 				reqAmt += Number(qty) * amt;
164 163
 			});
165
-			$('#ITP_AJAX_MPOMNG01010_VIEW_CONTAINER').find('.fnPchReqAmtTot').text(itp_fn_set_comma(reqAmt));
164
+			$('#ITP_AJAX_MPOMNG01010_VIEW_CONTAINER').find('.fnPchReqAmtTot').text(CommonObj.currency.add(reqAmt));
166 165
 		}
166
+	},
167
+	cancel: function () {
168
+		$(location).attr('href', MOBILE_CONTEXTPATH + '/app/main.html');
167 169
 	}
168 170
 };
169 171
 
@@ -190,7 +192,7 @@ let mobPopObj = {
190 192
 					var $li = $('#ITP_LIST_MPOMNG01010_POP_ITEM_AREA .panel-group > .row_2:last');
191 193
 					$li.find('#ITP_FORM_MPOMNG01010_POP_ITEM_CHECKBOX').val(item.itemId);
192 194
 					$li.find('.fnItemNm').text(item.itemNm);
193
-					$li.find('.fnUnitAmt').text(itp_fn_set_comma(item.unitAmt));
195
+					$li.find('.fnUnitAmt').text(CommonObj.currency.add(item.unitAmt));
194 196
 				});
195 197
 				mobPopObj.popItem.addRow.init();
196 198
 			};

+ 417 - 0
src/main/webapp/mobile/js/app/mpomng/ITP_MPOMNG02010.js

@@ -0,0 +1,417 @@
1
+require(['config'], function() {
2
+	require([
3
+	], function($) {
4
+		mobPageObj.init();
5
+	});
6
+});
7
+
8
+/*API URL*/
9
+const API_MOBILE_GRID_LIST 			= '/api/pomng/detail-grid-list';	// 목록
10
+const API_MOBILE_INFO 				= '/api/pomng/info-pchReq';			// 상세
11
+const API_MOBILE_SAVE 				= '/api/pomng/save-pchReq';			// 저장
12
+const API_POP_SEARCH_LIST			= '/api/whs/mng/pop-whs-search';
13
+
14
+const PCH_REQ_ST_CD_TEMP_SAVE		="PR00";
15
+const PCH_REQ_ST_CD_REQUEST_SAVE	="PR20";
16
+
17
+const VIEW_MODE_LIST				= "LIST";
18
+const VIEW_MODE_DETAIL				= "DETAIL";
19
+const VIEW_MODE_MODIFY				= "MODIFY";
20
+
21
+let mobPageObj = {
22
+	init: function () {
23
+		this.ui.init();
24
+		this.event.init();
25
+		this.ready();
26
+	},
27
+	ui: {
28
+		init: function () {
29
+			this.view();
30
+			this.info();
31
+			this.action();
32
+		},
33
+		view: function() {
34
+			// 공통코드 표시
35
+			$('select').each(function() {
36
+				if($(this).data('select-code')) {
37
+					fn_make_select(CODE_LIST, $(this).data('select-code'), $(this).attr('id'));
38
+				}
39
+			});
40
+
41
+			// 조회일자 지정
42
+			$('#ITP_FORM_MPOMNG02010_SEARCH_FROM_DT').val(itp_fn_date_add('M', -1));
43
+			$('#ITP_FORM_MPOMNG02010_SEARCH_TO_DT').val(itp_fn_date_add('M', 0));
44
+		},
45
+		info: function() {
46
+			$('input:hidden[id$="_BRAND_ID"]').val(fn_make_user_info.get('brandId'));
47
+			$('input:hidden[id$="_STORE_ID"]').val(fn_make_user_info.get('storeId'));
48
+		},
49
+		action: function() {
50
+			$('#ITP_LIST_MPOMNG02010_LIST_AREA').on('scroll', function () {
51
+				if($(this).scrollTop() + $(this).innerHeight() + 1 >= $(this)[0].scrollHeight) {
52
+					if(mobContentObj.list.totPage > mobContentObj.list.listPage) {
53
+						if(!mobContentObj.list.isSearch) {
54
+							mobContentObj.list.load();
55
+						}
56
+					}
57
+				}
58
+			});
59
+		}
60
+	},
61
+	event: {
62
+		init: function() {
63
+			this.button();
64
+		},
65
+		button: function() {
66
+			$('button[id^="ITP_BTN_MPOMNG02010_"]').on('click', function() {
67
+				var id = $(this).attr('id');
68
+				switch (id) {
69
+					case 'ITP_BTN_MPOMNG02010_SEARCH_WHS_NM'	: mobPopObj.popWhsNm.init(VIEW_MODE_LIST); 		break;
70
+					case 'ITP_BTN_MPOMNG02010_DELETE_WHS_NM'	: mobPopObj.popWhsNm.delete(VIEW_MODE_LIST); 		break;
71
+					case 'ITP_BTN_MPOMNG02010_SEARCH'			: mobContentObj.list.search();		break;
72
+					case 'ITP_BTN_MPOMNG02010_CANCEL_LIST'		: mobContentObj.detail.cancel();	break;
73
+				}
74
+				return false;
75
+			});
76
+		}
77
+	},
78
+	switchScreen: function(mode) {
79
+		$('#ITP_MOBILE_MPOMNG02010').find('div[id$="_CONTAINER"]').each(function(i) {
80
+			$(this).hide();
81
+		});
82
+		if(mode === VIEW_MODE_LIST) {
83
+			$('#ITP_AJAX_MPOMNG02010_VIEW_CONTAINER').show();
84
+		} else if(mode === VIEW_MODE_DETAIL) {
85
+			$('#ITP_AJAX_MPOMNG02010_DETAIL_CONTAINER').show();
86
+		} else if(mode === VIEW_MODE_MODIFY) {
87
+			$('#ITP_AJAX_MPOMNG02010_MODIFY_CONTAINER').show();
88
+		}
89
+	},
90
+	ready: function() {
91
+		mobContentObj.list.init();
92
+	}
93
+};
94
+
95
+let mobContentObj = {
96
+	list: {
97
+		listSize: 10,
98
+		listPage: 0,
99
+		totPage: 0,
100
+		isSearch: false,
101
+		rows: [],
102
+		init: function() {
103
+			mobPageObj.switchScreen(VIEW_MODE_LIST);
104
+			this.load();
105
+			this.action();
106
+		},
107
+		search: function() {
108
+			this.listPage = 0;
109
+			this.totPage = 0;
110
+			this.rows.length = 0;
111
+			$('#ITP_LIST_MPOMNG02010_LIST_ROWS').empty();
112
+			this.load();
113
+		},
114
+		load: function() {
115
+			var _this = this;
116
+			this.isSearch = true;
117
+			var callbackFn = function(result) {
118
+				console.log(result);
119
+				_this.isSearch = false;
120
+				_this.totPage = result.gridTotal;
121
+				$.each(result.gridRows, function (i, item) {
122
+					$('#ITP_LIST_MPOMNG02010_LIST_AREA .panel-group').append($('#ITP_LIST_MPOMNG02010_LIST_ROWCOPY').html());
123
+					var $li = $('#ITP_LIST_MPOMNG02010_LIST_AREA .panel-group > .list-row:last');
124
+					$li.find('.fnPchReqDt').text(item.pchReqDt);
125
+					$li.find('.fnPchReqMgrNm').text(item.pchReqMgrNm);
126
+					$li.find('.fnPchReqStNm').text(item.pchReqStNm);
127
+					$li.find('.fnWhsLocationNm').text(item.whsLocationNm);
128
+					$li.find('.fnPchReqItemQty').text(CommonObj.comma.set(item.pchReqItemQty));
129
+					$li.find('.fnPchReqTotalAmt').text(CommonObj.comma.set(item.pchReqTotalAmt));
130
+					$li.find('.fnPchReqRjctNm').text(item.pchReqRjctNm);
131
+					_this.rows.push(item);
132
+				});
133
+			};
134
+			var errFn = function() { _this.isSearch = false;};
135
+			const param = $('#ITP_FORM_MPOMNG02010_SEARCH').serializeObject();
136
+			param.gridPage = ++this.listPage;
137
+			param.gridSize = this.listSize;
138
+			param.fromDt = param.fromDt.replace(/-/g, ".");
139
+			param.toDt = param.toDt.replace(/-/g, ".");
140
+			fn_ajax_call(API_MOBILE_GRID_LIST, JSON.stringify(param), callbackFn, 'POST', errFn);
141
+		},
142
+		action: function () {
143
+			var _this = this;
144
+			$(document).on('click', '#ITP_LIST_MPOMNG02010_LIST_ROWS li', function() {
145
+				var index = $(this).index();
146
+				var item = _this.rows[index];
147
+				(item.pchReqStCd === PCH_REQ_ST_CD_TEMP_SAVE) ? mobContentObj.modify.init(item) : mobContentObj.detail.init(item);
148
+			});
149
+		},
150
+		move: function(index) {
151
+			var item = this.rows[index];
152
+			if(item.pchReqStCd === PCH_REQ_ST_CD_TEMP_SAVE) {
153
+				var pageParam = {};
154
+				pageParam['prevId'] = 'MPOMNG02010';
155
+				pageParam['prevHref'] = '/app/mpomng/MPOMNG02010.html';
156
+				pageParam['data'] = item;
157
+				pageParam['prevData'] = item;
158
+				sessionStorage.setItem(CMD_PAGE_MOVE_PARAM, JSON.stringify(item));
159
+				fn_make_slide_menu.loadPage('MPOMNG01010', MOBILE_CONTEXTPATH + '/app/mpomng/MPOMNG01010.html')
160
+			} else {
161
+				mobContentObj.detail.init(item);
162
+			}
163
+		}
164
+	},
165
+	detail: {
166
+		rows: [],
167
+		init: function(item) {
168
+			mobPageObj.switchScreen(VIEW_MODE_DETAIL);
169
+			this.search(item);
170
+		},
171
+		search: function(item) {
172
+			var _this = this;
173
+			var callbackFn = function(result) {
174
+				console.log(result);
175
+				_this.rows = result.pchReqDtlList;
176
+				_this.view(result);
177
+			};
178
+			const param = {'brandId':fn_make_user_info.get('brandId'), 'pchReqUnqNo': item.pchReqUnqNo};
179
+			fn_ajax_call(API_MOBILE_INFO, param, callbackFn, 'GET');
180
+		},
181
+		view: function(result) {
182
+			var _this = this;
183
+			var id = '#ITP_AJAX_MPOMNG02010_DETAIL_CONTAINER';
184
+			$(id).find('.fnDlvReqDt').text(result.dlvReqDt);
185
+			$(id).find('.fnPchReqTotalAmt').text(CommonObj.currency.add(result.pchReqTotalAmt));
186
+			$(id).find('.fnLocationNm').text(result.locationNm);
187
+			$(id).find('.fnPchApprNm').text('(' + result.pchApprNm + ')' + CommonObj.currency.add(result.pchApprAmt));
188
+			$.each(result.pchReqDtlList, function (i, item) {
189
+				$('#ITP_LIST_MPOMNG02010_DETAIL_AREA .panel-group').append($('#ITP_LIST_MPOMNG02010_DETAIL_ROWCOPY').html());
190
+				var $li = $('#ITP_LIST_MPOMNG02010_DETAIL_AREA .panel-group > .list-row:last');
191
+				$li.find('.fnItemNm').text(item.itemNm);
192
+				$li.find('.fnUnit').text(item.pchReqQty + item.unit);
193
+				$li.find('.fnPchReqAmt').text(CommonObj.comma.set(item.pchReqAmt));
194
+				$li.find('.fnPchReqQty').text(CommonObj.currency.add(item.pchReqQty, ''));
195
+				_this.rows.push(item);
196
+			});
197
+		},
198
+		cancel: function () {
199
+			this.rows.length = 0;
200
+			var id = '#ITP_AJAX_MPOMNG02010_DETAIL_CONTAINER';
201
+			$(id).find('.fnDlvReqDt').text('');
202
+			$(id).find('.fnPchReqTotalAmt').text('');
203
+			$(id).find('.fnLocationNm').text('');
204
+			$(id).find('.fnPchApprNm').text('');
205
+			$('#ITP_LIST_MPOMNG02010_DETAIL_AREA .panel-group').empty();
206
+			mobPageObj.switchScreen(VIEW_MODE_LIST);
207
+		}
208
+	},
209
+	modify: {
210
+		rows: [],
211
+		init: function(item) {
212
+			mobPageObj.switchScreen(VIEW_MODE_MODIFY);
213
+			this.clear();
214
+			this.event();
215
+			this.search(item);
216
+		},
217
+		event: function() {
218
+			var _this = this;
219
+			$('button[id^="ITP_BTN_MPOMNG02010_MODIFY"]').on('click', function() {
220
+				var id = $(this).attr('id');
221
+				switch (id) {
222
+					case 'ITP_BTN_MPOMNG02010_MODIFY_SEARCH_WHS_NM'		: mobPopObj.popWhsNm.init(VIEW_MODE_MODIFY); 	break;
223
+					case 'ITP_BTN_MPOMNG02010_MODIFY_DELETE_WHS_NM'		: mobPopObj.popWhsNm.delete(VIEW_MODE_MODIFY); 	break;
224
+					case 'ITP_BTN_MPOMNG02010_MODIFY_ADD_ROW'			: mobContObj.cancel();				break;
225
+					case 'ITP_BTN_MPOMNG02010_MODIFY_DEL_ROW'			: mobPopObj.popWhsNm.delete();		break;
226
+					case 'ITP_BTN_MPOMNG02010_MODIFY_REQ_ORDER'			: mobContObj.cancel();				break;
227
+					case 'ITP_BTN_MPOMNG02010_MODIFY_TEMP_SAVE'			: mobContObj.cancel();				break;
228
+					case 'ITP_BTN_MPOMNG02010_MODIFY_CANCEL'			: _this.cancel();					break;
229
+				}
230
+				return false;
231
+			});
232
+		},
233
+		search: function(item) {
234
+			var _this = this;
235
+			var callbackFn = function(result) {
236
+				console.log(result);
237
+				_this.view(result);
238
+			};
239
+			const param = {'brandId':fn_make_user_info.get('brandId'), 'pchReqUnqNo': item.pchReqUnqNo};
240
+			fn_ajax_call(API_MOBILE_INFO, param, callbackFn, 'GET');
241
+		},
242
+		view: function(result) {
243
+			var _this = this;
244
+			var id = '#ITP_AJAX_MPOMNG02010_MODIFY_CONTAINER';
245
+			$(id).find('.fnDlvReqDt').text(result.dlvReqDt.replace(/./g, "-"));
246
+			$(id).find('.fnPchReqTotalAmt').text(CommonObj.currency.add(result.pchReqTotalAmt));
247
+			$(id).find('.fnOrdUseAmt').text(CommonObj.currency.add(result.ordUseAmt));
248
+			$('#ITP_FORM_MPOMNG02010_MODIFY #ITP_FORM_MPOMNG02010_MODIFY_WHS_NM').val(result.whsNm);
249
+			$('#ITP_FORM_MPOMNG02010_MODIFY #ITP_FORM_MPOMNG02010_MODIFY_WHS_ID').val(result.whsId);
250
+			$('#ITP_FORM_MPOMNG02010_MODIFY #ITP_FORM_MPOMNG02010_MODIFY_LOCATION').val(result.location);
251
+			$.each(result.pchReqDtlList, function (i, item) {
252
+				_this.list.attachRow(item);
253
+			});
254
+		},
255
+		list: {
256
+			rows: [],
257
+			attachRow: function (item) {
258
+				var fnIsExist = function(rows) {
259
+					var isExist = false;
260
+					$.each(rows, function(i, row) {
261
+						if(row.brandUnitUnqNo === item.brandUnitUnqNo) {
262
+							isExist = true;
263
+							return false;
264
+						}
265
+					});
266
+					return isExist;
267
+				};
268
+				if(!fnIsExist(this.rows)) {
269
+					this.rows.push(item);
270
+					$('#ITP_LIST_MPOMNG02010_MODIFY_AREA .panel-group').append($('#ITP_LIST_MPOMNG02010_MODIFY_ROWCOPY').html());
271
+					var $li = $('#ITP_LIST_MPOMNG02010_MODIFY_AREA .panel-group > .list-row:last');
272
+					$li.find('.fnBrandUnitUnqNo').val(item.brandUnitUnqNo);
273
+					$li.find('.fnItemNm').text(item.itemNm);
274
+					$li.find('.fnPchReqQty').text(item.pchReqQty);
275
+					$li.find('.fnUnitAmt').text(CommonObj.currency.add(item.unitAmt));
276
+					this.pchReqAmtTot();
277
+				}
278
+			},
279
+			detachRow: function () {
280
+				if($('#ITP_LIST_MPOMNG01010_ITEM_AREA input:checkbox[name=brandUnitUnqNo]:checked').length > 0) {
281
+					var _this = this;
282
+					$('#ITP_LIST_MPOMNG01010_DETAIL_ROWS li').each(function(index, elem) {
283
+						var isChecked = $(this).find('input[type="checkbox"]').is(':checked');
284
+						if(isChecked) {
285
+							$(this).remove();_this.rows.splice(index, 1);
286
+						}
287
+					});
288
+					this.pchReqAmtTot();
289
+				}
290
+			},
291
+			actPlus: function(elem) {
292
+				var $div = $(elem).siblings('div');
293
+				var num = Number($div.text());
294
+				$($div).text((num + 1).toString());
295
+				this.rows[$div.parents('li').index()]['pchReqQty'] = $($div).text();
296
+				this.pchReqAmtTot();
297
+			},
298
+			actMinus: function(elem) {
299
+				var $div = $(elem).siblings('div');
300
+				var num = Number($div.text());
301
+				if(num <= 1) {
302
+					alert('주문수량을 확인하세요.');
303
+				} else {
304
+					$($div).text((num - 1).toString());
305
+					this.rows[$div.parents('li').index()]['pchReqQty'] = $($div).text();
306
+					this.pchReqAmtTot();
307
+				}
308
+			},
309
+			pchReqAmtTot: function() {
310
+				var reqAmt = 0;
311
+				$.each(this.rows, function(index, item) {
312
+					var qty = item.pchReqQty;
313
+					var amt = item.unitAmt;
314
+					reqAmt += Number(qty) * amt;
315
+				});
316
+				$('#ITP_AJAX_MPOMNG01010_VIEW_CONTAINER').find('.fnPchReqAmtTot').text(CommonObj.currency.add(reqAmt));
317
+			}
318
+		},
319
+		cancel: function () {
320
+			this.clear();
321
+			mobPageObj.switchScreen(VIEW_MODE_LIST);
322
+		},
323
+		clear: function() {
324
+			this.rows.length = 0;
325
+			var id = '#ITP_AJAX_MPOMNG02010_MODIFY_CONTAINER';
326
+			$(id).find('.fnDlvReqDt').val('');
327
+			$(id).find('.fnPchReqTotalAmt').text('');
328
+			$(id).find('.fnOrdUseAmt').text('');
329
+			$('#ITP_FORM_MPOMNG02010_MODIFY #ITP_FORM_MPOMNG02010_MODIFY_WHS_NM').val('');
330
+			$('#ITP_FORM_MPOMNG02010_MODIFY #ITP_FORM_MPOMNG02010_MODIFY_WHS_ID').val('');
331
+			$('#ITP_FORM_MPOMNG02010_MODIFY #ITP_FORM_MPOMNG02010_MODIFY_LOCATION').val('');
332
+			$('#ITP_LIST_MPOMNG02010_MODIFY_AREA .panel-group').empty();
333
+		}
334
+	}
335
+};
336
+
337
+let mobPopObj = {
338
+	popWhsNm: {
339
+		mode: '',
340
+		init: function (mode) {
341
+			this.mode = mode;
342
+			this.rows.length = 0;
343
+			mobPopObj.show(this.popId);
344
+			this.search();
345
+			this.action();
346
+		},
347
+		popId: 'ITP_POP_MPOMNG02010_WHS_AREA',
348
+		rows: [],
349
+		search: function () {
350
+			var _this = this;
351
+			$('#ITP_LIST_MPOMNG02010_POP_WHS_AREA .panel-group').empty();
352
+			var callbackFn = function(result) {
353
+				console.log(result);
354
+				_this.view(result.gridRows);
355
+			};
356
+			const param = $('#ITP_FORM_MPOMNG02010_POP_WHS').serializeObject();
357
+			fn_ajax_call(API_POP_SEARCH_LIST, JSON.stringify(param), callbackFn, 'POST');
358
+		},
359
+		view: function(gridRows) {
360
+			this.rows = gridRows;
361
+			$.each(gridRows, function (i, item) {
362
+				$('#ITP_LIST_MPOMNG02010_POP_WHS_AREA .panel-group').append($('#ITP_LIST_MPOMNG02010_POP_WHS_ROWCOPY').html());
363
+				var $li = $('#ITP_LIST_MPOMNG02010_POP_WHS_AREA .panel-group > .row_2:last');
364
+				$li.find('.fnWhsNm').text(item.whsNm);
365
+				$li.find('.fnLocationNm').text(item.locationNm);
366
+				$li.find('.fnWhsId').data('whs-id', item.whsId);
367
+			});
368
+		},
369
+		choice: function(elem) {
370
+			var _this = this;
371
+			var whsId = $(elem).data('whs-id');
372
+			$.each(this.rows, function (i, item) {
373
+				if(whsId === item.whsId) {
374
+					if(_this.mode === VIEW_MODE_LIST) {
375
+						$('#ITP_FORM_MPOMNG02010_SEARCH #ITP_FORM_MPOMNG02010_SEARCH_WHS_ID').val(item.whsId);
376
+						$('#ITP_FORM_MPOMNG02010_SEARCH #ITP_FORM_MPOMNG02010_SEARCH_WHS_NM').val(item.whsNm);
377
+					} else if(_this.mode === VIEW_MODE_MODIFY) {
378
+						$('#ITP_FORM_MPOMNG02010_MODIFY #ITP_FORM_MPOMNG02010_MODIFY_WHS_ID').val(item.whsId);
379
+						$('#ITP_FORM_MPOMNG02010_MODIFY #ITP_FORM_MPOMNG02010_MODIFY_WHS_NM').val(item.whsNm);
380
+						$('#ITP_FORM_MPOMNG02010_MODIFY #ITP_FORM_MPOMNG02010_MODIFY_LOCATION').val(item.location);
381
+					}
382
+					mobPopObj.hide(_this.popId);
383
+					return false;
384
+				}
385
+			});
386
+		},
387
+		action: function() {
388
+			var _this = this;
389
+			$('button[id^="ITP_BTN_MPOMNG02010_POP"]').off('click').on('click', function() {
390
+				var id = $(this).attr('id');
391
+				switch (id) {
392
+					case 'ITP_BTN_MPOMNG02010_POP_WHS_SEARCH'	: _this.search();				break;
393
+					case 'ITP_BTN_MPOMNG02010_POP_WHS_CHOICE'	: _this.choice($(this)); 		break;
394
+					case 'ITP_BTN_MPOMNG02010_POP_WHS_CLOSE'	: mobPopObj.hide(_this.popId);	break;
395
+				}
396
+				return false;
397
+			});
398
+		},
399
+		delete: function(mode) {
400
+			if(mode === VIEW_MODE_LIST) {
401
+				$('#ITP_FORM_MPOMNG02010_SEARCH #ITP_FORM_MPOMNG02010_SEARCH_WHS_ID').val('');
402
+				$('#ITP_FORM_MPOMNG02010_SEARCH #ITP_FORM_MPOMNG02010_SEARCH_WHS_NM').val('');
403
+			} else if(mode === VIEW_MODE_MODIFY) {
404
+				$('#ITP_FORM_MPOMNG02010_MODIFY #ITP_FORM_MPOMNG02010_MODIFY_WHS_ID').val('');
405
+				$('#ITP_FORM_MPOMNG02010_MODIFY #ITP_FORM_MPOMNG02010_MODIFY_WHS_NM').val('');
406
+				$('#ITP_FORM_MPOMNG02010_MODIFY #ITP_FORM_MPOMNG02010_MODIFY_LOCATION').val('');
407
+				mobPopObj.hide(ID_ITP_POP_MPOMNG01010_WHS_AREA);
408
+			}
409
+		}
410
+	},
411
+	show: function(popId) {
412
+		$('#' + popId).show();
413
+	},
414
+	hide: function(popId) {
415
+		$('#' + popId).closest('.mobile-pop-close').hide();
416
+	}
417
+};

+ 51 - 38
src/main/webapp/mobile/js/config.js

@@ -2,6 +2,8 @@
2 2
 var today = new Date();
3 3
 const js_version = itp_fn_date_format(today);
4 4
 
5
+const CMD_PAGE_MOVE_PARAM = 'PAGE_MOVE_PARAM';
6
+
5 7
 requirejs.config({
6 8
 	baseUrl: ITP_CONTEXTPATH,
7 9
 	paths: {
@@ -173,10 +175,6 @@ var fn_make_slide_menu = {
173 175
 				$(selector + ' .fnLevelBottomList .itp_svg_in:last').attr('data-conn-url', value.connUrl);
174 176
 				$(selector + ' .fnLevelBottomList .itp_svg_in:last').attr('data-open-cd', value.openCd);
175 177
 				$(selector + ' .fnLevelBottomList .itp_svg_in:last').attr('id', value.menuId + '_PAGE_NO');
176
-				// $(selector + ' .fnLevelBottomList .itp_svg_in:last').find('.itp_nav_link').attr('data-itp-nav-id', value.menuId);
177
-				// $(selector + ' .fnLevelBottomList .itp_svg_in:last').find('.itp_nav_link').attr('data-conn-url', value.connUrl);
178
-				// $(selector + ' .fnLevelBottomList .itp_svg_in:last').find('.itp_nav_link').attr('data-open-cd', value.openCd);
179
-				// $(selector + ' .fnLevelBottomList .itp_svg_in:last').find('.itp_nav_link').attr('id', value.menuId + '_PAGE_NO');
180 178
 			}
181 179
 		});
182 180
 		this.action();
@@ -195,6 +193,7 @@ var fn_make_slide_menu = {
195 193
 			if(openCd === 'C') {
196 194
 				const href = MOBILE_CONTEXTPATH + connUrl;
197 195
 				_this.loadPage(id, href);
196
+				$('#ITP_MENU').toggle();
198 197
 			}
199 198
 		});
200 199
 	},
@@ -219,7 +218,6 @@ var fn_make_slide_menu = {
219 218
 				//JS파일적용
220 219
 				const js = "<script src=\"../js/app/"+id.substring(0, id.length - 5).toLowerCase()+"/ITP_"+id+".js?version="+js_version+"\"></script>";
221 220
 				$('#ITP_CONTAINER #ITP_MOBILE_'+id+' #ITP_MOBILE_JS').append(js);
222
-				$('#ITP_MENU').toggle();
223 221
 			},
224 222
 			error: function(xhr, status, error) {
225 223
 				if (xhr.status == 401) location.href = MOBILE_CONTEXTPATH + '/app/';
@@ -384,7 +382,7 @@ function fn_call_popup(type, popnm, container,  popFn, args, returnType) {
384 382
 };
385 383
 
386 384
 //AJAX 양식 (이렇게 사용하시면 됩니다.)
387
-function fn_ajax_call(href, param, fn, type) {
385
+function fn_ajax_call(href, param, fn, type, errFn) {
388 386
 	$.ajax({
389 387
 		contentType: 'application/json',
390 388
 		url: DOMAIN + href,
@@ -418,9 +416,11 @@ function fn_ajax_call(href, param, fn, type) {
418 416
 			} else {
419 417
 				itp_fn_modal_alert_ajax(ITP_MSG_LOCALE.message.ajax.failProcess);
420 418
 			}
419
+			if (errFn !== undefined || typeof errFn !== 'undefined') errFn();
421 420
 		},
422 421
 		fail: function() {
423 422
 			itp_fn_modal_alert_ajax(ITP_MSG_LOCALE.message.ajax.failProcess);
423
+			if (errFn !== undefined || typeof errFn !== 'undefined') errFn();
424 424
 		}
425 425
 	});
426 426
 };
@@ -470,30 +470,6 @@ function itp_fn_modal_confirm(msg, fn, args) {
470 470
 			$('#ITP_MODAL_ALERT').modal('hide');
471 471
 		});
472 472
 	}
473
-};
474
-
475
-function itp_fn_date_format(date, type) {
476
-	let month = date.getMonth() + 1;
477
-	let day = date.getDate();
478
-	let hour = date.getHours();
479
-	let minute = date.getMinutes();
480
-	let second = date.getSeconds();
481
-
482
-	month = month >= 10 ? month : '0' + month;
483
-	day = day >= 10 ? day : '0' + day;
484
-	hour = hour >= 10 ? hour : '0' + hour;
485
-	minute = minute >= 10 ? minute : '0' + minute;
486
-	second = second >= 10 ? second : '0' + second;
487
-
488
-	if(type && type == 1) {
489
-		return date.getFullYear() + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second;
490
-	} else if(type && type == 2) {
491
-		return date.getFullYear() + '.' + month + '.' + day;
492
-	} else if(type && type == 3) {
493
-		return date.getFullYear() + '' + month + '' + day;
494
-	} else {
495
-		return date.getFullYear() + month + day + hour + minute + second;
496
-	}
497 473
 }
498 474
 
499 475
 let itp_fn_form_validate = function(form, element, arry, msg, type) {
@@ -663,6 +639,12 @@ let itp_fn_form_event = {
663 639
 };
664 640
 
665 641
 let CommonObj = {
642
+	listSize: 10,
643
+	jsonParam: function(formId) {
644
+		const param = $(formId).serializeObject();
645
+		param.gridSize = this.listSize;
646
+		return JSON.stringify(param);
647
+	},
666 648
 	init: function() {
667 649
 		$.fn.serializeObject = function() {
668 650
 			var result = {};
@@ -743,12 +725,43 @@ let CommonObj = {
743 725
 	}
744 726
 };
745 727
 
746
-function itp_fn_set_comma(str) {
747
-	str = String(str);
748
-	return str.replace(/(\d)(?=(?:\d{3})+(?!\d))/g, '$1,');
749
-};
728
+function itp_fn_date_format(date, type) {
729
+	let month = date.getMonth() + 1;
730
+	let day = date.getDate();
731
+	let hour = date.getHours();
732
+	let minute = date.getMinutes();
733
+	let second = date.getSeconds();
750 734
 
751
-function itp_fn_set_uncomma(str) {
752
-	str = String(str);
753
-	return str.replace(/[^\d]+/g, '');
754
-};
735
+	month = month >= 10 ? month : '0' + month;
736
+	day = day >= 10 ? day : '0' + day;
737
+	hour = hour >= 10 ? hour : '0' + hour;
738
+	minute = minute >= 10 ? minute : '0' + minute;
739
+	second = second >= 10 ? second : '0' + second;
740
+
741
+	if(type && type == 1) {
742
+		return date.getFullYear() + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second;
743
+	} else if(type && type == 2) {
744
+		return date.getFullYear() + '.' + month + '.' + day;
745
+	} else if(type && type == 3) {
746
+		return date.getFullYear() + '' + month + '' + day;
747
+	} else if(type && type == 4) {
748
+		return date.getFullYear() + '-' + month + '-' + day;
749
+	} else {
750
+		return date.getFullYear() + month + day + hour + minute + second;
751
+	}
752
+}
753
+
754
+function itp_fn_date_add(type, iAdd) {
755
+	var date = new Date();
756
+	if(type === 'Y') date.setFullYear(date.getFullYear() + iAdd);
757
+	else if(type === 'M') date.setMonth(date.getMonth() + iAdd);
758
+	else if(type === 'D') date.setDate(date.getDate() + iAdd);
759
+	return itp_fn_date_format(date, 4);
760
+}
761
+
762
+const ITP_DATE_LANGUAGE = (function() {
763
+	let lang = ITP_LANGUAGE;
764
+	if (lang == 'en') {lang = ITP_LANGUAGE + '-GB';}
765
+	var agrs = {language: lang};
766
+	return agrs;
767
+}());