|
|
@ -33,7 +33,7 @@ |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<!-- 物料信息卡片 --> |
|
|
<!-- 物料信息卡片 --> |
|
|
<div class="material-info-card" v-if="materialInfo.partNo"> |
|
|
|
|
|
|
|
|
<div class="material-info-card" v-if="materialInfo.inboundNo"> |
|
|
<div class="card-title"> |
|
|
<div class="card-title"> |
|
|
<span class="title-label">退货单号</span> |
|
|
<span class="title-label">退货单号</span> |
|
|
<span class="title-value">{{ materialInfo.inboundNo }}</span> |
|
|
<span class="title-value">{{ materialInfo.inboundNo }}</span> |
|
|
@ -240,27 +240,28 @@ export default { |
|
|
const params = { |
|
|
const params = { |
|
|
labelCode: labelCode, |
|
|
labelCode: labelCode, |
|
|
site: localStorage.getItem('site'), |
|
|
site: localStorage.getItem('site'), |
|
|
|
|
|
buNo: this.materialInfo.buNo |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
validateLabelWithSalesReturn(params).then(({ data }) => { |
|
|
validateLabelWithSalesReturn(params).then(({ data }) => { |
|
|
if (data && data.code === 0) { |
|
|
if (data && data.code === 0) { |
|
|
|
|
|
const resultList = data.data; |
|
|
// 检查是否已经扫描过 |
|
|
// 检查是否已经扫描过 |
|
|
const exists = this.labelList.find(item => item.labelCode === labelCode); |
|
|
const exists = this.labelList.find(item => item.labelCode === labelCode); |
|
|
if (exists) { |
|
|
if (exists) { |
|
|
this.$message.warning('该标签已扫描,请勿重复扫描'); |
|
|
this.$message.warning('该标签已扫描,请勿重复扫描'); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 添加到列表 |
|
|
|
|
|
this.labelList.push({ |
|
|
|
|
|
id: Date.now(), |
|
|
|
|
|
labelCode: labelCode, |
|
|
|
|
|
partNo: data.data.partNo, |
|
|
|
|
|
quantity: data.data.quantity, |
|
|
|
|
|
batchNo: data.data.batchNo |
|
|
|
|
|
|
|
|
// 将所有结果添加到列表 |
|
|
|
|
|
resultList.forEach(result => { |
|
|
|
|
|
this.labelList.push({ |
|
|
|
|
|
id: Date.now() + Math.random(), // 确保ID唯一 |
|
|
|
|
|
labelCode: result.labelCode, |
|
|
|
|
|
partNo: result.partNo, |
|
|
|
|
|
quantity: result.quantity, |
|
|
|
|
|
batchNo: result.batchNo |
|
|
|
|
|
}); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
this.$message.success('标签验证成功'); |
|
|
|
|
|
|
|
|
this.$message.success(`标签验证成功,共添加 ${resultList.length} 条记录`); |
|
|
} else { |
|
|
} else { |
|
|
this.$message.error(data.msg || '该标签不符合退货条件,请检查'); |
|
|
this.$message.error(data.msg || '该标签不符合退货条件,请检查'); |
|
|
} |
|
|
} |
|
|
@ -312,40 +313,29 @@ export default { |
|
|
this.$message.warning('请输入库位号'); |
|
|
this.$message.warning('请输入库位号'); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const params = { |
|
|
const params = { |
|
|
site:this.materialInfo.site, |
|
|
site:this.materialInfo.site, |
|
|
buNo: this.materialInfo.buNo, |
|
|
buNo: this.materialInfo.buNo, |
|
|
returnNo: this.returnNo, |
|
|
returnNo: this.returnNo, |
|
|
partNo: this.partNo, |
|
|
|
|
|
warehouseId: getCurrentWarehouse(), |
|
|
|
|
|
locationCode: this.locationCode.trim(), |
|
|
locationCode: this.locationCode.trim(), |
|
|
labels: this.labelList.map(label => ({ |
|
|
labels: this.labelList.map(label => ({ |
|
|
labelCode: label.labelCode, |
|
|
labelCode: label.labelCode, |
|
|
quantity: label.quantity, |
|
|
quantity: label.quantity, |
|
|
batchNo: label.batchNo |
|
|
|
|
|
|
|
|
batchNo: label.batchNo, |
|
|
|
|
|
partNo: label.partNo, |
|
|
})) |
|
|
})) |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
this.$confirm(`确定将标签退货到库位 ${this.locationCode} 吗?`, '确认退货', { |
|
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
|
type: 'info' |
|
|
|
|
|
}).then(() => { |
|
|
|
|
|
confirmSalesReturnStorage(params).then(({ data }) => { |
|
|
|
|
|
if (data && data.code === 0) { |
|
|
|
|
|
this.$message.success('退货成功'); |
|
|
|
|
|
this.showLocationDialog = false; |
|
|
|
|
|
this.$router.back(); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error(data.msg || '退货失败'); |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(error => { |
|
|
|
|
|
console.error('退货失败:', error); |
|
|
|
|
|
this.$message.error('退货失败'); |
|
|
|
|
|
}); |
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
// 用户取消 |
|
|
|
|
|
|
|
|
confirmSalesReturnStorage(params).then(({ data }) => { |
|
|
|
|
|
if (data && data.code === 0) { |
|
|
|
|
|
this.$message.success('退货成功'); |
|
|
|
|
|
this.showLocationDialog = false; |
|
|
|
|
|
this.$router.back(); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error(data.msg || '退货失败'); |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(error => { |
|
|
|
|
|
console.error('退货失败:', error); |
|
|
|
|
|
this.$message.error('退货失败'); |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
@ -421,12 +411,10 @@ export default { |
|
|
loadReturnDetails() { |
|
|
loadReturnDetails() { |
|
|
const params = { |
|
|
const params = { |
|
|
returnNo: this.returnNo, |
|
|
returnNo: this.returnNo, |
|
|
partNo: this.partNo, |
|
|
|
|
|
buNo: this.buNo, |
|
|
buNo: this.buNo, |
|
|
warehouseId: getCurrentWarehouse(), |
|
|
warehouseId: getCurrentWarehouse(), |
|
|
site:localStorage.getItem('site'), |
|
|
site:localStorage.getItem('site'), |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
getSalesReturnDetails(params).then(({ data }) => { |
|
|
getSalesReturnDetails(params).then(({ data }) => { |
|
|
if (data && data.code === 0) { |
|
|
if (data && data.code === 0) { |
|
|
this.materialInfo = data.data; |
|
|
this.materialInfo = data.data; |
|
|
@ -445,8 +433,7 @@ export default { |
|
|
this.returnNo = this.$route.params.returnNo; |
|
|
this.returnNo = this.$route.params.returnNo; |
|
|
this.partNo = this.$route.params.partNo; |
|
|
this.partNo = this.$route.params.partNo; |
|
|
this.buNo = this.$route.params.buNo; |
|
|
this.buNo = this.$route.params.buNo; |
|
|
if (!this.returnNo || !this.partNo) { |
|
|
|
|
|
this.$message.error('参数错误'); |
|
|
|
|
|
|
|
|
if (!this.returnNo ) { |
|
|
this.$router.back(); |
|
|
this.$router.back(); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|