Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/master'

zh 3 mesi fa
parent
commit
ee65b74065

+ 9 - 8
src/views/inventory/transfer/index.vue

@@ -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
   // 重新计算表格高度

+ 10 - 10
src/views/outbound/check/activity/index.vue

@@ -438,16 +438,16 @@ const packingRequests = async (startIndex = 0, lastNumber) => {
     reversePickingRef.value.show(successNumber.value,errorNumber.value,orderMap.value.cancelGroup,orderMap.value.freezeGroup)
     return
   }
+    const key = Object.keys(orderMap.value.dataGroup)[startIndex];
+    const list = orderMap.value.dataGroup[key] || [];
+    const groupDetailList = list.map(items => {
+      return {
+        lotNum: items.lotNum,
+        qty: items.quantity,
+      };
+    });
+    const item = list[0] || {};
   try {
-      const key = Object.keys(orderMap.value.dataGroup)[startIndex];
-      const list = orderMap.value.dataGroup[key] || [];
-      const groupDetailList = list.map(items => {
-        return {
-          lotNum: items.lotNum,
-          qty: items.quantity,
-        };
-      });
-      const item = list[0] || {};
       const data = {
         warehouse: item.warehouseId,
         workStation: item.warehouseId,
@@ -478,7 +478,7 @@ const packingRequests = async (startIndex = 0, lastNumber) => {
       }
   } catch (error) {
     errorNumber.value+=1
-    tips.value=error.message
+    tips.value=`错误信息: ${error.message} (订单号: ${item.orderNo || 'N/A'})`
     if(startIndex>0){
       reversePickingRef.value.show(successNumber.value,lastNumber-successNumber.value,orderMap.value.cancelGroup,orderMap.value.freezeGroup)
     }

+ 12 - 4
src/views/outbound/picking/task/index.vue

@@ -413,8 +413,12 @@ const  beforeClose= (action) =>
         showToast({duration:5000,message:'任务数量不能大于最大可生成数量'+modelCount.value})
         return resolve(false)
       }
-      if((model.value.type==='*' || model.value.type==='Y') && Number(count.value)>300){
-        showToast({duration:5000,message:'单次获取任务最大数量为:300'})
+      if((model.value.type==='*') && Number(count.value)>100){
+        showToast({duration:5000,message:'活动单获取任务最大数量为:100'})
+        return resolve(false)
+      }
+      if(( model.value.type==='Y') && Number(count.value)>300){
+        showToast({duration:5000,message:'单品单获取任务最大数量为:300'})
         return resolve(false)
       }
       if((model.value.type==='N') && Number(count.value)>60){
@@ -436,8 +440,12 @@ const onCountTask=()=>{
     showToast({duration:5000,message:'任务数量不能大于最大可生成数量'+modelCount.value})
     return
   }
-  if((model.value.type==='*' || model.value.type==='Y') && Number(count.value)>300){
-    showToast({duration:5000,message:'活动、单品-单次获取任务最大数量为:300'})
+  if((model.value.type==='*') && Number(count.value)>100){
+    showToast({duration:5000,message:'活动单次获取任务最大数量为:100'})
+    return
+  }
+  if((model.value.type==='Y') && Number(count.value)>300){
+    showToast({duration:5000,message:'单品单次获取任务最大数量为:300'})
     return
   }
   if((model.value.type==='N') && Number(count.value)>60){