|
|
|
@ -1039,6 +1039,7 @@ export default { |
|
|
|
projectId: undefined, |
|
|
|
projectName: undefined, |
|
|
|
customerId: undefined, |
|
|
|
status: '已完成', |
|
|
|
}, |
|
|
|
// 项目集合 |
|
|
|
projectList: [], |
|
|
|
@ -2666,6 +2667,7 @@ export default { |
|
|
|
} |
|
|
|
this.confirmProjectPart(); |
|
|
|
if (this.modalData.flag === '1') { |
|
|
|
this.assertProjectCompleted(this.modalData.projectId, '新增询价').then(() => { |
|
|
|
this.saveLoading = true |
|
|
|
quotationInformationSave(this.modalData).then(({data}) => { |
|
|
|
this.saveLoading = false |
|
|
|
@ -2677,6 +2679,11 @@ export default { |
|
|
|
} else { |
|
|
|
this.$message(data.msg) |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.saveLoading = false |
|
|
|
}) |
|
|
|
}).catch((msg) => { |
|
|
|
this.$message.warning(typeof msg === 'string' ? msg : '校验项目状态失败') |
|
|
|
}) |
|
|
|
} else { |
|
|
|
quotationInformationEdit(this.modalData).then(({data}) => { |
|
|
|
@ -3438,6 +3445,7 @@ export default { |
|
|
|
searchProjectInfoList() { |
|
|
|
this.projectList = []; |
|
|
|
this.searchProjectData.customerId = this.modalData.customerNo |
|
|
|
this.searchProjectData.status = '已完成' |
|
|
|
searchProjectInfoList(this.searchProjectData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.projectList = data.rows |
|
|
|
@ -3455,6 +3463,7 @@ export default { |
|
|
|
projectId: undefined, |
|
|
|
projectName: undefined, |
|
|
|
customerId: undefined, |
|
|
|
status: '已完成', |
|
|
|
} |
|
|
|
}, |
|
|
|
projectClickRow(row) { |
|
|
|
@ -3631,6 +3640,30 @@ export default { |
|
|
|
this.$message.error(error) |
|
|
|
}) |
|
|
|
}, |
|
|
|
assertProjectCompleted(projectId, actionText) { |
|
|
|
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('仅项目单据状态为已完成时允许' + actionText + ',当前状态:' + data.rows[0].status) |
|
|
|
return |
|
|
|
} |
|
|
|
resolve(data.rows[0]) |
|
|
|
}).catch((error) => { |
|
|
|
reject(error) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleQueryProjectByCustomer(){ |
|
|
|
let params = { |
|
|
|
site:this.$store.state.user.site, |
|
|
|
@ -3640,6 +3673,14 @@ export default { |
|
|
|
queryProjectByCustomer(params).then(({data})=>{ |
|
|
|
if (data && data.code === 0 ){ |
|
|
|
if (data.rows && data.rows.length === 1){ |
|
|
|
if (this.modalData.flag === '1' && data.rows[0].status !== '已完成') { |
|
|
|
this.$message.warning('仅项目单据状态为已完成时允许新增询价,当前状态:' + data.rows[0].status) |
|
|
|
this.modalData.projectId = '' |
|
|
|
this.modalData.projectName = '' |
|
|
|
this.modalData.finalCustomerId = '' |
|
|
|
this.modalData.finalCustomerName = '' |
|
|
|
return |
|
|
|
} |
|
|
|
this.modalData.projectName = data.rows[0].projectName |
|
|
|
this.modalData.finalCustomerId = data.rows[0].finalCustomerId |
|
|
|
this.modalData.finalCustomerName = data.rows[0].finalCustomerName |
|
|
|
|