From 6bff19bca7c57fe7db0d62dd0f3f2e5ccd1a1608 Mon Sep 17 00:00:00 2001
From: GuLiMmo <2820890765@qq.com>
Date: Sat, 23 Dec 2023 15:43:57 +0800
Subject: [PATCH] 细节修改
---
src/views/evaluate/evaluateTask.vue | 47 ++++++++++++++++++++++++++++++++++-------------
1 files changed, 34 insertions(+), 13 deletions(-)
diff --git a/src/views/evaluate/evaluateTask.vue b/src/views/evaluate/evaluateTask.vue
index 7db0bf3..ba5437d 100644
--- a/src/views/evaluate/evaluateTask.vue
+++ b/src/views/evaluate/evaluateTask.vue
@@ -14,7 +14,9 @@
</template>
<template #menu="{ size, row, index }">
<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.status === 2">发布</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>
</template>
</avue-crud>
@@ -35,6 +37,8 @@
</el-dialog>
<!-- 新增编辑弹窗 -->
<addDialog :params="addParams" @refreshTable="this.onLoad" />
+ <!-- 新增候选人 -->
+ <addCandidate :params="addCandidateParams" @refreshTable="this.onLoad" />
</basic-container>
</template>
@@ -49,11 +53,13 @@
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';
import addDialog from './components/addDialog.vue';
+import addCandidate from './components/addCandidate.vue';
import { getDeptTree } from '@/api/system/dept';
export default {
components: {
addDialog,
+ addCandidate
},
data() {
return {
@@ -93,6 +99,8 @@
},
],
},
+ // 新增候选人params
+ addCandidateParams: {},
};
},
watch: {
@@ -104,7 +112,7 @@
type: n,
};
// 更改option
- !n ? (this.option = option) : (this.option = sectionOption)
+ !n ? (this.option = option) : (this.option = sectionOption)
this.page.currentPage = 1;
this.onLoad(this.page, params);
},
@@ -244,14 +252,13 @@
if (['edit', 'view'].includes(type)) {
getDetail(this.form.id).then(res => {
if (type === 'view') {
- this.deptData().then(deptRes => {
- const candidates = [];
- res.data.data.candidateNum.forEach(item => {
- const value = deptRes.find(dept => dept.id === item.deptId);
- candidates.push(`${value.title}: ${item.val || 0}人`);
- });
- this.form.candidateNum = candidates.join('、');
- });
+ const candidates = [];
+ res.data.data.candidateNum.forEach(item => {
+ const users = []
+ item.users.forEach(item => users.push(item.name))
+ candidates.push(`${item.deptName}(${item.val || 0}人): ${users.join('、')}`);
+ })
+ this.form.candidateNum = candidates.join('\n');
}
this.form = res.data.data;
});
@@ -260,10 +267,13 @@
},
searchReset() {
this.query = {};
- this.onLoad(this.page);
+ this.onLoad(this.page, { type: this.defaultTaskType });
},
searchChange(params, done) {
- this.query = params;
+ this.query = {
+ ...params,
+ type: this.defaultTaskType,
+ };
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
@@ -325,9 +335,11 @@
const { id } = this.rowData;
const params = {
id,
+ // candidateState: 1,
+ evaluateState: 1,
evaluateCutoffTime: this.publicForm.publicData,
};
- add(params).then(
+ update(params).then(
res => {
this.$message({
type: 'success',
@@ -344,6 +356,15 @@
);
this.dialogVisible = false;
},
+ addCandidateHandle(row) {
+ this.addCandidateParams = {
+ visible: true,
+ type: 0,
+ data: {
+ ...row
+ }
+ }
+ },
tabChange(value) {
this.defaultTaskType = value.prop;
},
--
Gitblit v1.9.3