|
|
|
@ -1985,229 +1985,240 @@ |
|
|
|
}).then(() => { |
|
|
|
|
|
|
|
// 校验附件信息 |
|
|
|
let ossParams = { |
|
|
|
orderRef1: row.site, |
|
|
|
orderRef2: row.projectId |
|
|
|
} |
|
|
|
let ossDeleteFlag = false |
|
|
|
queryOss(ossParams).then(({data})=>{ |
|
|
|
if (data && data.code === 0){ |
|
|
|
if (data.rows.length===0){ |
|
|
|
ossDeleteFlag = true |
|
|
|
} |
|
|
|
}else { |
|
|
|
this.$message.warning(data.msg); |
|
|
|
const ossCheck = new Promise((resolve, reject) => { |
|
|
|
let ossParams = { |
|
|
|
orderRef1: row.site, |
|
|
|
orderRef2: row.projectId |
|
|
|
} |
|
|
|
}).catch((error)=>{ |
|
|
|
this.$message.error(error); |
|
|
|
}) |
|
|
|
if (ossDeleteFlag===false){ |
|
|
|
this.$alert('该项目已存在附件,不允许删除!', '提示', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
// 校验项目物料 |
|
|
|
let partParams = { |
|
|
|
site: row.site, |
|
|
|
projectId: row.projectId, |
|
|
|
searchType: 'Y', |
|
|
|
username: this.$store.state.user.name, |
|
|
|
customerId: row.customerId |
|
|
|
} |
|
|
|
let partDeleteFlag = false |
|
|
|
getProjectInfoPartList(partParams).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
if (data.page.list.length===0){ |
|
|
|
partDeleteFlag = true |
|
|
|
queryOss(ossParams).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
if (data.rows.length===0) { |
|
|
|
resolve(true); |
|
|
|
}else { |
|
|
|
reject(new Error('该项目已存在附件,不允许删除!')) |
|
|
|
this.$alert('该项目已存在附件,不允许删除!', '提示', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.$message.warning(data.msg); |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch((error) => { |
|
|
|
this.$message.error(error); |
|
|
|
}) |
|
|
|
}) |
|
|
|
if (partDeleteFlag===false){ |
|
|
|
this.$alert('该项目已绑定物料信息,不允许删除!', '提示', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
|
|
|
|
// 校验项目物料 |
|
|
|
const partCheck = new Promise((resolve, reject) => { |
|
|
|
let partParams = { |
|
|
|
site: row.site, |
|
|
|
projectId: row.projectId, |
|
|
|
searchType: 'Y', |
|
|
|
username: this.$store.state.user.name, |
|
|
|
customerId: row.customerId |
|
|
|
} |
|
|
|
getProjectInfoPartList(partParams).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
if (data.page.list.length===0){ |
|
|
|
resolve(true); |
|
|
|
} else { |
|
|
|
reject(new Error('该项目已绑定物料信息,不允许删除!')) |
|
|
|
this.$alert('该项目已绑定物料信息,不允许删除!', '提示', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
// 校验询价信息 |
|
|
|
let quotationParams = { |
|
|
|
site: row.site, |
|
|
|
projectId: row.projectId, |
|
|
|
createBy: this.$store.state.user.name, |
|
|
|
menuId: '102001' |
|
|
|
} |
|
|
|
let quotationDeleteFlag = false |
|
|
|
quotationInformationSearch(quotationParams).then(({data}) => { |
|
|
|
//区分请求成功和失败的状况 |
|
|
|
if (data && data.code === 0) { |
|
|
|
if(data.page.list.length===0){ |
|
|
|
quotationDeleteFlag = true |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.$message.warning(data.msg); |
|
|
|
const quotationCheck = new Promise((resolve, reject) => { |
|
|
|
let quotationParams = { |
|
|
|
site: row.site, |
|
|
|
projectId: row.projectId, |
|
|
|
createBy: this.$store.state.user.name, |
|
|
|
menuId: '102001' |
|
|
|
} |
|
|
|
}); |
|
|
|
if (quotationDeleteFlag===false){ |
|
|
|
this.$alert('该项目已存在询价信息,不允许删除!', '提示', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
quotationInformationSearch(quotationParams).then(({data}) => { |
|
|
|
//区分请求成功和失败的状况 |
|
|
|
if (data && data.code === 0) { |
|
|
|
if(data.page.list.length===0){ |
|
|
|
resolve(true); |
|
|
|
}else { |
|
|
|
reject(new Error('该项目已存在询价信息,不允许删除!')) |
|
|
|
this.$alert('该项目已存在询价信息,不允许删除!', '提示', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.$message.warning(data.msg); |
|
|
|
} |
|
|
|
}); |
|
|
|
}) |
|
|
|
|
|
|
|
// 校验项目报价信息 |
|
|
|
let quoteParams = { |
|
|
|
site: row.site, |
|
|
|
projectNo: row.projectId |
|
|
|
} |
|
|
|
let quoteDeleteFlag = false |
|
|
|
queryQuoteGroupDetailByInquiry(quoteParams).then(({data})=>{ |
|
|
|
if (data && data.code === 0){ |
|
|
|
if (data.rows.length===0){ |
|
|
|
quoteDeleteFlag = true |
|
|
|
} |
|
|
|
}else { |
|
|
|
this.$message.warning(data.msg) |
|
|
|
const quoteCheck = new Promise((resolve, reject) => { |
|
|
|
let quoteParams = { |
|
|
|
site: row.site, |
|
|
|
projectNo: row.projectId |
|
|
|
} |
|
|
|
}) |
|
|
|
if (quoteDeleteFlag===false){ |
|
|
|
this.$alert('该项目已存在报价信息,不允许删除!', '提示', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
queryQuoteGroupDetailByInquiry(quoteParams).then(({data})=>{ |
|
|
|
if (data && data.code === 0){ |
|
|
|
if (data.rows.length===0){ |
|
|
|
resolve(true); |
|
|
|
}else { |
|
|
|
reject(new Error('该项目已存在报价信息,不允许删除!')) |
|
|
|
this.$alert('该项目已存在报价信息,不允许删除!', '提示', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
}else { |
|
|
|
this.$message.warning(data.msg); |
|
|
|
} |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
// 校验项目打样信息 |
|
|
|
let proofingParams = { |
|
|
|
site: row.site, |
|
|
|
projectId: row.projectId, |
|
|
|
createBy: this.$store.state.user.name, |
|
|
|
menuId: '103001' |
|
|
|
} |
|
|
|
let proofingDeleteFlag = false |
|
|
|
proofingInformationSearch(proofingParams).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
if (data.page.list.length===0){ |
|
|
|
proofingDeleteFlag = true |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.$message.warning(data.msg) |
|
|
|
const proofingCheck = new Promise((resolve, reject) => { |
|
|
|
let proofingParams = { |
|
|
|
site: row.site, |
|
|
|
projectId: row.projectId, |
|
|
|
createBy: this.$store.state.user.name, |
|
|
|
menuId: '103001' |
|
|
|
} |
|
|
|
}) |
|
|
|
if (proofingDeleteFlag===false){ |
|
|
|
this.$alert('该项目已存在打样信息,不允许删除!', '提示', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
proofingInformationSearch(proofingParams).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
if (data.page.list.length===0){ |
|
|
|
resolve(true); |
|
|
|
}else { |
|
|
|
reject(new Error('该项目已存在打样信息,不允许删除!')) |
|
|
|
this.$alert('该项目已存在打样信息,不允许删除!', '提示', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.$message.warning(data.msg) |
|
|
|
} |
|
|
|
}) |
|
|
|
return; |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
// 校验项目测试记录 |
|
|
|
let testParams = { |
|
|
|
site: row.site, |
|
|
|
projectId: row.projectId, |
|
|
|
createBy: this.$store.state.user.name, |
|
|
|
menuId: '107001' |
|
|
|
} |
|
|
|
let testDeleteFlag = false |
|
|
|
testInformationList(testParams).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
if (data.rows.length===0){ |
|
|
|
testDeleteFlag = true |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.$message.warning(data.msg) |
|
|
|
const testCheck = new Promise((resolve, reject) => { |
|
|
|
let testParams = { |
|
|
|
site: row.site, |
|
|
|
projectId: row.projectId, |
|
|
|
createBy: this.$store.state.user.name, |
|
|
|
menuId: '107001' |
|
|
|
} |
|
|
|
}); |
|
|
|
if (testDeleteFlag===false){ |
|
|
|
this.$alert('该项目已存在测试信息,不允许删除!', '提示', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
testInformationList(testParams).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
if (data.rows.length===0){ |
|
|
|
resolve(true); |
|
|
|
} else { |
|
|
|
reject(new Error('该项目已存在测试记录,不允许删除!')) |
|
|
|
this.$alert('该项目已存在测试记录,不允许删除!', '提示', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.$message.warning(data.msg); |
|
|
|
} |
|
|
|
}); |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// 检验刀模申请 |
|
|
|
let toolParams = { |
|
|
|
orderRef1: row.projectId, |
|
|
|
site: row.site, |
|
|
|
username: this.$store.state.user.name |
|
|
|
} |
|
|
|
let toolDeleteFlag = false |
|
|
|
searchProjectToolApplyDetail(toolParams).then(({data}) => { |
|
|
|
//区分请求成功和失败的状况 |
|
|
|
if (data && data.code === 0) { |
|
|
|
if (data.rows.length===0){ |
|
|
|
toolDeleteFlag = true |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.$message.warning(data.msg) |
|
|
|
const toolCheck = new Promise((resolve, reject) => { |
|
|
|
let toolParams = { |
|
|
|
orderRef1: row.projectId, |
|
|
|
site: row.site, |
|
|
|
username: this.$store.state.user.name |
|
|
|
} |
|
|
|
}) |
|
|
|
if (toolDeleteFlag===false){ |
|
|
|
this.$alert('该项目已存在刀模申请,不允许删除!', '提示', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
searchProjectToolApplyDetail(toolParams).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
if (data.rows.length===0){ |
|
|
|
resolve(true); |
|
|
|
} else { |
|
|
|
reject(new Error('该项目已存在刀模申请,不允许删除!')) |
|
|
|
this.$alert('该项目已存在刀模申请,不允许删除!', '提示', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.$message.warning(data.msg) |
|
|
|
} |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
// 校验技术参数卡 |
|
|
|
let technicalSpecificationParams = { |
|
|
|
site: row.site, |
|
|
|
userName: this.$store.state.user.name, |
|
|
|
projectId: row.projectId, |
|
|
|
} |
|
|
|
let technicalSpecificationDeleteFlag = false |
|
|
|
technicalSpecificationListSearch(technicalSpecificationParams).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
if (data.page.list.length===0){ |
|
|
|
technicalSpecificationDeleteFlag = true |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.$message.warning(data.msg) |
|
|
|
const technicalSpecificationCheck = new Promise((resolve, reject) => { |
|
|
|
let technicalSpecificationParams = { |
|
|
|
site: row.site, |
|
|
|
userName: this.$store.state.user.name, |
|
|
|
projectId: row.projectId, |
|
|
|
page: 1, |
|
|
|
limit: 10 |
|
|
|
} |
|
|
|
}); |
|
|
|
if (technicalSpecificationDeleteFlag===false){ |
|
|
|
this.$alert('该项目已绑定技术参数卡,不允许删除!', '提示', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
// 校验项目变更记录 |
|
|
|
let changeParams = { |
|
|
|
site: row.site, |
|
|
|
projectId: row.projectId, |
|
|
|
menuId: '108002' |
|
|
|
} |
|
|
|
let changeDeleteFlag = false |
|
|
|
getChangeRecordByPartNo(changeParams).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
if (data.rows.length===0){ |
|
|
|
changeDeleteFlag = true |
|
|
|
technicalSpecificationListSearch(technicalSpecificationParams).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
if (data.page.list.length===0){ |
|
|
|
resolve(true); |
|
|
|
} else { |
|
|
|
this.$alert('该项目已绑定技术参数卡,不允许删除!', '提示', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
reject(new Error('该项目已绑定技术参数卡,不允许删除!')) |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.$message.warning(data.msg); |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.$message.warning(data.msg) |
|
|
|
} |
|
|
|
}); |
|
|
|
}) |
|
|
|
if(changeDeleteFlag===false){ |
|
|
|
this.$alert('该项目已存在变更记录,不允许删除!', '提示', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
deleteProjectInfo(row).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.success( '操作成功') |
|
|
|
this.contactChooseFlag = false |
|
|
|
this.search() |
|
|
|
} else { |
|
|
|
this.$message.error(data.msg) |
|
|
|
// 校验项目变更记录 |
|
|
|
const changeCheck = new Promise((resolve, reject) => { |
|
|
|
let changeParams = { |
|
|
|
site: row.site, |
|
|
|
projectId: row.projectId, |
|
|
|
menuId: '108002' |
|
|
|
} |
|
|
|
getChangeRecordByPartNo(changeParams).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
if (data.rows.length===0){ |
|
|
|
resolve(true); |
|
|
|
} else { |
|
|
|
this.$alert('该项目已存在变更记录,不允许删除!', '提示', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
reject(new Error('该项目已存在变更记录,不允许删除!')) |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.$message.warning(data.msg) |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}).catch(() => {}) |
|
|
|
return Promise.all([ |
|
|
|
ossCheck, |
|
|
|
partCheck, |
|
|
|
quotationCheck, |
|
|
|
quoteCheck, |
|
|
|
proofingCheck, |
|
|
|
testCheck, |
|
|
|
toolCheck, |
|
|
|
technicalSpecificationCheck, |
|
|
|
changeCheck |
|
|
|
]); |
|
|
|
}).then(()=>{ |
|
|
|
deleteProjectInfo(row).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.success( '操作成功') |
|
|
|
this.contactChooseFlag = false |
|
|
|
this.search() |
|
|
|
} else { |
|
|
|
this.$message.error(data.msg) |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}else { |
|
|
|
this.$alert('没有权限删除这个项目信息!', '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
|