Pārlūkot izejas kodu

Merge branch 'master' of http://106.246.249.162:13000/orderqueen/oqpo-view

whakdo963 2 gadi atpakaļ
vecāks
revīzija
e3c7567253

+ 2 - 2
src/main/webapp/app/stinfo/STINFO06010.html

@@ -22,10 +22,10 @@
22 22
 										<div class="col-xs-3 itp_ip itp_noMar">
23 23
 											<input type="text" id="ITP_FORM_STINFO06010_SEARCH_STORE_NM" class="form-control itp_input" name="sstoreNm" placeholder="매장명" />
24 24
 										</div>
25
-										<div class="col-xs-2 itp_ip itp_noMar" style="width:10%;">
25
+										<!--<div class="col-xs-2 itp_ip itp_noMar" style="width:10%;">
26 26
 											<button type="button" id="ITP_BTN_STINFO06010_SEARCH_SRH" class="btn btn-success btn-sm SEB" style="display: inline-block;"><i class="glyphicon glyphicon-search"></i></button>
27 27
 											<button type="button" id="ITP_BTN_STINFO06010_SEARCH_MODIFY" class="btn btn-primary btn-sm UPB" style="display: inline-block;"><i class="glyphicon glyphicon-erase"></i></button>
28
-										</div>
28
+										</div>-->
29 29
 									</div>
30 30
 								</form>
31 31
 							</div>

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

@@ -1,5 +1,5 @@
1 1
 <section id="ITP_MOBILE_MPOMNG01010">
2
-  <div id="ITP_POP_MPOMNG01010_REQ_CONFIRM" class="popup mobile-pop-close" style="display: none;">
2
+  <div id="ITP_POP_MPOMNG01010_REQ_AREA" 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>
@@ -15,47 +15,47 @@
15 15
       </div>
16 16
       <label class="pop_label">구매요청 하시겠습니까?</label>
17 17
       <div class="popup_btn">
18
-        <button id="ITP_BTN_MPOMNG01010_POP_CANCEL" class="cancel btn-gray CLB btn-pop-close">취소</button>
19
-        <button id="ITP_BTN_MPOMNG01010_POP_CONFIRM" class="ok btn-primary COK">확인</button>
18
+        <button id="ITP_BTN_MPOMNG01010_POP_REQ_CLOSE" class="cancel btn-gray CLB btn-pop-close">취소</button>
19
+        <button id="ITP_BTN_MPOMNG01010_POP_REQ_CONFIRM" class="ok btn-primary COK">확인</button>
20 20
       </div>
21 21
     </div>
22 22
   </div>
23
-  <div id="ITP_POP_MPOMNG01010_WHS_NM" class="popup2 mobile-pop-close" style="display: none;">
23
+  <div id="ITP_POP_MPOMNG01010_WHS_AREA" 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 type="button" id="ITP_BTN_MPOMNG01010_POP_CLOSE" class="btn-pop-close"><img src="../img/close.png"></button>
30
+          <button type="button" id="ITP_BTN_MPOMNG01010_POP_WHS_CLOSE" class="btn-pop-close"><img src="../img/close.png"></button>
31 31
         </div>
32 32
       </div>
33 33
       <div class="search_bar">
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>
34
+        <form id="ITP_FORM_MPOMNG01010_POP_WHS" class="form-horizontal" onsubmit="return false;">
35
+          <input id="ITP_FORM_MPOMNG01010_POP_WHS_KEYWORD" type="text" placeholder="납품장소명">
36
+          <button id="ITP_BTN_MPOMNG01010_POP_WHS_SEARCH"><img src="../img/search.png"></button>
37 37
         </form>
38 38
       </div>
39 39
       <div class="search_bar">
40 40
         <button id="ITP_BTN_MPOMNG01010_POP_WHS_NM" class="btn_blue">납품장소▼</button>
41 41
       </div>
42 42
       <div class="popup_scroll">
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;">
43
+        <ul id="ITP_LIST_MPOMNG01010_POP_WHS_ROWS" class="panel-group itp_nav"></ul>
44
+        <div id="ITP_LIST_MPOMNG01010_POP_WHS_ROWCOPY" style="display:none;">
45 45
           <li>
46 46
             <div class="scroll_left">
47 47
               <div class="fn">브랜드 창고 명A</div>
48 48
               <div class="fn">(상세위치내용)</div>
49 49
             </div>
50 50
             <div class="scroll_right">
51
-              <button id="ITP_BTN_MPOMNG01010_POP_CHOICE">선택</button>
51
+              <button id="ITP_BTN_MPOMNG01010_POP_WHS_CHOICE">선택</button>
52 52
             </div>
53 53
           </li>
54 54
         </div>
55 55
       </div>
56 56
     </div>
57 57
   </div>
58
-  <div id="ITP_POP_MPOMNG01010_ITEM_NM" class="popup2 mobile-pop-close" style="display: block;">
58
+  <div id="ITP_POP_MPOMNG01010_ITEM_AREA" class="popup2 mobile-pop-close" style="display: none;">
59 59
     <div class="pop">
60 60
         <div class="header">
61 61
             <div class="header_left">
@@ -76,9 +76,9 @@
76 76
                 <button id="ITP_BTN_MPOMNG01010_POP_ITEM_NM" class="btn_blue">품목명▼</button>
77 77
             </div>
78 78
         </form>
79
-        <div class="popup_scroll">
79
+        <div id="ITP_LIST_MPOMNG01010_POP_ITEM_AREA" class="popup_scroll">
80 80
             <ul id="ITP_LIST_MPOMNG01010_POP_ITEM_ROWS" class="panel-group"></ul>
81
-            <div id="ITP_LIST_MPOMNG01010_POP_ITEM_ROWCOPY" style="display:block;">
81
+            <div id="ITP_LIST_MPOMNG01010_POP_ITEM_ROWCOPY" style="display:none;">
82 82
                 <li class="row_2"
83 83
                     data-brandUnitUnqNo=""
84 84
                     data-podrPssblDvsn=""
@@ -89,9 +89,9 @@
89 89
                     data-unitAmt=""
90 90
                     data-unitGubun="">
91 91
                     <div class="left" style="width:200px;">
92
-                        <div class="check_box">
92
+                        <!--<div class="check_box">
93 93
                             <input type="checkbox" id="ITP_FORM_MPOMNG01010_POP_ITEM_CHECKBOX" name="itemId" />
94
-                        </div>
94
+                        </div>-->
95 95
                         <div class="thick">
96 96
                             <div class="fnItemNm">품목명</div>
97 97
                             <div>-</div>
@@ -99,16 +99,16 @@
99 99
                         </div>
100 100
                         <div class="thick" style="font-weight:100;">
101 101
                             <div class="space">구매가 :</div>
102
-                            <div class="fnOrdAmount">0</div>
102
+                            <div class="fnUnitAmt">0</div>
103 103
                         </div>
104 104
                     </div>
105 105
                     <div class="right">
106
-                        <button id="ITP_BTN_MPOMNG01010_POP_ITEM_PLUS">-</button>
107
-                        <div class="num">2</div>
108
-                        <button id="ITP_BTN_MPOMNG01010_POP_ITEM_MINUS">+</button>
106
+                        <button id="ITP_BTN_MPOMNG01010_POP_ITEM_MINUS" class="POP_ITEM_MINUS">-</button>
107
+                        <div class="num">1</div>
108
+                        <button id="ITP_BTN_MPOMNG01010_POP_ITEM_PLUS" class="POP_ITEM_PLUS">+</button>
109 109
                     </div>
110 110
                     <div class="add">
111
-                        <button id="ITP_BTN_MPOMNG01010_POP_ITEM_ADD">추가</button>
111
+                        <button id="ITP_BTN_MPOMNG01010_POP_ITEM_ADD" class="POP_ITEM_ADD">추가</button>
112 112
                     </div>
113 113
                 </li>
114 114
             </div>
@@ -148,7 +148,7 @@
148 148
               <input type="text" id="ITP_FORM_MPOMNG01010_DETAIL_WHS_NM" class="" name="whsNm" placeholder="매장명" />
149 149
             </div>
150 150
             <div class="float_left_btn">
151
-              <button id="ITP_BTN_MPOMNG01010_DETAIL_SEARCH_WHS_NM" data-call-popup="ITP_POP_MPOMNG01010_WHS_NM"><img src="../img/search.png" alt=""></button>
151
+              <button id="ITP_BTN_MPOMNG01010_DETAIL_SEARCH_WHS_NM" data-call-popup="ITP_POP_MPOMNG01010_WHS_AREA"><img src="../img/search.png" alt=""></button>
152 152
               <button id="ITP_BTN_MPOMNG01010_DETAIL_DELETE_WHS_NM"><img src="../img/delete.png" alt=""></button>
153 153
             </div>
154 154
           </div>
@@ -157,17 +157,17 @@
157 157
           <div class="table_header">
158 158
             <h1>>구매 품목</h1>
159 159
             <button type="button" id="ITP_BTN_MPOMNG01010_DETAIL_DELROW" class="btn-primary btn-sm ADB">품목삭제</button>
160
-            <button type="button" id="ITP_BTN_MPOMNG01010_DETAIL_ADDROW" class="btn-primary btn-sm ADB">품목추가</button>
160
+            <button type="button" id="ITP_BTN_MPOMNG01010_DETAIL_ADDROW" class="btn-primary btn-sm ADB" data-call-popup="ITP_POP_MPOMNG01010_ITEM_AREA">품목추가</button>
161 161
           </div>
162 162
         </div>
163 163
       </div>
164
-      <div class="scroll_area row-1">
165
-        <ul id="ITP_LIST_MPOMNG01010_DETAIL_ROWS"></ul>
164
+      <div id="ITP_LIST_MPOMNG01010_ITEM_AREA" class="scroll_area row-1">
165
+        <ul id="ITP_LIST_MPOMNG01010_DETAIL_ROWS" class="panel-group"></ul>
166 166
         <div id="ITP_LIST_MPOMNG01010_DETAIL_ROWCOPY" style="display:none;">
167
-          <li>
167
+          <li class="row_2">
168 168
             <div class="left_info">
169 169
               <div class="thick">
170
-                <div><input type="checkbox" id="ITP_FORM_MPOMNG01010_DETAIL_CHECKBOX" name="itemId" /></div>
170
+                <div><input type="checkbox" name="itemId" class="fnBrandUnitUnqNo" /></div>
171 171
               </div>
172 172
               <div class="thick">
173 173
                 <div class="fnItemNm">품목명</div>
@@ -176,7 +176,7 @@
176 176
               </div>
177 177
               <div class="thick">
178 178
                 <label class="space0">구매가 :</label>
179
-                <div class="fnPchActAmt">1,120,000</div>
179
+                <div class="fnUnitAmt">1,120,000</div>
180 180
               </div>
181 181
             </div>
182 182
             <div class="right">
@@ -188,7 +188,7 @@
188 188
         </div>
189 189
       </div>
190 190
       <div class="button_bar">
191
-        <button id="ITP_BTN_MPOMNG01010_DETAIL_REQ_ORDER" data-call-popup="ITP_POP_MPOMNG01010_REQ_CONFIRM" class="col_3 btn-primary REQ">구매요청</button>
191
+        <button id="ITP_BTN_MPOMNG01010_DETAIL_REQ_ORDER" data-call-popup="ITP_POP_MPOMNG01010_REQ_AREA" class="col_3 btn-primary REQ">구매요청</button>
192 192
         <button id="ITP_BTN_MPOMNG01010_DETAIL_TEMP_SAVE" class="col_3 btn-gray TSA">임시저장</button>
193 193
         <button id="ITP_BTN_MPOMNG01010_DETAIL_CANCEL" class="col_3 btn-gray CLB">취소</button>
194 194
       </div>

+ 114 - 49
src/main/webapp/mobile/js/app/mpomng/ITP_MPOMNG01010.js

@@ -33,11 +33,11 @@ let mobPageObj = {
33 33
 		button: function() {
34 34
 			$('button[id^="ITP_BTN_MPOMNG01010_DETAIL"]').on('click', function() {
35 35
 				if($(this).is('[data-call-popup]')) {
36
+					console.log($(this).attr('id'));
36 37
 					mobPopObj.show($(this).data('call-popup'));
37 38
 				} else {
38 39
 					var id = $(this).attr('id');
39 40
 					switch (id) {
40
-						case 'ITP_BTN_MPOMNG01010_DETAIL_ADDROW': contPopObj.list.addRow(); break;
41 41
 						case 'ITP_BTN_MPOMNG01010_DETAIL_DELROW': contPopObj.list.delRow(); break;
42 42
 						case 'ITP_BTN_MPOMNG01010_DETAIL_DELETE_WHS_NM': break;
43 43
 						case 'ITP_BTN_MPOMNG01010_DETAIL_TEMP_SAVE': break;
@@ -76,73 +76,138 @@ let contPopObj = {
76 76
 		}
77 77
 	},
78 78
 	list: {
79
+		rows: [],
79 80
 		addRow: function() {
80
-			var _this = this;
81
-			$('#ITP_LIST_MPOMNG01010_POP_ITEM_ROWS').empty();
82
-			var callbackFn = function(result) {
83
-				mobPopObj.addRow.init(result);
84
-			};
85
-			let param = $('#ITP_FORM_MPOMNG01010_POPUP_ITEM').serializeObject();
86
-			param.gridSize = 10;
87
-			fn_ajax_call(API_POP_ITEM_LIST, JSON.stringify(param), callbackFn, 'POST');
88 81
 		},
89 82
 		delRow: function() {
90
-
83
+			this.detachRow();
84
+		},
85
+		attachRow: function (item) {
86
+			console.log(item);
87
+			var fnIsExist = function(rows) {
88
+				var isExist = false;
89
+				$.each(rows, function(i, row) {
90
+					if(row.brandUnitUnqNo === item.brandUnitUnqNo) {
91
+						isExist = true;
92
+						return false;
93
+					}
94
+				});
95
+				return isExist;
96
+			};
97
+			if(!fnIsExist(this.rows)) {
98
+				this.rows.push(item);
99
+				$('#ITP_LIST_MPOMNG01010_ITEM_AREA .panel-group').append($('#ITP_LIST_MPOMNG01010_DETAIL_ROWCOPY').html());
100
+				var $li = $('#ITP_LIST_MPOMNG01010_ITEM_AREA .panel-group > .row_2:last');
101
+				$li.find('.fnBrandUnitUnqNo').val(item.brandUnitUnqNo);
102
+				$li.find('.fnItemNm').text(item.itemNm);
103
+				$li.find('.fnUnitAmt').text(itp_fn_set_comma(item.unitAmt));
104
+			}
105
+		},
106
+		detachRow: function () {
107
+			$('#ITP_LIST_MPOMNG01010_DETAIL_ROWS li').each(function(index, elem) {
108
+				var isChecked = $(this).find('input[type="checkbox"]').is(':checked');
109
+				console.log(index + " ===> " + isChecked);
110
+			});
91 111
 		}
92 112
 	}
93 113
 };
94 114
 
95 115
 let mobPopObj = {
96
-	addRow: {
97
-		rows: [],
98
-		init: function(rows) {
99
-			this.rows = rows.gridRows;
100
-			mobPopObj.show('ITP_POP_MPOMNG01010_ITEM_NM');
101
-			this.view();
102
-		},
103
-		view: function() {
104
-			$.each(this.rows, function (i, item) {
105
-				$('#ITP_LIST_MPOMNG01010_POP_ITEM_AREA .panel-group').append($('#ITP_LIST_MPOMNG01010_POP_ITEM_ROWCOPY').html());
106
-				var $li = $('#ITP_LIST_MPOMNG01010_POP_ITEM_AREA .panel-group > .row_2:last');
107
-				$li.data('brandUnitUnqNo', item.brandUnitUnqNo);
108
-				$li.data('podrPssblDvsn', item.podrPssblDvsn);
109
-				$li.data('spplyId', item.spplyId);
110
-				$li.data('stddQty', item.stddQty);
111
-				$li.data('storeUnitUnqNo', item.storeUnitUnqNo);
112
-				$li.data('unit', item.unit);
113
-				$li.data('unitAmt', item.unitAmt);
114
-				$li.data('unitGubun', item.unitGubun);
115
-				$li.find('#ITP_FORM_MPOMNG01010_POP_ITEM_CHECKBOX').val(item.itemId);
116
-				$li.find('.fnItemNm').text(item.itemNm);
117
-				$li.find('.fnItemNm').text(item.unitAmt);
118
-			});
116
+	popItem: {
117
+		parentFn: null,
118
+		rows: null,
119
+		init: function(fn) {
120
+			console.log(fn);
121
+			this.parentFn = fn;
122
+			this.search();
119 123
 		},
120 124
 		search: function() {
121
-
125
+			$('#ITP_LIST_MPOMNG01010_POP_ITEM_AREA .panel-group').empty();
126
+			var callbackFn = function(result) {
127
+				mobPopObj.popItem.rows = result.gridRows;
128
+				$.each(mobPopObj.popItem.rows, function (i, item) {
129
+					$('#ITP_LIST_MPOMNG01010_POP_ITEM_AREA .panel-group').append($('#ITP_LIST_MPOMNG01010_POP_ITEM_ROWCOPY').html());
130
+					var $li = $('#ITP_LIST_MPOMNG01010_POP_ITEM_AREA .panel-group > .row_2:last');
131
+					$li.data('brandUnitUnqNo', item.brandUnitUnqNo);
132
+					$li.data('podrPssblDvsn', item.podrPssblDvsn);
133
+					$li.data('spplyId', item.spplyId);
134
+					$li.data('stddQty', item.stddQty);
135
+					$li.data('storeUnitUnqNo', item.storeUnitUnqNo);
136
+					$li.data('unit', item.unit);
137
+					$li.data('unitAmt', item.unitAmt);
138
+					$li.data('unitGubun', item.unitGubun);
139
+					$li.find('#ITP_FORM_MPOMNG01010_POP_ITEM_CHECKBOX').val(item.itemId);
140
+					$li.find('.fnItemNm').text(item.itemNm);
141
+					$li.find('.fnUnitAmt').text(itp_fn_set_comma(item.unitAmt));
142
+				});
143
+				mobPopObj.popItem.addRow.init();
144
+			};
145
+			let param = $('#ITP_FORM_MPOMNG01010_POPUP_ITEM').serializeObject();
146
+			fn_ajax_call(API_POP_ITEM_LIST, JSON.stringify(param), callbackFn, 'POST');
147
+		},
148
+		addRow: {
149
+			init: function() {
150
+				this.button.init();
151
+			},
152
+			button: {
153
+				init: function() {
154
+					console.log('button');
155
+					var _this = this;
156
+					$('button[id^="ITP_BTN_MPOMNG01010_POP_ITEM_"]').off('click').on('click', function() {
157
+						var id = $(this).attr('id');
158
+						switch (id) {
159
+							case 'ITP_BTN_MPOMNG01010_POP_ITEM_PLUS': _this.actPlus($(this)); break;
160
+							case 'ITP_BTN_MPOMNG01010_POP_ITEM_MINUS': _this.actMinus($(this)); break;
161
+							case 'ITP_BTN_MPOMNG01010_POP_ITEM_ADD': _this.actItemAdd($(this)); break;
162
+							case 'ITP_BTN_MPOMNG01010_POP_ITEM_SEARCH': mobPopObj.popItem.search(); break;
163
+							case 'ITP_BTN_MPOMNG01010_POP_ITEM_CLOSE': mobPopObj.hide(id); break;
164
+						}
165
+						return false;
166
+					});
167
+				},
168
+				actPlus: function(elem) {
169
+					var $div = $(elem).closest('div').find('.num');
170
+					var num = Number($div.text());
171
+					$($div).text((num + 1).toString());
172
+				},
173
+				actMinus: function(elem) {
174
+					var $div = $(elem).closest('div').find('.num');
175
+					var num = Number($div.text());
176
+					if(num <= 1) {
177
+						alert('주문수량을 확인하세요.');
178
+					} else {
179
+						$($div).text((num - 1).toString());
180
+					}
181
+				},
182
+				actItemAdd: function(elem) {
183
+					var index = $(elem).closest('li').index();
184
+					contPopObj.list.attachRow(mobPopObj.popItem.rows[index]);
185
+				}
186
+			}
122 187
 		},
123
-		choice: function() {
188
+		delRow: function() {
124 189
 
125 190
 		}
126 191
 	},
127
-	show: function(id, args, fn) {
128
-		this.button();
129
-		$('#' + id).show();
192
+	popWhsNm: {
193
+
194
+	},
195
+	popReqConfirm: {
196
+
130 197
 	},
131
-	button: function() {
132
-		var _this = this;
133
-		$('button[id^="ITP_BTN_MPOMNG01010_POP"]').off('click').on('click', function() {
198
+	show: function(id) {
199
+		console.log('show ===> ' + id);
200
+		$('#' + id).show();
201
+		$('button[id$="CLOSE"]').off('click').on('click', function() {
134 202
 			var id = $(this).attr('id');
203
+			console.log('CLOSE ===> ' + id);
135 204
 			if($(this).hasClass('btn-pop-close')) {
136
-				_this.hide(id);
137
-				return;
205
+				$('#' + id).closest('.mobile-pop-close').hide();
138 206
 			}
139
-			switch (id) {
140
-				case 'ITP_BTN_MPOMNG01010_POP_CONFIRM': break;
141
-				case 'ITP_BTN_MPOMNG01010_POP_SEARCH':
142
-					break;
143
-			}
144
-			return false;
145 207
 		});
208
+		if(id.indexOf('ITEM_AREA') > -1) {
209
+			this.popItem.init();
210
+		}
146 211
 	},
147 212
 	hide: function(id) {
148 213
 		$('#' + id).closest('.mobile-pop-close').hide();