|
|
@@ -58,7 +58,7 @@
|
|
|
<template #right-icon v-if="selectedProducts['id']">
|
|
|
<div class="quantity-display">
|
|
|
<span class="quantity-label">库存</span>
|
|
|
- <span class="quantity-value">{{ selectedProducts.quantityAvailable }}</span>
|
|
|
+ <span class="quantity-value">{{ selectedProducts.use }}</span>
|
|
|
<span class="quantity-label">件</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -146,12 +146,12 @@
|
|
|
<td class="location-cell">{{ product.location }}</td>
|
|
|
<td class="barcode-cell">{{ product.barcode }}</td>
|
|
|
<td class="quantity-cell">{{ product.quantity }}</td>
|
|
|
- <td class="quantity-cell">{{ product.qtyPreAllocated }}</td>
|
|
|
- <td class="quantity-cell">{{ product.quantityAvailable }}</td>
|
|
|
+ <td class="quantity-cell">{{ product.quantityAllocation }}</td>
|
|
|
+ <td class="quantity-cell">{{ product.use }}</td>
|
|
|
<td class="checkbox-cell">
|
|
|
<van-checkbox
|
|
|
:model-value="isSelected(product)"
|
|
|
- :disabled="product.quantityAvailable <= 0"
|
|
|
+ :disabled="product.use <= 0"
|
|
|
@update:model-value="onProductSelect(product)"
|
|
|
/>
|
|
|
</td>
|
|
|
@@ -241,6 +241,7 @@ const _handlerScan = (code) => {
|
|
|
if (res.data.length > 0) {
|
|
|
res.data.forEach((item, i) => {
|
|
|
item.id = i + 1
|
|
|
+ item.use=item.quantityVirtual+item.quantityAvailable
|
|
|
})
|
|
|
// 按照locationUsage排序:PC、CS、EA、RS、ST、SS,其他的放最后
|
|
|
const sortOrder = {
|
|
|
@@ -263,7 +264,7 @@ const _handlerScan = (code) => {
|
|
|
})
|
|
|
productList.value = res.data
|
|
|
// 查找第一个可用数量大于0的商品进行选中
|
|
|
- const firstAvailableProduct = productList.value.find(item => item.quantityAvailable > 0)
|
|
|
+ const firstAvailableProduct = productList.value.find(item => item.use > 0)
|
|
|
if (firstAvailableProduct) {
|
|
|
onProductSelect(firstAvailableProduct)
|
|
|
} else {
|
|
|
@@ -331,7 +332,7 @@ const onConfirm = () => {
|
|
|
showNotify({ type: 'warning', duration: 3000, message: `请先输入移库数量` })
|
|
|
return
|
|
|
}
|
|
|
- if (transferQuantity.value <= 0 || transferQuantity.value > selectedProducts.value.quantityAvailable) {
|
|
|
+ if (transferQuantity.value <= 0 || transferQuantity.value > selectedProducts.value.use) {
|
|
|
scanError()
|
|
|
countRef.value?.focus()
|
|
|
tips.value = '请先输入正确的移库数量'
|
|
|
@@ -421,7 +422,7 @@ const calculateTableHeight = () => {
|
|
|
|
|
|
const onProductSelect = (product) => {
|
|
|
// 如果可用数量为0,则不允许选择
|
|
|
- if (product.quantityAvailable <= 0) {
|
|
|
+ if (product.use <= 0) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
@@ -429,7 +430,7 @@ const onProductSelect = (product) => {
|
|
|
productBarcode.value = product.barcode
|
|
|
oldProductBarcode.value = product.barcode
|
|
|
// 选择商品时自动赋值移库数量
|
|
|
- transferQuantity.value = product.quantityAvailable
|
|
|
+ transferQuantity.value = product.use
|
|
|
sourceLocation.value = product.location
|
|
|
scanType.value = 4
|
|
|
// 重新计算表格高度
|