From cbb23429b8beed72b58cbb57f9b3c56a0fb2b5d2 Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: 星期五, 09 五月 2025 13:31:26 +0800
Subject: [PATCH] 修改

---
 src/views/analyse/plan/index.vue |  187 ++++++++++++++++++++++++++--------------------
 1 files changed, 104 insertions(+), 83 deletions(-)

diff --git a/src/views/analyse/plan/index.vue b/src/views/analyse/plan/index.vue
index 90fb145..dce8efe 100644
--- a/src/views/analyse/plan/index.vue
+++ b/src/views/analyse/plan/index.vue
@@ -68,11 +68,11 @@
                                 <el-button size="small" text type="primary" v-if="scope.row.planSellStatus === 1" @click="accessPlan(scope.row)">派发</el-button>
                                 <el-button size="small" text type="primary" :icon="View" @click="openPlanDialog('查看', scope.row)">查看</el-button>
                                 <el-button v-if="scope.row.planSellStatus === 1" size="small" text type="primary" :icon="Edit" @click="openPlanDialog('修改', scope.row)">编辑</el-button>
-                                <el-button v-if="scope.row.identificationUserId == planState.user" size="small" text type="primary" :icon="Edit" @click="refuseIdentify(scope.row)">拒绝辨识</el-button>
-                                <el-button v-if="scope.row.evaluateUserId == planState.user" size="small" text type="primary" :icon="Edit" @click="refuseEvaluate(scope.row)">拒绝评价</el-button>
+                                <el-button v-if="scope.row.identityUsers?.find(i=>i.identificationUserId == planState.user)" size="small" text type="primary" :icon="Edit" @click="refuseIdentify(scope.row)">拒绝辨识</el-button>
+                                <el-button v-if="scope.row.evaluateUsers?.find(i=>i.evaluateUserId== planState.user)" size="small" text type="primary" :icon="Edit" @click="refuseEvaluate(scope.row)">拒绝评价</el-button>
 <!--                                <el-button v-if="scope.row.sceneUserId == planState.user" size="small" text type="primary" :icon="Edit" @click="refuseScene(scope.row)">拒绝现场</el-button>-->
-                                <el-button v-if="scope.row.identificationUserId == null" size="small" text type="primary" :icon="Edit" @click="reSendJob(scope.row,'identification')">重新指派辨识</el-button>
-                                <el-button v-if="scope.row.evaluateUserId == null" size="small" text type="primary" :icon="Edit" @click="reSendJob(scope.row,'evaluate')">重新指派评价</el-button>
+                                <el-button v-if="!scope.row.identityUsers" size="small" text type="primary" :icon="Edit" @click="reSendJob(scope.row,1)">重新指派辨识</el-button>
+                                <el-button v-if="!scope.row.evaluateUsers" size="small" text type="primary" :icon="Edit" @click="reSendJob(scope.row,2)">重新指派评价</el-button>
                                 <el-button v-if="scope.row.planSellStatus === 1" size="small" text type="danger" :icon="Delete" @click="onDelPlan(scope.row)">删除</el-button>
                             </template>
                         </el-table-column>
@@ -85,16 +85,26 @@
         </div>
         <plan-dialog ref="planDialogRef" @refresh="getPlanData"></plan-dialog>
 
-        <el-dialog :title="planState.reSendTitle" v-model="planState.reSendDialogVisible" width="50%">
+        <el-dialog class="chooseExpert" :title="planState.reSendTitle" v-model="planState.reSendDialogVisible" width="50%">
           <el-form ref="ruleFormRef" :rules="planState.rules" :model="planState.reSendForm" label-width="120px">
-            <el-form-item v-if="planState.reSendTitle == '指派辨识专家'" label="选择辨识专家" prop="identificationUserId">
-              <el-select v-model="planState.reSendForm.identificationUserId" style="width:100%"  placeholder="辨识专家" clearable>
-                <el-option v-for="item in planState.personList" :key="item.id" :label="item.realName" :value="item.id"></el-option>
+            <el-form-item v-if="planState.reSendTitle == '指派辨识专家'" label="选择辨识专家" prop="identificationUserId" class="valueSelect">
+              <el-select v-model="planState.reSendForm.userIds" multiple style="width:100%" :teleported="false" placeholder="辨识专家" clearable>
+                <el-option v-for="item in planState.bsExperts" :key="item.id" :label="item.realName" :value="item.id">
+                  <div class="valueTable">
+                    <div><div>姓名:</div><span>{{item.realName}}</span></div>
+                    <div><div>专业:</div><span>{{item.userIdentities?.map(i=>i.userIdentity).join(',')}}</span></div>
+                  </div>
+                </el-option>
               </el-select>
             </el-form-item>
-            <el-form-item v-if="planState.reSendTitle == '指派评价专家'" label="选择评价专家" prop="evaluateUserId">
-              <el-select v-model="planState.reSendForm.evaluateUserId" style="width:100%"  placeholder="评价专家" clearable>
-                <el-option v-for="item in planState.personList" :key="item.id" :label="item.realName" :value="item.id"></el-option>
+            <el-form-item v-if="planState.reSendTitle == '指派评价专家'" label="选择评价专家" prop="evaluateUserId" class="valueSelect">
+              <el-select v-model="planState.reSendForm.userIds" multiple style="width:100%" :teleported="false" placeholder="评价专家" clearable>
+                <el-option v-for="item in planState.pjExperts" :key="item.id" :label="item.realName" :value="item.id">
+                  <div class="valueTable">
+                    <div><div>姓名:</div><span>{{item.realName}}</span></div>
+                    <div><div>专业:</div><span>{{item.userIdentities?.map(i=>i.userIdentity).join(',')}}</span></div>
+                  </div>
+                </el-option>
               </el-select>
             </el-form-item>
           </el-form>
@@ -123,7 +133,6 @@
 
 
 const PlanDialog = defineAsyncComponent(() => import('./components/planDialog.vue'));
-
 const planDialogRef = ref();
 const userInfo = useUserInfo();
 const { userInfos } = storeToRefs(userInfo);
@@ -141,6 +150,8 @@
     riskUnitList: [
     ],
     personList: [],
+    bsExperts: [],
+    pjExperts: [],
     identificationMethodList: [
         {id:1, name: 'PHA'},
         {id:2, name: 'JHA'},
@@ -157,13 +168,12 @@
     reSendTitle:'',
     reSendDialogVisible: false,
     reSendForm: {
-      id: null,
-      identificationUserId: null,
-      evaluateUserId: null
+      riskAssessPlanId: null,
+      userIds: [],
+      userType: null
     },
     rules: {
-      identificationUserId: [{ required: true, message: '请选择辨识专家', trigger: 'blur' }],
-      evaluateUserId: [{ required: true, message: '请选择评价专家', trigger: 'blur' }]
+      userIds: [{ required: true, message: '请选择专家', trigger: 'blur' }]
     }
     // deviceUnitList: [
     //     {id:1, name: '台'},
@@ -207,7 +217,7 @@
           realName: ''
         }
     });
-    if(res.data.code === 200){
+    if(res.data.code === 100){
         planState.personList = JSON.parse(JSON.stringify(res.data.data));
     }else{
         ElMessage({
@@ -217,8 +227,34 @@
     }
 };
 
+const getAllExperts = async () => {
+  let res = await userApi().getExpertsList({
+    pageIndex: 1,
+    pageSize: 99999,
+    searchParams:{
+      userIndentityId: null
+    }
+  });
+  if (res.data.code === 100) {
+    const expertsList = res.data.data;
+    for(let i of expertsList){
+      if(i.roles?.find(obj=>obj.roleId == 2)){
+        planState.bsExperts.push(i)
+      }
+      if(i.roles?.find(obj=>obj.roleId == 3)){
+        planState.pjExperts.push(i)
+      }
+    }
+  } else {
+    ElMessage({
+      type: 'warning',
+      message: res.data.msg
+    });
+  }
+};
+
 const openPlanDialog = (title: string, value: PlanType) => {
-    planDialogRef.value.showPlanDialog(title, value, planState.riskUnitList, planState.personList);
+    planDialogRef.value.showPlanDialog(title, value, planState.riskUnitList, planState.personList,planState.bsExperts,planState.pjExperts);
 };
 
 const refuseIdentify = async(val: PlanType)=>{
@@ -247,13 +283,13 @@
       });
 }
 
-const reSendJob= async(val: PlanType,type:string)=>{
+const reSendJob= async(val: PlanType,type:number | null)=>{
   planState.reSendForm = {
-    id: val.id,
-    identificationUserId: null,
-    evaluateUserId: null
+    riskAssessPlanId: val.id,
+    userIds: [],
+    userType: type
   }
-  if(type=='identification'){
+  if(type==1){
     planState.reSendTitle = '指派辨识专家'
   }else{
     planState.reSendTitle = '指派评价专家'
@@ -279,9 +315,9 @@
       }
 
       planState.reSendForm = {
-        id: null,
-        identificationUserId: null,
-        evaluateUserId: null
+        riskAssessPlanId: null,
+        userIds: [],
+        userType: null
       },
       planState.reSendDialogVisible = false
       getPlanData()
@@ -408,14 +444,22 @@
 onMounted(() => {
     getPlanData();
     getAllRiskUnitList();
+    getAllExperts();
     getPersonList();
-    planState.user = userInfos.value.uid
+    planState.user = Number(userInfos.value.uid)
 })
 
 </script>
 
 <style scoped lang="scss">
 $homeNavLengh: 8;
+::v-deep(.el-dialog){
+  .el-dialog__body{
+    overflow-y: visible !important;
+    overflow-x: visible !important;
+  }
+}
+
 .home-container {
     height: calc(100vh - 144px);
     box-sizing: border-box;
@@ -482,65 +526,42 @@
         }
     }
 }
-.stepItem {
-    width: 100%;
-    display: flex;
-    align-items: flex-start;
-    margin-bottom: 30px;
-    margin-left: 30px;
-    padding-bottom: 30px;
-    border-left: 2px solid #ccc;
-    &:first-of-type {
-        margin-top: 30px;
-    }
-    &:last-of-type {
-        margin-bottom: 0;
-        border-left: none;
-    }
-    .stepNum {
-        width: 30px;
-        height: 30px;
-        border-radius: 15px;
-        box-sizing: border-box;
-        color: #333;
-        border: 1px solid #999;
-        line-height: 28px;
-        text-align: center;
-        margin-right: 10px;
-        margin-left: -16px;
-        margin-top: -30px;
-    }
-    .stepCard {
-        width: 100%;
-        margin-top: -30px;
 
-        .box-card {
-            width: 100%;
-            &:deep(.el-card__header) {
-                padding: 10px 15px;
-            }
-            .card-header {
-                width: 100%;
-                display: flex;
-                justify-content: space-between;
-                align-items: center;
-                & > div:first-of-type {
-                    margin-right: 80px;
-                    font-size: 18px;
-                    font-weight: bold;
-                }
-            }
+.valueSelect{
+  ::v-deep(.el-popper){
+    .el-select-dropdown__item{
+      width: 100%;
+      height: auto;
+      white-space: normal;
+      word-break: break-all;
+      word-wrap: break-word;
+      overflow: auto;
+      padding: 10px 25px;
+      border-bottom: 1px solid #ccc;
+
+      .valueTable{
+        &>div{
+          line-height: 1.5;
+          margin-bottom: 6px;
+          display: flex;
+          align-items: center;
+
+          div{
+            color: #999;
+          }
+
+          span{
+            font-weight: bolder;
+          }
+
+          &:last-of-type{
+            margin-bottom: 0;
+          }
         }
+      }
     }
-    &:hover .card-header {
-        color: #0098f5;
-    }
-    &:hover .stepNum {
-        border: 2px solid #0098f5;
-        color: #0098f5;
-    }
+  }
 }
-
 :deep(.el-date-editor) {
     width: 100%;
 }

--
Gitblit v1.9.2