马宇豪
2024-11-26 81eb726dec221cce6e0be422a69c01916ac13bf0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<template>
    <div class="notice">
        <el-dialog
            v-model="dialogVisible"
            :title="title"
            width="75%"
            @close="closeEvaluate"
        >
          <el-table :data="tableData" border style="width: 100%">
            <el-table-column type="index" width="55" align="center" />
            <el-table-column label="姓名" align="center" prop="name" />
            <el-table-column label="性别" align="center" prop="sex">
              <template #default="scope">
                {{scope.row.sex == 0?'男':scope.row.sex == 1?'女':'未知'}}
              </template>
            </el-table-column>
            <el-table-column label="身份证号" align="center" prop="idCard" />
            <el-table-column label="等级" align="center" prop="ratingLevel">
              <template #default="scope">
                {{scope.row.ratingLevel == 1?'一级':scope.row.ratingLevel == 2?'二级':scope.row.ratingLevel == 3?'三级':'暂无'}}
              </template>
            </el-table-column>
            <el-table-column label="专业领域" align="center" prop="domain"/>
            <el-table-column label="选用方式" align="center" prop="selectionMode">
              <template #default="scope">
                {{scope.row.selectionMode == 1?'固定':scope.row.selectionMode == 2?'随机':'其他'}}
              </template>
            </el-table-column>
            <el-table-column label="是否为组长" align="center" prop="teamLeader">
              <template #default="scope">
                {{scope.row.teamLeader == 0?'否':scope.row.teamLeader == 1?'是':'未知'}}
              </template>
            </el-table-column>
            <el-table-column label="评估状态" align="center" prop="evaluationState">
              <template #default="scope">
                <el-tag :type="scope.row.evaluationState == 0?'info':scope.row.evaluationState==1?'success':''">
                  {{scope.row.evaluationState ==0?'未评估':scope.row.evaluationState==1?'已评估':'--'}}
                </el-tag>
              </template>
            </el-table-column>
            <el-table-column label="考评总分" align="center" prop="score" />
            <el-table-column v-if="title == '专家评估'" label="操作" align="center" class-name="small-padding fixed-width">
              <template #default="scope">
                <el-button type="primary" link @click="openEvaluate(scope.row)">评分</el-button>
              </template>
            </el-table-column>
          </el-table>
          <pagination
              v-show="total > 0"
              :total="total"
              v-model:page="queryParams.pageNum"
              v-model:limit="queryParams.pageSize"
              @pagination="getEvaluationList"
          />
            <template #footer>
              <span class="dialog-footer">
                <el-button type="primary" @click="closeEvaluate" size="default" v-preReClick>确认</el-button>
              </span>
            </template>
          <evaluate ref="evaluateRef" @getList="getEvaluationList()"></evaluate>
        </el-dialog>
    </div>
</template>
<script setup>
import {reactive, ref, toRefs} from 'vue'
import {ElMessage} from "element-plus";
import Evaluate from "./evaluate";
import {
  getProjectExpertEvaluationList,
} from "@/api/backManage/evaluate";
const dialogVisible = ref(false);
const evaluateRef = ref()
const emit = defineEmits(["getList"]);
const state = reactive({
  tableData: [],
  total: null,
  queryParams: {
    id: null,
    pageNum: 1,
    pageSize: 10
  },
  projectName: '',
  projectCheckTime: '',
  title: ''
})
const {tableData,total,queryParams,projectName,title,projectCheckTime} = toRefs(state)
const openDialog = async (type,value) => {
  if(type == 'view'){
    state.title = '专家列表'
  }else{
    state.title = '专家评估'
  }
  state.queryParams.id = value.id
  state.projectName = value.projectName
  state.projectCheckTime = value.projectCheckTime
  await getEvaluationList()
  dialogVisible.value = true;
}
 
const getEvaluationList = async () => {
  const res = await getProjectExpertEvaluationList(state.queryParams)
  if(res.code == 200){
    state.tableData = res.rows
    state.total = res.total
  }else{
    ElMessage.warning(res.msg)
  }
}
 
const openEvaluate = (value)=>{
  evaluateRef.value.openDialog(value,state.projectName,state.projectCheckTime)
}
 
const closeEvaluate = ()=>{
  dialogVisible.value = false
  emit('getList')
}
 
defineExpose({
  openDialog
})
</script>
 
<style scoped lang="scss">
.notice{
    :deep(.el-form .el-form-item__label) {
        font-size: 15px;
    }
    .file {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }
}
</style>