|
@@ -79,18 +79,8 @@ let mobPageObj = {
|
79
|
79
|
|
80
|
80
|
let mobContObj = {
|
81
|
81
|
init: function() {
|
82
|
|
- this.button();
|
83
|
82
|
this.data.load();
|
84
|
83
|
},
|
85
|
|
- button: function() {
|
86
|
|
- var _this = this;
|
87
|
|
- $(document).on('click', '.DETAIL_ITEM_PLUS', function() {
|
88
|
|
- _this.list.actPlus($(this));
|
89
|
|
- });
|
90
|
|
- $(document).on('click', '.DETAIL_ITEM_MINUS', function() {
|
91
|
|
- _this.list.actMinus($(this));
|
92
|
|
- });
|
93
|
|
- },
|
94
|
84
|
data: {
|
95
|
85
|
initPchReq: null,
|
96
|
86
|
load: function() {
|
|
@@ -138,6 +128,9 @@ let mobContObj = {
|
138
|
128
|
$li.find('.fnItemNm').text(item.itemNm);
|
139
|
129
|
$li.find('.fnPchReqQty').text(item.pchReqQty);
|
140
|
130
|
$li.find('.fnUnitAmt').text(CommonObj.currency.add(item.unitAmt));
|
|
131
|
+ $li.find('.fnOrdAmt').text(CommonObj.currency.add(Number(item.unitAmt) * Number(item.pchReqQty)));
|
|
132
|
+ $('.list-row #ITP_BTN_MRTNMNG01010_DETAIL_PLUS')[$li.index()].addEventListener('click', function() { _this.actPlus(this); });
|
|
133
|
+ $('.list-row #ITP_BTN_MRTNMNG01010_DETAIL_MINUS')[$li.index()].addEventListener('click', function() { _this.actMinus(this); });
|
141
|
134
|
_this.pchReqAmtTot();
|
142
|
135
|
}
|
143
|
136
|
});
|
|
@@ -162,11 +155,20 @@ let mobContObj = {
|
162
|
155
|
}
|
163
|
156
|
},
|
164
|
157
|
actPlus: function(elem) {
|
165
|
|
- var $div = $(elem).siblings('div');
|
166
|
|
- var num = Number($div.text());
|
167
|
|
- $($div).text((num + 1).toString());
|
168
|
|
- this.rows[$div.parents('li').index()]['pchReqQty'] = $($div).text();
|
|
158
|
+ var $li = $(elem).closest('li');
|
|
159
|
+ var num = Number($li.find('.fnPchReqQty').text());
|
|
160
|
+ var calcNum = num + 1;
|
|
161
|
+ $($li).find('.fnPchReqQty').text(calcNum.toString());
|
|
162
|
+ this.rows[$li.index()]['pchReqQty'] = calcNum;
|
|
163
|
+ this.pchReqAmtUnit(elem, calcNum);
|
169
|
164
|
this.pchReqAmtTot();
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+ // var $div = $(elem).siblings('div');
|
|
168
|
+ // var num = Number($div.text());
|
|
169
|
+ // $($div).text((num + 1).toString());
|
|
170
|
+ // this.rows[$div.parents('li').index()]['pchReqQty'] = $($div).text();
|
|
171
|
+ // this.pchReqAmtTot();
|
170
|
172
|
},
|
171
|
173
|
actMinus: function(elem) {
|
172
|
174
|
var $div = $(elem).siblings('div');
|
|
@@ -176,8 +178,26 @@ let mobContObj = {
|
176
|
178
|
} else {
|
177
|
179
|
$($div).text((num - 1).toString());
|
178
|
180
|
this.rows[$div.parents('li').index()]['pchReqQty'] = $($div).text();
|
|
181
|
+ this.pchReqAmtUnit(elem, $($div).text());
|
179
|
182
|
this.pchReqAmtTot();
|
180
|
183
|
}
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+ // var $div = $(elem).siblings('div');
|
|
188
|
+ // var num = Number($div.text());
|
|
189
|
+ // if(num <= 1) {
|
|
190
|
+ // itp_fn_modal_alert('수량을 확인하세요.');
|
|
191
|
+ // } else {
|
|
192
|
+ // $($div).text((num - 1).toString());
|
|
193
|
+ // this.rows[$div.parents('li').index()]['pchReqQty'] = $($div).text();
|
|
194
|
+ // this.pchReqAmtTot();
|
|
195
|
+ // }
|
|
196
|
+ },
|
|
197
|
+ pchReqAmtUnit: function(elem, qty) {
|
|
198
|
+ var $div = $(elem).parent().prev();
|
|
199
|
+ var unitAmt = CommonObj.onlyNumber($div.find('.fnUnitAmt').text());
|
|
200
|
+ $div.find('.fnOrdAmt').text(CommonObj.currency.add(Number(unitAmt ? unitAmt : 0) * Number(qty)));
|
181
|
201
|
},
|
182
|
202
|
pchReqAmtTot: function() {
|
183
|
203
|
var reqAmt = 0;
|
|
@@ -206,6 +226,7 @@ let mobPopObj = {
|
206
|
226
|
popItem: {
|
207
|
227
|
// rows: null,
|
208
|
228
|
init: function() {
|
|
229
|
+ $('#ITP_POP_MRTNMNG01010_ITEM_AREA #ITP_FORM_MRTNMNG01010_POP_ITEM_KEYWORD').val('');
|
209
|
230
|
this.search();
|
210
|
231
|
},
|
211
|
232
|
search: function() {
|