|
|
|
@ -576,7 +576,6 @@ export default { |
|
|
|
insideInquiryVisible:false, |
|
|
|
|
|
|
|
detailFlag:false, |
|
|
|
skipAnnualSalesAssign: false, |
|
|
|
|
|
|
|
ossColumns:[ |
|
|
|
{ |
|
|
|
@ -973,11 +972,9 @@ export default { |
|
|
|
if (row){ |
|
|
|
// 先更新 currentQuote,确保 getNodeAuthority 能获取到正确的 stepId |
|
|
|
this.currentQuote = {...row} |
|
|
|
this.skipAnnualSalesAssign = true |
|
|
|
this.saveQuote = { |
|
|
|
...row |
|
|
|
} |
|
|
|
this.skipAnnualSalesAssign = false |
|
|
|
// 草稿(10节点)/审批中均按节点配置控制字段 |
|
|
|
if (row.status !== '已完成') { |
|
|
|
await this.getNodeAuthority() |
|
|
|
@ -1210,8 +1207,10 @@ export default { |
|
|
|
this.saveQuote.projectDesc = '' |
|
|
|
this.saveQuote.finalCustomerNo = '' |
|
|
|
this.saveQuote.finalCustomerDesc = '' |
|
|
|
if (!this.saveQuote.id) { |
|
|
|
this.$set(this.saveQuote, 'annualSales', undefined) |
|
|
|
} |
|
|
|
} |
|
|
|
}else { |
|
|
|
this.$message.warning(data.msg) |
|
|
|
} |
|
|
|
@ -1433,10 +1432,8 @@ export default { |
|
|
|
return Number.isNaN(amount) ? undefined : amount |
|
|
|
}, |
|
|
|
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 |
|
|
|
} |
|
|
|
const amount = this.pickProjectAmount(project) |
|
|
|
@ -1444,7 +1441,7 @@ export default { |
|
|
|
this.$set(this.saveQuote, 'annualSales', amount) |
|
|
|
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) { |
|
|
|
this.$set(this.saveQuote, 'annualSales', undefined) |
|
|
|
return |
|
|
|
@ -1453,6 +1450,9 @@ export default { |
|
|
|
site: this.$store.state.user.site, |
|
|
|
projectId: id |
|
|
|
}).then(({data}) => { |
|
|
|
if (!this.saveQuote || this.saveQuote.id) { |
|
|
|
return |
|
|
|
} |
|
|
|
if (!(data && data.code === 0 && data.rows && data.rows.length)) { |
|
|
|
this.$set(this.saveQuote, 'annualSales', undefined) |
|
|
|
return |
|
|
|
@ -1461,6 +1461,9 @@ export default { |
|
|
|
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)) |
|
|
|
}).catch(() => { |
|
|
|
if (!this.saveQuote || this.saveQuote.id) { |
|
|
|
return |
|
|
|
} |
|
|
|
this.$set(this.saveQuote, 'annualSales', undefined) |
|
|
|
}) |
|
|
|
}, |
|
|
|
@ -1694,8 +1697,10 @@ export default { |
|
|
|
this.saveQuote.projectDesc = '' |
|
|
|
this.saveQuote.finalCustomerNo = '' |
|
|
|
this.saveQuote.finalCustomerDesc = '' |
|
|
|
if (!this.saveQuote.id) { |
|
|
|
this.$set(this.saveQuote, 'annualSales', undefined) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
'saveQuote.quoter'(newVal, oldVal){ |
|
|
|
if (!newVal){ |
|
|
|
|