Commit 8bc84814 by sujingsong

fix: 去掉首次进入页面

parent b02fc0a8
......@@ -4,8 +4,8 @@ import { MAS } from '@/plugins/mas'
const masConfig = process.env.PACK_ENV === 'prod'
? {
baseUrl: 'https://jffcvp.cndrealty.com:4433', // 正式环境
// baseUrl: 'https://mxytest.cndrealty.com:4433', // 测试环境
// baseUrl: 'https://jffcvp.cndrealty.com:4433', // 正式环境
baseUrl: 'https://mxytest.cndrealty.com:4433', // 测试环境
tokenKey: 'accessToken',
code: 'cndvp-api'
}
......
<template>
<card-panel :title="title">
<div class="person-info">
<div class="flex flex-cross-center">
<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 >
<card-panel :title="title">
<div class="person-info">
<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>
<span class="label">{{item.deptName}}</span>
<span class="label">{{leader.deptName}}</span>
</div>
</div>
</div>
<div class="other-info">
<div>
<label class="label">备注</label>
<span>{{remark}}</span>
<div v-show="expand">
<div class="person-info" v-for="(item, index) in otherPersons" :key="index">
<div class="flex flex-cross-center">
<span class="name">{{item.personName}}-{{item.positionName}}</span>
</div>
<div>
<span class="label">{{item.deptName}}</span>
</div>
</div>
</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 class="other-info">
<div>
<label class="label">备注</label>
<span>{{remark}}</span>
</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 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>
</div>
</template>
<script>
import { Tag, Collapse, CollapseItem } from 'vant'
import CardPanel from '@/components/CardPanel'
import FontIcon from '@/components/FontIcon'
import ReviewProjectInfo from '@/components/ReviewProjectInfo'
export default {
name: 'group-info',
......@@ -52,7 +56,8 @@ export default {
Collapse,
CollapseItem,
CardPanel,
FontIcon
FontIcon,
ReviewProjectInfo
},
props: {
personsInfo: {
......@@ -61,6 +66,12 @@ export default {
return {}
}
},
projectsInfo: {
type: Object,
default: function () {
return {}
}
},
remark: String,
attachmentCount: Number
},
......@@ -156,4 +167,8 @@ label {
font-size: 14px;
font-weight: 400;
}
.bgColor{
background-color: #fff;
padding: 0 15px 10px;
}
</style>
<template>
<base-layout :title="title">
<base-layout title="" v-if="false">
<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">
<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 {
return this.inspectAttachmentInfo.total || 0
},
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
},
supplierType () {
......@@ -110,6 +111,15 @@ export default {
},
currentPageType (newVal, oldVal) {
this.init()
},
inspectSupplierSummaryList: {
handler (newValue) {
console.log(newValue, 'inspectSupplierSummaryList')
if (newValue.length > 0) {
this.handleSupplierClick(newValue[0])
}
},
immediate: true
}
},
methods: {
......@@ -119,7 +129,7 @@ export default {
fetchData () {
this.$store.commit('showLoading', true)
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))
.catch(() => this.$store.commit('showLoading', false))
} else {
......@@ -220,25 +230,27 @@ export default {
}
},
handleSupplierClick (item) {
console.log(this.currentPageType, this.PageTypes)
this.updateCurrentReviewFormFid(item.id)
this.updateCurrentSupplier(item)
switch (this.currentPageType) {
case this.PageTypes.Approval_Todo:
case this.PageTypes.Approval_Done:
// 审批
this.$router.push({name: 'approval', params: item})
this.$router.replace({name: 'approval', params: item})
break
case this.PageTypes.Grade_Todo:
case this.PageTypes.Grade_Done:
this.updateMemberGradeInfo(item)
this.$router.push({name: 'summary', params: item})
this.$router.replace({name: 'summary', params: item})
break
default:
this.$router.push({name: 'supplier', params: item})
this.$router.replace({name: 'supplier', params: item})
}
},
// 判断对应的适用区域是否为空
checkAppRegion (index) {
console.log(this.inspectAllAppRegions, 'this.inspectAllAppRegions', index)
let result = true
if (this.inspectAllAppRegions && this.inspectAllAppRegions[index]) {
// 对应的当前供方的适用区域
......@@ -356,6 +368,7 @@ export default {
if (!this.checkBeforeSubmit()) {
return
}
console.log(this.inspectSupplierSummaryList, 'this.inspectSupplierSummaryList')
let infos = this.inspectSupplierSummaryList.map((v, i) => {
let info = {
id: encodeURIComponent(v.id),
......@@ -366,7 +379,6 @@ export default {
}
// 适用区域
let arr = findItemByIndexPath(this.inspectAllAppRegions[i], this.regionSelectIndexPath)
console.log(arr, 'arr', this.inspectAllAppRegions[i], this.regionSelectIndexPath)
switch (this.currentPageType) {
case this.PageTypes.Leader_Todo:
info.leaderSupplyRank = v.leaderSupplyRank
......@@ -402,6 +414,7 @@ export default {
infos: infos,
assignmentId: this.todoId
}
console.log('inspect')
this.fetchAuditReviewSummarys({params, callback: this.submitCallback})
},
submitCallback (success, msg) {
......
<template>
<base-layout :title="title">
<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">
<div class="supplier-info flex flex-v">
<span>{{currentSupplierInfo.supplierName}}</span>
......@@ -33,6 +35,7 @@ import ConclusionItem from '@/components/ConclusionItem'
import SignItem from '@/components/SignItem'
import { mapState, mapGetters, mapActions, mapMutations } from 'vuex'
import { Coder } from '@/common'
import GroupInfo from '@/components/GroupInfo'
export default {
name: 'supplier',
......@@ -43,12 +46,13 @@ export default {
GradeList,
ConclusionItem,
SignItem,
'van-button': Button
'van-button': Button,
GroupInfo
},
mounted () {
this.init()
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))
.catch(() => this.$store.commit('showLoading', false))
},
......@@ -66,8 +70,20 @@ export default {
currentSupplierInfo: state => state.currentSupplierInfo,
groupConclusion: state => state.groupConclusion,
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 () {
return this.currentPageType === this.PageTypes.Leader_Done ||
......
......@@ -55,9 +55,10 @@ import ReviewTextArea from '@/components/ReviewTextArea.vue'
import ReviewAddItem from '@/components/ReviewAddItem.vue'
import PopupPicker from '@/components/PopupPicker.vue'
import ProductGradePicker from '@/components/ProductGradePicker'
import { mapActions } from 'vuex'
import reviewSummaryMixin from '@/mixins/reviewSummaryMixin'
import { Coder } from '@/common'
import { findItemByIndexPath } from '@/common/utils/assist'
import { mapActions, mapState, mapGetters } from 'vuex'
export default {
name: 'leadercheck',
......@@ -78,6 +79,20 @@ export default {
this.supplyRank.opinion = this.reviewSummaryInfo.leaderOpinion
this.supplyRank.supplyRank = this.reviewSummaryInfo.leaderSupplyRank
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 () {
return {
......@@ -86,7 +101,8 @@ export default {
supplyRank: '0'
},
conditionOption: '',
productGradeId: ''
productGradeId: '',
submitType: ''
}
},
methods: {
......@@ -94,6 +110,47 @@ export default {
'fetchApplicableRegionList',
'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 () {
/**
* 校验必填字段
......@@ -145,6 +202,7 @@ export default {
productGrade: encodeURIComponent(this.productGradeId || '')
}]
}
console.log('leadercheck')
this.fetchAuditReviewSummarys({params, callback: this.submitCallback})
}
},
......@@ -152,11 +210,77 @@ export default {
if (!success) {
Toast(msg)
}
setTimeout(() => {
if (success) {
this.$router.go(-2)
this.handleFinallySubmit()
// setTimeout(() => {
// 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>
<base-layout :title="title">
<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">
<div class="project-info flex-v">
<span class="name">{{currentSupplierInfo.supplierName}}</span>
......@@ -76,9 +78,11 @@ import ReviewTextArea from '@/components/ReviewTextArea.vue'
import ReviewAddItem from '@/components/ReviewAddItem.vue'
import PopupPicker from '@/components/PopupPicker.vue'
import ProductGradePicker from '@/components/ProductGradePicker'
import { mapActions, mapState } from 'vuex'
import { mapActions, mapState, mapGetters } from 'vuex'
import reviewSummaryMixin from '@/mixins/reviewSummaryMixin'
import { Coder } from '@/common'
import GroupInfo from '@/components/GroupInfo'
import { findItemByIndexPath } from '@/common/utils/assist'
export default {
name: 'approval',
......@@ -92,7 +96,8 @@ export default {
ReviewAddItem,
PopupPicker,
ProductGradePicker,
[Button.name]: Button
[Button.name]: Button,
GroupInfo
},
mixins: [reviewSummaryMixin],
mounted () {
......@@ -109,6 +114,7 @@ export default {
this.$store.commit('showLoading', false)
})
.catch(() => this.$store.commit('showLoading', false))
this.init()
},
data () {
return {
......@@ -123,8 +129,31 @@ export default {
},
computed: {
...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 () {
return this.supplierSignList.length > 0
......@@ -136,6 +165,47 @@ export default {
'fetchReviewSummaryInfo',
'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 () {
/**
* 校验必填字段
......@@ -195,11 +265,76 @@ export default {
if (!success) {
Toast(msg)
}
setTimeout(() => {
if (success) {
this.$router.go(-1)
this.handleFinallySubmit()
// setTimeout(() => {
// 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 () {
......
......@@ -98,6 +98,10 @@ export default {
showProjectScore () {
return this.projectScoreInfo && this.projectScoreInfo.total > 0
},
showProjectScore_showBusinessScore () {
// 如果 showProjectScore 或 showBusinessScore 中任意一个为 true,则返回 true
return this.showProjectScore || this.showBusinessScore
},
// 企业评审应得分
businessShouldTotalScore () {
return this.businessScoreList.reduce((total, cur) => Number(cur.shouldScore || 0) + total, 0)
......@@ -118,6 +122,11 @@ export default {
mounted () {
this.fetchScores({billId: Coder.replace(this.memberGradeInfo.id)})
},
activated () {
if (!this.showProjectScore_showBusinessScore) {
this.$router.replace({path: '/summary'})
}
},
data () {
return {
title: '评分详情',
......
......@@ -5,6 +5,9 @@
<p>供方名称 <span>{{currentSupplierInfo.supplierName}}</span></p>
<p>供方类别 <span>{{currentSupplierInfo.supplierTypeName}}</span></p>
</div>
<group-info class="margin-top" :projectsInfo="inspectProjectInfo" :personsInfo="inspectPersionInfo" :remark="remark" :attachmentCount="attachmentCount" />
<div class="card-panel">
<cell-group>
<cell :title="contact" class="title">
......@@ -49,6 +52,7 @@ import { Cell, CellGroup, Field, Button, Toast } from 'vant'
import BaseLayout from '@/layouts/BaseLayout'
import FontIcon from '@/components/FontIcon'
import { Coder } from '@/common'
import GroupInfo from '@/components/GroupInfo'
export default {
components: {
......@@ -57,7 +61,8 @@ export default {
CellGroup,
'font-icon': FontIcon,
'van-field': Field,
'van-button': Button
'van-button': Button,
GroupInfo
},
mounted () {
this.clientHeight = `${document.documentElement.clientHeight}`;
......@@ -143,9 +148,10 @@ export default {
}
this.reviewDistributeSumit({params, callback: this.submitCallback})
}
} else {
this.$router.go(-1)
}
// else {
// this.$router.go(-1)
// }
},
submitCallback (success, msg) {
if (!success) {
......@@ -175,11 +181,23 @@ export default {
...mapState(['PageTypes']),
...mapState(['todoId']),
...mapState('inspect', [
'currentSupplierInfo'
'currentSupplierInfo',
'inspectPersionInfo',
'inspectInfo',
'inspectAttachmentInfo',
'inspectProjectInfo'
]),
...mapState('score', [
'memberGradeInfo'
]),
// 考察组基本信息-备注
remark () {
return this.inspectInfo.description
},
// 考察组基本信息-附件信息个数
attachmentCount () {
return this.inspectAttachmentInfo.total || 0
},
isEditable () {
switch (this.currentPageType) {
case this.PageTypes.Grade_Todo:
......
......@@ -43,7 +43,6 @@
</template>
<script>
import { mapActions } from 'vuex'
import { Button, Toast } from 'vant'
import BaseLayout from '@/layouts/BaseLayout'
import FontIcon from '@/components/FontIcon'
......@@ -53,6 +52,8 @@ import PopupPicker from '@/components/PopupPicker.vue'
import ProductGradePicker from '@/components/ProductGradePicker'
import reviewSummaryMixin from '@/mixins/reviewSummaryMixin'
import { Coder } from '@/common'
import { findItemByIndexPath } from '@/common/utils/assist'
import { mapActions, mapState, mapGetters } from 'vuex'
export default {
name: 'sign',
......@@ -66,6 +67,38 @@ export default {
ProductGradePicker
},
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 () {
this.conditionOption = this.reviewSummaryInfo.useCondition
this.productGradeId = this.reviewSummaryInfo.productGrade
......@@ -76,6 +109,7 @@ export default {
return
}
})
this.init()
},
data () {
return {
......@@ -88,6 +122,32 @@ export default {
...mapActions('inspect', [
'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 () {
/**
* 校验必填字段
......@@ -135,6 +195,7 @@ export default {
productGrade: encodeURIComponent(this.productGradeId || '')
}]
}
console.log('sign')
this.fetchAuditReviewSummarys({params, callback: this.submitCallback})
}
},
......@@ -142,11 +203,79 @@ export default {
if (!success) {
Toast(msg)
}
setTimeout(() => {
if (success) {
this.$router.go(-2)
this.handleFinallySubmit()
// setTimeout(() => {
// 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 {
actionGetAllAppRegionList({ isConvert: true }).then(res => {
console.log(res, '111')
const regionList = JSON.parse(res.data)
const {node: itemRe, path} = findNodeById(response.data.appRegion, regionList) || {}
console.log(itemRe, 'itemRe', response.data.appRegion, regionList)
const {node: itemRe, path} = findNodeById(response.data.appRegion, regionList)
console.log(itemRe, 'itemRe', response.data.appRegion, regionList, path)
// 已选的适用特定项目
if (itemRe) {
commit('updateSupplierAppRegionList', [itemRe])
......@@ -131,6 +131,10 @@ export default {
}
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)
if (isGradeNode) {
reviewGrpId = getters.reviewGrpId
......@@ -165,7 +169,7 @@ export default {
.catch(error => {
commit('networkError', error.msg, { root: true })
})
console.log(response, 'response')
// 获取所有的供方信息
if (response.data.rows.length > 0) {
if (isGradeNode) {
......@@ -181,6 +185,7 @@ export default {
}
return null
})
console.log('updateInspectSupplierSummaryList', datas.filter(v => v !== null))
commit('updateInspectSupplierSummaryList', datas.filter(v => v !== null))
})
.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