diff --git a/src/views/modules/sales-return/salesReturnStorage.vue b/src/views/modules/sales-return/salesReturnStorage.vue index b94c64a..d0d9ea3 100644 --- a/src/views/modules/sales-return/salesReturnStorage.vue +++ b/src/views/modules/sales-return/salesReturnStorage.vue @@ -102,7 +102,16 @@
{{ labelList.length - index }}
{{ label.labelCode }}
{{ label.partNo }}
-
{{ label.quantity }}
+
+ +
@@ -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 {