Selaa lähdekoodia

活动单-增加订单状态展示

zhaohuanhuan 7 kuukautta sitten
vanhempi
commit
bb79ec960a
1 muutettua tiedostoa jossa 49 lisäystä ja 12 poistoa
  1. 49 12
      src/views/outbound/check/activity/index.vue

+ 49 - 12
src/views/outbound/check/activity/index.vue

@@ -76,21 +76,23 @@
              <th style="width: 40%">商品条码</th>
              <th>数量</th>
              <th>剩余</th>
+             <th>状态</th>
              <th v-if="isUniqueCode">标记</th>
            </tr>
            </thead>
            <tbody>
-           <tr v-for="(item, index) in orderList" :key="index" v-if="orderList.length>0">
+           <tr v-for="(item, index) in orderList" :key="index" v-if="orderList.length>0"  :style="rowStyle(item)"  >
              <td>{{ item.barcode }} <van-tag type="success" v-if="item.universalCode">万用</van-tag></td>
              <td>{{item.qty}}/{{item.qtyOrdered}}</td>
              <td>{{ item.qty }}</td>
+             <td>{{ statusMap[item.status] || '' }}</td>
              <td v-if="isUniqueCode">
                <van-tag v-if="item.uniqueRegExp" type="warning" >唯一码</van-tag>
                <van-tag v-if="item.imeiRegExp" type="primary" >IMEI码</van-tag>
              </td>
            </tr>
            <tr v-else>
-             <td colspan="3">
+             <td colspan="4">
                <div>暂无数据</div>
              </td>
            </tr>
@@ -114,7 +116,7 @@
   </div>
 </template>
 <script setup>
-import { onMounted, onUnmounted, ref } from 'vue'
+import { computed, onMounted, onUnmounted, ref } from 'vue'
 import { androidFocus, getHeader, goBack, scanError, scanSuccess } from '@/utils/android'
 import { useStore } from '@/store/modules/user'
 import { closeListener, openListener, scanInit } from '@/utils/keydownListener'
@@ -143,6 +145,7 @@ onMounted(() => {
 })
 const warehouse = store.warehouse
 //收货容器号
+// JH-WH99-990
 const waveNo = ref('')
 const  isUniqueCode=ref(false)
 // 错误提示
@@ -163,7 +166,35 @@ const reversePickingContainerNo=containerNoMap[warehouse]
 const orderDetail=ref({})
 //订单详情
 const orderMap=ref({})
-const orderList=ref([])
+const dataList=ref([])
+const orderList = computed(() => {
+  return dataList.value
+    .sort((a, b) => {
+      const statusPriority = {
+        '60': 0,
+        '600': 1,
+        '50': 2,
+        '40': 3,
+        '30': 4,
+        '20': 5,
+        '00': 6,
+      }
+      if (statusPriority[a.status] !== statusPriority[b.status]) {
+        return statusPriority[a.status] - statusPriority[b.status]
+      }
+      return 0
+    })
+})
+const statusMap = {
+  '00': '创建',
+  '20': '预配',
+  '30': '部分分配',
+  '40': '已分配',
+  '50': '待拣货',
+  '60': '已拣货',
+  '61': '分拣完成',
+  '90': '订单取消',
+}
 //匹配条码
 const matchBarcodeList=ref([])
 const actions = [
@@ -186,12 +217,13 @@ const _handlerScan = (code) => {
     }
     const barcode = [...new Set(
       orderList.value
+        .filter(item => (item.status == '60'))
         .flatMap(item => [item.barcode, item.barcode2, item.sku, item.universalCode])
         .filter(value => value !== null && value !== '' && value !== undefined),
     )];
     const checkBarcode = barcodeToUpperCase(code);
     if (barcode.some(item => barcodeToUpperCase(item) === checkBarcode)) {
-      matchBarcodeList.value=orderList.value.filter(item=>((item.barcode===checkBarcode || item.sku===checkBarcode || item.barcode2===checkBarcode || item.universalCode==checkBarcode) && item.qty>0) )
+      matchBarcodeList.value=orderList.value.filter(item=>((item.barcode===checkBarcode || item.sku===checkBarcode || item.barcode2===checkBarcode || item.universalCode==checkBarcode) && item.status == '60'  && item.qty>0) )
       if(matchBarcodeList.value.length>0){
         const itemActive = matchBarcodeList.value[0]
         scanBarcode.value=code
@@ -236,7 +268,6 @@ const _handlerScan = (code) => {
           showNotify({ type: 'warning', duration: 3000, message: `商品条码${code},不匹配请重新扫描!`})
         }
       })
-
     }
   }
 }
@@ -297,7 +328,7 @@ const reset=()=>{
     totalWeight.value=''
     orderDetail.value={}
     orderMap.value={}
-    orderList.value=[]
+    dataList.value=[]
     matchBarcodeList.value=[]
     tips.value='请扫描商品条码'
     inputBarcodeRef.value?.show('', '请扫描波次/容器号', '')
@@ -362,7 +393,7 @@ const endCheck=()=>{
     const dataGroup = orderMap.value.dataGroup
     for (const order of Object.values(dataGroup)) {
       for (const item of order) {
-        if (item.qty !== 0) {
+        if (item.qty !== 0 && item.status=='60') {
           item.quantity = item.qty
           item.qty = 0
         }
@@ -403,6 +434,7 @@ const packingRequests = async (startIndex = 0, lastNumber) => {
         code: item.orderNo,
         totalGrossWeight:Number(totalWeight.value),
         groupDetailList,
+        activityOrderFlag:true
       };
         showLoadingToast({
           duration: 0,
@@ -475,10 +507,10 @@ const setBarcode = (code) => {
       orderDetail.value = res.data
       orderMap.value=getDataList(res.data.details)
       if(orderMap.value.dataGroup && Object.keys(orderMap.value.dataGroup).length>0){
-        orderList.value=orderMap.value.dataGroup[Object.keys(orderMap.value.dataGroup)[0]]
-        isUniqueCode.value = orderList.value.some(item => item.uniqueRegExp || item.imeiRegExp );
+        dataList.value=orderMap.value.dataGroup[Object.keys(orderMap.value.dataGroup)[0]]
+        isUniqueCode.value = dataList.value.some(item => item.uniqueRegExp || item.imeiRegExp );
       }else {
-        orderList.value=[]
+        dataList.value=[]
       }
       matchBarcodeList.value=[]
       scanBarcode.value=''
@@ -524,7 +556,12 @@ const getDataList = (data) => {
   });
   return groupedData
 };
-
+const rowStyle=( row )=>{
+  if(row.status!='60' ){
+    return { background: '#b3b3b3'}
+  }
+  return ''
+}
 
 //切换波次
 const _setWaveNo = () => {