|
|
@ -22,6 +22,7 @@ import OssComponents from "../oss/ossComponents.vue"; |
|
|
import quotationProjectInformation from "../quotation/sellForQuotation/quotationProjectInformation.vue"; |
|
|
import quotationProjectInformation from "../quotation/sellForQuotation/quotationProjectInformation.vue"; |
|
|
import { |
|
|
import { |
|
|
quotationInformationSearchByAnyField, |
|
|
quotationInformationSearchByAnyField, |
|
|
|
|
|
searchProjectInfoList, |
|
|
searchQuotationByQuotationNo |
|
|
searchQuotationByQuotationNo |
|
|
} from "../../../api/quotation/quotationInformation"; |
|
|
} from "../../../api/quotation/quotationInformation"; |
|
|
import PriceCheckProperties from "../quotation/priceCheckProperties.vue"; |
|
|
import PriceCheckProperties from "../quotation/priceCheckProperties.vue"; |
|
|
@ -103,6 +104,7 @@ export default { |
|
|
chipPrice:'', |
|
|
chipPrice:'', |
|
|
approvalUsername: '', |
|
|
approvalUsername: '', |
|
|
nodeId: '', |
|
|
nodeId: '', |
|
|
|
|
|
annualSales: undefined, |
|
|
}, |
|
|
}, |
|
|
quoteForm:{ |
|
|
quoteForm:{ |
|
|
}, |
|
|
}, |
|
|
@ -1163,15 +1165,19 @@ export default { |
|
|
this.saveQuote.projectDesc = '' |
|
|
this.saveQuote.projectDesc = '' |
|
|
this.saveQuote.finalCustomerNo = '' |
|
|
this.saveQuote.finalCustomerNo = '' |
|
|
this.saveQuote.finalCustomerDesc = '' |
|
|
this.saveQuote.finalCustomerDesc = '' |
|
|
|
|
|
this.saveQuote.annualSales = undefined |
|
|
|
|
|
this.$set(this.saveQuote, 'annualSales', undefined) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
this.saveQuote.projectDesc = data.rows[0].projectName |
|
|
this.saveQuote.projectDesc = data.rows[0].projectName |
|
|
this.saveQuote.finalCustomerNo = data.rows[0].finalCustomerId |
|
|
this.saveQuote.finalCustomerNo = data.rows[0].finalCustomerId |
|
|
this.saveQuote.finalCustomerDesc = data.rows[0].finalCustomerName |
|
|
this.saveQuote.finalCustomerDesc = data.rows[0].finalCustomerName |
|
|
|
|
|
this.assignAnnualSalesFromProject(data.rows[0], this.saveQuote.projectNo) |
|
|
}else { |
|
|
}else { |
|
|
this.saveQuote.projectDesc = '' |
|
|
this.saveQuote.projectDesc = '' |
|
|
this.saveQuote.finalCustomerNo = '' |
|
|
this.saveQuote.finalCustomerNo = '' |
|
|
this.saveQuote.finalCustomerDesc = '' |
|
|
this.saveQuote.finalCustomerDesc = '' |
|
|
|
|
|
this.$set(this.saveQuote, 'annualSales', undefined) |
|
|
} |
|
|
} |
|
|
}else { |
|
|
}else { |
|
|
this.$message.warning(data.msg) |
|
|
this.$message.warning(data.msg) |
|
|
@ -1267,6 +1273,7 @@ export default { |
|
|
case 104: |
|
|
case 104: |
|
|
this.saveQuote.projectNo = val.project_id |
|
|
this.saveQuote.projectNo = val.project_id |
|
|
this.saveQuote.projectDesc = val.project_name |
|
|
this.saveQuote.projectDesc = val.project_name |
|
|
|
|
|
this.assignAnnualSalesFromProject(val, val.project_id) |
|
|
break; |
|
|
break; |
|
|
case 2000: |
|
|
case 2000: |
|
|
this.saveQuote.purchase = val.username |
|
|
this.saveQuote.purchase = val.username |
|
|
@ -1361,7 +1368,7 @@ export default { |
|
|
this.insideInquiryVisible = true |
|
|
this.insideInquiryVisible = true |
|
|
}, |
|
|
}, |
|
|
dblclickInsideInquiry(row){ |
|
|
dblclickInsideInquiry(row){ |
|
|
this.assertProjectCompleted(row.projectId).then(() => { |
|
|
|
|
|
|
|
|
this.assertProjectCompleted(row.projectId).then((project) => { |
|
|
this.saveQuote.insideInquiryNo = row.quotationNo |
|
|
this.saveQuote.insideInquiryNo = row.quotationNo |
|
|
this.saveQuote.customerNo = row.customerNo |
|
|
this.saveQuote.customerNo = row.customerNo |
|
|
this.saveQuote.customerDesc = row.customerDesc |
|
|
this.saveQuote.customerDesc = row.customerDesc |
|
|
@ -1373,11 +1380,51 @@ export default { |
|
|
this.saveQuote.finalCustomerDesc = row.finalCustomerName |
|
|
this.saveQuote.finalCustomerDesc = row.finalCustomerName |
|
|
this.saveQuote.purchase = row.tracker |
|
|
this.saveQuote.purchase = row.tracker |
|
|
this.saveQuote.purchaseName = row.trackerName |
|
|
this.saveQuote.purchaseName = row.trackerName |
|
|
|
|
|
this.assignAnnualSalesFromProject(project, row.projectId) |
|
|
this.insideInquiryVisible = false |
|
|
this.insideInquiryVisible = false |
|
|
}).catch((msg) => { |
|
|
}).catch((msg) => { |
|
|
this.$message.warning(typeof msg === 'string' ? msg : '校验项目状态失败') |
|
|
this.$message.warning(typeof msg === 'string' ? msg : '校验项目状态失败') |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
pickProjectAmount(project) { |
|
|
|
|
|
if (!project) { |
|
|
|
|
|
return undefined |
|
|
|
|
|
} |
|
|
|
|
|
const raw = project.projectAmount != null && project.projectAmount !== '' |
|
|
|
|
|
? project.projectAmount |
|
|
|
|
|
: project.project_amount |
|
|
|
|
|
if (raw == null || raw === '') { |
|
|
|
|
|
return undefined |
|
|
|
|
|
} |
|
|
|
|
|
const amount = Number(raw) |
|
|
|
|
|
return Number.isNaN(amount) ? undefined : amount |
|
|
|
|
|
}, |
|
|
|
|
|
assignAnnualSalesFromProject(project, projectId) { |
|
|
|
|
|
const amount = this.pickProjectAmount(project) |
|
|
|
|
|
if (amount != null) { |
|
|
|
|
|
this.$set(this.saveQuote, 'annualSales', amount) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
const id = projectId || (project && (project.projectId || project.project_id)) || (this.saveQuote && this.saveQuote.projectNo) |
|
|
|
|
|
if (!id) { |
|
|
|
|
|
this.$set(this.saveQuote, 'annualSales', undefined) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
searchProjectInfoList({ |
|
|
|
|
|
site: this.$store.state.user.site, |
|
|
|
|
|
projectId: id |
|
|
|
|
|
}).then(({data}) => { |
|
|
|
|
|
if (!(data && data.code === 0 && data.rows && data.rows.length)) { |
|
|
|
|
|
this.$set(this.saveQuote, 'annualSales', undefined) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
const currentId = String(this.saveQuote.projectNo || id).toUpperCase() |
|
|
|
|
|
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(() => { |
|
|
|
|
|
this.$set(this.saveQuote, 'annualSales', undefined) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
assertProjectCompleted(projectId) { |
|
|
assertProjectCompleted(projectId) { |
|
|
return new Promise((resolve, reject) => { |
|
|
return new Promise((resolve, reject) => { |
|
|
if (!projectId) { |
|
|
if (!projectId) { |
|
|
@ -1579,6 +1626,7 @@ 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) |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
'saveQuote.quoter'(newVal, oldVal){ |
|
|
'saveQuote.quoter'(newVal, oldVal){ |
|
|
@ -1829,7 +1877,7 @@ export default { |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="8"> |
|
|
<el-col :span="8"> |
|
|
<el-form-item label="项目年销售额CNY(K)" prop="annualSales" :show-message="false"> |
|
|
<el-form-item label="项目年销售额CNY(K)" prop="annualSales" :show-message="false"> |
|
|
<el-input-number v-model="saveQuote.annualSales" :disabled="detailFlag" :precision="6" :min="0" :controls="false" style="width:100%" placeholder="请输入年销售额"></el-input-number> |
|
|
|
|
|
|
|
|
<el-input v-model="saveQuote.annualSales" disabled placeholder="随项目自动带出"></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="24"> |
|
|
<el-col :span="24"> |
|
|
|