Browse Source

2026-10-21

优化
master
fengyuan_yang 1 month ago
parent
commit
165f9a9a30
  1. 68
      src/views/modules/sales-return/salesReturnStorage.vue

68
src/views/modules/sales-return/salesReturnStorage.vue

@ -102,7 +102,16 @@
<div class="col-no">{{ labelList.length - index }}</div>
<div class="col-label">{{ label.labelCode }}</div>
<div class="col-part">{{ label.partNo }}</div>
<div class="col-qty">{{ label.quantity }}</div>
<div class="col-qty">
<input
type="number"
v-model.number="label.quantity"
class="qty-input"
min="0"
@focus="$event.target.select()"
@click.stop
/>
</div>
</div>
<!-- 空状态 -->
@ -366,8 +375,16 @@ export default {
// 确认退货
confirmReturn() {
if (this.labelList.length === 0) {
this.$message.warning('请先扫描标签');
return;
this.$message.warning('请先扫描标签')
return
}
const invalidLabel = this.labelList.find(item => {
const qty = Number(item.quantity)
return item.quantity === '' || item.quantity === null || item.quantity === undefined || Number.isNaN(qty) || qty <= 0
})
if (invalidLabel) {
this.$message.warning('标签 ' + (invalidLabel.labelCode || '') + ' 的数量必须大于0')
return
}
// 显示库位号输入对话框
@ -401,7 +418,11 @@ export default {
site:this.materialInfo.site,
buNo: this.materialInfo.buNo,
returnNo: this.returnNo,
locationCode: this.locationCode.trim()
locationCode: this.locationCode.trim(),
labels: this.labelList.map(item => ({
rollNo: item.labelCode,
quantity: item.quantity
}))
};
this.submitLoading = true;
confirmSalesReturnStorage(params).then(({ data }) => {
@ -430,11 +451,19 @@ export default {
getScannedLabelList(params).then(({ data }) => {
if (data && data.code === 0) {
const labelData = data.data || [];
const editedQtyMap = {}
;(this.labelList || []).forEach(item => {
if (item && item.labelCode) {
editedQtyMap[item.labelCode] = item.quantity
}
})
this.labelList = labelData.map((item, index) => ({
id: Date.now() + index,
labelCode: item.labelCode,
partNo: item.partNo,
quantity: item.quantity,
quantity: Object.prototype.hasOwnProperty.call(editedQtyMap, item.labelCode)
? editedQtyMap[item.labelCode]
: item.quantity,
batchNo: item.batchNo || ''
}));
} else {
@ -997,9 +1026,34 @@ export default {
}
.col-qty {
width: 60px;
width: 80px;
text-align: right;
padding-right: 12px;
padding-right: 8px;
}
.qty-input {
width: 100%;
height: 28px;
padding: 0 6px;
border: 1px solid #dcdfe6;
border-radius: 4px;
font-size: 12px;
text-align: right;
outline: none;
box-sizing: border-box;
-webkit-appearance: none;
-moz-appearance: textfield;
}
.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
.qty-input:focus {
border-color: #17B3A3;
background-color: #f0f9ff;
}
.col-action {

Loading…
Cancel
Save