From c69c2f0731f2bc71016ab799e043901351ee0351 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=86=8A=E6=88=90=E5=BC=BA?= Date: Thu, 29 Oct 2020 11:56:48 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/assessment.js | 9 +++ src/components/EvaluationTeamFilter/index.vue | 80 ++++++++++--------- src/components/kpi-layout/SmallNav.vue | 3 + src/views/kpi/assessment/goals/index.vue | 17 +++- .../components/UseButton/index.vue | 41 ++++++++++ .../kpi/assessment/performance/index.vue | 29 ++----- src/views/kpi/assessment/stepList/index.vue | 42 +++++----- src/views/kpi/workbench/todo/index.vue | 2 +- 8 files changed, 136 insertions(+), 87 deletions(-) create mode 100644 src/views/kpi/assessment/performance/components/UseButton/index.vue diff --git a/src/api/assessment.js b/src/api/assessment.js index cf9218a..b73eedd 100644 --- a/src/api/assessment.js +++ b/src/api/assessment.js @@ -53,3 +53,12 @@ export function apiResultGetDetail (query) { params: query }) } + +// 保存绩效详情- +export function apiSaveDetail (query) { + return request({ + url: '/lz_management/user/lzresultrecord/saveDetail', + method: 'post', + data: query + }) +} diff --git a/src/components/EvaluationTeamFilter/index.vue b/src/components/EvaluationTeamFilter/index.vue index 94953dc..2751493 100644 --- a/src/components/EvaluationTeamFilter/index.vue +++ b/src/components/EvaluationTeamFilter/index.vue @@ -3,7 +3,7 @@
@@ -16,6 +16,7 @@ prefix-icon="el-icon-search" v-model="searchName" @change="handleSearchChange" + clearable placeholder="搜索考评组" size="small" > @@ -24,7 +25,6 @@ ref="refChooseTable" max-height="394" @selection-change="handleSelectionChange" - v-if="tableList.length" > '' + }, filtersDic: { type: Object, default: () => { @@ -124,24 +128,11 @@ export default { data () { return { searchName: '', - tableList: [{ - copyId: 0, - counts: 53, - depIds: '154322459', - gmtCreate: '2020-10-26 11:22:01', - gmtModified: '2020-10-27 14:30:47', - id: 57, - isDelete: 0, - managerIds: '380', - name: '1231', - outIds: '322,379,380,387,388,389,391,410,825', - score: 0, - staffIds: '' - }], + tableList: [], seleactedList: [], pageInfo: { currPage: 1, - pageSize: 20, + pageSize: 500, totalCount: 1, totalPage: 1 } @@ -150,36 +141,41 @@ export default { created () { }, mounted () { + this.$nextTick(() => { + this.handleDataList() + }) }, watch: { - dialogVisible (newVal, oldVal) { - if (newVal) { - if (this.filtersDic.currPage === undefined || !this.filtersDic.currPage) { - this.filtersDic['currPage'] = this.pageInfo.currPage - } - if (this.filtersDic.pageSize === undefined || !this.filtersDic.pageSize) { - this.filtersDic['pageSize'] = this.pageInfo.pageSize - } - this.handleDataList() - } - } + // dialogVisible (newVal, oldVal) { + // if (newVal) { + // if (this.filtersDic.currPage === undefined || !this.filtersDic.currPage) { + // this.filtersDic['currPage'] = this.pageInfo.currPage + // } + // if (this.filtersDic.pageSize === undefined || !this.filtersDic.pageSize) { + // this.filtersDic['pageSize'] = this.pageInfo.pageSize + // } + // this.handleDataList() + // } + // } }, methods: { handleDataList () { - apiGetEvaluationTeamList(this.filtersDic).then(res => { + apiGetEvaluationTeamList(Object.assign({}, this.pageInfo, this.filtersDic)).then(res => { this.pageInfo.currPage = res.data.currPage this.pageInfo.totalCount = res.data.totalCount this.pageInfo.totalPage = res.data.totalPage this.tableList = res.data.list + + this.$nextTick(() => { + this.tableList.map(i => { + if (this.value.includes(String(i.id))) { + this.$refs.refChooseTable.toggleRowSelection(i, true) + } + }) + }) + // this.$ref.refChooseTable.toggleRowSelection() }) - // for (let index = 0; index < 100; index++) { - // let dic = { id: index.toString(), name: '12月绩效考核' + index.toString(), count: '12' } - // this.tableList.push(dic) - // } }, - // handleGetRowStyle () { - // return { 'height': '44px' } - // }, handleSearchChange () { // 搜索 this.filtersDic['name'] = this.searchName @@ -193,7 +189,16 @@ export default { this.$emit('close') }, handleSubmit () { - this.$emit('submitClick', this.seleactedList) + const obj = { + value: '', + title: '' + } + this.seleactedList.sort((a, b) => a.id - b.id).map(i => { + obj.value += i.id + ',' + }) + obj.value = obj.value.substring(obj.value.length - 1, 0) + obj.title = this.seleactedList.length > 0 ? (this.seleactedList[0].name + '等' + this.seleactedList.length + '个考评组') : '' + this.$emit('submitClick', obj) }, handleSelectionChange (val) { this.seleactedList = val @@ -229,6 +234,7 @@ export default { &-content { width: 100%; height: 425px; + padding: 20px 0; border-bottom: 1 solid @borderColor; &-left { height: 100%; diff --git a/src/components/kpi-layout/SmallNav.vue b/src/components/kpi-layout/SmallNav.vue index ea2dbd7..03699fc 100644 --- a/src/components/kpi-layout/SmallNav.vue +++ b/src/components/kpi-layout/SmallNav.vue @@ -53,6 +53,9 @@ export default { color: #aaaaaa; cursor: pointer; } + &-back:hover{ + color: @fontBlue; + } &-title{ padding: 0 10px; position: relative; diff --git a/src/views/kpi/assessment/goals/index.vue b/src/views/kpi/assessment/goals/index.vue index a023e5b..89ad3f6 100644 --- a/src/views/kpi/assessment/goals/index.vue +++ b/src/views/kpi/assessment/goals/index.vue @@ -9,8 +9,8 @@ departmentName:obj.departmentName }"/>
- 暂存 - 提交 + 暂存 + 提交
@@ -107,7 +107,7 @@ import InfoHeader from '@/components/InfoHeader' import PopupRight from '@/components/PopupRight' import draggable from 'vuedraggable' import {getDimensions} from '@/api/data' -import { apiResultGetDetail } from '@/api/assessment' +import { apiResultGetDetail, apiSaveDetail } from '@/api/assessment' export default { data () { return { @@ -160,6 +160,15 @@ export default { this.handleGetTbale() }, methods: { + async handleSaveDetail (params = this.obj) { + let res = await apiSaveDetail(params) + if (res.code !== 200) { + this.$message.error = res.msg + return + } + this.handleGetTbale() + console.log('res: ', res) + }, // 获取维度类型 async handleGetDimensions () { try { @@ -220,7 +229,7 @@ export default { handleFilter (item) { return item ? item.filter(i => !i.isDelete) : [] }, - async handleGetTbale (id = 226) { + async handleGetTbale (id = this.$route.query.id) { let res = await apiResultGetDetail({id}) if (res.code !== 200) return this.obj = res.data diff --git a/src/views/kpi/assessment/performance/components/UseButton/index.vue b/src/views/kpi/assessment/performance/components/UseButton/index.vue new file mode 100644 index 0000000..6fe7b53 --- /dev/null +++ b/src/views/kpi/assessment/performance/components/UseButton/index.vue @@ -0,0 +1,41 @@ + + + + + + diff --git a/src/views/kpi/assessment/performance/index.vue b/src/views/kpi/assessment/performance/index.vue index 2dace9d..49a191a 100644 --- a/src/views/kpi/assessment/performance/index.vue +++ b/src/views/kpi/assessment/performance/index.vue @@ -25,11 +25,7 @@ departmentName:obj.departmentName }" />
- 制定目标 +
@@ -92,7 +88,7 @@ :obj='obj' />
-
+
记录
@@ -136,9 +132,6 @@ > {{i}}
-
@@ -148,6 +141,8 @@ import SmallNav from '@/components/kpi-layout/SmallNav' import InfoHeader from '@/components/InfoHeader' import PopupRight from '@/components/PopupRight' +import UseButton from './components/UseButton' + import { apiResultRecordDetail, apiResultGetDetail } from '@/api/assessment' import tables from './components/table' @@ -187,7 +182,8 @@ export default { SmallNav, InfoHeader, PopupRight, - tables + tables, + UseButton }, computed: {}, beforeMount () { }, @@ -196,16 +192,7 @@ export default { this.handleGetTbale() }, methods: { - // 制定目标 - handleZhiding () { - this.$router.push({ - name: 'assessment-goals', - query: { - id: this.$route.query.id - } - }) - }, - async handleGetTbale (id = 226) { + async handleGetTbale (id = 267) { let res = await apiResultGetDetail({ id }) this.obj = res.data console.log('res: ', res) @@ -223,7 +210,7 @@ export default { }, async handleList () { // resultRecordId = == this.$route.query.id - let res = await apiResultRecordDetail({ resultRecordId: 215 }) + let res = await apiResultRecordDetail({ resultRecordId: 267 }) if (res.code !== 200) return for (let i in res.data.flowRecordList) { if (res.data.flowRecordList[i].status !== 1) { diff --git a/src/views/kpi/assessment/stepList/index.vue b/src/views/kpi/assessment/stepList/index.vue index f453b39..f11e77a 100644 --- a/src/views/kpi/assessment/stepList/index.vue +++ b/src/views/kpi/assessment/stepList/index.vue @@ -16,7 +16,7 @@
{{formTitle}} - 选择考评组 + {{params.evaluationIds?params.title:'选择考评组'}}
@@ -98,13 +98,7 @@
- -
-
- {{i.staffName}} -
-
-
+ @@ -113,6 +107,8 @@ import SmallNav from '@/components/kpi-layout/SmallNav' import getPersonnel from '@/components/getPersonnel' import PopupRight from '@/components/PopupRight' +import EvaluationTeamFilter from '@/components/EvaluationTeamFilter' + import { apiManagerDetail, apiChartList } from '@/api/assessment' import {getWorkList} from '@/api/workbench' import { getStartsData } from '@/api/report' @@ -120,9 +116,7 @@ let id = 0 export default { data () { return { - kaopingFrom: { - showRight: false - }, + dialogVisible: false, form: { isShowPersonnel: false, personnelList: { @@ -135,8 +129,8 @@ export default { 'evaluationIds': '', 'flowProcess': null, 'pageSize': 5, - // 'staffIds': '', - // 'staffName': '', + 'staffIds': '', + 'staffName': '', 'startId': 10 }, key: 0, @@ -163,7 +157,8 @@ export default { components: { SmallNav, getPersonnel, - PopupRight + PopupRight, + EvaluationTeamFilter }, computed: { formTitle () { @@ -176,18 +171,16 @@ export default { await this.handleStartsReq() }, methods: { + submitClick (item) { + this.params.evaluationIds = item.value + this.params.title = item.title + this.params.currPage = 1 + this.handleGetListContent() + this.dialogVisible = false + }, // 获取考评组 async handleKaoping () { - let res = await getWorkList(Object.assign({}, {startId: this.params.startId}, { - 'currPage': 1, - 'pageSize': 999 - })) - if (res.code !== 200) { - this.rightList = [] - return - } - this.rightList = res.data.list - this.kaopingFrom.showRight = true + this.dialogVisible = true }, handleLook (id) { // this.handleKaoping() @@ -206,6 +199,7 @@ export default { this.handleGetListContent() }, async handleGetListContent (params = this.params) { + console.log('params: ', params) let res = await apiManagerDetail(params) if (res.code !== 200) return this.tableData = res.data.list diff --git a/src/views/kpi/workbench/todo/index.vue b/src/views/kpi/workbench/todo/index.vue index 4d2ab4b..50d46f5 100644 --- a/src/views/kpi/workbench/todo/index.vue +++ b/src/views/kpi/workbench/todo/index.vue @@ -149,7 +149,7 @@ export default { this.handleGetList() }, handleRowClick (row) { - this.$router.push({ name: 'assessment-stepList', query: { id: row.recordId } }) + this.$router.push({ name: 'assessment-performance', query: { id: row.recordId } }) } }, watch: {} From 92a028bc23f51f90c616e29c091944f5d15f1e49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=86=8A=E6=88=90=E5=BC=BA?= Date: Thu, 29 Oct 2020 15:06:59 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=9C=89=E5=93=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../edit/components/ApprovalList.vue | 37 ++++++++++--------- .../edit/components/ConfirmList.vue | 19 ++++++---- .../edit/components/ScoreList.vue | 2 +- 3 files changed, 32 insertions(+), 26 deletions(-) diff --git a/src/views/kpi/workbench/assessmentGroup/edit/components/ApprovalList.vue b/src/views/kpi/workbench/assessmentGroup/edit/components/ApprovalList.vue index 83c463d..f00aad5 100644 --- a/src/views/kpi/workbench/assessmentGroup/edit/components/ApprovalList.vue +++ b/src/views/kpi/workbench/assessmentGroup/edit/components/ApprovalList.vue @@ -25,6 +25,7 @@ 主管(指定一级) 指定成员 + 被考核人自己
被考评人的 @@ -42,7 +43,7 @@ {{itemInfo.name}}
-
+
当执行人为多人时的处理方式:
@@ -132,7 +133,7 @@ export default { list = list.map(i => { i.isShow = false i = Object.assign({}, this.handleOptType(i), i) - i.isActive = i.optType === 0 ? 0 : 1 + i.isActive = (i.optType === 0 || i.optType === -1) ? i.optType : 1 i.roleDtos = JSON.parse(JSON.stringify(this.roleDtos)).map(j => { j.checked = i.roleIds ? i.roleIds.includes(String(j.id)) : false return j @@ -157,6 +158,7 @@ export default { return obj } if (i.optType === -1) { + obj.name = '被考核人' return obj } else { obj.name = this.options.filter(j => j.id === i.optType)[0].name @@ -231,10 +233,11 @@ export default { n.map(i => { i.roleIds = '' i.roleDtos.map(j => { - if (j.type !== 1 && j.checked) i.roleIds += j.id + ',' + console.log('j: ', j) + if (j.type !== 1 && j.checked) i.roleIds += j.roleId + ',' }) i.roleIds = i.roleIds.substring(0, i.roleIds.length - 1) - i.optType = i.isActive === 0 ? 0 : i.optType + i.optType = (i.isActive === 0 || i.isActive === -1) ? i.isActive : i.optType }) console.log('n: ', n) this.$emit('update:info', this.list) @@ -248,27 +251,25 @@ export default { list: { deep: true, handler (n, o) { - this.handleIsEmit(n) + this.handleIsEmit(JSON.parse(JSON.stringify(n))) } }, itemInfo: { deep: true, handler (n, o) { - console.log('nxcq: ', n) - if (n.isActive !== 0) { - if (n.optType === 0 && n.optType !== -1) { - n.name = this.options.filter(i => i.id === n.optType)[0].name - n.optType = 1 - } - if (n.optType === -1) { - n.name = '考核人员自己' + const arr = n + console.log('arr: ', arr) + if (arr.isActive !== 0 && arr.isActive !== -1) { + if (arr.optType < 1) arr.optType = 1 + arr.name = this.options.filter(i => i.id === arr.optType)[0].name + } else if (arr.isActive === 0) { + if (arr.list) { + arr.name = this.handleTitle(arr.list) + } else { + arr.name = '未指定成员' } } else { - if (n.list) { - n.name = this.handleTitle(n.list) - } else { - n.name = '未指定成员' - } + arr.name = '被考核人自己' } // n.roleIds = '' // n.roleDtos.map(i => { diff --git a/src/views/kpi/workbench/assessmentGroup/edit/components/ConfirmList.vue b/src/views/kpi/workbench/assessmentGroup/edit/components/ConfirmList.vue index 0fe17db..9c2e573 100644 --- a/src/views/kpi/workbench/assessmentGroup/edit/components/ConfirmList.vue +++ b/src/views/kpi/workbench/assessmentGroup/edit/components/ConfirmList.vue @@ -25,6 +25,7 @@ 主管(指定一级) 指定成员 + 被考核人自己
被考评人的 @@ -42,7 +43,7 @@ {{itemInfo.name}}
-
+
当执行人为多人时的处理方式:
@@ -137,7 +138,8 @@ export default { list = list.map(i => { i.isShow = false i = Object.assign({}, this.handleOptType(i), i) - i.isActive = i.optType === 0 ? 0 : 1 + console.log('i: ', i) + i.isActive = (i.optType === 0 || i.optType === -1) ? i.optType : 1 i.roleDtos = JSON.parse(JSON.stringify(this.roleDtos)).map(j => { j.checked = i.roleIds ? i.roleIds.includes(String(j.id)) : false return j @@ -162,6 +164,7 @@ export default { return obj } if (i.optType === -1) { + obj.name = '被考核人' return obj } else { obj.name = this.options.filter(j => j.id === i.optType)[0].name @@ -239,10 +242,10 @@ export default { arr = arr.map(i => { i.roleIds = '' i.roleDtos.map(j => { - if (j.type !== 1 && j.checked) i.roleIds += j.id + ',' + if (j.type !== 1 && j.checked) i.roleIds += j.roleId + ',' }) i.roleIds = i.roleIds.substring(0, i.roleIds.length - 1) - i.optType = i.isActive === 0 ? 0 : i.optType + i.optType = (i.isActive === 0 || i.isActive === -1) ? i.isActive : i.optType return i }) console.log('arr: ', arr) @@ -266,15 +269,17 @@ export default { handler (n, o) { const arr = n console.log('arr: ', arr) - if (arr.isActive !== 0) { - if (arr.optType === 0) arr.optType = 1 + if (arr.isActive !== 0 && arr.isActive !== -1) { + if (arr.optType < 1) arr.optType = 1 arr.name = this.options.filter(i => i.id === arr.optType)[0].name - } else { + } else if (arr.isActive === 0) { if (arr.list) { arr.name = this.handleTitle(arr.list) } else { arr.name = '未指定成员' } + } else { + arr.name = '被考核人自己' } // this.$emit('update:info', this.list) // n.roleIds = '' diff --git a/src/views/kpi/workbench/assessmentGroup/edit/components/ScoreList.vue b/src/views/kpi/workbench/assessmentGroup/edit/components/ScoreList.vue index e867f90..acc2f05 100644 --- a/src/views/kpi/workbench/assessmentGroup/edit/components/ScoreList.vue +++ b/src/views/kpi/workbench/assessmentGroup/edit/components/ScoreList.vue @@ -239,7 +239,7 @@ export default { n.map(i => { i.roleIds = '' i.roleDtos.map(j => { - if (j.type !== 1 && j.checked) i.roleIds += j.id + ',' + if (j.type !== 1 && j.checked) i.roleIds += j.roleId + ',' }) i.roleIds = i.roleIds.substring(0, i.roleIds.length - 1) }) From ae14fa88c7cebdbb05223040f5787fcd0c4dbe03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=86=8A=E6=88=90=E5=BC=BA?= Date: Thu, 29 Oct 2020 16:25:58 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/getPersonnel/index.vue | 19 +++++++-- src/views/kpi/assessment/homeList/index.vue | 2 +- .../components/UseButton/index.vue | 16 ++++++- .../kpi/assessment/performance/index.vue | 42 ++++++++++++++++++- .../edit/components/ApprovalList.vue | 1 - .../edit/components/process.vue | 3 +- .../workbench/assessmentGroup/edit/index.vue | 1 - 7 files changed, 73 insertions(+), 11 deletions(-) diff --git a/src/components/getPersonnel/index.vue b/src/components/getPersonnel/index.vue index dc7fa3e..1df5172 100644 --- a/src/components/getPersonnel/index.vue +++ b/src/components/getPersonnel/index.vue @@ -68,6 +68,10 @@ import bbb from './a' export default { props: { + len: { + type: Number, + default: 99999 + }, isShow: { TYPE: Boolean, default: () => false @@ -224,10 +228,19 @@ export default { } return item }, []) + if (this.len < arr.length) { + this.$message.info('人数最多只能选择' + this.len + '人') + return + } const params = this.$personlGetForm(arr) - this.$emit('update:value', params.value) - this.$emit('update:showDataList', params) - this.$emit('update:isShow', false) + console.log(this.$listeners) + if (this.$listeners.cb) { + this.$emit('cb', params) + } else { + this.$emit('update:value', params.value) + this.$emit('update:showDataList', params) + this.$emit('update:isShow', false) + } }, handleGetPerson (list = this.tags, getList = []) { list.map(i => { diff --git a/src/views/kpi/assessment/homeList/index.vue b/src/views/kpi/assessment/homeList/index.vue index db304cd..92d9d1e 100644 --- a/src/views/kpi/assessment/homeList/index.vue +++ b/src/views/kpi/assessment/homeList/index.vue @@ -56,7 +56,7 @@ @click="handlePush(scope.row.id)" type="text" size="small"> - 编 辑 + 查 看 制定目标 +