马宇豪
2025-02-10 02bd5982028af6e791dd0857f535a41aaf74679e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<template>
  <div class="app-container">
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd('add')"
          v-hasPermi="['system:experts:add']"
        >新增</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>
 
    <el-table v-loading="loading" :data="examList">
      <el-table-column type="index" label="序号" width="55" align="center" />
      <el-table-column label="考试点名称" align="center" prop="siteName" />
      <el-table-column label="所属地区" align="center" prop="districtName" />
      <el-table-column label="地址" align="center" prop="address" />
<!--      <el-table-column label="关联培训机构" align="center" prop="institutionName" />-->
      <el-table-column label="负责人及电话" align="center" prop="phone">
        <template #default="scope">
          <div>{{scope.row.header}}</div>
          <div>{{scope.row.hphone}}</div>
        </template>
      </el-table-column>
      <el-table-column label="联系人及电话" align="center" prop="phone">
        <template #default="scope">
          <div>{{scope.row.contact}}</div>
          <div>{{scope.row.cphone}}</div>
        </template>
      </el-table-column>
      <el-table-column label="说明(备注)" align="center" prop="remark"/>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template #default="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleAdd('edit',scope.row)"
          >编辑</el-button>
          <el-button
            size="mini"
            type="text"
            style="color: #f56c6c"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['system:experts:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageIndex"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
    <add-dialog ref="addDialogRef" @getList = "getList"></add-dialog>
  </div>
</template>
 
<script>
import addDialog from "@/views/coalMine/cPlaceManage/cExamManage/components/addDialog.vue";
import {delExam, getExamPage} from "@/api/coalMine/placeManage/exam";
export default {
  name: "nPeopleManage",
  dicts: [],
  components: {addDialog},
  data() {
    return {
      loading: false,
      single: true,
      multiple: true,
      showSearch: true,
      addForm: false,
      total: 0,
      expertTypes: [],
      examList: [],
      queryParams: {
        pageIndex: 1,
        pageSize: 10
      },
      form: {},
    };
  },
  created() {
    this.getList()
  },
  methods: {
    async getList() {
      this.loading = true;
      const param = {
        isCm: 1,
        pageNum: this.queryParams.pageIndex,
        pageSize: this.queryParams.pageSize
      }
      const res = await getExamPage(param);
      console.log("res",res)
      if(res.code == 200) {
        this.examList = res.rows;
        this.total = res.total
      }else {
        this.$message({
          message: res.msg,
          type: 'warning'
        })
      }
      this.loading = false;
    },
    handleAdd(type, data){
      this.$refs.addDialogRef.openDialog(type, data);
    },
    handleDelete(val) {
      this.$confirm('删除此条信息,是否继续', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        delExam( val.siteId).then((res) => {
          if (res.code == 200) {
            this.$message({
              type:'success',
              message: '删除成功'
            })
            this.getList()
          }
        })
      })
    }
  }
};
</script>