|
|
@@ -71,8 +71,10 @@
|
|
|
<uni-tr class="custom-table-head">
|
|
|
<uni-th align="center" width="80px">箱数</uni-th>
|
|
|
<uni-th align="center" width="80px">每箱数量</uni-th>
|
|
|
+ <uni-th align="center" width="80px">总数量</uni-th>
|
|
|
<uni-th align="center" width="140px">采购单号</uni-th>
|
|
|
<uni-th align="center" width="140px">物料编码</uni-th>
|
|
|
+ <uni-th align="center" width="140px">物料名称</uni-th>
|
|
|
<uni-th align="center" width="140px">送货批次</uni-th>
|
|
|
<uni-th align="center" width="180px">生产日期</uni-th>
|
|
|
</uni-tr>
|
|
|
@@ -80,14 +82,18 @@
|
|
|
<uni-tr v-for="(item, key) in scanParams.detail" :key="key">
|
|
|
<uni-td align="center"
|
|
|
:style="item.state? 'background-color: rgba(109, 205, 50, 1);color: white;': ''">
|
|
|
- <uni-easyinput v-model="item.bagQty" type="number" :input-border="false" placeholder="请输入箱数" />
|
|
|
+ <uni-easyinput v-model="item.bagQty" type="number" :input-border="false" placeholder="请输入箱数" @input="handleBagQtyChange" />
|
|
|
</uni-td>
|
|
|
<uni-td align="center"
|
|
|
:style="item.state? 'background-color: rgba(109, 205, 50, 1);color: white;': ''">{{ item.receiptQty }}</uni-td>
|
|
|
+ <uni-td align="center"
|
|
|
+ :style="item.state? 'background-color: rgba(109, 205, 50, 1);color: white;': ''">{{ calculateTotalQty(item) }}</uni-td>
|
|
|
<uni-td align="center"
|
|
|
:style="item.state? 'background-color: rgba(109, 205, 50, 1);color: white;': ''">{{ item.purchaseOrderNo }}</uni-td>
|
|
|
<uni-td align="center"
|
|
|
:style="item.state? 'background-color: rgba(109, 205, 50, 1);color: white;': ''">{{ item.materialNo }}</uni-td>
|
|
|
+ <uni-td align="center"
|
|
|
+ :style="item.state? 'background-color: rgba(109, 205, 50, 1);color: white;': ''">{{ item.name }}</uni-td>
|
|
|
<uni-td align="center"
|
|
|
:style="item.state? 'background-color: rgba(109, 205, 50, 1);color: white;': ''">{{ item.deliverBatch }}</uni-td>
|
|
|
<uni-td align="center"
|
|
|
@@ -182,6 +188,10 @@
|
|
|
// }) => {
|
|
|
// if (code === 0) {
|
|
|
// Object.assign(scanParams.value, data);
|
|
|
+ // // 给箱数补默认值
|
|
|
+ // scanParams.value.detail.forEach(item => {
|
|
|
+ // if (item.bagQty == null || item.bagQty === '') item.bagQty = 1
|
|
|
+ // })
|
|
|
// setInputFocus2();
|
|
|
// } else {
|
|
|
// // #ifdef APP-PLUS
|
|
|
@@ -215,8 +225,12 @@
|
|
|
msg
|
|
|
}) => {
|
|
|
if (code === 0) {
|
|
|
- Object.assign(scanParams.value, data)
|
|
|
- setInputFocus2()
|
|
|
+ Object.assign(scanParams.value, data)
|
|
|
+ // 给箱数补默认值
|
|
|
+ scanParams.value.detail.forEach(item => {
|
|
|
+ if (item.bagQty == null || item.bagQty === '') item.bagQty = 1
|
|
|
+ })
|
|
|
+ setInputFocus2()
|
|
|
} else {
|
|
|
// #ifdef APP-PLUS
|
|
|
plus.device.beep(2)
|
|
|
@@ -243,8 +257,12 @@
|
|
|
msg
|
|
|
}) => {
|
|
|
if (code === 0) {
|
|
|
- Object.assign(scanParams.value, data)
|
|
|
- setInputFocus2()
|
|
|
+ Object.assign(scanParams.value, data)
|
|
|
+ // 给箱数补默认值
|
|
|
+ scanParams.value.detail.forEach(item => {
|
|
|
+ if (item.bagQty == null || item.bagQty === '') item.bagQty = 1
|
|
|
+ })
|
|
|
+ setInputFocus2()
|
|
|
} else {
|
|
|
// #ifdef APP-PLUS
|
|
|
plus.device.beep(2)
|
|
|
@@ -462,13 +480,25 @@
|
|
|
}
|
|
|
|
|
|
// 关闭错误信息弹窗
|
|
|
- const handleCloseErrorTipsModal = async function() {
|
|
|
- errorTip.value.close()
|
|
|
- if (errorState.value === 0) {
|
|
|
- await setInputFocus()
|
|
|
- } else if (errorState.value === 1) {
|
|
|
- await setInputFocus2()
|
|
|
- }
|
|
|
+ const handleCloseErrorTipsModal = async function() {
|
|
|
+ errorTip.value.close()
|
|
|
+ if (errorState.value === 0) {
|
|
|
+ await setInputFocus()
|
|
|
+ } else if (errorState.value === 1) {
|
|
|
+ await setInputFocus2()
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 计算总数量
|
|
|
+ const calculateTotalQty = function(item) {
|
|
|
+ const bagQty = item.bagQty || 1
|
|
|
+ const receiptQty = item.receiptQty || 0
|
|
|
+ return bagQty * receiptQty
|
|
|
+ }
|
|
|
+
|
|
|
+ // 处理箱数变化
|
|
|
+ const handleBagQtyChange = function() {
|
|
|
+ // 当箱数变化时,Vue的响应式会自动触发calculateTotalQty的重新计算
|
|
|
}
|
|
|
|
|
|
// 禁用软键盘
|
|
|
@@ -523,7 +553,9 @@
|
|
|
confirmMaterial,
|
|
|
confirmDeliverOrderNo,
|
|
|
handleCloseErrorTipsModal,
|
|
|
- handleNavigateToRegisterRecord
|
|
|
+ handleNavigateToRegisterRecord,
|
|
|
+ calculateTotalQty,
|
|
|
+ handleBagQtyChange
|
|
|
}
|
|
|
}
|
|
|
})
|