| | |
| | | @row-save="rowSave" @row-del="rowDel" @search-change="searchChange" @search-reset="searchReset" |
| | | @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange" |
| | | @refresh-change="refreshChange" @on-load="onLoad"> |
| | | <template #candidateState="{ row }"> |
| | | <div v-if="row.candidateState !== 1">{{ setStatus(row.candidateState) }}</div> |
| | | <el-button v-else text type="success" icon="el-icon-edit" @click="updateState(row, 'candidateState')">{{ |
| | | setStatus(row.candidateState) }}</el-button> |
| | | </template> |
| | | <template #evaluateState="{ row }"> |
| | | <div v-if="row.evaluateState !== 1">{{ setStatus(row.evaluateState) }}</div> |
| | | <el-button v-else :disabled="row.evaluateState !== 1" text type="success" icon="el-icon-edit" |
| | | @click="updateState(row, 'evaluateState')">{{ |
| | | setStatus(row.evaluateState) }}</el-button> |
| | | </template> |
| | | <template #candidateCutoffTimeEnd="{ row }"> |
| | | <div class="time-box"> |
| | | {{ row.candidateCutoffTimeStart }} |
| | |
| | | <!-- <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" v-if="!row.type && row.candidateState === 2 && !row.evaluateState" text plain icon="el-icon-position" |
| | | @click="taskPublicDialog(row)">发布</el-button> |
| | | <el-button type="primary" text plain icon="el-icon-view" @click="viewHandlerClick(row)">结果详情</el-button> |
| | | <el-button type="primary" text plain icon="el-icon-view" |
| | | @click="viewVotingDetailsHandlerClick(row)">投票详情</el-button> |
| | | <el-button type="primary" text plain icon="el-icon-position" |
| | | v-if="!row.type && row.candidateState === 2 && !row.evaluateState" @click="taskPublicDialog(row)">发布</el-button> |
| | | <el-button type="success" v-if="(row.candidateState === 0 && !row.type) || (row.evaluateState === 0 && row.type)" |
| | | text plain icon="el-icon-edit" @click="editTaskDialog(row)">编辑</el-button> |
| | | <el-button type="danger" text plain icon="el-icon-delete" @click="rowDel(row)">删除</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | <!-- 新增个人评优任务弹窗 --> |
| | | <addIndividualTask :params="addIndividualParams" @refreshTable="this.onLoad" /> |
| | | <addSectionTask :params="addSectionParams" @refreshTable="this.onLoad" /> |
| | | <!-- 编辑任务 --> |
| | | <editIndividualTask :params="editIndividualTaskParams" @refreshTable="this.onLoad" /> |
| | | <editSectionTask :params="editSectionTaskParams" @refreshTable="this.onLoad" /> |
| | | <!-- 发布 --> |
| | | <individualTaskPublic :params="taskPublicParams" @refreshTable="this.onLoad" /> |
| | | <!-- 预览 --> |
| | | <viewEvaluateDetail :params="viewEvaluateDetailParams" /> |
| | | <viewEvaluate :params="viewEvaluateParams" /> |
| | | <!-- 投票详情 --> |
| | | <votingDetails :params="votingParams" /> |
| | | </basic-container> |
| | | </template> |
| | | |
| | |
| | | import 'nprogress/nprogress.css'; |
| | | import addIndividualTask from './components/addIndividualTask.vue'; |
| | | import addSectionTask from './components/addSectionTask.vue'; |
| | | import viewEvaluateDetail from './components/viewEvaluateDetail.vue'; |
| | | import viewEvaluate from './components/viewEvaluateDetail.vue'; |
| | | import individualTaskPublic from './components/IndividualTaskPublic.vue'; |
| | | import votingDetails from './components/votingDetails.vue'; |
| | | import editIndividualTask from './components/editIndividualTask.vue' |
| | | import editSectionTask from './components/editSectionTask.vue' |
| | | |
| | | export default { |
| | | components: { |
| | | addIndividualTask, |
| | | addSectionTask, |
| | | individualTaskPublic, |
| | | viewEvaluateDetail |
| | | viewEvaluate, |
| | | votingDetails, |
| | | editIndividualTask, |
| | | editSectionTask |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | ], |
| | | }, |
| | | // 信息预览弹窗 |
| | | viewEvaluateDetailParams: {}, |
| | | taskPublicParams: {} |
| | | viewEvaluateParams: {}, |
| | | taskPublicParams: {}, |
| | | votingParams: {}, |
| | | // 编辑 |
| | | editIndividualTaskParams: {}, |
| | | editSectionTaskParams: {}, |
| | | }; |
| | | }, |
| | | watch: { |
| | |
| | | } |
| | | ); |
| | | }, |
| | | viewDateilDialog(row) { |
| | | this.viewEvaluateDetailParams = { |
| | | viewHandlerClick(row) { |
| | | this.viewEvaluateParams = { |
| | | visible: true, |
| | | type: this.defaultTaskType, |
| | | data: row |
| | | } |
| | | }, |
| | | viewVotingDetailsHandlerClick(row) { |
| | | this.votingParams = { |
| | | visible: true, |
| | | data: row |
| | | } |
| | | }, |
| | | editTaskDialog(row) { |
| | | if (!this.defaultTaskType) { |
| | | this.editIndividualTaskParams = { |
| | | visible: true, |
| | | data: row |
| | | } |
| | | } else { |
| | | this.editSectionTaskParams = { |
| | | visible: true, |
| | | data: row |
| | | } |
| | | } |
| | | |
| | | }, |
| | | taskPublicDialog(row) { |
| | | this.taskPublicParams = { |
| | |
| | | }, |
| | | tabChange(value) { |
| | | this.defaultTaskType = value.prop; |
| | | }, |
| | | setStatus(value) { |
| | | const status = { |
| | | 0: '未开始', |
| | | 1: '进行中', |
| | | 2: '已完成' |
| | | } |
| | | return status[value] |
| | | }, |
| | | updateState(row, name) { |
| | | const text = (name === 'candidateState' ? '是否提前结束第一轮评优?' : '是否提前结束评优任务?') |
| | | this.$confirm(text, { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }).then(res => { |
| | | const { id } = row |
| | | let params = { |
| | | id |
| | | } |
| | | name === 'candidateState' ? Object.assign(params, { candidateState: 2 }) : Object.assign(params, { evaluateState: 2 }) |
| | | update(params).then(res => { |
| | | if (res.data.code !== 200) return this.$message.error(res.data.msg) |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | this.onLoad(this.page); |
| | | }) |
| | | }) |
| | | } |
| | | }, |
| | | provide() { |