9 files modified
2 files added
| | |
| | | }) |
| | | } |
| | | |
| | | // 获取类别 |
| | | export const getEcList = (current, size, evaluateTaskId ) => { |
| | | return request({ |
| | | url: '/evaluate/evaluateTaskCategory/list', |
| | |
| | | } |
| | | }) |
| | | } |
| | | // 更新类别 |
| | | export const upDateEcList = (data) => { |
| | | return request({ |
| | | url: '/evaluate/evaluateTaskCategory/sumbit', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | } |
| | | |
| | | |
| | | // 查询类别候选人 |
| | | export const getEtaskCcList = (current, size, values) => { |
| | | return request({ |
| | | url: '/evaluate/evaluateTaskCategoryCandidate/list', |
| | | method: 'get', |
| | | params: { |
| | | current, |
| | | size, |
| | | ...values |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 添加类别候选人 |
| | | export const addEtaskCc = (data) => { |
| | | return request({ |
| | | url: '/evaluate/evaluateTaskCategoryCandidate/submit', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | } |
| | | |
| | | export const removeEtaskCc = (ids) => { |
| | | return request({ |
| | | url: '/evaluate/evaluateTaskCategoryCandidate/remove', |
| | | method: 'post', |
| | | params: { |
| | | ids, |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | // 获取最终结果 |
| | | // url: '/evaluate/evaluateCandidate/page', |
| | |
| | | display: false, |
| | | width: 100, |
| | | slot: true |
| | | }, |
| | | // { |
| | | // label: "创建人", |
| | | // prop: "createUser", |
| | | // type: "input", |
| | | // hide: true, |
| | | // }, |
| | | // { |
| | | // label: "创建部门", |
| | | // prop: "createDept", |
| | | // type: "input", |
| | | // hide: true, |
| | | // }, |
| | | // { |
| | | // label: "创建时间", |
| | | // prop: "createTime", |
| | | // type: "input", |
| | | // hide: true, |
| | | // }, |
| | | // { |
| | | // label: "修改人", |
| | | // prop: "updateUser", |
| | | // type: "input", |
| | | // hide: true, |
| | | // }, |
| | | // { |
| | | // label: "修改时间", |
| | | // prop: "updateTime", |
| | | // type: "input", |
| | | // hide: true, |
| | | // }, |
| | | // { |
| | | // label: "状态", |
| | | // prop: "status", |
| | | // type: "input", |
| | | // hide: true, |
| | | // }, |
| | | // { |
| | | // label: "是否已删除", |
| | | // prop: "isDeleted", |
| | | // type: "input", |
| | | // hide: true, |
| | | // }, |
| | | } |
| | | ] |
| | | } |
| | |
| | | label: 'dictValue', |
| | | value: 'dictKey', |
| | | }, |
| | | // formatter: (row, value) => { |
| | | // return value.toString() |
| | | // }, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | minWidth: '100px' |
| | | }, |
| | | { |
| | | label: "第二轮结束时间", |
| | | label: "第二轮时间", |
| | | prop: "evaluateCutoffTimeEnd", |
| | | type: "input", |
| | | minWidth: '170px', |
| | |
| | | <div class="box"> |
| | | <el-scrollbar> |
| | | <basic-container> |
| | | <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick"/> |
| | | <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" /> |
| | | </basic-container> |
| | | </el-scrollbar> |
| | | </div> |
| | |
| | | <basic-container> |
| | | <!-- :permission="permissionList" --> |
| | | <avue-crud :option="option" v-model:search="search" :table-loading="loading" :data="data" ref="crud" |
| | | v-model="form" @row-del="rowDel" @row-update="rowUpdate" |
| | | @row-save="rowSave" |
| | | :before-open="beforeOpen" v-model:page="page" @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange" |
| | | @refresh-change="refreshChange" @on-load="onLoad"> |
| | | v-model="form" @row-del="rowDel" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen" |
| | | v-model:page="page" @search-change="searchChange" @search-reset="searchReset" |
| | | @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange" |
| | | @refresh-change="refreshChange" @on-load="onLoad"> |
| | | <template #menu-left> |
| | | <el-button type="danger" plain icon="el-icon-delete" v-if="permission.user_delete" |
| | | @click="handleDelete">删 除 |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | <el-button type="success" plain v-if="userInfo.role_name.includes('admin')" |
| | | icon="el-icon-upload" |
| | | @click="handleImport">导入 |
| | | <el-button type="success" plain v-if="userInfo.role_name.includes('admin')" icon="el-icon-upload" |
| | | @click="handleImport">导入 |
| | | </el-button> |
| | | <el-button type="warning" plain v-if="userInfo.role_name.includes('admin')" |
| | | icon="el-icon-download" |
| | | @click="handleExport">导出 |
| | | <el-button type="warning" plain v-if="userInfo.role_name.includes('admin')" icon="el-icon-download" |
| | | @click="handleExport">导出 |
| | | </el-button> |
| | | </template> |
| | | <template #deptName="{ row }"> |
| | |
| | | resetPassword, |
| | | unlock, |
| | | } from '@/api/system/user'; |
| | | import {option} from '@/option/employee/list' |
| | | import {exportBlob} from '@/api/common'; |
| | | import {getDeptTree, getDeptLazyTree} from '@/api/system/dept'; |
| | | import {getRoleTree} from '@/api/system/role'; |
| | | import {getPostList} from '@/api/system/post'; |
| | | import {mapGetters} from 'vuex'; |
| | | import { option } from '@/option/employee/list' |
| | | import { exportBlob } from '@/api/common'; |
| | | import { getDeptTree, getDeptLazyTree } from '@/api/system/dept'; |
| | | import { getRoleTree } from '@/api/system/role'; |
| | | import { getPostList } from '@/api/system/post'; |
| | | import { mapGetters } from 'vuex'; |
| | | import website from '@/config/website'; |
| | | import {getToken} from '@/utils/auth'; |
| | | import {downloadXls} from '@/utils/util'; |
| | | import { getToken } from '@/utils/auth'; |
| | | import { downloadXls } from '@/utils/util'; |
| | | import NProgress from 'nprogress'; |
| | | import 'nprogress/nprogress.css'; |
| | | import func from '@/utils/func'; |
| | |
| | | const parentId = node.level === 0 ? 0 : node.data.id; |
| | | getDeptLazyTree(parentId).then(res => { |
| | | resolve( |
| | | res.data.data.map(item => { |
| | | return { |
| | | ...item, |
| | | leaf: !item.hasChildren, |
| | | }; |
| | | }) |
| | | res.data.data.map(item => { |
| | | return { |
| | | ...item, |
| | | leaf: !item.hasChildren, |
| | | }; |
| | | }) |
| | | ); |
| | | }); |
| | | }, |
| | |
| | | row.account = row.phone |
| | | row.roleId = '1123598816738675202' |
| | | add(row).then( |
| | | () => { |
| | | this.initFlag = false; |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | done(); |
| | | }, |
| | | error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | | () => { |
| | | this.initFlag = false; |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | done(); |
| | | }, |
| | | error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | | ); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | |
| | | row.roleId = func.join(row.roleId); |
| | | row.postId = func.join(row.postId); |
| | | update(row).then( |
| | | () => { |
| | | this.initFlag = false; |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | done(); |
| | | }, |
| | | error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | | () => { |
| | | this.initFlag = false; |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | done(); |
| | | }, |
| | | error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | | ); |
| | | }, |
| | | rowDel(row) { |
| | |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | .then(() => { |
| | | return remove(row.id); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | }); |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }, |
| | | handleReset() { |
| | | if (this.selectionList.length === 0) { |
| | |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then(() => { |
| | | return resetPassword(this.ids); |
| | | }) |
| | | .then(() => { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | .then(() => { |
| | | return resetPassword(this.ids); |
| | | }) |
| | | .then(() => { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }, |
| | | handleGrant() { |
| | | if (this.selectionList.length === 0) { |
| | |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then(() => { |
| | | return unlock(this.ids); |
| | | }) |
| | | .then(() => { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | .then(() => { |
| | | return unlock(this.ids); |
| | | }) |
| | | .then(() => { |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | }); |
| | | }, |
| | | handleImport() { |
| | | this.excelBox = true; |
| | |
| | | }).then(() => { |
| | | NProgress.start(); |
| | | exportBlob( |
| | | `/blade-system/user/export-user?${this.website.tokenHeader |
| | | }=${getToken()}&account=${account}&realName=${realName}` |
| | | `/blade-system/user/export-user?${this.website.tokenHeader |
| | | }=${getToken()}&account=${account}&realName=${realName}` |
| | | ).then(res => { |
| | | downloadXls(res.data, `用户数据表${this.$dayjs().format('YYYY-MM-DD')}.xlsx`); |
| | | NProgress.done(); |
| | |
| | | }, |
| | | handleTemplate() { |
| | | exportBlob( |
| | | `/blade-system/user/export-template?${this.website.tokenHeader}=${getToken()}` |
| | | `/blade-system/user/export-template?${this.website.tokenHeader}=${getToken()}` |
| | | ).then(res => { |
| | | downloadXls(res.data, '用户数据模板.xlsx'); |
| | | }); |
| | |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | getList( |
| | | page.currentPage, |
| | | page.pageSize, |
| | | // Object.assign(params, this.query), |
| | | Object.assign(params, { |
| | | ...this.query, |
| | | userType: 2 |
| | | }), |
| | | this.treeDeptId |
| | | page.currentPage, |
| | | page.pageSize, |
| | | // Object.assign(params, this.query), |
| | | Object.assign(params, { |
| | | ...this.query, |
| | | userType: 2 |
| | | }), |
| | | this.treeDeptId |
| | | ).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | |
| | | }, |
| | | platformRowUpdate(row, index, done, loading) { |
| | | updatePlatform(row.id, row.userType, row.userExt).then( |
| | | () => { |
| | | this.platformOnLoad(this.platformPage); |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | done(); |
| | | }, |
| | | error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | | () => { |
| | | this.platformOnLoad(this.platformPage); |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '操作成功!', |
| | | }); |
| | | done(); |
| | | }, |
| | | error => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | | ); |
| | | }, |
| | | platformBeforeOpen(done, type) { |
| | |
| | | platformOnLoad(page, params = {}) { |
| | | this.platformLoading = true; |
| | | getList( |
| | | page.currentPage, |
| | | page.pageSize, |
| | | // Object.assign(params, this.query), |
| | | Object.assign(params, { |
| | | ...this.query, |
| | | userType: 2 |
| | | }), |
| | | this.treeDeptId |
| | | page.currentPage, |
| | | page.pageSize, |
| | | // Object.assign(params, this.query), |
| | | Object.assign(params, { |
| | | ...this.query, |
| | | userType: 2 |
| | | }), |
| | | this.treeDeptId |
| | | ).then(res => { |
| | | const data = res.data.data; |
| | | this.platformPage.total = data.total; |
| | |
| | | |
| | | :deep() { |
| | | .el-tree-node__children { |
| | | .el-tree-node[aria-checked = 'false'] { |
| | | .el-tree-node[aria-checked='false'] { |
| | | position: relative; |
| | | |
| | | &::after, |
| | |
| | | <template> |
| | | <el-dialog v-model="params.visible" title="发布评优任务" width="50%" @open="openDialog" @close="dialogClose"> |
| | | <el-dialog v-model="params.visible" :title="`发布评优任务(${params.data?.taskName || ''})`" width="50%" @open="openDialog" @close="dialogClose"> |
| | | <div class="content"> |
| | | <el-form :model="form" ref="formRef" :rules="rules" label-position="top"> |
| | | <el-form-item label="任务类别" prop="taskType"> |
| | | <el-form-item prop="categoryEntities"> |
| | | <template #label> |
| | | 评优类别 |
| | | <el-button type="primary" icon="el-icon-view" text>查看第一轮候选结果</el-button> |
| | | </template> |
| | | <ul class="type-list"> |
| | | <li class="type-item"> |
| | | <div class="title">类别</div> |
| | |
| | | <div class="number">名额</div> |
| | | <div class="tool">操作</div> |
| | | </li> |
| | | <li class="type-item" v-for="(item, index) in form.taskType" :key="index"> |
| | | <div class="title">{{ item.title }}</div> |
| | | <li class="type-item" v-for="(item, index) in form.categoryEntities" :key="index"> |
| | | <div class="title">{{ item.categoryName }}</div> |
| | | <el-tooltip effect="dark" placement="top"> |
| | | <template #content> |
| | | <p style="width: 500px;">{{ item.introduction }}</p> |
| | | <p style="max-width: 500px;">{{ item.standard }}</p> |
| | | </template> |
| | | <div class="introduction"> |
| | | {{ item.introduction }} |
| | | {{ item.standard }} |
| | | </div> |
| | | </el-tooltip> |
| | | |
| | | <div class="number">{{ item.number }}</div> |
| | | <div class="number">{{ item.peopleNum }}</div> |
| | | <div class="tool"> |
| | | <el-button type="primary" icon="el-icon-plus" text>添加候选人</el-button> |
| | | <el-button type="primary" icon="el-icon-plus" text @click="addEcCandidateHandler(item)">添加候选人</el-button> |
| | | </div> |
| | | </li> |
| | | </ul> |
| | | </el-form-item> |
| | | <el-form-item label="投票人员" prop="employees"> |
| | | <el-checkbox-group v-model="form.employees"> |
| | | <el-form-item label="投票人员" prop="pollingPersons"> |
| | | <el-checkbox-group v-model="form.pollingPersons"> |
| | | <el-checkbox v-for="item in employeeDict" :key="item.id" :label="item.dictKey"> |
| | | {{ item.dictValue }} |
| | | </el-checkbox> |
| | | </el-checkbox-group> |
| | | </el-form-item> |
| | | <el-form-item label="第二轮任务结束时间" required> |
| | | <el-form-item class="time-box" prop="candidateCutoffTimeStart"> |
| | | <el-date-picker v-model="form.candidateCutoffTimeStart" type="datetime" placeholder="请选择任务开始时间" |
| | | <el-form-item class="time-box" prop="evaluateCutoffTimeStart"> |
| | | <el-date-picker v-model="form.evaluateCutoffTimeStart" type="datetime" placeholder="请选择任务开始时间" |
| | | value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%;" /> |
| | | </el-form-item> |
| | | <span class="time-span">至</span> |
| | | <el-form-item class="time-box" prop="candidateCutoffTimeEnd"> |
| | | <el-date-picker v-model="form.candidateCutoffTimeEnd" type="datetime" placeholder="请选择任务结束时间" |
| | | <el-form-item class="time-box" prop="evaluateCutoffTimeEnd"> |
| | | <el-date-picker v-model="form.evaluateCutoffTimeEnd" type="datetime" placeholder="请选择任务结束时间" |
| | | value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%;" /> |
| | | </el-form-item> |
| | | </el-form-item> |
| | |
| | | </div> |
| | | <template #footer> |
| | | <el-button @click="() => params.visible = false">取消</el-button> |
| | | <el-button type="primary">确定发布</el-button> |
| | | <el-button type="primary" @click="taskPublic">确认发布</el-button> |
| | | </template> |
| | | <addEcCandidate :params="addEcCandidateParams" /> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import _ from 'lodash'; |
| | | import { getDict } from '@/api/dict' |
| | | import { getEcList } from '@/api/evaluate/evaluateTask' |
| | | import { update, getEcList } from '@/api/evaluate/evaluateTask' |
| | | import addEcCandidate from './addEcCandidate.vue'; |
| | | |
| | | export default { |
| | | components: { |
| | | addEcCandidate |
| | | }, |
| | | props: { |
| | | params: { |
| | | type: Object, |
| | |
| | | return { |
| | | employeeDict: [], |
| | | form: { |
| | | taskType: [], |
| | | employees: [], |
| | | candidateCutoffTimeStart: '', |
| | | candidateCutoffTimeEnd: '' |
| | | categoryEntities: [], |
| | | pollingPersons: [], |
| | | evaluateCutoffTimeStart: '', |
| | | evaluateCutoffTimeEnd: '' |
| | | }, |
| | | rules: { |
| | | taskType: [ |
| | | categoryEntities: [ |
| | | { required: true, message: '任务类别不可为空', trigger: 'click' }, |
| | | ], |
| | | employees: [ |
| | | pollingPersons: [ |
| | | { required: true, message: '请选择评定人员', trigger: 'click' }, |
| | | ], |
| | | candidateCutoffTimeStart: [ |
| | | evaluateCutoffTimeStart: [ |
| | | { required: true, message: '请选择任务开始时间', trigger: 'click' }, |
| | | ], |
| | | candidateCutoffTimeEnd: [ |
| | | evaluateCutoffTimeEnd: [ |
| | | { required: true, message: '请选择任务开始时间', trigger: 'click' }, |
| | | ] |
| | | }, |
| | | page: { |
| | | current: 1, |
| | | size: 10, |
| | | size: 100, |
| | | total: 0 |
| | | } |
| | | }, |
| | | addEcCandidateParams: {} |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | const { id } = this.params.data |
| | | const { current, size } = this.page |
| | | getEcList(current, size, id).then(ecResult => { |
| | | const { code, data } = ecResult.data |
| | | console.log(data); |
| | | const { code, data: { records } } = ecResult.data |
| | | if (code !== 200) return this.$message.error('评优类别加载失败') |
| | | this.form.categoryEntities = records |
| | | }) |
| | | }, |
| | | initDict() { |
| | |
| | | } |
| | | this.employeeDict = data |
| | | }) |
| | | }, |
| | | taskPublic() { |
| | | this.$refs.formRef.validate(valid => { |
| | | if (!valid) return |
| | | const data = _.cloneDeep(this.form) |
| | | const { id } = this.params.data |
| | | data.id = id |
| | | data.candidateState = 2 |
| | | data.evaluateState = 1 |
| | | data.pollingPersons = data.pollingPersons.join(',') |
| | | delete data.categoryEntities |
| | | update(data).then(res => { |
| | | if (res.data.code !== 200) return |
| | | this.params.visible = false |
| | | this.$emit('refreshTable', { currentPage:1, pageSize: 10 }) |
| | | }) |
| | | }) |
| | | }, |
| | | addEcCandidateHandler(row) { |
| | | this.addEcCandidateParams = { |
| | | visible: true, |
| | | data: row |
| | | } |
| | | } |
| | | } |
| | | }; |
| New file |
| | |
| | | <template> |
| | | <el-dialog v-model="params.visible" :title="params.data?.categoryName || '添加类别候选人'" width="50%"> |
| | | <avue-crud :option="option" v-model:search="search" v-model:page="page" v-model="form" :table-loading="loading" |
| | | :data="data" :before-open="beforeOpen" ref="crud" @row-update="rowUpdate" |
| | | @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 #menu-left> |
| | | <el-button icon="el-icon-plus" type="primary" @click="addCandidateDailog">新增{{ params.data.categoryName }}</el-button> |
| | | </template> |
| | | </avue-crud> |
| | | <candidateDialog :params="candidateDailogParams" @refreshTable="this.onLoad"/> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getEtaskCcList, removeEtaskCc } from '@/api/evaluate/evaluateTask' |
| | | import { exportBlob } from "@/api/common"; |
| | | import { getToken } from '@/utils/auth'; |
| | | import { downloadXls } from "@/utils/util"; |
| | | import { dateNow } from "@/utils/date"; |
| | | import NProgress from 'nprogress'; |
| | | import 'nprogress/nprogress.css'; |
| | | import candidateDialog from './candidateDialog.vue' |
| | | |
| | | export default { |
| | | components: { |
| | | candidateDialog |
| | | }, |
| | | props: { |
| | | params: { |
| | | type: Object, |
| | | default: () => { |
| | | return { |
| | | visible: false, |
| | | data: {} |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | form: {}, |
| | | query: {}, |
| | | search: {}, |
| | | loading: true, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0 |
| | | }, |
| | | selectionList: [], |
| | | option: { |
| | | height: '300', |
| | | calcHeight: 30, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: true, |
| | | index: true, |
| | | viewBtn: false, |
| | | editBtn: false, |
| | | addBtn: false, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: '姓名', |
| | | prop: 'userName', |
| | | type: 'input' |
| | | }, |
| | | { |
| | | label: '职位', |
| | | prop: 'postName', |
| | | type: 'input' |
| | | }, |
| | | { |
| | | label: '部门', |
| | | prop: 'deptName', |
| | | type: 'input' |
| | | } |
| | | ] |
| | | }, |
| | | data: [], |
| | | candidateDailogParams: {} |
| | | }; |
| | | }, |
| | | computed: { |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach(ele => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | } |
| | | }, |
| | | methods: { |
| | | rowSave(row, done, loading) { |
| | | add(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | loading(); |
| | | window.console.log(error); |
| | | }); |
| | | }, |
| | | addCandidateDailog() { |
| | | this.candidateDailogParams = { |
| | | visible: true, |
| | | data: this.params.data |
| | | } |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | update(row).then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | done(); |
| | | }, error => { |
| | | loading(); |
| | | console.log(error); |
| | | }); |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return removeEtaskCc(row.id); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | }); |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | return removeEtaskCc(this.ids); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!" |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }, |
| | | handleExport() { |
| | | let downloadUrl = `/evaluate/evaluateResult/export-evaluateResult?${this.website.tokenHeader}=${getToken()}`; |
| | | const { |
| | | } = this.query; |
| | | let values = { |
| | | }; |
| | | this.$confirm("是否导出数据?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }).then(() => { |
| | | NProgress.start(); |
| | | exportBlob(downloadUrl, values).then(res => { |
| | | downloadXls(res.data, `评优结果${dateNow()}.xlsx`); |
| | | NProgress.done(); |
| | | }) |
| | | }); |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then(res => { |
| | | this.form = res.data.data; |
| | | }); |
| | | } |
| | | done(); |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = { |
| | | type: this.defaultTaskType, |
| | | ...params |
| | | }; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | this.loading = true; |
| | | const { id } = this.params.data |
| | | |
| | | const { |
| | | } = this.query; |
| | | |
| | | let values = { |
| | | ...this.query, |
| | | ...params, |
| | | evaluateTaskCategoryId: id, |
| | | }; |
| | | |
| | | getEtaskCcList(page.currentPage, page.pageSize, values).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | }, |
| | | } |
| | | }; |
| | | </script> |
| | |
| | | <el-form-item label="任务名称" prop="taskName"> |
| | | <el-input v-model="form.taskName" placeholder="请输入任务名称"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="任务类别" prop="categoryEntities"> |
| | | <el-form-item label="评优类别" prop="categoryEntities"> |
| | | <ul class="type-list"> |
| | | <li class="type-item"> |
| | | <div class="title">类别</div> |
| | |
| | | <el-input type="textarea" v-model="taskTypeForm.standard" placeholder="请输入认定标准"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="名额" prop="peopleNum"> |
| | | <el-input v-model="taskTypeForm.peopleNum" placeholder="请输入名额数量"></el-input> |
| | | <el-input-number v-model="taskTypeForm.peopleNum" placeholder="请输入名额数量" controls-position="right"></el-input-number> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | |
| | | addEvaluateTask() { |
| | | this.$refs.formRef.validate(valid => { |
| | | if (!valid) return |
| | | const data = { |
| | | ..._.cloneDeep(this.form), |
| | | type: this.type() |
| | | } |
| | | add(this.form).then(res => { |
| | | // if () |
| | | console.log(res); |
| | | if (res.data.code !== 200) return |
| | | this.$emit('refreshTable', { currentPage: 1, pageSize: 10 }) |
| | | this.$message.success('添加成功') |
| | | this.params.visible = false |
| | | }) |
| | | }) |
| | | } |
| New file |
| | |
| | | <template> |
| | | <el-dialog v-model="props.params.visible" title="添加考核人" @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-form-item label="部门" prop="deptId"> |
| | | <el-cascader v-model="form.deptId" :props="cascaderProps" placeholder="请选择部门" @change="deptChange" |
| | | style="width: 100%;" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <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" |
| | | :value="item.id" /> |
| | | <div class="loading-more" @click="loadMore">{{ loadingMoreText }}</div> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="职务"> |
| | | <el-input v-model="form.postName" placeholder="请填写职务" disabled /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <el-button @click="() => props.params.visible = false">取消</el-button> |
| | | <el-button type="primary" @click="submit">确定</el-button> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { computed, markRaw, reactive, ref, watch } from 'vue'; |
| | | import { getDeptLazyTree } from '@/api/system/dept.js' |
| | | import { getList } from '@/api/system/user.js' |
| | | import { ElMessage } from 'element-plus'; |
| | | import { addEtaskCc } from '@/api/evaluate/evaluateTask' |
| | | |
| | | const props = defineProps({ |
| | | params: { |
| | | type: Object, |
| | | default: () => { } |
| | | }, |
| | | }) |
| | | |
| | | const emits = defineEmits(['refresh']) |
| | | |
| | | const curType = ref() |
| | | |
| | | const formRef = ref(null) |
| | | |
| | | const form = reactive({ |
| | | evaluateTaskCategoryId: '', |
| | | userId: '', |
| | | userName: '', |
| | | deptId: '', |
| | | deptName: '', |
| | | postName: '' |
| | | }) |
| | | |
| | | |
| | | const rules = markRaw({ |
| | | userId: [ |
| | | { |
| | | required: true, |
| | | message: '请选择候选人', |
| | | trigger: 'click', |
| | | } |
| | | ], |
| | | deptId: [ |
| | | { |
| | | required: true, |
| | | message: '请选择部门', |
| | | trigger: 'click', |
| | | } |
| | | ] |
| | | }) |
| | | |
| | | const requestParams = reactive({ |
| | | evaluateTaskCategoryId: '', |
| | | userId: '', |
| | | userName: '', |
| | | deptId: '', |
| | | deptName: '', |
| | | postName: '' |
| | | }) |
| | | |
| | | const currentDeptId = ref('') |
| | | |
| | | |
| | | const deptList = ref([]) |
| | | |
| | | // options 数据 |
| | | const userSelectOption = ref([]) |
| | | |
| | | // 懒加载 |
| | | const isOptionsLoading = ref(false) |
| | | |
| | | const loadingMoreText = computed(() => { |
| | | if (userSelectOption.value.length >= page.total) { |
| | | return '数据已全部加载完成' |
| | | } |
| | | if (isOptionsLoading.value) { |
| | | return '加载中...' |
| | | } |
| | | if (!isOptionsLoading.value) { |
| | | return '点击加载更多' |
| | | } |
| | | }) |
| | | // 分页 |
| | | const page = reactive({ |
| | | current: 1, |
| | | size: 10, |
| | | total: 0 |
| | | }) |
| | | |
| | | const loadMore = async () => { |
| | | isOptionsLoading.value = true |
| | | page.current += 1 |
| | | const res = await initUserList(currentDeptId.value) |
| | | userSelectOption.value = [...userSelectOption.value, ...res] |
| | | isOptionsLoading.value = false |
| | | } |
| | | |
| | | // 初始化部门数据 |
| | | const initDept = async (parentId) => { |
| | | const deptResult = await getDeptLazyTree(parentId) |
| | | return deptResult.data.data |
| | | } |
| | | |
| | | // 初始化用户列表 |
| | | const initUserList = (deptId) => { |
| | | return getList( |
| | | page.current, |
| | | page.size, |
| | | { |
| | | userType: 2, |
| | | }, |
| | | deptId, |
| | | ).then(res => { |
| | | page.total = res.data.data.total |
| | | return res.data.data.records |
| | | }) |
| | | } |
| | | |
| | | |
| | | // 选择部门改变 |
| | | const deptChange = async (value) => { |
| | | const id = value[value.length - 1] |
| | | currentDeptId.value = id |
| | | const userList = await initUserList(id) |
| | | userSelectOption.value = userList |
| | | } |
| | | |
| | | // 级联配置 |
| | | const cascaderProps = { |
| | | lazy: true, |
| | | label: 'title', |
| | | value: 'id', |
| | | multiple: false, |
| | | lazyLoad: async (node, resovle) => { |
| | | 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) |
| | | } |
| | | }, |
| | | leaf(node) { |
| | | const { hasChildren } = node |
| | | return !hasChildren |
| | | } |
| | | } |
| | | |
| | | const userSelectChange = (value) => { |
| | | const obj = userSelectOption.value.find(item => item.id == value) |
| | | const { id, deptName, deptId, postName, realName } = obj |
| | | requestParams.userId = id |
| | | requestParams.deptId = deptId |
| | | requestParams.userName = realName |
| | | requestParams.deptName = deptName |
| | | requestParams.postName = postName |
| | | |
| | | form.deptName = deptName |
| | | form.postName = postName |
| | | } |
| | | |
| | | const submit = () => { |
| | | formRef.value.validate(valid => { |
| | | if (!valid) return ElMessage.error('添加候选人失败') |
| | | addEtaskCc(requestParams).then(res => { |
| | | ElMessage.success('添加候选人成功') |
| | | props.params.visible = false |
| | | emits('refreshTable', { |
| | | currentPage: 1, |
| | | pageSize: 10, |
| | | }) |
| | | }, error => { |
| | | ElMessage.error(error) |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | const dialogClose = () => { |
| | | formRef.value.resetFields() |
| | | } |
| | | |
| | | watch(() => props.params.visible, (val) => { |
| | | if (!val) return |
| | | const { id } = props.params.data |
| | | requestParams.evaluateTaskCategoryId = id |
| | | |
| | | }, { |
| | | deep: true |
| | | }) |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .loading-more { |
| | | text-align: center; |
| | | cursor: pointer; |
| | | } |
| | | </style> |
| | |
| | |
|
| | | let values = {
|
| | | ...this.query,
|
| | | ...this.params
|
| | | ...params
|
| | | };
|
| | |
|
| | | getList(page.currentPage, page.pageSize, values).then(res => {
|
| | |
| | | </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" text plain icon="el-icon-position" |
| | | <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="danger" text plain icon="el-icon-delete" @click="rowDel(row)">删除</el-button> |
| | | </template> |
| | |
| | | } |
| | | }, |
| | | taskPublicDialog(row) { |
| | | console.log(row); |
| | | this.taskPublicParams = { |
| | | visible: true, |
| | | data: row |