Forráskód Böngészése

feat: 重构发货状态标签组件,使用send-status-tag组件替代原有标签

xieyong 1 hónapja
szülő
commit
15a6824a51

+ 2 - 31
src/views/beEntrusted/index.vue

@@ -70,36 +70,7 @@
         </template>
 
         <template v-slot:sendStatus="{ row }">
-          <el-tag v-if="row.sendStatus == 0 || !row.sendStatus">{{
-            '未收货'
-          }}</el-tag>
-          <el-tag v-else-if="row.sendStatus == 1" type="success">{{
-            '已发货'
-          }}</el-tag>
-          <el-tag v-else-if="row.sendStatus == 2" type="success">{{
-            '已收货'
-          }}</el-tag>
-          <el-tag v-else-if="row.sendStatus == 3" type="success">{{
-            '受托已发'
-          }}</el-tag>
-          <el-tag v-else-if="row.sendStatus == 4" type="success">{{
-            '请托已收'
-          }}</el-tag>
-          <el-tag v-else-if="row.sendStatus == 5" type="success">{{
-            '受托拒收'
-          }}</el-tag>
-          <el-tag v-else-if="row.sendStatus == 6" type="success">{{
-            '请托拒收'
-          }}</el-tag>
-          <el-tag v-else-if="row.sendStatus == 7" type="success">{{
-            '部分发货'
-          }}</el-tag>
-          <el-tag v-else-if="row.sendStatus == 8" type="success">{{
-            '部分收货'
-          }}</el-tag>
-          <el-tag v-else-if="row.sendStatus == 9" type="success">{{
-            '部分驳回'
-          }}</el-tag>
+          <send-status-tag :status="row.sendStatus" default-text="未收货" />
         </template>
 
         <template v-slot:approvalStatus="{ row }">
@@ -140,7 +111,7 @@
             @click="receiveGoos(row, 'send')"
             v-if="
               row.approvalStatus == 2 &&
-              (row.sendStatus == 3 || row.sendStatus == 4)
+              (row.sendStatus == 3 || row.sendStatus == 4 || row.sendStatus == 10)
             "
           >
             发货详情

+ 3 - 32
src/views/entrust/index.vue

@@ -29,36 +29,7 @@
         </template>
 
         <template v-slot:sendStatus="{ row }">
-          <el-tag v-if="row.sendStatus == 0 || !row.sendStatus">{{
-            '未发货'
-          }}</el-tag>
-          <el-tag v-else-if="row.sendStatus == 1" type="success">{{
-            '已发货'
-          }}</el-tag>
-          <el-tag v-else-if="row.sendStatus == 2" type="success">{{
-            '已收货'
-          }}</el-tag>
-          <el-tag v-else-if="row.sendStatus == 3" type="success">{{
-            '受托已发'
-          }}</el-tag>
-          <el-tag v-else-if="row.sendStatus == 4" type="success">{{
-            '请托已收'
-          }}</el-tag>
-          <el-tag v-else-if="row.sendStatus == 5" type="success">{{
-            '受托拒收'
-          }}</el-tag>
-          <el-tag v-else-if="row.sendStatus == 6" type="success">{{
-            '请托拒收'
-          }}</el-tag>
-          <el-tag v-else-if="row.sendStatus == 7" type="success">{{
-            '部分发货'
-          }}</el-tag>
-          <el-tag v-else-if="row.sendStatus == 8" type="success">{{
-            '部分收货'
-          }}</el-tag>
-          <el-tag v-else-if="row.sendStatus == 9" type="success">{{
-            '部分驳回'
-          }}</el-tag>
+          <send-status-tag :status="row.sendStatus" />
         </template>
 
         <template v-slot:approvalStatus="{ row }">
@@ -159,7 +130,7 @@
             type="primary"
             :underline="false"
             @click="sendGoods(row, 'receipt', 3)"
-            v-if="row.approvalStatus == 2 && row.sendStatus == 3"
+            v-if="row.approvalStatus == 2 && (row.sendStatus == 3 || row.sendStatus == 10 || row.sendStatus == 11)"
           >
             收货
           </el-link>
@@ -168,7 +139,7 @@
             type="primary"
             :underline="false"
             @click="sendGoods(row, 'receipt')"
-            v-if="row.approvalStatus == 2 && row.sendStatus == 4"
+            v-if="row.approvalStatus == 2 && (row.sendStatus == 4 || row.sendStatus == 11)"
           >
             收货详情
           </el-link>

+ 3 - 26
src/views/produce/components/outsourcing/details.vue

@@ -188,30 +188,7 @@
       </template>
 
       <template v-slot:sendStatus="{ row }">
-        <el-tag v-if="row.sendStatus == 0 || !row.sendStatus">{{
-          '未发货'
-        }}</el-tag>
-        <el-tag v-else-if="row.sendStatus == 1" type="success">{{
-          '已发货'
-        }}</el-tag>
-        <el-tag v-else-if="row.sendStatus == 2" type="success">{{
-          '已收货'
-        }}</el-tag>
-        <el-tag v-else-if="row.sendStatus == 3" type="success">{{
-          '受托已发'
-        }}</el-tag>
-        <el-tag v-else-if="row.sendStatus == 4" type="success">{{
-          '请托已收'
-        }}</el-tag>
-        <el-tag v-else-if="row.sendStatus == 7" type="success">{{
-          '部分发货'
-        }}</el-tag>
-        <el-tag v-else-if="row.sendStatus == 8" type="success">{{
-          '部分收货'
-        }}</el-tag>
-        <el-tag v-else-if="row.sendStatus == 9" type="success">{{
-          '部分驳回'
-        }}</el-tag>
+        <send-status-tag :status="row.sendStatus" />
       </template>
 
       <template v-slot:approvalStatus="{ row }">
@@ -285,7 +262,7 @@
           type="primary"
           :underline="false"
           @click="sendGoods(row, 'receipt', 3)"
-          v-if="row.approvalStatus == 2 && row.sendStatus == 3"
+          v-if="row.approvalStatus == 2 && (row.sendStatus == 3 || row.sendStatus == 10 || row.sendStatus == 11)"
         >
           收货
         </el-link>
@@ -294,7 +271,7 @@
           type="primary"
           :underline="false"
           @click="sendGoods(row, 'receipt')"
-          v-if="row.approvalStatus == 2 && row.sendStatus == 4"
+          v-if="row.approvalStatus == 2 && (row.sendStatus == 4 || row.sendStatus == 11)"
         >
           收货详情
         </el-link>