bonus-Certificate-ui/src/views/certificate/certificateManage/certificateInfo/index.vue

1122 lines
47 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div class="app-container">
<!-- <el-row style="margin-bottom: 10px;">
<el-col :span="6">
<div class="top-view">
<div class="flex-between" style="width: 80%;margin: 6px auto;">
<span>应备案人员</span><span>共计{{statistics.registerNum}}</span>
</div>
<div class="flex-between" style="width: 80%;margin: 6px auto;">
<span>有证 {{statistics.ownNum}}</span><span>无证 {{statistics.unOwnNum}}</span>
</div>
<div class="flex-between" style="width: 80%;margin: 6px auto;">
<span>已存入 {{statistics.storeNum}}</span><span>未存入 {{statistics.unStoreNum}}</span>
</div>
</div>
</el-col>
<el-col :span="6">
<div class="top-view">
<div class="flex-between" style="width: 80%;margin: 6px auto;">
<span>普通护照</span><span>共计 {{statistics.passPortNum}} </span>
</div>
<div class="flex-between" style="width: 80%;margin: 6px auto;">
<span>已借出 {{statistics.outPassPortNum}}</span><span>待入库 {{statistics.inPassPortNum}}</span>
</div>
</div>
</el-col>
<el-col :span="6">
<div class="top-view">
<div class="flex-between" style="width: 80%;margin: 6px auto;">
<span>港澳通行证</span><span>共计 {{statistics.hMCardNum}} </span>
</div>
<div class="flex-between" style="width: 80%;margin: 6px auto;">
<span>已借出 {{statistics.outHMCardNum}}</span><span>待入库 {{statistics.inHMCardNum}}</span>
</div>
</div>
</el-col>
<el-col :span="6">
<div class="top-view">
<div class="flex-between" style="width: 80%;margin: 6px auto;">
<span>台湾通行证</span><span>共计 {{statistics.taiwanNum}} </span>
</div>
<div class="flex-between" style="width: 80%;margin: 6px auto;">
<span>已借出 {{statistics.outTaiwanNum}}</span><span>待入库 {{statistics.inTaiwanNum}}</span>
</div>
</div>
</el-col>
</el-row> -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="身份证号" prop="idNumber">
<el-input
v-model="queryParams.idNumber"
placeholder="请输入身份证号"
clearable maxlength="20"
style="width: 300px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="姓名" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入姓名"
clearable maxlength="20"
style="width: 300px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="证件编号" prop="certificateNo">
<el-input
v-model="queryParams.certificateNo"
placeholder="请输入证件编号"
clearable maxlength="20"
style="width: 300px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
size="mini"
@click="handleDelete"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button>
</el-col>
<el-col :span="1.5">
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url"
:show-file-list="false"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:before-upload="beforeUpload"
>
<el-button
type="success"
size="mini"
>导入
</el-button>
</el-upload>
</el-col>
<el-col :span="1.5">
<el-button
size="mini"
@click="importTemplate"
>模板下载
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleTask"
>一人多证核验</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="tableListData" @selection-change="handleSelectionChange" height="800">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column label="序号" align="center" width="80" type="index">
<template slot-scope="scope">
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column label="姓名" align="center" prop="name" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="身份证号" align="center" prop="idNumber" :show-overflow-tooltip="true" width="180"/>
<!-- <el-table-column label="部门" align="center" prop="deptFullName" :show-overflow-tooltip="true" width="250"/>
<el-table-column label="出生日期" align="center" width="120" prop="birthday" :show-overflow-tooltip="true"/>
<el-table-column label="出生地点" align="center" prop="birthAddr" :show-overflow-tooltip="true"/> -->
<el-table-column label="证件类型" align="center" prop="certificateTypeName" :show-overflow-tooltip="true"/>
<el-table-column label="证件编号" align="center" prop="certificateNo" :show-overflow-tooltip="true" width="180">
<template slot-scope="scope">
<span style="color: #1890ff;cursor: pointer;" @click="openLog(scope.row)">{{scope.row.certificateNo}}</span>
</template>
</el-table-column>
<el-table-column label="签发地" align="center" prop="issueAddr" :show-overflow-tooltip="true"/>
<el-table-column label="签发日期" align="center" width="120" prop="issueDay" :show-overflow-tooltip="true"/>
<el-table-column label="有效期至" align="center" width="120" prop="issueLifespan" :show-overflow-tooltip="true"/>
<el-table-column label="设备名称" align="center" prop="deviceName" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{scope.row.deviceName || "/"}}</span>
</template>
</el-table-column>
<el-table-column label="设备地点" align="center" prop="deviceAddr" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{scope.row.deviceAddr || "/"}}</span>
</template>
</el-table-column>
<el-table-column label="槽位编号" align="center" prop="slotNo" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{scope.row.slotNo || "/"}}</span>
</template>
</el-table-column>
<el-table-column label="当前状态" align="center" prop="stateName" :show-overflow-tooltip="true">
<template slot-scope="scope">
<!-- <dict-tag :options="dict.type.dev_status" :value="scope.row.deviceState"/> -->
<span v-if="scope.row.state==0" style="color: #FF7322;font-size: 15px;">{{scope.row.stateName}}</span>
<span v-if="scope.row.state==1" style="color: #FEE838;font-size: 15px;">{{scope.row.stateName}}</span>
<span v-if="scope.row.state==2" style="color: #03DF6D;font-size: 15px;">{{scope.row.stateName}}</span>
<span v-if="scope.row.state==3" style="color: #FEE838;font-size: 15px;">{{scope.row.stateName}}</span>
<span v-if="scope.row.state==4" style="color: #FF7322;font-size: 15px;">{{scope.row.stateName}}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button v-if="scope.row.state==0||scope.row.state==4"
size="mini"
type="text"
@click="handleUpdate(scope.row)"
>编辑</el-button>
<el-button v-if="scope.row.state==0||scope.row.state==4"
size="mini"
type="text"
style="color: red;"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改参数配置对话框 -->
<el-dialog :title="title+''" :visible.sync="open" width="800px" append-to-body>
<el-form ref="baseForm" :model="baseForm" :rules="baseFormRules" label-width="80px">
<el-row>
<el-col :span="12">
<el-form-item label="姓名" prop="name">
<el-input style="background-color;:#E7EAEE" v-model="baseForm.name" disabled placeholder="请选择" maxlength="30" clearable/>
</el-form-item>
</el-col>
<el-col el-col :span="12" v-if="baseForm.deptId !== 0&&!isUpdate">
<el-form-item label="">
<el-button
type="success"
size="mini"
@click="handleSelect()"
>选择人员
</el-button>
</el-form-item>
</el-col>
<el-col :span="12" v-if="baseForm.deptId !== 0">
<el-form-item label="单位" prop="deptId" style="width: 100%;" disabled="true">
<treeselect
v-model="baseForm.deptId"
:options="deptOptions"
:disabled="true"
:normalizer="normalizer"
placeholder="选择单位"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="手机号码" prop="phone">
<el-input style="background-color:#E7EAEE" disabled v-model="baseForm.phone" placeholder="请输入" maxlength="30" readonly="true" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="身份证号" prop="idNumber">
<el-input style="background-color:#E7EAEE" disabled v-model="baseForm.idNumber" placeholder="请输入" maxlength="30" readonly="true"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="出生日期" prop="birthday">
<el-date-picker disabled
v-model="baseForm.birthday"
type="date"
placeholder="选择日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="出生地点" prop="birthAddr">
<el-input v-model="baseForm.birthAddr" placeholder="请输入" maxlength="30" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="证件类型" prop="certificateType">
<el-select v-model="baseForm.certificateType" placeholder="证件类型" clearable>
<el-option
v-for="dict in dict.type.sys_certificate_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="证件编号" prop="certificateNo">
<el-input v-model="baseForm.certificateNo" placeholder="请输入" maxlength="30" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="签发地" prop="issueAddr">
<el-input v-model="baseForm.issueAddr" placeholder="请输入" maxlength="30" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="签发日期" prop="issueDay">
<el-date-picker
v-model="baseForm.issueDay"
type="date"
placeholder="选择日期"
:picker-options="pickerOptionsIssueLifespan"
@focus="issueDayDateFocus"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="有效期至" prop="issueLifespan">
<el-date-picker
v-model="baseForm.issueLifespan"
type="date"
placeholder="选择日期"
:picker-options="pickerOptionsIssueDay"
@focus="issueLifespanDateFocus"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label-width="120px" label="是否电子标签" prop="isEle">
<el-radio-group v-model="baseForm.isEle" size="small">
<el-radio label="1">是</el-radio>
<el-radio label="0">否</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item v-if="isCreateFlage" label-width="120px" label="是否创建账号" prop="isCreate">
<el-radio-group v-model="baseForm.isCreate" size="small">
<el-radio @change="handleRadioChange('1')" label="1">是</el-radio>
<el-radio @change="handleRadioChange('0')" label="0">否</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="userNameFlage" label="用户名" prop="userName">
<el-input v-model="baseForm.userName" placeholder="请输入" maxlength="30" clearable/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<!-- 选择人员 -->
<el-dialog title="选择系统人员" :visible.sync="openSelectUser" width="600px" append-to-body>
<el-form ref="baseForm2" :model="baseForm2" :rules="baseFormRules" label-width="100px">
<el-row>
<el-col :span="24">
<el-form-item label="姓名" prop="userId">
<el-select
v-model="baseForm2.userId"
placeholder="请选择"
filterable
clearable
style="width: 100%"
>
<el-option
v-for="item in allUserList"
:key="item.userId"
:label="item.userName"
:value="item.userId"
@click.native="getCorpAndDept(item)"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="手机号码" prop="phone">
<el-input style="width: 100%;background-color:#DAE1EE;" v-model="baseForm2.phone" readonly="true" maxlength="30" clearable/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm2">确 定</el-button>
<el-button @click="cancel2">取 消</el-button>
</div>
</el-dialog>
<!-- 核验任务下达 -->
<el-dialog title="核验任务下达" :visible.sync="openTask" width="600px" append-to-body>
<el-form ref="taskForm" :model="taskForm" :rules="taskRules" label-width="120px">
<el-row>
<el-col :span="24">
<el-form-item label="核验开始日期" prop="startTime">
<el-date-picker
v-model="taskForm.startTime"
type="date"
placeholder="选择日期"
format="yyyy-MM-dd" style="width: 100%;"
:picker-options="pickerOptionsToday"
@focus="startDateFocus"
value-format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
<el-form-item label="核验结束日期" prop="endTime">
<el-date-picker
v-model="taskForm.endTime"
type="date"
placeholder="选择日期"
:picker-options="pickerOptionsStart"
@focus="endDateFocus"
format="yyyy-MM-dd" style="width: 100%;"
value-format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitTask">确 定</el-button>
<el-button @click="cancelTask">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listDept,
getDept,
delDept,
addDept,
updateDept,
listDeptExcludeChild,
} from '@/api/system/dept'
import { getCertificateInfoListPageApi,addCertificateInfoApi, updateCertificateInfoApi,
deleteCertificateInfoApi,getSysUserListApi,addCertificateCheckApi } from "@/api/certificateManage/index";
import { getStatisticsApi } from "@/api/certificateStatistics/index";
import base64 from 'base-64';
import { getToken } from '@/utils/auth'
import { downloadFileByUrl } from '@/utils/download'
import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default {
name: "certificateInfo",
dicts: ["sys_certificate_type"],
components: { Treeselect },
data() {
return {
isUpdate:false,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
//表格数据
tableListData: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
checked: false,
isCreateFlage:false,
userNameFlage:false,
certificateNos:[],
userIds:[],
isReadOnly:false,
openSelectUser:false,
selectItme:{},
allUserList:[],
// 部门树选项
deptOptions: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
idNumber:null,//身份证号
name:null,//姓名
certificateNo:null,//证件编号
},
activeName:"baseSetting",
deviceData:{},
statistics:{
registerNum:0,
ownNum:0,
unOwnNum:0,
storeNum:0,
unStoreNum:0,
passPortNum:0,
outPassPortNum:0,
inPassPortNum:0,
hMCardNum:0,
outHMCardNum:0,
inHMCardNum:0,
taiwanNum:0,
outTaiwanNum:0,
inTaiwanNum:0,
},
// 表单参数
baseForm: {
deptId:null,
name:"",
idNumber:"",
birthday:"",
birthAddr:"",
certificateType:"",
certificateTypeName:"",
certificateNo:"",
issueAddr:"",
issueDay:"",
issueLifespan:"0",
createTime:"",
phone:"",
userId:"",
isEle:""
},
baseForm2: {
userId:"",
phone:""
},
// 表单校验
baseFormRules: {
deptId: [
{ required: true, message: "部门不能为空", trigger: "blur" }
],
name: [
{ required: true, message: "姓名不能为空", trigger: "blur" }
],
idNumber: [
{ required: true, message: "身份证不能为空", trigger: "blur" },
{ validator: this.validateIDCard, trigger: 'blur' }
],
certificateType: [
{ required: true, message: "证件类型不能为空", trigger: "blur" }
],
certificateNo: [
{ required: true, message: "证件编号不能为空", trigger: "blur" }
],
issueDay: [
{ required: true, message: "签发日期不能为空", trigger: "blur" }
],
phone: [
{ required: true, message: "手机号码不能为空", trigger: "blur" },
{ pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号', trigger: 'blur' }
],
issueLifespan: [
{ required: true, message: "有效期不能为空", trigger: "blur" }
]
},
logTableData:[],//异常弹窗
// 总条数
dialogTotal: 0,
//当前菜谱
openMenu:false,
//导入参数
upload: {
// 是否禁用上传
isUploading: false,
// 设置上传的请求头部
headers: { Authorization: 'Bearer ' + getToken() },
// 上传的地址
url: process.env.VUE_APP_BASE_API + '/certificate/certificate_manage/certificateInfo/import',
},
//远程校验弹窗
openTask: false,
// 表单参数
taskForm: {
startTime:"",
endTime:"",
processDate:""
},
// 表单校验
taskRules: {
startTime: [
{
required: true,
message: '核验开始日期不能为空',
trigger: 'blur',
},
],
endTime: [
{
required: true,
message: '核验截止日期不能为空',
trigger: 'blur',
},
]
},
pickerOptionsToday: {
disabledDate(time) {
const today = new Date();
today.setHours(0, 0, 0, 0); // 设置时间为00:00:00确保比较时只比较日期部分
// 比较日期,禁用今天之前的日期
return time.getTime() < today.getTime();
}
},
pickerOptionsStart: {
disabledDate(time) {
// 获取今天的日期
const startTime=this.taskForm.startTime;
const today = new Date(startTime);
today.setHours(0, 0, 0, 0); // 设置时间为00:00:00确保比较时只比较日期部分
// 比较日期,禁用今天之前的日期
return time.getTime() < today.getTime();
}
},
pickerOptionsIssueLifespan: {
disabledDate(time) {
// 获取开始的日期
const startTime=this.baseForm.issueLifespan;
if (!startTime){
return true;
}else{
const today = new Date(startTime);
today.setHours(0, 0, 0, 0); // 设置时间为00:00:00确保比较时只比较日期部分
// 比较日期,禁用今天之前的日期
return time.getTime() > today.getTime();
}
},
},
pickerOptionsIssueDay:{
disabledDate(time) {
// 获取今天的日期
const startTime=this.baseForm.issueDay;
const today = new Date(startTime);
today.setHours(0, 0, 0, 0); // 设置时间为00:00:00确保比较时只比较日期部分
// 比较日期,禁用今天之前的日期
return time.getTime() < today.getTime();
}
},
};
},
mounted(){
this.getList();
this.initStatistics();
},
methods: {
validateIDCard(rule, value, callback) {
// 15位身份证正则表达式
const reg15 = /^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$/;
// 18位身份证正则表达式
const reg18 = /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}(\d|X|x)$/;
if (reg15.test(value) || reg18.test(value)) {
callback(); // 验证通过,无错误信息提示
} else {
callback(new Error('请输入有效的身份证号')); // 验证失败,显示错误信息提示
}
},
startDateFocus() {
this.taskForm.endTime = ''
let endTime = this.taskForm.endTime;
if (!endTime) return;
let that = this;
that.pickerOptionsToday = {
disabledDate(time) {
// 获取今天的日期
const today = new Date();
today.setHours(0, 0, 0, 0); // 设置时间为00:00:00确保比较时只比较日期部分
// 比较日期,禁用今天之前的日期
return time.getTime() < today.getTime();
},
};
},
endDateFocus() {
let startTime = this.taskForm.startTime;
if (!startTime) return;
let that = this;
that.pickerOptionsStart = {
disabledDate(time) {
// 获取开始的日期
const startTime=that.taskForm.startTime;
const today = new Date(startTime);
today.setHours(0, 0, 0, 0); // 设置时间为00:00:00确保比较时只比较日期部分
// 比较日期,禁用开始之前的日期
return time.getTime() < today.getTime();
},
};
},
issueLifespanDateFocus() {
let startTime = this.baseForm.issueDay;
if (!startTime) return;
let that = this;
that.pickerOptionsIssueDay = {
disabledDate(time) {
// 获取开始的日期
const startTime=that.baseForm.issueDay;
const today = new Date(startTime);
today.setHours(0, 0, 0, 0); // 设置时间为00:00:00确保比较时只比较日期部分
// 比较日期,禁用开始之前的日期
return time.getTime() < today.getTime();
},
};
},
issueDayDateFocus(){
let startTime = this.baseForm.issueLifespan;
let that = this;
that.pickerOptionsIssueLifespan = {
disabledDate(time) {
// 获取开始的日期
const startTime=that.baseForm.issueLifespan;
const today = new Date(startTime);
today.setHours(0, 0, 0, 0); // 设置时间为00:00:00确保比较时只比较日期部分
// 比较日期,禁用开始之前的日期
return time.getTime() > today.getTime();
},
};
},
handleRadioChange(val){
if(val==1){
this.userNameFlage=true;
this.baseFormRules= {
deptId: [
{ required: true, message: "部门不能为空", trigger: "blur" }
],
name: [
{ required: true, message: "姓名不能为空", trigger: "blur" }
],
idNumber: [
{ required: true, message: "身份证不能为空", trigger: "blur" },
{ validator: this.validateIDCard, trigger: 'blur' }
],
certificateType: [
{ required: true, message: "证件类型不能为空", trigger: "blur" }
],
certificateNo: [
{ required: true, message: "证件编号不能为空", trigger: "blur" }
],
issueDay: [
{ required: true, message: "签发日期不能为空", trigger: "blur" }
],
phone: [
{ required: true, message: "手机号码不能为空", trigger: "blur" },
{ pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号', trigger: 'blur' }
],
issueLifespan: [
{ required: true, message: "有效期不能为空", trigger: "blur" }
],
userName: [
{ required: true, message: "用户名不能为空", trigger: "blur" }
]
}
}else{
this.userNameFlage=false;
this.baseFormRules= {
deptId: [
{ required: true, message: "部门不能为空", trigger: "blur" }
],
name: [
{ required: true, message: "姓名不能为空", trigger: "blur" }
],
idNumber: [
{ required: true, message: "身份证不能为空", trigger: "blur" },
{ validator: this.validateIDCard, trigger: 'blur' }
],
certificateType: [
{ required: true, message: "证件类型不能为空", trigger: "blur" }
],
certificateNo: [
{ required: true, message: "证件编号不能为空", trigger: "blur" }
],
issueDay: [
{ required: true, message: "签发日期不能为空", trigger: "blur" }
],
phone: [
{ required: true, message: "手机号码不能为空", trigger: "blur" },
{ pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号', trigger: 'blur' }
],
issueLifespan: [
{ required: true, message: "有效期不能为空", trigger: "blur" }
]
}
}
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
initStatistics(){
let param = {}
getStatisticsApi(param).then(response => {
console.log("getStatisticsApi",response)
if(response.code==200){
this.statistics =response.data;
console.log("this.statistics",this.statistics)
}
});
},
/** 查询列表 */
getList() {
this.loading = true;
let param = {
"pageNum":this.queryParams.pageNum,
"pageSize":this.queryParams.pageSize,
"idNumber":this.queryParams.idNumber,
"name":this.queryParams.name,
"certificateNo":this.queryParams.certificateNo
}
console.log("param",param)
// let str = base64.encode(JSON.stringify(param))
// console.log({"content":str})
getCertificateInfoListPageApi(param).then(response => {
this.tableListData = response.rows;
this.total = Number(response.total);
this.loading = false;
});
},
// 表单重置
reset() {
this.baseForm = {
deptId:null,
name:"",
idNumber:"",
birthday:"",
birthAddr:"",
certificateType:"",
certificateTypeName:"",
certificateNo:"",
issueAddr:"",
issueDay:"",
issueLifespan:"",
isEle:"0",isCreate:"0"
};
this.resetForm("baseForm");
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.isUpdate=false;
this.isReadOnly=false;
this.title = "新增";
listDept().then((response) => {
this.deptOptions = this.handleTree(response.data, 'deptId')
})
console.log("this.baseForm",this.baseForm);
},
/** 电子标签*/
handleCheckedOne(value, type) {
console.log(type,value)
},
handleCheckedTwo(value, type) {
console.log(type,value)
},
/** 转换部门数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children
}
return {
id: node.deptId,
label: node.deptName,
children: node.children,
}
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.open = true;
this.isUpdate=true;
this.isReadOnly=true;
this.baseForm = Object.assign({}, row)
listDept().then((response) => {
this.deptOptions = this.handleTree(response.data, 'deptId')
})
this.title = "修改";
this.pickerOptionsIssueDay={
disabledDate(time) {
// 获取今天的日期
const startTime=this.baseForm.issueDay;
const today = new Date(startTime);
today.setHours(0, 0, 0, 0); // 设置时间为00:00:00确保比较时只比较日期部分
// 比较日期,禁用今天之前的日期
return time.getTime() < today.getTime();
}
}
},
handleTabClick(tab, event) {
console.log(tab, event);
},
/** 提交按钮 */
submitForm: function() {
console.log("this.baseForm",this.baseForm);
this.$refs["baseForm"].validate(valid => {
if (valid) {
if (this.baseForm.certificateId != undefined&&this.baseForm.certificateId != null) {
updateCertificateInfoApi(this.baseForm).then(response => {
if(response.code==200){
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}else{
this.$modal.msgError(response.msg);
}
});
} else {
addCertificateInfoApi(this.baseForm).then(response => {
if(response.code==200){
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}else{
this.$modal.msgError(response.msg);
}
});
}
}
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
handleSelect(){
this.openSelectUser = true;
getSysUserListApi({}).then(response => {
console.log("response",response);
this.allUserList=response;
this.$set(this.baseForm2,"userId",this.baseForm.userId)
this.$set(this.baseForm2,"phone",this.baseForm.phone)
});
},
getCorpAndDept(val){
console.log("getCorpAndDept",val)
this.selectItme=val;
this.$set(this.baseForm2,"phone",this.selectItme.phone)
this.$set(this.baseForm2,"userId",this.selectItme.userId)
},
/** 提交按钮 */
submitForm2: function() {
console.log("this.baseForm2",this.baseForm2);
this.$refs["baseForm2"].validate(valid => {
if (valid) {
this.$set(this.baseForm,"birthday",this.selectItme.birthday)
this.$set(this.baseForm,"idNumber",this.selectItme.idNumber)
this.$set(this.baseForm,"phone",this.selectItme.phone)
this.$set(this.baseForm,"name",this.selectItme.userName)
this.$set(this.baseForm,"userId",this.selectItme.userId)
this.$set(this.baseForm,"deptId",this.selectItme.deptId)
this.openSelectUser = false;
this.isCreateFlage=false;
}
});
},
// 取消按钮
cancel2() {
this.openSelectUser = false;
},
/** 删除按钮操作 */
handleDelete(row) {
var certificateNoRow="";
if(row!=undefined &&row.certificateNo!=null&&row.certificateNo!=undefined){
certificateNoRow=row.certificateNo.split(" ");
}
const certificateNos = certificateNoRow || this.certificateNos;
console.log("certificateNos",certificateNos);
this.$modal.confirm('是否确认删除数据项?').then(() => {
deleteCertificateInfoApi({certificateNos:certificateNos}).then(response => {
console.log("deleteCertificateInfoApi",response);
this.getList();
this.$modal.msgSuccess("删除成功");
return;
});
}).catch(() => {});
},
formatDate(date) {
// 格式化为 YYYY-MM-DD
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
},
/** 导出按钮操作 */
handleExport() {
this.download('certificate/certificate_manage/certificateInfo/export', {
...this.queryParams
}, `证件信息_${new Date().getTime()}.xlsx`);
},
beforeUpload(file){
const isLt2M = file.size / 1024 / 1024 < 0.5;
if (!isLt2M) {
this.$message.error('上传文件大小不能超过 500KB!');
return false;
}
},
// 文件上传中处理
handleFileUploadProgress(event, file, fileList) {
console.log("============");
console.log(file);
console.log(file.length);
this.upload.isUploading = true
},
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
console.log(response)
this.upload.isUploading = false
this.$refs.upload.clearFiles()
if(response.code==200){
this.$modal.msgSuccess(response.msg);
this.getList();
}else{
// this.$modal.msgError(response.msg);
this.$alert(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
response.msg +
'</div>',
'导入结果',
{ dangerouslyUseHTMLString: true },
)
}
},
/** 下载模板操作 */
importTemplate() {
let url = window.location.origin + '/certificateWeb/template/证件信息模板.xlsx';
console.log(url)
downloadFileByUrl(url)
},
/** 批量删除 */
handleBatchDel(){
},
// 多选框选中数据
handleSelectionChange(selection) {
this.certificateNos = selection.map(item => item.certificateNo)
this.userIds=selection.map(item => item.userId)
// 更新单选和多选状态
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 远程校验按钮操作 */
handleTask() {
if(this.userIds==undefined||this.userIds==null||this.userIds.length==0){
this.$modal.msgError("请选择核验人员!");
return;
}
this.resetTask()
this.openTask = true
},
// 取消按钮
cancelTask() {
this.openTask = false
this.resetTask()
},
// 表单重置
resetTask() {
this.taskForm = {
startTime:"",
endTime:""
}
this.resetForm('taskForm')
},
/** 提交按钮 */
submitTask: function () {
this.$refs['taskForm'].validate((valid) => {
let paramd = Object.assign({},this.taskForm)
console.log(paramd)
console.log(this.ids)
if (valid) {
paramd.userIds=this.userIds;
paramd.checkType="2";
let param={
verifyTitle:"一人多证核验",
startTime:paramd.startTime,
endTime:paramd.endTime,
verifyUsers:this.userIds,
verifyType:"2",
type:"100000",
noticeType:"2"
}
addCertificateCheckApi(param).then(response => {
if(response.code=200){
this.$modal.msgSuccess("验证下发成功");
this.openTask = false;
this.getList();
}else{
this.$modal.msgError(response.msg);
}
});
}
})
},
openLog(row){
this.$router.push({ path: "/certificate/certificateManage/certificateLogList",query:{certificateNo:row.certificateNo}});
}
}
};
</script>
<style scoped lang="scss">
.top-view{
width: 85%;
height: 100px;
padding: 8px;
border: 1px solid #ccc;
border-radius: 10px;
font-weight: 600;
}
.flex-between{
display: flex;
align-items: center;
justify-content: space-between;
}
.form-title{
display: flex;
align-items: flex-end;
// width: 100%;
// height: 40px;
background: #e7f0fa;
border-left: 3px solid #46a6ff;
margin: 10px 0;
padding: 5px;
}
.form-item{
width: 100%;
font-size: 14px !important;
}
</style>