瀏覽代碼

始宁农业管理后台:农产品上架申请

panyong 2 年之前
父節點
當前提交
fc1254bf7f
共有 1 個文件被更改,包括 24 次插入31 次删除
  1. 24 31
      htmldev/shiningManage/src/views/productManage/toBeReviewed/index.vue

+ 24 - 31
htmldev/shiningManage/src/views/productManage/toBeReviewed/index.vue

@@ -27,11 +27,11 @@
           <el-select
             clearable
             placeholder="请选择审核状态"
-            v-model="searchForm.product_status">
+            v-model="searchForm.product_check_status">
             <el-option
               :label="item.name"
               :value="item.value"
-              v-for="item in arrProductStatus"
+              v-for="item in arrProductCheckStatus"
               :key="item.value"></el-option>
           </el-select>
         </el-form-item>
@@ -122,8 +122,8 @@
       <el-table-column label="店铺名称" prop="shop_name" min-width="160" show-overflow-tooltip>
         <template slot-scope="scope">{{ scope.row.shop_name }}</template>
       </el-table-column>
-      <el-table-column label="审核状态" prop="product_status" min-width="100">
-        <template slot-scope="scope">{{ getStatusTextAndColor(scope.row).product_status_text }}</template>
+      <el-table-column label="审核状态" prop="product_check_status" min-width="100">
+        <template slot-scope="scope">{{ getText(arrProductCheckStatus, scope.row.product_check_status + '') }}</template>
       </el-table-column>
       <el-table-column label="申请时间" prop="created_at" min-width="160"></el-table-column>
       <el-table-column label="审核人" prop="product_check_name" min-width="80"></el-table-column>
@@ -183,8 +183,21 @@ export default {
     arrProductSaleType() {
       return this.$store.state.common.arrProductSaleType
     },
-    arrProductStatus() {
-      return this.$store.state.common.arrProductStatus
+    arrProductCheckStatus() {
+      return [
+        {
+          name: '未审核',
+          value: '0'
+        },
+        {
+          name: '审核成功',
+          value: '1'
+        },
+        {
+          name: '审核失败',
+          value: '2'
+        }
+      ]
     }
   },
   methods: {
@@ -192,32 +205,12 @@ export default {
       this.detailsDialog.exData = row
       this.detailsDialog.show = true
     },
-    getStatusTextAndColor(row) {
-      // product_check_status 0未审核 1审核成功 2审核失败
-      // product_status 0 未上架 1 上架
-
-      const productStatus = row.product_status
-      const productCheckStatus = row.product_check_status
-      let color = 'col-0'
-      let text = ''
-
-      if (productCheckStatus === 0) {
-        color = 'col-1'
-        text = '审核中'
-      } else if (productCheckStatus === 2) {
-        color = 'col-3'
-        text = '审核未通过'
-      } else if (productCheckStatus === 1 && productStatus === 1) {
-        color = 'col-2'
-        text = '已上架'
-      } else if (productCheckStatus === 1 && productStatus === 0) {
-        text = '未上架'
-      }
-
-      return {
-        product_status_text: text,
-        product_status_color: color
+    getText(arr, value) {
+      const temp = arr.filter(item => item.value === value)
+      if (temp.length > 0) {
+        return temp[0].name
       }
+      return ''
     }
   },
   mounted() {