Преглед изворни кода

모바일 디자인 적용

juney пре 2 година
родитељ
комит
18def8e795

+ 2 - 21
src/main/webapp/mobile/js/app/mpomng/ITP_MPOMNG02010.js

@@ -110,33 +110,14 @@ let mobPageObj = {
110 110
 				$('#ITP_FORM_MPOMNG02010_LIST_SEARCH #ITP_FORM_MPOMNG02010_LIST_SEARCH_WHS_NM').attr('readonly', true);
111 111
 				$('#ITP_FORM_MPOMNG02010_LIST_SEARCH #ITP_FORM_MPOMNG02010_LIST_SEARCH_WHS_ID').attr('disabled', true);
112 112
 			}
113
-			// this.moreView(true);
114 113
 		} else if(mode === VIEW_MODE_DETAIL) {
115 114
 			$('#ITP_AJAX_MPOMNG02010_VIEW_CONTAINER').show();
116
-			// this.moreView(false);
117 115
 		} else if(mode === VIEW_MODE_MODIFY) {
118 116
 			$('#ITP_AJAX_MPOMNG02010_MODIFY_CONTAINER').show();
119
-			// this.moreView(false);
120 117
 		}
121 118
 		CommonObj.moreView('#ITP_LIST_MPOMNG02010_ITEM_AREA', mode === VIEW_MODE_LIST, mobContentObj.list.load);
122 119
 		this.viewMode = mode;
123 120
 	},
124
-	moreView: function(isScroll) {
125
-		if(isScroll) {
126
-			$('#ITP_LIST_MPOMNG02010_ITEM_AREA').off('scroll').on('scroll', function () {
127
-				if($(this).scrollTop() + $(this).innerHeight() + 1 >= $(this)[0].scrollHeight) {
128
-					mobContentObj.list.load();
129
-					// if(mobContentObj.list.totPage > mobContentObj.list.listPage) {
130
-					// 	if(!mobContentObj.list.isSearch) {
131
-					// 		mobContentObj.list.load();
132
-					// 	}
133
-					// }
134
-				}
135
-			});
136
-		} else {
137
-			$('#ITP_LIST_MPOMNG02010_ITEM_AREA').off('scroll');
138
-		}
139
-	},
140 121
 	ready: function() {
141 122
 		mobContentObj.list.init();
142 123
 	}
@@ -159,7 +140,7 @@ let mobContentObj = {
159 140
 		load: function() {
160 141
 			var callbackFn = function(result) {
161 142
 				console.log(result);
162
-				if(result.gridPage >= result.gridTotal) {
143
+				if(mobContentObj.list.listPage >= result.gridTotal) {
163 144
 					CommonObj.moreView('#ITP_LIST_MPOMNG02010_ITEM_AREA', false);
164 145
 				}
165 146
 				$.each(result.gridRows, function (i, item) {
@@ -180,7 +161,7 @@ let mobContentObj = {
180 161
 				mobContentObj.list.action();
181 162
 			};
182 163
 			const param = $('#ITP_FORM_MPOMNG02010_LIST_SEARCH').serializeObject();
183
-			param.gridPage = ++this.listPage;
164
+			param.gridPage = ++mobContentObj.list.listPage;
184 165
 			param.gridSize = mobile_list_size;
185 166
 			fn_ajax_call(API_MOBILE_GRID_LIST, JSON.stringify(param), callbackFn, 'POST');
186 167
 		},

+ 9 - 32
src/main/webapp/mobile/js/app/mpomng/ITP_MPOMNG04010.js

@@ -36,7 +36,7 @@ let mobPageObj = {
36 36
 
37 37
 			// 조회일자 지정
38 38
 			$('#ITP_MOBILE_MPOMNG04010 .itp_input.date').datepicker(ITP_DATE_LANGUAGE);
39
-			$('#ITP_FORM_MPOMNG04010_LIST_SEARCH_FROM_DT').datepicker('setDate', itp_fn_date_add('M', 0));
39
+			$('#ITP_FORM_MPOMNG04010_LIST_SEARCH_FROM_DT').datepicker('setDate', itp_fn_date_add('M', -1));
40 40
 			$('#ITP_FORM_MPOMNG04010_LIST_SEARCH_TO_DT').datepicker('setDate', itp_fn_date_add('M', 1));
41 41
 
42 42
 			$('input:hidden[id$="_BRAND_ID"]').val(fn_make_user_info.get('brandId'));
@@ -88,29 +88,12 @@ let mobPageObj = {
88 88
 		});
89 89
 		if(mode === PAGE_MODE_LIST) {
90 90
 			$('#ITP_AJAX_MPOMNG04010_LIST_CONTAINER').show();
91
-			this.moreView(true);
92 91
 		} else if(mode === PAGE_MODE_VIEW) {
93 92
 			$('#ITP_AJAX_MPOMNG04010_VIEW_CONTAINER').show();
94
-			this.moreView(false);
95 93
 		}
94
+		CommonObj.moreView('#ITP_LIST_MPOMNG04010_LIST_ITEM_AREA', mode === PAGE_MODE_LIST, mobContentObj.list.load);
96 95
 		this.viewMode = mode;
97 96
 	},
98
-	moreView: function(isScroll) {
99
-		var _this = this;
100
-		if(isScroll) {
101
-			$('#ITP_LIST_MPOMNG04010_LIST_ITEM_AREA').on('scroll', function () {
102
-				if($(this).scrollTop() + $(this).innerHeight() + 1 >= $(this)[0].scrollHeight) {
103
-					if(mobContentObj.list.totPage > mobContentObj.list.listPage) {
104
-						if(!mobContentObj.list.isSearch) {
105
-							mobContentObj.list.load();
106
-						}
107
-					}
108
-				}
109
-			});
110
-		} else {
111
-			$('#ITP_LIST_MPOMNG04010_LIST_AREA').off('scroll');
112
-		}
113
-	},
114 97
 	ready: function() {
115 98
 		mobContentObj.list.init();
116 99
 	}
@@ -118,10 +101,7 @@ let mobPageObj = {
118 101
 
119 102
 let mobContentObj = {
120 103
 	list: {
121
-		listSize: 10,
122 104
 		listPage: 0,
123
-		totPage: 0,
124
-		isSearch: false,
125 105
 		rows: [],
126 106
 		init: function() {
127 107
 			mobPageObj.switchScreen(PAGE_MODE_LIST);
@@ -129,18 +109,17 @@ let mobContentObj = {
129 109
 		},
130 110
 		search: function() {
131 111
 			this.listPage = 0;
132
-			this.totPage = 0;
133 112
 			this.rows.length = 0;
134 113
 			$('#ITP_LIST_MPOMNG04010_LIST_ITEM_ROWS').empty();
135 114
 			this.load();
136 115
 		},
137 116
 		load: function() {
138 117
 			var _this = this;
139
-			this.isSearch = true;
140 118
 			var callbackFn = function(result) {
141 119
 				console.log(result);
142
-				_this.isSearch = false;
143
-				_this.totPage = result.gridTotal;
120
+				if(mobContentObj.list.listPage >= result.gridTotal) {
121
+					CommonObj.moreView('#ITP_LIST_MPOMNG04010_LIST_ITEM_AREA', false);
122
+				}
144 123
 				$.each(result.gridRows, function (i, item) {
145 124
 					$('#ITP_LIST_MPOMNG04010_LIST_ITEM_AREA .panel-group').append($('#ITP_LIST_MPOMNG04010_LIST_ITEM_ROWCOPY').html());
146 125
 					var $li = $('#ITP_LIST_MPOMNG04010_LIST_ITEM_AREA .panel-group > .list-row2:last');
@@ -152,15 +131,13 @@ let mobContentObj = {
152 131
 					$li.find('.fnItemQty').text($li.find('.fnItemQty').text().replace('$', item.podrItemQty));
153 132
 					$li.find('.fnPodrTotalAmt').text(CommonObj.comma.set(item.podrTotalAmt));
154 133
 					$li.find('.fnSpplyNm').text(item.spplyNm);
155
-					_this.rows.push(item);
134
+					mobContentObj.list.rows.push(item);
156 135
 				});
157 136
 			};
158
-			var errFn = function() { _this.isSearch = false;};
159 137
 			const param = $('#ITP_FORM_MPOMNG04010_LIST_SEARCH').serializeObject();
160
-			param.gridPage = ++this.listPage;
161
-			param.gridSize = this.listSize;
162
-			console.log(JSON.stringify(param));
163
-			fn_ajax_call(API_MOBILE_GRID_LIST, JSON.stringify(param), callbackFn, 'POST', errFn);
138
+			param.gridPage = ++mobContentObj.list.listPage;
139
+			param.gridSize = mobile_list_size;
140
+			fn_ajax_call(API_MOBILE_GRID_LIST, JSON.stringify(param), callbackFn, 'POST');
164 141
 		}
165 142
 	},
166 143
 	view: {

+ 2 - 2
src/main/webapp/mobile/js/app/mpomng/ITP_MPOMNG05010.js

@@ -36,7 +36,7 @@ let mobPageObj = {
36 36
 
37 37
 			// 조회일자 지정
38 38
 			$('#ITP_MOBILE_MPOMNG05010 .itp_input.date').datepicker(ITP_DATE_LANGUAGE);
39
-			$('#ITP_FORM_MPOMNG05010_LIST_SEARCH_FROM_DT').datepicker('setDate', itp_fn_date_add('M', 0));
39
+			$('#ITP_FORM_MPOMNG05010_LIST_SEARCH_FROM_DT').datepicker('setDate', itp_fn_date_add('M', -1));
40 40
 			$('#ITP_FORM_MPOMNG05010_LIST_SEARCH_TO_DT').datepicker('setDate', itp_fn_date_add('M', 1));
41 41
 		},
42 42
 		info: function() {
@@ -81,8 +81,8 @@ let mobPageObj = {
81 81
 		});
82 82
 		if(mode === PAGE_MODE_LIST) {
83 83
 			$('#ITP_AJAX_MPOMNG05010_LIST_CONTAINER').show();
84
-			this.moreView(true);
85 84
 		}
85
+		CommonObj.moreView('#ITP_LIST_MPOMNG04010_LIST_ITEM_AREA', mode === PAGE_MODE_LIST, mobContentObj.list.load);
86 86
 		this.viewMode = mode;
87 87
 	},
88 88
 	moreView: function(isScroll) {

+ 0 - 1
src/main/webapp/mobile/js/app/mpomng/ITP_MPOMNG07010.js

@@ -138,7 +138,6 @@ let mobContentObj = {
138 138
 					$li.find('.fnItemNm').text(item.itemNm);
139 139
 					$li.find('.fnDlvMgrNm').text(item.dlvMgrNm);
140 140
 					$li.find('.fnWhsCnfmNm').text(item.whsCnfmNm);
141
-					$li.find('.fnWhsNm').text(item.whsCnfmNm);
142 141
 					$li.find('.fnDlvReqDt').text(item.dlvReqDt);
143 142
 					$li.find('.fnDlvSchDt').text(item.dlvSchDt);
144 143
 					$li.find('.fnPodrQty').text(CommonObj.comma.set(item.podrQty) + ' ' + item.unit);