|
|
|
@ -69,7 +69,7 @@ |
|
|
|
|
|
|
|
<!-- 审核对话框 --> |
|
|
|
<el-dialog :title="auditTitle" :visible.sync="auditVisible" width="80%" append-to-body :close-on-click-modal="false" |
|
|
|
class="audit-dialog" @close="closeAuditDialog" :destroy-on-close="true"> |
|
|
|
class="audit-dialog" @close="closeAuditDialog"> |
|
|
|
<el-tabs v-model="activeAuditTab" type="border-card"> |
|
|
|
<!-- 基本信息审核标签页 --> |
|
|
|
<el-tab-pane label="基本信息审核" name="basic"> |
|
|
|
@ -146,7 +146,7 @@ |
|
|
|
<!-- 证书列表展示 --> |
|
|
|
<div class="cert-list-section"> |
|
|
|
<h3>证书列表</h3> |
|
|
|
<div v-for="(cert, index) in certificateList" :key="cert.qualificationId + '_' + index" |
|
|
|
<div v-for="(cert, index) in certificateList" :key="index" |
|
|
|
class="certificate-item-wrapper"> |
|
|
|
<div class="certificate-item" :class="{ 'cert-audited': cert.auditStatus && cert.auditStatus !== '0' }"> |
|
|
|
<div class="cert-header"> |
|
|
|
@ -223,13 +223,14 @@ |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-tab-pane> |
|
|
|
</el-tabs> |
|
|
|
|
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="primary" @click="submitAllAudit" :loading="submittingAll" :disabled="!isAllAuditSelected || submittingAll"> |
|
|
|
<el-button type="primary" @click="submitAllAudit" :loading="submittingAll" :disabled="!isAllAuditSelected"> |
|
|
|
{{ submittingAll ? '提交中...' : '提交审核' }} |
|
|
|
</el-button> |
|
|
|
<el-button @click="auditVisible = false">关 闭</el-button> |
|
|
|
@ -237,7 +238,7 @@ |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!-- 详情对话框 --> |
|
|
|
<el-dialog :title="detailTitle" :visible.sync="detailVisible" width="80%" append-to-body :destroy-on-close="true"> |
|
|
|
<el-dialog :title="detailTitle" :visible.sync="detailVisible" width="80%" append-to-body> |
|
|
|
<div v-if="loadingDetail" class="tab-loading"> |
|
|
|
<i class="el-icon-loading"></i> |
|
|
|
<div>加载详情信息...</div> |
|
|
|
@ -280,7 +281,7 @@ |
|
|
|
<div class="certificate-section"> |
|
|
|
<h3>资质证书列表(共 {{ detailCertificates.length }} 个证书)</h3> |
|
|
|
|
|
|
|
<div v-for="(cert, index) in detailCertificates" :key="cert.qualificationId + '_detail_' + index" |
|
|
|
<div v-for="(cert, index) in detailCertificates" :key="index" |
|
|
|
class="certificate-item-wrapper"> |
|
|
|
<div class="certificate-item view-only"> |
|
|
|
<div class="cert-header"> |
|
|
|
@ -450,6 +451,22 @@ export default { |
|
|
|
return true |
|
|
|
} |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
// 监听基本信息审核结果变化 |
|
|
|
'basicAuditForm.auditStatus': { |
|
|
|
handler() { |
|
|
|
this.$nextTick(() => { }) |
|
|
|
}, |
|
|
|
deep: true |
|
|
|
}, |
|
|
|
// 监听证书审核结果变化 |
|
|
|
'certAuditForm.auditStatus': { |
|
|
|
handler() { |
|
|
|
this.$nextTick(() => { }) |
|
|
|
}, |
|
|
|
deep: true |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|
this.getList() |
|
|
|
}, |
|
|
|
@ -466,12 +483,6 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
handleAudit(row) { |
|
|
|
// 防止在提交过程中再次打开审核对话框 |
|
|
|
if (this.submittingAll) { |
|
|
|
this.$message.warning('正在提交审核,请稍后...') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
this.resetAuditData() |
|
|
|
|
|
|
|
const id = row.id || this.ids[0] |
|
|
|
@ -566,8 +577,7 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
handleCertAuditChange(e) { |
|
|
|
console.log(e); |
|
|
|
handleCertAuditChange() { |
|
|
|
// 如果选择审核通过,清空审核意见 |
|
|
|
if (this.certAuditForm.auditStatus === '1') { |
|
|
|
this.certAuditForm.auditOpinion = '' |
|
|
|
@ -578,7 +588,6 @@ export default { |
|
|
|
async submitAllAudit() { |
|
|
|
// 防止重复提交 |
|
|
|
if (this.submittingAll) { |
|
|
|
// this.$message.warning('数据正在处理中,请勿重复提交') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
@ -591,7 +600,7 @@ export default { |
|
|
|
} |
|
|
|
|
|
|
|
// 验证基本信息审核意见(不通过时必须填写) |
|
|
|
if (this.basicAuditForm.auditStatus === '2' && (!this.basicAuditForm.auditDesc || this.basicAuditForm.auditDesc.trim() === '')) { |
|
|
|
if (this.basicAuditForm.auditStatus === '2' && !this.basicAuditForm.auditDesc) { |
|
|
|
this.$message.warning('审核不通过时,请填写审核意见') |
|
|
|
this.activeAuditTab = 'basic' |
|
|
|
return |
|
|
|
@ -607,7 +616,7 @@ export default { |
|
|
|
} |
|
|
|
|
|
|
|
// 审核不通过时必须填写审核意见 |
|
|
|
if (this.certAuditForm.auditStatus === '2' && (!this.certAuditForm.auditOpinion || this.certAuditForm.auditOpinion.trim() === '')) { |
|
|
|
if (this.certAuditForm.auditStatus === '2' && !this.certAuditForm.auditOpinion) { |
|
|
|
this.$message.warning('证书审核不通过时,请填写审核意见') |
|
|
|
this.activeAuditTab = 'certificate' |
|
|
|
return |
|
|
|
@ -621,7 +630,7 @@ export default { |
|
|
|
const basicAuditData = { |
|
|
|
id: this.currentVetId, |
|
|
|
auditStatus: this.basicAuditForm.auditStatus, |
|
|
|
auditDesc: this.basicAuditForm.auditDesc || '' |
|
|
|
auditDesc: this.basicAuditForm.auditDesc |
|
|
|
} |
|
|
|
|
|
|
|
const basicResult = await auditBasicInfo(basicAuditData) |
|
|
|
@ -630,35 +639,31 @@ export default { |
|
|
|
throw new Error(basicResult.msg || '基本信息审核提交失败') |
|
|
|
} |
|
|
|
|
|
|
|
// 提交证书审核(如果有证书) |
|
|
|
// 提交证书批量审核(如果有证书) |
|
|
|
if (this.certificateList && this.certificateList.length > 0) { |
|
|
|
// 使用 Promise.all 并发提交所有证书审核 |
|
|
|
const certPromises = this.certificateList.map(cert => { |
|
|
|
const certAuditData = { |
|
|
|
qualificationId: cert.qualificationId, |
|
|
|
auditStatus: this.certAuditForm.auditStatus, |
|
|
|
auditOpinion: this.certAuditForm.auditOpinion || '' |
|
|
|
} |
|
|
|
return auditCertificate(certAuditData) |
|
|
|
}) |
|
|
|
// 构建批量审核数据 |
|
|
|
const certIds = this.certificateList.map(cert => cert.certId) |
|
|
|
const batchAuditData = { |
|
|
|
certId: certIds, |
|
|
|
auditStatus: this.certAuditForm.auditStatus, |
|
|
|
auditOpinion: this.certAuditForm.auditOpinion || '' |
|
|
|
} |
|
|
|
|
|
|
|
const certResults = await Promise.all(certPromises) |
|
|
|
const certResult = await auditCertificate(batchAuditData) |
|
|
|
|
|
|
|
// 检查是否有失败的证书审核 |
|
|
|
const failedCert = certResults.find(result => result.code !== 200) |
|
|
|
if (failedCert) { |
|
|
|
throw new Error(failedCert.msg || '部分证书审核提交失败') |
|
|
|
if (certResult.code !== 200) { |
|
|
|
throw new Error(certResult.msg || '证书批量审核提交失败') |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 所有审核提交成功 |
|
|
|
this.$modal.msgSuccess('审核提交成功') |
|
|
|
this.$message.success('审核提交成功') |
|
|
|
this.auditVisible = false |
|
|
|
this.getList() |
|
|
|
|
|
|
|
} catch (error) { |
|
|
|
console.error('提交失败:', error) |
|
|
|
this.$modal.msgError(error.message || '提交失败') |
|
|
|
this.$message.error(error.message || '提交失败') |
|
|
|
} finally { |
|
|
|
this.submittingAll = false |
|
|
|
} |
|
|
|
@ -682,21 +687,10 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
closeAuditDialog() { |
|
|
|
// 如果正在提交,不允许关闭 |
|
|
|
if (this.submittingAll) { |
|
|
|
this.$message.warning('正在提交审核,请稍后...') |
|
|
|
return |
|
|
|
} |
|
|
|
this.resetAuditData() |
|
|
|
}, |
|
|
|
|
|
|
|
handleView(row) { |
|
|
|
// 防止在提交过程中打开详情 |
|
|
|
if (this.submittingAll) { |
|
|
|
this.$message.warning('请等待当前操作完成') |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
this.detailVisible = true |
|
|
|
this.detailTitle = "兽医详情信息" |
|
|
|
this.loadingDetail = true |
|
|
|
|