Browse Source

2026-09-20

待报价清单跳转销售报价优化
master
fengyuan_yang 21 hours ago
parent
commit
facd9db84d
  1. 6
      src/views/modules/quotation/toBeQuoted.vue
  2. 60
      src/views/modules/quote/index.vue

6
src/views/modules/quotation/toBeQuoted.vue

@ -643,7 +643,11 @@ export default {
if (this.$router.resolve('quote-index').resolved.name === '404') {
this.$alert('权限不足,访问失败', '警告', {confirmButtonText: '确定',});
} else {
this.$router.push({name:"quote-index",params:{ids:data.rows},})
const ids = (Array.isArray(data.rows) ? data.rows : [data.rows])
.map(id => Number(id))
.filter(id => Number.isFinite(id) && id > 0)
sessionStorage.setItem('plm_quote_locate_ids', JSON.stringify(ids))
this.$router.push({ name: 'quote-index' })
}
}else {
this.$message.error(data.msg);

60
src/views/modules/quote/index.vue

@ -724,6 +724,14 @@ export default {
no: this.no,
size: this.size,
}
if (params.ids != null && params.ids !== '') {
params.ids = this.parseQuoteIds(params.ids)
if (!params.ids.length) {
delete params.ids
}
} else {
delete params.ids
}
//
this.currentQuote = {}
this.searchLoading = true
@ -1318,8 +1326,13 @@ export default {
}
},
handleQueryByIds(){
const ids = this.readQuoteLocateIds()
if (!ids.length) {
this.$message.warning('未查询到对应的报价单')
return
}
let params = {
ids: pickRouteValue(this.$route, 'ids'),
ids,
no:this.no,
size:this.size,
createBy:this.$store.state.user.name,
@ -1332,7 +1345,8 @@ export default {
if (this.total > 0){
this.currentQuote = {...this.dataList[0]}
//
this.$router.replace({name: 'quote-index', params: {}})
this.clearQuoteLocateIds()
this.$router.replace({name: 'quote-index'})
//
this.$message.success(`已定位到新建的报价单:${this.dataList[0].quoteVersionNo || ''}`)
}else {
@ -1348,6 +1362,45 @@ export default {
this.searchLoading = false
})
},
parseQuoteIds(value) {
if (Array.isArray(value)) {
return value.map(id => Number(id)).filter(id => Number.isFinite(id) && id > 0)
}
if (value == null || String(value).trim() === '') {
return []
}
const text = String(value).trim()
try {
const parsed = JSON.parse(text)
if (Array.isArray(parsed) || typeof parsed === 'number') {
return this.parseQuoteIds(parsed)
}
} catch (e) {
// JSON
}
return text
.split(/[,\s]+/)
.map(id => Number(id))
.filter(id => Number.isFinite(id) && id > 0)
},
readQuoteLocateIds() {
let ids = []
try {
const cached = sessionStorage.getItem('plm_quote_locate_ids')
if (cached) {
ids = this.parseQuoteIds(JSON.parse(cached))
}
} catch (e) {
ids = []
}
if (!ids.length) {
ids = this.parseQuoteIds(pickRouteValue(this.$route, 'ids'))
}
return ids
},
clearQuoteLocateIds() {
sessionStorage.removeItem('plm_quote_locate_ids')
},
handleInquiryBlur(){
let params = {
site:this.$store.state.user.site,
@ -1579,7 +1632,8 @@ export default {
if (!this.isMenu) {
return false
}
const ids = pickRouteValue(this.$route, 'ids')
const locateIds = this.readQuoteLocateIds()
const ids = locateIds.length ? locateIds.join(',') : pickRouteValue(this.$route, 'ids')
const quoteVersionNo = pickRouteValue(this.$route, ['quoteVersionNo', 'docNo'])
const type = pickRouteValue(this.$route, 'type')
const routeKey = [ids, quoteVersionNo, type].join('|')

Loading…
Cancel
Save