|
|
@ -1,6 +1,6 @@ |
|
|
<template> |
|
|
<template> |
|
|
<div> |
|
|
<div> |
|
|
<div class="pda-container"> |
|
|
|
|
|
|
|
|
<div class="pda-container" v-loading.fullscreen.lock="fullscreenLoading"> |
|
|
<div class="status-bar"> |
|
|
<div class="status-bar"> |
|
|
<div class="goBack" @click="handleBack"><i class="el-icon-arrow-left"></i>上一页</div> |
|
|
<div class="goBack" @click="handleBack"><i class="el-icon-arrow-left"></i>上一页</div> |
|
|
<div class="goBack">采购订单接收</div> |
|
|
<div class="goBack">采购订单接收</div> |
|
|
@ -32,16 +32,16 @@ |
|
|
<el-col :span="24"> |
|
|
<el-col :span="24"> |
|
|
<el-form-item label="商品描述"><span>{{ poDetail.description }}</span></el-form-item> |
|
|
<el-form-item label="商品描述"><span>{{ poDetail.description }}</span></el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="6"> |
|
|
|
|
|
|
|
|
<el-col :span="6" :class="{ mt10: getTextWidth(poDetail.description) > 34 }"> |
|
|
<el-form-item label="订单数量"><span>{{ poDetail.purchaseQty }}</span></el-form-item> |
|
|
<el-form-item label="订单数量"><span>{{ poDetail.purchaseQty }}</span></el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="6"> |
|
|
|
|
|
|
|
|
<el-col :span="6" :class="{ mt10: getTextWidth(poDetail.description) > 34 }"> |
|
|
<el-form-item label="待收数量"><span>{{ poDetail.qtyToReceive }}</span></el-form-item> |
|
|
<el-form-item label="待收数量"><span>{{ poDetail.qtyToReceive }}</span></el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="6"> |
|
|
|
|
|
<el-form-item label="此次接收数量"><span>{{ poDetail.thisRecvQty }}</span></el-form-item> |
|
|
|
|
|
|
|
|
<el-col :span="6" :class="{ mt10: getTextWidth(poDetail.description) > 34 }"> |
|
|
|
|
|
<el-form-item label="此次接收数量"><span>{{ poDetail.invQtyToReceive }}</span></el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="6" > |
|
|
|
|
|
|
|
|
<el-col :span="6" :class="{ mt10: getTextWidth(poDetail.description) > 34 }"> |
|
|
<el-form-item style="margin-left: 20px" label="单位"><span>{{ poDetail.purchaseUOM }}</span></el-form-item> |
|
|
<el-form-item style="margin-left: 20px" label="单位"><span>{{ poDetail.purchaseUOM }}</span></el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
</el-row> |
|
|
</el-row> |
|
|
@ -126,7 +126,8 @@ export default { |
|
|
recvItem: {}, |
|
|
recvItem: {}, |
|
|
handlingUnit: [], |
|
|
handlingUnit: [], |
|
|
hanlingItem: { code: '', qty: '', perQty: '', packageQty: '' }, |
|
|
hanlingItem: { code: '', qty: '', perQty: '', packageQty: '' }, |
|
|
site:localStorage.getItem('site') |
|
|
|
|
|
|
|
|
site:localStorage.getItem('site'), |
|
|
|
|
|
fullscreenLoading: false // 控制全屏loading |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
|
@ -143,6 +144,20 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
// 计算“显示宽度” |
|
|
|
|
|
getTextWidth(text) { |
|
|
|
|
|
if (!text) return 0 |
|
|
|
|
|
let len = 0 |
|
|
|
|
|
for (let char of text) { |
|
|
|
|
|
// 中文、全角符号 |
|
|
|
|
|
if (/[\u4e00-\u9fa5\u3000-\u303F\uFF00-\uFFEF]/.test(char)) { |
|
|
|
|
|
len += 2 |
|
|
|
|
|
} else { |
|
|
|
|
|
len += 1 |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return len |
|
|
|
|
|
}, |
|
|
handleBack() { |
|
|
handleBack() { |
|
|
if (this.processFlag === 1) this.$router.back(); |
|
|
if (this.processFlag === 1) this.$router.back(); |
|
|
else if (this.processFlag === 3) this.processFlag = 2; |
|
|
else if (this.processFlag === 3) this.processFlag = 2; |
|
|
@ -168,8 +183,8 @@ export default { |
|
|
this.recvItem = { |
|
|
this.recvItem = { |
|
|
...row, |
|
|
...row, |
|
|
poNo: row.poNumber || this.scanCode, |
|
|
poNo: row.poNumber || this.scanCode, |
|
|
dueinQty: row.qtyToReceive || row.thisRecvQty, |
|
|
|
|
|
transQty: row.thisRecvQty || 0 |
|
|
|
|
|
|
|
|
dueinQty: row.qtyToReceive || row.invQtyToReceive, |
|
|
|
|
|
transQty: row.invQtyToReceive || 0 |
|
|
}; |
|
|
}; |
|
|
this.processFlag = 2; |
|
|
this.processFlag = 2; |
|
|
}, |
|
|
}, |
|
|
@ -194,8 +209,11 @@ export default { |
|
|
localStorage.setItem(this.huKey, JSON.stringify(this.handlingUnit)); |
|
|
localStorage.setItem(this.huKey, JSON.stringify(this.handlingUnit)); |
|
|
}, |
|
|
}, |
|
|
receivePo() { |
|
|
receivePo() { |
|
|
|
|
|
if (this.fullscreenLoading) return; // 防止重复点 |
|
|
|
|
|
this.fullscreenLoading = true; |
|
|
const item = this.recvItem; |
|
|
const item = this.recvItem; |
|
|
if (!item.transQty || !item.locationNo || !item.batchNo) { |
|
|
if (!item.transQty || !item.locationNo || !item.batchNo) { |
|
|
|
|
|
this.fullscreenLoading = false; |
|
|
return this.$message.error("请填写完整信息"); |
|
|
return this.$message.error("请填写完整信息"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -213,16 +231,17 @@ export default { |
|
|
poNo: item.poNumber || item.poNo, |
|
|
poNo: item.poNumber || item.poNo, |
|
|
orderNo: item.orderNo, |
|
|
orderNo: item.orderNo, |
|
|
lineNo: item.lineNo, |
|
|
lineNo: item.lineNo, |
|
|
relNo: item.relNo, |
|
|
|
|
|
|
|
|
releaseNo: item.releaseNo, |
|
|
receiptNo: item.receiptNo, |
|
|
receiptNo: item.receiptNo, |
|
|
orderRef1: item.orderNo, |
|
|
orderRef1: item.orderNo, |
|
|
|
|
|
supplierNo: item.supplierNo, |
|
|
|
|
|
purchaseUOM: item.purchaseUOM, |
|
|
|
|
|
receiveCase: item.receiveCase, |
|
|
|
|
|
receiveCaseDB: item.receiveCaseDB, |
|
|
// 业务控制字段 |
|
|
// 业务控制字段 |
|
|
needHandlingUnit: item.needHandlingUnit || 'N', |
|
|
|
|
|
needCheck: item.needCheck || 'N', |
|
|
|
|
|
warehouseType: item.warehouseType || 'MANUAL', |
|
|
|
|
|
needPallet: item.needPallet || 'N', |
|
|
|
|
|
workshopFlag: item.workshopFlag || 'N', |
|
|
|
|
|
cuttingFlag: item.cuttingFlag || 'N', |
|
|
|
|
|
|
|
|
needHandlingUnit: item.needHandlingUnit , |
|
|
|
|
|
needCheck: item.needCheck , |
|
|
|
|
|
warehouseType: item.warehouseType , |
|
|
// 日期字段 |
|
|
// 日期字段 |
|
|
manufactureDate: item.manufactureDate, |
|
|
manufactureDate: item.manufactureDate, |
|
|
// 处理单元列表 |
|
|
// 处理单元列表 |
|
|
@ -231,7 +250,6 @@ export default { |
|
|
packageQty: 1 |
|
|
packageQty: 1 |
|
|
})) : [] |
|
|
})) : [] |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
receivePo(receiveData).then(({ data }) => { |
|
|
receivePo(receiveData).then(({ data }) => { |
|
|
if (data.code === 0) { |
|
|
if (data.code === 0) { |
|
|
this.$message.success("操作成功"); |
|
|
this.$message.success("操作成功"); |
|
|
@ -247,6 +265,8 @@ export default { |
|
|
}).catch(error => { |
|
|
}).catch(error => { |
|
|
console.error('接收失败:', error); |
|
|
console.error('接收失败:', error); |
|
|
this.$message.error('网络错误,请重试'); |
|
|
this.$message.error('网络错误,请重试'); |
|
|
|
|
|
}).finally(() => { |
|
|
|
|
|
this.fullscreenLoading = false; // 结束后关闭loading |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
@ -257,6 +277,9 @@ export default { |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<style scoped> |
|
|
<style scoped> |
|
|
|
|
|
.mt10 { |
|
|
|
|
|
margin-top: 10px; |
|
|
|
|
|
} |
|
|
.scan-box input { |
|
|
.scan-box input { |
|
|
width: 100%; |
|
|
width: 100%; |
|
|
padding: 12px; |
|
|
padding: 12px; |
|
|
|