|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+<template>
|
|
|
2
|
+ <div class="app-container">
|
|
|
3
|
+ <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="80px">
|
|
|
4
|
+ <el-form-item label="部门名称" prop="deptId">
|
|
|
5
|
+ <el-select v-model="queryParams.deptId" placeholder="请选择部门" style="width:150px" clearable filterable
|
|
|
6
|
+ @change="handleQueryDeptChange">
|
|
|
7
|
+ <el-option v-for="d in queryDeptOptions" :key="d.deptId" :label="d.deptName" :value="d.deptId" />
|
|
|
8
|
+ </el-select>
|
|
|
9
|
+ </el-form-item>
|
|
|
10
|
+ <el-form-item label="队室/班组" prop="teamId">
|
|
|
11
|
+ <el-select v-model="queryParams.teamId" placeholder="请选择队室/班组" style="width:150px" clearable filterable
|
|
|
12
|
+ @change="handleQueryTeamChange">
|
|
|
13
|
+ <el-option v-for="t in queryTeamOptions" :key="t.id" :label="t.label" :value="t.id" />
|
|
|
14
|
+ </el-select>
|
|
|
15
|
+ </el-form-item>
|
|
|
16
|
+ <el-form-item label="小组" prop="groupId">
|
|
|
17
|
+ <el-select v-model="queryParams.groupId" placeholder="请选择小组" style="width:150px" clearable filterable
|
|
|
18
|
+ @change="handleQueryGroupChange">
|
|
|
19
|
+ <el-option v-for="g in queryGroupOptions" :key="g.id" :label="g.label" :value="g.id" />
|
|
|
20
|
+ </el-select>
|
|
|
21
|
+ </el-form-item>
|
|
|
22
|
+ <el-form-item label="员工姓名" prop="personId">
|
|
|
23
|
+ <el-select v-model="queryParams.personId" placeholder="请选择员工" style="width:150px" clearable filterable>
|
|
|
24
|
+ <el-option v-for="p in queryPersonOptions" :key="p.userId" :label="p.nickName" :value="p.userId" />
|
|
|
25
|
+ </el-select>
|
|
|
26
|
+ </el-form-item>
|
|
|
27
|
+ <el-form-item label="录入时间">
|
|
|
28
|
+ <el-date-picker v-model="dateRange" type="daterange" value-format="YYYY-MM-DD" range-separator="-"
|
|
|
29
|
+ start-placeholder="开始日期" end-placeholder="结束日期" clearable />
|
|
|
30
|
+ </el-form-item>
|
|
|
31
|
+ <el-form-item>
|
|
|
32
|
+ <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
|
33
|
+ <el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
|
|
34
|
+ </el-form-item>
|
|
|
35
|
+ </el-form>
|
|
|
36
|
+
|
|
|
37
|
+ <el-row :gutter="10" class="mb8">
|
|
|
38
|
+ <el-col :span="1.5">
|
|
|
39
|
+ <el-button type="warning" plain icon="Download" @click="handleExport"
|
|
|
40
|
+ v-hasPermi="['ledger:qualification:export']">导出</el-button>
|
|
|
41
|
+ </el-col>
|
|
|
42
|
+ <right-toolbar v-model:showSearch="showSearch" @queryTable="getList" />
|
|
|
43
|
+ </el-row>
|
|
|
44
|
+
|
|
|
45
|
+ <el-table v-loading="loading" :data="list" style="width: 100%;" fit="true"
|
|
|
46
|
+ :scrollbar-always-on="true">
|
|
|
47
|
+ <el-table-column label="部门名称" align="center" prop="deptName" min-width="120" resizable />
|
|
|
48
|
+ <el-table-column label="队室/班组" align="center" prop="teamName" min-width="120" resizable />
|
|
|
49
|
+ <el-table-column label="小组" align="center" prop="groupName" min-width="120" resizable />
|
|
|
50
|
+ <el-table-column label="姓名" align="center" prop="personName" width="80" resizable />
|
|
|
51
|
+ <el-table-column label="一级发证时间" align="center" prop="level1CertTime" width="120" resizable>
|
|
|
52
|
+ <template #default="{ row }">{{ row.level1CertTime || '-' }}</template>
|
|
|
53
|
+ </el-table-column>
|
|
|
54
|
+ <el-table-column label="二级发证时间" align="center" prop="level2CertTime" width="120" resizable>
|
|
|
55
|
+ <template #default="{ row }">{{ row.level2CertTime || '-' }}</template>
|
|
|
56
|
+ </el-table-column>
|
|
|
57
|
+ <el-table-column label="三级发证时间" align="center" prop="level3CertTime" width="120" resizable>
|
|
|
58
|
+ <template #default="{ row }">{{ row.level3CertTime || '-' }}</template>
|
|
|
59
|
+ </el-table-column>
|
|
|
60
|
+ <el-table-column label="四级发证时间" align="center" prop="level4CertTime" width="120" resizable>
|
|
|
61
|
+ <template #default="{ row }">{{ row.level4CertTime || '-' }}</template>
|
|
|
62
|
+ </el-table-column>
|
|
|
63
|
+ <el-table-column label="五级发证时间" align="center" prop="level5CertTime" width="120" resizable>
|
|
|
64
|
+ <template #default="{ row }">{{ row.level5CertTime || '-' }}</template>
|
|
|
65
|
+ </el-table-column>
|
|
|
66
|
+ <el-table-column label="录入时间" align="center" prop="createTime" width="170" resizable>
|
|
|
67
|
+ <template #default="{ row }">{{ row.createTime }}</template>
|
|
|
68
|
+ </el-table-column>
|
|
|
69
|
+ </el-table>
|
|
|
70
|
+ <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
|
|
71
|
+ v-model:limit="queryParams.pageSize" @pagination="getList" />
|
|
|
72
|
+ </div>
|
|
|
73
|
+</template>
|
|
|
74
|
+
|
|
|
75
|
+<script setup>
|
|
|
76
|
+import { ref, reactive, onMounted } from 'vue'
|
|
|
77
|
+import { listDept } from '@/api/system/dept'
|
|
|
78
|
+import { deptTreeSelect } from '@/api/system/user'
|
|
|
79
|
+import { listUser } from '@/api/system/user'
|
|
|
80
|
+import { listQualificationCertificateStatus, exportQualificationCertificateStatus } from '@/api/ledger/index'
|
|
|
81
|
+
|
|
|
82
|
+defineOptions({ name: 'LedgerQualificationCertificateStatus' })
|
|
|
83
|
+
|
|
|
84
|
+const loading = ref(false), list = ref([]), total = ref(0), showSearch = ref(true)
|
|
|
85
|
+const dateRange = ref([]), queryRef = ref(null)
|
|
|
86
|
+
|
|
|
87
|
+const queryParams = reactive({
|
|
|
88
|
+ pageNum: 1,
|
|
|
89
|
+ pageSize: 10,
|
|
|
90
|
+ deptId: null,
|
|
|
91
|
+ teamId: null,
|
|
|
92
|
+ groupId: null,
|
|
|
93
|
+ personId: null
|
|
|
94
|
+})
|
|
|
95
|
+
|
|
|
96
|
+const queryDeptOptions = ref([])
|
|
|
97
|
+const queryTeamOptions = ref([])
|
|
|
98
|
+const queryGroupOptions = ref([])
|
|
|
99
|
+const queryPersonOptions = ref([])
|
|
|
100
|
+
|
|
|
101
|
+async function loadQueryDepts() {
|
|
|
102
|
+ const r = await listDept()
|
|
|
103
|
+ queryDeptOptions.value = (r.data || []).filter(d => d.deptType === 'BRIGADE')
|
|
|
104
|
+}
|
|
|
105
|
+
|
|
|
106
|
+async function handleQueryDeptChange(deptId) {
|
|
|
107
|
+ queryParams.teamId = null; queryParams.groupId = null; queryParams.personId = null
|
|
|
108
|
+ queryTeamOptions.value = []; queryGroupOptions.value = []; queryPersonOptions.value = []
|
|
|
109
|
+ if (deptId) {
|
|
|
110
|
+ const r = await deptTreeSelect({ parentId: deptId })
|
|
|
111
|
+ queryTeamOptions.value = r.data || []
|
|
|
112
|
+ }
|
|
|
113
|
+}
|
|
|
114
|
+
|
|
|
115
|
+async function handleQueryTeamChange(val) {
|
|
|
116
|
+ queryParams.groupId = null; queryParams.personId = null
|
|
|
117
|
+ queryGroupOptions.value = []; queryPersonOptions.value = []
|
|
|
118
|
+ if (val) {
|
|
|
119
|
+ const r = await deptTreeSelect({ parentId: val })
|
|
|
120
|
+ queryGroupOptions.value = r.data || []
|
|
|
121
|
+ }
|
|
|
122
|
+}
|
|
|
123
|
+
|
|
|
124
|
+async function handleQueryGroupChange(val) {
|
|
|
125
|
+ queryParams.personId = null
|
|
|
126
|
+ queryPersonOptions.value = []
|
|
|
127
|
+ if (val) {
|
|
|
128
|
+ const r = await listUser({ deptId: val, pageSize: 9999 })
|
|
|
129
|
+ queryPersonOptions.value = r.rows || []
|
|
|
130
|
+ }
|
|
|
131
|
+}
|
|
|
132
|
+
|
|
|
133
|
+function getList() {
|
|
|
134
|
+ loading.value = true
|
|
|
135
|
+ const p = { ...queryParams }
|
|
|
136
|
+ if (dateRange.value?.length === 2) {
|
|
|
137
|
+ p['params[beginTime]'] = dateRange.value[0]
|
|
|
138
|
+ p['params[endTime]'] = dateRange.value[1]
|
|
|
139
|
+ }
|
|
|
140
|
+ listQualificationCertificateStatus(p).then(r => {
|
|
|
141
|
+ list.value = r.rows
|
|
|
142
|
+ total.value = r.total
|
|
|
143
|
+ }).finally(() => loading.value = false)
|
|
|
144
|
+}
|
|
|
145
|
+
|
|
|
146
|
+function handleQuery() { queryParams.pageNum = 1; getList() }
|
|
|
147
|
+
|
|
|
148
|
+function resetQuery() {
|
|
|
149
|
+ dateRange.value = []
|
|
|
150
|
+ Object.assign(queryParams, {
|
|
|
151
|
+ pageNum: 1,
|
|
|
152
|
+ pageSize: 10,
|
|
|
153
|
+ deptId: null,
|
|
|
154
|
+ teamId: null,
|
|
|
155
|
+ groupId: null,
|
|
|
156
|
+ personId: null
|
|
|
157
|
+ })
|
|
|
158
|
+ queryTeamOptions.value = []; queryGroupOptions.value = []; queryPersonOptions.value = []
|
|
|
159
|
+ queryRef.value?.resetFields()
|
|
|
160
|
+ handleQuery()
|
|
|
161
|
+}
|
|
|
162
|
+
|
|
|
163
|
+function handleExport() {
|
|
|
164
|
+ const p = { ...queryParams }
|
|
|
165
|
+ if (dateRange.value?.length === 2) {
|
|
|
166
|
+ p['params[beginTime]'] = dateRange.value[0]
|
|
|
167
|
+ p['params[endTime]'] = dateRange.value[1]
|
|
|
168
|
+ }
|
|
|
169
|
+ exportQualificationCertificateStatus(p)
|
|
|
170
|
+}
|
|
|
171
|
+
|
|
|
172
|
+onMounted(() => {
|
|
|
173
|
+ loadQueryDepts()
|
|
|
174
|
+ getList()
|
|
|
175
|
+})
|
|
|
176
|
+</script>
|