马宇豪
2025-03-12 de5e674a5655cd5c8d5457d1be8182519625d265
src/views/analyse/plan/components/planDialog.vue
@@ -1,18 +1,22 @@
<template>
    <div class="system-menu-dialog-container">
        <el-dialog :title="planDialogState.title" v-model="planDialogState.planDialogVisible" width="600px">
            <el-form ref="planFormRef" :rules="planDialogState.planFormRules" :model="planDialogState.planForm" size="default" label-width="120px">
      <el-form ref="planFormRef" :rules="planDialogState.planFormRules" :model="planDialogState.planForm" size="default"
               label-width="120px">
                <el-row :gutter="35">
                    <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
                        <el-form-item label="风险分析单元" prop="riskUnitId">
                            <el-select :disabled="planDialogState.disabled" v-model="planDialogState.planForm.riskUnitId" style="width:100%" placeholder="风险分析单元" clearable>
                                <el-option v-for="item in planDialogState.riskUnitList" :key="item.id" :label="item.riskName" :value="item.id"></el-option>
              <el-select :disabled="planDialogState.disabled" v-model="planDialogState.planForm.riskUnitId"
                         style="width:100%" placeholder="风险分析单元" clearable>
                <el-option v-for="item in planDialogState.riskUnitList" :key="item.id" :label="item.riskName"
                           :value="item.id"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
                        <el-form-item label="评估计划名称" prop="assessPlanName">
                            <el-input :disabled="planDialogState.disabled" v-model="planDialogState.planForm.assessPlanName" placeholder="评估计划名称" clearable></el-input>
              <el-input :disabled="planDialogState.disabled" v-model="planDialogState.planForm.assessPlanName"
                        placeholder="评估计划名称" clearable></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
@@ -32,30 +36,53 @@
                    </el-col>
                    <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
                        <el-form-item label="计划制定人" prop="planUserId">
                            <el-select :disabled="planDialogState.disabled" v-model="planDialogState.planForm.planUserId" style="width:100%"  placeholder="计划制定人" clearable>
                                <el-option v-for="item in planDialogState.personList" :key="item.id" :label="item.realName" :value="item.id"></el-option>
              <el-select :disabled="planDialogState.disabled" v-model="planDialogState.planForm.planUserId"
                         style="width:100%" placeholder="计划制定人" clearable>
                <el-option v-for="item in planDialogState.personList" :key="item.id" :label="item.realName"
                           :value="item.id"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
            <el-form-item label="辨识类型" prop="identificationType">
              <el-select :disabled="planDialogState.disabled" v-model="planDialogState.planForm.identificationType"
                         style="width:100%" placeholder="辨识类型" clearable>
                <el-option v-for="item in planDialogState.typeList" :key="item.value" :label="item.name"
                           :value="item.value"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20 valueSelect">
                        <el-form-item label="辨识专家" prop="identificationUserId">
                            <el-select :disabled="planDialogState.disabled" v-model="planDialogState.planForm.identificationUserId" style="width:100%" :teleported="false" placeholder="辨识专家" clearable>
                                <el-option v-for="item in planDialogState.bsExperts" :key="item.id" :label="item.realName" :value="item.id">
            <el-form-item label="辨识专家" prop="identificationUserInsert">
              <el-select :disabled="planDialogState.disabled" multiple v-model="planDialogState.planForm.identificationUserInsert"
                         style="width:100%" :teleported="false" placeholder="辨识专家" clearable>
                <el-option v-for="item in planDialogState.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>
                      <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-col>
                    <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20 valueSelect">
                        <el-form-item label="评价专家" prop="evaluateUserId">
                            <el-select :disabled="planDialogState.disabled" v-model="planDialogState.planForm.evaluateUserId" style="width:100%" :teleported="false" placeholder="评价专家" clearable>
                                <el-option v-for="item in planDialogState.pjExperts" :key="item.id" :label="item.realName" :value="item.id">
            <el-form-item label="评价专家" prop="evaluateUserInsert">
              <el-select :disabled="planDialogState.disabled" multiple v-model="planDialogState.planForm.evaluateUserInsert"
                         style="width:100%" :teleported="false" placeholder="评价专家" clearable>
                <el-option v-for="item in planDialogState.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>
                      <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>
@@ -65,8 +92,10 @@
            </el-form>
            <template #footer>
            <span class="dialog-footer">
               <el-button @click="planDialogState.planDialogVisible = !planDialogState.planDialogVisible" size="default">取 消</el-button>
               <el-button v-if="!planDialogState.disabled" type="primary" @click="onSubmitPlan" size="default">确定</el-button>
               <el-button @click="planDialogState.planDialogVisible = !planDialogState.planDialogVisible"
                     size="default">取 消</el-button>
               <el-button v-if="!planDialogState.disabled" type="primary" @click="onSubmitPlan"
                     size="default">确定</el-button>
            </span>
            </template>
        </el-dialog>
@@ -90,10 +119,11 @@
        planUserId: null,
        assessPlanName: '',
        assessTime: [],
    identificationType: null,
        assessStartTime: '',
        assessEndTime: '',
        identificationUserId: null,
        evaluateUserId: null,
    identificationUserInsert: [],
    evaluateUserInsert: [],
        riskType: 2
    },
    planFormRules: {
@@ -101,11 +131,26 @@
        assessPlanName: [{ required: true, message: '请填写评估计划名称', trigger: 'blur' }],
        assessTime: [{ required: true, message: '请选择评估时间', trigger: 'blur' }],
        planUserId: [{ required: true, message: '请选择计划制定人', trigger: 'change' }],
        identificationUserId: [{ required: true, message: '请选择辨识专家', trigger: 'change' }],
        evaluateUserId: [{ required: true, message: '请选择评价专家', trigger: 'change' }],
    identificationType: [{required: true, message: '请选择辨识类型', trigger: 'change'}],
    identificationUserInsert: [{required: true, message: '请选择辨识专家', trigger: 'change'}],
    evaluateUserInsert: [{required: true, message: '请选择评价专家', trigger: 'change'}],
    },
    riskUnitList: [],
    personList: [],
  typeList: [
    {
      name: '线上专家',
      value: 1
    },
    {
      name: '现场专家',
      value: 2
    },
    {
      name: '线上+现场',
      value: 3
    }
  ],
    bsExperts: [],
    pjExperts: []
})
@@ -127,30 +172,28 @@
            planUserId: null,
            assessPlanName: '',
            assessTime: [],
      identificationType: null,
            assessStartTime: '',
            assessEndTime: '',
            identificationUserId: null,
            evaluateUserId: null,
      identificationUserInsert: [],
      evaluateUserInsert: [],
            riskType: 2
        };
    }else if(title === '查看'){
        planDialogState.title = '查看';
        planDialogState.disabled = true
        for(let i in planDialogState.planForm){
            if(isValidKey(i, planDialogState.planForm)){
                planDialogState.planForm[i] = value[i]
            }
        }
        planDialogState.planForm.assessTime=[value.assessStartTime, value.assessEndTime]
        console.log(value,planDialogState.planForm.assessTime,'time')
    }else{
        planDialogState.title = '编辑';
    if(title === '查看'){
      planDialogState.title = '查看'
      planDialogState.disabled = true
    }else{
      planDialogState.title = '编辑'
        planDialogState.planForm.id = value.id
    }
        for(let i in planDialogState.planForm){
            if(isValidKey(i, planDialogState.planForm)){
                planDialogState.planForm[i] = value[i]
            }
        }
    planDialogState.planForm.identificationUserInsert = value.identityUsers?.map(i=>i.identificationUserId)
    planDialogState.planForm.evaluateUserInsert = value.evaluateUsers?.map(i=>i.evaluateUserId)
        planDialogState.planForm.assessTime=[value.assessStartTime, value.assessEndTime]
    }
};
@@ -217,6 +260,7 @@
      position: absolute !important;
      top: 0 !important;
    }
    .valueSelect{
      ::v-deep(.el-popper){
        .el-select-dropdown__item{