From 8d14fec97344df49d58db115852c03b466482bc6 Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: 星期三, 12 四月 2023 14:47:21 +0800
Subject: [PATCH] 设备、场所、部门接口

---
 src/views/analyse/identify/index.vue |   63 ++++++++++++++++++++-----------
 1 files changed, 40 insertions(+), 23 deletions(-)

diff --git a/src/views/analyse/identify/index.vue b/src/views/analyse/identify/index.vue
index 320da4a..eb0ce8e 100644
--- a/src/views/analyse/identify/index.vue
+++ b/src/views/analyse/identify/index.vue
@@ -39,18 +39,28 @@
                         <el-table-column prop="createByUserName" label="创建人" show-overflow-tooltip></el-table-column>
                         <el-table-column prop="updateTime" label="最后修改时间" show-overflow-tooltip></el-table-column>
                         <el-table-column prop="updateByUserName" label="最后修改人" show-overflow-tooltip></el-table-column>
-                        <el-table-column prop="planExecStatus" label="状态" show-overflow-tooltip>
+                        <el-table-column prop="planExecStatus" label="执行状态" show-overflow-tooltip>
                             <template #default="scope">
                                 <div>
+                                    <div v-if="scope.row.planExecStatus === 1">
+                                      <el-tag :type="'info'">
+                                        {{ '未开始' }}
+                                      </el-tag>
+                                    </div>
                                     <div v-if="scope.row.planExecStatus === 2">
                                         <el-tag :type="'info'">
-                                            {{ '未辨识' }}
+                                            {{ '辨识阶段' }}
                                         </el-tag>
                                     </div>
                                     <div v-if="scope.row.planExecStatus === 3">
-                                        <el-tag :type="'success'">
-                                            {{ '已辨识' }}
+                                        <el-tag :type="'primary'">
+                                            {{ '评价阶段' }}
                                         </el-tag>
+                                    </div>
+                                    <div v-if="scope.row.planExecStatus === 4">
+                                      <el-tag :type="'success'">
+                                        {{ '完成阶段' }}
+                                      </el-tag>
                                     </div>
                                 </div>
                             </template>
@@ -58,9 +68,9 @@
                         <el-table-column label="操作" width="250">
                             <template #default="scope">
                                 <el-button size="small" text type="primary" v-if="scope.row.planExecStatus === 2" @click="accessIdentify(scope.row)">提交</el-button>
-                                <el-button size="small" text type="primary" :icon="View" @click="openIdentifyQuery('查看', scope.row)">查看</el-button>
-                                <el-button size="small" text type="primary" v-if="scope.row.planExecStatus === 2" :icon="Edit" @click="openIdentifyQuery('编辑', scope.row)">编辑</el-button>
-                                <el-button size="small" text type="danger" :icon="Delete" @click="onDelIdentify(scope.row)">删除</el-button>
+                                <el-button size="small" text type="primary" v-if="scope.row.planExecStatus === 3 || scope.row.planExecStatus === 4" :icon="View" @click="openIdentifyQuery('查看', scope.row)">查看</el-button>
+                                <el-button size="small" text type="primary" v-if="scope.row.planExecStatus === 2" :icon="Edit" @click="openIdentifyQuery('辨识', scope.row)">辨识</el-button>
+<!--                                <el-button size="small" text type="primary" v-if="scope.row.planExecStatus === 2" :icon="Edit" @click="openIdentifyQuery('编辑', scope.row)">编辑</el-button>-->
                             </template>
                         </el-table-column>
                     </el-table>
@@ -192,29 +202,36 @@
 };
 
 const accessIdentify = (val: IdentifyType) => {
-    ElMessageBox.confirm(`此操作将派发该计划:“${val.assessPlanName}”,是否继续?`, '提示', {
+    if(val.factorQueryDTOList?.length > 0){
+      ElMessageBox.confirm(`此操作将派发该计划:“${val.assessPlanName}”,是否继续?`, '提示', {
         confirmButtonText: '确认',
         cancelButtonText: '取消',
         type: 'warning'
-    })
-        .then(async () => {
+      })
+          .then(async () => {
             let res = await identifyApi().submitIdentify({ id: val.id});
             if (res.data.code === 100) {
-                ElMessage({
-                    type: 'success',
-                    duration: 2000,
-                    message: '提交成功'
-                });
-                await getIdentifyData();
+              ElMessage({
+                type: 'success',
+                duration: 2000,
+                message: '提交成功'
+              });
+              await getIdentifyData();
             } else {
-                ElMessage({
-                    type: 'warning',
-                    message: res.data.msg
-                });
+              ElMessage({
+                type: 'warning',
+                message: res.data.msg
+              });
             }
-        })
-        .catch((error) => {
-        });
+          })
+          .catch((error) => {
+          });
+    }else{
+      ElMessage({
+        type: 'warning',
+        message: '请先添加辨识信息'
+      });
+    }
 };
 
 const onHandleSizeChange = (val: number) => {

--
Gitblit v1.9.2