sc
This commit is contained in:
@@ -3,7 +3,7 @@ import Vue from '@vitejs/plugin-vue'
|
|||||||
import VueJsx from '@vitejs/plugin-vue-jsx'
|
import VueJsx from '@vitejs/plugin-vue-jsx'
|
||||||
import WindiCSS from 'vite-plugin-windicss'
|
import WindiCSS from 'vite-plugin-windicss'
|
||||||
import progress from 'vite-plugin-progress'
|
import progress from 'vite-plugin-progress'
|
||||||
import EslintPlugin from 'vite-plugin-eslint'
|
// import EslintPlugin from 'vite-plugin-eslint'
|
||||||
import PurgeIcons from 'vite-plugin-purge-icons'
|
import PurgeIcons from 'vite-plugin-purge-icons'
|
||||||
import { ViteEjsPlugin } from 'vite-plugin-ejs'
|
import { ViteEjsPlugin } from 'vite-plugin-ejs'
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@@ -75,10 +75,10 @@ export function createVitePlugins() {
|
|||||||
resolvers: [ElementPlusResolver()],
|
resolvers: [ElementPlusResolver()],
|
||||||
exclude: [/[\\/]node_modules[\\/]/]
|
exclude: [/[\\/]node_modules[\\/]/]
|
||||||
}),
|
}),
|
||||||
EslintPlugin({
|
// EslintPlugin({
|
||||||
cache: false,
|
// cache: false,
|
||||||
include: ['src/**/*.vue', 'src/**/*.ts', 'src/**/*.tsx'] // 检查的文件
|
// include: ['src/**/*.vue', 'src/**/*.ts', 'src/**/*.tsx'] // 检查的文件
|
||||||
}),
|
// }),
|
||||||
VueI18nPlugin({
|
VueI18nPlugin({
|
||||||
runtimeOnly: true,
|
runtimeOnly: true,
|
||||||
compositionOnly: true,
|
compositionOnly: true,
|
||||||
|
|||||||
31
src/api/customer/customer.js
Normal file
31
src/api/customer/customer.js
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
// 创建
|
||||||
|
export const createCustomer = (data) => {
|
||||||
|
return request.post({ url: '/admin-api/applet/xunjia/user/add', data, isSubmitForm: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改
|
||||||
|
export const updateCustomer = (data) => {
|
||||||
|
return request.put({ url: '/admin-api/applet/xunjia/user/update', data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 分页
|
||||||
|
export const getCustomerPage = (params) => {
|
||||||
|
return request.get({ url: '/admin-api/applet/xunjia/user/page', params })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除
|
||||||
|
export const deleteCustomer = (userId) => {
|
||||||
|
return request.delete({ url: '/admin-api/applet/xunjia/user/delete', params: { userId } })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取考试车型
|
||||||
|
export const getCustomerExamCarType = () => {
|
||||||
|
return request.get({ url: '/admin-api/applet/xunjia/car/simple-list' })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导入学员
|
||||||
|
export const importStudent = async (data) => {
|
||||||
|
return await request.upload({ url: '/admin-api/applet/xunjia/user/import', data })
|
||||||
|
}
|
||||||
10
src/api/customer/examRecord.js
Normal file
10
src/api/customer/examRecord.js
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import request from '@/config/axios'
|
||||||
|
// 分页
|
||||||
|
export const getRecordPage = (data) => {
|
||||||
|
return request.post({ url: '/admin-api/applet/xunjia/qestionTest/page', data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出
|
||||||
|
export const exportRecord = (params) => {
|
||||||
|
return request.download({ url: '/admin-api/applet/xunjia/qestionTest/export', params })
|
||||||
|
}
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
import request from '@/config/axios'
|
|
||||||
|
|
||||||
// 创建
|
|
||||||
export const createCustomer = (data) => {
|
|
||||||
return request.post({ url: '/admin-api/tiku/customer/create', data, isSubmitForm: true })
|
|
||||||
}
|
|
||||||
|
|
||||||
// 分页
|
|
||||||
export const getCustomerSimpleList = (params) => {
|
|
||||||
return request.get({ url: '/admin-api/tiku/customer/list-all-simple', params })
|
|
||||||
}
|
|
||||||
|
|
||||||
// 修改
|
|
||||||
export const updateCustomer = (data) => {
|
|
||||||
return request.put({ url: '/admin-api/tiku/customer/update', data })
|
|
||||||
}
|
|
||||||
|
|
||||||
// 分页
|
|
||||||
export const getCustomerPage = (params) => {
|
|
||||||
return request.get({ url: '/admin-api/tiku/customer/page', params })
|
|
||||||
}
|
|
||||||
|
|
||||||
// 详情
|
|
||||||
export const getCustomerDetail = (id) => {
|
|
||||||
return request.get({ url: '/admin-api/tiku/customer/get', params: { id } })
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除
|
|
||||||
export const deleteCustomer = (id) => {
|
|
||||||
return request.delete({ url: '/admin-api/tiku/customer/delete', params: { id } })
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取钉钉id
|
|
||||||
export const getDingUserId = (params) => {
|
|
||||||
return request.get({ url: '/admin-api/tiku/customer/getDingTalkUserIdByMobile', params })
|
|
||||||
}
|
|
||||||
@@ -51,9 +51,9 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/Home',
|
path: '',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
redirect: '/Home/index',
|
redirect: '/index',
|
||||||
name: '',
|
name: '',
|
||||||
meta: {
|
meta: {
|
||||||
title: '首页'
|
title: '首页'
|
||||||
@@ -129,35 +129,6 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
|||||||
// }
|
// }
|
||||||
// ]
|
// ]
|
||||||
// },
|
// },
|
||||||
{
|
|
||||||
path: '/Customer',
|
|
||||||
component: Layout,
|
|
||||||
name: 'Customer',
|
|
||||||
meta: {
|
|
||||||
title: '客户管理'
|
|
||||||
},
|
|
||||||
redirect: '/Customer/customer',
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: 'customer',
|
|
||||||
component: () => import('@/views/Customer/Customer/index.vue'),
|
|
||||||
name: 'CustomerList',
|
|
||||||
meta: {
|
|
||||||
canTo: true,
|
|
||||||
title: '学员管理'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'ExamRecord',
|
|
||||||
component: () => import('@/views/Customer/ExamRecord/index.vue'),
|
|
||||||
name: 'ExamRecord',
|
|
||||||
meta: {
|
|
||||||
canTo: true,
|
|
||||||
title: '考试成绩'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: '/login',
|
path: '/login',
|
||||||
component: () => import('@/views/Login/Login.vue'),
|
component: () => import('@/views/Login/Login.vue'),
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
>
|
>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="学员姓名" prop="name">
|
<el-form-item label="学员姓名" prop="userName">
|
||||||
<el-input v-model="formData.name" placeholder="请输入学员姓名" />
|
<el-input v-model="formData.userName" placeholder="请输入学员姓名" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@@ -24,8 +24,8 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="手机号码" prop="mobile">
|
<el-form-item label="手机号码" prop="phone">
|
||||||
<el-input v-model="formData.mobile" maxlength="11" placeholder="请输入手机号码" />
|
<el-input v-model="formData.phone" maxlength="11" placeholder="请输入手机号码" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@@ -34,23 +34,6 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="钉钉手机号">
|
|
||||||
<el-input
|
|
||||||
v-model="formData.ddPhone"
|
|
||||||
placeholder="请输入钉钉手机号"
|
|
||||||
clearable
|
|
||||||
@blur="getDingdingUserId"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="钉钉Id" prop="dingUserId">
|
|
||||||
<el-input v-model="formData.dingUserId" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="考试类型" prop="examType">
|
<el-form-item label="考试类型" prop="examType">
|
||||||
@@ -64,9 +47,9 @@
|
|||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in cartypeOptions"
|
v-for="item in cartypeOptions"
|
||||||
:key="item.id"
|
:key="item.carTypeId"
|
||||||
:label="item.name"
|
:label="item.carName"
|
||||||
:value="item.id"
|
:value="item.carTypeId"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -80,10 +63,8 @@
|
|||||||
</Dialog>
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
<script name="DialogCustomer" setup>
|
<script name="DialogCustomer" setup>
|
||||||
import { formatDate } from '@/utils/formatTime'
|
|
||||||
import { defaultProps, handleTree } from '@/utils/tree'
|
|
||||||
|
|
||||||
import * as CustomerApi from '@/api/Customer/customer'
|
import * as CustomerApi from '@/api/Customer/customer.js'
|
||||||
|
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
@@ -94,15 +75,15 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
|
|||||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||||
const formData = ref({})
|
const formData = ref({})
|
||||||
const formRules = ref({
|
const formRules = ref({
|
||||||
name: [{ required: true, message: '学员姓名不能为空', trigger: 'blur' }],
|
userName: [{ required: true, message: '学员姓名不能为空', trigger: 'blur' }],
|
||||||
idcard: [
|
idcard: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入正确的邮箱地址',
|
message: '请输入身份证号',
|
||||||
trigger: 'blur'
|
trigger: 'blur'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
mobile: [{ required: true, message: '手机号不能为空', trigger: 'blur' }]
|
phone: [{ required: true, message: '手机号不能为空', trigger: 'blur' }]
|
||||||
})
|
})
|
||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
const cartypeOptions = ref([])
|
const cartypeOptions = ref([])
|
||||||
@@ -110,31 +91,23 @@ const cartypeOptions = ref([])
|
|||||||
const deptList = ref([])
|
const deptList = ref([])
|
||||||
|
|
||||||
/** 打开弹窗 */
|
/** 打开弹窗 */
|
||||||
const open = async (type, id) => {
|
const open = async (type, info) => {
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
dialogTitle.value = t('action.' + type)
|
dialogTitle.value = t('action.' + type)
|
||||||
formType.value = type
|
formType.value = type
|
||||||
resetForm()
|
resetForm()
|
||||||
// 修改时,设置数据
|
// 修改时,设置数据
|
||||||
if (id) {
|
if (info?.userId) {
|
||||||
formLoading.value = true
|
formData.value = { ...info }
|
||||||
try {
|
|
||||||
formData.value = await CustomerApi.getCustomerDetail(id)
|
|
||||||
} finally {
|
|
||||||
formLoading.value = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
deptList.value = handleTree(await DeptApi.getSimpleDeptList({ allFlag: true }))
|
|
||||||
getOptions()
|
getOptions()
|
||||||
}
|
}
|
||||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
function getOptions() {
|
function getOptions() {
|
||||||
cartypeOptions.value = [
|
CustomerApi.getCustomerExamCarType().then((data) => {
|
||||||
{ id: '1', name: 'C1' },
|
cartypeOptions.value = data
|
||||||
{ id: '2', name: 'C2' },
|
})
|
||||||
{ id: '3', name: 'C3' }
|
|
||||||
] // 示例数据
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 提交表单 */
|
/** 提交表单 */
|
||||||
@@ -166,12 +139,12 @@ const submitForm = async () => {
|
|||||||
/** 重置表单 */
|
/** 重置表单 */
|
||||||
const resetForm = () => {
|
const resetForm = () => {
|
||||||
formData.value = {
|
formData.value = {
|
||||||
name: '',
|
userName: '',
|
||||||
mobile: '',
|
phone: '',
|
||||||
idcard: '',
|
idcard: '',
|
||||||
id: undefined,
|
id: undefined,
|
||||||
sex: 1,
|
sex: 1,
|
||||||
examType: []
|
examType: [1011]
|
||||||
}
|
}
|
||||||
formRef.value?.resetFields()
|
formRef.value?.resetFields()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<el-form :model="searchForm" inline @submit.prevent>
|
<el-form :model="searchForm" inline @submit.prevent>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-input
|
<el-input
|
||||||
v-model="searchForm.name"
|
v-model="searchForm.userName"
|
||||||
placeholder="请输入姓名"
|
placeholder="请输入姓名"
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter="handleQuery"
|
@keyup.enter="handleQuery"
|
||||||
@@ -26,50 +26,60 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-select
|
<el-select
|
||||||
v-model="searchForm.examType"
|
v-model="searchForm.examType"
|
||||||
placeholder="选择考试类型"
|
placeholder="选择考试类型"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
multiple
|
@change="handleQuery"
|
||||||
@change="handleQuery">
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in carTypeOptions"
|
v-for="item in carTypeOptions"
|
||||||
:key="item.value"
|
:key="item.carTypeId"
|
||||||
:label="item.label"
|
:label="item.carName"
|
||||||
:value="item.value" />
|
:value="item.carTypeId"
|
||||||
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button @click="handleQuery" v-hasPermi="['pers:employee:search']">搜索</el-button>
|
<el-button @click="handleQuery" v-hasPermi="['customer:customer:search']">搜索</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
plain
|
plain
|
||||||
@click="openForm('create')"
|
@click="openForm('create')"
|
||||||
v-hasPermi="['pers:employee:add']"
|
v-hasPermi="['customer:customer:add']"
|
||||||
>
|
>
|
||||||
新增
|
新增
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-upload
|
||||||
|
style="margin-left: 10px"
|
||||||
|
ref="studentFile"
|
||||||
|
action="#"
|
||||||
|
:limit="1"
|
||||||
|
accept=".xls,.xlsx"
|
||||||
|
:show-file-list="false"
|
||||||
|
:before-upload="fileBeforeUpload"
|
||||||
|
:http-request="handleImport"
|
||||||
|
v-hasPermi="['customer:customer:import']"
|
||||||
|
>
|
||||||
|
<el-button type="primary" plain>导入</el-button>
|
||||||
|
</el-upload>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="tableList" border stripe>
|
<el-table v-loading="loading" :data="tableList" border stripe>
|
||||||
<el-table-column type="index" width="50" />
|
<el-table-column type="index" width="50" />
|
||||||
<el-table-column label="姓名" prop="name" />
|
<el-table-column label="姓名" prop="userName" />
|
||||||
<el-table-column label="职位" prop="post" />
|
<el-table-column label="性别" prop="sex" />
|
||||||
<el-table-column label="手机号码" prop="mobile" width="120" />
|
<el-table-column label="手机号码" prop="phone" width="120" />
|
||||||
<el-table-column label="微信号" prop="wxAlias" min-width="120" />
|
<el-table-column label="身份证号" prop="idcard" min-width="120" />
|
||||||
<el-table-column label="钉钉号" prop="dingUserId" min-width="120" />
|
<el-table-column label="考试类型" prop="examType" min-width="120" />
|
||||||
<el-table-column label="考勤方案" prop="attendanceSettingName" width="100" />
|
|
||||||
<el-table-column label="绩效考核人" prop="meritsExamineUserNames" width="120" />
|
|
||||||
<el-table-column label="已开通系统" prop="instanceName" min-width="120" />
|
|
||||||
<el-table-column label="操作" width="260" fixed="right">
|
<el-table-column label="操作" width="260" fixed="right">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
link
|
link
|
||||||
@click="openForm('update', scope.row.id)"
|
@click="openForm('update', scope.row)"
|
||||||
v-hasPermi="['pers:employee:update']"
|
v-hasPermi="['pers:employee:update']"
|
||||||
>
|
>
|
||||||
修改
|
修改
|
||||||
@@ -77,7 +87,7 @@
|
|||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
link
|
link
|
||||||
@click="handleDelete(scope.row.id)"
|
@click="handleDelete(scope.row.userId)"
|
||||||
v-hasPermi="['pers:employee:delete']"
|
v-hasPermi="['pers:employee:delete']"
|
||||||
>
|
>
|
||||||
删除
|
删除
|
||||||
@@ -98,7 +108,7 @@
|
|||||||
<script name="CustomerList" setup>
|
<script name="CustomerList" setup>
|
||||||
import DialogCustomer from './Comp/DialogCustomer.vue'
|
import DialogCustomer from './Comp/DialogCustomer.vue'
|
||||||
import { removeNullField } from '@/utils'
|
import { removeNullField } from '@/utils'
|
||||||
import * as CustomerApi from '@/api/Customer/customer'
|
import * as CustomerApi from '@/api/customer/customer.js'
|
||||||
|
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
@@ -106,19 +116,16 @@ const { t } = useI18n() // 国际化
|
|||||||
const carTypeOptions = ref([])
|
const carTypeOptions = ref([])
|
||||||
|
|
||||||
const searchForm = ref({
|
const searchForm = ref({
|
||||||
name: undefined,
|
userName: undefined,
|
||||||
|
examType: 1011,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 20
|
pageSize: 20
|
||||||
})
|
})
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
CustomerApi.getCustomerExamCarType().then((res) => {
|
||||||
carTypeOptions.value = [
|
carTypeOptions.value = res
|
||||||
{ value: '1', label: 'C1' },
|
})
|
||||||
{ value: '2', label: 'C2' },
|
|
||||||
{ value: '3', label: 'C3' }
|
|
||||||
] // 示例数据
|
|
||||||
|
|
||||||
handleQuery()
|
handleQuery()
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -145,8 +152,8 @@ const getList = async () => {
|
|||||||
|
|
||||||
/** 添加/修改操作 */
|
/** 添加/修改操作 */
|
||||||
const formRef = ref()
|
const formRef = ref()
|
||||||
const openForm = (type, id = undefined) => {
|
const openForm = (type, info = undefined) => {
|
||||||
formRef.value.open(type, id)
|
formRef.value.open(type, info)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
@@ -161,6 +168,33 @@ const handleDelete = async (id) => {
|
|||||||
await getList()
|
await getList()
|
||||||
} catch {}
|
} catch {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const fileBeforeUpload = (file) => {
|
||||||
|
let format = '.' + file.name.split('.')[1]
|
||||||
|
if (!['.xls', '.xlsx'].includes(format)) {
|
||||||
|
message.error(`请上传指定格式".xls,.xlsx"文件`)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
let isRightSize = file.size / 1024 / 1024 < 20
|
||||||
|
if (!isRightSize) {
|
||||||
|
message.error('文件大小超过 20MB')
|
||||||
|
}
|
||||||
|
return isRightSize
|
||||||
|
}
|
||||||
|
|
||||||
|
const uploading = ref(false)
|
||||||
|
async function handleImport(data) {
|
||||||
|
uploading.value = true
|
||||||
|
const fd = new FormData()
|
||||||
|
fd.append('file', data.file)
|
||||||
|
try {
|
||||||
|
await CustomerApi.importStudent(fd)
|
||||||
|
message.success('导入成功')
|
||||||
|
handleQuery()
|
||||||
|
} finally {
|
||||||
|
uploading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped></style>
|
||||||
|
|||||||
@@ -0,0 +1,165 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-form :model="searchForm" inline @submit.prevent>
|
||||||
|
<el-form-item>
|
||||||
|
<el-input
|
||||||
|
v-model="searchForm.userName"
|
||||||
|
placeholder="请输入姓名"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-input
|
||||||
|
v-model="searchForm.phone"
|
||||||
|
placeholder="请输入手机号"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-input
|
||||||
|
v-model="searchForm.idcard"
|
||||||
|
placeholder="请输入身份证号"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-select
|
||||||
|
v-model="searchForm.examType"
|
||||||
|
placeholder="选择考试类型"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
@change="handleQuery"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in carTypeOptions"
|
||||||
|
:key="item.carTypeId"
|
||||||
|
:label="item.carName"
|
||||||
|
:value="item.carTypeId"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-select
|
||||||
|
v-model="searchForm.subject"
|
||||||
|
placeholder="选择科目"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
@change="handleQuery"
|
||||||
|
>
|
||||||
|
<el-option label="科一" :value="1" />
|
||||||
|
<el-option label="科四" :value="4" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-date-picker
|
||||||
|
v-model="searchForm.examTime"
|
||||||
|
type="daterange"
|
||||||
|
range-separator="-"
|
||||||
|
start-placeholder="考试日期"
|
||||||
|
end-placeholder="日期"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="handleQuery" v-hasPermi="['customer:exam-record:list']">搜索</el-button>
|
||||||
|
<el-button @click="handleExport" v-hasPermi="['customer:exam-record:export']">
|
||||||
|
导出
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<el-table v-loading="loading" :data="tableList" border stripe>
|
||||||
|
<el-table-column type="index" width="50" />
|
||||||
|
<el-table-column label="姓名" prop="userName" />
|
||||||
|
<el-table-column label="手机号码" prop="phone" width="120" />
|
||||||
|
<el-table-column label="身份证号" prop="idcard" min-width="120" />
|
||||||
|
<el-table-column label="考试类型" prop="examType" min-width="120" />
|
||||||
|
<el-table-column label="考试科目" prop="subject" min-width="120" />
|
||||||
|
<el-table-column label="考试得分" prop="score" min-width="120" />
|
||||||
|
<el-table-column label="交卷时间" prop="createTime" min-width="120" />
|
||||||
|
<el-table-column label="考试时长" prop="testTimeStr" min-width="120" />
|
||||||
|
</el-table>
|
||||||
|
<Pagination
|
||||||
|
:total="total"
|
||||||
|
v-model:page="searchForm.pageNo"
|
||||||
|
v-model:limit="searchForm.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup name="ExamRecord">
|
||||||
|
import { removeNullField } from '@/utils'
|
||||||
|
import * as ExamRecordApi from '@/api/customer/examRecord.js'
|
||||||
|
|
||||||
|
import { getCustomerExamCarType } from '@/api/customer/customer.js'
|
||||||
|
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
|
const carTypeOptions = ref([])
|
||||||
|
|
||||||
|
const searchForm = ref({
|
||||||
|
userName: undefined,
|
||||||
|
examType: 1011,
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 20
|
||||||
|
})
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
getCustomerExamCarType().then((res) => {
|
||||||
|
carTypeOptions.value = res
|
||||||
|
})
|
||||||
|
|
||||||
|
handleQuery()
|
||||||
|
})
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
const handleQuery = () => {
|
||||||
|
searchForm.value.pageNo = 1
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
|
||||||
|
const loading = ref(false)
|
||||||
|
const tableList = ref([])
|
||||||
|
const total = ref(0)
|
||||||
|
/** 查询列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
if (searchForm.value.examTime && searchForm.value.examTime.length > 0) {
|
||||||
|
searchForm.value.startTime = searchForm.value.examTime[0]
|
||||||
|
searchForm.value.endTime = searchForm.value.examTime[1]
|
||||||
|
} else {
|
||||||
|
searchForm.value.startTime = undefined
|
||||||
|
searchForm.value.endTime = undefined
|
||||||
|
}
|
||||||
|
const data = await ExamRecordApi.getRecordPage(removeNullField(searchForm.value))
|
||||||
|
tableList.value = data.list
|
||||||
|
total.value = data.total
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleExport() {
|
||||||
|
const params = removeNullField(searchForm.value)
|
||||||
|
if (params.examTime && params.examTime.length > 0) {
|
||||||
|
params.startTime = params.examTime[0]
|
||||||
|
params.endTime = params.examTime[1]
|
||||||
|
} else {
|
||||||
|
params.startTime = undefined
|
||||||
|
params.endTime = undefined
|
||||||
|
}
|
||||||
|
ExamRecordApi.exportRecord(params).then((res) => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
message.success('导出成功')
|
||||||
|
} else {
|
||||||
|
message.error(res.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped></style>
|
||||||
|
|||||||
Reference in New Issue
Block a user