| File was renamed from src/views/assessment/assessmentTaskSetting.vue |
| | |
| | | <template> |
| | | <basic-container> |
| | | <template v-if="isWeight"> |
| | | <avue-tabs ref="tabs" :option="taskTypeList" @change="tabChange"></avue-tabs> |
| | | <avue-crud ref="crud" v-model="form" v-model:search="search" :option="!defaultTaskType ? option : deptOption" |
| | | <el-page-header @back="back" class="header"> |
| | | <template #content> |
| | | <span>{{ !params.type ? '个人考核设置' : '部门考核设置' }}</span> |
| | | </template> |
| | | </el-page-header> |
| | | <avue-crud ref="crud" v-model="form" v-model:search="search" :option="!params.type ? option : deptOption" |
| | | :data="data" v-model:page="page" @search-change="searchChange" @search-reset="searchReset" |
| | | @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" |
| | | @tree-load="treeLoad" @on-load="onLoad"> |
| | | <template #menu-left> |
| | | <el-button type="primary" icon="el-icon-plus" @click="rowSave"> |
| | | {{ !params.type? '添加被考核人' : '添加被考核部门' }} |
| | | </el-button> |
| | | </template> |
| | | <template #menu="{ size, row, index }"> |
| | | <el-button type="primary" size="small" @click="handleWeight(row)"> |
| | | 添加考核人 |
| | | </el-button> |
| | | </template> |
| | | <template #assessmentPerson="{ row }"> |
| | | <popoverTable :params="{...row, type: defaultTaskType}"> |
| | | <popoverTable :params="{ ...row, type: params.type }"> |
| | | <template #content> |
| | | <el-button type="success" text icon="el-icon-pointer">考核人预览</el-button> |
| | | </template> |
| | | </popoverTable> |
| | | </template> |
| | | <template #deptCategory="{ row }"> |
| | | <el-tag>{{ row.deptCategoryName }}</el-tag> |
| | | </template> |
| | | </avue-crud> |
| | | <addAssessor :dialogParams="dialogParams" @refresh="onLoad" /> |
| | | </template> |
| | | <template v-else> |
| | | <assessmentWeight v-model:params="weightParams" @changeIs="changeIs" /> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import assessmentWeight from './components/assessmentWeight.vue' |
| | | import assessmentWeight from './assessmentWeight.vue' |
| | | import addAssessor from './addAssessor.vue'; |
| | | import popoverTable from '@/views/assessment/components/popoverTable.vue' |
| | | import { getList } from '@/api/system/user.js' |
| | | import { getList } from '@/api/assessment/assessmentSet.js' |
| | | import { getLazyList } from '@/api/system/dept'; |
| | | import _ from 'lodash' |
| | | |
| | |
| | | components: { |
| | | assessmentWeight, |
| | | popoverTable, |
| | | addAssessor |
| | | }, |
| | | props: { |
| | | params: { |
| | | type: Object, |
| | | default() { |
| | | return {} |
| | | } |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | }, |
| | | { |
| | | label: "被考核人", |
| | | prop: "name", |
| | | // prop: "userName", |
| | | // prop: "name", |
| | | prop: "userName", |
| | | type: "input", |
| | | search: true, |
| | | minWidth: 70 |
| | | }, |
| | | { |
| | | label: "工号", |
| | | prop: 'code', |
| | | type: "input", |
| | | minWidth: 70 |
| | | }, |
| | | { |
| | |
| | | // minWidth: 70 |
| | | // }, |
| | | { |
| | | label: "联系方式", |
| | | prop: "phone", |
| | | type: "input", |
| | | minWidth: 150, |
| | | }, |
| | | { |
| | | label: "考核人", |
| | | minWidth: 120, |
| | | prop: "assessmentPerson", |
| | |
| | | search: true, |
| | | }, |
| | | { |
| | | label: '部门全称', |
| | | prop: 'fullName', |
| | | // search: true, |
| | | }, |
| | | { |
| | | label: '机构类型', |
| | | type: 'select', |
| | | dicUrl: '/blade-system/dict/dictionary?code=org_category', |
| | | props: { |
| | | label: 'dictValue', |
| | | value: 'dictKey', |
| | | }, |
| | | dataType: 'number', |
| | | width: 120, |
| | | prop: 'deptCategory', |
| | | slot: true, |
| | | }, |
| | | { |
| | | label: '考核人', |
| | | prop: 'assessmentPerson', |
| | | slot: true |
| | |
| | | depts: [], |
| | | posts: [] |
| | | }, |
| | | // 考核结果参数 |
| | | defaultTaskType: 0, |
| | | taskTypeList: { |
| | | column: [ |
| | | { |
| | | label: '个人考核权重设置', |
| | | prop: 0 |
| | | }, |
| | | { |
| | | label: '部门考核权重设置', |
| | | prop: 1 |
| | | } |
| | | ] |
| | | }, |
| | | } |
| | | }, |
| | | watch: { |
| | | defaultTaskType: { |
| | | handler(n) { |
| | | this.form = {} |
| | | this.query = {} |
| | | this.search = {} |
| | | this.weightParams = {} |
| | | this.page.currentPage = 1 |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | immediate: true, |
| | | dialogParams: {} |
| | | } |
| | | }, |
| | | methods: { |
| | | back() { |
| | | this.$emit('changeIs', 0) |
| | | }, |
| | | changeIs(value) { |
| | | this.isWeight = value |
| | | }, |
| | | handleWeight(row) { |
| | | this.weightParams = { ...row } |
| | | this.defaultTaskType && (this.weightParams = { ...row, isDept: true }) |
| | | this.weightParams.type = this.defaultTaskType |
| | | this.params.type && (this.weightParams = { ...row, isDept: true }) |
| | | this.weightParams.type = this.params.type |
| | | this.isWeight = false |
| | | }, |
| | | changeIs(is) { |
| | | this.isWeight = is |
| | | this.$nextTick(() => { |
| | | this.$refs.tabs.active = this.defaultTaskType.toString() |
| | | }) |
| | | rowSave() { |
| | | this.dialogParams = { |
| | | visible: true, |
| | | taskParams: this.params |
| | | } |
| | | }, |
| | | searchChange(params, done) { |
| | | if (!this.defaultTaskType) { |
| | |
| | | userType: 2 |
| | | }; |
| | | this.data = [] |
| | | !this.defaultTaskType && getList(page.currentPage, page.pageSize, values, values.deptId).then(res => { |
| | | const { id } = this.params |
| | | getList(page.currentPage, page.pageSize, { assessmentTaskId: id }).then(res => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | }); |
| | | this.defaultTaskType && getLazyList(this.parentId, values).then(res => { |
| | | this.data = res.data.data; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | |
| | | } |
| | | </script> |
| | | |
| | | <style></style> |
| | | <style lang="scss" scoped> |
| | | .header { |
| | | margin-bottom: 20px; |
| | | } |
| | | </style> |