优化
This commit is contained in:
parent
7012d8756d
commit
99c44a9738
@ -72,7 +72,7 @@ import getPersonnel from '@/components/getPersonnel'
|
||||
import PopupRight from '@/components/PopupRight'
|
||||
import { apiSaveapproval } from '@/api/assessment'
|
||||
export default {
|
||||
props: ['tableInfo', 'formList', 'info'],
|
||||
props: ['tableInfo', 'formList', 'info', 'resultRecordId'],
|
||||
data () {
|
||||
return {
|
||||
authList: [
|
||||
@ -205,7 +205,7 @@ export default {
|
||||
}).then(async () => {
|
||||
const obj = {status: 3, menuName: '催办了'}
|
||||
if (this.info) obj.flowRecordId = this.info.flowRecordId
|
||||
const params = Object.assign({}, this.form, {resultRecordId: this.$route.query.id || ''}, obj)
|
||||
const params = Object.assign({}, this.form, {resultRecordId: this.resultRecordId || ''}, obj)
|
||||
this.$loadingStart()
|
||||
let res = await apiSaveapproval(params)
|
||||
this.$loadingEnd()
|
||||
@ -238,7 +238,7 @@ export default {
|
||||
const obj = {status: 4, menuName: '跳过了'}
|
||||
if (this.info) obj.flowRecordId = this.info.flowRecordId
|
||||
if (this.$attrs.flowRecordId) obj.flowRecordId = this.$attrs.flowRecordId
|
||||
const params = Object.assign({}, this.form, {resultRecordId: this.$route.query.id || ''}, obj)
|
||||
const params = Object.assign({}, this.form, {resultRecordId: this.resultRecordId || ''}, obj)
|
||||
this.$loadingStart()
|
||||
let res = await apiSaveapproval(params)
|
||||
this.$loadingEnd()
|
||||
@ -268,7 +268,7 @@ export default {
|
||||
this.$router.push({
|
||||
name: 'assessment-goals',
|
||||
query: {
|
||||
id: this.$route.query.id || ''
|
||||
id: this.resultRecordId || ''
|
||||
}
|
||||
})
|
||||
},
|
||||
@ -287,7 +287,7 @@ export default {
|
||||
if (this.info) {
|
||||
obj.flowRecordId = this.info.flowRecordId
|
||||
} else if (this.formList.flowRecordId !== 0) obj.flowRecordId = this.formList.flowRecordId
|
||||
const params = Object.assign({}, this.form, {resultRecordId: this.$route.query.id || ''}, obj)
|
||||
const params = Object.assign({}, this.form, {resultRecordId: this.resultRecordId || ''}, obj)
|
||||
let res = await apiSaveapproval(params)
|
||||
if (res.code !== 200) {
|
||||
this.$message.error(res.msg)
|
||||
@ -304,7 +304,7 @@ export default {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.$refs.form.validate(async v => {
|
||||
if (v) {
|
||||
const params = Object.assign({}, this.form, {resultRecordId: this.$route.query.id || ''}, obj)
|
||||
const params = Object.assign({}, this.form, {resultRecordId: this.resultRecordId || ''}, obj)
|
||||
let res = await apiSaveapproval(params)
|
||||
if (res.code !== 200) {
|
||||
this.$message.error(res.msg)
|
||||
|
||||
@ -1,8 +1,18 @@
|
||||
<!-- -->
|
||||
<template>
|
||||
<div class="performance">
|
||||
<SmallNav />
|
||||
<SmallNav v-if="!isNoRouter"/>
|
||||
<div class="performance-content boderAndRadius">
|
||||
<el-cascader
|
||||
v-if="isNoRouter"
|
||||
style="margin:0 0 20px 0;"
|
||||
:key="key"
|
||||
v-model="startId"
|
||||
size="mini"
|
||||
:props="props"
|
||||
:options="timeOptions"
|
||||
@change="handleChange"
|
||||
></el-cascader>
|
||||
<div class="performance-content-title">
|
||||
<InfoHeader :obj="{
|
||||
src:obj.avatar || '',
|
||||
@ -10,7 +20,7 @@
|
||||
departmentName:obj.departmentName
|
||||
}" />
|
||||
<div class="performance-content-title-right">
|
||||
<UseButton v-if="isShow" :formList='formList' :tableInfo.sync='tableInfo'/>
|
||||
<UseButton :resultRecordId='resultRecordId' v-if="isShow" :formList='formList' :tableInfo.sync='tableInfo'/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="performance-content-center">
|
||||
@ -129,7 +139,7 @@
|
||||
<el-tag v-if='i.status===1' size="mini" type="success">已确认</el-tag>
|
||||
</div>
|
||||
<div>
|
||||
<UseButton :info='i' :formList='formList' :tableInfo.sync='tableInfo'/>
|
||||
<UseButton :resultRecordId='resultRecordId' :info='i' :formList='formList' :tableInfo.sync='tableInfo'/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -144,10 +154,34 @@ import PopupRight from '@/components/PopupRight'
|
||||
import UseButton from './components/UseButton'
|
||||
import { apiResultRecordDetail, apiResultGetDetail } from '@/api/assessment'
|
||||
import tables from './components/table'
|
||||
|
||||
import { getStartsData } from '@/api/report'
|
||||
export default {
|
||||
props: {
|
||||
isNoRouter: {
|
||||
type: Boolean,
|
||||
deafult: false
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
key: 0,
|
||||
startIds: '',
|
||||
timeOptions: [{
|
||||
startId: 0,
|
||||
time: '月底',
|
||||
children: []
|
||||
}, {
|
||||
startId: 1,
|
||||
time: '自定义',
|
||||
children: []
|
||||
}],
|
||||
props: {
|
||||
value: 'startId',
|
||||
label: 'time',
|
||||
level: true
|
||||
},
|
||||
startId: [],
|
||||
resultRecordId: null,
|
||||
isShow: false,
|
||||
right: {
|
||||
showRight: false
|
||||
@ -177,14 +211,57 @@ export default {
|
||||
computed: {},
|
||||
beforeMount () { },
|
||||
async mounted () {
|
||||
await this.handleGetTbale({id: this.$route.query.id})
|
||||
if (this.isNoRouter) {
|
||||
await this.handleStartsReq()
|
||||
}
|
||||
await this.handleList()
|
||||
},
|
||||
methods: {
|
||||
async handleGetTbale (id = this.$route.query.id) {
|
||||
async handleChange (item) {
|
||||
this.startId = item
|
||||
await this.handleGetTbale({startId: item[1]})
|
||||
await this.handleList()
|
||||
},
|
||||
// 为了不分页直接传999
|
||||
async handleStartsReq (type, handleNode) {
|
||||
let params = {
|
||||
currentPage: 1,
|
||||
cycleType: type,
|
||||
pageSize: 999
|
||||
}
|
||||
for (let j in this.timeOptions) {
|
||||
// params.startId
|
||||
try {
|
||||
let res = await getStartsData({
|
||||
currentPage: 1,
|
||||
cycleType: this.timeOptions[j].startId,
|
||||
pageSize: 999
|
||||
})
|
||||
res = res.data
|
||||
console.log('res: ', res)
|
||||
this.key += 10
|
||||
this.timeOptions[j].children = res.list.map(i => {
|
||||
if (i.startId === this.startIds) {
|
||||
this.startId = [this.timeOptions[j].startId, i.startId]
|
||||
}
|
||||
return i
|
||||
})
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
},
|
||||
async handleGetTbale (params) {
|
||||
this.$loadingStart()
|
||||
let res = await apiResultGetDetail({ id })
|
||||
let res = await apiResultGetDetail(params)
|
||||
this.$loadingEnd()
|
||||
if (res.code !== 200) return this.$message.error(res.msg)
|
||||
if (res.code !== 200) {
|
||||
this.resultRecordId = ''
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.startIds = res.data.startId
|
||||
this.resultRecordId = res.data.id
|
||||
res.data.recortModelDtos = res.data.recortModelDtos.concat([{name: '总分', detailDtos: []}])
|
||||
this.obj = res.data
|
||||
},
|
||||
@ -200,14 +277,12 @@ export default {
|
||||
},
|
||||
async handleList () {
|
||||
this.isShow = false
|
||||
let res = await apiResultRecordDetail({ resultRecordId: this.$route.query.id })
|
||||
this.handleGetTbale()
|
||||
let res = await apiResultRecordDetail({ resultRecordId: this.resultRecordId || this.$route.query.id || '' })
|
||||
if (res.code !== 200) return this.$message.error(res.msg)
|
||||
const arr = res.data.flowRecordList.concat([])
|
||||
for (let i in res.data.flowRecordList) {
|
||||
arr.shift()
|
||||
res.data.flowRecordList[i][arr.some(j => j.status === 1) ? 'isGou' : 'isActive'] = true
|
||||
|
||||
if (!arr.some(j => j.status === 1)) {
|
||||
break
|
||||
}
|
||||
|
||||
@ -1,32 +1,35 @@
|
||||
<!-- -->
|
||||
<template>
|
||||
<div class="home boderAndRadius" >
|
||||
<div class='home-left'>
|
||||
<div class="home-left-todo " :class="{borderBottom:selectedTableList.length===0}">
|
||||
<div class="home-left-todo-top">
|
||||
<div class="commonFont">待办事项<span style="margin:0 4px" class="blueColor">{{pageProcessedInfo.totalCount || 0}}</span>条</div>
|
||||
<div class="blueColor noSelect commonFont" style="cursor: pointer;" @click="handleGetMoreToDo('workbench-todo')">查看更多<i class="el-icon-arrow-right"></i></div>
|
||||
</div>
|
||||
<div class="home-left-todo-center">
|
||||
<tableItem v-if="selectedTableList.length!==0" :selectedTableList='selectedTableList' />
|
||||
<!-- <div style="height:300px">
|
||||
sassa
|
||||
</div> -->
|
||||
<div>
|
||||
<div class="home boderAndRadius" >
|
||||
<div class='home-left'>
|
||||
<div class="home-left-todo " :class="{borderBottom:selectedTableList.length===0}">
|
||||
<div class="home-left-todo-top">
|
||||
<div class="commonFont">待办事项<span style="margin:0 4px" class="blueColor">{{pageProcessedInfo.totalCount || 0}}</span>条</div>
|
||||
<div class="blueColor noSelect commonFont" style="cursor: pointer;" @click="handleGetMoreToDo('workbench-todo')">查看更多<i class="el-icon-arrow-right"></i></div>
|
||||
</div>
|
||||
<div class="home-left-todo-center">
|
||||
<tableItem v-if="selectedTableList.length!==0" :selectedTableList='selectedTableList' />
|
||||
<!-- <div style="height:300px">
|
||||
sassa
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="auth.assessment && auth.indexData && auth.launchEvaluation && auth.evaluationGroupManager" class="home-left-enter">
|
||||
<div class="home-left-enter-title commonFont">快捷入口</div>
|
||||
<div class="home-left-enter-content">
|
||||
<div class="boderAndRadius commonFont noSelect" v-if="auth.assessment" @click="handleGetMoreToDo('assessment')">考核管理</div>
|
||||
<div class="boderAndRadius commonFont noSelect" v-if="auth.evaluationGroupManager" @click="handleGetMoreToDo('workbench-group')" >考评组</div>
|
||||
<div class="boderAndRadius commonFont noSelect" v-if="auth.launchEvaluation" @click="handleGetMoreToDo('initiate')">发起考核</div>
|
||||
<div class="boderAndRadius commonFont noSelect" v-if="auth.indexData" @click="handleGetMoreToDo('1')">指标库</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="auth.assessment && auth.indexData && auth.launchEvaluation && auth.evaluationGroupManager" class="home-left-enter">
|
||||
<div class="home-left-enter-title commonFont">快捷入口</div>
|
||||
<div class="home-left-enter-content">
|
||||
<div class="boderAndRadius commonFont noSelect" v-if="auth.assessment" @click="handleGetMoreToDo('assessment')">考核管理</div>
|
||||
<div class="boderAndRadius commonFont noSelect" v-if="auth.evaluationGroupManager" @click="handleGetMoreToDo('workbench-group')" >考评组</div>
|
||||
<div class="boderAndRadius commonFont noSelect" v-if="auth.launchEvaluation" @click="handleGetMoreToDo('initiate')">发起考核</div>
|
||||
<div class="boderAndRadius commonFont noSelect" v-if="auth.indexData" @click="handleGetMoreToDo('1')">指标库</div>
|
||||
<div class="home-right boderAndRadius">
|
||||
<report />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="home-right boderAndRadius">
|
||||
<report />
|
||||
</div>
|
||||
<performance :isNoRouter='true'/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -34,6 +37,7 @@
|
||||
import report from './report'
|
||||
import tableItem from '../todo/tableItem'
|
||||
import { apiGetWaitList } from '@/api/toDo'
|
||||
import performance from '../../assessment/performance'
|
||||
|
||||
export default {
|
||||
data () {
|
||||
@ -52,7 +56,8 @@ export default {
|
||||
},
|
||||
components: {
|
||||
report,
|
||||
tableItem
|
||||
tableItem,
|
||||
performance
|
||||
},
|
||||
computed: {},
|
||||
beforeMount () {},
|
||||
@ -105,7 +110,6 @@ export default {
|
||||
|
||||
<style lang='less' scoped>
|
||||
.home{
|
||||
height: 537px;
|
||||
background: #fff;
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user