|
@@ -0,0 +1,507 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
|
|
|
+ <el-form-item label="到访单位" prop="unitId">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.unitId"
|
|
|
+ placeholder="请输入到访单位"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="接待人" prop="peopleId">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.peopleId"
|
|
|
+ placeholder="请输入接待人"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="到访人员姓名" prop="name">
|
|
|
+ <el-input
|
|
|
+ v-model="queryParams.name"
|
|
|
+ placeholder="请输入到访人员姓名"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleQuery"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="到访时间" prop="arriveTime" style="margin-left:20px">
|
|
|
+ <el-date-picker clearable size="small"
|
|
|
+ v-model="form.arriveTime"
|
|
|
+ type="datetime"
|
|
|
+ placeholder="选择到访时间">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="离队时间" prop="endTime">
|
|
|
+ <el-date-picker clearable size="small"
|
|
|
+ v-model="form.endTime"
|
|
|
+ type="datetime"
|
|
|
+ placeholder="选择离队时间">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item class="search">
|
|
|
+ <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"
|
|
|
+ v-hasPermi="['doormanManage:bdglVisit:add']"
|
|
|
+ >新增</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ plain
|
|
|
+ icon="el-icon-edit"
|
|
|
+ size="mini"
|
|
|
+ :disabled="single"
|
|
|
+ @click="handleUpdate"
|
|
|
+ v-hasPermi="['doormanManage:bdglVisit:edit']"
|
|
|
+ >修改</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="danger"
|
|
|
+ plain
|
|
|
+ icon="el-icon-delete"
|
|
|
+ size="mini"
|
|
|
+ :disabled="multiple"
|
|
|
+ @click="handleDelete"
|
|
|
+ v-hasPermi="['doormanManage:bdglVisit:remove']"
|
|
|
+ >删除</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ plain
|
|
|
+ icon="el-icon-download"
|
|
|
+ size="mini"
|
|
|
+ :loading="exportLoading"
|
|
|
+ @click="handleExport"
|
|
|
+ v-hasPermi="['doormanManage:bdglVisit:export']"
|
|
|
+ >导出</el-button>
|
|
|
+ </el-col>
|
|
|
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-table v-loading="loading" :data="bdglVisitList" @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column type="selection" width="55" align="center" />
|
|
|
+ <!-- <el-table-column label="接待人姓名" align="center" prop="id" /> -->
|
|
|
+ <el-table-column label="到访单位" align="center" prop="unitId" :formatter="unit2Format"/>
|
|
|
+ <el-table-column label="接待人" align="center" prop="peopleName" />
|
|
|
+ <el-table-column label="到访人员姓名" align="center" prop="name" />
|
|
|
+ <el-table-column label="到访时间" align="center" prop="arriveTime" width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ parseTime(scope.row.arriveTime, '{y}-{m}-{d} {h}:{m}:{s}') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="离队时间" align="center" prop="endTime" width="180">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d} {h}:{m}:{s}') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="到访车牌号" align="center" prop="numberPlate" />
|
|
|
+ <el-table-column label="来访原因" align="center" prop="contents" />
|
|
|
+ <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-edit"
|
|
|
+ @click="handleUpdate(scope.row)"
|
|
|
+ v-hasPermi="['doormanManage:bdglVisit:edit']"
|
|
|
+ >修改</el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ @click="handleDelete(scope.row)"
|
|
|
+ v-hasPermi="['doormanManage:bdglVisit:remove']"
|
|
|
+ >删除</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="1200px" append-to-body>
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="110px" :inline="true">
|
|
|
+ <el-form-item label="到访单位" prop="unitId" style="margin-left:20px">
|
|
|
+ <treeselect
|
|
|
+ v-model="form.unitId"
|
|
|
+ :options="users"
|
|
|
+ placeholder="请选择到访单位"
|
|
|
+ class="threeselects"
|
|
|
+ @select="selectPeo"
|
|
|
+ />
|
|
|
+ <!-- <el-input v-model="form.unitId" placeholder="请输入到访单位" /> -->
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="接待人" prop="peopleId">
|
|
|
+ <!-- <el-input v-model="form.peopleId" placeholder="请输入接待人" /> -->
|
|
|
+ <el-select
|
|
|
+ v-model="form.peopleName"
|
|
|
+ placeholder="请选择接待人"
|
|
|
+ id="execute"
|
|
|
+ ref="peoplenames"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in executor"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.name"
|
|
|
+ @click.native="peopleIds(item.id)"
|
|
|
+ id="execute"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="到访人员姓名" prop="name">
|
|
|
+ <el-input v-model="form.name" placeholder="请输入到访人员姓名" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="到访时间" prop="arriveTime" style="margin-left:20px">
|
|
|
+ <el-date-picker clearable size="small"
|
|
|
+ v-model="form.arriveTime"
|
|
|
+ type="datetime"
|
|
|
+ placeholder="选择到访时间">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="离队时间" prop="endTime">
|
|
|
+ <el-date-picker clearable size="small"
|
|
|
+ v-model="form.endTime"
|
|
|
+ type="datetime"
|
|
|
+ placeholder="选择离队时间">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="到访车牌号" prop="numberPlate">
|
|
|
+ <el-input v-model="form.numberPlate" placeholder="请输入到访车牌号" />
|
|
|
+ </el-form-item>
|
|
|
+ <div class="jiben" style="margin-left:20px">来访原因</div>
|
|
|
+ <el-form-item prop="contents" class="daofang" style="margin-left:20px">
|
|
|
+ <el-input v-model="form.contents" type="textarea" placeholder="请输入内容" />
|
|
|
+ </el-form-item>
|
|
|
+ </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 { listBdglVisit, getBdglVisit, delBdglVisit, addBdglVisit, updateBdglVisit, exportBdglVisit, deptUser } from "@/api/doormanManage/bdglVisit";
|
|
|
+import Treeselect from "@riophae/vue-treeselect";
|
|
|
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
+import { getDept2 } from "@/api/grassrootsregistration/bdglmeeting";
|
|
|
+import {allUser} from "@/api/workingArrangements/workTask"
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: "BdglVisit",
|
|
|
+ components: { Treeselect },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ // 遮罩层
|
|
|
+ loading: true,
|
|
|
+ // 导出遮罩层
|
|
|
+ exportLoading: false,
|
|
|
+ // 选中数组
|
|
|
+ ids: [],
|
|
|
+ // 非单个禁用
|
|
|
+ single: true,
|
|
|
+ // 非多个禁用
|
|
|
+ multiple: true,
|
|
|
+ // 显示搜索条件
|
|
|
+ showSearch: true,
|
|
|
+ // 总条数
|
|
|
+ total: 0,
|
|
|
+ // 人员来访登记表格数据
|
|
|
+ bdglVisitList: [],
|
|
|
+ // 弹出层标题
|
|
|
+ title: "",
|
|
|
+ // 是否显示弹出层
|
|
|
+ open: false,
|
|
|
+ // 查询参数
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ unitId: null,
|
|
|
+ peopleId: null,
|
|
|
+ name: null,
|
|
|
+ arriveTime: null,
|
|
|
+ endTime: null,
|
|
|
+ adminId: null,
|
|
|
+ contents: null,
|
|
|
+ createtime: null,
|
|
|
+ updatetime: null,
|
|
|
+ numberPlate: null,
|
|
|
+ unitName: null,
|
|
|
+ peopleName: null
|
|
|
+ },
|
|
|
+ // 表单参数
|
|
|
+ form: {},
|
|
|
+ // 表单校验
|
|
|
+ rules: {
|
|
|
+ unitId: [{ required: true, message: "到访单位不能为空", trigger: "blur" }],
|
|
|
+ // peopleId: [{ required: true, message: "接待人不能为空", trigger: "blur" }],
|
|
|
+ name: [{ required: true, message: "到访人员姓名不能为空", trigger: "blur" }],
|
|
|
+ arriveTime: [{ required: true, message: "到访时间不能为空", trigger: "blur" }],
|
|
|
+ endTime: [{ required: true, message: "离队时间不能为空", trigger: "blur" }],
|
|
|
+ numberPlate: [{ required: true, message: "到访车牌号不能为空", trigger: "blur" }],
|
|
|
+ },
|
|
|
+ // 执行单位列表
|
|
|
+ users: [],
|
|
|
+ // 接待人
|
|
|
+ executor:[],
|
|
|
+ // 人员列表
|
|
|
+ rylist:[]
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getList();
|
|
|
+ allUser().then((res) => {
|
|
|
+ this.rylist = res.rows;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ unit2Format(row, column) {
|
|
|
+ var deptName = "";
|
|
|
+ deptName=row.unitName
|
|
|
+ // if(this.bdglVisitList[0].unitId==row.unitId){
|
|
|
+ // deptName=row.unitName
|
|
|
+ // }
|
|
|
+ return deptName;
|
|
|
+ },
|
|
|
+ peopleIds(id){
|
|
|
+ this.form.peopleId=id
|
|
|
+ console.log(id)
|
|
|
+ },
|
|
|
+ // 获取执行人
|
|
|
+ getZhuChi(id) {
|
|
|
+ deptUser(id).then((res) => {
|
|
|
+ this.executor = res.data;
|
|
|
+ console.log(this.executor)
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 到访单位选中触发
|
|
|
+ selectPeo(val) {
|
|
|
+ this.form.unitId = val.id;
|
|
|
+ // console.log(this.form.unitId)
|
|
|
+ this.getZhuChi(this.form.unitId);
|
|
|
+ },
|
|
|
+ /** 查询人员来访登记列表 */
|
|
|
+ getList() {
|
|
|
+ this.loading = true;
|
|
|
+ listBdglVisit(this.queryParams).then(response => {
|
|
|
+ // console.log(response)
|
|
|
+ this.bdglVisitList = response.rows;
|
|
|
+ console.log(this.bdglVisitList)
|
|
|
+ this.total = response.total;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 取消按钮
|
|
|
+ cancel() {
|
|
|
+ this.open = false;
|
|
|
+ this.reset();
|
|
|
+ },
|
|
|
+ // 表单重置
|
|
|
+ reset() {
|
|
|
+ this.form = {
|
|
|
+ id: null,
|
|
|
+ unitId: null,
|
|
|
+ peopleId: null,
|
|
|
+ name: null,
|
|
|
+ arriveTime: null,
|
|
|
+ endTime: null,
|
|
|
+ adminId: null,
|
|
|
+ contents: null,
|
|
|
+ createtime: null,
|
|
|
+ updatetime: null,
|
|
|
+ numberPlate: null,
|
|
|
+ unitName: null,
|
|
|
+ peopleName: null
|
|
|
+ };
|
|
|
+ this.resetForm("form");
|
|
|
+ },
|
|
|
+ /** 搜索按钮操作 */
|
|
|
+ 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 = "添加人员来访登记";
|
|
|
+ // 获取执行单位列表
|
|
|
+ getDept2().then((res) => {
|
|
|
+ // console.log(res,2)
|
|
|
+ this.users = res.data;
|
|
|
+ console.log(this.users);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 修改按钮操作 */
|
|
|
+ handleUpdate(row) {
|
|
|
+ this.reset();
|
|
|
+ getDept2().then((res) => {
|
|
|
+ // console.log(res,2)
|
|
|
+ this.users = res.data;
|
|
|
+ console.log(this.users);
|
|
|
+ });
|
|
|
+ const id = row.id || this.ids
|
|
|
+ getBdglVisit(id).then(response => {
|
|
|
+ this.form = response.data;
|
|
|
+ this.open = true;
|
|
|
+ this.title = "修改人员来访登记";
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 提交按钮 */
|
|
|
+ submitForm() {
|
|
|
+ console.log(this.form)
|
|
|
+ this.$refs["form"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ if (this.form.id != null) {
|
|
|
+ updateBdglVisit(this.form).then(response => {
|
|
|
+ this.$modal.msgSuccess("修改成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ addBdglVisit(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 delBdglVisit(ids);
|
|
|
+ }).then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
+ }).catch(() => {});
|
|
|
+ },
|
|
|
+ /** 导出按钮操作 */
|
|
|
+ handleExport() {
|
|
|
+ const queryParams = this.queryParams;
|
|
|
+ this.$modal.confirm('是否确认导出所有人员来访登记数据项?').then(() => {
|
|
|
+ this.exportLoading = true;
|
|
|
+ return exportBdglVisit(queryParams);
|
|
|
+ }).then(response => {
|
|
|
+ this.$download.name(response.msg);
|
|
|
+ this.exportLoading = false;
|
|
|
+ }).catch(() => {});
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style scoped>
|
|
|
+::v-deep .el-dialog{
|
|
|
+ background-color: #004d86 !important;
|
|
|
+}
|
|
|
+/* 输入框 */
|
|
|
+::v-deep .el-dialog .el-input__inner{
|
|
|
+ background-color: #004d86 !important;
|
|
|
+ width: 220px;
|
|
|
+ color: white;
|
|
|
+}
|
|
|
+/* 标题弹框 */
|
|
|
+::v-deep .el-dialog__title{
|
|
|
+ color: white;
|
|
|
+ /* border-bottom: 1px solid white; */
|
|
|
+}
|
|
|
+/* 标题下划线 */
|
|
|
+::v-deep .el-dialog__header{
|
|
|
+ border-bottom: 1px solid white;
|
|
|
+}
|
|
|
+::v-deep .el-form-item__content{
|
|
|
+ width: 250px;
|
|
|
+}
|
|
|
+::v-deep .el-form-item__label{
|
|
|
+ text-align: start;
|
|
|
+}
|
|
|
+/* ::v-deep .el-form-item{
|
|
|
+ width: 200px;
|
|
|
+} */
|
|
|
+/* ::v-deep .jiedainame .el-form-item__label{
|
|
|
+ width: 90px !important;
|
|
|
+}
|
|
|
+::v-deep .el-input--small .el-input__inner{
|
|
|
+ width: 230px;
|
|
|
+} */
|
|
|
+::v-deep .el-textarea .el-textarea__inner{
|
|
|
+ /* text-align: center; */
|
|
|
+ width: 1080px;
|
|
|
+ height: auto !important;
|
|
|
+ min-height: 130px !important;
|
|
|
+}
|
|
|
+/* 到访单位 */
|
|
|
+::v-deep .el-form-item__content .el-input--small .el-input__inner{
|
|
|
+ width: 220px;
|
|
|
+}
|
|
|
+/* 表格头部 */
|
|
|
+v-deep .el-table thead tr{
|
|
|
+ background-color: #004d86 !important;
|
|
|
+}
|
|
|
+/* 树形 */
|
|
|
+.threeselects {
|
|
|
+ width: 200px;
|
|
|
+}
|
|
|
+.threeselects .vue-treeselect__input {
|
|
|
+ background-color: #004d86;
|
|
|
+ /* color: white; */
|
|
|
+}
|
|
|
+::v-deep .search .el-form-item__content{
|
|
|
+ margin-top: 0px;
|
|
|
+}
|
|
|
+::v-deep .el-picker-panel__body{
|
|
|
+ background-color: #004d86 !important;
|
|
|
+}
|
|
|
+::v-deep .vue-treeselect__control{
|
|
|
+ background-color: #004d86;
|
|
|
+ color: white;
|
|
|
+}
|
|
|
+::v-deep .vue-treeselect__single-value{
|
|
|
+ color: white;
|
|
|
+}
|
|
|
+::v-deep .threeselects{
|
|
|
+ width: 220px;
|
|
|
+}
|
|
|
+#execute{
|
|
|
+ color: white !important;
|
|
|
+}
|
|
|
+
|
|
|
+</style>
|