Commit 8bc84814 by sujingsong

fix: 去掉首次进入页面

parent b02fc0a8
...@@ -4,8 +4,8 @@ import { MAS } from '@/plugins/mas' ...@@ -4,8 +4,8 @@ import { MAS } from '@/plugins/mas'
const masConfig = process.env.PACK_ENV === 'prod' const masConfig = process.env.PACK_ENV === 'prod'
? { ? {
baseUrl: 'https://jffcvp.cndrealty.com:4433', // 正式环境 // baseUrl: 'https://jffcvp.cndrealty.com:4433', // 正式环境
// baseUrl: 'https://mxytest.cndrealty.com:4433', // 测试环境 baseUrl: 'https://mxytest.cndrealty.com:4433', // 测试环境
tokenKey: 'accessToken', tokenKey: 'accessToken',
code: 'cndvp-api' code: 'cndvp-api'
} }
......
<template> <template>
<card-panel :title="title"> <div >
<div class="person-info"> <card-panel :title="title">
<div class="flex flex-cross-center"> <div class="person-info">
<tag v-if="leader.isLeader" class="tag" color="#D23930">组长</tag>
<span class="name">{{leader.personName}}-{{leader.positionName}}</span>
</div>
<div>
<span class="label">{{leader.deptName}}</span>
</div>
</div>
<div v-show="expand">
<div class="person-info" v-for="(item, index) in otherPersons" :key="index">
<div class="flex flex-cross-center"> <div class="flex flex-cross-center">
<span class="name">{{item.personName}}-{{item.positionName}}</span> <tag v-if="leader.isLeader" class="tag" color="#D23930">组长</tag>
<span class="name">{{leader.personName}}-{{leader.positionName}}</span>
</div> </div>
<div> <div>
<span class="label">{{item.deptName}}</span> <span class="label">{{leader.deptName}}</span>
</div> </div>
</div> </div>
</div> <div v-show="expand">
<div class="other-info"> <div class="person-info" v-for="(item, index) in otherPersons" :key="index">
<div> <div class="flex flex-cross-center">
<label class="label">备注</label> <span class="name">{{item.personName}}-{{item.positionName}}</span>
<span>{{remark}}</span> </div>
<div>
<span class="label">{{item.deptName}}</span>
</div>
</div>
</div> </div>
<div> <div class="other-info">
<label class="label">附件信息</label> <div>
<font-icon type="file"></font-icon> <label class="label">备注</label>
<span>{{attachmentCount}}个附件</span> <span>{{remark}}</span>
<a @click="handleEnclosure"><span class="red-link">详情</span><font-icon type="forward_arrow_red_small"></font-icon></a> </div>
<div>
<label class="label">附件信息</label>
<font-icon type="file"></font-icon>
<span>{{attachmentCount}}个附件</span>
<a @click="handleEnclosure"><span class="red-link">详情</span><font-icon type="forward_arrow_red_small"></font-icon></a>
</div>
</div>
</card-panel>
<review-project-info v-show="expand" class="margin-top" :projectsInfo="projectsInfo" />
<div v-if="hasMore" class="flex flex-center bgColor">
<span @click="handleExpandChange">
<span class="red-link">{{expandTitle}}</span>
<font-icon :type="expandIconType"></font-icon>
</span>
</div> </div>
</div> </div>
<div v-if="hasMore" class="flex flex-center" style="margin-top:8px">
<span @click="handleExpandChange">
<span class="red-link">{{expandTitle}}</span>
<font-icon :type="expandIconType"></font-icon>
</span>
</div>
</card-panel>
</template> </template>
<script> <script>
import { Tag, Collapse, CollapseItem } from 'vant' import { Tag, Collapse, CollapseItem } from 'vant'
import CardPanel from '@/components/CardPanel' import CardPanel from '@/components/CardPanel'
import FontIcon from '@/components/FontIcon' import FontIcon from '@/components/FontIcon'
import ReviewProjectInfo from '@/components/ReviewProjectInfo'
export default { export default {
name: 'group-info', name: 'group-info',
...@@ -52,7 +56,8 @@ export default { ...@@ -52,7 +56,8 @@ export default {
Collapse, Collapse,
CollapseItem, CollapseItem,
CardPanel, CardPanel,
FontIcon FontIcon,
ReviewProjectInfo
}, },
props: { props: {
personsInfo: { personsInfo: {
...@@ -61,6 +66,12 @@ export default { ...@@ -61,6 +66,12 @@ export default {
return {} return {}
} }
}, },
projectsInfo: {
type: Object,
default: function () {
return {}
}
},
remark: String, remark: String,
attachmentCount: Number attachmentCount: Number
}, },
...@@ -156,4 +167,8 @@ label { ...@@ -156,4 +167,8 @@ label {
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
} }
.bgColor{
background-color: #fff;
padding: 0 15px 10px;
}
</style> </style>
<template> <template>
<base-layout :title="title"> <base-layout title="" v-if="false">
<div class="inspect flex-v full"> <div class="inspect flex-v full">
<group-info class="margin-top" :personsInfo="inspectPersionInfo" :remark="remark" :attachmentCount="attachmentCount" /> <group-info class="margin-top" :projectsInfo="inspectProjectInfo" :personsInfo="inspectPersionInfo" :remark="remark" :attachmentCount="attachmentCount" />
<review-project-info class="margin-top" :projectsInfo="inspectProjectInfo" /> <!-- <review-project-info class="margin-top" :projectsInfo="inspectProjectInfo" /> -->
<card-panel title="供方信息" class="margin-top"> <card-panel title="供方信息" class="margin-top">
<supplier-item v-for="(item, index) in inspectSupplierSummaryList" @item-click="handleSupplierClick" :supplierInfo="item" :type="supplierType" :isDone="isSupplierItemDone(item, index)" :key="index" class="margin-bottom" /> <supplier-item v-for="(item, index) in inspectSupplierSummaryList" @item-click="handleSupplierClick" :supplierInfo="item" :type="supplierType" :isDone="isSupplierItemDone(item, index)" :key="index" class="margin-bottom" />
...@@ -76,6 +76,7 @@ export default { ...@@ -76,6 +76,7 @@ export default {
return this.inspectAttachmentInfo.total || 0 return this.inspectAttachmentInfo.total || 0
}, },
showButton () { showButton () {
console.log(this.currentPageType, 'this.PageTypes', this.PageTypes)
return this.currentPageType === this.PageTypes.Leader_Todo || this.currentPageType === this.PageTypes.Sign_Todo || this.currentPageType === this.PageTypes.Approval_Todo return this.currentPageType === this.PageTypes.Leader_Todo || this.currentPageType === this.PageTypes.Sign_Todo || this.currentPageType === this.PageTypes.Approval_Todo
}, },
supplierType () { supplierType () {
...@@ -110,6 +111,15 @@ export default { ...@@ -110,6 +111,15 @@ export default {
}, },
currentPageType (newVal, oldVal) { currentPageType (newVal, oldVal) {
this.init() this.init()
},
inspectSupplierSummaryList: {
handler (newValue) {
console.log(newValue, 'inspectSupplierSummaryList')
if (newValue.length > 0) {
this.handleSupplierClick(newValue[0])
}
},
immediate: true
} }
}, },
methods: { methods: {
...@@ -119,7 +129,7 @@ export default { ...@@ -119,7 +129,7 @@ export default {
fetchData () { fetchData () {
this.$store.commit('showLoading', true) this.$store.commit('showLoading', true)
if (!this.isGradeNode) { if (!this.isGradeNode) {
this.fetchInspect({billId: encodeURIComponent(Coder.replace(this.currentFid)), isGradeNode: this.isGradeNode}) this.fetchInspect({billId: Coder.replace(this.currentFid), isGradeNode: this.isGradeNode})
.then(() => this.$store.commit('showLoading', false)) .then(() => this.$store.commit('showLoading', false))
.catch(() => this.$store.commit('showLoading', false)) .catch(() => this.$store.commit('showLoading', false))
} else { } else {
...@@ -220,25 +230,27 @@ export default { ...@@ -220,25 +230,27 @@ export default {
} }
}, },
handleSupplierClick (item) { handleSupplierClick (item) {
console.log(this.currentPageType, this.PageTypes)
this.updateCurrentReviewFormFid(item.id) this.updateCurrentReviewFormFid(item.id)
this.updateCurrentSupplier(item) this.updateCurrentSupplier(item)
switch (this.currentPageType) { switch (this.currentPageType) {
case this.PageTypes.Approval_Todo: case this.PageTypes.Approval_Todo:
case this.PageTypes.Approval_Done: case this.PageTypes.Approval_Done:
// 审批 // 审批
this.$router.push({name: 'approval', params: item}) this.$router.replace({name: 'approval', params: item})
break break
case this.PageTypes.Grade_Todo: case this.PageTypes.Grade_Todo:
case this.PageTypes.Grade_Done: case this.PageTypes.Grade_Done:
this.updateMemberGradeInfo(item) this.updateMemberGradeInfo(item)
this.$router.push({name: 'summary', params: item}) this.$router.replace({name: 'summary', params: item})
break break
default: default:
this.$router.push({name: 'supplier', params: item}) this.$router.replace({name: 'supplier', params: item})
} }
}, },
// 判断对应的适用区域是否为空 // 判断对应的适用区域是否为空
checkAppRegion (index) { checkAppRegion (index) {
console.log(this.inspectAllAppRegions, 'this.inspectAllAppRegions', index)
let result = true let result = true
if (this.inspectAllAppRegions && this.inspectAllAppRegions[index]) { if (this.inspectAllAppRegions && this.inspectAllAppRegions[index]) {
// 对应的当前供方的适用区域 // 对应的当前供方的适用区域
...@@ -356,6 +368,7 @@ export default { ...@@ -356,6 +368,7 @@ export default {
if (!this.checkBeforeSubmit()) { if (!this.checkBeforeSubmit()) {
return return
} }
console.log(this.inspectSupplierSummaryList, 'this.inspectSupplierSummaryList')
let infos = this.inspectSupplierSummaryList.map((v, i) => { let infos = this.inspectSupplierSummaryList.map((v, i) => {
let info = { let info = {
id: encodeURIComponent(v.id), id: encodeURIComponent(v.id),
...@@ -366,7 +379,6 @@ export default { ...@@ -366,7 +379,6 @@ export default {
} }
// 适用区域 // 适用区域
let arr = findItemByIndexPath(this.inspectAllAppRegions[i], this.regionSelectIndexPath) let arr = findItemByIndexPath(this.inspectAllAppRegions[i], this.regionSelectIndexPath)
console.log(arr, 'arr', this.inspectAllAppRegions[i], this.regionSelectIndexPath)
switch (this.currentPageType) { switch (this.currentPageType) {
case this.PageTypes.Leader_Todo: case this.PageTypes.Leader_Todo:
info.leaderSupplyRank = v.leaderSupplyRank info.leaderSupplyRank = v.leaderSupplyRank
...@@ -402,6 +414,7 @@ export default { ...@@ -402,6 +414,7 @@ export default {
infos: infos, infos: infos,
assignmentId: this.todoId assignmentId: this.todoId
} }
console.log('inspect')
this.fetchAuditReviewSummarys({params, callback: this.submitCallback}) this.fetchAuditReviewSummarys({params, callback: this.submitCallback})
}, },
submitCallback (success, msg) { submitCallback (success, msg) {
......
<template> <template>
<base-layout :title="title"> <base-layout :title="title">
<div class="supplier flex-v full"> <div class="supplier flex-v full">
<group-info class="margin-top" :projectsInfo="inspectProjectInfo" :personsInfo="inspectPersionInfo" :remark="remark" :attachmentCount="attachmentCount" />
<card-panel title="供方信息" class="margin-top"> <card-panel title="供方信息" class="margin-top">
<div class="supplier-info flex flex-v"> <div class="supplier-info flex flex-v">
<span>{{currentSupplierInfo.supplierName}}</span> <span>{{currentSupplierInfo.supplierName}}</span>
...@@ -33,6 +35,7 @@ import ConclusionItem from '@/components/ConclusionItem' ...@@ -33,6 +35,7 @@ import ConclusionItem from '@/components/ConclusionItem'
import SignItem from '@/components/SignItem' import SignItem from '@/components/SignItem'
import { mapState, mapGetters, mapActions, mapMutations } from 'vuex' import { mapState, mapGetters, mapActions, mapMutations } from 'vuex'
import { Coder } from '@/common' import { Coder } from '@/common'
import GroupInfo from '@/components/GroupInfo'
export default { export default {
name: 'supplier', name: 'supplier',
...@@ -43,12 +46,13 @@ export default { ...@@ -43,12 +46,13 @@ export default {
GradeList, GradeList,
ConclusionItem, ConclusionItem,
SignItem, SignItem,
'van-button': Button 'van-button': Button,
GroupInfo
}, },
mounted () { mounted () {
this.init() this.init()
this.$store.commit('showLoading', true) this.$store.commit('showLoading', true)
this.fetchReviewSummaryInfo({billId: encodeURIComponent(Coder.replace(this.currentSupplierInfo.id))}) this.fetchReviewSummaryInfo({billId: Coder.replace(this.currentSupplierInfo.id)})
.then(() => this.$store.commit('showLoading', false)) .then(() => this.$store.commit('showLoading', false))
.catch(() => this.$store.commit('showLoading', false)) .catch(() => this.$store.commit('showLoading', false))
}, },
...@@ -66,8 +70,20 @@ export default { ...@@ -66,8 +70,20 @@ export default {
currentSupplierInfo: state => state.currentSupplierInfo, currentSupplierInfo: state => state.currentSupplierInfo,
groupConclusion: state => state.groupConclusion, groupConclusion: state => state.groupConclusion,
memberGradeInfo: state => state.memberGradeInfo, memberGradeInfo: state => state.memberGradeInfo,
supplierSignList: state => state.supplierSignList.filter(v => v.submitTime) // 过滤未提交的 supplierSignList: state => state.supplierSignList.filter(v => v.submitTime), // 过滤未提交的
inspectPersionInfo: state => state.inspectPersionInfo,
inspectInfo: state => state.inspectInfo,
inspectAttachmentInfo: state => state.inspectAttachmentInfo,
inspectProjectInfo: state => state.inspectProjectInfo
}), }),
// 考察组基本信息-备注
remark () {
return this.inspectInfo.description
},
// 考察组基本信息-附件信息个数
attachmentCount () {
return this.inspectAttachmentInfo.total || 0
},
// 显示考察组综合结论 // 显示考察组综合结论
showLeader () { showLeader () {
return this.currentPageType === this.PageTypes.Leader_Done || return this.currentPageType === this.PageTypes.Leader_Done ||
......
...@@ -55,9 +55,10 @@ import ReviewTextArea from '@/components/ReviewTextArea.vue' ...@@ -55,9 +55,10 @@ import ReviewTextArea from '@/components/ReviewTextArea.vue'
import ReviewAddItem from '@/components/ReviewAddItem.vue' import ReviewAddItem from '@/components/ReviewAddItem.vue'
import PopupPicker from '@/components/PopupPicker.vue' import PopupPicker from '@/components/PopupPicker.vue'
import ProductGradePicker from '@/components/ProductGradePicker' import ProductGradePicker from '@/components/ProductGradePicker'
import { mapActions } from 'vuex'
import reviewSummaryMixin from '@/mixins/reviewSummaryMixin' import reviewSummaryMixin from '@/mixins/reviewSummaryMixin'
import { Coder } from '@/common' import { Coder } from '@/common'
import { findItemByIndexPath } from '@/common/utils/assist'
import { mapActions, mapState, mapGetters } from 'vuex'
export default { export default {
name: 'leadercheck', name: 'leadercheck',
...@@ -78,6 +79,20 @@ export default { ...@@ -78,6 +79,20 @@ export default {
this.supplyRank.opinion = this.reviewSummaryInfo.leaderOpinion this.supplyRank.opinion = this.reviewSummaryInfo.leaderOpinion
this.supplyRank.supplyRank = this.reviewSummaryInfo.leaderSupplyRank this.supplyRank.supplyRank = this.reviewSummaryInfo.leaderSupplyRank
this.fetchApplicableRegionList({reviewSummaryId: Coder.replace(this.reviewSummaryInfo.id)}) // 获取适用区域列表(树结构) this.fetchApplicableRegionList({reviewSummaryId: Coder.replace(this.reviewSummaryInfo.id)}) // 获取适用区域列表(树结构)
this.init()
},
computed: {
...mapState(['PageTypes']),
...mapGetters(['currentPageType']),
...mapState('inspect', [
'inspectSupplierSummaryList',
'inspectAllAppRegions',
'regionSelectIndexPath'
]),
...mapGetters('inspect', [
'currentFid'
]),
...mapState(['PageTypes', 'flowId', 'isReady', 'todoId'])
}, },
data () { data () {
return { return {
...@@ -86,7 +101,8 @@ export default { ...@@ -86,7 +101,8 @@ export default {
supplyRank: '0' supplyRank: '0'
}, },
conditionOption: '', conditionOption: '',
productGradeId: '' productGradeId: '',
submitType: ''
} }
}, },
methods: { methods: {
...@@ -94,6 +110,47 @@ export default { ...@@ -94,6 +110,47 @@ export default {
'fetchApplicableRegionList', 'fetchApplicableRegionList',
'fetchAuditReviewSummarys' 'fetchAuditReviewSummarys'
]), ]),
init () {
switch (this.currentPageType) {
case this.PageTypes.Leader_Todo:
// 组长会审
this.title = '考察-组长会审'
this.submitType = 'leader'
break
case this.PageTypes.Leader_Done:
// 组长已会审
this.title = '考察-组长已会审'
break
case this.PageTypes.Grade_Todo:
// 评分会审
this.title = '考察-评分会审'
this.submitType = 'leader'
break
case this.PageTypes.Grade_Done:
// 评分已会审
this.title = '考察-评分已会审'
break
case this.PageTypes.Sign_Todo:
// 待会审
this.title = '考察-会审'
this.submitType = 'sign'
break
case this.PageTypes.Sign_Done:
// 已会审
this.title = '考察-已会审'
break
case this.PageTypes.Approval_Todo:
// 待审批
this.title = '考察-审批'
this.submitType = 'audit'
break
case this.PageTypes.Approval_Done:
// 已审批
this.title = '考察-已审批'
break
default:
}
},
checkBeforeSubmit () { checkBeforeSubmit () {
/** /**
* 校验必填字段 * 校验必填字段
...@@ -145,6 +202,7 @@ export default { ...@@ -145,6 +202,7 @@ export default {
productGrade: encodeURIComponent(this.productGradeId || '') productGrade: encodeURIComponent(this.productGradeId || '')
}] }]
} }
console.log('leadercheck')
this.fetchAuditReviewSummarys({params, callback: this.submitCallback}) this.fetchAuditReviewSummarys({params, callback: this.submitCallback})
} }
}, },
...@@ -152,11 +210,77 @@ export default { ...@@ -152,11 +210,77 @@ export default {
if (!success) { if (!success) {
Toast(msg) Toast(msg)
} }
setTimeout(() => { this.handleFinallySubmit()
if (success) { // setTimeout(() => {
this.$router.go(-2) // if (success) {
// this.$router.go(-2)
// }
// }, 1000)
},
handleFinallySubmit () {
console.log(this.inspectSupplierSummaryList, 'this.inspectSupplierSummaryList')
let infos = this.inspectSupplierSummaryList.map((v, i) => {
let info = {
id: encodeURIComponent(v.id),
useCondition: encodeURIComponent(Coder.replaceQuots(Coder.replaceCRLF(v.useCondition))),
productGrade: encodeURIComponent(v.productGrade),
PrjTypeEntry: v.PrjTypeEntry.filter(v => v.checked).map(v => ({'projectType': encodeURIComponent(v.id)})),
ProjectEntry: v.ProjectEntry.map(v => ({'curProject': encodeURIComponent(v.curProject)}))
} }
}, 1000) // 适用区域
let arr = findItemByIndexPath(this.inspectAllAppRegions[i], this.regionSelectIndexPath)
switch (this.currentPageType) {
case this.PageTypes.Leader_Todo:
// info.leaderSupplyRank = v.leaderSupplyRank
// info.leaderOpinion = encodeURIComponent(Coder.replaceQuots(Coder.replaceCRLF(v.leaderOpinion)))
info.leaderSupplyRank = this.supplyRank.supplyRank
info.leaderOpinion = encodeURIComponent(Coder.replaceQuots(Coder.replaceCRLF(this.supplyRank.opinion || '')))
info.AppRegionEntry = arr.map(v => ({'appRegion': encodeURIComponent(v.id)}))
// info.AppRegionEntry = this.supplierAppRegionList.map(v => ({'appRegion': encodeURIComponent(v.id)}))
break
case this.PageTypes.Sign_Todo:
let person = v.SignEntry.find(it => it.signPerson === v.currentPerson)
if (person) {
// 只上传当前用户的会审意见
info.SignEntry = [
{
'signOpinion': encodeURIComponent(Coder.replaceQuots(Coder.replaceCRLF(person.signOpinion)))
}
]
}
break
case this.PageTypes.Approval_Todo:
info.auditSupplyRank = v.auditSupplyRank
info.auditOpinion = encodeURIComponent(Coder.replaceQuots(Coder.replaceCRLF(v.auditOpinion)))
info.AppRegionEntry = arr.map(v => ({'appRegion': encodeURIComponent(v.id)}))
// info.AppRegionEntry = this.supplierAppRegionList.map(v => ({'appRegion': encodeURIComponent(v.id)}))
break
default:
}
return info
})
console.log(this.currentFid, 'this.currentFid')
let params = {
isSave: false,
type: this.submitType,
id: encodeURIComponent(this.currentFid),
infos: infos,
assignmentId: this.todoId
}
console.log('inspect', params)
this.fetchAuditReviewSummarys({params, callback: this.submitFinallyCallback})
},
submitFinallyCallback (success, msg) {
this.$dialog
.alert({
message: msg
})
.then(() => {
if (success) {
this.$nativeApi.navigator.exit()
}
})
} }
} }
} }
......
<template> <template>
<base-layout :title="title"> <base-layout :title="title">
<div class="approval flex-v full"> <div class="approval flex-v full">
<group-info class="margin-top" :projectsInfo="inspectProjectInfo" :personsInfo="inspectPersionInfo" :remark="remark" :attachmentCount="attachmentCount" />
<card-panel title="基本信息" class="margin-top"> <card-panel title="基本信息" class="margin-top">
<div class="project-info flex-v"> <div class="project-info flex-v">
<span class="name">{{currentSupplierInfo.supplierName}}</span> <span class="name">{{currentSupplierInfo.supplierName}}</span>
...@@ -76,9 +78,11 @@ import ReviewTextArea from '@/components/ReviewTextArea.vue' ...@@ -76,9 +78,11 @@ import ReviewTextArea from '@/components/ReviewTextArea.vue'
import ReviewAddItem from '@/components/ReviewAddItem.vue' import ReviewAddItem from '@/components/ReviewAddItem.vue'
import PopupPicker from '@/components/PopupPicker.vue' import PopupPicker from '@/components/PopupPicker.vue'
import ProductGradePicker from '@/components/ProductGradePicker' import ProductGradePicker from '@/components/ProductGradePicker'
import { mapActions, mapState } from 'vuex' import { mapActions, mapState, mapGetters } from 'vuex'
import reviewSummaryMixin from '@/mixins/reviewSummaryMixin' import reviewSummaryMixin from '@/mixins/reviewSummaryMixin'
import { Coder } from '@/common' import { Coder } from '@/common'
import GroupInfo from '@/components/GroupInfo'
import { findItemByIndexPath } from '@/common/utils/assist'
export default { export default {
name: 'approval', name: 'approval',
...@@ -92,7 +96,8 @@ export default { ...@@ -92,7 +96,8 @@ export default {
ReviewAddItem, ReviewAddItem,
PopupPicker, PopupPicker,
ProductGradePicker, ProductGradePicker,
[Button.name]: Button [Button.name]: Button,
GroupInfo
}, },
mixins: [reviewSummaryMixin], mixins: [reviewSummaryMixin],
mounted () { mounted () {
...@@ -109,6 +114,7 @@ export default { ...@@ -109,6 +114,7 @@ export default {
this.$store.commit('showLoading', false) this.$store.commit('showLoading', false)
}) })
.catch(() => this.$store.commit('showLoading', false)) .catch(() => this.$store.commit('showLoading', false))
this.init()
}, },
data () { data () {
return { return {
...@@ -123,8 +129,31 @@ export default { ...@@ -123,8 +129,31 @@ export default {
}, },
computed: { computed: {
...mapState('inspect', { ...mapState('inspect', {
supplierSignList: state => state.supplierSignList.filter(v => v.submitTime) // 过滤未提交的 supplierSignList: state => state.supplierSignList.filter(v => v.submitTime), // 过滤未提交的
inspectPersionInfo: state => state.inspectPersionInfo,
inspectInfo: state => state.inspectInfo,
inspectAttachmentInfo: state => state.inspectAttachmentInfo,
inspectProjectInfo: state => state.inspectProjectInfo
}), }),
...mapState(['PageTypes']),
...mapGetters(['currentPageType']),
...mapState('inspect', [
'inspectSupplierSummaryList',
'inspectAllAppRegions',
'regionSelectIndexPath'
]),
...mapGetters('inspect', [
'currentFid'
]),
...mapState(['PageTypes', 'flowId', 'isReady', 'todoId']),
// 考察组基本信息-备注
remark () {
return this.inspectInfo.description
},
// 考察组基本信息-附件信息个数
attachmentCount () {
return this.inspectAttachmentInfo.total || 0
},
// 显示考察组会审 // 显示考察组会审
showSign () { showSign () {
return this.supplierSignList.length > 0 return this.supplierSignList.length > 0
...@@ -136,6 +165,47 @@ export default { ...@@ -136,6 +165,47 @@ export default {
'fetchReviewSummaryInfo', 'fetchReviewSummaryInfo',
'fetchAuditReviewSummarys' 'fetchAuditReviewSummarys'
]), ]),
init () {
switch (this.currentPageType) {
case this.PageTypes.Leader_Todo:
// 组长会审
this.title = '考察-组长会审'
this.submitType = 'leader'
break
case this.PageTypes.Leader_Done:
// 组长已会审
this.title = '考察-组长已会审'
break
case this.PageTypes.Grade_Todo:
// 评分会审
this.title = '考察-评分会审'
this.submitType = 'leader'
break
case this.PageTypes.Grade_Done:
// 评分已会审
this.title = '考察-评分已会审'
break
case this.PageTypes.Sign_Todo:
// 待会审
this.title = '考察-会审'
this.submitType = 'sign'
break
case this.PageTypes.Sign_Done:
// 已会审
this.title = '考察-已会审'
break
case this.PageTypes.Approval_Todo:
// 待审批
this.title = '考察-审批'
this.submitType = 'audit'
break
case this.PageTypes.Approval_Done:
// 已审批
this.title = '考察-已审批'
break
default:
}
},
checkBeforeSubmit () { checkBeforeSubmit () {
/** /**
* 校验必填字段 * 校验必填字段
...@@ -195,11 +265,76 @@ export default { ...@@ -195,11 +265,76 @@ export default {
if (!success) { if (!success) {
Toast(msg) Toast(msg)
} }
setTimeout(() => { this.handleFinallySubmit()
if (success) { // setTimeout(() => {
this.$router.go(-1) // if (success) {
// this.$router.go(-2)
// }
// }, 1000)
},
handleFinallySubmit () {
console.log(this.inspectSupplierSummaryList, 'this.inspectSupplierSummaryList')
let infos = this.inspectSupplierSummaryList.map((v, i) => {
let info = {
id: encodeURIComponent(v.id),
useCondition: encodeURIComponent(Coder.replaceQuots(Coder.replaceCRLF(v.useCondition))),
productGrade: encodeURIComponent(v.productGrade),
PrjTypeEntry: v.PrjTypeEntry.filter(v => v.checked).map(v => ({'projectType': encodeURIComponent(v.id)})),
ProjectEntry: v.ProjectEntry.map(v => ({'curProject': encodeURIComponent(v.curProject)}))
}
// 适用区域
let arr = findItemByIndexPath(this.inspectAllAppRegions[i], this.regionSelectIndexPath)
switch (this.currentPageType) {
case this.PageTypes.Leader_Todo:
info.leaderSupplyRank = v.leaderSupplyRank
info.leaderOpinion = encodeURIComponent(Coder.replaceQuots(Coder.replaceCRLF(v.leaderOpinion)))
info.AppRegionEntry = arr.map(v => ({'appRegion': encodeURIComponent(v.id)}))
// info.AppRegionEntry = this.supplierAppRegionList.map(v => ({'appRegion': encodeURIComponent(v.id)}))
break
case this.PageTypes.Sign_Todo:
let person = v.SignEntry.find(it => it.signPerson === v.currentPerson)
if (person) {
// 只上传当前用户的会审意见
info.SignEntry = [
{
'signOpinion': encodeURIComponent(Coder.replaceQuots(Coder.replaceCRLF(person.signOpinion)))
}
]
}
break
case this.PageTypes.Approval_Todo:
// info.auditSupplyRank = v.auditSupplyRank
// info.auditOpinion = encodeURIComponent(Coder.replaceQuots(Coder.replaceCRLF(v.auditOpinion)))
info.auditSupplyRank = this.supplyRank.supplyRank
info.auditOpinion = encodeURIComponent(Coder.replaceQuots(Coder.replaceCRLF(this.supplyRank.opinion || '')))
info.AppRegionEntry = arr.map(v => ({'appRegion': encodeURIComponent(v.id)}))
// info.AppRegionEntry = this.supplierAppRegionList.map(v => ({'appRegion': encodeURIComponent(v.id)}))
break
default:
} }
}, 1000) return info
})
console.log(this.currentFid, 'this.currentFid')
let params = {
isSave: false,
type: this.submitType,
id: encodeURIComponent(this.currentFid),
infos: infos,
assignmentId: this.todoId
}
console.log('inspect')
this.fetchAuditReviewSummarys({params, callback: this.submitFinallyCallback})
},
submitFinallyCallback (success, msg) {
this.$dialog
.alert({
message: msg
})
.then(() => {
if (success) {
this.$nativeApi.navigator.exit()
}
})
}, },
// 进入考察成员评分页面 // 进入考察成员评分页面
gotoMemberGrade () { gotoMemberGrade () {
......
...@@ -98,6 +98,10 @@ export default { ...@@ -98,6 +98,10 @@ export default {
showProjectScore () { showProjectScore () {
return this.projectScoreInfo && this.projectScoreInfo.total > 0 return this.projectScoreInfo && this.projectScoreInfo.total > 0
}, },
showProjectScore_showBusinessScore () {
// 如果 showProjectScore 或 showBusinessScore 中任意一个为 true,则返回 true
return this.showProjectScore || this.showBusinessScore
},
// 企业评审应得分 // 企业评审应得分
businessShouldTotalScore () { businessShouldTotalScore () {
return this.businessScoreList.reduce((total, cur) => Number(cur.shouldScore || 0) + total, 0) return this.businessScoreList.reduce((total, cur) => Number(cur.shouldScore || 0) + total, 0)
...@@ -118,6 +122,11 @@ export default { ...@@ -118,6 +122,11 @@ export default {
mounted () { mounted () {
this.fetchScores({billId: Coder.replace(this.memberGradeInfo.id)}) this.fetchScores({billId: Coder.replace(this.memberGradeInfo.id)})
}, },
activated () {
if (!this.showProjectScore_showBusinessScore) {
this.$router.replace({path: '/summary'})
}
},
data () { data () {
return { return {
title: '评分详情', title: '评分详情',
......
...@@ -5,6 +5,9 @@ ...@@ -5,6 +5,9 @@
<p>供方名称 <span>{{currentSupplierInfo.supplierName}}</span></p> <p>供方名称 <span>{{currentSupplierInfo.supplierName}}</span></p>
<p>供方类别 <span>{{currentSupplierInfo.supplierTypeName}}</span></p> <p>供方类别 <span>{{currentSupplierInfo.supplierTypeName}}</span></p>
</div> </div>
<group-info class="margin-top" :projectsInfo="inspectProjectInfo" :personsInfo="inspectPersionInfo" :remark="remark" :attachmentCount="attachmentCount" />
<div class="card-panel"> <div class="card-panel">
<cell-group> <cell-group>
<cell :title="contact" class="title"> <cell :title="contact" class="title">
...@@ -49,6 +52,7 @@ import { Cell, CellGroup, Field, Button, Toast } from 'vant' ...@@ -49,6 +52,7 @@ import { Cell, CellGroup, Field, Button, Toast } from 'vant'
import BaseLayout from '@/layouts/BaseLayout' import BaseLayout from '@/layouts/BaseLayout'
import FontIcon from '@/components/FontIcon' import FontIcon from '@/components/FontIcon'
import { Coder } from '@/common' import { Coder } from '@/common'
import GroupInfo from '@/components/GroupInfo'
export default { export default {
components: { components: {
...@@ -57,7 +61,8 @@ export default { ...@@ -57,7 +61,8 @@ export default {
CellGroup, CellGroup,
'font-icon': FontIcon, 'font-icon': FontIcon,
'van-field': Field, 'van-field': Field,
'van-button': Button 'van-button': Button,
GroupInfo
}, },
mounted () { mounted () {
this.clientHeight = `${document.documentElement.clientHeight}`; this.clientHeight = `${document.documentElement.clientHeight}`;
...@@ -143,9 +148,10 @@ export default { ...@@ -143,9 +148,10 @@ export default {
} }
this.reviewDistributeSumit({params, callback: this.submitCallback}) this.reviewDistributeSumit({params, callback: this.submitCallback})
} }
} else {
this.$router.go(-1)
} }
// else {
// this.$router.go(-1)
// }
}, },
submitCallback (success, msg) { submitCallback (success, msg) {
if (!success) { if (!success) {
...@@ -175,11 +181,23 @@ export default { ...@@ -175,11 +181,23 @@ export default {
...mapState(['PageTypes']), ...mapState(['PageTypes']),
...mapState(['todoId']), ...mapState(['todoId']),
...mapState('inspect', [ ...mapState('inspect', [
'currentSupplierInfo' 'currentSupplierInfo',
'inspectPersionInfo',
'inspectInfo',
'inspectAttachmentInfo',
'inspectProjectInfo'
]), ]),
...mapState('score', [ ...mapState('score', [
'memberGradeInfo' 'memberGradeInfo'
]), ]),
// 考察组基本信息-备注
remark () {
return this.inspectInfo.description
},
// 考察组基本信息-附件信息个数
attachmentCount () {
return this.inspectAttachmentInfo.total || 0
},
isEditable () { isEditable () {
switch (this.currentPageType) { switch (this.currentPageType) {
case this.PageTypes.Grade_Todo: case this.PageTypes.Grade_Todo:
......
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
</template> </template>
<script> <script>
import { mapActions } from 'vuex'
import { Button, Toast } from 'vant' import { Button, Toast } from 'vant'
import BaseLayout from '@/layouts/BaseLayout' import BaseLayout from '@/layouts/BaseLayout'
import FontIcon from '@/components/FontIcon' import FontIcon from '@/components/FontIcon'
...@@ -53,6 +52,8 @@ import PopupPicker from '@/components/PopupPicker.vue' ...@@ -53,6 +52,8 @@ import PopupPicker from '@/components/PopupPicker.vue'
import ProductGradePicker from '@/components/ProductGradePicker' import ProductGradePicker from '@/components/ProductGradePicker'
import reviewSummaryMixin from '@/mixins/reviewSummaryMixin' import reviewSummaryMixin from '@/mixins/reviewSummaryMixin'
import { Coder } from '@/common' import { Coder } from '@/common'
import { findItemByIndexPath } from '@/common/utils/assist'
import { mapActions, mapState, mapGetters } from 'vuex'
export default { export default {
name: 'sign', name: 'sign',
...@@ -66,6 +67,38 @@ export default { ...@@ -66,6 +67,38 @@ export default {
ProductGradePicker ProductGradePicker
}, },
mixins: [reviewSummaryMixin], mixins: [reviewSummaryMixin],
computed: {
...mapState('inspect', {
supplierSignList: state => state.supplierSignList.filter(v => v.submitTime), // 过滤未提交的
inspectPersionInfo: state => state.inspectPersionInfo,
inspectInfo: state => state.inspectInfo,
inspectAttachmentInfo: state => state.inspectAttachmentInfo,
inspectProjectInfo: state => state.inspectProjectInfo
}),
...mapState(['PageTypes']),
...mapGetters(['currentPageType']),
...mapState('inspect', [
'inspectSupplierSummaryList',
'inspectAllAppRegions',
'regionSelectIndexPath'
]),
...mapGetters('inspect', [
'currentFid'
]),
...mapState(['PageTypes', 'flowId', 'isReady', 'todoId']),
// 考察组基本信息-备注
remark () {
return this.inspectInfo.description
},
// 考察组基本信息-附件信息个数
attachmentCount () {
return this.inspectAttachmentInfo.total || 0
},
// 显示考察组会审
showSign () {
return this.supplierSignList.length > 0
}
},
mounted () { mounted () {
this.conditionOption = this.reviewSummaryInfo.useCondition this.conditionOption = this.reviewSummaryInfo.useCondition
this.productGradeId = this.reviewSummaryInfo.productGrade this.productGradeId = this.reviewSummaryInfo.productGrade
...@@ -76,6 +109,7 @@ export default { ...@@ -76,6 +109,7 @@ export default {
return return
} }
}) })
this.init()
}, },
data () { data () {
return { return {
...@@ -88,6 +122,32 @@ export default { ...@@ -88,6 +122,32 @@ export default {
...mapActions('inspect', [ ...mapActions('inspect', [
'fetchAuditReviewSummarys' 'fetchAuditReviewSummarys'
]), ]),
init () {
switch (this.currentPageType) {
case this.PageTypes.Leader_Todo:
// 组长会审
this.submitType = 'leader'
break
case this.PageTypes.Leader_Done:
break
case this.PageTypes.Grade_Todo:
this.submitType = 'leader'
break
case this.PageTypes.Grade_Done:
break
case this.PageTypes.Sign_Todo:
this.submitType = 'sign'
break
case this.PageTypes.Sign_Done:
break
case this.PageTypes.Approval_Todo:
this.submitType = 'audit'
break
case this.PageTypes.Approval_Done:
break
default:
}
},
checkBeforeSubmit () { checkBeforeSubmit () {
/** /**
* 校验必填字段 * 校验必填字段
...@@ -135,6 +195,7 @@ export default { ...@@ -135,6 +195,7 @@ export default {
productGrade: encodeURIComponent(this.productGradeId || '') productGrade: encodeURIComponent(this.productGradeId || '')
}] }]
} }
console.log('sign')
this.fetchAuditReviewSummarys({params, callback: this.submitCallback}) this.fetchAuditReviewSummarys({params, callback: this.submitCallback})
} }
}, },
...@@ -142,11 +203,79 @@ export default { ...@@ -142,11 +203,79 @@ export default {
if (!success) { if (!success) {
Toast(msg) Toast(msg)
} }
setTimeout(() => { this.handleFinallySubmit()
if (success) { // setTimeout(() => {
this.$router.go(-2) // if (success) {
// this.$router.go(-2)
// }
// }, 1000)
},
handleFinallySubmit () {
console.log(this.inspectSupplierSummaryList, 'this.inspectSupplierSummaryList')
let infos = this.inspectSupplierSummaryList.map((v, i) => {
let info = {
id: encodeURIComponent(v.id),
useCondition: encodeURIComponent(Coder.replaceQuots(Coder.replaceCRLF(v.useCondition))),
productGrade: encodeURIComponent(v.productGrade),
PrjTypeEntry: v.PrjTypeEntry.filter(v => v.checked).map(v => ({'projectType': encodeURIComponent(v.id)})),
ProjectEntry: v.ProjectEntry.map(v => ({'curProject': encodeURIComponent(v.curProject)}))
} }
}, 1000) // 适用区域
let arr = findItemByIndexPath(this.inspectAllAppRegions[i], this.regionSelectIndexPath)
switch (this.currentPageType) {
case this.PageTypes.Leader_Todo:
info.leaderSupplyRank = v.leaderSupplyRank
info.leaderOpinion = encodeURIComponent(Coder.replaceQuots(Coder.replaceCRLF(v.leaderOpinion)))
info.AppRegionEntry = arr.map(v => ({'appRegion': encodeURIComponent(v.id)}))
// info.AppRegionEntry = this.supplierAppRegionList.map(v => ({'appRegion': encodeURIComponent(v.id)}))
break
case this.PageTypes.Sign_Todo:
// let person = v.SignEntry.find(it => it.signPerson === v.currentPerson)
// if (person) {
// // 只上传当前用户的会审意见
// info.SignEntry = [
// {
// 'signOpinion': encodeURIComponent(Coder.replaceQuots(Coder.replaceCRLF(person.signOpinion)))
// }
// ]
// }
info.SignEntry = [
{
signOpinion: encodeURIComponent(Coder.replaceQuots(Coder.replaceCRLF(this.signOption || '')))
}
]
break
case this.PageTypes.Approval_Todo:
info.auditSupplyRank = v.auditSupplyRank
info.auditOpinion = encodeURIComponent(Coder.replaceQuots(Coder.replaceCRLF(v.auditOpinion)))
info.AppRegionEntry = arr.map(v => ({'appRegion': encodeURIComponent(v.id)}))
// info.AppRegionEntry = this.supplierAppRegionList.map(v => ({'appRegion': encodeURIComponent(v.id)}))
break
default:
}
return info
})
console.log(this.currentFid, 'this.currentFid')
let params = {
isSave: false,
type: this.submitType,
id: encodeURIComponent(this.currentFid),
infos: infos,
assignmentId: this.todoId
}
console.log('inspect')
this.fetchAuditReviewSummarys({params, callback: this.submitFinallyCallback})
},
submitFinallyCallback (success, msg) {
this.$dialog
.alert({
message: msg
})
.then(() => {
if (success) {
this.$nativeApi.navigator.exit()
}
})
} }
} }
} }
......
...@@ -117,8 +117,8 @@ export default { ...@@ -117,8 +117,8 @@ export default {
actionGetAllAppRegionList({ isConvert: true }).then(res => { actionGetAllAppRegionList({ isConvert: true }).then(res => {
console.log(res, '111') console.log(res, '111')
const regionList = JSON.parse(res.data) const regionList = JSON.parse(res.data)
const {node: itemRe, path} = findNodeById(response.data.appRegion, regionList) || {} const {node: itemRe, path} = findNodeById(response.data.appRegion, regionList)
console.log(itemRe, 'itemRe', response.data.appRegion, regionList) console.log(itemRe, 'itemRe', response.data.appRegion, regionList, path)
// 已选的适用特定项目 // 已选的适用特定项目
if (itemRe) { if (itemRe) {
commit('updateSupplierAppRegionList', [itemRe]) commit('updateSupplierAppRegionList', [itemRe])
...@@ -131,6 +131,10 @@ export default { ...@@ -131,6 +131,10 @@ export default {
} }
if (response.code === 200 && typeof response.data !== 'string') { if (response.code === 200 && typeof response.data !== 'string') {
console.log(response.data, 'response.data11')
if (!response.data.description && response.data.reviewGrp) {
response.data.description = response.data.reviewGrp.description
}
await commit('updateInspectInfo', response.data) await commit('updateInspectInfo', response.data)
if (isGradeNode) { if (isGradeNode) {
reviewGrpId = getters.reviewGrpId reviewGrpId = getters.reviewGrpId
...@@ -165,7 +169,7 @@ export default { ...@@ -165,7 +169,7 @@ export default {
.catch(error => { .catch(error => {
commit('networkError', error.msg, { root: true }) commit('networkError', error.msg, { root: true })
}) })
console.log(response, 'response')
// 获取所有的供方信息 // 获取所有的供方信息
if (response.data.rows.length > 0) { if (response.data.rows.length > 0) {
if (isGradeNode) { if (isGradeNode) {
...@@ -181,6 +185,7 @@ export default { ...@@ -181,6 +185,7 @@ export default {
} }
return null return null
}) })
console.log('updateInspectSupplierSummaryList', datas.filter(v => v !== null))
commit('updateInspectSupplierSummaryList', datas.filter(v => v !== null)) commit('updateInspectSupplierSummaryList', datas.filter(v => v !== null))
}) })
.catch(error => { .catch(error => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment