Commit ce73501e by 钟乾明

u: 云之家request参数需要编码

parent eaa89736
<template> <template>
<div id="app" class="full"> <div id="app"
class="full">
<transition> <transition>
<keep-alive :include="includedComponents"> <keep-alive :include="includedComponents">
<router-view></router-view> <router-view></router-view>
...@@ -34,7 +35,10 @@ export default { ...@@ -34,7 +35,10 @@ export default {
setToken() setToken()
this.updateFid(testFid) this.updateFid(testFid)
this.updateCurrentPageType(5) this.updateCurrentPageType(5)
await this.fetchInspect({billId: Coder.replace(testFid), isGradeNode: false}) // 29 30评分节点放开 await this.fetchInspect({
billId: Coder.replace(testFid),
isGradeNode: false
}) // 29 30评分节点放开
this.updateReadyState(true) this.updateReadyState(true)
}, 1000) }, 1000)
} }
...@@ -52,7 +56,7 @@ export default { ...@@ -52,7 +56,7 @@ export default {
this.cacheRouterNames.push(to.name) this.cacheRouterNames.push(to.name)
} else { } else {
// 返回上个页面 // 返回上个页面
if (this.cacheRouterNames[this.cacheRouterNames.length - 1] === from.name) { if (this.cacheRouterNames[ this.cacheRouterNames.length - 1 ] === from.name) {
this.cacheRouterNames.pop() this.cacheRouterNames.pop()
} }
} }
...@@ -68,7 +72,10 @@ export default { ...@@ -68,7 +72,10 @@ export default {
} }
}, },
computed: { computed: {
...mapState(['loading', 'PageTypes']), ...mapState([
'loading',
'PageTypes'
]),
includedComponents () { includedComponents () {
return this.cacheRouterNames.join(',') return this.cacheRouterNames.join(',')
}, },
...@@ -154,7 +161,10 @@ export default { ...@@ -154,7 +161,10 @@ export default {
switch (params.page) { switch (params.page) {
case 'review_grade': case 'review_grade':
// 评分节点 // 评分节点
await this.fetchInspect({billId: encodeURIComponent(Coder.replace(params.billId)), isGradeNode: true}) await this.fetchInspect({
billId: (Coder.encode(params.billId)),
isGradeNode: true
})
if (this.isGCSupplierType) { if (this.isGCSupplierType) {
if (recType == 3) { if (recType == 3) {
type = this.PageTypes.Grade_Done type = this.PageTypes.Grade_Done
......
...@@ -129,7 +129,7 @@ export default { ...@@ -129,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: Coder.replace(this.currentFid), isGradeNode: this.isGradeNode}) this.fetchInspect({billId: Coder.encode(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 {
......
...@@ -52,7 +52,7 @@ export default { ...@@ -52,7 +52,7 @@ export default {
mounted () { mounted () {
this.init() this.init()
this.$store.commit('showLoading', true) this.$store.commit('showLoading', true)
this.fetchReviewSummaryInfo({billId: Coder.replace(this.currentSupplierInfo.id)}) this.fetchReviewSummaryInfo({billId: Coder.encode(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))
}, },
......
...@@ -116,8 +116,8 @@ export default { ...@@ -116,8 +116,8 @@ export default {
}, },
mounted () { mounted () {
let fid = this.isGradeNode ? this.reviewGrpId : this.currentFid let fid = this.isGradeNode ? this.reviewGrpId : this.currentFid
this.fetchAttachmentList({ billId: Coder.replace(fid) }) this.fetchAttachmentList({ billId: Coder.encode(fid) })
this.fetchGetHisAttachmentList({ billId: Coder.replace(fid) }) this.fetchGetHisAttachmentList({ billId: Coder.encode(fid) })
}, },
data () { data () {
return { return {
......
...@@ -297,7 +297,7 @@ export default { ...@@ -297,7 +297,7 @@ export default {
]), ]),
fetchData () { fetchData () {
this.$store.commit('showLoading', true) this.$store.commit('showLoading', true)
this.fetchAdjustGradeInfo({billId: Coder.replace(this.currentFid)}) this.fetchAdjustGradeInfo({billId: Coder.encode(this.currentFid)})
.then(() => this.$store.commit('showLoading', false)) .then(() => this.$store.commit('showLoading', false))
.catch(() => this.$store.commit('showLoading', false)) .catch(() => this.$store.commit('showLoading', false))
}, },
......
...@@ -102,7 +102,7 @@ export default { ...@@ -102,7 +102,7 @@ export default {
mixins: [reviewSummaryMixin], mixins: [reviewSummaryMixin],
mounted () { mounted () {
this.$store.commit('showLoading', true) this.$store.commit('showLoading', true)
this.fetchReviewSummaryInfo({billId: Coder.replace(this.currentSupplierInfo.id)}) this.fetchReviewSummaryInfo({billId: Coder.encode(this.currentSupplierInfo.id)})
.then(() => { .then(() => {
this.conditionOption = this.reviewSummaryInfo.useCondition this.conditionOption = this.reviewSummaryInfo.useCondition
this.productGradeId = this.reviewSummaryInfo.productGrade this.productGradeId = this.reviewSummaryInfo.productGrade
......
...@@ -120,7 +120,7 @@ export default { ...@@ -120,7 +120,7 @@ export default {
} }
}, },
mounted () { mounted () {
this.fetchScores({billId: Coder.replace(this.memberGradeInfo.id)}) this.fetchScores({billId: Coder.encode(this.memberGradeInfo.id)})
}, },
activated () { activated () {
if (!this.showProjectScore_showBusinessScore) { if (!this.showProjectScore_showBusinessScore) {
......
...@@ -273,7 +273,7 @@ export default { ...@@ -273,7 +273,7 @@ export default {
]), ]),
fetchData () { fetchData () {
this.$store.commit('showLoading', true) this.$store.commit('showLoading', true)
this.fetchpauseresumeInfo({billId: Coder.replace(this.currentFid)}) this.fetchpauseresumeInfo({billId: Coder.encode(this.currentFid)})
.then(() => this.$store.commit('showLoading', false)) .then(() => this.$store.commit('showLoading', false))
.catch(() => this.$store.commit('showLoading', false)) .catch(() => this.$store.commit('showLoading', false))
}, },
......
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
]), ]),
fetchData () { fetchData () {
this.$store.commit('showLoading', true) this.$store.commit('showLoading', true)
this.fetchEvaluateDistributInfo({billId: Coder.replace(this.currentFid)}) this.fetchEvaluateDistributInfo({billId: Coder.encode(this.currentFid)})
.then(() => { .then(() => {
this.checkInitData() this.checkInitData()
this.$store.commit('showLoading', false) this.$store.commit('showLoading', false)
......
...@@ -208,7 +208,7 @@ export default { ...@@ -208,7 +208,7 @@ export default {
'fetchAdjustProjectInfo' 'fetchAdjustProjectInfo'
]), ]),
fetchData () { fetchData () {
this.fetchAdjustProjectInfo({billId: Coder.replace(this.currentFid)}) this.fetchAdjustProjectInfo({billId: Coder.encode(this.currentFid)})
}, },
init () { init () {
switch (this.currentPageType) { switch (this.currentPageType) {
......
...@@ -169,7 +169,7 @@ export default { ...@@ -169,7 +169,7 @@ export default {
]), ]),
fetchData () { fetchData () {
this.$store.commit('showLoading', true) this.$store.commit('showLoading', true)
this.fetchAdjustRegionInfo({billId: Coder.replace(this.currentFid)}) this.fetchAdjustRegionInfo({billId: Coder.encode(this.currentFid)})
.then(() => this.$store.commit('showLoading', false)) .then(() => this.$store.commit('showLoading', false))
.catch(() => this.$store.commit('showLoading', false)) .catch(() => this.$store.commit('showLoading', false))
}, },
......
...@@ -242,7 +242,7 @@ export default { ...@@ -242,7 +242,7 @@ export default {
]), ]),
fetchData () { fetchData () {
this.$store.commit('showLoading', true) this.$store.commit('showLoading', true)
this.fetchAdjustSupplierInfo({billId: Coder.replace(this.currentFid)}) this.fetchAdjustSupplierInfo({billId: Coder.encode(this.currentFid)})
.then(() => this.$store.commit('showLoading', false)) .then(() => this.$store.commit('showLoading', false))
.catch(() => this.$store.commit('showLoading', false)) .catch(() => this.$store.commit('showLoading', false))
}, },
......
...@@ -72,7 +72,7 @@ function request (opt) { ...@@ -72,7 +72,7 @@ function request (opt) {
var val = urlParams[key] var val = urlParams[key]
if (isObject(val)) { if (isObject(val)) {
val = JSON.stringify(val) val = JSON.stringify(val)
val = decodeURIComponent(val)//有对象参数的先解码 val = decodeURIComponent(val)// 有对象参数的先解码
val = encodeURIComponent(val) val = encodeURIComponent(val)
} else if (/[^\x00-\xff]/.test(val)) { } else if (/[^\x00-\xff]/.test(val)) {
val = encodeURIComponent(val) val = encodeURIComponent(val)
...@@ -115,6 +115,7 @@ function request (opt) { ...@@ -115,6 +115,7 @@ function request (opt) {
if (type !== 'string') { if (type !== 'string') {
val = val + '' val = val + ''
} }
// 因content-type可能存在大小写不规范,这里先过滤掉,后面根据serializer统一添加 // 因content-type可能存在大小写不规范,这里先过滤掉,后面根据serializer统一添加
var _key = key.toLowerCase() var _key = key.toLowerCase()
if (_key !== 'content-type') { if (_key !== 'content-type') {
...@@ -142,6 +143,7 @@ function request (opt) { ...@@ -142,6 +143,7 @@ function request (opt) {
headers: resp.header, headers: resp.header,
config: opt config: opt
} }
var validateStatus = response.config.validateStatus var validateStatus = response.config.validateStatus
// Note: status is not exposed by XDomainRequest // Note: status is not exposed by XDomainRequest
if ( if (
......
...@@ -42,7 +42,7 @@ export default { ...@@ -42,7 +42,7 @@ export default {
// } // }
// request(i); // request(i);
for (let i = 0; i < evaluateFormIdArr.length; i++) { for (let i = 0; i < evaluateFormIdArr.length; i++) {
let res = await getEvaluateForm({billId: Coder.replace(evaluateFormIdArr[i].evaluateItemId)}) let res = await getEvaluateForm({billId: Coder.encode(evaluateFormIdArr[i].evaluateItemId)})
if (res.code === 200 && typeof res.data !== 'string') { if (res.code === 200 && typeof res.data !== 'string') {
evaluateFromItem.push(res.data) evaluateFromItem.push(res.data)
} }
......
...@@ -143,10 +143,10 @@ export default { ...@@ -143,10 +143,10 @@ export default {
} }
let arr = [] let arr = []
arr.push(getReviewGrpList({billId: Coder.replace(reviewGrpId), entryName: 'PersonEntry'})) arr.push(getReviewGrpList({billId: (Coder.encode(reviewGrpId)), entryName: 'PersonEntry'}))
arr.push(getReviewGrpList({billId: Coder.replace(reviewGrpId), entryName: 'ProjectEntry'})) arr.push(getReviewGrpList({billId: (Coder.encode(reviewGrpId)), entryName: 'ProjectEntry'}))
arr.push(getReviewGrpList({billId: Coder.replace(reviewGrpId), entryName: 'SupplierEntry'})) arr.push(getReviewGrpList({billId: (Coder.encode(reviewGrpId)), entryName: 'SupplierEntry'}))
arr.push(getAttachmentList({billId: Coder.replace(reviewGrpId)})) arr.push(getAttachmentList({billId: (Coder.encode(reviewGrpId))}))
Promise.all(arr) Promise.all(arr)
.then(resultArr => { .then(resultArr => {
// 考察组成员 // 考察组成员
...@@ -175,7 +175,7 @@ export default { ...@@ -175,7 +175,7 @@ export default {
if (isGradeNode) { if (isGradeNode) {
let arr = [] let arr = []
response.data.rows.forEach(v => { response.data.rows.forEach(v => {
arr.push(getReviewFormInfo({billId: encodeURIComponent(Coder.replace(v.id))})) arr.push(getReviewFormInfo({billId: (Coder.encode(v.id))}))
}) })
Promise.all(arr) Promise.all(arr)
.then(resultArr => { .then(resultArr => {
...@@ -194,7 +194,7 @@ export default { ...@@ -194,7 +194,7 @@ export default {
} else { } else {
let arr = [] let arr = []
response.data.rows.forEach(v => { response.data.rows.forEach(v => {
arr.push(getReviewSummaryInfo({billId: encodeURIComponent(Coder.replace(v.id))})) arr.push(getReviewSummaryInfo({billId: (Coder.encode(v.id))}))
}) })
Promise.all(arr) Promise.all(arr)
.then(resultArr => { .then(resultArr => {
...@@ -470,7 +470,7 @@ export default { ...@@ -470,7 +470,7 @@ export default {
if (response.code === 200) { if (response.code === 200) {
if (response.data.error === 0) { if (response.data.error === 0) {
Toast.success(response.data.msg) Toast.success(response.data.msg)
const result = await getAttachmentList({ billId: Coder.replace(state.AttachmentInfo.billId) }) const result = await getAttachmentList({ billId: (Coder.encode(state.AttachmentInfo.billId)) })
if (result !== 40650) { if (result !== 40650) {
commit('updateInspectAttachmentInfo', result) commit('updateInspectAttachmentInfo', result)
} else { } else {
...@@ -488,8 +488,8 @@ export default { ...@@ -488,8 +488,8 @@ export default {
const response = await attachmentCancel(payload) const response = await attachmentCancel(payload)
if (response.code === 200) { if (response.code === 200) {
Toast.success('作废成功') Toast.success('作废成功')
const hisresult = await getGetHisAttachmentList({ billId: Coder.replace(state.AttachmentInfo.billId) }) const hisresult = await getGetHisAttachmentList({ billId: (Coder.encode(state.AttachmentInfo.billId)) })
const result = await getAttachmentList({ billId: Coder.replace(state.AttachmentInfo.billId) }) const result = await getAttachmentList({ billId: (Coder.encode(state.AttachmentInfo.billId)) })
if (hisresult !== 40650) { if (hisresult !== 40650) {
commit('updateInspectHisAttachmentInfo', hisresult) commit('updateInspectHisAttachmentInfo', hisresult)
} else { } else {
......
...@@ -44,7 +44,7 @@ export default { ...@@ -44,7 +44,7 @@ export default {
if (state.pauseresumeInfo) { if (state.pauseresumeInfo) {
// 原供方等级列表 // 原供方等级列表
commit('showLoading', true, { root: true }) commit('showLoading', true, { root: true })
let response = await getpauseresumeGradeList({billId: Coder.replace(state.pauseresumeInfo.supplier), entryName: 'SupplierRankEntry'}) let response = await getpauseresumeGradeList({billId: (Coder.encode(state.pauseresumeInfo.supplier)), entryName: 'SupplierRankEntry'})
commit('showLoading', false, { root: true }) commit('showLoading', false, { root: true })
if (response.code === 200) { if (response.code === 200) {
commit('updateOldpauseresumeList', (response.data && response.data.rows) || []) commit('updateOldpauseresumeList', (response.data && response.data.rows) || [])
......
...@@ -42,7 +42,7 @@ export default { ...@@ -42,7 +42,7 @@ export default {
if (state.adjustProjectInfo) { if (state.adjustProjectInfo) {
// 原供方等级列表 // 原供方等级列表
commit('showLoading', true, { root: true }) commit('showLoading', true, { root: true })
let response = await getAdjustProjectOldRegion({billId: Coder.replace(state.adjustProjectInfo.supplier), entryName: 'SupplierRankEntry'}) let response = await getAdjustProjectOldRegion({billId: (Coder.encode(state.adjustProjectInfo.supplier)), entryName: 'SupplierRankEntry'})
commit('showLoading', false, { root: true }) commit('showLoading', false, { root: true })
if (response.code === 200) { if (response.code === 200) {
commit('updateOldGradeList', (response.data && response.data.rows) || []) commit('updateOldGradeList', (response.data && response.data.rows) || [])
......
...@@ -42,7 +42,7 @@ export default { ...@@ -42,7 +42,7 @@ export default {
if (state.adjustSupplierInfo) { if (state.adjustSupplierInfo) {
// 原供方等级列表 // 原供方等级列表
commit('showLoading', true, { root: true }) commit('showLoading', true, { root: true })
let response = await getAdjustSupplierGradeList({billId: Coder.replace(state.adjustSupplierInfo.supplier), entryName: 'SupplierRankEntry'}) let response = await getAdjustSupplierGradeList({billId: (Coder.encode(state.adjustSupplierInfo.supplier)), entryName: 'SupplierRankEntry'})
commit('showLoading', false, { root: true }) commit('showLoading', false, { root: true })
if (response.code === 200) { if (response.code === 200) {
commit('updateOldSupplierList', (response.data && response.data.rows) || []) commit('updateOldSupplierList', (response.data && response.data.rows) || [])
......
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