|
@@ -84,6 +84,11 @@ |
|
@@ -84,6 +84,11 @@ |
|
84
|
<uni-easyinput v-model="item.quantity" type="number" :inputBorder="false" disabled placeholder="不可编辑" />
|
84
|
<uni-easyinput v-model="item.quantity" type="number" :inputBorder="false" disabled placeholder="不可编辑" />
|
|
85
|
</template>
|
85
|
</template>
|
|
86
|
</uni-list-item>
|
86
|
</uni-list-item>
|
|
|
|
87
|
+ <uni-list-item title="本次锁价数量">
|
|
|
|
88
|
+ <template v-slot:footer>
|
|
|
|
89
|
+ <uni-easyinput v-model="item.currentQuantity" type="number" :inputBorder="false" placeholder="请输入本次锁价数量" @input="onImmediateChange(idx)" @blur="onNumberBlur(idx, 'currentQuantity', 3)" />
|
|
|
|
90
|
+ </template>
|
|
|
|
91
|
+ </uni-list-item>
|
|
87
|
<uni-list-item title="单价">
|
92
|
<uni-list-item title="单价">
|
|
88
|
<template v-slot:footer>
|
93
|
<template v-slot:footer>
|
|
89
|
<uni-easyinput v-model="item.unitPrice" type="digit" :inputBorder="false" placeholder="请输入单价" @input="onImmediateChange(idx)" @blur="onNumberBlur(idx, 'unitPrice', 0)" />
|
94
|
<uni-easyinput v-model="item.unitPrice" type="digit" :inputBorder="false" placeholder="请输入单价" @input="onImmediateChange(idx)" @blur="onNumberBlur(idx, 'unitPrice', 0)" />
|
|
@@ -243,6 +248,7 @@ export default { |
|
@@ -243,6 +248,7 @@ export default { |
|
243
|
materialCode: v.materialCode || '',
|
248
|
materialCode: v.materialCode || '',
|
|
244
|
status: v.status || '',
|
249
|
status: v.status || '',
|
|
245
|
quantity: v.productQuantity || v.quantity || '',
|
250
|
quantity: v.productQuantity || v.quantity || '',
|
|
|
|
251
|
+ currentQuantity: v.currentQuantity === 0 ? 0 : (v.currentQuantity || ''),
|
|
246
|
unitPrice: v.unitPrice || '',
|
252
|
unitPrice: v.unitPrice || '',
|
|
247
|
amountExcludingTax: v.amountExcludingTax || 0,
|
253
|
amountExcludingTax: v.amountExcludingTax || 0,
|
|
248
|
totalAmount: v.totalAmount || 0,
|
254
|
totalAmount: v.totalAmount || 0,
|
|
@@ -322,6 +328,7 @@ export default { |
|
@@ -322,6 +328,7 @@ export default { |
|
322
|
this.items = this.items.map((it, i) => ({
|
328
|
this.items = this.items.map((it, i) => ({
|
|
323
|
...it,
|
329
|
...it,
|
|
324
|
quantity: '',
|
330
|
quantity: '',
|
|
|
|
331
|
+ currentQuantity: '',
|
|
325
|
unitPrice: '',
|
332
|
unitPrice: '',
|
|
326
|
amountExcludingTax: 0
|
333
|
amountExcludingTax: 0
|
|
327
|
}))
|
334
|
}))
|
|
@@ -330,11 +337,13 @@ export default { |
|
@@ -330,11 +337,13 @@ export default { |
|
330
|
const selected = this.items.filter(it => it.locked).map(it => {
|
337
|
const selected = this.items.filter(it => it.locked).map(it => {
|
|
331
|
const raw = { ...(it.raw || {}) }
|
338
|
const raw = { ...(it.raw || {}) }
|
|
332
|
const qty = this.toNumber(it.quantity)
|
339
|
const qty = this.toNumber(it.quantity)
|
|
|
|
340
|
+ const curQtyRaw = it.currentQuantity
|
|
333
|
const price = this.toNumber(it.unitPrice)
|
341
|
const price = this.toNumber(it.unitPrice)
|
|
334
|
const total = this.toNumber(it.totalAmount)
|
342
|
const total = this.toNumber(it.totalAmount)
|
|
335
|
const excl = this.toNumber(it.amountExcludingTax)
|
343
|
const excl = this.toNumber(it.amountExcludingTax)
|
|
336
|
if (Object.prototype.hasOwnProperty.call(raw, 'productQuantity')) raw.productQuantity = qty
|
344
|
if (Object.prototype.hasOwnProperty.call(raw, 'productQuantity')) raw.productQuantity = qty
|
|
337
|
else raw.quantity = qty
|
345
|
else raw.quantity = qty
|
|
|
|
346
|
+ raw.currentQuantity = (curQtyRaw === '' || curQtyRaw === null || curQtyRaw === undefined) ? null : this.toNumber(curQtyRaw)
|
|
338
|
raw.unitPrice = price
|
347
|
raw.unitPrice = price
|
|
339
|
raw.totalAmount = total
|
348
|
raw.totalAmount = total
|
|
340
|
raw.amountExcludingTax = excl
|
349
|
raw.amountExcludingTax = excl
|
|
@@ -352,6 +361,14 @@ export default { |
|
@@ -352,6 +361,14 @@ export default { |
|
352
|
uni.showToast({ title: '请填写单价', icon: 'none' })
|
361
|
uni.showToast({ title: '请填写单价', icon: 'none' })
|
|
353
|
return
|
362
|
return
|
|
354
|
}
|
363
|
}
|
|
|
|
364
|
+ const invalidQty = selected.find(r => {
|
|
|
|
365
|
+ const q = this.toNumber(r.currentQuantity)
|
|
|
|
366
|
+ return !(q > 0)
|
|
|
|
367
|
+ })
|
|
|
|
368
|
+ if (invalidQty) {
|
|
|
|
369
|
+ uni.showToast({ title: '请填写本次锁价数量', icon: 'none' })
|
|
|
|
370
|
+ return
|
|
|
|
371
|
+ }
|
|
355
|
this.selectedItems = selected
|
372
|
this.selectedItems = selected
|
|
356
|
const payload = {
|
373
|
const payload = {
|
|
357
|
id: this.id,
|
374
|
id: this.id,
|
|
@@ -768,4 +785,4 @@ export default { |
|
@@ -768,4 +785,4 @@ export default { |
|
768
|
height: 60rpx;
|
785
|
height: 60rpx;
|
|
769
|
align-items: center;
|
786
|
align-items: center;
|
|
770
|
}
|
787
|
}
|
|
771
|
-</style> |
|
|
|
|
|
788
|
+</style> |