|
@@ -86,14 +86,32 @@ export default {
|
|
|
resData: [],
|
|
|
resquestData: {},
|
|
|
isperfect: false,
|
|
|
- iscomplete: false // 招标完成展示弹框
|
|
|
+ iscomplete: false, // 招标完成展示弹框
|
|
|
+ bidtype: '',
|
|
|
+ timer: '' // 定时器
|
|
|
}
|
|
|
},
|
|
|
created () {
|
|
|
// this.getData()
|
|
|
+ this.bidtype = this.$route.query.bidtype
|
|
|
+ if (this.bidtype) {
|
|
|
+ // 获取sessionStroage的pid 请求项目信息接口
|
|
|
+ const BID_PID = sessionStorage.getItem('BID_PID')
|
|
|
+ if (BID_PID) {
|
|
|
+ this.paramlist.ptid = BID_PID
|
|
|
+ this.getproStatus()
|
|
|
+ }
|
|
|
+ this.loading = true
|
|
|
+ this.proShow = true
|
|
|
+ this.getProForWResult(this.$route.query.sid)
|
|
|
+ }
|
|
|
this.getBaseInfo()
|
|
|
this.getproStatus()
|
|
|
},
|
|
|
+ // 离开页面事件
|
|
|
+ beforeDestroy () {
|
|
|
+ clearInterval(this.timer)
|
|
|
+ },
|
|
|
methods: {
|
|
|
getData () {
|
|
|
getResultDetail({ id: this.paramlist.id }).then(res => {
|
|
@@ -117,9 +135,53 @@ export default {
|
|
|
ptid: this.paramlist.ptid,
|
|
|
sourceinfoid: this.paramlist.sid
|
|
|
}
|
|
|
+ const _this = this
|
|
|
const res = await getProjectInfo(data)
|
|
|
if (res.error_code === 0 && res.data) {
|
|
|
+ console.log(res.data)
|
|
|
+ if (res.data.buyerContent && res.data.buyerContent.length > 0) {
|
|
|
+ const newKeyArr = []
|
|
|
+ res.data.buyerContent.forEach(function (item, i) {
|
|
|
+ console.log(item)
|
|
|
+ item.key.forEach(function (v) {
|
|
|
+ newKeyArr.push(v)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ res.data.buyerContent = newKeyArr
|
|
|
+ }
|
|
|
+ const bidListPC = this.$store.state.forcast.detailBaseList
|
|
|
+ if (bidListPC.filter(v => v.id === res.data.id).length) {
|
|
|
+ const newKeyArr = []
|
|
|
+ bidListPC.forEach(function (v) {
|
|
|
+ if (v.id === res.data.id) {
|
|
|
+ v.buyerContent.forEach(function (item, i) {
|
|
|
+ // const conList = {
|
|
|
+ // key: [item]
|
|
|
+ // appendkey: [],
|
|
|
+ // notkey: []
|
|
|
+ // }
|
|
|
+ newKeyArr.push(item)
|
|
|
+ })
|
|
|
+ v.buyerContent = newKeyArr
|
|
|
+ _this.baseInfo = v
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // const newKeyArr = []
|
|
|
+ // console.log(res.data)
|
|
|
+ // res.data.buyerContent.forEach(function (item, i) {
|
|
|
+ // const conList = {
|
|
|
+ // key: [item]
|
|
|
+ // // appendkey: [],
|
|
|
+ // // notkey: []
|
|
|
+ // }
|
|
|
+ // newKeyArr.push(conList)
|
|
|
+ // })
|
|
|
+ // res.data.buyerContent = newKeyArr
|
|
|
this.baseInfo = res.data
|
|
|
+ const result = [res.data]
|
|
|
+ this.$store.commit('forcast/setDetailBaseList', result)
|
|
|
} else {
|
|
|
console.log(res.error_code)
|
|
|
}
|
|
@@ -128,6 +190,19 @@ export default {
|
|
|
getLimit (data) {
|
|
|
console.log(data)
|
|
|
if (Object.keys(data.area).length !== 0 && data.buyerContent.length !== 0 && data.buyer !== '') {
|
|
|
+ const bidListPC = this.$store.state.forcast.detailBaseList
|
|
|
+ // 点击预测把筛选条件重新赋值存入本地local
|
|
|
+ if (bidListPC) {
|
|
|
+ const nowData = bidListPC.map(v =>{
|
|
|
+ if (this.paramlist.ptid === v.id) {
|
|
|
+ return Object.assign(v, data)
|
|
|
+ }
|
|
|
+ return v
|
|
|
+ })
|
|
|
+ this.$store.commit('forcast/changeDetailBaseList', nowData)
|
|
|
+ }
|
|
|
+ // 把预测的pid存入session,查询项目信息接口
|
|
|
+ sessionStorage.setItem('BID_PID', this.paramlist.ptid)
|
|
|
this.getProForWData(data)
|
|
|
} else {
|
|
|
this.$refs.forlimits.isClick = false
|
|
@@ -173,7 +248,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
async getProForWStatus () {
|
|
|
- const timer = setInterval(() => {
|
|
|
+ this.timer = setInterval(() => {
|
|
|
getForWStatus().then(res => {
|
|
|
console.log(res)
|
|
|
if (res.error_code === 0) {
|