| | |
| | | ...params,
|
| | | current,
|
| | | size,
|
| | | descs: 'vote_num'
|
| | | descs: 'evaluate_task_id,dept_id,vote_num'
|
| | | }
|
| | | })
|
| | | }
|
| | |
| | | method: 'get', |
| | | params: { |
| | | ...params, |
| | | type: 2, |
| | | descs: 'vote_num' |
| | | } |
| | | }) |
| | |
| | | @click="handleDelete"> |
| | | 删除 |
| | | </el-button> |
| | | <el-button type="warning" plain icon="el-icon-download" @click="handleExport"> |
| | | <!-- <el-button type="warning" plain icon="el-icon-download" @click="handleExport"> |
| | | 导出 |
| | | </el-button> |
| | | </el-button> --> |
| | | </template> |
| | | <template #menu="{ row }"> |
| | | <el-button type="primary" icon="el-icon-plus" size="small" @click="handleTaskResult(row)"> |
| | |
| | | } = this.query; |
| | | let values = { |
| | | ...this.query, |
| | | ...params |
| | | ...params, |
| | | userType: 2 |
| | | }; |
| | | this.data = [] |
| | | !this.defaultTaskType && getList(page.currentPage, page.pageSize, values, values.deptId).then(res => { |
| | |
| | | type: 'input', |
| | | display: false, |
| | | formatter: (row) => { |
| | | console.log(dataSourceStatus[row.dataSource]); |
| | | return dataSourceStatus[row.dataSource] || '系统分配' |
| | | }, |
| | | } |
| | |
| | | <template> |
| | | <el-dialog title="信息预览" v-model="params.visible" width="50%"> |
| | | <el-dialog title="信息预览" v-model="params.visible" width="70%"> |
| | | <div class="descriptions"> |
| | | <div class="descriptions-item" v-for="item in taskDateil" :key="item.prop" :style="{ width: item.width }"> |
| | | <div class="label">{{ item.title }}</div> |
| | |
| | | column: [ |
| | | { |
| | | label: '评优项目', |
| | | prop: '', |
| | | prop: 'evaluateTaskName', |
| | | type: 'input', |
| | | }, |
| | | { |
| | | label: '名称', |
| | | prop: '', |
| | | type: 'input', |
| | | }, |
| | | // { |
| | | // label: '任务类别', |
| | | // prop: '', |
| | | // type: 'input', |
| | | // }, |
| | | { |
| | | label: '候选人', |
| | | prop: '', |
| | | prop: 'userName', |
| | | type: 'input', |
| | | }, |
| | | { |
| | | label: '部门', |
| | | prop: '', |
| | | prop: 'deptName', |
| | | type: 'input' |
| | | }, |
| | | { |
| | | label: '票数', |
| | | prop: '', |
| | | prop: 'voteNum', |
| | | type: 'input' |
| | | } |
| | | ] |
| | |
| | | } |
| | | |
| | | const getFinallyList = () => { |
| | | const { id, evaluateNum } = props.params.data |
| | | const params = { |
| | | evaluateTaskId: props.params.data.id, |
| | | current: page.current, |
| | | size: page.size |
| | | evaluateTaskId: id, |
| | | current: 1, |
| | | size: evaluateNum |
| | | } |
| | | return getFinallyResult(params).then(res => { |
| | | return res.data.data.records |
| | |
| | | |
| | | const initData = async () => { |
| | | const data = props.params.data |
| | | const status = { |
| | | 0: '未开始', |
| | | 1: '进行中', |
| | | 2: '已完成' |
| | | } |
| | | |
| | | for (const item of taskDateil) { |
| | | item.value = data[item.prop] || '暂未完善' |
| | | |
| | | if (['candidateState', 'evaluateState'].includes(item.prop)) { |
| | | item.value = status[item.value] |
| | | } |
| | | |
| | | if (item.prop === 'candidateResult') { |
| | | const res = await candidateList() |
| | | if (res.length == 0) { |
| | | item.value = '暂无候选人' |
| | | } else { |
| | | const candidates = {} |
| | | const candidateStrArr = [] |
| | | const { candidateNum } = data |
| | | candidateNum.forEach(candidate => { |
| | | res.forEach(r => { |
| | | const value = candidate.users.find(user => user.id === r.userId) |
| | | if (value) { |
| | | if (candidates[candidate.deptName] === void 0) { |
| | | candidates[candidate.deptName] = [] |
| | | } |
| | | candidates[candidate.deptName].push(value.name) |
| | | } |
| | | }) |
| | | }) |
| | | Object.keys(candidates).forEach(key => { candidateStrArr.push(`${key}(${candidates[key].length}人):${candidates[key].join('、')}`) }) |
| | | item.value = candidateStrArr.join('\n') |
| | | console.log(candidateStrArr.join('\n')); |
| | | } |
| | | } |
| | | |
| | | if (item.prop === 'finallyResult') { |
| | | const res = await getFinallyList() |
| | | item.data = res |
| | | console.log(item.data); |
| | | } |
| | | } |
| | | |
| | |
| | | background-color: aliceblue; |
| | | border-right: 1px solid #eeeded; |
| | | } |
| | | |
| | | .value { |
| | | white-space: pre-line; |
| | | } |
| | | |
| | | .table { |
| | | padding: 10px; |
| | | width: calc(100% - 20px); |
| | |
| | | <el-button type="primary" icon="el-icon-plus" @click="handleAdd">新增</el-button> |
| | | <el-button type="danger" icon="el-icon-delete" plain v-if="permission.evaluateTask_delete" |
| | | @click="handleDelete">删除</el-button> |
| | | <el-button type="warning" plain icon="el-icon-download" @click="handleExport">导出</el-button> |
| | | <!-- <el-button type="warning" plain icon="el-icon-download" @click="handleExport">导出</el-button> --> |
| | | </template> |
| | | <template #menu="{ size, row, index }"> |
| | | <el-button type="primary" text plain icon="el-icon-view" @click="viewDateilDialog(row)">详情</el-button> |
| | | <el-button type="primary" text plain icon="el-icon-edit" @click="editDialog(row)">编辑</el-button> |
| | | <el-button type="primary" text plain icon="el-icon-position" @click="publicTimeBtn(row)" |
| | | v-if="row.candidateState === 2">发布</el-button> |
| | | <el-button type="primary" v-if="row.type === 0 && row.candidateState === 2" text plain icon="el-icon-plus" @click="addCandidateHandle(row)">新增候选人</el-button> |
| | | <el-button type="primary" text plain icon="el-icon-download">导出</el-button> |
| | | v-if="row.candidateState === 2 && row.evaluateState === 0">发布</el-button> |
| | | <el-button type="primary" v-if="row.type === 0 && row.candidateState === 0" text plain icon="el-icon-plus" @click="addCandidateHandle(row)">新增候选人</el-button> |
| | | <!-- <el-button type="primary" text plain icon="el-icon-download">导出</el-button> --> |
| | | </template> |
| | | </avue-crud> |
| | | <!-- 发布弹窗 --> |
| | |
| | | this.rowData = row; |
| | | this.dialogVisible = true; |
| | | }, |
| | | // 发布 |
| | | timeSubmit() { |
| | | const { id } = this.rowData; |
| | | const params = { |