|
|
|
@ -1984,235 +1984,21 @@ |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
|
|
|
|
// 校验附件信息 |
|
|
|
const ossCheck = new Promise((resolve, reject) => { |
|
|
|
let ossParams = { |
|
|
|
orderRef1: row.site, |
|
|
|
orderRef2: row.projectId |
|
|
|
} |
|
|
|
queryOss(ossParams).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
if (data.rows.length===0) { |
|
|
|
resolve(true); |
|
|
|
}else { |
|
|
|
reject(new Error('该项目已存在附件,不允许删除!')) |
|
|
|
this.$message.warning('该项目已存在附件,不允许删除!') |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.$message.warning(data.msg); |
|
|
|
} |
|
|
|
}).catch((error) => { |
|
|
|
this.$message.error(error); |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
// 校验项目物料 |
|
|
|
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, |
|
|
|
limit: 10, |
|
|
|
limit2: 20, |
|
|
|
page: 1, |
|
|
|
page2: 1 |
|
|
|
} |
|
|
|
getProjectInfoPartList(partParams).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
if (data.page.list.length===0){ |
|
|
|
resolve(true); |
|
|
|
} else { |
|
|
|
reject(new Error('该项目已绑定物料信息,不允许删除!')) |
|
|
|
this.$message.warning('该项目已绑定物料信息,不允许删除!') |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
// 校验询价信息 |
|
|
|
const quotationCheck = new Promise((resolve, reject) => { |
|
|
|
let quotationParams = { |
|
|
|
site: row.site, |
|
|
|
projectId: row.projectId, |
|
|
|
createBy: this.$store.state.user.name, |
|
|
|
menuId: '102001', |
|
|
|
limit: 10, |
|
|
|
page: 1 |
|
|
|
} |
|
|
|
quotationInformationSearch(quotationParams).then(({data}) => { |
|
|
|
//区分请求成功和失败的状况 |
|
|
|
if (data && data.code === 0) { |
|
|
|
if(data.page.list.length===0){ |
|
|
|
resolve(true); |
|
|
|
}else { |
|
|
|
reject(new Error('该项目已存在询价信息,不允许删除!')) |
|
|
|
this.$message.warning('该项目已存在询价信息,不允许删除!') |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.$message.warning(data.msg); |
|
|
|
} |
|
|
|
}); |
|
|
|
}) |
|
|
|
|
|
|
|
// 校验项目报价信息 |
|
|
|
const quoteCheck = new Promise((resolve, reject) => { |
|
|
|
let quoteParams = { |
|
|
|
site: row.site, |
|
|
|
projectNo: row.projectId |
|
|
|
} |
|
|
|
queryQuoteGroupDetailByInquiry(quoteParams).then(({data})=>{ |
|
|
|
if (data && data.code === 0){ |
|
|
|
if (data.rows.length===0){ |
|
|
|
resolve(true); |
|
|
|
}else { |
|
|
|
reject(new Error('该项目已存在报价信息,不允许删除!')) |
|
|
|
this.$message.warning('该项目已存在报价信息,不允许删除!') |
|
|
|
} |
|
|
|
}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', |
|
|
|
limit: 10, |
|
|
|
page: 1 |
|
|
|
} |
|
|
|
proofingInformationSearch(proofingParams).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
if (data.page.list.length===0){ |
|
|
|
resolve(true); |
|
|
|
}else { |
|
|
|
reject(new Error('该项目已存在打样信息,不允许删除!')) |
|
|
|
this.$message.warning('该项目已存在打样信息,不允许删除!') |
|
|
|
} |
|
|
|
} 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', |
|
|
|
limit: 10, |
|
|
|
page: 1 |
|
|
|
} |
|
|
|
testInformationList(testParams).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
if (data.rows.length===0){ |
|
|
|
resolve(true); |
|
|
|
} else { |
|
|
|
reject(new Error('该项目已存在测试记录,不允许删除!')) |
|
|
|
this.$message.warning('该项目已存在测试记录,不允许删除!') |
|
|
|
} |
|
|
|
} 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, |
|
|
|
} |
|
|
|
searchProjectToolApplyDetail(toolParams).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
if (data.rows.length===0){ |
|
|
|
resolve(true); |
|
|
|
} else { |
|
|
|
reject(new Error('该项目已存在刀模申请,不允许删除!')) |
|
|
|
this.$message.warning('该项目已存在刀模申请,不允许删除!') |
|
|
|
} |
|
|
|
} 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 |
|
|
|
} |
|
|
|
technicalSpecificationListSearch(technicalSpecificationParams).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
if (data.page.list.length===0){ |
|
|
|
resolve(true); |
|
|
|
} else { |
|
|
|
reject(new Error('该项目已绑定技术参数卡,不允许删除!')) |
|
|
|
this.$message.warning('该项目已绑定技术参数卡,不允许删除!') |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.$message.warning(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 { |
|
|
|
reject(new Error('该项目已存在变更记录,不允许删除!')) |
|
|
|
this.$message.warning('该项目已存在变更记录,不允许删除!') |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.$message.warning(data.msg) |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
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() |
|
|
|
if (data.checkMsg!==null){ |
|
|
|
this.$message.warning(data.checkMsg) |
|
|
|
}else { |
|
|
|
this.$message.success( '操作成功') |
|
|
|
this.contactChooseFlag = false |
|
|
|
this.search() |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.$message.error(data.msg) |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}else { |
|
|
|
this.$alert('没有权限删除这个项目信息!', '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
|