|
|
|
@ -148,122 +148,70 @@ |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="审核状态" align="center" prop="auditStatus" width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<!-- 使用 qualification_shenhe 字典显示审核状态 --> |
|
|
|
<dict-tag :options="dict.type.qualification_shenhe" :value="scope.row.auditStatus"/> |
|
|
|
<el-tag :type="getAuditStatusType(scope.row.auditStatus)" size="small"> |
|
|
|
{{ getDictLabel('qualification_shenhe', scope.row.auditStatus) }} |
|
|
|
</el-tag> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="备注" align="center" prop="remark" /> |
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="250"> |
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="300"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<!-- 调试信息:查看实际状态值 --> |
|
|
|
<!-- <span style="color: red; font-size: 10px; margin-right: 5px;">状态:{{ scope.row.auditStatus }}</span> --> |
|
|
|
|
|
|
|
<!-- 情况1:没有审核状态(null、空、undefined)或状态为3(待提交) --> |
|
|
|
<template v-if="!scope.row.auditStatus || scope.row.auditStatus === '' || scope.row.auditStatus === '3'"> |
|
|
|
<el-button |
|
|
|
size="mini" |
|
|
|
type="text" |
|
|
|
icon="el-icon-edit" |
|
|
|
style="color: #42B983" |
|
|
|
@click="handleUpdate(scope.row)" |
|
|
|
v-hasPermi="['vet:qualification:edit']" |
|
|
|
>修改</el-button> |
|
|
|
|
|
|
|
<el-button |
|
|
|
size="mini" |
|
|
|
type="text" |
|
|
|
icon="el-icon-s-check" |
|
|
|
style="color: #409EFF" |
|
|
|
@click="handleSubmitAudit(scope.row)" |
|
|
|
v-hasPermi="['vet:qualification:edit']" |
|
|
|
>提交审核</el-button> |
|
|
|
|
|
|
|
<el-button |
|
|
|
size="mini" |
|
|
|
type="text" |
|
|
|
icon="el-icon-delete" |
|
|
|
style="color: #f56c6c" |
|
|
|
@click="handleDelete(scope.row)" |
|
|
|
v-hasPermi="['vet:qualification:remove']" |
|
|
|
>删除</el-button> |
|
|
|
</template> |
|
|
|
|
|
|
|
<!-- 情况2:审核状态为待审核(0) --> |
|
|
|
<template v-else-if="scope.row.auditStatus === '0'"> |
|
|
|
<span style="color: #E6A23C; font-size: 12px;"> |
|
|
|
<i class="el-icon-time" style="margin-right: 3px;"></i>审核中 |
|
|
|
</span> |
|
|
|
<!-- <el-button |
|
|
|
size="mini" |
|
|
|
type="text" |
|
|
|
style="color: #909399; margin-left: 10px;" |
|
|
|
disabled |
|
|
|
>不可操作</el-button>--> |
|
|
|
</template> |
|
|
|
|
|
|
|
<!-- 情况3:审核状态为通过(1) --> |
|
|
|
<template v-else-if="scope.row.auditStatus === '1'"> |
|
|
|
<span style="color: #67C23A; font-size: 12px;"> |
|
|
|
<i class="el-icon-success" style="margin-right: 3px;"></i>已通过 |
|
|
|
</span> |
|
|
|
<!-- 查看按钮 --> |
|
|
|
<el-button |
|
|
|
size="mini" |
|
|
|
type="text" |
|
|
|
icon="el-icon-view" |
|
|
|
style="color: #909399; margin-left: 10px;" |
|
|
|
@click="handleView(scope.row)" |
|
|
|
v-hasPermi="['vet:qualification:query']" |
|
|
|
>查看</el-button> |
|
|
|
</template> |
|
|
|
|
|
|
|
<!-- 情况4:审核状态为拒绝(2) --> |
|
|
|
<template v-else-if="scope.row.auditStatus === '2'"> |
|
|
|
<span style="color: #F56C6C; font-size: 12px;"> |
|
|
|
<i class="el-icon-error" style="margin-right: 3px;"></i>已拒绝 |
|
|
|
</span> |
|
|
|
<!-- 修改按钮 --> |
|
|
|
<el-button |
|
|
|
v-if="!scope.row.auditStatus || scope.row.auditStatus === '0' || scope.row.auditStatus === '2'" |
|
|
|
size="mini" |
|
|
|
type="text" |
|
|
|
icon="el-icon-edit" |
|
|
|
style="color: #42B983; margin-left: 10px;" |
|
|
|
style="color: #42B983" |
|
|
|
@click="handleUpdate(scope.row)" |
|
|
|
v-hasPermi="['vet:qualification:edit']" |
|
|
|
>修改</el-button> |
|
|
|
|
|
|
|
<!-- 提交/重新提交按钮 --> |
|
|
|
<el-button |
|
|
|
v-if="!scope.row.auditStatus || scope.row.auditStatus === '2'" |
|
|
|
size="mini" |
|
|
|
type="text" |
|
|
|
icon="el-icon-s-check" |
|
|
|
style="color: #409EFF" |
|
|
|
@click="handleSubmitAudit(scope.row)" |
|
|
|
v-hasPermi="['vet:qualification:edit']" |
|
|
|
>重新提交</el-button> |
|
|
|
</template> |
|
|
|
>{{ !scope.row.auditStatus ? '提交审核' : '重新提交' }}</el-button> |
|
|
|
|
|
|
|
<!-- 情况5:其他未知状态 --> |
|
|
|
<template v-else> |
|
|
|
<span style="color: #909399; font-size: 12px; margin-right: 10px;"> |
|
|
|
状态: {{ scope.row.auditStatus }} |
|
|
|
</span> |
|
|
|
<!-- 下架按钮:已上架状态显示 --> |
|
|
|
<el-button |
|
|
|
v-if="scope.row.auditStatus === '1'" |
|
|
|
size="mini" |
|
|
|
type="text" |
|
|
|
icon="el-icon-edit" |
|
|
|
style="color: #42B983" |
|
|
|
@click="handleUpdate(scope.row)" |
|
|
|
v-hasPermi="['vet:qualification:edit']" |
|
|
|
>修改</el-button> |
|
|
|
icon="el-icon-bottom" |
|
|
|
style="color: #E6A23C" |
|
|
|
@click="handleUnshelf(scope.row)" |
|
|
|
v-hasPermi="['vet:qualification:unshelf']" |
|
|
|
>下架</el-button> |
|
|
|
|
|
|
|
<!-- 上架按钮:已下架状态显示 --> |
|
|
|
<el-button |
|
|
|
v-if="scope.row.auditStatus === '3'" |
|
|
|
size="mini" |
|
|
|
type="text" |
|
|
|
icon="el-icon-s-check" |
|
|
|
style="color: #409EFF" |
|
|
|
@click="handleSubmitAudit(scope.row)" |
|
|
|
v-hasPermi="['vet:qualification:edit']" |
|
|
|
>提交</el-button> |
|
|
|
icon="el-icon-top" |
|
|
|
style="color: #67C23A" |
|
|
|
@click="handleShelf(scope.row)" |
|
|
|
v-hasPermi="['vet:qualification:shelf']" |
|
|
|
>上架</el-button> |
|
|
|
|
|
|
|
<!-- 删除按钮 --> |
|
|
|
<el-button |
|
|
|
v-if="!scope.row.auditStatus || scope.row.auditStatus === '2'" |
|
|
|
size="mini" |
|
|
|
type="text" |
|
|
|
icon="el-icon-delete" |
|
|
|
@ -272,7 +220,6 @@ |
|
|
|
v-hasPermi="['vet:qualification:remove']" |
|
|
|
>删除</el-button> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
|
|
|
|
@ -352,11 +299,11 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import { listQualification, getQualification, delQualification, addQualification, updateQualification } from "@/api/vet/qualification" |
|
|
|
import { submitQualification } from "@/api/vet/qualification" |
|
|
|
import { submitQualification, unshelfQualification, shelfQualification } from "@/api/vet/qualification" |
|
|
|
|
|
|
|
export default { |
|
|
|
name: "Qualification", |
|
|
|
dicts: ['qualification_shenhe', 'expert_type'], // 添加 qualification_shenhe 字典 |
|
|
|
dicts: ['qualification_shenhe', 'expert_type'], |
|
|
|
data() { |
|
|
|
return { |
|
|
|
// 遮罩层 |
|
|
|
@ -386,7 +333,6 @@ export default { |
|
|
|
qualificationType: null, |
|
|
|
certificateNo: null, |
|
|
|
auditStatus: null, |
|
|
|
// 新增证书查询字段 |
|
|
|
certName: null, |
|
|
|
issueOrg: null, |
|
|
|
expireDate: null, |
|
|
|
@ -419,7 +365,6 @@ export default { |
|
|
|
getList() { |
|
|
|
this.loading = true |
|
|
|
listQualification(this.queryParams).then(response => { |
|
|
|
console.log('资质列表数据:', response.rows) // 调试用 |
|
|
|
this.qualificationList = response.rows |
|
|
|
this.total = response.total |
|
|
|
this.loading = false |
|
|
|
@ -446,24 +391,13 @@ export default { |
|
|
|
return map[status] || 'info' |
|
|
|
}, |
|
|
|
|
|
|
|
/** 获取审核状态标签(备用方法,主要用字典) */ |
|
|
|
getAuditStatusLabel(status) { |
|
|
|
const map = { |
|
|
|
'0': '待审核', |
|
|
|
'1': '通过', |
|
|
|
'2': '拒绝', |
|
|
|
'3': '待提交' |
|
|
|
} |
|
|
|
return map[status] || status || '-' |
|
|
|
}, |
|
|
|
|
|
|
|
/** 获取审核状态标签类型(备用方法) */ |
|
|
|
/** 获取审核状态标签类型 */ |
|
|
|
getAuditStatusType(status) { |
|
|
|
const map = { |
|
|
|
'0': 'info', |
|
|
|
'1': 'success', |
|
|
|
'2': 'danger', |
|
|
|
'3': 'warning' |
|
|
|
'0': 'info', // 待审核 - 蓝色 |
|
|
|
'1': 'success', // 已上架 - 绿色 |
|
|
|
'2': 'danger', // 已拒绝 - 红色 |
|
|
|
'3': 'warning' // 已下架 - 黄色 |
|
|
|
} |
|
|
|
return map[status] || 'info' |
|
|
|
}, |
|
|
|
@ -475,6 +409,65 @@ export default { |
|
|
|
return value |
|
|
|
}, |
|
|
|
|
|
|
|
/** 下架操作 */ |
|
|
|
handleUnshelf(row) { |
|
|
|
this.$prompt('请输入下架原因', '下架确认', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
inputPlaceholder: '请输入下架原因(如:证书过期、违规操作等)', |
|
|
|
inputValidator: (value) => { |
|
|
|
if (!value || value.trim().length < 2) { |
|
|
|
return '下架原因不能少于2个字' |
|
|
|
} |
|
|
|
if (value.trim().length > 200) { |
|
|
|
return '下架原因不能超过200字' |
|
|
|
} |
|
|
|
return true |
|
|
|
} |
|
|
|
}).then(({ value }) => { |
|
|
|
this.loading = true |
|
|
|
unshelfQualification(row.qualificationId, value).then(response => { |
|
|
|
this.loading = false |
|
|
|
if (response.code === 200) { |
|
|
|
this.$modal.msgSuccess('下架成功') |
|
|
|
this.getList() // 刷新列表 |
|
|
|
} else { |
|
|
|
this.$modal.msgError(response.msg || '下架失败') |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
this.loading = false |
|
|
|
this.$modal.msgError(error.msg || '下架失败') |
|
|
|
}) |
|
|
|
}).catch(() => { |
|
|
|
// 用户取消操作 |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
/** 上架操作 */ |
|
|
|
handleShelf(row) { |
|
|
|
this.$confirm('确认要上架此资质吗?', '上架确认', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
this.loading = true |
|
|
|
shelfQualification(row.qualificationId).then(response => { |
|
|
|
this.loading = false |
|
|
|
if (response.code === 200) { |
|
|
|
this.$modal.msgSuccess('上架成功') |
|
|
|
this.getList() // 刷新列表 |
|
|
|
} else { |
|
|
|
this.$modal.msgError(response.msg || '上架失败') |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
this.loading = false |
|
|
|
this.$modal.msgError(error.msg || '上架失败') |
|
|
|
}) |
|
|
|
}).catch(() => { |
|
|
|
// 用户取消操作 |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
/** 提交审核操作 */ |
|
|
|
handleSubmitAudit(row) { |
|
|
|
this.$modal.confirm('确认提交 "' + row.realName + '" 的资质进行审核?').then(() => { |
|
|
|
@ -507,22 +500,63 @@ export default { |
|
|
|
}).catch(() => {}) |
|
|
|
}, |
|
|
|
|
|
|
|
/** 查看详情 - 极简版 */ |
|
|
|
/** 查看详情 */ |
|
|
|
handleView(row) { |
|
|
|
// 直接使用 this.$alert |
|
|
|
this.$alert(` |
|
|
|
<table style="width:100%;"> |
|
|
|
<tr><td style="padding:5px;">姓名:</td><td>${row.realName || '-'}</td></tr> |
|
|
|
<tr><td style="padding:5px;">身份证:</td><td>${row.idCard || '-'}</td></tr> |
|
|
|
<tr><td style="padding:5px;">证书编号:</td><td>${row.certificateNo || '-'}</td></tr> |
|
|
|
<tr><td style="padding:5px;">审核状态:</td><td>${this.getDictLabel('qualification_shenhe', row.auditStatus) || '-'}</td></tr> |
|
|
|
</table> |
|
|
|
`, '资质详情', { |
|
|
|
// 构建详情内容 |
|
|
|
let detailContent = ` |
|
|
|
<table style="width:100%; border-collapse: collapse;"> |
|
|
|
<tr> |
|
|
|
<td style="padding:8px 5px; border-bottom: 1px solid #eee; color: #666;">姓名:</td> |
|
|
|
<td style="padding:8px 5px; border-bottom: 1px solid #eee;">${row.realName || '-'}</td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td style="padding:8px 5px; border-bottom: 1px solid #eee; color: #666;">身份证:</td> |
|
|
|
<td style="padding:8px 5px; border-bottom: 1px solid #eee;">${row.idCard || '-'}</td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td style="padding:8px 5px; border-bottom: 1px solid #eee; color: #666;">证书编号:</td> |
|
|
|
<td style="padding:8px 5px; border-bottom: 1px solid #eee;">${row.certificateNo || '-'}</td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td style="padding:8px 5px; border-bottom: 1px solid #eee; color: #666;">证书名称:</td> |
|
|
|
<td style="padding:8px 5px; border-bottom: 1px solid #eee;">${row.certName || '-'}</td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td style="padding:8px 5px; border-bottom: 1px solid #eee; color: #666;">发证机构:</td> |
|
|
|
<td style="padding:8px 5px; border-bottom: 1px solid #eee;">${row.issueOrg || '-'}</td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td style="padding:8px 5px; border-bottom: 1px solid #eee; color: #666;">到期日期:</td> |
|
|
|
<td style="padding:8px 5px; border-bottom: 1px solid #eee;">${row.expireDate ? this.parseTime(row.expireDate, '{y}-{m}-{d}') : '-'}</td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td style="padding:8px 5px; border-bottom: 1px solid #eee; color: #666;">证书状态:</td> |
|
|
|
<td style="padding:8px 5px; border-bottom: 1px solid #eee;">${this.getCertStatusLabel(row.certStatus)}</td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td style="padding:8px 5px; border-bottom: 1px solid #eee; color: #666;">审核状态:</td> |
|
|
|
<td style="padding:8px 5px; border-bottom: 1px solid #eee;">${this.getDictLabel('qualification_shenhe', row.auditStatus) || '-'}</td> |
|
|
|
</tr>` |
|
|
|
|
|
|
|
// 如果有审核意见,添加审核意见 |
|
|
|
if (row.auditOpinion) { |
|
|
|
detailContent += ` |
|
|
|
<tr> |
|
|
|
<td style="padding:8px 5px; border-bottom: 1px solid #eee; color: #666;">审核意见:</td> |
|
|
|
<td style="padding:8px 5px; border-bottom: 1px solid #eee;">${row.auditOpinion}</td> |
|
|
|
</tr>` |
|
|
|
} |
|
|
|
|
|
|
|
detailContent += `</table>` |
|
|
|
|
|
|
|
this.$alert(detailContent, '资质详情', { |
|
|
|
dangerouslyUseHTMLString: true, |
|
|
|
confirmButtonText: '关闭', |
|
|
|
width: '450px' |
|
|
|
width: '550px', |
|
|
|
customClass: 'qualification-detail-dialog' |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 取消按钮 |
|
|
|
cancel() { |
|
|
|
this.open = false |
|
|
|
@ -541,11 +575,10 @@ export default { |
|
|
|
certificateFiles: null, |
|
|
|
applyTime: null, |
|
|
|
auditTime: null, |
|
|
|
auditStatus: null, // 新增时审核状态为null |
|
|
|
auditStatus: null, |
|
|
|
auditOpinion: null, |
|
|
|
auditorId: null, |
|
|
|
remark: null, |
|
|
|
// 新增的证书字段 |
|
|
|
certName: null, |
|
|
|
certType: null, |
|
|
|
issueOrg: null, |
|
|
|
@ -585,7 +618,6 @@ export default { |
|
|
|
this.reset() |
|
|
|
this.open = true |
|
|
|
this.title = "添加兽医资质" |
|
|
|
// 确保新增时审核状态为null |
|
|
|
this.form.auditStatus = null |
|
|
|
}, |
|
|
|
|
|
|
|
@ -606,16 +638,13 @@ export default { |
|
|
|
if (valid) { |
|
|
|
if (this.form.qualificationId != null) { |
|
|
|
updateQualification(this.form).then(response => { |
|
|
|
console.log('修改返回数据:', response) // 调试 |
|
|
|
this.$modal.msgSuccess("修改成功") |
|
|
|
this.open = false |
|
|
|
this.getList() |
|
|
|
}) |
|
|
|
} else { |
|
|
|
// 新增时确保审核状态为null |
|
|
|
this.form.auditStatus = null |
|
|
|
addQualification(this.form).then(response => { |
|
|
|
console.log('新增返回数据:', response) // 调试 |
|
|
|
this.$modal.msgSuccess("新增成功") |
|
|
|
this.open = false |
|
|
|
this.getList() |
|
|
|
@ -661,5 +690,25 @@ export default { |
|
|
|
.el-button--text { |
|
|
|
padding: 6px 10px; |
|
|
|
margin: 0 2px; |
|
|
|
min-width: 50px; |
|
|
|
} |
|
|
|
|
|
|
|
/* 状态标签样式 */ |
|
|
|
.el-tag { |
|
|
|
margin: 2px; |
|
|
|
} |
|
|
|
|
|
|
|
/* 详情对话框样式 */ |
|
|
|
::v-deep .qualification-detail-dialog .el-message-box__content { |
|
|
|
max-height: 400px; |
|
|
|
overflow-y: auto; |
|
|
|
} |
|
|
|
|
|
|
|
::v-deep .qualification-detail-dialog table { |
|
|
|
width: 100%; |
|
|
|
} |
|
|
|
|
|
|
|
::v-deep .qualification-detail-dialog table tr:last-child td { |
|
|
|
border-bottom: none; |
|
|
|
} |
|
|
|
</style> |