页面初始化绘制

This commit is contained in:
zzyuan 2025-10-27 09:48:29 +08:00
parent 37c56846ae
commit 2c44e5738e
4 changed files with 1129 additions and 0 deletions

View File

@ -0,0 +1,346 @@
<template>
<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="keyWord">
<el-input
v-model="queryParams.keyWord"
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">
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="tableListData" height="800">
<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"/>
<el-table-column label="定值单日期" align="center" prop="deptFullName" :show-overflow-tooltip="true"/>
<el-table-column label="设备所属" align="center" prop="idNumber" :show-overflow-tooltip="true"/>
<el-table-column label="一次设备名称" align="center" prop="idNumber" :show-overflow-tooltip="true"/>
<el-table-column label="保护装置名称" align="center" prop="idNumber" :show-overflow-tooltip="true"/>
<el-table-column label="保护装置型号" align="center" prop="idNumber" :show-overflow-tooltip="true"/>
<el-table-column label="装置版本" align="center" prop="idNumber" :show-overflow-tooltip="true"/>
<el-table-column label="识别时间" align="center" width="120" prop="" :show-overflow-tooltip="true"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
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="600px" append-to-body>
<el-form ref="baseForm" :model="baseForm" :rules="baseFormRules" label-width="80px">
<!-- <el-row>
<el-col :span="24">
<el-form-item label="变电站名称" prop="substationName">
<el-input v-model="baseForm.substationName" placeholder="请输入" maxlength="30" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="投运时间" prop="commissioningDate">
<el-date-picker
v-model="baseForm.commissioningDate"
type="date"
placeholder="选择日期"
format="yyyy-MM-dd"
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="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listDept,
getDept,
delDept,
addDept,
updateDept,
listDeptExcludeChild,
} from '@/api/system/dept'
import { getCertificateInfoListPageApi,addCertificateInfoApi, updateCertificateInfoApi, deleteCertificateInfoApi } from "@/api/certificateManage/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: "",
dicts: ["sys_certificate_type"],
components: { Treeselect },
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
tableListData: [],
//
title: "",
//
open: false,
checked: false,
userNameFlage:false,
certificateNos:[],
//
deptOptions: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
idNumber:null,//
name:null,//
certificateNo:null,//
},
activeName:"baseSetting",
deviceData:{},
//
baseForm: {
deptId:null,
name:"",
idNumber:"",
birthday:"",
birthAddr:"",
certificateType:"",
certificateTypeName:"",
certificateNo:"",
issueAddr:"",
issueDay:"",
issueLifespan:"0",
createTime:"",
phone:"",
isEle:""
},
//
baseFormRules: {
deptId: [
{ 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',
},
};
},
mounted(){
this.getList();
},
methods: {
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 查询列表 */
getList() {
this.loading = true;
let param = {
"pageNum":this.queryParams.pageNum,
"pageSize":this.queryParams.pageSize,
"keyWord":this.queryParams.keyWord,
}
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;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
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.title = "新增";
console.log("this.baseForm",this.baseForm);
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.open = true;
this.baseForm = Object.assign({}, row)
this.title = "查看";
},
/** 提交按钮 */
submitForm: function() {
console.log("this.baseForm",this.baseForm);
this.$refs["baseForm"].validate(valid => {
if (valid) {
if (this.baseForm.createTime != undefined) {
updateCertificateInfoApi(this.baseForm).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addCertificateInfoApi(this.baseForm).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
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`)
},
//
handleFileUploadProgress(event, file, fileList) {
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);
}
},
/** 下载模板操作 */
importTemplate() {
let url = window.location.origin + '/glweb/template/证件信息模板.xlsx';
console.log(url)
downloadFileByUrl(url)
},
}
};
</script>
<style scoped lang="scss">
.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>

View File

@ -0,0 +1,344 @@
<template>
<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="keyWord">
<el-input
v-model="queryParams.keyWord"
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="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:dict:export']"
>导出</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"
>
<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> -->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="tableListData" height="800">
<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"/>
<el-table-column label="投运时间" align="center" prop="deptFullName" :show-overflow-tooltip="true"/>
<el-table-column label="录入人" align="center" prop="idNumber" :show-overflow-tooltip="true"/>
<el-table-column label="备注" align="center" width="120" prop="birthday" :show-overflow-tooltip="true"/>
<el-table-column label="操作" align="center" 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="600px" append-to-body>
<el-form ref="baseForm" :model="baseForm" :rules="baseFormRules" label-width="80px">
<el-row>
<el-col :span="24">
<el-form-item label="变电站名称" prop="substationName">
<el-input v-model="baseForm.substationName" placeholder="请输入" maxlength="30" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="投运时间" prop="commissioningDate">
<el-date-picker
v-model="baseForm.commissioningDate"
type="date"
placeholder="选择日期"
format="yyyy-MM-dd"
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="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { getCertificateInfoListPageApi,addCertificateInfoApi, updateCertificateInfoApi, deleteCertificateInfoApi } from "@/api/certificateManage/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: "",
dicts: ["sys_certificate_type"],
components: { Treeselect },
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
tableListData: [],
//
title: "",
//
open: false,
checked: false,
userNameFlage:false,
certificateNos:[],
//
deptOptions: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
keyWord:null,
},
//
baseForm: {
substationName:"",
commissioningDate:""
},
//
baseFormRules: {
substationName: [
{ required: true, message: "变电站名称不能为空", trigger: "blur" }
]
},
//
upload: {
//
isUploading: false,
//
headers: { Authorization: 'Bearer ' + getToken() },
//
url: process.env.VUE_APP_BASE_API + '/certificate/certificate_manage/certificateInfo/import',
},
};
},
mounted(){
this.getList();
},
methods: {
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 查询列表 */
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;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.baseForm = {
substationName:"",
commissioningDate:""
};
this.resetForm("baseForm");
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "新增";
console.log("this.baseForm",this.baseForm);
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.open = true;
this.baseForm = Object.assign({}, row)
this.title = "修改";
},
/** 提交按钮 */
submitForm: function() {
console.log("this.baseForm",this.baseForm);
this.$refs["baseForm"].validate(valid => {
if (valid) {
if (this.baseForm.substationId != undefined) {
updateCertificateInfoApi(this.baseForm).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addCertificateInfoApi(this.baseForm).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal.confirm('是否确认删除数据项?').then(() => {
deleteCertificateInfoApi({substationId:row.substationId}).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`)
},
//
handleFileUploadProgress(event, file, fileList) {
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);
}
},
/** 下载模板操作 */
importTemplate() {
let url = window.location.origin + '/glweb/template/证件信息模板.xlsx';
console.log(url)
downloadFileByUrl(url)
},
}
};
</script>
<style scoped lang="scss">
.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>

View File

@ -0,0 +1,439 @@
<template>
<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="keyWord">
<el-input
v-model="queryParams.keyWord"
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"
v-hasPermi="['system:dict:export']"
>导出</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"
>
<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>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="tableListData" height="800">
<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"/>
<el-table-column label="定值单日期" align="center" prop="deptFullName" :show-overflow-tooltip="true"/>
<el-table-column label="设备所属" align="center" prop="idNumber" :show-overflow-tooltip="true"/>
<el-table-column label="一次设备名称" align="center" prop="idNumber" :show-overflow-tooltip="true"/>
<el-table-column label="保护装置名称" align="center" prop="idNumber" :show-overflow-tooltip="true"/>
<el-table-column label="保护装置型号" align="center" prop="idNumber" :show-overflow-tooltip="true"/>
<el-table-column label="装置版本" align="center" prop="idNumber" :show-overflow-tooltip="true"/>
<el-table-column label="备注" align="center" width="120" prop="" :show-overflow-tooltip="true"/>
<el-table-column label="说明" align="center" width="120" prop="" :show-overflow-tooltip="true"/>
<el-table-column label="操作" align="center" 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="600px" append-to-body>
<el-form ref="baseForm" :model="baseForm" :rules="baseFormRules" label-width="80px">
<!-- <el-row>
<el-col :span="24">
<el-form-item label="变电站名称" prop="substationName">
<el-input v-model="baseForm.substationName" placeholder="请输入" maxlength="30" clearable/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="投运时间" prop="commissioningDate">
<el-date-picker
v-model="baseForm.commissioningDate"
type="date"
placeholder="选择日期"
format="yyyy-MM-dd"
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="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-dialog
:title="upload.title"
:visible.sync="upload.open"
width="400px"
append-to-body
>
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text"
>将文件拖到此处<em>点击上传</em></div
>
<div class="el-upload__tip text-center" slot="tip">
<span>仅允许导入xlsxlsx格式文件</span>
<el-link
type="primary"
:underline="false"
style="font-size: 12px; vertical-align: baseline"
@click="importTemplate"
>下载模板
</el-link>
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"
> </el-button
>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listDept,
getDept,
delDept,
addDept,
updateDept,
listDeptExcludeChild,
} from '@/api/system/dept'
import { getCertificateInfoListPageApi,addCertificateInfoApi, updateCertificateInfoApi, deleteCertificateInfoApi } from "@/api/certificateManage/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: "",
dicts: ["sys_certificate_type"],
components: { Treeselect },
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
tableListData: [],
//
title: "",
//
open: false,
checked: false,
userNameFlage:false,
certificateNos:[],
//
deptOptions: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
idNumber:null,//
name:null,//
certificateNo:null,//
},
activeName:"baseSetting",
deviceData:{},
//
baseForm: {
deptId:null,
name:"",
idNumber:"",
birthday:"",
birthAddr:"",
certificateType:"",
certificateTypeName:"",
certificateNo:"",
issueAddr:"",
issueDay:"",
issueLifespan:"0",
createTime:"",
phone:"",
isEle:""
},
//
baseFormRules: {
deptId: [
{ 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',
},
};
},
mounted(){
this.getList();
},
methods: {
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 查询列表 */
getList() {
this.loading = true;
let param = {
"pageNum":this.queryParams.pageNum,
"pageSize":this.queryParams.pageSize,
"keyWord":this.queryParams.keyWord,
}
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;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
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.title = "新增";
console.log("this.baseForm",this.baseForm);
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.open = true;
this.baseForm = Object.assign({}, row)
this.title = "修改";
},
/** 提交按钮 */
submitForm: function() {
console.log("this.baseForm",this.baseForm);
this.$refs["baseForm"].validate(valid => {
if (valid) {
if (this.baseForm.createTime != undefined) {
updateCertificateInfoApi(this.baseForm).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addCertificateInfoApi(this.baseForm).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
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`)
},
//
handleFileUploadProgress(event, file, fileList) {
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);
}
},
/** 下载模板操作 */
importTemplate() {
let url = window.location.origin + '/glweb/template/证件信息模板.xlsx';
console.log(url)
downloadFileByUrl(url)
},
}
};
</script>
<style scoped lang="scss">
.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>