|
|
@ -1025,26 +1025,30 @@ export default { |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
handleSaveQuote(){ |
|
|
handleSaveQuote(){ |
|
|
let params = { |
|
|
|
|
|
...this.saveQuote, |
|
|
|
|
|
status: '草稿', |
|
|
|
|
|
action: 'Y', |
|
|
|
|
|
createBy: this.$store.state.user.name, |
|
|
|
|
|
} |
|
|
|
|
|
this.saveLoading = true |
|
|
|
|
|
saveQuote(params).then(({data})=>{ |
|
|
|
|
|
if (data && data.code === 0){ |
|
|
|
|
|
this.saveVisible = false |
|
|
|
|
|
this.quoteForm.quoteVersionNo = data.quoteVersionNo |
|
|
|
|
|
this.$message.success(data.msg) |
|
|
|
|
|
}else { |
|
|
|
|
|
this.$message.warning(data.msg) |
|
|
|
|
|
|
|
|
this.assertProjectCompleted(this.saveQuote.projectNo).then(() => { |
|
|
|
|
|
let params = { |
|
|
|
|
|
...this.saveQuote, |
|
|
|
|
|
status: '草稿', |
|
|
|
|
|
action: 'Y', |
|
|
|
|
|
createBy: this.$store.state.user.name, |
|
|
} |
|
|
} |
|
|
this.handleSearch(0); |
|
|
|
|
|
this.saveLoading = false |
|
|
|
|
|
}).catch((error)=>{ |
|
|
|
|
|
this.$message.error(error) |
|
|
|
|
|
this.saveLoading = false |
|
|
|
|
|
|
|
|
this.saveLoading = true |
|
|
|
|
|
saveQuote(params).then(({data})=>{ |
|
|
|
|
|
if (data && data.code === 0){ |
|
|
|
|
|
this.saveVisible = false |
|
|
|
|
|
this.quoteForm.quoteVersionNo = data.quoteVersionNo |
|
|
|
|
|
this.$message.success(data.msg) |
|
|
|
|
|
}else { |
|
|
|
|
|
this.$message.warning(data.msg) |
|
|
|
|
|
} |
|
|
|
|
|
this.handleSearch(0); |
|
|
|
|
|
this.saveLoading = false |
|
|
|
|
|
}).catch((error)=>{ |
|
|
|
|
|
this.$message.error(error) |
|
|
|
|
|
this.saveLoading = false |
|
|
|
|
|
}) |
|
|
|
|
|
}).catch((msg) => { |
|
|
|
|
|
this.$message.warning(typeof msg === 'string' ? msg : '校验项目状态失败') |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
handleUpdateQuote(){ |
|
|
handleUpdateQuote(){ |
|
|
@ -1153,6 +1157,14 @@ export default { |
|
|
queryProjectByCustomer(params).then(({data})=>{ |
|
|
queryProjectByCustomer(params).then(({data})=>{ |
|
|
if (data && data.code === 0 ){ |
|
|
if (data && data.code === 0 ){ |
|
|
if (data.rows && data.rows.length === 1){ |
|
|
if (data.rows && data.rows.length === 1){ |
|
|
|
|
|
if (!this.saveQuote.id && data.rows[0].status !== '已完成') { |
|
|
|
|
|
this.$message.warning('仅项目单据状态为已完成时允许报价,当前状态:' + data.rows[0].status) |
|
|
|
|
|
this.saveQuote.projectNo = '' |
|
|
|
|
|
this.saveQuote.projectDesc = '' |
|
|
|
|
|
this.saveQuote.finalCustomerNo = '' |
|
|
|
|
|
this.saveQuote.finalCustomerDesc = '' |
|
|
|
|
|
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 |
|
|
@ -1349,18 +1361,46 @@ export default { |
|
|
this.insideInquiryVisible = true |
|
|
this.insideInquiryVisible = true |
|
|
}, |
|
|
}, |
|
|
dblclickInsideInquiry(row){ |
|
|
dblclickInsideInquiry(row){ |
|
|
this.saveQuote.insideInquiryNo = row.quotationNo |
|
|
|
|
|
this.saveQuote.customerNo = row.customerNo |
|
|
|
|
|
this.saveQuote.customerDesc = row.customerDesc |
|
|
|
|
|
this.saveQuote.projectNo = row.projectId |
|
|
|
|
|
this.saveQuote.projectDesc = row.projectName |
|
|
|
|
|
this.saveQuote.quoter = row.quoter |
|
|
|
|
|
this.saveQuote.quoterName = row.quoterName |
|
|
|
|
|
this.saveQuote.finalCustomerNo = row.finalCustomerId |
|
|
|
|
|
this.saveQuote.finalCustomerDesc = row.finalCustomerName |
|
|
|
|
|
this.saveQuote.purchase = row.tracker |
|
|
|
|
|
this.saveQuote.purchaseName = row.trackerName |
|
|
|
|
|
this.insideInquiryVisible = false |
|
|
|
|
|
|
|
|
this.assertProjectCompleted(row.projectId).then(() => { |
|
|
|
|
|
this.saveQuote.insideInquiryNo = row.quotationNo |
|
|
|
|
|
this.saveQuote.customerNo = row.customerNo |
|
|
|
|
|
this.saveQuote.customerDesc = row.customerDesc |
|
|
|
|
|
this.saveQuote.projectNo = row.projectId |
|
|
|
|
|
this.saveQuote.projectDesc = row.projectName |
|
|
|
|
|
this.saveQuote.quoter = row.quoter |
|
|
|
|
|
this.saveQuote.quoterName = row.quoterName |
|
|
|
|
|
this.saveQuote.finalCustomerNo = row.finalCustomerId |
|
|
|
|
|
this.saveQuote.finalCustomerDesc = row.finalCustomerName |
|
|
|
|
|
this.saveQuote.purchase = row.tracker |
|
|
|
|
|
this.saveQuote.purchaseName = row.trackerName |
|
|
|
|
|
this.insideInquiryVisible = false |
|
|
|
|
|
}).catch((msg) => { |
|
|
|
|
|
this.$message.warning(typeof msg === 'string' ? msg : '校验项目状态失败') |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
assertProjectCompleted(projectId) { |
|
|
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
|
|
if (!projectId) { |
|
|
|
|
|
reject('项目号不能为空') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
queryProjectByCustomer({ |
|
|
|
|
|
site: this.$store.state.user.site, |
|
|
|
|
|
projectId |
|
|
|
|
|
}).then(({data}) => { |
|
|
|
|
|
if (!(data && data.code === 0 && data.rows && data.rows.length === 1)) { |
|
|
|
|
|
reject('未找到对应项目信息') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
if (data.rows[0].status !== '已完成') { |
|
|
|
|
|
reject('仅项目单据状态为已完成时允许报价,当前状态:' + data.rows[0].status) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
resolve(data.rows[0]) |
|
|
|
|
|
}).catch((error) => { |
|
|
|
|
|
reject(error) |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
searchInsideInquiry(){ |
|
|
searchInsideInquiry(){ |
|
|
searchQuotationByQuotationNo(this.insideInquiry).then(({data}) => { |
|
|
searchQuotationByQuotationNo(this.insideInquiry).then(({data}) => { |
|
|
|