whakdo963 2 роки тому
батько
коміт
cb826adb55

+ 70 - 0
bin/src/main/webapp/mobile/js/app/mpomng/ITP_MPOMNG01010.js

@@ -0,0 +1,70 @@
1
+require(['config'], function() {
2
+	require([
3
+	], function($) {
4
+		contentPageObj.init();
5
+	});
6
+});
7
+
8
+/*API URL*/
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';
12
+
13
+let contentPageObj = {
14
+	init: function () {
15
+		this.ui.init();
16
+		this.event.init();
17
+	},
18
+	ui: {
19
+		init: function () {
20
+
21
+		}
22
+	},
23
+	event: {
24
+		init: function() {
25
+			this.button();
26
+		},
27
+		button: 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');
33
+					switch (id) {
34
+						case 'ITP_BTN_MPOMNG01010_DETAIL_TEMP_SAVE': break;
35
+						case 'ITP_BTN_MPOMNG01010_DETAIL_CANCEL':break;
36
+					}
37
+				}
38
+				return false;
39
+			});
40
+		}
41
+	}
42
+};
43
+
44
+let contentPopObj = {
45
+	show: function(id, args, fn) {
46
+		this.button();
47
+		console.log(id);
48
+		$('#' + id).show();
49
+	},
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;
57
+			}
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
+		});
66
+	},
67
+	hide: function(id) {
68
+		$('#' + id).closest('.mobile-pop-close').hide();
69
+	}
70
+};

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

@@ -178,9 +178,13 @@
178 178
 				</div>
179 179
 			</div>
180 180
 			<div id="ITP_CONTAINER" class="fix">
181
+				<div class="itp_mobile_contents">
181 182
 				<section>
182 183
 				  
183 184
 				</section>
185
+
186
+				</div>
187
+			</div>
184 188
 		</div>
185 189
 	</body>
186 190
 </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>

+ 2 - 186
src/main/webapp/mobile/js/app/main.js

@@ -1,198 +1,14 @@
1
-
2
-const MAIN_NOTICE_GRID_ID = '#ITP_MAIN_NOTICE_jqGrid';
3
-const MAIN_NOTICE_GRID_LIST = '#ITP_MAIN_NOTICE_jqGrid_list';
4
-const MAIN_NOTICE_GRID_PAGER = '#ITP_MAIN_NOTICE_jqGridPager';
5
-const MAIN_NOTICE_GRID_EMPTY = '#ITP_MAIN_NOTICE_jqGridEmpty';
6
-
7
-let NTICE_DETAIL_GRID_LIST = '/api/ntice/detail-grid-list';
8
-
9 1
 require(['config'], function() {
10 2
 	require([
11 3
 		'jquery'
12 4
 	], function($) {
13
-		
14
-		setTimeout(function() {
15
-			// // 시간지정
16
-			// $('#ITP_FORM_MAIN_NOTICE_SEARCH_SCH_DT').val(itp_fn_date_format(new Date(), 2));
17
-			// $('#ITP_FORM_MAIN_NOTICE_SEARCH_USER_ID').val(USER_ID);
18
-			//
19
-	    	// // Barcode
20
-			// itp_fn_barcode.init();
21 5
 
6
+		setTimeout(function() {
22 7
 		}, 100);
23
-				
8
+
24 9
 	});
25 10
 });
26 11
 
27
-var itp_fn_mobile_MAIN_MENU = {
28
-	init: function() {
29
-		this.topMenuMake();
30
-		this.button();
31
-	},
32
-	button: function() {
33
-		var _this = this;
34
-		$(document).on('click', '.manage_btn_bar button', function() {
35
-			$('#ITP_CONTAINER').empty();
36
-			_this.subMenuMake($(this).data('top-menu'));
37
-		});
38
-		$(document).on('click', '#ITP_CONTAINER button', function() {
39
-			console.log('===> ' + $(this).data('sub-menu'));
40
-		});
41
-	},
42
-	topMenuMake: function() {
43
-		var _this = this;
44
-		var topMenuCnt = 0;
45
-		$.each(AUTH_MENU_LIST, function(key, value) {
46
-			if(value.topMenuNo === 200) {
47
-				topMenuCnt++;
48
-			}
49
-		});
50
-		console.log(topMenuCnt);
51
-		$.each(AUTH_MENU_LIST, function(key, value) {
52
-			if(value.topMenuNo === 200) {
53
-				var menuDIV = 	'<div class="manage col_' + topMenuCnt + '">' +
54
-								'	<button data-top-menu="' + value.menuNo + '">' + value.menuNm + '</button>' +
55
-								'</div>';
56
-				$('.manage_btn_bar').append(menuDIV);
57
-				if(key === 0) {
58
-					_this.subMenuMake(value.menuNo);
59
-				}
60
-			}
61
-		});
62
-	},
63
-	subMenuMake: function(topMenuNo) {
64
-		var seq = 0;
65
-		var pos = 'icon_left';
66
-		var menuDIV = '<div class="wicon">\n';
67
-		$.each(AUTH_MENU_LIST, function(key, value) {
68
-			if(value.topMenuNo === topMenuNo) {
69
-				if(seq > 0 && seq % 2 === 0) {
70
-					menuDIV += '</div>\n';
71
-					menuDIV += '<div class="wicon">\n';
72
-					pos = 'icon_left';
73
-				}
74
-				menuDIV += 	'	<div class="' + pos + '">\n' +
75
-							'		<button data-sub-menu="' + value.menuNo + '">\n' +
76
-							'			<label>ICON<br>' + value.menuNm + '</label>\n' +
77
-							'		</button>\n' +
78
-							'	</div>\n';
79
-				seq++;
80
-				pos = 'icon_right';
81
-			}
82
-		});
83
-		menuDIV += '</div>';
84
-		$('#ITP_CONTAINER').append(menuDIV);
85
-	}
86
-};
87
-
88
-var itp_fn_MAIN_NOTICE_grid = {
89
-	init: function() {
90
-		// 데이터 없을때
91
-		itp_fn_MAIN_NOTICE_empty.push();
92
-		$(MAIN_NOTICE_GRID_EMPTY).on('click', function() {
93
-			itp_fn_MAIN_NOTICE_empty.back();
94
-			itp_MAIN_NOTICE_param.gridSize = $.jgrid.defaults.rowNum;
95
-			$(MAIN_NOTICE_GRID_ID).setGridParam({'postData': JSON.stringify(itp_MAIN_NOTICE_param)}).trigger('reloadGrid');
96
-		});
97
-	},
98
-	callBack: function() {
99
-		let param = $('#ITP_FORM_MAIN_NOTICE_SEARCH').serializeObject();
100
-		param.gridSize = $.jgrid.defaults.rowNum;
101
-		$(MAIN_NOTICE_GRID_ID).jqGrid({
102
-			colModel: [
103
-				{
104
-					index: 'NTICE_NO', name: 'nticeNo',
105
-					label: ITP_MSG_LOCALE.label.notiNo, //공지번호
106
-					width: '10', fixed: false, align: 'center',
107
-					sortable: false, hidden: false
108
-				},
109
-				{
110
-					index: 'NTICE_TITL', name: 'nticeTitl',
111
-					label: '공지사항', //공지제목
112
-					width: '15', fixed: false, align: 'center',
113
-					sortable: false, hidden: false
114
-				},
115
-				{
116
-					index: 'ADD_DT', name: 'addDt',
117
-					label: ITP_MSG_LOCALE.label.regDt, //등록일
118
-					width: '10', fixed: false, align: 'center',
119
-					sortable: false, hidden: false
120
-				}
121
-			],
122
-			loadBeforeSend: function(jqXHR) {
123
-			    jqXHR.setRequestHeader('X-AUTH-TOKEN', CONN_KEY);
124
-			},
125
-			postData: JSON.stringify(param),
126
-			url: DOMAIN + NTICE_DETAIL_GRID_LIST,
127
-			pager: MAIN_NOTICE_GRID_PAGER,
128
-			multiselect: false,
129
-			rownumbers: true,
130
-			onCellSelect: function(rowId, cellIdx, cellValue) {
131
-				var cm = $(this).jqGrid('getGridParam', 'colModel');
132
-				var colNm = cm[cellIdx].name;
133
-				if (colNm == 'nticeTitl') {
134
-					const nticeNoVal = $(this).jqGrid('getCell', rowId, 'nticeNo');
135
-					const key = {nticeNo: nticeNoVal, viewCd: 'R'};
136
-					var param = $.param(key);
137
-					// itp_fn_MAIN_NOTICE_view(param);
138
-					
139
-					fn_call_popup('comm', 'NOTICE_INFO_POPUP', '#ITP_ASIDE', function() {
140
-												
141
-					}, param, 'S');
142
-					$('#ITP_NOTICE_INFO_POPUP > div.modal-dialog').width('500px');
143
-				}
144
-		   	},
145
-			loadComplete: function(data) {
146
-				//console.log(JSON.stringify(data));
147
-				itp_fn_grid_load_complete(data, MAIN_NOTICE_GRID_ID, true, 'number', 'MAIN_NOTICE', itp_MAIN_NOTICE_search, itp_fn_MAIN_NOTICE_empty, false, data.gridRecords, false);
148
-				var ids = $(MAIN_NOTICE_GRID_ID).getDataIDs();
149
-				$.each(ids, function(idx, rowId) {
150
-					$(MAIN_NOTICE_GRID_ID).jqGrid('setCell', rowId, 'nticeTitl', '', ITP_GRID_COL_STYLE.link);
151
-				});
152
-
153
-				if ($('#ITP_CONTAINER').data('openYn') == 'Y') {
154
-					$('#ITP_CONTAINER').data('openYn', 'N');
155
-					const keyNew = {nticeNo: $('#ITP_CONTAINER').data('nticeNo'), viewCd: 'R'};
156
-					var paramNew = $.param(keyNew);
157
-					itp_fn_MAIN_NOTICE_view(paramNew);
158
-				}
159
-		    },
160
-		    loadError: function(jqXHR, textStatus, errorThrown) {
161
-		    	itp_fn_grid_load_error(jqXHR, textStatus, errorThrown);
162
-		    },
163
-		    onPaging: function(action) {
164
-		    	itp_fn_grid_paging(MAIN_NOTICE_GRID_ID, action, param);
165
-		    }
166
-		}).navGrid(MAIN_NOTICE_GRID_PAGER, ITP_GRID_NAV_DEFAULTS.navGrid);
167
-	},
168
-	clearData : function() {
169
-		$(MAIN_NOTICE_GRID_ID).jqGrid('clearGridData', true);
170
-		$(MAIN_NOTICE_GRID_LIST).find('.ui-jqgrid-bdiv').css('min-height', '100px');
171
-		$(MAIN_NOTICE_GRID_EMPTY).html(ITP_MSG_LOCALE.message.grid.noData);
172
-		$(MAIN_NOTICE_GRID_EMPTY).show();
173
-	},
174
-	unload : function() {
175
-		$.jgrid.gridUnload(MAIN_NOTICE_GRID_ID);
176
-	}
177
-};
178
-
179
-var itp_fn_MAIN_NOTICE_search = function() {
180
-	itp_fn_MAIN_NOTICE_grid.unload();
181
-	itp_fn_MAIN_NOTICE_grid.callBack();
182
-};
183
-
184
-let itp_MAIN_NOTICE_param = {};
185
-let itp_MAIN_NOTICE_search = false;
186
-var itp_fn_MAIN_NOTICE_empty = {
187
-	push: function() {		
188
-		let param = $('#ITP_FORM_MAIN_NOTICE_SEARCH').serializeObject();
189
-		itp_MAIN_NOTICE_param = param;
190
-	},
191
-	back: function() {
192
-		
193
-	}
194
-};
195
-
196 12
 var itp_fn_barcode = {
197 13
 	init: function () {
198 14
 		this.event();

+ 70 - 0
src/main/webapp/mobile/js/app/mpomng/ITP_MPOMNG01010.js

@@ -0,0 +1,70 @@
1
+require(['config'], function() {
2
+	require([
3
+	], function($) {
4
+		contentPageObj.init();
5
+	});
6
+});
7
+
8
+/*API URL*/
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';
12
+
13
+let contentPageObj = {
14
+	init: function () {
15
+		this.ui.init();
16
+		this.event.init();
17
+	},
18
+	ui: {
19
+		init: function () {
20
+
21
+		}
22
+	},
23
+	event: {
24
+		init: function() {
25
+			this.button();
26
+		},
27
+		button: 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');
33
+					switch (id) {
34
+						case 'ITP_BTN_MPOMNG01010_DETAIL_TEMP_SAVE': break;
35
+						case 'ITP_BTN_MPOMNG01010_DETAIL_CANCEL':break;
36
+					}
37
+				}
38
+				return false;
39
+			});
40
+		}
41
+	}
42
+};
43
+
44
+let contentPopObj = {
45
+	show: function(id, args, fn) {
46
+		this.button();
47
+		console.log(id);
48
+		$('#' + id).show();
49
+	},
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;
57
+			}
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
+		});
66
+	},
67
+	hide: function(id) {
68
+		$('#' + id).closest('.mobile-pop-close').hide();
69
+	}
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
+};