马宇豪
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
      <el-form-item prop="isCm">
        <el-radio-group v-model="queryParams.isCm" @change="changeType">
          <el-radio-button :label="2">全部</el-radio-button>
          <el-radio-button :label="1">煤矿</el-radio-button>
          <el-radio-button :label="0">非煤</el-radio-button>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="时间范围" prop="timeRange">
        <el-date-picker
          v-model="queryParams.timeRange"
          value-format="yyyy-MM-dd HH:mm"
          type="datetimerange"
          range-separator="-"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
        ></el-date-picker>
      </el-form-item>
      <el-form-item label="所属区域" prop="districtId">
        <el-select v-model="queryParams.districtId" placeholder="请选择" style="width: 100%;">
          <el-option
            v-for="item in areaList"
            :key="item.id"
            :label="item.name"
            :value="item.id">
          </el-option>
        </el-select>
      </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
          size="mini"
          @click="openExamApply({},'add')"
        >考试计划申请</el-button>
        <el-button
          type="primary"
          plain
          size="mini"
          @click="openExamRegist()"
          v-if="!roles.find(i=>i=='feimeiexam') && !roles.find(i=>i=='mkexam')"
        >考试报名</el-button>
        <el-button
          type="primary"
          plain
          size="mini"
          @click="openGrades()"
          v-if="!roles.find(i=>i=='feimeiexam') && !roles.find(i=>i=='mkexam')"
        >成绩查询</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>
    <el-table v-loading="loading" :data="dataList">
      <el-table-column label="归档序号" align="center" type="index"/>
      <el-table-column label="机构名称" align="center" prop="institutionName" />
      <el-table-column label="考试点名称" align="center" prop="siteName" />
      <el-table-column label="考试批次全称" align="center" prop="examName" />
      <el-table-column label="考试人数" align="center" prop="examNum" />
      <el-table-column label="正考时间安排" align="center">
        <template #default="scope">
          {{scope.row.examStartTime.substring(0,16) + '--' + scope.row.examEndTime.substring(0,16)}}
        </template>
      </el-table-column>
      <el-table-column label="补考时间安排" align="center">
        <template #default="scope">
          {{scope.row.resitStartTime.substring(0,16) + '--' + scope.row.resitEndTime.substring(0,16)}}
        </template>
      </el-table-column>
      <el-table-column label="实操时间" align="center">
        <template #default="scope">
          {{scope.row.operationStartTime.substring(0,16) + '--' + scope.row.operationEndTime.substring(0,16)}}
        </template>
      </el-table-column>
      <el-table-column label="培训机构联系人" align="center">
        <template #default="scope">
          {{scope.row.institutionContacts + '(' + scope.row.institutionContactsPhone + ')'}}
        </template>
      </el-table-column>
      <el-table-column label="考试点联系人" align="center">
        <template #default="scope">
          {{scope.row.siteContacts + '(' + scope.row.siteContactsPhone + ')'}}
        </template>
      </el-table-column>
      <el-table-column label="考试申请时间" align="center" prop="updateTime" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template #default="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-view"
            @click="alpop('机构暂未导入报名详单。')"
          >报名详情</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-view"
            @click="alpop('成绩信息暂未上传。')"
          >成绩清单查询</el-button>
        <el-button
            size="mini"
            type="text"
            icon="el-icon-view"
            @click="openExamApply(scope.row,'view')"
          >申请审批</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="openExamApply(scope.row,'edit')"
            v-hasPermi="['system:experts:remove']"
          >信息设定分配</el-button>
          <el-button
            size="mini"
            type="text"
            style="color: red"
            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.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
    <examApply-dialog ref="examApplyDialog" @getList="getList" :typeList="typeList"></examApply-dialog>
    <exam-regist-dialog ref="examRegistDialog" @getList="getList" :typeList="typeList"></exam-regist-dialog>
    <exam-grades-dialog ref="examGradesDialog" @getList="getList" :typeList="typeList"></exam-grades-dialog>
  </div>
</template>
 
<script>
 
import examApplyDialog from "@/views/commonMod/examApply/components/examApplyDialog";
import examRegistDialog from '@/views/commonMod/examApply/components/examRegistDialog.vue'
import examGradesDialog from '@/views/commonMod/examApply/components/examGradesDialog.vue'
import {getOperatePage} from "@/api/coalMine/operateType";
import {delExamApply, getExamPage} from "@/api/commonMod/examApply";
import {getAreaList} from "@/api/coalMine/placeManage/train";
import store from '@/store'
export default {
  name: "examApply",
  dicts: [],
  components: {
    examApplyDialog,
    examRegistDialog,
    examGradesDialog
  },
  data() {
    return {
      violationDialog: '',
      loading: false,
      showSearch: true,
      dataList: [],
      total: 0,
      typeList: [],
      areaList: [],
      queryParams: {
        districtId: null,
        isCm: 2,
        examStartTime: '',
        examEndTime: '',
        pageNum: 1,
        pageSize: 10
      },
      roles: []
    };
  },
  created() {
    this.roles = store.getters && store.getters.roles
    console.log(this.roles,'role')
    // if (roles.includes('mk')) {
    //   this.form.isCm = 1
    // }
    this.getList()
    this.getTypeList()
    this.getArea()
  },
  methods: {
    async getList(){
      const t = this
      t.loading = true
      const res = await getExamPage(t.queryParams)
      if(res.code == 200){
        t.dataList = res.rows
        t.total = res.total
      }else{
        t.$message({
          message: res.msg,
          type: 'warning'
        })
      }
      t.loading = false
    },
    async getTypeList() {
      this.loading = true;
      const res = await getOperatePage({name: ''})
      if(res.code == 200){
        this.typeList = this.handleTree(res.data, "id");
      }else{
        this.$message({
          type: 'warning',
          message: res.msg
        });
      }
      this.loading = false;
    },
    async getArea() {
      const res = await getAreaList();
      if(res.code == 200) {
        this.areaList = res.data;
      }
    },
    handleDelete(row){
      this.$confirm('此操作将永久删除该条数据, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(async () => {
        const res = await delExamApply([row.applyId])
        if(res.code == 200){
          this.$message({
            type: 'success',
            message: '删除成功!'
          });
          await this.getList()
        }else{
          this.$message({
            type: 'warning',
            message: res.msg
          });
        }
      }).catch(() => {
 
      });
    },
    handleQuery(){
      this.queryParams.pageNum = 1
      this.getList()
    },
    resetQuery(){
      this.queryParams = {
        name: '',
        idCard:'',
        dept: '',
        operateTypeId: null,
        isCm: 2,
        pageNum: 1,
        pageSize: 10
      }
      this.getList()
    },
    changeType(){
      this.queryParams.pageNum = 1
      this.getList()
    },
    openExamApply(data,type){
      this.$refs.examApplyDialog.openDialog(data,type);
    },
    openExamRegist() {
      const data = {}
      const userInfo = store.getters && store.getters.userInfo
      data.name = userInfo.nickName
      data.sex = userInfo.sex == 0 ? '男':'女'
 
      this.$refs.examRegistDialog.openDialog(data);
    },
    openGrades() {
      this.$refs.examGradesDialog.openDialog();
    },
    alpop(value){
      alert(value)
    }
  }
};
</script>