|
|
@ -724,6 +724,14 @@ export default { |
|
|
no: this.no, |
|
|
no: this.no, |
|
|
size: this.size, |
|
|
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.currentQuote = {} |
|
|
this.searchLoading = true |
|
|
this.searchLoading = true |
|
|
@ -1318,8 +1326,13 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
handleQueryByIds(){ |
|
|
handleQueryByIds(){ |
|
|
|
|
|
const ids = this.readQuoteLocateIds() |
|
|
|
|
|
if (!ids.length) { |
|
|
|
|
|
this.$message.warning('未查询到对应的报价单') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
let params = { |
|
|
let params = { |
|
|
ids: pickRouteValue(this.$route, 'ids'), |
|
|
|
|
|
|
|
|
ids, |
|
|
no:this.no, |
|
|
no:this.no, |
|
|
size:this.size, |
|
|
size:this.size, |
|
|
createBy:this.$store.state.user.name, |
|
|
createBy:this.$store.state.user.name, |
|
|
@ -1332,7 +1345,8 @@ export default { |
|
|
if (this.total > 0){ |
|
|
if (this.total > 0){ |
|
|
this.currentQuote = {...this.dataList[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 || ''}`) |
|
|
this.$message.success(`已定位到新建的报价单:${this.dataList[0].quoteVersionNo || ''}`) |
|
|
}else { |
|
|
}else { |
|
|
@ -1348,6 +1362,45 @@ export default { |
|
|
this.searchLoading = false |
|
|
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(){ |
|
|
handleInquiryBlur(){ |
|
|
let params = { |
|
|
let params = { |
|
|
site:this.$store.state.user.site, |
|
|
site:this.$store.state.user.site, |
|
|
@ -1579,7 +1632,8 @@ export default { |
|
|
if (!this.isMenu) { |
|
|
if (!this.isMenu) { |
|
|
return false |
|
|
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 quoteVersionNo = pickRouteValue(this.$route, ['quoteVersionNo', 'docNo']) |
|
|
const type = pickRouteValue(this.$route, 'type') |
|
|
const type = pickRouteValue(this.$route, 'type') |
|
|
const routeKey = [ids, quoteVersionNo, type].join('|') |
|
|
const routeKey = [ids, quoteVersionNo, type].join('|') |
|
|
|