first commit
This commit is contained in:
352
src/views/system/signOut/index.vue
Normal file
352
src/views/system/signOut/index.vue
Normal file
@@ -0,0 +1,352 @@
|
||||
<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="idcard">
|
||||
<el-input
|
||||
v-model="queryParams.idcard"
|
||||
placeholder="请输入来访人"
|
||||
clearable
|
||||
@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-table v-loading="loading" :data="visitorList" @selection-change="handleSelectionChange">
|
||||
<el-table-column label="名称" align="center" prop="name" />
|
||||
<el-table-column label="手机号" align="center" prop="phone" />
|
||||
<el-table-column label="身份证号" align="center" prop="idcard" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-connection"
|
||||
@click="handleUpdate(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"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { queryVisitorUnsigned, updateState, delVisitor, addVisitor, updateVisitor } from "@/api/system/signOut";
|
||||
import logoImg from '@/assets/images/example.png'
|
||||
import {branchTreeSelect} from "@/api/system/sysBranch";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
import {listSysPeople} from "@/api/system/sysPeople";
|
||||
import urlImg from '@/assets/images/ewm.png';
|
||||
import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
|
||||
|
||||
|
||||
|
||||
export default {
|
||||
name: "Visitor",
|
||||
dicts: ['sys_user_sex','vis_info_type'],
|
||||
components: {Treeselect,ElImageViewer },
|
||||
data() {
|
||||
return {
|
||||
showViewer: false, // 显示查看器
|
||||
url:urlImg,
|
||||
logo: logoImg,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 访客信息表格数据
|
||||
visitorList: [],
|
||||
// 部门树选项
|
||||
branchOptions: [],
|
||||
peopleOptions:[],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: null,
|
||||
sex: null,
|
||||
avatar: null,
|
||||
userId: null,
|
||||
deptId: null,
|
||||
startTime: null,
|
||||
},
|
||||
queryParams1: {
|
||||
branchId: undefined,
|
||||
},
|
||||
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: "来访人不能为空", trigger: "blur" }
|
||||
],
|
||||
phone: [
|
||||
{ required: true, message: "来访人联系电话不能为空", trigger: "blur" }
|
||||
],
|
||||
startTime: [
|
||||
{ required: true, message: "预约时间不能为空", trigger: "blur" }
|
||||
],
|
||||
endTime: [
|
||||
{ required: true, message: "结束时间不能为空", trigger: "blur" }
|
||||
],
|
||||
userId: [
|
||||
{ required: true, message: "被访人不能为空", trigger: "blur" }
|
||||
],
|
||||
deptId: [
|
||||
{ required: true, message: "园区/公司不能为空", trigger: "blur" }
|
||||
],
|
||||
},
|
||||
//给一个默认行
|
||||
itemData: [],
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
// 监听deptId
|
||||
'form.deptId': 'getPeople'
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getOptions();
|
||||
},
|
||||
methods: {
|
||||
/** 查询访客信息列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
queryVisitorUnsigned(this.queryParams).then(response => {
|
||||
this.visitorList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 查询选项列表 */
|
||||
getOptions() {
|
||||
this.branchOptions = []
|
||||
branchTreeSelect().then(response => {
|
||||
this.branchOptions = response.data
|
||||
})
|
||||
},
|
||||
/** 查询选项列表 */
|
||||
getPeople() {
|
||||
this.queryParams1.branchId=this.form.deptId;
|
||||
this.peopleOptions = []
|
||||
listSysPeople(this.queryParams1).then(response => {
|
||||
this.peopleOptions = response.rows
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
name: null,
|
||||
phone: null,
|
||||
sex: null,
|
||||
avatar: null,
|
||||
idcard: null,
|
||||
carNo: null,
|
||||
userId: null,
|
||||
deptId: null,
|
||||
flag: null,
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
matter: null,
|
||||
res: null,
|
||||
guid: null,
|
||||
faceGuid: null,
|
||||
remark: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 转换树数据结构 */
|
||||
normalizer(node) {
|
||||
if (node.children && !node.children.length) {
|
||||
delete node.children;
|
||||
}
|
||||
return {
|
||||
id: node.id,
|
||||
label: node.label,
|
||||
isDisabled: false,
|
||||
children: node.children
|
||||
};
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加访客信息";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
let that = this;
|
||||
that.$confirm('是否签离?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
updateState({type:'2',id:row.id}).then(res => {
|
||||
that.$message({
|
||||
type: 'success',
|
||||
message: '签离成功!'
|
||||
});
|
||||
that.getList();
|
||||
})
|
||||
}).catch(() => {
|
||||
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.form.itemList=this.itemData;
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateVisitor(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addVisitor(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除访客信息编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delVisitor(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/visitor/export', {
|
||||
...this.queryParams
|
||||
}, `visitor_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
// 增加一行
|
||||
addRow(length) {
|
||||
if (this.itemData == undefined) {
|
||||
this.itemData = new Array();
|
||||
}
|
||||
let obj = {};
|
||||
obj.avatar = "";
|
||||
obj.name = "";
|
||||
obj.phone = "";
|
||||
this.itemData.push(obj);
|
||||
},
|
||||
// 删除一行
|
||||
deleteRow(index) {
|
||||
this.itemData.splice(index, 1)
|
||||
|
||||
},
|
||||
handleEwm(){
|
||||
this.showViewer = true
|
||||
},
|
||||
// 关闭查看器
|
||||
closeViewer() {
|
||||
this.showViewer = false
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
.card_list {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 10px;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.published-div {
|
||||
position: absolute;
|
||||
top: 70px;
|
||||
right: 150px;
|
||||
}
|
||||
.el-button--mini.is-circle {
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.el-col-8 {
|
||||
height: 60px;
|
||||
}
|
||||
.el-select {
|
||||
width: 100%;
|
||||
}
|
||||
.el-date-editor.el-input, .el-date-editor.el-input__inner {
|
||||
width: 100%;
|
||||
}
|
||||
.el-table .cell .el-upload{
|
||||
line-height: 80px;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
.el-table .cell .el-upload-list--picture-card .el-upload-list__item {
|
||||
overflow: hidden;
|
||||
background-color: #fff;
|
||||
border: 1px solid #c0ccda;
|
||||
border-radius: 6px;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
margin: 0 8px 8px 0;
|
||||
display: inline-block;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user