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] =?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: {}