| | |
| | |
|
| | | export const getList = (current, size, params) => {
|
| | | return request({
|
| | | url: '/evaluate/evaluateResult/list',
|
| | | // url: '/evaluate/evaluateResult/list',
|
| | | url: 'evaluate/evaluateTaskSet/list',
|
| | | method: 'get',
|
| | | params: {
|
| | | ...params,
|
| | |
| | | export default {
|
| | | height:'auto',
|
| | | export const option = {
|
| | | height: 'auto',
|
| | | calcHeight: 30,
|
| | | tip: false,
|
| | | searchShow: true,
|
| | | searchMenuSpan: 6,
|
| | | border: true,
|
| | | index: true,
|
| | | viewBtn: true,
|
| | | selection: true,
|
| | | viewBtn: false,
|
| | | addBtn: false,
|
| | | menu: false,
|
| | | dialogClickModal: false,
|
| | | column: [
|
| | | {
|
| | | label: "主键",
|
| | | prop: "id",
|
| | | type: "input",
|
| | | addDisplay: false,
|
| | | editDisplay: false,
|
| | | viewDisplay: false,
|
| | | hide: true,
|
| | | },
|
| | | {
|
| | | label: "租户ID",
|
| | | prop: "tenantId",
|
| | | type: "input",
|
| | | addDisplay: false,
|
| | | editDisplay: false,
|
| | | viewDisplay: false,
|
| | | hide: true,
|
| | | },
|
| | | {
|
| | | label: "评优任务",
|
| | | prop: "assessmentTaskId",
|
| | | type: "input",
|
| | | },
|
| | | {
|
| | | label: "被评优的人/部门",
|
| | | prop: "beId",
|
| | | type: "input",
|
| | | },
|
| | | {
|
| | | label: "评优人",
|
| | | prop: "scoreUserId",
|
| | | type: "input",
|
| | | },
|
| | | {
|
| | | label: "评优说明",
|
| | | prop: "remark",
|
| | | type: "input",
|
| | | },
|
| | | {
|
| | | label: "类型(0:员工评优,1:部门评优,2:公司评优)",
|
| | | prop: "type",
|
| | | type: "input",
|
| | | },
|
| | | {
|
| | | label: "创建人",
|
| | | prop: "createUser",
|
| | | type: "input",
|
| | | addDisplay: false,
|
| | | editDisplay: false,
|
| | | viewDisplay: false,
|
| | | hide: true,
|
| | | },
|
| | | {
|
| | | label: "创建部门",
|
| | | prop: "createDept",
|
| | | type: "input",
|
| | | addDisplay: false,
|
| | | editDisplay: false,
|
| | | viewDisplay: false,
|
| | | hide: true,
|
| | | },
|
| | | {
|
| | | label: "创建时间",
|
| | | prop: "createTime",
|
| | | type: "input",
|
| | | addDisplay: false,
|
| | | editDisplay: false,
|
| | | viewDisplay: false,
|
| | | hide: true,
|
| | | },
|
| | | {
|
| | | label: "修改人",
|
| | | prop: "updateUser",
|
| | | type: "input",
|
| | | addDisplay: false,
|
| | | editDisplay: false,
|
| | | viewDisplay: false,
|
| | | hide: true,
|
| | | },
|
| | | {
|
| | | label: "修改时间",
|
| | | prop: "updateTime",
|
| | | type: "input",
|
| | | addDisplay: false,
|
| | | editDisplay: false,
|
| | | viewDisplay: false,
|
| | | hide: true,
|
| | | },
|
| | | {
|
| | | label: "状态",
|
| | | prop: "status",
|
| | | type: "input",
|
| | | addDisplay: false,
|
| | | editDisplay: false,
|
| | | viewDisplay: false,
|
| | | hide: true,
|
| | | },
|
| | | {
|
| | | label: "是否已删除",
|
| | | prop: "isDeleted",
|
| | | type: "input",
|
| | | addDisplay: false,
|
| | | editDisplay: false,
|
| | | viewDisplay: false,
|
| | | hide: true,
|
| | | },
|
| | | ]
|
| | | column: []
|
| | | }
|
| | |
|
| | | export const personColumn = [
|
| | | {
|
| | | label: "评优项目",
|
| | | prop: "evaluateTaskName",
|
| | | type: "input",
|
| | | search: true
|
| | | },
|
| | | {
|
| | | label: "部门",
|
| | | prop: "deptName",
|
| | | type: "input",
|
| | | search: true
|
| | | },
|
| | | {
|
| | | label: "候选人",
|
| | | prop: "userName",
|
| | | type: "input",
|
| | | },
|
| | | {
|
| | | label: "票数",
|
| | | prop: "voteNum",
|
| | | type: "input",
|
| | | },
|
| | | {
|
| | | label: "创建人",
|
| | | prop: "createUser",
|
| | | type: "input",
|
| | | addDisplay: false,
|
| | | editDisplay: false,
|
| | | viewDisplay: false,
|
| | | hide: true,
|
| | | },
|
| | | {
|
| | | label: "创建部门",
|
| | | prop: "createDept",
|
| | | type: "input",
|
| | | addDisplay: false,
|
| | | editDisplay: false,
|
| | | viewDisplay: false,
|
| | | hide: true,
|
| | | },
|
| | | {
|
| | | label: "创建时间",
|
| | | prop: "createTime",
|
| | | type: "input",
|
| | | addDisplay: false,
|
| | | editDisplay: false,
|
| | | viewDisplay: false,
|
| | | hide: true,
|
| | | },
|
| | | {
|
| | | label: "修改人",
|
| | | prop: "updateUser",
|
| | | type: "input",
|
| | | addDisplay: false,
|
| | | editDisplay: false,
|
| | | viewDisplay: false,
|
| | | hide: true,
|
| | | },
|
| | | {
|
| | | label: "修改时间",
|
| | | prop: "updateTime",
|
| | | type: "input",
|
| | | addDisplay: false,
|
| | | editDisplay: false,
|
| | | viewDisplay: false,
|
| | | hide: true,
|
| | | },
|
| | | {
|
| | | label: "状态",
|
| | | prop: "status",
|
| | | type: "input",
|
| | | addDisplay: false,
|
| | | editDisplay: false,
|
| | | viewDisplay: false,
|
| | | hide: true,
|
| | | },
|
| | | {
|
| | | label: "是否已删除",
|
| | | prop: "isDeleted",
|
| | | type: "input",
|
| | | addDisplay: false,
|
| | | editDisplay: false,
|
| | | viewDisplay: false,
|
| | | hide: true,
|
| | | },
|
| | | ]
|
| | |
|
| | | export const sectionColumn = [
|
| | | {
|
| | | label: "评优项目",
|
| | | prop: "evaluateTaskName",
|
| | | type: "input",
|
| | | search: true
|
| | | },
|
| | | {
|
| | | label: "部门",
|
| | | prop: "deptName",
|
| | | type: "input",
|
| | | search: true
|
| | | },
|
| | | {
|
| | | label: "票数",
|
| | | prop: "voteNum",
|
| | | type: "input",
|
| | | },
|
| | | {
|
| | | label: "创建人",
|
| | | prop: "createUser",
|
| | | type: "input",
|
| | | addDisplay: false,
|
| | | editDisplay: false,
|
| | | viewDisplay: false,
|
| | | hide: true,
|
| | | },
|
| | | {
|
| | | label: "创建部门",
|
| | | prop: "createDept",
|
| | | type: "input",
|
| | | addDisplay: false,
|
| | | editDisplay: false,
|
| | | viewDisplay: false,
|
| | | hide: true,
|
| | | },
|
| | | {
|
| | | label: "创建时间",
|
| | | prop: "createTime",
|
| | | type: "input",
|
| | | addDisplay: false,
|
| | | editDisplay: false,
|
| | | viewDisplay: false,
|
| | | hide: true,
|
| | | },
|
| | | {
|
| | | label: "修改人",
|
| | | prop: "updateUser",
|
| | | type: "input",
|
| | | addDisplay: false,
|
| | | editDisplay: false,
|
| | | viewDisplay: false,
|
| | | hide: true,
|
| | | },
|
| | | {
|
| | | label: "修改时间",
|
| | | prop: "updateTime",
|
| | | type: "input",
|
| | | addDisplay: false,
|
| | | editDisplay: false,
|
| | | viewDisplay: false,
|
| | | hide: true,
|
| | | },
|
| | | {
|
| | | label: "状态",
|
| | | prop: "status",
|
| | | type: "input",
|
| | | addDisplay: false,
|
| | | editDisplay: false,
|
| | | viewDisplay: false,
|
| | | hide: true,
|
| | | },
|
| | | {
|
| | | label: "是否已删除",
|
| | | prop: "isDeleted",
|
| | | type: "input",
|
| | | addDisplay: false,
|
| | | editDisplay: false,
|
| | | viewDisplay: false,
|
| | | hide: true,
|
| | | },
|
| | | ]
|
| | |
| | | <el-option label="部门评优" value="1" /> |
| | | </el-select> |
| | | </el-form-item> --> |
| | | <el-form-item :label="params.type ? '评定部门:' : '候选部门:'" prop="candidateNum"> |
| | | <el-form-item :label="params.type ? '评定人:' : '候选部门:'" prop="candidateNum"> |
| | | <el-select v-model="selectGroup" value-key="deptId" multiple style="width: 100%;" placeholder="请选择候选部门"> |
| | | <el-option v-for="dept in depts" :key="dept.deptId" |
| | | :label="dept.employees.length === 0 ? (dept.deptName + '(当前部门下员工人数为0)') : dept.deptName" |
| | |
| | | controls-position="right" :placeholder="`请输入评优数量(最多不可超过${maxEvaluateNum})`" |
| | | class="evaluateNum-input"></el-input-number> |
| | | </el-form-item> |
| | | <el-form-item label="评优截止日期:" prop="evaluateCutoffTime"> |
| | | <!-- <el-form-item label="评优截止日期:" prop="evaluateCutoffTime"> |
| | | <el-date-picker v-model="addForm.evaluateCutoffTime" type="datetime" placeholder="请选择截止时间" |
| | | format="YYYY-MM-DD HH:mm:ss" valueFormat="YYYY-MM-DD HH:mm:ss" style="width: 100%;" /> |
| | | </el-form-item> |
| | | </el-form-item> --> |
| | | </el-form> |
| | | </div> |
| | | <template #footer> |
| | |
| | | deep: true, |
| | | immediate: true, |
| | | }, |
| | | // 拦截candidateNum |
| | | selectGroup: { |
| | | handler(val) { |
| | | this.addForm.candidateNum = []; |
| | |
| | | methods: { |
| | | submitOrEdit() { |
| | | const { candidateNum } = this.addForm |
| | | const isExist = candidateNum.find(item => item.val === void 0 || item.val === 0 || item.users.length === 0) |
| | | const isExist = candidateNum.find(item => item.val === void 0 || item.val === 0) |
| | | if (isExist) { |
| | | this.$message.warning(`${isExist.deptName}候选人人数不可为空或者0`) |
| | | } else { |
| | |
| | | }, |
| | | setDefaultValue(depts) { |
| | | const params = _.cloneDeep(this.params.addForm.candidateNum) || [] |
| | | params.forEach(item => { |
| | | const newParams = params.map(item => { |
| | | const value = depts.find(dept => item.deptId === dept.deptId); |
| | | item.employees = value?.employees || []; |
| | | }); |
| | | this.selectGroup = params; |
| | | return item |
| | | }) |
| | | this.selectGroup = newParams |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | @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 #menu-left>
|
| | | <el-button type="danger" icon="el-icon-delete" plain v-if="permission.evaluateResult_delete"
|
| | | @click="handleDelete">删 除
|
| | | </el-button>
|
| | | <el-button type="warning" plain icon="el-icon-download" @click="handleExport">导 出
|
| | | </el-button>
|
| | | </template>
|
| | | </avue-crud>
|
| | | </basic-container>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import { getList, getDetail, add, update, remove } from "@/api/evaluate/evaluateResult";
|
| | | import option from "@/option/evaluate/evaluateResult";
|
| | | import { option, personColumn, sectionColumn } from "@/option/evaluate/evaluateResult";
|
| | | import { mapGetters } from "vuex";
|
| | | import { exportBlob } from "@/api/common";
|
| | | import { getToken } from '@/utils/auth';
|
| | |
| | | taskTypeList: {
|
| | | column: [
|
| | | {
|
| | | label: '个人评优',
|
| | | label: '个人评优结果',
|
| | | prop: 0,
|
| | | },
|
| | | {
|
| | | label: '部门评优',
|
| | | label: '部门评优结果',
|
| | | prop: 1,
|
| | | },
|
| | | ],
|
| | |
| | | });
|
| | | return ids.join(",");
|
| | | }
|
| | | },
|
| | | watch: {
|
| | | defaultTaskType: {
|
| | | handler(n) {
|
| | | this.query = {};
|
| | | this.query['type'] = n;
|
| | | let params = {
|
| | | type: n,
|
| | | };
|
| | | console.log(option.column.length);
|
| | | if (n) {
|
| | | this.option.column = sectionColumn
|
| | | } else {
|
| | | this.option.column = personColumn
|
| | | }
|
| | | this.page.currentPage = 1;
|
| | | this.onLoad(this.page, params);
|
| | | },
|
| | | immediate: true,
|
| | | },
|
| | | },
|
| | | methods: {
|
| | | rowSave(row, done, loading) {
|
| | |
| | | } = this.query;
|
| | |
|
| | | let values = {
|
| | | ...this.query,
|
| | | ...this.params
|
| | | };
|
| | |
|
| | | getList(page.currentPage, page.pageSize, values).then(res => {
|
| | | console.log(res);
|
| | | console.log(res.data.data.records);
|
| | | const data = res.data.data;
|
| | | this.page.total = data.total;
|
| | | this.data = data.records;
|