Commit b02fc0a8 by sujingsong

fix: 去掉区域选择

parent 7e7f5602
......@@ -33,8 +33,8 @@ export default {
setTimeout(async () => {
setToken()
this.updateFid(testFid)
this.updateCurrentPageType(29)
await this.fetchInspect({billId: Coder.replace(testFid), isGradeNode: true}) // 29 30评分节点放开
this.updateCurrentPageType(5)
await this.fetchInspect({billId: Coder.replace(testFid), isGradeNode: false}) // 29 30评分节点放开
this.updateReadyState(true)
}, 1000)
}
......
......@@ -19,10 +19,10 @@ const mas = MAS.getInstance().config(masConfig)
// 测试token,从美信云平台的登录记录获取
const testToken = 'T3362026552542208'
const testToken = 'yzj_d0760d55e9d54b0bd7af2392e1722feb'
// 测试流程单据id
const testFid = 'x9oAAArXirvuMsBg' // x9oAAArMGB/irKan 营销类 x9oAAArNAtPirKan 商业类 x9oAAArNClDirKan
const testFid = 'x9oAADIWh6nirKan' // x9oAAArMGB/irKan 营销类 x9oAAArNAtPirKan 商业类 x9oAAArNClDirKan
/* 1.供方更名:(会签)x9oAAArQslp2xf1N 、x9oAAArTSgN2xf1N - dingzhy@cndrealty.com 、x9oAAArQqcV2xf1N \\ (审批)x9oAAArTSdR2xf1N - liub@cndrealty.com
* 2.调整联系方式:(会签)x9oAAArTSgN2xf1N - dingzhy@cndrealty.com 、x9oAAArMYD12xf1N - caimm \ \\ (审批)x9oAAArTSdR2xf1N - liub@cndrealty.com
* 3.调整品牌方式:(会签)x9oAAArTShV2xf1N - xiewei
......
......@@ -17,6 +17,13 @@ export async function getApplicableRegionList (params) {
}
/**
* 适用区域全部
*/
export async function actionGetAllAppRegionList (params) {
return mas.proxy(MAS_CODES.actionGetAllAppRegionList, params)
}
/**
* 供方考察会签保存或提交
*/
export async function getAuditReviewSummarys (payload) {
......
......@@ -10,6 +10,7 @@ export const MAS_CODES = {
attachmentx2proriginal: 'mas.x2pr.original', // 附件转换获取原文件数据
attachmentCancel: 'eas.supply.actionCancelAttachmentInfo', // 附件作废
applicableRegionList: 'eas.supply.actionGetApplicableRegionList', // 适用区域
actionGetAllAppRegionList: 'eas.supply.actionGetAllAppRegionList', // 适用区域(全部)
auditReviewSummarys: 'eas.supply.reviewGrpActionAuditReviewSummarys', // 供方考察会签保存或提交
reviewSummaryPersionList: 'eas.supply.reviewSummaryActionGetEntryList', // 获取供方考察评审汇总人员
reviewSummaryInfo: 'eas.supply.reviewSummaryActionGetInfo', // 获取供方考察评审汇总表
......
......@@ -121,3 +121,36 @@ export function reduceTreeCheckedList (list, arr) {
}
}
}
export function findNodeById (id, list, parentIndexes = []) {
for (let index = 0; index < list.length; index++) {
const item = list[index];
// 当前层级索引路径 = 父级路径 + 当前索引
const currentPath = [...parentIndexes, index];
// 匹配时返回带路径的对象
if (item.id === id) {
return { node: item, path: currentPath };
}
// 递归时携带当前路径
if (item.children && !item.leaf) {
const result = findNodeById(id, item.children, currentPath);
if (result) return result;
}
}
return null;
}
export function findItemByIndexPath (list, indexPath = []) {
if (list.length == 0 || indexPath.length == 0) return
let currentNode = list
indexPath.forEach((item, index) => {
if (index == 0) {
currentNode = currentNode[item]
} else {
currentNode = currentNode.children[item]
}
})
return [currentNode]
}
......@@ -85,9 +85,10 @@ export default {
},
handleRadioClick (value) {
if (this.editable) {
const conclusion = value === '0' ? '同意' : '不同意'
this.inspectLibRadio = value
this.value.supplyRank = value
this.$emit('input', { opinion: this.value.opinion, supplyRank: this.inspectLibRadio })
this.$emit('input', { opinion: conclusion, supplyRank: this.inspectLibRadio })
}
}
}
......
......@@ -27,14 +27,15 @@ export default {
}
},
showCondition () {
// 工程类、设计类显示使用条件,其他不显示
switch (this.supplierTypeNumber) {
case this.SupplierTypes.GC:
case this.SupplierTypes.SJ:
return true
default:
return false
}
// 工程类、设计类显示使用条件,其他不显示
// switch (this.supplierTypeNumber) {
// case this.SupplierTypes.GC:
// case this.SupplierTypes.SJ:
// return true
// default:
// return false
// }
},
showAppRegion () {
// 会签节点没有选择适用区域权限
......
......@@ -23,7 +23,7 @@ import CardPanel from '@/components/CardPanel'
import GroupInfo from '@/components/GroupInfo'
import ReviewProjectInfo from '@/components/ReviewProjectInfo'
import SupplierItem from '@/components/SupplierItem'
import { reduceTreeCheckedList } from '@/common/utils/assist'
import { findItemByIndexPath } from '@/common/utils/assist'
import { Coder } from '@/common'
export default {
......@@ -63,7 +63,9 @@ export default {
'inspectPersionInfo',
'inspectProjectInfo',
'inspectSupplierInfo',
'inspectAttachmentInfo'
'supplierAppRegionList',
'inspectAttachmentInfo',
'regionSelectIndexPath'
]),
// 考察组基本信息-备注
remark () {
......@@ -185,9 +187,9 @@ export default {
if (item.leaderSupplyRank == '-1') {
return false
}
if (!this.checkAppRegion(index)) {
return false
}
// if (!this.checkAppRegion(index)) {
// return false
// }
return true
case this.PageTypes.Approval_Todo:
// 审批必填项校验
......@@ -197,9 +199,9 @@ export default {
if (item.auditSupplyRank == '-1') {
return false
}
if (!this.checkAppRegion(index)) {
return false
}
// if (!this.checkAppRegion(index)) {
// return false
// }
return true
case this.PageTypes.Sign_Todo:
// 会审必填项校验
......@@ -297,11 +299,11 @@ export default {
isFinished = false
break
}
if (!this.checkAppRegion(index)) {
tipText = '适用区域不能为空!'
isFinished = false
break
}
// if (!this.checkAppRegion(index)) {
// tipText = '适用区域不能为空!'
// isFinished = false
// break
// }
break
case this.PageTypes.Sign_Todo:
if (v.SignEntry.length > 0) {
......@@ -330,11 +332,11 @@ export default {
isFinished = false
break
}
if (!this.checkAppRegion(index)) {
tipText = '适用区域不能为空!'
isFinished = false
break
}
// if (!this.checkAppRegion(index)) {
// tipText = '适用区域不能为空!'
// isFinished = false
// break
// }
break
}
// 有未通过校验的就退出循环
......@@ -363,13 +365,14 @@ export default {
ProjectEntry: v.ProjectEntry.map(v => ({'curProject': encodeURIComponent(v.curProject)}))
}
// 适用区域
let arr = []
reduceTreeCheckedList(this.inspectAllAppRegions[i], arr)
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
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)
......@@ -386,6 +389,7 @@ export default {
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:
}
......
......@@ -11,14 +11,14 @@
<review-add-item
:title="`${appRegionIndex}.适用区域`"
v-if="showAppRegion"
:editable="isTodo"
:editable="false"
btnTitle="添加适用区域"
:itemList="supplierAppRegionList.map(v=>v.text)"
@handleAdd="handleChooseArea"
></review-add-item>
<review-add-item
v-if="showProject"
:editable="isTodo"
:editable="false"
:title="`${projectIndex}.适用特定项目`"
:itemList="cacheProjectList.map(v=>v.projectName)"
btnTitle="添加适用项目"
......@@ -77,7 +77,7 @@ export default {
this.productGradeId = this.reviewSummaryInfo.productGrade
this.supplyRank.opinion = this.reviewSummaryInfo.leaderOpinion
this.supplyRank.supplyRank = this.reviewSummaryInfo.leaderSupplyRank
this.fetchApplicableRegionList({reviewSummaryId: encodeURIComponent(Coder.replace(this.reviewSummaryInfo.id))}) // 获取适用区域列表(树结构)
this.fetchApplicableRegionList({reviewSummaryId: Coder.replace(this.reviewSummaryInfo.id)}) // 获取适用区域列表(树结构)
},
data () {
return {
......@@ -111,10 +111,11 @@ export default {
} else if (this.supplyRank.supplyRank == '-1') {
tipText = '综合评估不能为空!'
isFinished = false
} else if (this.supplierAppRegionList.length < 1) {
tipText = '适用区域不能为空!'
isFinished = false
}
// else if (this.supplierAppRegionList.length < 1) {
// tipText = '适用区域不能为空!'
// isFinished = false
// }
if (!isFinished) {
this.$dialog.alert({
title: tipTitle,
......
......@@ -30,20 +30,20 @@
<review-add-item
:title="`${appRegionIndex}.适用区域`"
v-if="showAppRegion"
:editable="isTodo"
:editable="false"
btnTitle="添加适用区域"
:itemList="supplierAppRegionList.map(v=>v.text)"
@handleAdd="handleChooseArea"
></review-add-item>
<review-add-item
v-if="showProject"
:editable="isTodo"
:editable="false"
:title="`${projectIndex}.适用特定项目`"
:itemList="cacheProjectList.map(v=>v.projectName)"
btnTitle="添加适用项目"
@handleAdd="handleChooseProject"
/>
<review-add-item
<!-- <review-add-item
v-if="showProjectType"
:editable="isTodo"
:title="`${projectTypeIndex}.适用项目类型`"
......@@ -57,7 +57,7 @@
:title="`${productGradeIndex}.适用产品档次`"
:defaultValue="productGradeId"
v-model="productGradeId"
/>
/> -->
<van-button @click="handleSubmit" v-if="isTodo" type="danger" size="large">确认</van-button>
</div>
</card-panel>
......@@ -97,13 +97,15 @@ export default {
mixins: [reviewSummaryMixin],
mounted () {
this.$store.commit('showLoading', true)
this.fetchReviewSummaryInfo({billId: encodeURIComponent(Coder.replace(this.currentSupplierInfo.id))})
this.fetchReviewSummaryInfo({billId: Coder.replace(this.currentSupplierInfo.id)})
.then(() => {
this.conditionOption = this.reviewSummaryInfo.useCondition
this.productGradeId = this.reviewSummaryInfo.productGrade
this.supplyRank.supplyRank = this.reviewSummaryInfo.auditSupplyRank
this.supplyRank.opinion = this.reviewSummaryInfo.auditOpinion
this.fetchApplicableRegionList({reviewSummaryId: encodeURIComponent(Coder.replace(this.reviewSummaryInfo.id))}) // 获取适用区域列表(树结构)
console.log(this.reviewSummaryInfo, 'reviewSummaryInfo', this.reviewSummaryInfo.AppRegionEntry, this.supplierAppRegionList)
this.fetchApplicableRegionList({reviewSummaryId: Coder.replace(this.reviewSummaryInfo.id)}) // 获取适用区域列表(树结构)
this.$store.commit('showLoading', false)
})
.catch(() => this.$store.commit('showLoading', false))
......@@ -151,10 +153,11 @@ export default {
} else if (this.supplyRank.supplyRank == '-1') {
tipText = '综合评估不能为空!'
isFinished = false
} else if (this.supplierAppRegionList.length < 1) {
tipText = '适用区域不能为空!'
isFinished = false
}
// else if (this.supplierAppRegionList.length < 1) {
// tipText = '适用区域不能为空!'
// isFinished = false
// }
if (!isFinished) {
this.$dialog.alert({
title: tipTitle,
......@@ -184,6 +187,7 @@ export default {
productGrade: encodeURIComponent(this.productGradeId || '')
}]
}
console.log(params, 'params', this.cacheProjectList, this.supplierAppRegionList)
this.fetchAuditReviewSummarys({params, callback: this.submitCallback})
}
},
......
......@@ -66,6 +66,11 @@ export default {
};
this.index = this.memberGradeInfo.supplyRank
// this.fetchScores({billId: Coder.replace(this.memberGradeInfo.id)})
console.log(this.memberGradeInfo, 'mountend')
if (!this.memberGradeInfo || !this.memberGradeInfo.conclusion) {
console.log('111')
this.updateMemberGradeInfo({ ...this.memberGradeInfo, conclusion: '同意' })
}
},
watch: {
clientHeight: function () {
......@@ -88,7 +93,8 @@ export default {
toggle (index) {
if (this.isEditable) {
this.index = index
this.updateMemberGradeInfo({ ...this.memberGradeInfo, supplyRank: index })
const conclusion = index === 0 ? '同意' : '不同意'
this.updateMemberGradeInfo({ ...this.memberGradeInfo, supplyRank: index, conclusion })
}
},
changeFixed (clientHeight) {
......@@ -185,6 +191,7 @@ export default {
}
},
defaultSupplyRank () {
console.log(this.memberGradeInfo, 'memberGradeInfo')
return this.memberGradeInfo.supplyRank || 0
}
}
......
......@@ -14,13 +14,13 @@
placeholder="请输入使用条件说明" />
<review-add-item
v-if="showProject"
:editable="isTodo"
:editable="false"
:title="`${projectIndex}.适用特定项目`"
:itemList="cacheProjectList.map(v=>v.projectName)"
btnTitle="添加适用项目"
@handleAdd="handleChooseProject"
/>
<review-add-item
<!-- <review-add-item
v-if="showProjectType"
:editable="isTodo"
:title="`${projectTypeIndex}.适用项目类型`"
......@@ -34,7 +34,7 @@
:title="`${productGradeIndex}.适用产品档次`"
:defaultValue="productGradeId"
v-model="productGradeId"
/>
/> -->
</div>
<div class="footer flex-v flex-center" slot="footer">
<van-button @click="handleSubmit" v-if="isTodo" type="danger" size="large">确认</van-button>
......
......@@ -169,6 +169,7 @@ export class MAS {
* @memberof MAS
*/
proxy (alias, params, options) {
console.log('proxy', alias, params, options, this.token)
params = Object.assign({
// [this.tokenKey]: this.token // token 不放入post数据
}, params, options && options.params)
......
import {
getApplicableRegionList,
// getApplicableRegionList,
actionGetAllAppRegionList,
getAuditReviewSummarys,
// getReviewSummaryPersionList,
getReviewSummaryInfo,
......@@ -21,7 +22,7 @@ import {
attachmentDownload
} from '@/api/inspect'
import { Toast } from 'vant'
import { reduceTreeCheckedList } from '@/common/utils/assist'
import { reduceTreeCheckedList, findNodeById } from '@/common/utils/assist'
import { Coder } from '@/common'
export default {
......@@ -48,6 +49,7 @@ export default {
// 适用区域列表
applicableRegionList: [], // 适用区域列表
supplierAppRegionList: [], // 已选的适用区域{包含:服务器返回或手动选择}
regionSelectIndexPath: [],
allProjectInfo: {}, // 缓存接口的所有特定项目列表
projectPagingList: [], // 特定项目已选择列表
currentReviewFormFid: '', // 当前选择的供方考察评审表(CT_SUP_ReviewForm)的FID
......@@ -76,8 +78,8 @@ export default {
currentFid: state => state.fid,
// CT_SUP_ReviewGrp表的FID
reviewGrpId: state => state.inspectInfo.reviewGrp && state.inspectInfo.reviewGrp.id,
supplierList: state => state.inspectInfo.rows || [],
isGCSupplierType: state => (state.inspectInfo.reviewGrp && state.inspectInfo.reviewGrp.isGCSupplierType) || false,
supplierList: state => state.inspectInfo.rows || [],
reviewformList: state => state.reviewFormList.rows || [],
attachmentInfo: state => state.inspectAttachmentInfo.rows || [],
hisattachmentInfo: state => state.inspectHisAttachmentInfo.rows || [],
......@@ -110,7 +112,22 @@ export default {
response = await getReviewDistributeInfo({billId})
} else {
// 组长审核、会签、审批节点
response = await getReviewGrpInfo({billId})
response = await getReviewGrpInfo({ billId })
if (response.data && response.data.appRegion) {
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)
// 已选的适用特定项目
if (itemRe) {
commit('updateSupplierAppRegionList', [itemRe])
}
if (path) {
commit('updateRegionSelectIndexPath', path)
}
})
}
}
if (response.code === 200 && typeof response.data !== 'string') {
......@@ -172,7 +189,7 @@ export default {
} else {
let arr = []
response.data.rows.forEach(v => {
arr.push(getReviewSummaryInfo({billId: encodeURIComponent(Coder.replace(v.id))}))
arr.push(getReviewSummaryInfo({billId: Coder.replace(v.id)}))
})
Promise.all(arr)
.then(resultArr => {
......@@ -187,7 +204,7 @@ export default {
let appRegionReqs = []
datas.forEach(it => {
if (it) {
appRegionReqs.push(getApplicableRegionList({reviewSummaryId: encodeURIComponent(Coder.replace(it.id))}))
appRegionReqs.push(actionGetAllAppRegionList({reviewSummaryId: Coder.replace(it.id)}))
}
})
Promise.all(appRegionReqs)
......@@ -233,13 +250,13 @@ export default {
// },
// 获取适用区域列表,并缓存
async fetchApplicableRegionList ({ commit }, payload) {
const response = await getApplicableRegionList(payload)
const response = await actionGetAllAppRegionList({...payload, isConvert: true})
if (response.code === 200) {
let treeArr = JSON.parse(response.data)
let arr = []
reduceTreeCheckedList(treeArr, arr)
commit('updateApplicableRegionList', treeArr)
commit('updateSupplierAppRegionList', arr)
// commit('updateSupplierAppRegionList', arr)
return treeArr
} else {
commit('networkError', response.msg, { root: true })
......@@ -274,6 +291,7 @@ export default {
async fetchReviewSummaryInfo ({ commit, rootState }, payload) {
const response = await getReviewSummaryInfo(payload)
if (response.code === 200) {
console.log('response.data', response.data)
commit('updateReviewSummaryInfo', response.data)
// 考察组成员评分
if (response.data.PersonEntry) {
......@@ -286,7 +304,6 @@ export default {
if (response.data.PrjTypeEntry) {
commit('updateSupplierPrjTypeList', response.data.PrjTypeEntry)
}
// 已选的适用特定项目
if (response.data.ProjectEntry) {
commit('updateSupplierProjectList', response.data.ProjectEntry.map(v => Object.assign({}, v, {projectId: v.curProject})))
}
......@@ -573,6 +590,9 @@ export default {
updateSupplierAppRegionList (state, payload) {
state.supplierAppRegionList = payload
},
updateRegionSelectIndexPath (state, payload) {
state.regionSelectIndexPath = payload
},
// 更新已选的适用特定项目
updateSupplierProjectList (state, payload) {
state.supplierProjectList = payload
......
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