页面初始化绘制
This commit is contained in:
parent
37c56846ae
commit
2c44e5738e
|
|
@ -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>
|
||||
|
|
@ -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>
|
||||
|
|
@ -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>仅允许导入xls、xlsx格式文件。</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>
|
||||
Loading…
Reference in New Issue