This commit is contained in:
熊成强 2020-11-16 15:03:33 +08:00
parent 7012d8756d
commit 99c44a9738
3 changed files with 120 additions and 41 deletions

View File

@ -72,7 +72,7 @@ import getPersonnel from '@/components/getPersonnel'
import PopupRight from '@/components/PopupRight' import PopupRight from '@/components/PopupRight'
import { apiSaveapproval } from '@/api/assessment' import { apiSaveapproval } from '@/api/assessment'
export default { export default {
props: ['tableInfo', 'formList', 'info'], props: ['tableInfo', 'formList', 'info', 'resultRecordId'],
data () { data () {
return { return {
authList: [ authList: [
@ -205,7 +205,7 @@ export default {
}).then(async () => { }).then(async () => {
const obj = {status: 3, menuName: '催办了'} const obj = {status: 3, menuName: '催办了'}
if (this.info) obj.flowRecordId = this.info.flowRecordId 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() this.$loadingStart()
let res = await apiSaveapproval(params) let res = await apiSaveapproval(params)
this.$loadingEnd() this.$loadingEnd()
@ -238,7 +238,7 @@ export default {
const obj = {status: 4, menuName: '跳过了'} const obj = {status: 4, menuName: '跳过了'}
if (this.info) obj.flowRecordId = this.info.flowRecordId if (this.info) obj.flowRecordId = this.info.flowRecordId
if (this.$attrs.flowRecordId) obj.flowRecordId = this.$attrs.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() this.$loadingStart()
let res = await apiSaveapproval(params) let res = await apiSaveapproval(params)
this.$loadingEnd() this.$loadingEnd()
@ -268,7 +268,7 @@ export default {
this.$router.push({ this.$router.push({
name: 'assessment-goals', name: 'assessment-goals',
query: { query: {
id: this.$route.query.id || '' id: this.resultRecordId || ''
} }
}) })
}, },
@ -287,7 +287,7 @@ export default {
if (this.info) { if (this.info) {
obj.flowRecordId = this.info.flowRecordId obj.flowRecordId = this.info.flowRecordId
} else if (this.formList.flowRecordId !== 0) obj.flowRecordId = this.formList.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) let res = await apiSaveapproval(params)
if (res.code !== 200) { if (res.code !== 200) {
this.$message.error(res.msg) this.$message.error(res.msg)
@ -304,7 +304,7 @@ export default {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.$refs.form.validate(async v => { this.$refs.form.validate(async v => {
if (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) let res = await apiSaveapproval(params)
if (res.code !== 200) { if (res.code !== 200) {
this.$message.error(res.msg) this.$message.error(res.msg)

View File

@ -1,8 +1,18 @@
<!-- --> <!-- -->
<template> <template>
<div class="performance"> <div class="performance">
<SmallNav /> <SmallNav v-if="!isNoRouter"/>
<div class="performance-content boderAndRadius"> <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"> <div class="performance-content-title">
<InfoHeader :obj="{ <InfoHeader :obj="{
src:obj.avatar || '', src:obj.avatar || '',
@ -10,7 +20,7 @@
departmentName:obj.departmentName departmentName:obj.departmentName
}" /> }" />
<div class="performance-content-title-right"> <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> </div>
<div class="performance-content-center"> <div class="performance-content-center">
@ -129,7 +139,7 @@
<el-tag v-if='i.status===1' size="mini" type="success">已确认</el-tag> <el-tag v-if='i.status===1' size="mini" type="success">已确认</el-tag>
</div> </div>
<div> <div>
<UseButton :info='i' :formList='formList' :tableInfo.sync='tableInfo'/> <UseButton :resultRecordId='resultRecordId' :info='i' :formList='formList' :tableInfo.sync='tableInfo'/>
</div> </div>
</div> </div>
</div> </div>
@ -144,10 +154,34 @@ import PopupRight from '@/components/PopupRight'
import UseButton from './components/UseButton' import UseButton from './components/UseButton'
import { apiResultRecordDetail, apiResultGetDetail } from '@/api/assessment' import { apiResultRecordDetail, apiResultGetDetail } from '@/api/assessment'
import tables from './components/table' import tables from './components/table'
import { getStartsData } from '@/api/report'
export default { export default {
props: {
isNoRouter: {
type: Boolean,
deafult: false
}
},
data () { data () {
return { 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, isShow: false,
right: { right: {
showRight: false showRight: false
@ -177,14 +211,57 @@ export default {
computed: {}, computed: {},
beforeMount () { }, beforeMount () { },
async mounted () { async mounted () {
await this.handleGetTbale({id: this.$route.query.id})
if (this.isNoRouter) {
await this.handleStartsReq()
}
await this.handleList() await this.handleList()
}, },
methods: { 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() this.$loadingStart()
let res = await apiResultGetDetail({ id }) let res = await apiResultGetDetail(params)
this.$loadingEnd() 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: []}]) res.data.recortModelDtos = res.data.recortModelDtos.concat([{name: '总分', detailDtos: []}])
this.obj = res.data this.obj = res.data
}, },
@ -200,14 +277,12 @@ export default {
}, },
async handleList () { async handleList () {
this.isShow = false this.isShow = false
let res = await apiResultRecordDetail({ resultRecordId: this.$route.query.id }) let res = await apiResultRecordDetail({ resultRecordId: this.resultRecordId || this.$route.query.id || '' })
this.handleGetTbale()
if (res.code !== 200) return this.$message.error(res.msg) if (res.code !== 200) return this.$message.error(res.msg)
const arr = res.data.flowRecordList.concat([]) const arr = res.data.flowRecordList.concat([])
for (let i in res.data.flowRecordList) { for (let i in res.data.flowRecordList) {
arr.shift() arr.shift()
res.data.flowRecordList[i][arr.some(j => j.status === 1) ? 'isGou' : 'isActive'] = true res.data.flowRecordList[i][arr.some(j => j.status === 1) ? 'isGou' : 'isActive'] = true
if (!arr.some(j => j.status === 1)) { if (!arr.some(j => j.status === 1)) {
break break
} }

View File

@ -1,5 +1,6 @@
<!-- --> <!-- -->
<template> <template>
<div>
<div class="home boderAndRadius" > <div class="home boderAndRadius" >
<div class='home-left'> <div class='home-left'>
<div class="home-left-todo " :class="{borderBottom:selectedTableList.length===0}"> <div class="home-left-todo " :class="{borderBottom:selectedTableList.length===0}">
@ -28,12 +29,15 @@
<report /> <report />
</div> </div>
</div> </div>
<performance :isNoRouter='true'/>
</div>
</template> </template>
<script> <script>
import report from './report' import report from './report'
import tableItem from '../todo/tableItem' import tableItem from '../todo/tableItem'
import { apiGetWaitList } from '@/api/toDo' import { apiGetWaitList } from '@/api/toDo'
import performance from '../../assessment/performance'
export default { export default {
data () { data () {
@ -52,7 +56,8 @@ export default {
}, },
components: { components: {
report, report,
tableItem tableItem,
performance
}, },
computed: {}, computed: {},
beforeMount () {}, beforeMount () {},
@ -105,7 +110,6 @@ export default {
<style lang='less' scoped> <style lang='less' scoped>
.home{ .home{
height: 537px;
background: #fff; background: #fff;
margin: 0 auto; margin: 0 auto;
display: flex; display: flex;