|
|
|
@ -2,44 +2,38 @@ |
|
|
|
<div class="app-container"> |
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
|
|
|
<el-form-item label="真实姓名" prop="realName"> |
|
|
|
<el-input |
|
|
|
v-model="queryParams.realName" |
|
|
|
placeholder="请输入真实姓名" |
|
|
|
clearable |
|
|
|
@keyup.enter.native="handleQuery" |
|
|
|
/> |
|
|
|
<el-input v-model="queryParams.realName" placeholder="请输入真实姓名" clearable @keyup.enter.native="handleQuery" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="身份证号" prop="idCard"> |
|
|
|
<el-input |
|
|
|
v-model="queryParams.idCard" |
|
|
|
placeholder="请输入身份证号" |
|
|
|
clearable |
|
|
|
@keyup.enter.native="handleQuery" |
|
|
|
/> |
|
|
|
<el-input v-model="queryParams.idCard" placeholder="请输入身份证号" clearable @keyup.enter.native="handleQuery" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="资质类型" prop="qualificationType"> |
|
|
|
<el-select |
|
|
|
v-model="queryParams.qualificationType" |
|
|
|
placeholder="请选择资质类型" |
|
|
|
style="width: 100%;" |
|
|
|
@keyup.enter.native="handleQuery" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="dict in dict.type.qualification_type" |
|
|
|
:key="dict.value" |
|
|
|
:label="dict.label" |
|
|
|
:value="dict.value" |
|
|
|
/> |
|
|
|
<el-select v-model="queryParams.qualificationType" placeholder="请选择资质类型" style="width: 100%;" |
|
|
|
@keyup.enter.native="handleQuery"> |
|
|
|
<el-option v-for="dict in dict.type.qualification_type" :key="dict.value" :label="dict.label" |
|
|
|
:value="dict.value" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<!-- <el-form-item label="资质类型" prop="qualificationType">--> |
|
|
|
<!-- <el-input--> |
|
|
|
<!-- v-model="queryParams.qualificationType"--> |
|
|
|
<!-- placeholder="请输入资质类型"--> |
|
|
|
<!-- clearable--> |
|
|
|
<!-- @keyup.enter.native="handleQuery"--> |
|
|
|
<!-- />--> |
|
|
|
<!-- </el-form-item>--> |
|
|
|
<!-- <el-form-item label="证书编号" prop="certificateNo">--> |
|
|
|
<!-- <el-input--> |
|
|
|
<!-- v-model="queryParams.certificateNo"--> |
|
|
|
<!-- placeholder="请输入证书编号"--> |
|
|
|
<!-- clearable--> |
|
|
|
<!-- @keyup.enter.native="handleQuery"--> |
|
|
|
<!-- />--> |
|
|
|
<!-- </el-form-item>--> |
|
|
|
<el-form-item label="审核状态" prop="auditStatus"> |
|
|
|
<el-select v-model="queryParams.auditStatus" placeholder="审核状态" clearable style="width: 100px"> |
|
|
|
<el-option |
|
|
|
v-for="dict in dict.type.qualification_shenhe" |
|
|
|
:key="dict.value" |
|
|
|
:label="dict.label" |
|
|
|
:value="dict.value" |
|
|
|
/> |
|
|
|
<el-select v-model="queryParams.auditStatus" placeholder="审核状态" clearable> |
|
|
|
<el-option v-for="dict in dict.type.qualification_shenhe" :key="dict.value" :label="dict.label" |
|
|
|
:value="dict.value" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
@ -49,145 +43,16 @@ |
|
|
|
</el-form> |
|
|
|
|
|
|
|
<!-- 表格 --> |
|
|
|
<el-table v-loading="loading" :data="qualificationList" @selection-change="handleSelectionChange"> |
|
|
|
<el-table v-loading="loading" :data="qualificationList" border style="width: 100%"> |
|
|
|
<el-table-column type="selection" width="55" align="center" /> |
|
|
|
<el-table-column label="真实姓名" align="center" prop="realName" width="150" :show-overflow-tooltip="true"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="scope.row.realName">{{ scope.row.realName }}</span> |
|
|
|
<span v-else style="color: #909399">-</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="身份证号" align="center" prop="idCard" width="200"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="scope.row.idCard">{{ scope.row.idCard }}</span> |
|
|
|
<span v-else style="color: #909399">-</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="资质类型" align="center" prop="qualificationType" width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ formatQualificationType(scope.row.qualificationType) }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="申请时间" align="center" prop="applyTime" width="180"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="scope.row.applyTime">{{ parseTime(scope.row.applyTime, '{y}-{m}-{d}') }}</span> |
|
|
|
<span v-else style="color: #909399">-</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="审核时间" align="center" prop="auditTime" width="180"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="scope.row.auditTime">{{ parseTime(scope.row.auditTime, '{y}-{m}-{d}') }}</span> |
|
|
|
<span v-else style="color: #909399">-</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="审核状态" align="center" prop="auditStatus" width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<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" width="150" :show-overflow-tooltip="true"/> |
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="300"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button |
|
|
|
size="mini" |
|
|
|
type="text" |
|
|
|
icon="el-icon-view" |
|
|
|
@click="handleView(scope.row)" |
|
|
|
v-hasPermi="['vet:qualification:query']" |
|
|
|
class="info-btn view-btn" |
|
|
|
>详情</el-button> |
|
|
|
</template> |
|
|
|
<el-table-column prop="certName" label="证书名称" align="center" width="150" :show-overflow-tooltip="true"/> |
|
|
|
<el-table-column prop="certificateNo" label="证书编号" align="center" width="150" :show-overflow-tooltip="true"/> |
|
|
|
<el-table-column label="发证机构" align="center" prop="issueOrg" width="150" :show-overflow-tooltip="true" /> |
|
|
|
<el-table-column label="资质类型" align="center" prop="issueOrg" width="150" :show-overflow-tooltip="true" > |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
|
|
|
|
<div class="pagestyle"> |
|
|
|
<pagination |
|
|
|
v-show="total>0" |
|
|
|
:total="total" |
|
|
|
:page.sync="queryParams.pageNum" |
|
|
|
:limit.sync="queryParams.pageSize" |
|
|
|
@pagination="getList" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
|
|
|
|
<!-- 显示资质证书信息弹窗 --> |
|
|
|
<el-dialog :title="title" :visible.sync="openDetail" width="80%" append-to-body> |
|
|
|
<div v-if="detailData" style="padding: 20px;"> |
|
|
|
<!-- 显示实名信息摘要 --> |
|
|
|
<el-card class="auth-info-card" style="margin-bottom: 20px; background-color: #f0f9eb;" v-if="authInfo"> |
|
|
|
<div slot="header" class="clearfix"> |
|
|
|
<span><i class="el-icon-success" style="color: #67C23A;"></i> 实名认证信息</span> |
|
|
|
</div> |
|
|
|
<div class="auth-info-content"> |
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-col :span="8"> |
|
|
|
<span class="auth-label">真实姓名:</span> |
|
|
|
<span class="auth-value">{{ authInfo.realName || detailData.realName || '-' }}</span> |
|
|
|
</el-col> |
|
|
|
<el-col :span="16"> |
|
|
|
<span class="auth-label">身份证号:</span> |
|
|
|
<span class="auth-value">{{ authInfo.maskedIdCard || detailData.idCard || '-' }}</span> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</div> |
|
|
|
</el-card> |
|
|
|
|
|
|
|
<div> |
|
|
|
<el-alert |
|
|
|
v-if="!certificateList || certificateList.length === 0" |
|
|
|
title="暂无资质证书" |
|
|
|
type="info" |
|
|
|
:closable="false" |
|
|
|
style="margin-bottom: 20px;" |
|
|
|
/> |
|
|
|
<el-table v-else :data="certificateList" border style="width: 100%"> |
|
|
|
<el-table-column type="selection" width="55" align="center" /> |
|
|
|
<el-table-column prop="certificateNo" label="证书编号" align="center" width="150" :show-overflow-tooltip="true"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.certificateNo }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="certName" label="证书名称" align="center" width="150" :show-overflow-tooltip="true"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.certName }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="发证机构" align="center" prop="issueOrg" width="150" :show-overflow-tooltip="true"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="scope.row.issueOrg">{{ scope.row.issueOrg }}</span> |
|
|
|
<span v-else style="color: #909399">-</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="证书文件" prop="certificateFiles" align="center" width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span v-if="scope.row.certificateFiles"> |
|
|
|
<template v-if="isImageFile(scope.row.certificateFiles)"> |
|
|
|
<el-button |
|
|
|
type="text" |
|
|
|
icon="el-icon-view" |
|
|
|
@click="previewCertificate(scope.row.certificateFiles)" |
|
|
|
style="color: #409EFF;font-size: 20px" |
|
|
|
> |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
<template v-else-if="isPdfFile(scope.row.certificateFiles)"> |
|
|
|
<el-button |
|
|
|
type="text" |
|
|
|
icon="el-icon-download" |
|
|
|
@click="downloadFile(scope.row.certificateFiles)" |
|
|
|
style="color: #287c07;font-size: 20px" |
|
|
|
> |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
<template v-else> |
|
|
|
{{ getImageUrl(scope.row.certificateFiles) }} |
|
|
|
</template> |
|
|
|
</span> |
|
|
|
<span v-else style="color: #909399">-</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="issueDate" label="发证日期" align="center" width="150"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ parseTime(scope.row.issueDate, '{y}-{m}-{d}') }}</span> |
|
|
|
@ -207,87 +72,53 @@ |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="300"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button |
|
|
|
v-if="!detailData.auditStatus || detailData.auditStatus === '0' || detailData.auditStatus === '2'" |
|
|
|
size="mini" |
|
|
|
type="text" |
|
|
|
icon="el-icon-edit" |
|
|
|
style="color: #42B983" |
|
|
|
@click="handleUpdate(scope.row)" |
|
|
|
v-hasPermi="['vet:qualification:edit']" |
|
|
|
class="info-btn alter-btn" |
|
|
|
>修改</el-button> |
|
|
|
<el-button v-if="!detailData.auditStatus || detailData.auditStatus === '0' || detailData.auditStatus === '2'" |
|
|
|
size="mini" type="text" icon="el-icon-edit" style="color: #42B983" @click="handleUpdate(scope.row)" |
|
|
|
v-hasPermi="['vet:qualification:edit']" class="info-btn alter-btn">修改</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
|
|
|
|
<div class="pagestyle"> |
|
|
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" |
|
|
|
@pagination="getList" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button @click="closeDetail">关 闭</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 图片预览弹窗 --> |
|
|
|
<el-dialog :visible.sync="previewDialogVisible" width="80%" append-to-body> |
|
|
|
<div style="text-align: center; padding: 20px;"> |
|
|
|
<img |
|
|
|
:src="getImageUrl(previewFileUrl)" |
|
|
|
style="max-width: 100%; max-height: 70vh; height: auto;" |
|
|
|
preview-teleported |
|
|
|
:preview-src-list="[getImageUrl(previewFileUrl)]" |
|
|
|
/> |
|
|
|
<img :src="getImageUrl(previewFileUrl)" style="max-width: 100%; max-height: 70vh; height: auto;" preview-teleported |
|
|
|
:preview-src-list="[getImageUrl(previewFileUrl)]" /> |
|
|
|
</div> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button @click="closeimage">关 闭</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!-- 添加或修改兽医资质弹窗 --> |
|
|
|
<!-- 添加或修改兽医资质弹窗--> |
|
|
|
<el-dialog :title="title" :visible.sync="open" width="80%" append-to-body> |
|
|
|
<!-- 实名认证提示 --> |
|
|
|
<el-alert |
|
|
|
v-if="authInfo" |
|
|
|
type="success" |
|
|
|
:closable="false" |
|
|
|
show-icon |
|
|
|
style="margin-bottom: 20px;" |
|
|
|
> |
|
|
|
<span>已通过实名认证,姓名和身份证已自动填充并锁定</span> |
|
|
|
</el-alert> |
|
|
|
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
|
|
|
<!-- 真实姓名 - 根据实名认证状态决定是否只读 --> |
|
|
|
<el-form-item label="真实姓名" prop="realName"> |
|
|
|
<el-input |
|
|
|
v-model="form.realName" |
|
|
|
placeholder="请输入真实姓名" |
|
|
|
:readonly="realNameReadOnly" |
|
|
|
:disabled="realNameReadOnly" |
|
|
|
> |
|
|
|
<template v-if="realNameReadOnly" slot="suffix"> |
|
|
|
<el-tooltip content="已通过实名认证" placement="top"> |
|
|
|
<i class="el-icon-success" style="color: #67C23A; line-height: 32px;"></i> |
|
|
|
</el-tooltip> |
|
|
|
</template> |
|
|
|
</el-input> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<!-- 身份证号 - 根据实名认证状态决定是否只读 --> |
|
|
|
<el-form-item label="身份证号" prop="idCard"> |
|
|
|
<el-input |
|
|
|
v-model="form.idCard" |
|
|
|
placeholder="请输入身份证号" |
|
|
|
:readonly="idCardReadOnly" |
|
|
|
:disabled="idCardReadOnly" |
|
|
|
> |
|
|
|
<template v-if="idCardReadOnly" slot="suffix"> |
|
|
|
<el-tooltip content="已通过实名认证" placement="top"> |
|
|
|
<i class="el-icon-success" style="color: #67C23A; line-height: 32px;"></i> |
|
|
|
</el-tooltip> |
|
|
|
</template> |
|
|
|
</el-input> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<!-- <el-form-item label="真实姓名" prop="realName">--> |
|
|
|
<!-- <el-input v-model="form.realName" placeholder="请输入真实姓名" />--> |
|
|
|
<!-- </el-form-item>--> |
|
|
|
<!-- <el-form-item label="身份证号" prop="idCard">--> |
|
|
|
<!-- <el-input v-model="form.idCard" placeholder="请输入身份证号" />--> |
|
|
|
<!-- </el-form-item>--> |
|
|
|
<!-- <el-form-item label="资质类型" prop="qualificationType">--> |
|
|
|
<!-- <el-select--> |
|
|
|
<!-- v-model="form.qualificationType"--> |
|
|
|
<!-- placeholder="请选择资质类型"--> |
|
|
|
<!-- style="width: 100%;"--> |
|
|
|
<!-- >--> |
|
|
|
<!-- <el-option--> |
|
|
|
<!-- v-for="dict in dict.type.qualification_type"--> |
|
|
|
<!-- :key="dict.value"--> |
|
|
|
<!-- :label="dict.label"--> |
|
|
|
<!-- :value="dict.value"--> |
|
|
|
<!-- />--> |
|
|
|
<!-- </el-select>--> |
|
|
|
<!-- </el-form-item>--> |
|
|
|
<el-form-item label="证书编号" prop="certificateNo"> |
|
|
|
<el-input v-model="form.certificateNo" placeholder="请输入证书编号" /> |
|
|
|
</el-form-item> |
|
|
|
@ -298,49 +129,39 @@ |
|
|
|
<el-input v-model="form.issueOrg" placeholder="请输入发证机构" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="发证日期" prop="issueDate"> |
|
|
|
<el-date-picker clearable |
|
|
|
v-model="form.issueDate" |
|
|
|
type="date" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
placeholder="请选择发证日期" |
|
|
|
<el-date-picker clearable v-model="form.issueDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择发证日期" |
|
|
|
style="width: 100%"> |
|
|
|
</el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="到期日期" prop="expireDate"> |
|
|
|
<el-date-picker clearable |
|
|
|
v-model="form.expireDate" |
|
|
|
type="date" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
placeholder="请选择到期日期" |
|
|
|
<el-date-picker clearable v-model="form.expireDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择到期日期" |
|
|
|
style="width: 100%"> |
|
|
|
</el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
<!-- <el-form-item label="证书图片" prop="certImage">--> |
|
|
|
<!-- <image-upload v-model="form.certImage"/>--> |
|
|
|
<!-- </el-form-item>--> |
|
|
|
<el-form-item label="证书文件" prop="certificateFiles"> |
|
|
|
<file-upload |
|
|
|
v-model="form.certificateFiles" |
|
|
|
:limit="1" |
|
|
|
:file-type="['pdf','png','jpg','jpeg']" |
|
|
|
/> |
|
|
|
<!--<!– <el-input v-model="form.certificateFiles" type="textarea" placeholder="请输入内容" />–>--> |
|
|
|
<file-upload v-model="form.certificateFiles" :limit="1" :file-type="['pdf', 'png', 'jpg', 'jpeg']" /> |
|
|
|
</el-form-item> |
|
|
|
<!-- <el-form-item label="提前提醒天数" prop="remindDays">--> |
|
|
|
<!-- <el-input v-model="form.remindDays" placeholder="请输入提前提醒天数" />--> |
|
|
|
<!-- </el-form-item>--> |
|
|
|
<!-- <el-form-item label="备注" prop="remark">--> |
|
|
|
<!-- <el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />--> |
|
|
|
<!-- </el-form-item>--> |
|
|
|
</el-form> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button type="primary" @click="resubmitForm">重新提交审核</el-button> |
|
|
|
<el-button @click="cancel">取 消</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { |
|
|
|
listQualification, |
|
|
|
getQualificationCertificate, |
|
|
|
delQualification, |
|
|
|
getQualificationCertificates, |
|
|
|
updateAndSubmitQualification, |
|
|
|
listQualificationCertificates |
|
|
|
} from "@/api/vet/qualification" |
|
|
|
import { getUserInfo } from "@/api/system/user" |
|
|
|
import { listQualification, getQualificationCertificate, delQualification, getQualificationCertificates, updateAndSubmitQualification, listQualificationCertificates } from "@/api/vet/qualification" |
|
|
|
|
|
|
|
export default { |
|
|
|
name: "Qualification", |
|
|
|
@ -375,16 +196,6 @@ export default { |
|
|
|
open: false, |
|
|
|
openDetail: false, |
|
|
|
previewDialogVisible: false, |
|
|
|
|
|
|
|
// ========== 实名认证相关字段 ========== |
|
|
|
// 实名认证信息 |
|
|
|
authInfo: null, |
|
|
|
// 控制姓名和身份证是否只读 |
|
|
|
realNameReadOnly: false, |
|
|
|
idCardReadOnly: false, |
|
|
|
// 是否已获取过实名信息 |
|
|
|
authInfoFetched: false, |
|
|
|
|
|
|
|
// 查询参数 |
|
|
|
queryParams: { |
|
|
|
pageNum: 1, |
|
|
|
@ -401,8 +212,17 @@ export default { |
|
|
|
}, |
|
|
|
// 表单参数 |
|
|
|
form: {}, |
|
|
|
// 表单校验 - 移除姓名和身份证的必填验证 |
|
|
|
// 表单校验 |
|
|
|
rules: { |
|
|
|
// realName: [ |
|
|
|
// { required: true, message: "真实姓名不能为空", trigger: "blur" } |
|
|
|
// ], |
|
|
|
// idCard: [ |
|
|
|
// { required: true, message: "身份证号不能为空", trigger: "blur" } |
|
|
|
// ], |
|
|
|
// qualificationType: [ |
|
|
|
// { required: true, message: "资质类型不能为空", trigger: "change" } |
|
|
|
// ], |
|
|
|
certificateNo: [ |
|
|
|
{ required: true, message: "证书编号不能为空", trigger: "blur" } |
|
|
|
], |
|
|
|
@ -424,77 +244,16 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
created() { |
|
|
|
this.getList() |
|
|
|
this.getUserAuthInfo() // 获取用户实名信息 |
|
|
|
}, |
|
|
|
|
|
|
|
// ========== 添加 watch 监听弹窗打开状态 ========== |
|
|
|
watch: { |
|
|
|
open(val) { |
|
|
|
if (val) { |
|
|
|
// 弹窗打开时,确保表单有实名信息 |
|
|
|
this.$nextTick(() => { |
|
|
|
this.fillAuthInfoToForm() |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
// ========== 获取用户实名认证信息 ========== |
|
|
|
async getUserAuthInfo() { |
|
|
|
if (this.authInfoFetched) return // 如果已获取过,不再重复获取 |
|
|
|
|
|
|
|
try { |
|
|
|
const res = await getUserInfo() |
|
|
|
|
|
|
|
if (res.code === 200) { |
|
|
|
const userInfo = res.data |
|
|
|
|
|
|
|
// 如果已实名认证,保存信息 |
|
|
|
if (userInfo.authStatus === '已认证' && userInfo.authInfo) { |
|
|
|
this.authInfo = userInfo.authInfo |
|
|
|
this.realNameReadOnly = true |
|
|
|
this.idCardReadOnly = true |
|
|
|
this.authInfoFetched = true |
|
|
|
|
|
|
|
console.log('已获取实名认证信息:', this.authInfo) |
|
|
|
|
|
|
|
// 如果当前弹窗是打开的,立即填充 |
|
|
|
if (this.open) { |
|
|
|
this.fillAuthInfoToForm() |
|
|
|
} |
|
|
|
} else if (userInfo.authStatus === '未认证') { |
|
|
|
console.log('用户未完成实名认证') |
|
|
|
this.authInfoFetched = true |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
console.error('获取用户实名信息失败:', error) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// ========== 填充实名信息到表单 ========== |
|
|
|
fillAuthInfoToForm() { |
|
|
|
if (this.authInfo) { |
|
|
|
// 使用 Vue.set 或直接赋值,确保响应式 |
|
|
|
this.$set(this.form, 'realName', this.authInfo.realName) |
|
|
|
this.$set(this.form, 'idCard', this.authInfo.idCard) |
|
|
|
|
|
|
|
// 如果身份证是脱敏的,可能需要原始值,这里用脱敏的也可以 |
|
|
|
// 如果后端返回的是完整身份证,直接用 this.authInfo.idCard |
|
|
|
|
|
|
|
console.log('已填充实名信息到表单:', this.form.realName, this.form.idCard) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 查询兽医资质列表 |
|
|
|
getList() { |
|
|
|
this.loading = true |
|
|
|
listQualification(this.queryParams).then(response => { |
|
|
|
this.qualificationList = response.rows |
|
|
|
this.qualificationList = response.rows[0].certificates |
|
|
|
console.log(2222, this.qualificationList); |
|
|
|
this.total = response.total |
|
|
|
this.loading = false |
|
|
|
}) |
|
|
|
@ -523,10 +282,10 @@ export default { |
|
|
|
// 获取审核状态标签类型 |
|
|
|
getAuditStatusType(status) { |
|
|
|
const map = { |
|
|
|
'0': 'info', |
|
|
|
'1': 'success', |
|
|
|
'2': 'danger', |
|
|
|
'3': 'warning' |
|
|
|
'0': 'info', // 待审核 - 蓝色 |
|
|
|
'1': 'success', // 已上架 - 绿色 |
|
|
|
'2': 'danger', // 已拒绝 - 红色 |
|
|
|
'3': 'warning' // 已下架 - 黄色 |
|
|
|
} |
|
|
|
return map[status] || 'info' |
|
|
|
}, |
|
|
|
@ -550,7 +309,7 @@ export default { |
|
|
|
// 判断是否为图片文件 |
|
|
|
isImageFile(filePath) { |
|
|
|
if (!filePath) return false; |
|
|
|
const imageExts = ['.png','.jpg','.jpeg']; |
|
|
|
const imageExts = ['.png', '.jpg', '.jpeg']; |
|
|
|
const ext = filePath.substring(filePath.lastIndexOf('.')).toLowerCase(); |
|
|
|
return imageExts.includes(ext); |
|
|
|
}, |
|
|
|
@ -573,14 +332,108 @@ export default { |
|
|
|
const fullUrl = this.getImageUrl(filePath); |
|
|
|
const link = document.createElement('a'); |
|
|
|
link.href = fullUrl; |
|
|
|
|
|
|
|
const fileName = filePath.substring(filePath.lastIndexOf('/') + 1); |
|
|
|
link.download = fileName; |
|
|
|
|
|
|
|
document.body.appendChild(link); |
|
|
|
link.click(); |
|
|
|
document.body.removeChild(link); |
|
|
|
this.$modal.msgSuccess('开始下载文件'); |
|
|
|
}, |
|
|
|
|
|
|
|
/** 下架操作 */ |
|
|
|
// 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(() => { |
|
|
|
// // 准备提交数据 |
|
|
|
// const submitData = { |
|
|
|
// qualificationId: row.qualificationId, |
|
|
|
// realName: row.realName, |
|
|
|
// idCard: row.idCard, |
|
|
|
// qualificationType: row.qualificationType, |
|
|
|
// certificateNo: row.certificateNo, |
|
|
|
// certName: row.certName, |
|
|
|
// issueOrg: row.issueOrg, |
|
|
|
// issueDate: row.issueDate, |
|
|
|
// expireDate: row.expireDate, |
|
|
|
// certImage: row.certImage, |
|
|
|
// certificateFiles: row.certificateFiles, |
|
|
|
// remark: row.remark, |
|
|
|
// // 提交审核时设置审核状态为待审核(0) |
|
|
|
// auditStatus: '0' |
|
|
|
// } |
|
|
|
// |
|
|
|
// return submitQualification(submitData) |
|
|
|
// }).then(response => { |
|
|
|
// if (response.code === 200) { |
|
|
|
// this.$modal.msgSuccess("提交审核成功") |
|
|
|
// this.getList() |
|
|
|
// } else { |
|
|
|
// this.$modal.msgError(response.msg || "提交审核失败") |
|
|
|
// } |
|
|
|
// }).catch(() => { |
|
|
|
// }) |
|
|
|
// }, |
|
|
|
|
|
|
|
// 重新提交审核 |
|
|
|
resubmitForm() { |
|
|
|
this.$refs["form"].validate(valid => { |
|
|
|
@ -598,8 +451,8 @@ export default { |
|
|
|
const submitData = { |
|
|
|
certId: certId, |
|
|
|
qualificationId: this.form.qualificationId, |
|
|
|
realName: this.form.realName || (this.authInfo ? this.authInfo.realName : null), |
|
|
|
idCard: this.form.idCard || (this.authInfo ? this.authInfo.idCard : null), |
|
|
|
realName: this.form.realName, |
|
|
|
idCard: this.form.idCard, |
|
|
|
qualificationType: this.form.qualificationType, |
|
|
|
certificateNo: this.form.certificateNo, |
|
|
|
certName: this.form.certName, |
|
|
|
@ -652,8 +505,66 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
/** 查看详情 */ |
|
|
|
// handleView(row) { |
|
|
|
// // 构建详情内容 |
|
|
|
// 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: '550px', |
|
|
|
// customClass: 'qualification-detail-dialog' |
|
|
|
// }) |
|
|
|
// }, |
|
|
|
|
|
|
|
// 资质证书详情 |
|
|
|
handleView(row) { |
|
|
|
console.log(1111, row); |
|
|
|
this.openDetail = true |
|
|
|
this.detailData = row |
|
|
|
this.title = "资质证书详情" |
|
|
|
@ -674,22 +585,18 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
// 关闭按钮 |
|
|
|
closeDetail(){ |
|
|
|
closeDetail() { |
|
|
|
this.openDetail = false |
|
|
|
this.reset() |
|
|
|
}, |
|
|
|
|
|
|
|
// closeimage |
|
|
|
closeimage(){ |
|
|
|
closeimage() { |
|
|
|
this.previewDialogVisible = false |
|
|
|
}, |
|
|
|
|
|
|
|
// ========== 修改 reset 方法,保留实名信息 ========== |
|
|
|
// 表单重置 |
|
|
|
reset() { |
|
|
|
// 保存当前的实名信息 |
|
|
|
const currentRealName = this.form?.realName |
|
|
|
const currentIdCard = this.form?.idCard |
|
|
|
|
|
|
|
this.form = { |
|
|
|
qualificationId: null, |
|
|
|
userId: null, |
|
|
|
@ -716,15 +623,7 @@ export default { |
|
|
|
scopeIds: null, |
|
|
|
scopeNames: null |
|
|
|
} |
|
|
|
|
|
|
|
this.resetForm("form") |
|
|
|
|
|
|
|
// 重置后如果有实名信息,重新填充 |
|
|
|
if (this.authInfo) { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.fillAuthInfoToForm() |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 搜索按钮操作 |
|
|
|
@ -746,30 +645,16 @@ export default { |
|
|
|
this.multiple = !selection.length |
|
|
|
}, |
|
|
|
|
|
|
|
// ========== 修改 handleAdd 方法 ========== |
|
|
|
async handleAdd() { |
|
|
|
// 新增按钮操作 |
|
|
|
handleAdd() { |
|
|
|
this.reset() |
|
|
|
this.open = true |
|
|
|
this.title = "添加兽医资质" |
|
|
|
this.form.auditStatus = null |
|
|
|
|
|
|
|
// 如果还没有实名信息,等待获取 |
|
|
|
if (!this.authInfoFetched) { |
|
|
|
await this.getUserAuthInfo() |
|
|
|
} |
|
|
|
|
|
|
|
// 填充实名信息 |
|
|
|
this.fillAuthInfoToForm() |
|
|
|
|
|
|
|
if (this.authInfo) { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$message.success('已自动填充实名信息') |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// ========== 修改 handleUpdate 方法 ========== |
|
|
|
async handleUpdate(row) { |
|
|
|
// 修改按钮操作 |
|
|
|
handleUpdate(row) { |
|
|
|
this.reset() |
|
|
|
let certId = row.certId || row.certificateId || row.id |
|
|
|
if (certId && typeof certId === 'object') { |
|
|
|
@ -782,41 +667,60 @@ export default { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
try { |
|
|
|
const response = await getQualificationCertificate(certId) |
|
|
|
getQualificationCertificate(certId).then(response => { |
|
|
|
if (response.code === 200 && response.data) { |
|
|
|
this.form = response.data |
|
|
|
|
|
|
|
// 如果还没有实名信息,等待获取 |
|
|
|
if (!this.authInfoFetched) { |
|
|
|
await this.getUserAuthInfo() |
|
|
|
} |
|
|
|
|
|
|
|
// 填充实名信息 |
|
|
|
this.fillAuthInfoToForm() |
|
|
|
|
|
|
|
this.open = true |
|
|
|
this.title = "修改兽医资质证书信息" |
|
|
|
} else { |
|
|
|
this.$modal.msgError(response.msg || "获取证书信息失败") |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
}).catch(error => { |
|
|
|
console.error('获取证书信息失败:', error) |
|
|
|
this.$modal.msgError("获取证书信息失败") |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
/** 提交按钮 */ |
|
|
|
// submitForm() { |
|
|
|
// this.$refs["form"].validate(valid => { |
|
|
|
// if (valid) { |
|
|
|
// if (this.form.qualificationId != null) { |
|
|
|
// updateQualification(this.form).then(response => { |
|
|
|
// this.$modal.msgSuccess("修改成功") |
|
|
|
// this.open = false |
|
|
|
// this.getList() |
|
|
|
// }) |
|
|
|
// } else { |
|
|
|
// this.form.auditStatus = null |
|
|
|
// addQualification(this.form).then(response => { |
|
|
|
// this.$modal.msgSuccess("新增成功") |
|
|
|
// this.open = false |
|
|
|
// this.getList() |
|
|
|
// }) |
|
|
|
// } |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// }, |
|
|
|
|
|
|
|
// 删除按钮操作 |
|
|
|
handleDelete(row) { |
|
|
|
const qualificationIds = row.qualificationId || this.ids |
|
|
|
this.$modal.confirm('是否确认删除兽医资质编号为"' + qualificationIds + '"的数据项?').then(function() { |
|
|
|
this.$modal.confirm('是否确认删除兽医资质编号为"' + qualificationIds + '"的数据项?').then(function () { |
|
|
|
return delQualification(qualificationIds) |
|
|
|
}).then(() => { |
|
|
|
this.getList() |
|
|
|
this.$modal.msgSuccess("删除成功") |
|
|
|
}).catch(() => {}) |
|
|
|
}).catch(() => { }) |
|
|
|
}, |
|
|
|
|
|
|
|
// 导出按钮操作 |
|
|
|
// handleExport() { |
|
|
|
// this.download('vet/qualification/export', { |
|
|
|
// ...this.queryParams |
|
|
|
// }, `qualification_${new Date().getTime()}.xlsx`) |
|
|
|
// }, |
|
|
|
|
|
|
|
// 根据字典值获取标签 |
|
|
|
getDictLabel(dictType, value) { |
|
|
|
const dict = this.dict.type[dictType] |
|
|
|
@ -843,43 +747,16 @@ export default { |
|
|
|
margin: 2px; |
|
|
|
} |
|
|
|
|
|
|
|
::v-deep .pagestyle .el-input{ |
|
|
|
width: auto !important; |
|
|
|
} |
|
|
|
::v-deep .pageway .el-input{ |
|
|
|
::v-deep .pagestyle .el-input { |
|
|
|
width: auto !important; |
|
|
|
} |
|
|
|
::v-deep .pageway .pagination-container{ |
|
|
|
background-color: #f8fafc; |
|
|
|
} |
|
|
|
|
|
|
|
/* 实名信息卡片样式 */ |
|
|
|
.auth-info-card { |
|
|
|
border-radius: 8px; |
|
|
|
border-left: 4px solid #67C23A; |
|
|
|
} |
|
|
|
|
|
|
|
.auth-info-card .el-card__header { |
|
|
|
background-color: #f0f9eb; |
|
|
|
border-bottom: 1px solid #e1f3d8; |
|
|
|
padding: 12px 20px; |
|
|
|
font-weight: 600; |
|
|
|
color: #67C23A; |
|
|
|
} |
|
|
|
|
|
|
|
.auth-info-content { |
|
|
|
padding: 12px 0; |
|
|
|
} |
|
|
|
|
|
|
|
.auth-label { |
|
|
|
color: #606266; |
|
|
|
font-size: 14px; |
|
|
|
::v-deep .pageway .el-input { |
|
|
|
width: auto !important; |
|
|
|
} |
|
|
|
|
|
|
|
.auth-value { |
|
|
|
color: #303133; |
|
|
|
font-weight: 500; |
|
|
|
font-size: 14px; |
|
|
|
::v-deep .pageway .pagination-container { |
|
|
|
background-color: #f8fafc; |
|
|
|
} |
|
|
|
|
|
|
|
/* 详情对话框样式 */ |
|
|
|
@ -911,7 +788,7 @@ export default { |
|
|
|
transform: translateY(-1px); |
|
|
|
} |
|
|
|
|
|
|
|
.alter-btn:hover{ |
|
|
|
.alter-btn:hover { |
|
|
|
background-color: rgb(230, 255, 238); |
|
|
|
transform: translateY(-1px); |
|
|
|
} |
|
|
|
|