123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- <!--白名单列表-->
- <template>
- <div class="app-container whitelist">
- <div class="whitelist-page" v-if="pageType == 1">
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="90px">
- <el-form-item label="关键字" prop="userName">
- <el-input
- v-model="queryParams.searchValue"
- placeholder="姓名/工号/联系方式"
- clearable
- maxLength="30"
- size="small"
- />
- </el-form-item>
- <el-form-item>
- <p class="inquire-button-one" @click="handleQuery">查询</p>
- <p class="reset-button-one" @click="resetQuery">重置</p>
- </el-form-item>
- <el-form-item style="float: right;">
- <el-button
- style="margin-left: 20px"
- type="primary"
- plain
- icon="el-icon-plus"
- size="mini"
- @click="pageClick(2)"
- v-hasPermi="['laboratory:whitelist:add']"
- >新增</el-button>
- </el-form-item>
- </el-form>
- <el-table v-loading="loading" border :data="safe_bookList" >
- <el-table-column label="姓名" align="left" prop="userName"/>
- <el-table-column label="工号" align="left" prop="userNumber"/>
- <el-table-column label="联系方式" align="left" prop="userTelephone"/>
- <el-table-column label="学院" align="left" prop="deptName"/>
- <el-table-column label="操作" align="center" width="160" v-if="tableButtonType">
- <template slot-scope="scope">
- <div class="table-button-box">
- <p class="table-button-null"></p>
- <p class="table-button-p"
- @click="pageEditClick(2,scope.row)"
- v-hasPermiAnd="['laboratory:whitelist:query','laboratory:whitelist:edit']"
- >编辑</p>
- <p class="table-button-p"
- @click="delButton(scope.row)"
- v-hasPermi="['laboratory:whitelist:remove']"
- >移除</p>
- <p class="table-button-null"></p>
- </div>
- </template>
- </el-table-column>
- </el-table>
- <pagination :page-sizes="[20, 30, 40, 50]"
- v-show="total>0"
- :total="total"
- :page.sync="queryParams.pageNum"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- />
- </div>
- <add-page v-if="pageType == 2" :pageData="pageData"></add-page>
- </div>
- </template>
- <script>
- import { whitelistList,whitelistDel } from "@/api/laboratory/whitelist";
- import addPage from './addPage.vue'
- export default {
- components:{
- addPage
- },
- name: "whitelist",
- data() {
- return {
- tableButtonType:this.hasPermiDom(['laboratory:whitelist:query','laboratory:whitelist:edit','laboratory:whitelist:remove']),
- pageType:1,
- // 遮罩层
- loading: false,
- // 显示搜索条件
- showSearch: true,
- // 总条数
- total: 0,
- // 实验室安全制度表格数据
- safe_bookList: [],
- // 查询参数
- queryParams: {
- pageNum: 1,
- pageSize:20,
- searchValue: null,
- },
- pageData:{},
- };
- },
- created() {
- this.getList();
- },
- methods: {
- delButton(item){
- let self = this;
- this.$confirm('确定移除当前准入信息,移除后将无法进入实验室?', "警告", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
- }).then(function() {
- self.whitelistDel(item);
- }).then(() => {}).catch(() => {});
- },
- whitelistDel(item){
- whitelistDel(item.id).then(response => {
- this.msgSuccess("删除成功");
- this.getList();
- });
- },
- getList(){
- this.loading = true;
- whitelistList(this.queryParams).then(response => {
- this.safe_bookList = response.rows;
- this.total = response.total;
- this.loading = false;
- });
- },
- //新增
- pageClick(type){
- if(this.pageType != type){
- this.pageType = type;
- this.pageData= {};
- if(type == 1){
- this.getList();
- }
- }
- },
- //编辑
- pageEditClick(type,item){
- if(this.pageType != type){
- this.pageType = type;
- this.pageData=item;
- if(type == 1){
- this.getList();
- }
- }
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.queryParams.pageNum = 1;
- this.getList();
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.queryParams.searchValue='';
- this.handleQuery();
- },
- handleDelete(){
- },
- }
- };
- </script>
- <style scoped lang="scss">
- .whitelist {
- flex:1;
- display: flex !important;
- flex-direction: column;
- overflow: hidden;
- box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);
- .whitelist-page{
- flex:1;
- display: flex;
- flex-direction: column;
- overflow: hidden;
- padding:11px 20px 20px!important;
- .button-box{
- margin:0 auto;
- width:190px;
- display: flex;
- }
- }
- }
- </style>
|