| | |
| | | <basic-container> |
| | | <template v-if="isWeight"> |
| | | <avue-tabs :option="taskTypeList" @change="tabChange"></avue-tabs> |
| | | <avue-crud ref="crud" v-model="form" v-model:search="search" :option="option" :data="data" v-model:page="page" |
| | | @search-change="searchChange" @search-reset="searchReset" @current-change="currentChange" |
| | | @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad"> |
| | | <avue-crud ref="crud" v-model="form" v-model:search="search" :option="!defaultTaskType ? option : deptOption" |
| | | :data="data" v-model:page="page" @search-change="searchChange" @search-reset="searchReset" |
| | | @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad"> |
| | | <template #menu="{ size, row, index }"> |
| | | <el-button type="primary" size="small" @click="handleWeight(row)"> |
| | | 考核权重 |
| | |
| | | <script> |
| | | import assessmentWeight from './components/assessmentWeight.vue' |
| | | import { getList } from '@/api/system/user.js' |
| | | import { getdeptList } from '@/api/assessment/assessmentSet.js' |
| | | import { getLazyList } from '@/api/system/dept'; |
| | | |
| | | export default { |
| | | components: { |
| | |
| | | }, |
| | | ] |
| | | }, |
| | | deptOption: { |
| | | height: 'auto', |
| | | calcHeight: 32, |
| | | tip: true, |
| | | searchMenuSpan: 6, |
| | | border: true, |
| | | index: true, |
| | | addBtn: false, |
| | | viewBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | menuWidth: 200, |
| | | column: [ |
| | | { |
| | | label: '部门名称', |
| | | prop: 'deptName', |
| | | search: true, |
| | | }, |
| | | { |
| | | label: '部门全称', |
| | | prop: 'fullName', |
| | | // search: true, |
| | | }, |
| | | { |
| | | label: '机构类型', |
| | | prop: 'deptCategory', |
| | | type: 'input' |
| | | } |
| | | ], |
| | | }, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | |
| | | } |
| | | ] |
| | | }, |
| | | isDeptRequest: true |
| | | } |
| | | }, |
| | | watch: { |
| | | defaultTaskType: { |
| | | handler(n) { |
| | | this.form = {} |
| | | this.query = {} |
| | | this.search = {} |
| | | this.weightParams = {} |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | immediate: true, |
| | |
| | | methods: { |
| | | handleWeight(row) { |
| | | this.weightParams = { ...row } |
| | | this.defaultTaskType && (this.weightParams = { ...row, isDept: true }) |
| | | this.isWeight = false |
| | | }, |
| | | changeIs(is) { |
| | | this.isWeight = is |
| | | }, |
| | | searchChange(params, done) { |
| | | params.deptId = params.deptName || '' |
| | | params.postId = params.postName || '' |
| | | delete params.deptName |
| | | delete params.postName |
| | | if (!this.defaultTaskType) { |
| | | params.deptId = params.deptName || '' |
| | | params.postId = params.postName || '' |
| | | delete params.deptName |
| | | delete params.postName |
| | | } |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | |
| | | ...this.query, |
| | | ...params |
| | | }; |
| | | !this.defaultTaskType && getList(page.currentPage, page.pageSize, values).then(res => { |
| | | this.data = [] |
| | | !this.defaultTaskType && getList(page.currentPage, page.pageSize, values, values.deptId).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | }); |
| | | this.defaultTaskType && getdeptList(page.currentPage, page.pageSize, values).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.defaultTaskType && getLazyList(this.parentId, values).then(res => { |
| | | let deptRes = res.data.data |
| | | // 扁平化 |
| | | res.data.data.forEach(item => { |
| | | if (item.children) { |
| | | deptRes = deptRes.concat(item.children) |
| | | delete item.children |
| | | } else { |
| | | deptRes.push(item) |
| | | } |
| | | }) |
| | | this.data = deptRes; |
| | | this.loading = false; |
| | | }) |
| | | }); |
| | | }, |
| | | tabChange(value) { |
| | | this.defaultTaskType = value.prop |
| | | console.log(!!this.defaultTaskType); |
| | | } |
| | | } |
| | | } |