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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
| <template>
| <el-dialog v-model="props.params.visible" :title="`${tipInfo.evaluateTaskName}-评定人列表`" width="50%" destroy-on-close>
| <div class="tips">
| <el-tag style="width: 100%;" size="large">当前评优任务:{{ tipInfo.evaluateTaskName }}</el-tag>
| <div class="tags">
| <el-tag size="large" class="item" v-if="!curType">候选人姓名:{{ tipInfo.userName }}</el-tag>
| <el-tag size="large" class="item" >候选人部门:{{ tipInfo.deptName }}</el-tag>
| <el-tag size="large" class="item" v-if="!curType">候选人职位:{{ tipInfo.postName }}</el-tag>
| </div>
| </div>
| <avue-crud :data="table.data" :option="tableOption" v-model:page="table.page">
| <template #menu-left>
| <el-button type="primary" icon="el-icon-plus" @click="assessorDialog">新增评定人</el-button>
| </template>
| </avue-crud>
| <selectAssessor v-model:params="selectAssessorParams" @refresh="refresh" />
| </el-dialog>
| </template>
|
| <script setup>
| import { getAssessorList } from '@/api/evaluate/evaluateTask'
| import { ElMessage } from 'element-plus';
| import { markRaw, reactive, watch } from 'vue';
| import selectAssessor from './selectAssessor.vue';
|
|
| const props = defineProps({
| params: {
| type: Object,
| default: () => {
| return {
| visible: false,
| taskInfo: {},
| candidateInfo: {}
| }
| }
| }
| })
|
| const type = inject('type')
| const curType = computed(() => type())
|
| const tableOption = markRaw({
| height: '240',
| calcHeight: 30,
| tip: false,
| searchShow: true,
| searchMenuSpan: 6,
| border: true,
| index: true,
| viewBtn: false,
| addBtn: false,
| editBtn: false,
| delBtn: false,
| selection: false,
| dialogClickModal: false,
| menuFixed: 'right',
| labelWidth: '70',
| menu: false,
| column: [
| {
| label: '任务id',
| prop: 'evaluateTaskId',
| type: 'input',
| hide: true,
| },
| {
| label: '候选人id',
| prop: 'userId',
| type: 'input',
| hide: true,
| },
| {
| label: '候选人姓名',
| prop: 'userName',
| type: 'input'
| },
| {
| label: '部门id',
| prop: 'deptId',
| type: 'input',
| hide: true,
| },
| {
| label: '部门名称',
| prop: 'deptName',
| type: 'input'
| },
| {
| label: '职位名称',
| prop: 'postName',
| type: 'input'
| }
| ]
| })
|
| const tipInfo = reactive({})
|
| const table = reactive({
| data: [],
| page: {
| current: 1,
| size: 10,
| total: 10
| },
| })
|
| const selectAssessorParams = reactive({
| visible: false,
| evaluateCandidateId: ''
| })
|
| const initData = () => {
| const { current, size } = table.page
| const { id } = props.params.candidateInfo
| getAssessorList(current, size, id).then(res => {
| const result = res.data.data
| table.data = result.records
| table.page.total = result.total
| }, error => {
| ElMessage.error(error)
| })
| }
|
| const refresh = () => {
| table.page.total = 0
| initData()
| }
|
| const assessorDialog = () => {
| selectAssessorParams.visible = true
| selectAssessorParams.evaluateCandidateId = props.params.candidateInfo.id
| }
|
| watch(() => props.params.visible, (val) => {
| if (!val) return
| const { evaluateTaskName } = props.params.taskInfo
| const { postName, deptName, userName } = props.params.candidateInfo
| tipInfo.evaluateTaskName = evaluateTaskName
| tipInfo.postName = postName
| tipInfo.deptName = deptName
| tipInfo.userName = userName
| initData()
|
| }, {
| deep: true
| })
|
| </script>
|
| <style lang="scss" scoped>
| .tips {
| margin-bottom: 15px;
|
| .tags {
| display: flex;
| width: 100%;
| margin: 5px 0;
|
| .item {
| flex: 1;
|
| &:nth-child(2) {
| margin: 0 5px;
| }
| }
| }
| }
| </style>
|
|