| | |
| | | label: '手机号', |
| | | prop: 'phone', |
| | | slot: true, |
| | | search: true, |
| | | display: false, |
| | | }, |
| | | ], |
| | |
| | | minWidth: '100px' |
| | | }, |
| | | { |
| | | label: "第一轮结束时间", |
| | | label: "第一轮时间", |
| | | prop: "candidateCutoffTimeEnd", |
| | | type: "input", |
| | | minWidth: '170px' |
| | | minWidth: '170px', |
| | | isSlot: true |
| | | }, |
| | | { |
| | | label: "评优数量", |
| | |
| | | label: "第二轮结束时间", |
| | | prop: "evaluateCutoffTimeEnd", |
| | | type: "input", |
| | | minWidth: '170px' |
| | | minWidth: '170px', |
| | | isSlot: true |
| | | }, |
| | | { |
| | | label: "创建人", |
| | |
| | | <div class="tips"> |
| | | <el-tag style="width: 100%;" size="large">当前评优任务:{{ tipInfo.evaluateTaskName }}</el-tag> |
| | | <div class="tags"> |
| | | <el-tag size="large" class="item">候选人姓名:{{ tipInfo.userName }}</el-tag> |
| | | <el-tag size="large" class="item">候选人部门:{{ tipInfo.deptName }}</el-tag> |
| | | <el-tag size="large" class="item">候选人职位:{{ tipInfo.postName }}</el-tag> |
| | | <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"> |
| | |
| | | } |
| | | }) |
| | | |
| | | const type = inject('type') |
| | | const curType = computed(() => type()) |
| | | |
| | | const tableOption = markRaw({ |
| | | height: '240', |
| | | calcHeight: 30, |
| | |
| | | <template> |
| | | <el-dialog v-model="props.dialogParams.visible" title="添加候选人" @close="dialogClose"> |
| | | <el-dialog v-model="props.dialogParams.visible" :title="`${curType ? '添加候选部门' : '添加候选人'}`" @close="dialogClose"> |
| | | <div style="margin-bottom: 20px;" v-if="!form.deptId"> |
| | | <el-alert title="请先选择部门信息" type="warning" /> |
| | | </div> |
| | | <el-form :model="form" ref="formRef" :rules="rules" label-width="70px"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-col :span="!curType ? 12 : 24"> |
| | | <el-form-item label="部门" prop="deptId"> |
| | | <el-cascader v-model="form.deptId" :props="cascaderProps" placeholder="请选择部门" @change="deptChange" style="width: 100%;" /> |
| | | <el-cascader v-model="form.deptId" :props="cascaderProps" placeholder="请选择部门" @change="deptChange" |
| | | style="width: 100%;" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-col :span="12" v-if="!curType"> |
| | | <el-form-item label="候选人" prop="userId"> |
| | | <el-select v-model="form.userId" placeholder="请选择候选人" |
| | | :disabled="userSelectOption.length > 0 ? false : true" @change="userSelectChange" |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-col :span="12" v-if="!curType"> |
| | | <el-form-item label="职务"> |
| | | <el-input v-model="form.postName" placeholder="请填写职务" disabled /> |
| | | </el-form-item> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { computed, markRaw, reactive, ref, watch } from 'vue'; |
| | | import { computed, inject, markRaw, reactive, ref, watch } from 'vue'; |
| | | import { getDeptLazyTree } from '@/api/system/dept.js' |
| | | import { getList } from '@/api/system/user.js' |
| | | import { addCandidate } from '@/api/evaluate/evaluateTask' |
| | |
| | | deptName: '', |
| | | postName: '' |
| | | }) |
| | | |
| | | const type = inject('type') |
| | | const curType = computed(() => type()) |
| | | |
| | | const rules = markRaw({ |
| | | userId: [ |
| | |
| | | postName: '' |
| | | }) |
| | | |
| | | const requestSectionParams = reactive({ |
| | | evaluateTaskId: '', |
| | | evaluateTaskName: '', |
| | | deptId: '', |
| | | deptName: '' |
| | | }) |
| | | |
| | | // 当前部门 |
| | | const currentDeptId = ref('') |
| | | |
| | | |
| | | const deptList = ref([]) |
| | | |
| | | // options 数据 |
| | | const userSelectOption = ref([]) |
| | |
| | | }) |
| | | } |
| | | |
| | | |
| | | // 选择部门改变 |
| | | const deptChange = async (value) => { |
| | | const id = value[value.length - 1] |
| | | currentDeptId.value = id |
| | | const userList = await initUserList(id) |
| | | userSelectOption.value = userList |
| | | if (!curType) { |
| | | const userList = await initUserList(id) |
| | | userSelectOption.value = userList |
| | | } else { |
| | | const dept = deptList.value.find(item => item.id == id) |
| | | requestSectionParams.deptId = dept.value || '' |
| | | requestSectionParams.deptName = dept.title || '' |
| | | console.log(requestSectionParams); |
| | | } |
| | | } |
| | | |
| | | // 级联配置 |
| | |
| | | const level = node.level || 0 |
| | | if (level == 0) { |
| | | const res = await initDept(level) |
| | | deptList.value = res |
| | | resovle(res) |
| | | } else { |
| | | const { value } = node |
| | | const res = await initDept(value) |
| | | deptList.value = res |
| | | resovle(res) |
| | | } |
| | | }, |
| | |
| | | const submit = () => { |
| | | formRef.value.validate(valid => { |
| | | if (!valid) return ElMessage.error('添加候选人失败') |
| | | addCandidate(requestParams).then(res => { |
| | | const params = curType? requestSectionParams : requestParams |
| | | addCandidate(params).then(res => { |
| | | ElMessage.success('添加候选人成功') |
| | | props.dialogParams.visible = false |
| | | emits('refresh') |
| | |
| | | watch(() => props.dialogParams.visible, (val) => { |
| | | if (!val) return |
| | | const { evaluateTaskId, evaluateTaskName } = props.dialogParams.taskParams |
| | | requestParams.evaluateTaskName = evaluateTaskName |
| | | requestParams.evaluateTaskId = evaluateTaskId |
| | | if (!curType) { |
| | | requestParams.evaluateTaskName = evaluateTaskName |
| | | requestParams.evaluateTaskId = evaluateTaskId |
| | | } else { |
| | | requestSectionParams.evaluateTaskName = evaluateTaskName |
| | | requestSectionParams.evaluateTaskId = evaluateTaskId |
| | | } |
| | | |
| | | }, { |
| | | deep: true |
| | | }) |
| | |
| | | }, |
| | | handleSubmit() { |
| | | this.$refs.addFormRef.validate(valid => { |
| | | this.params.type && (data.evaluateState = 1) |
| | | if (!valid) return |
| | | const data = _.cloneDeep(this.addForm) |
| | | this.params.type && (data.evaluateState = 1) |
| | | Object.keys(data).forEach(key => { |
| | | if (['candidateCutoffTime', 'evaluateCutoffTime'].includes(key)) { |
| | | const [start, end] = this.addForm[key] |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="候选人" prop="userId"> |
| | | <el-select v-model="form.userId" placeholder="请选择候选人" |
| | | <el-form-item label="评定人" prop="userId"> |
| | | <el-select v-model="form.userId" placeholder="请选择评选人" |
| | | :disabled="userSelectOption.length > 0 ? false : true" @change="userSelectChange" |
| | | style="width: 100%;"> |
| | | <el-option v-for="item in userSelectOption" :label="item.name" :key="item.id" |
| | |
| | | <template> |
| | | <el-dialog v-model="props.params.visible" :title="`${taskParams.evaluateTaskName}-候选人列表`" width="60%" destroy-on-close |
| | | <el-dialog v-model="props.params.visible" :title="`${taskParams.evaluateTaskName}-${curType ? '部门列表' : '候选人列表'}`" width="60%" destroy-on-close |
| | | align-center> |
| | | <avue-crud :data="table.data" :option="candidatesOptions" v-model:page="table.page" @refresh-change="refreshChange"> |
| | | <avue-crud :data="table.data" :option="option" v-model:page="table.page" @refresh-change="refreshChange"> |
| | | <template #menu-left> |
| | | <el-button type="primary" icon="el-icon-plus" @click="addCandidateDialog">新增候选人</el-button> |
| | | <el-button type="primary" icon="el-icon-plus" @click="addCandidateDialog"> |
| | | {{ curType? '添加部门' : '添加候选人' }} |
| | | </el-button> |
| | | </template> |
| | | <template #menu="{ row }"> |
| | | <el-button type="primary" icon="el-icon-plus" text plain @click="addAssessor(row)">添加评定人</el-button> |
| | |
| | | <script setup> |
| | | import addCandidate from './addCandidate.vue'; |
| | | import addAssessors from './addAssessors.vue'; |
| | | import { markRaw, reactive, watch } from 'vue'; |
| | | import { computed, inject, markRaw, reactive, watch } from 'vue'; |
| | | import { getCandidateList, removeCandidate } from '@/api/evaluate/evaluateTask' |
| | | import { ElMessage } from 'element-plus'; |
| | | |
| | |
| | | visible: false, |
| | | taskParams: {} |
| | | }) |
| | | |
| | | const type = inject('type') |
| | | |
| | | const props = defineProps({ |
| | | params: { |
| | |
| | | ] |
| | | }) |
| | | |
| | | const setcionOptions = markRaw({ |
| | | height: '400', |
| | | 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', |
| | | column: [ |
| | | { |
| | | label: '任务id', |
| | | prop: 'evaluateTaskId', |
| | | type: 'input', |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: '任务名称', |
| | | prop: 'evaluateTaskName', |
| | | type: 'input' |
| | | }, |
| | | { |
| | | label: '部门id', |
| | | prop: 'deptId', |
| | | type: 'input', |
| | | hide: true, |
| | | }, |
| | | { |
| | | label: '部门名称', |
| | | prop: 'deptName', |
| | | type: 'input' |
| | | }, |
| | | ] |
| | | }) |
| | | |
| | | const option = computed(() => type() ? setcionOptions : candidatesOptions) |
| | | |
| | | const table = reactive({ |
| | | data: [], |
| | | page: { |
| | |
| | | candidateInfo: {} |
| | | }) |
| | | |
| | | const curType = computed(() => type()) |
| | | |
| | | const addAssessor = (row) => { |
| | | dialogAssessorParams.visible = true |
| | | dialogAssessorParams.taskInfo = taskParams |
| | |
| | | <!-- <el-button type="primary" text plain icon="el-icon-download">导出</el-button> --> |
| | | <el-button type="danger" text plain icon="el-icon-delete" @click="rowDel(row)">删除</el-button> |
| | | </template> |
| | | <template #candidateCutoffTimeEnd="{ row }"> |
| | | {{ row.candidateCutoffTimeStart || '开始时间为完善' }} |
| | | <div style="text-align: center;">-</div> |
| | | {{ row.candidateCutoffTimeEnd || '结束时间为完善' }} |
| | | </template> |
| | | <template #evaluateCutoffTimeEnd="{ row }"> |
| | | {{ row.evaluateCutoffTimeStart || '开始时间为完善' }} |
| | | <div style="text-align: center;">-</div> |
| | | {{ row.candidateCutoffTimeEnd || '结束时间为完善' }} |
| | | </template> |
| | | </avue-crud> |
| | | <!-- 新增编辑弹窗 --> |
| | | <add-dialog :params="addParams" @refreshTable="this.onLoad" /> |
| | |
| | | taskSettingDialog(row) { |
| | | this.taskSettingParams = { |
| | | visible: true, |
| | | type: this.defaultTaskType, |
| | | task: row |
| | | } |
| | | } |
| | | }, |
| | | provide() { |
| | | return { |
| | | type: () => this.defaultTaskType |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |