Quellcode durchsuchen

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

dwkim vor 2 Jahren
Ursprung
Commit
474d52af6d

+ 3 - 3
src/main/webapp/js/app/config.js

@@ -526,8 +526,7 @@ function fn_make_side_menu() {
526 526
 		// const path = '/app/'+id.substring(0, id.length - 5).toLowerCase();
527 527
 		const tabSize = $('#ITP_HEADER .itp_tab_list li').size();
528 528
 
529
-
530
-		console.log('[ITP_NAV_LINK] data-itp-nav-id = ' + id + ', data-conn-url = ' + connUrl + ', tabSize = ' + tabSize);
529
+		
531 530
 
532 531
 		if(String(id).indexOf('OPER') === -1 && String(id).indexOf('SYSTEM') === -1) {
533 532
 			if(fn_make_user_info.get('brandId') === '') {
@@ -557,11 +556,12 @@ function fn_make_side_menu() {
557 556
 		});
558 557
 
559 558
 		if (!isDup && openCd == 'C') {
560
-
561 559
 			const href = ITP_CONTEXTPATH + connUrl; // $(this).attr('href');
562 560
 			const text = $(this).children('.itp_tt').text();
563 561
 			const tab = '<li class="active"><a href="#ITP_TAB_' + id + '" role="tab" data-toggle="tab" class="itp_tab_open">' + text + ' <i class="glyphicon glyphicon-remove itp_tab_close" data-itp-tab-id="' + id + '"></i></a></li>';
564 562
 			itp_fn_load_page(href, tab, '', id);
563
+			console.log('[ITP_NAV_LINK] data-itp-nav-id = ' + id + ', data-conn-url = ' + connUrl + ', tabSize = ' + tabSize+' [text='+text+']' );
564
+			if(text) $('.itp_det_tit>strong').html(text);
565 565
 
566 566
 		} else {
567 567
 			itp_fn_fire_window_resize();

+ 7 - 1
src/main/webapp/js/app/pomng/ITP_POMNG08010.js

@@ -127,7 +127,7 @@ function onPageInit() {
127 127
 			console.log("item add result ==> ", result);
128 128
 			// 기존등록 데이터
129 129
 			var exists=[]; 
130
-			for(var cur of grid.getRowData() ) exists.push(cur.brandUnitUnqNo);
130
+			for(var cur of grid.getRowData() ) exists.push(cur.brandUnitUnqNo); 
131 131
 			for(var cur of result ) {
132 132
 				if(exists.indexOf(cur.brandUnitUnqNo)==-1 ) {
133 133
 					cur['viewCd'] = "C";
@@ -183,6 +183,12 @@ const gridColModel = {
183 183
 			width: 0, fixed: false, align: 'center',
184 184
 			sortable: false, hidden: true
185 185
 		},
186
+		{
187
+			index: 'BRAND_UNIT_UNQ_NO', name: 'brandUnitUnqNo',
188
+			label: ITP_MSG_LOCALE.label.brandUnitUnqNo,
189
+			width: 0, fixed: false, align: 'center',
190
+			sortable: false, hidden: true
191
+		},
186 192
 		{
187 193
 			index: 'ITEM_NO', name: 'itemId',
188 194
 			label: '품목번호',

+ 2 - 2
src/main/webapp/js/app/stinfo/ITP_STINFO04010.js

@@ -1205,8 +1205,8 @@ let createObj = {
1205 1205
 		                    ITP_FORM_STINFO04010_DETAIL_IS_WRITING = false;
1206 1206
 		                    listObj.grid.search();
1207 1207
 		                };
1208
-                        console.log("save ==> ", param);
1209
-		                // fn_ajax_call(API_DETAIL_SAVE_LIST, JSON.stringify(param), searhFn, 'POST');
1208
+                        console.log("excel save ==> ", param);
1209
+		                fn_ajax_call(API_DETAIL_SAVE_LIST, JSON.stringify(param), searhFn, 'POST');
1210 1210
 					}
1211 1211
 				};
1212 1212
 				itp_fn_modal_confirm('저장 하시겠습니까?', modalFn);				

+ 1 - 1
src/main/webapp/mobile/app/main.html

@@ -192,7 +192,7 @@
192 192
 							<button data-menu-id="MLOANMNG03010"><img src="../img/main_icon/no_amt.png"></button>
193 193
 						</div>
194 194
 						<div class="itp_icon">
195
-							<button data-menu-id="ITP_MAIN_ICON_ITEM_SALES"><img src="../img/main_icon/Sales.png"></button>
195
+							<button data-menu-id="MSALESMNG02010"><img src="../img/main_icon/Sales.png"></button>
196 196
 						</div>
197 197
 					</div>
198 198
 				</div>

+ 52 - 17
src/main/webapp/mobile/app/msalesmng/MSALESMNG02010.html

@@ -6,19 +6,18 @@
6 6
     	<div class="content">
7 7
     	  <div class="content_fix">
8 8
 	   	    <div class="line header">
9
-				<div class="itp_search_header"><img src="../img/right_arrow_pink.png" alt="">구매요청현황</div>
9
+				<div class="itp_search_header"><img src="../img/right_arrow_pink.png" alt="">품목별매출현황</div>
10 10
 	      	</div>
11 11
 	      <div class="line">
12 12
 	        <label>매장명</label>
13 13
 	        <div class="float_left">
14
-	          <input id="ITP_FORM_MSALESMNG02010_LIST_SEARCH_WHS_NM" class="" name="swhsNm" type="text" readonly>
15
-	             <input type="hidden" id="ITP_FORM_MSALESMNG02010_LIST_SEARCH_WHS_ID" name="swhsId" value="">
16
-	             <div class="itp_input_btn">
17
-	         		 <button id="ITP_BTN_MSALESMNG02010_LIST_SEARCH_WHS_NM"><img src="../img/search.png" alt=""></button>
14
+	          	<input id="ITP_FORM_MSALESMNG02010_LIST_SEARCH_STORE_NM" class="" name="swhsNm" type="text" readonly>
15
+	            <div class="itp_input_btn">
16
+	         		 <button id="ITP_BTN_MSALESMNG02010_LIST_SEARCH_STORE_NN"><img src="../img/search.png" alt=""></button>
18 17
 	  			</div>
19 18
 	        </div>
20 19
 	        <div class="float_right_btn">
21
-	          <button id="ITP_BTN_MSALESMNG02010_LIST_DELETE_WHS_NM"><img src="../img/delete.png" alt=""></button>
20
+	          <button id="ITP_BTN_MSALESMNG02010_LIST_DELETE_STORE_NN"><img src="../img/delete.png" alt=""></button>
22 21
 	        </div>
23 22
 	      </div>
24 23
 	        <div class="line">
@@ -39,52 +38,88 @@
39 38
 	      </div>
40 39
         </div>
41 40
       </div>
42
-    <div id="ITP_LIST_MSALESMNG02010_ITEM_AREA" class="scroll_area row-2">
43
-      <ul id="ITP_LIST_MSALESMNG02010_ITEM_ROWS" class="mb_0 panel-group"></ul>
44
-      <div id="ITP_LIST_MSALESMNG02010_ITEM_ROWCOPY" style="display: none;">
41
+    <div id="ITP_LIST_MSALESMNG02010_LIST_ITEM_AREA" class="scroll_area row-2">
42
+      <ul id="ITP_LIST_MSALESMNG02010_LIST_ITEM_ROWS" class="mb_0 panel-group"></ul>
43
+      <div id="ITP_LIST_MSALESMNG02010_LIST_ITEM_ROWCOPY" style="display: none;">
45 44
         <li class="history_list7 item-row">
46 45
           <div class="left">
47 46
             <div class="nomal">
48 47
               	<label class="col_4">품목번호 </label>
49
-              	<span>:</span>
48
+				<span>:</span>
49
+              	<span class="fn-itemId"></span>
50 50
               	<div class="full_s fnItemNo"></div>
51
-              	<div style="width:60px;" class="red fnSt"></div>
51
+              	<div style="width:60px;" class="fn-saleType"></div>
52 52
             </div>
53 53
           </div>
54 54
           <div class="left">
55 55
             <div class="nomal">
56 56
              	<label class="col_4">품목명 </label>
57 57
               	<span>:</span>
58
-              	<div class="full fnItemNm"></div>
58
+              	<div class="full fn-itemNm"></div>
59 59
             </div>
60 60
           </div>
61 61
           <div class="left">
62 62
             <div class="nomal">
63 63
               	<label class="col_4">수량</label>
64 64
               	<span>:</span>
65
-              	<div class="red fnQty"></div>
65
+              	<div class="fn-whsQty"></div>
66 66
               	<label class="col_4">공급가액</label>
67 67
               	<span>:</span>
68
-              	<div class="red fnSpyAmt"></div>
68
+              	<div class="fn-supplyAmt"></div>
69 69
             </div>
70 70
           </div>
71 71
           <div class="left">
72 72
             <div class="nomal">
73 73
               	<label class="col_4">판매금액</label>
74 74
               	<span>:</span>
75
-              	<div class="red fnSaleAmt"></div>
75
+              	<div class="fn-storeAmt"></div>
76 76
               	<label class="col_4">수익금액</label>
77 77
               	<span>:</span>
78
-              	<div class="red fnAmt"></div>
78
+              	<div class="fn-incomeAmt"></div>
79 79
             </div>
80 80
           </div>
81 81
         </li>
82 82
       </div>
83 83
    	  </div>
84 84
    	  <div class="button_bar">
85
-		<button id="ITP_BTN_MSTOCKMNG01010_DETAIL_CANCEL" class="col_12 btn-gray CLB">닫기</button>
85
+		<button id="ITP_BTN_MSALESMNG02010_DETAIL_CANCEL" class="col_12 btn-gray CLB">닫기</button>
86 86
 	  </div>
87 87
     </form>
88 88
   </div>
89 89
   <div id="ITP_MOBILE_JS"></div>
90
+
91
+  <div id="ITP_POP_MSALESMNG02010_STORE_AREA" class="popup2 mobile-pop-close" style="display: none;">
92
+	<div class="pop">
93
+		<div class="header">
94
+			<div class="header_left">
95
+				<label>매장</label>
96
+			</div>
97
+			<div class="header_right">
98
+				<button type="button" id="ITP_BTN_MSALESMNG02010_POP_STORE_CLOSE"><img src="../img/close.png"></button>
99
+			</div>
100
+		</div>
101
+		<div class="search_bar">
102
+			<form id="ITP_FORM_MSALESMNG02010_POP_STORE" class="form-horizontal" onsubmit="return false;">
103
+				<input type="hidden" id="ITP_FORM_MSALESMNG02010_STORE_ITEM_BRAND_ID" name="brandId" value="">
104
+				<input type="hidden" id="ITP_FORM_MSALESMNG02010_STORE_ITEM_STORE_ID" name="storeId" value="">
105
+				<input id="ITP_FORM_MSALESMNG02010_POP_STORE_KEYWORD" type="text" name="storeNm" placeholder="매장명">
106
+				<button id="ITP_BTN_MSALESMNG02010_POP_STORE_SEARCH"><img src="../img/search.png"></button>
107
+			</form>
108
+		</div>
109
+		<div id="ITP_LIST_MSALESMNG02010_POP_STORE_AREA" class="popup_scroll">
110
+			<ul id="ITP_LIST_MSALESMNG02010_POP_STORE_ROWS" class="mb_0 panel-group itp_nav"></ul>
111
+			<div id="ITP_LIST_MSALESMNG02010_POP_STORE_ROWCOPY" style="display: none;">
112
+				<li class="row_2 item-row">
113
+					<div class="scroll_left">
114
+						<div class="con_2 fnStoreNm"></div>
115
+						<div class="con_2 wichi fnStoreStNm"></div>
116
+					</div>
117
+					<div class="scroll_right">
118
+						<button id="ITP_BTN_MSALESMNG02010_POP_STORE_CHOICE" class="fnStoreId" data-store-id="">선택</button>
119
+					</div>
120
+				</li>
121
+			</div>
122
+		</div>
123
+	</div>
124
+</div>
90 125
 </section>

+ 186 - 0
src/main/webapp/mobile/js/app/msalesmng/ITP_MSALESMNG02010.js

@@ -0,0 +1,186 @@
1
+require(['config'], function() {
2
+	require([
3
+	], function($) {
4
+		mobPageObj.init();
5
+	});
6
+});
7
+
8
+/*API URL*/
9
+const API_MOBILE_GRID_LIST 			= '/api/sale/mng/item-grid-list';	// 목록 
10
+
11
+const PAGE_MODE_LIST				= "LIST"; 
12
+
13
+let mobPageObj = {
14
+	viewMode: PAGE_MODE_LIST,
15
+	init: function () {		
16
+		// 조회일자 지정 
17
+		$('#ITP_MOBILE_MSALESMNG02010 .itp_input.date').datepicker(ITP_DATE_LANGUAGE);
18
+		$('#ITP_FORM_MSALESMNG02010_LIST_SEARCH_FROM_DT').datepicker('setDate', itp_fn_date_add('D', -7));
19
+		$('#ITP_FORM_MSALESMNG02010_LIST_SEARCH_TO_DT').datepicker('setDate', itp_fn_date_add('M', 0));
20
+		$('#ITP_FORM_MSALESMNG02010_LIST_SEARCH_BRAND_ID').val(fn_make_user_info.get('brandId')); 
21
+
22
+		$('button[id^="ITP_BTN_MSALESMNG02010_LIST"]').on('click', function() { 
23
+			switch ($(this).attr('id') ) {
24
+				case 'ITP_BTN_MSALESMNG02010_LIST_SEARCH_STORE_NN'	: 
25
+					mobContObj.popStoreNm.search(); 		
26
+					break; 
27
+				case 'ITP_BTN_MSALESMNG02010_LIST_DELETE_STORE_NN'	: 
28
+					$('#ITP_FORM_MSALESMNG02010_LIST_SEARCH_STORE_ID').val(''); 		
29
+					$('#ITP_FORM_MSALESMNG02010_LIST_SEARCH_STORE_NM').val(''); 		
30
+					break; 
31
+				case 'ITP_BTN_MSALESMNG02010_LIST_SEARCH': 
32
+					mobContObj.list.search();
33
+					break; 
34
+				default: break;
35
+			}
36
+			return false;
37
+		});
38
+		$('#ITP_BTN_MSALESMNG02010_DETAIL_CANCEL').on('click', ()=>$(location).attr('href', MOBILE_CONTEXTPATH + '/app/main.html') );
39
+		// 리스트 조회
40
+		mobContObj.list.init();
41
+	},	 
42
+	switchScreen: function(mode) {
43
+		$('#ITP_MOBILE_MSALESMNG02010').find('div[id$="_CONTAINER"]').each(function(i) {
44
+			$(this).hide();
45
+		});
46
+		if(mode === PAGE_MODE_LIST) {
47
+			$('#ITP_AJAX_MSALESMNG02010_LIST_CONTAINER').show();
48
+		}  
49
+		this.viewMode = mode;
50
+	}, 
51
+};
52
+
53
+let mobContObj = {
54
+	 
55
+    list: {
56
+		rows: [],
57
+        listPage: 0,
58
+		init: function() {
59
+			mobPageObj.switchScreen(PAGE_MODE_LIST);
60
+            this.search();
61
+		},
62
+		search: function() {
63
+			this.listPage = 1;
64
+			this.rows.length = 0;
65
+			$('#ITP_LIST_MSALESMNG02010_LIST_ITEM_ROWS').empty();
66
+			setTimeout(function() {
67
+				mobContObj.list.load();
68
+			}, 100);
69
+		},
70
+		pager: function(totPage) {
71
+			(this.listPage < totPage) ?
72
+				CommonObj.moreView('#ITP_LIST_MSALESMNG02010_LIST_ITEM_AREA', true, mobContObj.list.load) :
73
+				CommonObj.moreView('#ITP_LIST_MSALESMNG02010_LIST_ITEM_AREA', false);
74
+			this.listPage += 1;
75
+		},
76
+		load: function() {
77
+			var _this = this;
78
+			var callbackFn = function(result) { 
79
+				mobContObj.list.pager(result.gridTotal);                
80
+                const label=function(li, item, id, txt, color) {
81
+                    if(!txt) txt=item[id];
82
+                    var val=color? '<span style="color:'+color+'; font-weight:bold;">'+txt+'</span>': txt;
83
+                    li.find('.fn-'+id).html(val);
84
+                };
85
+                const blueLabel=function(li, item, id, txt) {
86
+                    label(li, item, id, txt, '#32e');  
87
+                };
88
+                const redLabel=function(li, item, id, txt) {
89
+                    label(li, item, id, txt, '#e32');
90
+                };
91
+				$.each(result.gridRows, function (i, item) {
92
+                    if(item.whsQty!='0') {
93
+                        $('#ITP_LIST_MSALESMNG02010_LIST_ITEM_AREA .panel-group').append($('#ITP_LIST_MSALESMNG02010_LIST_ITEM_ROWCOPY').html());
94
+                        var $li = $('#ITP_LIST_MSALESMNG02010_LIST_ITEM_AREA .panel-group > .item-row:last');
95
+                        label($li,item,'itemId'); blueLabel($li,item,'saleType',"구매");
96
+                        label($li,item,'itemNm');
97
+                        blueLabel($li,item,'whsQty', item.whsQty);
98
+                        blueLabel($li,item,'supplyAmt', CommonObj.currency.add(item.supplyAmt)); // 공급
99
+                        blueLabel($li,item,'storeAmt', CommonObj.currency.add(item.storeAmt));   // 판매
100
+                        blueLabel($li,item,'incomeAmt', CommonObj.currency.add(item.incomeAmt)); // 수익
101
+                    }
102
+                    if(item.whsQty1!='0') {
103
+                        $('#ITP_LIST_MSALESMNG02010_LIST_ITEM_AREA .panel-group').append($('#ITP_LIST_MSALESMNG02010_LIST_ITEM_ROWCOPY').html());
104
+                        var $li = $('#ITP_LIST_MSALESMNG02010_LIST_ITEM_AREA .panel-group > .item-row:last');
105
+                        label($li,item,'itemId'); redLabel($li,item,'saleType',"반품");
106
+                        label($li,item,'itemNm');
107
+                        redLabel($li,item,'whsQty', item.whsQty1);
108
+                        redLabel($li,item,'supplyAmt', CommonObj.currency.add(item.supplyAmt1)); // 공급
109
+                        redLabel($li,item,'storeAmt', CommonObj.currency.add(item.storeAmt1));   // 판매
110
+                        redLabel($li,item,'incomeAmt', CommonObj.currency.add(item.incomeAmt1)); // 수익
111
+                    }
112
+                    mobContObj.list.rows.push(item);
113
+					
114
+				});
115
+			};
116
+			const param = $('#ITP_FORM_MSALESMNG02010_LIST_SEARCH').serializeObject();
117
+			param.gridPage = mobContObj.list.listPage;
118
+			param.gridSize = mobile_list_size;
119
+			console.log(JSON.stringify(param));
120
+			fn_ajax_call(API_MOBILE_GRID_LIST, JSON.stringify(param), callbackFn, 'POST');
121
+		}, 
122
+	}, 
123
+    /* 팝업 */
124
+    show: function(popId) {
125
+		$('button[id$="_CLOSE"]').off('click').on('click', function() {
126
+			console.log($(this).attr('id'));
127
+			if($(this).hasClass('btn-pop-close')) {
128
+				mobContObj.hide(popId);
129
+			}
130
+		});
131
+		$('#' + popId).show();
132
+	},
133
+	hide: function(popId) {
134
+		$('#' + popId).closest('.mobile-pop-close').hide();
135
+	},
136
+    popStoreNm: {
137
+		popId: 'ITP_POP_MSALESMNG02010_STORE_AREA',
138
+		rows: [],
139
+		search: function () {
140
+			var self = this;
141
+			mobContObj.show(this.popId);
142
+			$('#ITP_LIST_MSALESMNG02010_POP_STORE_AREA .panel-group').empty();
143
+			$('#ITP_FORM_MSALESMNG02010_STORE_ITEM_BRAND_ID').val(fn_make_user_info.get('brandId')); 
144
+			const callbackFn = function(result) {
145
+				self.rows = result.gridRows;
146
+				for(var item of self.rows) { 
147
+					$('#ITP_LIST_MSALESMNG02010_POP_STORE_AREA .panel-group').append($('#ITP_LIST_MSALESMNG02010_POP_STORE_ROWCOPY').html());
148
+					var $li = $('#ITP_LIST_MSALESMNG02010_POP_STORE_AREA .panel-group > .row_2:last');
149
+					$li.find('.fnStoreNm').text(item.storeNm);
150
+					$li.find('.fnStoreStNm').text(item.storeStNm);
151
+					$li.find('.fnStoreId').data('store-id', item.storeId);
152
+				}
153
+				$('button[id^="ITP_BTN_MSALESMNG02010_POP_STORE"]').off('click').on('click', function() {
154
+					var id = $(this).attr('id');
155
+					switch (id) {
156
+						case 'ITP_BTN_MSALESMNG02010_POP_STORE_SEARCH'	: self.search();			break;
157
+						case 'ITP_BTN_MSALESMNG02010_POP_STORE_CHOICE'	: self.choice($(this)); 	break;
158
+						case 'ITP_BTN_MSALESMNG02010_POP_STORE_CLOSE'	: self.close(); 			break;
159
+					}
160
+					return false;
161
+				});
162
+			};
163
+			const param = $('#ITP_FORM_MSALESMNG02010_POP_STORE').serializeObject();
164
+			fn_ajax_call('/api/store/pop-grid-list', JSON.stringify(param), callbackFn, 'POST');
165
+		}, 
166
+		choice: function(elem) {
167
+			var _this = this;
168
+			var storeId = $(elem).data('store-id');
169
+			console.log("xxxxx choice xxxxx", storeId, this.rows)
170
+			$.each(this.rows, function (i, item) {
171
+				if(storeId === item.storeId) {
172
+					$('#ITP_FORM_MSALESMNG02010_LIST_SEARCH_STORE_ID').val(item.storeId);
173
+					$('#ITP_FORM_MSALESMNG02010_LIST_SEARCH_STORE_NM').val(item.storeNm);
174
+					_this.close();
175
+					return false;
176
+				}
177
+			});
178
+		}, 
179
+		close: function() { 
180
+			$('#ITP_FORM_MSALESMNG02010_POP_STORE #ITP_FORM_MSALESMNG02010_POP_STORE_KEYWORD').val('');
181
+			mobContObj.hide(this.popId);
182
+		}
183
+	},
184
+	
185
+};
186
+