|
@@ -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: {
|