Browse Source

2026-09-20

销售报价“项目年销售额CNY(K)”取值优化
master
fengyuan_yang 21 hours ago
parent
commit
ced0f89c1d
  1. 25
      src/views/modules/quote/index.vue

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

@ -576,7 +576,6 @@ export default {
insideInquiryVisible:false, insideInquiryVisible:false,
detailFlag:false, detailFlag:false,
skipAnnualSalesAssign: false,
ossColumns:[ ossColumns:[
{ {
@ -973,11 +972,9 @@ export default {
if (row){ if (row){
// currentQuote getNodeAuthority stepId // currentQuote getNodeAuthority stepId
this.currentQuote = {...row} this.currentQuote = {...row}
this.skipAnnualSalesAssign = true
this.saveQuote = { this.saveQuote = {
...row ...row
} }
this.skipAnnualSalesAssign = false
// 稿(10)/ // 稿(10)/
if (row.status !== '已完成') { if (row.status !== '已完成') {
await this.getNodeAuthority() await this.getNodeAuthority()
@ -1210,7 +1207,9 @@ export default {
this.saveQuote.projectDesc = '' this.saveQuote.projectDesc = ''
this.saveQuote.finalCustomerNo = '' this.saveQuote.finalCustomerNo = ''
this.saveQuote.finalCustomerDesc = '' this.saveQuote.finalCustomerDesc = ''
this.$set(this.saveQuote, 'annualSales', undefined)
if (!this.saveQuote.id) {
this.$set(this.saveQuote, 'annualSales', undefined)
}
} }
}else { }else {
this.$message.warning(data.msg) this.$message.warning(data.msg)
@ -1433,10 +1432,8 @@ export default {
return Number.isNaN(amount) ? undefined : amount return Number.isNaN(amount) ? undefined : amount
}, },
assignAnnualSalesFromProject(project, projectId) { assignAnnualSalesFromProject(project, projectId) {
if (this.skipAnnualSalesAssign) {
return
}
if (!this.isAnnualSalesDisabled() && this.saveQuote && this.saveQuote.annualSales != null && this.saveQuote.annualSales !== '') {
//
if (!this.saveQuote || this.saveQuote.id) {
return return
} }
const amount = this.pickProjectAmount(project) const amount = this.pickProjectAmount(project)
@ -1444,7 +1441,7 @@ export default {
this.$set(this.saveQuote, 'annualSales', amount) this.$set(this.saveQuote, 'annualSales', amount)
return return
} }
const id = projectId || (project && (project.projectId || project.project_id)) || (this.saveQuote && this.saveQuote.projectNo)
const id = projectId || (project && (project.projectId || project.project_id)) || this.saveQuote.projectNo
if (!id) { if (!id) {
this.$set(this.saveQuote, 'annualSales', undefined) this.$set(this.saveQuote, 'annualSales', undefined)
return return
@ -1453,6 +1450,9 @@ export default {
site: this.$store.state.user.site, site: this.$store.state.user.site,
projectId: id projectId: id
}).then(({data}) => { }).then(({data}) => {
if (!this.saveQuote || this.saveQuote.id) {
return
}
if (!(data && data.code === 0 && data.rows && data.rows.length)) { if (!(data && data.code === 0 && data.rows && data.rows.length)) {
this.$set(this.saveQuote, 'annualSales', undefined) this.$set(this.saveQuote, 'annualSales', undefined)
return return
@ -1461,6 +1461,9 @@ export default {
const row = data.rows.find(item => String(item.projectId || item.project_id || '').toUpperCase() === currentId) || data.rows[0] const row = data.rows.find(item => String(item.projectId || item.project_id || '').toUpperCase() === currentId) || data.rows[0]
this.$set(this.saveQuote, 'annualSales', this.pickProjectAmount(row)) this.$set(this.saveQuote, 'annualSales', this.pickProjectAmount(row))
}).catch(() => { }).catch(() => {
if (!this.saveQuote || this.saveQuote.id) {
return
}
this.$set(this.saveQuote, 'annualSales', undefined) this.$set(this.saveQuote, 'annualSales', undefined)
}) })
}, },
@ -1694,7 +1697,9 @@ export default {
this.saveQuote.projectDesc = '' this.saveQuote.projectDesc = ''
this.saveQuote.finalCustomerNo = '' this.saveQuote.finalCustomerNo = ''
this.saveQuote.finalCustomerDesc = '' this.saveQuote.finalCustomerDesc = ''
this.$set(this.saveQuote, 'annualSales', undefined)
if (!this.saveQuote.id) {
this.$set(this.saveQuote, 'annualSales', undefined)
}
} }
}, },
'saveQuote.quoter'(newVal, oldVal){ 'saveQuote.quoter'(newVal, oldVal){

Loading…
Cancel
Save