Compare commits

...

2 Commits

Author SHA1 Message Date
PQZ
125c295a63 1 2025-01-18 11:22:27 +08:00
PQZ
65d436e279 1 2025-01-17 13:18:53 +08:00
12 changed files with 885 additions and 1259 deletions

View File

@ -155,6 +155,7 @@ export const DICT_TYPE = {
Drive_card_type : 'drive_card_type',
File_type : 'file_type',
Cource_type : 'cource_type',
COURCE_TYPE : 'cource_type',
Car_blong : 'car_blong',
// 车牌颜色
CAR_LICENSE_COLOR: 'car_license_color',
@ -242,6 +243,9 @@ export const DICT_TYPE = {
// ----------检测相关------------
INS_EQU_TYPE: 'ins_equ_type',
// ----------驾校相关------------
DRIVE_TYPE: 'drive_type'
}
/**

View File

@ -0,0 +1,45 @@
import request from '@/utils/request'
// 创建驾校教练
export function saveCoach(data) {
return request({
url: '/base/dl-drive-school-coach/save',
method: 'post',
data: data
})
}
// 删除驾校教练
export function deleteDlDriveSchoolCoach(id) {
return request({
url: '/base/dl-drive-school-coach/delete?id=' + id,
method: 'delete'
})
}
// 获得驾校教练
export function getDlDriveSchoolCoach(id) {
return request({
url: '/base/dl-drive-school-coach/get?id=' + id,
method: 'get'
})
}
// 获得驾校教练分页
export function getDlDriveSchoolCoachPage(params) {
return request({
url: '/base/dl-drive-school-coach/page',
method: 'get',
params
})
}
// 导出驾校教练 Excel
export function exportDlDriveSchoolCoachExcel(params) {
return request({
url: '/base/dl-drive-school-coach/export-excel',
method: 'get',
params,
responseType: 'blob'
})
}

View File

@ -1,44 +0,0 @@
import request from '@/utils/request'
// 查询驾校教练列表
export function listSchoolCoach(query) {
return request({
url: '/drivingSchool/system/schoolCoach/list',
method: 'get',
params: query
})
}
// 查询驾校教练详细
export function getSchoolCoach(id) {
return request({
url: '/drivingSchool/system/schoolCoach/' + id,
method: 'get'
})
}
// 新增驾校教练
export function addSchoolCoach(data) {
return request({
url: '/drivingSchool/system/schoolCoach',
method: 'post',
data: data
})
}
// 修改驾校教练
export function updateSchoolCoach(data) {
return request({
url: '/drivingSchool/system/schoolCoach',
method: 'put',
data: data
})
}
// 删除驾校教练
export function delSchoolCoach(id) {
return request({
url: '/drivingSchool/system/schoolCoach/' + id,
method: 'delete'
})
}

View File

@ -0,0 +1,188 @@
<template>
<div class="app-container">
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="45%" v-dialogDrag append-to-body>
<el-form ref="formRef" :model="formData" :rules="formRules" v-loading="formLoading" label-width="100px">
<el-form-item label="照片">
<ImageUpload v-model="formData.image"/>
</el-form-item>
<el-form-item label="姓名" prop="name">
<el-input v-model="formData.name" placeholder="请输入姓名"/>
</el-form-item>
<el-form-item label="年龄" prop="age">
<el-input v-model="formData.age" placeholder="请输入年龄"/>
</el-form-item>
<el-form-item label="性别" prop="sex">
<el-radio-group v-model="formData.sex">
<el-radio v-for="dict in this.getDictDatas(DICT_TYPE.SYSTEM_USER_SEX)"
:key="dict.value" :label="dict.value">{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="联系电话" prop="phone">
<el-input v-model="formData.phone" placeholder="请输入联系电话"/>
</el-form-item>
<el-form-item label="身份证号" prop="idNumber">
<el-input v-model="formData.idNumber" placeholder="请输入身份证号"/>
</el-form-item>
<el-form-item label="车牌" prop="carId">
<el-input v-model="formData.carId" placeholder="请输入车牌"/>
</el-form-item>
<el-form-item label="户籍地址" prop="regAddress">
<el-input v-model="formData.regAddress" placeholder="请输入户籍地址"/>
</el-form-item>
<el-form-item label="家庭住址" prop="address">
<el-input v-model="formData.address" placeholder="请输入家庭住址"/>
</el-form-item>
<el-form-item label="教龄" prop="seniority">
<el-input v-model="formData.seniority" placeholder="请输入教龄"/>
</el-form-item>
<el-form-item label="个人简介" prop="instructorDesc">
<el-input v-model="formData.instructorDesc" placeholder="请输入个人简介"/>
</el-form-item>
<el-form-item label="工作人员类型" prop="type">
<el-select v-model="formData.type" placeholder="请选择工作人员类型">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.DRIVE_TYPE)"
:key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item label="身份证" prop="idPhoto">
<ImageUpload v-model="formData.idPhoto" />
</el-form-item>
<el-form-item label="生活照" prop="lifePhoto">
<ImageUpload v-model="formData.lifePhoto" />
</el-form-item>
<el-form-item label="驾驶证" prop="drivePhoto">
<ImageUpload v-model="formData.drivePhoto" />
</el-form-item>
<el-form-item label="其他证件" prop="otherPhoto">
<ImageUpload v-model="formData.otherPhoto" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import * as DlDriveSchoolCoachApi from '@/views/drivingSchool/schoolCoach/api';
import ImageUpload from '@/components/ImageUpload';
export default {
name: "DlDriveSchoolCoachForm",
components: {
ImageUpload,
},
data() {
return {
//
dialogTitle: "",
//
dialogVisible: false,
// 12
formLoading: false,
//
formData: {
image: undefined,
name: undefined,
age: undefined,
sex: undefined,
phone: undefined,
idNumber: undefined,
carId: undefined,
regAddress: undefined,
address: undefined,
seniority: undefined,
instructorDesc: undefined,
type: undefined,
userId: undefined,
idPhoto: undefined,
lifePhoto: undefined,
drivePhoto: undefined,
otherPhoto: undefined,
},
//
formRules: {
name: [
{ required: true, message: '请输入教练/员工名称', trigger: 'blur' },
],
phone: [
{ required: true, message: '请输入教练/员工联系方式,联系方式将作为登录账号', trigger: 'blur' },
],
type: [
{ required: true, message: '请选择工作人员类型', trigger: 'blur' },
],
},
};
},
methods: {
/** 打开弹窗 */
async open(id) {
this.dialogVisible = true;
this.reset();
//
if (id) {
this.formLoading = true;
try {
const res = await DlDriveSchoolCoachApi.getDlDriveSchoolCoach(id);
this.formData = res.data;
this.title = "修改驾校教练";
} finally {
this.formLoading = false;
}
}
this.title = "新增驾校教练";
},
/** 提交按钮 */
async submitForm() {
//
await this.$refs["formRef"].validate();
this.formLoading = true;
try {
const data = this.formData;
//
if (data.id) {
await DlDriveSchoolCoachApi.saveCoach(data);
this.$modal.msgSuccess("修改成功");
this.dialogVisible = false;
this.$emit('success');
return;
}
//
await DlDriveSchoolCoachApi.saveCoach(data);
this.$modal.msgSuccess("新增成功");
this.dialogVisible = false;
this.$emit('success');
} finally {
this.formLoading = false;
}
},
/** 表单重置 */
reset() {
this.formData = {
image: undefined,
name: undefined,
age: undefined,
sex: undefined,
phone: undefined,
idNumber: undefined,
carId: undefined,
regAddress: undefined,
address: undefined,
seniority: undefined,
instructorDesc: undefined,
type: undefined,
userId: undefined,
idPhoto: undefined,
lifePhoto: undefined,
drivePhoto: undefined,
otherPhoto: undefined,
};
this.resetForm("formRef");
}
}
};
</script>

View File

@ -1,344 +1,113 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="姓名" prop="instructorName">
<el-input
v-model="queryParams.instructorName"
placeholder="请输入姓名"
clearable
@keyup.enter.native="handleQuery"
/>
<el-form-item label="姓名" prop="name">
<el-input v-model="queryParams.name" placeholder="请输入姓名" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="驾考车型 " prop="driveCardType">
<el-select v-model="queryParams.driveCardType" placeholder="请选择驾考车型 " clearable>
<el-option
v-for="dict in this.getDictDatas(DICT_TYPE.Drive_card_type)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
<el-form-item label="联系电话" prop="phone">
<el-input v-model="queryParams.phone" placeholder="请输入联系电话" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="科目类型 " prop="subjectType">
<el-select v-model="queryParams.subjectType" placeholder="科目类型 " clearable>
<el-option
v-for="dict in this.getDictDatas(DICT_TYPE.Drive_course_subject)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
<el-form-item label="人员类型" prop="type">
<el-select @keyup.enter.native="handleQuery" v-model="queryParams.type" placeholder="请选择工作人员类型">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.DRIVE_TYPE)"
:key="dict.value" :label="dict.label" :value="dict.value"/>
</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-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @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
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button>
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="openForm(undefined)" >新增</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="schoolCoachList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column
type="index"
width="50">
</el-table-column>
<el-table-column label="姓名" align="center" prop="instructorName" />
<el-table-column label="照片" align="center" prop="image" width="100">
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="照片" align="center" prop="image" width="120">
<template slot-scope="scope">
<image-preview :src="scope.row.image" :width="50" :height="50"/>
<image-preview :src="viewFilePath+scope.row.image" :width="50" :height="50"/>
</template>
</el-table-column>
<!-- <el-table-column label="年龄" align="center" prop="age" />-->
<el-table-column label="性别" align="center" prop="sex" />
<el-table-column label="联系电话" align="center" prop="phone" />
<!-- <el-table-column label="学员人数" align="center" prop="student" />-->
<el-table-column label="车牌" align="center" prop="carId" />
<!-- <el-table-column label="学员人数" align="center" prop="indenty" />-->
<el-table-column label="家庭住址" align="center" prop="address" />
<!-- <el-table-column label="平均星级" align="center" prop="averageStar" />-->
<el-table-column label="驾龄" align="center" prop="experienceYear" />
<el-table-column label="个人简介" align="center" prop="instructorDesc">
<template slot-scope="scope">
<el-button @click="viewContentFun(scope.row.instructorDesc)" type="text" >查看</el-button>
</template>
</el-table-column>
<!-- <el-table-column label="驾驶年龄" align="center" prop="drivingYear" />-->
<el-table-column label="驾考车型 " align="center" prop="driveCardType">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.Drive_card_type" :value="scope.row.driveCardType"/>
</template>
</el-table-column>
<!-- <el-table-column label="科目类型 " align="center" multiple prop="subjectTypeList">
<template slot-scope="scope">
<dict-tag :options="dict.type.drive_course_subject" :value="scope.row.subjectTypeList"/>
</template>
</el-table-column>-->
<!-- <el-table-column label="科目类型" align="center" prop="subjectType" />-->
<!-- <el-table-column label="科目类型" align="center" >
<template slot-scope="scope">
<div>{{scope.row.subjectType}}</div>
</template>
</el-table-column>-->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
<el-table-column label="姓名" align="center" prop="name" width="120"/>
<el-table-column label="教龄" align="center" prop="seniority" width="80"/>
<el-table-column label="人员类型" align="center" prop="type" width="120"/>
<el-table-column label="个人简介" align="left" prop="instructorDesc" />
<el-table-column label="操作" width="150" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.id)">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</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"
/>
<!-- 添加或修改驾校教练对话框 -->
<el-dialog :title="title" :visible.sync="open" width="750px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="姓名" prop="instructorName">
<el-input v-model="form.instructorName" placeholder="请输入姓名" />
</el-form-item>
<el-form-item label="照片" prop="image">
<image-upload v-model="form.image"/>
</el-form-item>
<!-- <el-form-item label="年龄" prop="age">
<el-input v-model="form.age" placeholder="请输入年龄" />
</el-form-item>-->
<el-form-item label="性别" prop="sex">
<el-input v-model="form.sex" placeholder="请输入性别" />
</el-form-item>
<el-form-item label="联系电话" prop="phone">
<el-input type="number" v-model="form.phone" placeholder="请输入联系电话" />
</el-form-item>
<el-form-item label="身份证号" prop="indenty">
<el-input v-model="form.indenty" placeholder="请输入身份证号" />
</el-form-item>
<el-form-item label="车牌" prop="carId">
<el-input v-model="form.carId" placeholder="请输入车牌" />
</el-form-item>
<el-form-item label="家庭住址" prop="address">
<el-input v-model="form.address" placeholder="请输入家庭住址" />
</el-form-item>
<!-- <el-form-item label="学员人数" prop="student">
<el-input v-model="form.student" placeholder="输入学员人数" />
</el-form-item>-->
<!-- <el-form-item label="平均星级" prop="averageStar">
<el-input v-model="form.averageStar" placeholder="请输入平均星级" />
</el-form-item>-->
<el-form-item label="驾龄" prop="experienceYear">
<el-input v-model="form.experienceYear" placeholder="请输入驾龄" />
</el-form-item>
<!-- <el-form-item label="驾驶年龄" prop="drivingYear">
<el-input v-model="form.drivingYear" placeholder="请输入驾驶年龄" />
</el-form-item>-->
<el-form-item label="驾考车型 " prop="driveCardType">
<el-select v-model="form.driveCardType" placeholder="请选择驾考车型 ">
<el-option
v-for="dict in this.getDictDatas(DICT_TYPE.Drive_card_type)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="科目类型 " prop="subjectTypeList">
<el-select v-model="form.subjectTypeList" multiple placeholder="请选择科目类型 ">
<el-option
v-for="dict in this.getDictDatas(DICT_TYPE.Drive_course_subject)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="个人简介">
<editor v-model="form.instructorDesc" :min-height="192"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-dialog title="查看" :visible.sync="viewFlag" width="65%" append-to-body>
<div style="box-sizing: border-box;padding: 15px;overflow: hidden" v-html="instructorDesc"></div>
</el-dialog>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<DlDriveSchoolCoachForm ref="formRef" @success="getList" />
</div>
</template>
<script>
import { listSchoolCoach, getSchoolCoach, delSchoolCoach, addSchoolCoach, updateSchoolCoach } from "./api/schoolCoach";
//import CouponTemplate from "@/views/system/inspection/PartnerManagement/couponTemplate";
import editor from '@/components/Editor/index.vue'
import * as DlDriveSchoolCoachApi from '@/views/drivingSchool/schoolCoach/api';
import DlDriveSchoolCoachForm from '@/views/drivingSchool/schoolCoach/form/DlDriveSchoolCoachForm.vue';
export default {
name: "SchoolCoach",
// components: {CouponTemplate},
components: {editor},
name: "DlDriveSchoolCoach",
components: {
DlDriveSchoolCoachForm,
},
data() {
return {
viewFlag:false,
instructorDesc:"",
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
viewFilePath:process.env.VUE_APP_FILE_API,
//
exportLoading: false,
//
showSearch: true,
//
total: 0,
//
schoolCoachList: [],
//
title: "",
//
open: false,
//
list: [],
//
isExpandAll: true,
//
refreshTable: true,
//
currentRow: {},
//
queryParams: {
subjectType:'',
pageNum: 1,
pageNo: 1,
pageSize: 10,
deptId: null,
image: null,
instructorName: null,
age: null,
sex: null,
averageStar: null,
experienceYear: null,
instructorDesc: null,
drivingYear: null,
driveCardType: null,
name: null,
phone: null,
type: null
},
//
form: {},
//
rules: {
instructorName: [
{ required: true, message: "姓名不能为空", trigger: "blur" }
],
sex: [
{ required: true, message: "性别不能为空", trigger: "change" }
],
phone: [
{ required: true, message: "联系电话不能为空", trigger: "blur" }
],
indenty: [
{ required: true, message: "身份证号不能为空", trigger: "blur" }
],
carId: [
{ required: true, message: "车牌不能为空", trigger: "blur" }
],
address: [
{ required: true, message: "家庭住址不能为空", trigger: "blur" }
],
riveCardType: [
{ required: true, message: "驾证类型不能为空", trigger: "blur" }
],
driveCardType: [
{ required: true, message: "驾驶证类型不能为空", trigger: "blur" }
],
subjectTypeList: [
{ required: true, message: "科目类型不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
viewContentFun(data){
this.instructorDesc = data;
this.viewFlag = true
},
/** 查询驾校教练列表 */
getList() {
/** 查询列表 */
async getList() {
try {
this.loading = true;
listSchoolCoach(this.queryParams).then(response => {
this.schoolCoachList = response.data;
// this.total = response.data.total;
const res = await DlDriveSchoolCoachApi.getDlDriveSchoolCoachPage(this.queryParams);
this.list = res.data.records;
this.total = res.data.total;
} finally {
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
deptId: null,
image: null,
instructorName: null,
age: null,
sex: null,
averageStar: null,
experienceYear: null,
instructorDesc: null,
drivingYear: null,
driveCardType: null,
createTime: null,
createBy: null,
updateTime: null,
updateBy: null
};
this.resetForm("form");
}
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
@ -346,64 +115,21 @@ export default {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加驾校教练";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getSchoolCoach(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改驾校教练";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateSchoolCoach(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addSchoolCoach(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
/** 添加/修改操作 */
openForm(id) {
this.$refs["formRef"].open(id);
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除驾校教练编号为"' + ids + '"的数据项?').then(function() {
return delSchoolCoach(ids);
}).then(() => {
this.getList();
async handleDelete(row) {
const id = row.id;
await this.$modal.confirm('是否确认删除驾校教练编号为"' + id + '"的数据项?')
try {
await DlDriveSchoolCoachApi.deleteDlDriveSchoolCoach(id);
await this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
} catch {}
},
/** 导出按钮操作 */
handleExport() {
this.download('drivingSchool/system/schoolCoach/export', {
...this.queryParams
}, `schoolCoach_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@ -3,7 +3,7 @@ import request from '@/utils/request'
// 查询驾校课程分类列表
export function listDriveSchoolCourse(query) {
return request({
url: '/drivingSchool/system/driveSchoolCourse/list',
url: '/base/dl-drive-school-course/page',
method: 'get',
params: query
})

View File

@ -0,0 +1,53 @@
import request from '@/utils/request'
// 创建驾校课程分类
export function createDlDriveSchoolCourse(data) {
return request({
url: '/base/dl-drive-school-course/create',
method: 'post',
data: data
})
}
// 更新驾校课程分类
export function updateDlDriveSchoolCourse(data) {
return request({
url: '/base/dl-drive-school-course/update',
method: 'put',
data: data
})
}
// 删除驾校课程分类
export function deleteDlDriveSchoolCourse(id) {
return request({
url: '/base/dl-drive-school-course/delete?id=' + id,
method: 'delete'
})
}
// 获得驾校课程分类
export function getDlDriveSchoolCourse(id) {
return request({
url: '/base/dl-drive-school-course/get?id=' + id,
method: 'get'
})
}
// 获得驾校课程分类分页
export function getDlDriveSchoolCoursePage(params) {
return request({
url: '/base/dl-drive-school-course/page',
method: 'get',
params
})
}
// 导出驾校课程分类 Excel
export function exportDlDriveSchoolCourseExcel(params) {
return request({
url: '/base/dl-drive-school-course/export-excel',
method: 'get',
params,
responseType: 'blob'
})
}

View File

@ -0,0 +1,147 @@
<template>
<div class="app-container">
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="45%" v-dialogDrag append-to-body>
<el-form ref="formRef" :model="formData" :rules="formRules" v-loading="formLoading" label-width="100px">
<el-form-item label="课程类型" prop="automatic">
<el-select v-model="formData.automatic" placeholder="请选择课程类型">
<el-option label="请选择字典生成" value=""/>
</el-select>
</el-form-item>
<el-form-item label="驾照类型" prop="license">
<el-input v-model="formData.license" placeholder="请输入驾照类型"/>
</el-form-item>
<el-form-item
label="驾证类型 1C1小型手动挡汽车 2C2小型自动档汽车 3B1中型客车 4B2大型货车 5A1大型客车 6A2牵引车 7A3城市公交车 8D三轮摩托车 9E两轮摩托车 10F轻便摩托车"
prop="type">
<el-select v-model="formData.type"
placeholder="请选择驾证类型 1C1小型手动挡汽车 2C2小型自动档汽车 3B1中型客车 4B2大型货车 5A1大型客车 6A2牵引车 7A3城市公交车 8D三轮摩托车 9E两轮摩托车 10F轻便摩托车">
<el-option label="请选择字典生成" value=""/>
</el-select>
</el-form-item>
<el-form-item label="课程名字" prop="name">
<el-input v-model="formData.name" placeholder="请输入课程名字"/>
</el-form-item>
<el-form-item label="课程开始时间" prop="dayStart">
<el-input v-model="formData.dayStart" placeholder="请输入课程开始时间"/>
</el-form-item>
<el-form-item label="课程结束时间" prop="dayEnd">
<el-input v-model="formData.dayEnd" placeholder="请输入课程结束时间"/>
</el-form-item>
<el-form-item label="价格" prop="price">
<el-input v-model="formData.price" placeholder="请输入价格"/>
</el-form-item>
<el-form-item label="封面图" prop="photo">
<el-input v-model="formData.photo" placeholder="请输入封面图"/>
</el-form-item>
<el-form-item label="课程简介" prop="describ">
<el-input v-model="formData.describ" placeholder="请输入课程简介"/>
</el-form-item>
<el-form-item label="订金" prop="reserveMoney">
<el-input v-model="formData.reserveMoney" placeholder="请输入订金"/>
</el-form-item>
<el-form-item label="交付定金的优惠" prop="favour">
<el-input v-model="formData.favour" placeholder="请输入交付定金的优惠"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import * as DlDriveSchoolCourseApi from '@/views/drivingSchool/schoolCourse/courseApi';
export default {
name: "DlDriveSchoolCourseForm",
components: {},
data() {
return {
//
dialogTitle: "",
//
dialogVisible: false,
// 12
formLoading: false,
//
formData: {
automatic: undefined,
license: undefined,
type: undefined,
name: undefined,
dayStart: undefined,
dayEnd: undefined,
price: undefined,
photo: undefined,
describ: undefined,
reserveMoney: undefined,
favour: undefined,
},
//
formRules: {},
};
},
methods: {
/** 打开弹窗 */
async open(id) {
this.dialogVisible = true;
this.reset();
//
if (id) {
this.formLoading = true;
try {
const res = await DlDriveSchoolCourseApi.getDlDriveSchoolCourse(id);
this.formData = res.data;
this.title = "修改驾校课程分类";
} finally {
this.formLoading = false;
}
}
this.title = "新增驾校课程分类";
},
/** 提交按钮 */
async submitForm() {
//
await this.$refs["formRef"].validate();
this.formLoading = true;
try {
const data = this.formData;
//
if (data.id) {
await DlDriveSchoolCourseApi.updateDlDriveSchoolCourse(data);
this.$modal.msgSuccess("修改成功");
this.dialogVisible = false;
this.$emit('success');
return;
}
//
await DlDriveSchoolCourseApi.createDlDriveSchoolCourse(data);
this.$modal.msgSuccess("新增成功");
this.dialogVisible = false;
this.$emit('success');
} finally {
this.formLoading = false;
}
},
/** 表单重置 */
reset() {
this.formData = {
automatic: undefined,
license: undefined,
type: undefined,
name: undefined,
dayStart: undefined,
dayEnd: undefined,
price: undefined,
photo: undefined,
describ: undefined,
reserveMoney: undefined,
favour: undefined,
};
this.resetForm("formRef");
}
}
};
</script>

View File

@ -1,327 +1,112 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
<el-form-item label="课程类型" prop="type">
<el-select v-model="queryParams.name" placeholder="请选择课程类型" clearable>
<el-option
v-for="dict in this.getDictDatas(DICT_TYPE.Cource_type)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
<!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="课程类型" prop="automatic">
<el-select v-model="queryParams.automatic" placeholder="请选择课程类型" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="课程名字" prop="automatic">
<el-input
v-model="queryParams.automatic"
placeholder="请输入课程名字"
clearable
@keyup.enter.native="handleQuery"
/>
<el-form-item label="课程名字" prop="name">
<el-input v-model="queryParams.name" placeholder="请输入课程名字" clearable @keyup.enter.native="handleQuery"/>
</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-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @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
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button>
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="openForm(undefined)">新增</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="driveSchoolCourseList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column
type="index"
width="50">
</el-table-column>
<el-table-column label="课程类型" align="center" prop="name">
<template slot-scope="scope">
<dict-tag :type="DICT_TYPE.Cource_type" :value="scope.row.name"/>
</template>
</el-table-column>
<!-- <el-table-column label="课程类型" align="center" prop="name" />-->
<el-table-column label="课程名字" align="center" prop="automatic" />
<!-- <el-table-column label="课程开始时间" align="center" prop="dayStart" />
<el-table-column label="课程结束时间" align="center" prop="dayEnd" />-->
<!-- <el-table-column label="价格" align="center" :prop="price" />-->
<el-table-column label="价格" align="center" >
<template #default="data">
<div>{{data.row.price}}</div>
</template>
</el-table-column>
<!-- <el-table-column label="定金" align="center" prop="reserveMoney" />-->
<el-table-column label="定金" align="center" >
<template #default="data">
<div>{{data.row.reserveMoney}}</div>
</template>
</el-table-column>
<el-table-column label="交付定金的优惠:" align="center" >
<template #default="data">
<div>{{data.row.favour}}</div>
</template>
</el-table-column>
<el-table-column label="封面图" align="center" prop="photo" width="100">
<template slot-scope="scope">
<image-preview :src="scope.row.photo" :width="50" :height="50"/>
</template>
</el-table-column>
<el-table-column label="课程简介" align="center" prop="describ">
<template slot-scope="scope">
<el-button @click="viewContentFun(scope.row.describ)" type="text" slot="reference">查看</el-button>
</template>
</el-table-column>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="课程类型" align="center" prop="automatic" />
<el-table-column label="驾照类型" align="center" prop="license" />
<el-table-column label="驾证类型" align="center" prop="type" />
<el-table-column label="课程名字" align="center" prop="name" />
<el-table-column label="课程开始时间" align="center" prop="dayStart" />
<el-table-column label="课程结束时间" align="center" prop="dayEnd" />
<el-table-column label="价格" align="center" prop="price" />
<el-table-column label="封面图" align="center" prop="photo" />
<el-table-column label="课程简介" align="center" prop="describ" />
<el-table-column label="订金" align="center" prop="reserveMoney" />
<el-table-column label="交付定金的优惠" align="center" prop="favour" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">`
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.id)"
v-hasPermi="['base:dl-drive-school-course:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['base:dl-drive-school-course:delete']">删除</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"
/>
<!-- 添加或修改驾校课程分类对话框 -->
<el-dialog :title="title" :visible.sync="open" width="750" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="课程类型" prop="name">
<el-radio-group v-model="form.name">
<el-radio
v-for="dict in this.getDictDatas(DICT_TYPE.Cource_type)"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="课程名字" prop="automatic">
<el-input v-model="form.automatic" placeholder="请输入课程名字" />
</el-form-item>
<!-- <el-form-item label="上课时间" prop="weekDay">
<el-checkbox-group :max="2" v-model="form.weekDay">
<el-checkbox label="星期一">星期一</el-checkbox>
<el-checkbox label="星期二">星期二</el-checkbox>
<el-checkbox label="星期三">星期三</el-checkbox>
<el-checkbox label="星期四">星期四</el-checkbox>
<el-checkbox label="星期五">星期五</el-checkbox>
<el-checkbox label="星期六">星期六</el-checkbox>
<el-checkbox label="星期日">星期日</el-checkbox>
</el-checkbox-group>
</el-form-item>-->
<!-- <el-form-item label="课程开始时间" prop="dayStart">
<el-input v-model="form.dayStart" placeholder="请输入课程开始时间" />
</el-form-item>
<el-form-item label="课程结束时间" prop="dayEnd">
<el-input v-model="form.dayEnd" placeholder="请输入课程结束时间" />
</el-form-item>-->
<el-form-item label="价格(元)" prop="price">
<el-input v-model="form.price" placeholder="请输入价格" />
</el-form-item>
<!-- <el-form-item label="驾照类型" prop="automatic">
<el-input v-model="form.automatic" placeholder="驾照类型" />
</el-form-item>-->
<el-form-item label="驾校优势" prop="license">
<el-input v-model="form.license" placeholder="驾校优势" />
</el-form-item>
<el-form-item label="定金(元)" prop="reserveMoney">
<el-input v-model="form.reserveMoney" placeholder="请输入定金" />
</el-form-item>
<el-form-item label="交付定金优惠(元):" prop="favour">
<el-input v-model="form.favour" placeholder="请输入优惠金额" />
</el-form-item>
<el-form-item label="封面图" prop="photo">
<image-upload :limit="1" v-model="form.photo"/>
</el-form-item>
<el-form-item label="课程简介">
<editor v-model="form.describ" :min-height="192"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-dialog title="查看" :visible.sync="viewFlag" width="65%" append-to-body>
<div style="box-sizing: border-box;padding: 15px;overflow: hidden" v-html="viewContent"></div>
</el-dialog>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<DlDriveSchoolCourseForm ref="formRef" @success="getList" />
</div>
</template>
<script>
import { listDriveSchoolCourse, getDriveSchoolCourse, delDriveSchoolCourse, addDriveSchoolCourse, updateDriveSchoolCourse } from "./api/driveSchoolCourse";
import editor from '@/components/Editor/index.vue'
import * as DlDriveSchoolCourseApi from '@/views/drivingSchool/schoolCourse/courseApi';
import DlDriveSchoolCourseForm from '@/views/drivingSchool/schoolCourse/form/DlDriveSchoolCourseForm.vue';
export default {
name: "DriveSchoolCourse",
components: {editor},
name: "DlDriveSchoolCourse",
components: {
DlDriveSchoolCourseForm,
},
data() {
return {
viewFlag:false,
viewContent:"",
weekDay:[],
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
exportLoading: false,
//
showSearch: true,
//
total: 0,
//
driveSchoolCourseList: [],
//
title: "",
//
open: false,
//
list: [],
//
isExpandAll: true,
//
refreshTable: true,
//
currentRow: {},
//
queryParams: {
pageNum: 1,
pageNo: 1,
pageSize: 10,
deptId: null,
type: null,
name: null,
dayStart: null,
dayEnd: null,
price: null,
automatic: null,
license: null,
photo: null,
describ: null,
name: null,
},
//
form: {},
//
rules: {
type: [
{ required: true, message: "驾驶证类型不能为空", trigger: "blur" }
],
automatic: [
{ required: true, message: "课程名字不能为空", trigger: "blur" }
],
name: [
{ required: true, message: "课程名字不能为空", trigger: "blur" }
],
price: [
{ required: true, trigger: 'blur', message:'金额不能为空'},
],
reserveMoney: [
{ required: true, trigger: 'blur', message:'合同金额不能为空'},
],
photo: [
{ required: true, message: "封面图不能为空", trigger: "blur" }
],
license: [
{ required: true, message: "封面图不能为空", trigger: "blur", size: 5 }
]
}
};
},
created() {
this.getList();
},
methods: {
viewContentFun(data){
this.viewContent =data;
this.viewFlag = true;
},
/** 查询驾校课程分类列表 */
getList() {
/** 查询列表 */
async getList() {
try {
this.loading = true;
listDriveSchoolCourse(this.queryParams).then(response => {
this.driveSchoolCourseList = response.data.records;
this.total = response.data.total;
const res = await DlDriveSchoolCourseApi.getDlDriveSchoolCoursePage(this.queryParams);
this.list = res.data.records;
this.total = res.data.total;
} finally {
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
deptId: null,
type: null,
name: null,
dayStart: null,
dayEnd: null,
price: null,
automatic: null,
license: null,
reserveMoney: null,
weekDay:[],
photo: null,
describ: null,
createTime: null,
createBy: null,
updateTime: null,
updateBy: null
};
this.resetForm("form");
}
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
@ -329,70 +114,32 @@ export default {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.weekDay = []
this.reset();
this.open = true;
this.title = "添加驾校课程分类";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getDriveSchoolCourse(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改驾校课程分类";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateDriveSchoolCourse(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addDriveSchoolCourse(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
if (response.data.weekDay){
this.weekDay = response.data.weekDay.split(",")
}else {
this.weekDay = []
}
});
/** 添加/修改操作 */
openForm(id) {
this.$refs["formRef"].open(id);
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除驾校课程为"' + row.name + '"的数据项?').then(function() {
return delDriveSchoolCourse(ids);
}).then(() => {
this.getList();
async handleDelete(row) {
const id = row.id;
await this.$modal.confirm('是否确认删除驾校课程分类编号为"' + id + '"的数据项?')
try {
await DlDriveSchoolCourseApi.deleteDlDriveSchoolCourse(id);
await this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
} catch {}
},
/** 导出按钮操作 */
handleExport() {
this.download('drivingSchool/system/driveSchoolCourse/export', {
...this.queryParams
}, `driveSchoolCourse_${new Date().getTime()}.xlsx`)
async handleExport() {
await this.$modal.confirm('是否确认导出所有驾校课程分类数据项?');
try {
this.exportLoading = true;
const data = await DlDriveSchoolCourseApi.exportDlDriveSchoolCourseExcel(this.queryParams);
this.$download.excel(data, '驾校课程分类.xls');
} catch {
} finally {
this.exportLoading = false;
}
},
}
};
</script>

View File

@ -0,0 +1,160 @@
<template>
<div class="app-container">
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="45%" v-dialogDrag append-to-body>
<el-form ref="formRef" :model="formData" :rules="formRules" v-loading="formLoading" label-width="100px">
<el-form-item label="姓名" prop="name">
<el-input v-model="formData.name" placeholder="请输入姓名"/>
</el-form-item>
<el-form-item label="年龄" prop="age">
<el-input v-model="formData.age" placeholder="请输入年龄"/>
</el-form-item>
<el-form-item label="性别" prop="sex">
<el-radio-group v-model="formData.sex">
<el-radio v-for="dict in this.getDictDatas(DICT_TYPE.SYSTEM_USER_SEX)"
:key="dict.value" :label="dict.value">{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="联系电话" prop="phone">
<el-input v-model="formData.phone" placeholder="请输入联系电话"/>
</el-form-item>
<el-form-item label="身份证号" prop="idCard">
<el-input v-model="formData.idCard" placeholder="请输入身份证号"/>
</el-form-item>
<el-form-item label="工作单位" prop="workName">
<el-input v-model="formData.workName" placeholder="请输入工作单位"/>
</el-form-item>
<el-form-item label="户籍地址" prop="registAddress">
<el-input v-model="formData.registAddress" placeholder="请输入户籍地址"/>
</el-form-item>
<el-form-item label="家庭住址" prop="address">
<el-input v-model="formData.address" placeholder="请输入家庭住址"/>
</el-form-item>
<el-form-item label="人员类型" prop="type">
<el-select v-model="formData.type" placeholder="请选择人员类型(暂留)">
<el-option label="请选择字典生成" value=""/>
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="formData.remark" placeholder="请输入备注"/>
</el-form-item>
<el-form-item label="证件照" prop="idPhoto">
<ImageUpload v-model="formData.idPhoto" />
</el-form-item>
<el-form-item label="生活照" prop="lifePhoto">
<ImageUpload v-model="formData.lifePhoto" />
</el-form-item>
<el-form-item label="其他照片" prop="otherPhoto">
<ImageUpload v-model="formData.otherPhoto" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import * as DlDriveSchoolStudentApi from '@/views/drivingSchool/student/studentApi';
export default {
name: "DlDriveSchoolStudentForm",
components: {},
data() {
return {
//
dialogTitle: "",
//
dialogVisible: false,
// 12
formLoading: false,
//
formData: {
name: undefined,
age: undefined,
sex: undefined,
phone: undefined,
idCard: undefined,
workName: undefined,
registAddress: undefined,
address: undefined,
type: undefined,
remark: undefined,
userId: undefined,
idPhoto: undefined,
lifePhoto: undefined,
otherPhoto: undefined,
},
//
formRules: {
sex: [{required: true, message: '性别不能为空', trigger: 'blur'}],
},
};
},
methods: {
/** 打开弹窗 */
async open(id) {
this.dialogVisible = true;
this.reset();
//
if (id) {
this.formLoading = true;
try {
const res = await DlDriveSchoolStudentApi.getDlDriveSchoolStudent(id);
this.formData = res.data;
this.title = "修改驾校学员";
} finally {
this.formLoading = false;
}
}
this.title = "新增驾校学员";
},
/** 提交按钮 */
async submitForm() {
//
await this.$refs["formRef"].validate();
this.formLoading = true;
try {
const data = this.formData;
//
if (data.id) {
await DlDriveSchoolStudentApi.updateDlDriveSchoolStudent(data);
this.$modal.msgSuccess("修改成功");
this.dialogVisible = false;
this.$emit('success');
return;
}
//
await DlDriveSchoolStudentApi.createDlDriveSchoolStudent(data);
this.$modal.msgSuccess("新增成功");
this.dialogVisible = false;
this.$emit('success');
} finally {
this.formLoading = false;
}
},
/** 表单重置 */
reset() {
this.formData = {
name: undefined,
age: undefined,
sex: undefined,
phone: undefined,
idCard: undefined,
workName: undefined,
registAddress: undefined,
address: undefined,
type: undefined,
remark: undefined,
userId: undefined,
idPhoto: undefined,
lifePhoto: undefined,
otherPhoto: undefined,
};
this.resetForm("formRef");
}
}
};
</script>

View File

@ -1,533 +1,111 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="姓名" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入姓名"
clearable
@keyup.enter.native="handleQuery"
/>
<el-input v-model="queryParams.name" placeholder="请输入姓名" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="手机号" prop="phone">
<el-input
v-model="queryParams.phone"
placeholder="请输入手机号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="身份证号" prop="identity">
<el-input
v-model="queryParams.identity"
placeholder="请输入身份证号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="state">
<el-select v-model="queryParams.state" placeholder="请选择状态" clearable>
<el-option
v-for="dict in this.getDictDatas('jx_report_state')"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="是否面签" prop="isSign">
<el-select v-model="queryParams.isSign" placeholder="请选择状态" clearable>
<el-option
v-for="dict in this.getDictDatas('sign_status')"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="是否退学" prop="isReturn">
<el-select v-model="queryParams.isReturn" placeholder="请选择状态" clearable>
<el-option
v-for="dict in this.getDictDatas('school_return')"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
<el-form-item label="课程名称" prop="courseName">
<el-input
v-model="queryParams.courseName"
placeholder="请输入课程名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-form-item>
<!-- <el-form-item label="是否下午" prop="afternoon">-->
<!-- <el-input-->
<!-- v-model="queryParams.afternoon"-->
<!-- placeholder="请输入是否下午"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </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-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @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
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-upload2"
size="mini"
@click="handleImport"
>导入
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="openForm(undefined)">新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:pay:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="payList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="类别" align="center" prop="typeDec" />-->
<el-table-column label="序号" align="center" prop="sorNumber" />
<el-table-column label="姓名" align="center" prop="name" />
<el-table-column label="手机号" align="center" prop="phone" />
<el-table-column label="学员照片" align="center" prop="proofTwo" width="100">
<template slot-scope="scope">
<image-preview :src="scope.row.proofTwo" :width="50" :height="50"/>
</template>
</el-table-column>
<el-table-column label="缴费金额" align="center" prop="money" />
<!-- <el-table-column label="家庭住址" align="center" prop="address" />
<el-table-column label="缴费情况" align="center" prop="moneyDetail" />
<el-table-column label="黑谷录入" align="center" prop="blackInto" />
<el-table-column label="管理费" align="center" prop="manageMoney" />
<el-table-column label="科二结款" align="center" prop="towMoney" />
<el-table-column label="科三结款" align="center" prop="thirdMoney" />
<el-table-column label="科二考试日期" align="center" prop="twoTime" />
<el-table-column label="科二结款日期" align="center" prop="twoMoneyTime" />
<el-table-column label="科三考试日期" align="center" prop="thirdTime" />
<el-table-column label="科三结款日期" align="center" prop="thirdMoneyTime" />
<el-table-column label="结款教练" align="center" prop="coursenName" />-->
<!-- <el-table-column label="身份证" align="center" prop="identity" />-->
<!-- <el-table-column label="身份证" align="center" prop="identity" />-->
<el-table-column label="状态" align="center" prop="state">
<template slot-scope="scope">
<dict-tag :options=" this.getDictDatas('jx_report_state')" :value="scope.row.state"/>
</template>
</el-table-column>
<el-table-column label="职业" align="center" prop="prof">
<template slot-scope="scope">
<dict-tag :options="this.getDictDatas('profession')" :value="scope.row.prof"/>
</template>
</el-table-column>
<!-- <el-table-column label="是否面签" align="center" prop="isSign">-->
<!-- <template slot-scope="scope">-->
<!-- <dict-tag :options="dict.type.sign_status" :value="scope.row.isSign"/>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="课程名称" align="center" prop="courseName" />
<!-- <el-table-column label="支付方式" align="center" prop="startPay" >-->
<el-table-column label="报名日期" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="退学日期" align="center" prop="endTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>-->
<el-table-column label="退费金额" align="center" prop="returnMoney" />
<!-- <el-table-column label="转账凭证" align="center" prop="proofOne" width="100">
<template slot-scope="scope">
<image-preview :src="scope.row.proofOne" :width="50" :height="50"/>
</template>
</el-table-column>-->
<el-table-column label="身份证号" align="center" prop="identity" />
<el-table-column label="教练" align="center" >
<template #default="data">
<el-button @click="changeJlClick(data.row.jxId, data.row.id)" size="mini" v-if="!data.row.jlName" type="primary">分配教练</el-button>
<div style="color: #00afff" @click="changeJlClick(data.row.jxId, data.row.id)" v-else>{{data.row.jlName}}</div>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<!-- <el-table-column label="是否下午" align="center" prop="afternoon" />-->
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="姓名" align="center" prop="name"/>
<el-table-column label="年龄" align="center" prop="age"/>
<el-table-column label="性别" align="center" prop="sex"/>
<el-table-column label="联系电话" align="center" prop="phone"/>
<el-table-column label="身份证号" align="center" prop="idCard"/>
<el-table-column label="工作单位" align="center" prop="workName"/>
<el-table-column label="户籍地址" align="center" prop="registAddress"/>
<el-table-column label="家庭住址" align="center" prop="address"/>
<el-table-column label="人员类型" align="center" prop="type"/>
<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="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.id)">修改
</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除
</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"
/>
<!-- 添加或修改订单对话框 -->
<el-dialog :title="title" :visible.sync="open" width="750px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="姓名" prop="name">
<el-input v-model="form.name" placeholder="请输入姓名" />
</el-form-item>
<el-form-item label="手机号" prop="phone">
<el-input v-model="form.phone" placeholder="请输入手机号" />
</el-form-item>
<el-form-item label="学员照片" prop="proofTwo">
<image-upload limit="1" v-model="form.proofTwo"/>
</el-form-item>
<el-form-item label="职业" prop="prof">
<el-radio-group v-model="form.prof">
<el-radio
v-for="dict in this.getDictDatas('profession')"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="状态" prop="state">
<el-radio-group v-model="form.state">
<el-radio
v-for="dict in this.getDictDatas('jx_report_state')"
:key="dict.value"
:label="parseInt(dict.value)"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="是否已面签" prop="isSign">
<el-radio-group v-model="form.isSign">
<el-radio
v-for="dict in this.getDictDatas('sign_status')"
:key="dict.value"
:label="parseInt(dict.value)"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="是否退学" prop="isReturn">
<el-radio-group v-model="form.isReturn">
<el-radio
v-for="dict in this.getDictDatas('school_return')"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<!-- <el-form-item label="支付方式" prop="startPay">
<el-input v-model="form.startPay" placeholder="请输入支付方式" />
</el-form-item>-->
<!-- <el-form-item label="订单编号" prop="orderNumber">
<el-input v-model="form.orderNumber" placeholder="请输入订单编号" />
</el-form-item>-->
<el-form-item label="退费金额(元)" prop="returnMoney">
<el-input v-model="form.returnMoney" placeholder="请输入退费金额" />
</el-form-item>
<el-form-item label="转账凭证" prop="proofOne">
<image-upload limit="1" v-model="form.proofOne"/>
</el-form-item>
<!-- <el-form-item label="是否下午" prop="afternoon">-->
<!-- <el-input v-model="form.afternoon" placeholder="请输入是否下午" />-->
<!-- </el-form-item>-->
</el-form>
<el-form-item label="身份证号" prop="identity">
<el-input v-model="form.identity" placeholder="请输入身份证号" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 修改教练 -->
<el-dialog
:visible.sync="isJl"
width="30%"
>
<el-table v-loading="loading" :data="jlListAll" @selection-change="handleSelectionChange">
<el-table-column label="教练姓名" align="center" prop="instructorName" />
<el-table-column label="手机号" align="center" prop="phone" />
<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="okJlClick(scope.row.instructorName, scope.row.id)"
>选择</el-button>
</template>
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button @click="exitJlClick()"> </el-button>
</span>
</el-dialog>
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div class="el-upload__tip text-center" slot="tip">
<!-- <div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport"/>
是否更新已经存在的用户数据
</div>-->
<span>仅允许导入xlsxlsx格式文件</span>
<!-- <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
@click="importTemplate">下载模板
</el-link>-->
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<DlDriveSchoolStudentForm ref="formRef" @success="getList"/>
</div>
</template>
<script>
// import { listPay, getPay, delPay, addPay, updatePay } from "@/api/system/pay";
import { listPay, getPay, delPay, addPay, updatePay, findJlListAll, updatePayById } from "./api/DriveSchoolPay";
import {getAccessToken} from "@/utils/auth";
import * as DlDriveSchoolStudentApi from '@/views/drivingSchool/student/studentApi';
import DlDriveSchoolStudentForm from '@/views/drivingSchool/student/form/DlDriveSchoolStudentForm.vue';
export default {
name: "Pay",
dicts: ['jx_report_state','sign_status','school_return','profession'],
name: "DlDriveSchoolStudent",
components: {
DlDriveSchoolStudentForm,
},
data() {
return {
//
upload: {
//
open: false,
//
title: "",
//
isUploading: false,
//
updateSupport: 0,
//
headers: {Authorization: "Bearer " + getAccessToken()},
//
url: process.env.VUE_APP_BASE_API + "/system/pay/importData"
},
isJl: false,
jlListAll: [],
bmId: null,
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
exportLoading: false,
//
showSearch: true,
//
total: 0,
//
payList: [],
//
title: "",
//
open: false,
//
list: [],
//
isExpandAll: true,
//
refreshTable: true,
//
currentRow: {},
//
queryParams: {
pageNum: 1,
pageNo: 1,
pageSize: 10,
name: null,
phone: null,
identity: null,
state: null,
startPay: null,
createTime: null,
orderNumber: null,
afternoon: null
type: null,
idPhoto: null,
lifePhoto: null,
otherPhoto: null,
},
//
form: {},
//
rules: {
name: [
{ required: true, message: "姓名不能为空", trigger: "blur" }
],
phone: [
{ required: true, message: "手机号不能为空", trigger: "blur" }
],
state: [
{ required: true, message: "状态不能为空", trigger: "change" }
],
}
};
},
created() {
console.log(this.queryParams,458)
this.getList();
},
methods: {
//
submitFileForm() {
this.$refs.upload.submit();
},
/** 导入按钮操作 */
handleImport() {
this.upload.title = "学员导入";
this.upload.open = true;
},
exitJlClick() {
this.isJl = false
},
async okJlClick(name, id) {
await updatePayById(this.bmId, name, id)
this.isJl = false
console.log(479479)
listPay(this.queryParams).then(response => {
this.payList = response.data.records;
this.total = response.data.total;
this.loading = false;
});
},
async changeJlClick(jlId, bmId) {
this.isJl = true
let res = await findJlListAll(jlId);
this.jlListAll = res
this.bmId = bmId
},
/** 查询订单列表 */
getList() {
/** 查询列表 */
async getList() {
try {
this.loading = true;
console.log(this.queryParams,496)
listPay(this.queryParams).then(response => {
this.payList = response.rows;
this.total = response.total;
const res = await DlDriveSchoolStudentApi.getDlDriveSchoolStudentPage(this.queryParams);
this.list = res.data.records;
this.total = res.data.total;
} finally {
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
name: null,
phone: null,
identity: null,
state: null,
userId: null,
jlId: null,
jxId: null,
courseId: null,
startPay: null,
createTime: null,
orderNumber: null,
afternoon: null
};
this.resetForm("form");
}
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
@ -535,64 +113,33 @@ export default {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加订单";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getPay(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改订单";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updatePay(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addPay(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
/** 添加/修改操作 */
openForm(id) {
this.$refs["formRef"].open(id);
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除订单编号为"' + ids + '"的数据项?').then(function() {
return delPay(ids);
}).then(() => {
this.getList();
async handleDelete(row) {
const id = row.id;
await this.$modal.confirm('是否确认删除驾校学员编号为"' + id + '"的数据项?')
try {
await DlDriveSchoolStudentApi.deleteDlDriveSchoolStudent(id);
await this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
} catch {
}
},
/** 导出按钮操作 */
handleExport() {
this.download('system/pay/export', {
...this.queryParams
}, `pay_${new Date().getTime()}.xlsx`)
async handleExport() {
await this.$modal.confirm('是否确认导出所有驾校学员数据项?');
try {
this.exportLoading = true;
const data = await DlDriveSchoolStudentApi.exportDlDriveSchoolStudentExcel(this.queryParams);
this.$download.excel(data, '驾校学员.xls');
} catch {
} finally {
this.exportLoading = false;
}
},
}
};
</script>

View File

@ -0,0 +1,53 @@
import request from '@/utils/request'
// 创建驾校学员
export function createDlDriveSchoolStudent(data) {
return request({
url: '/base/dl-drive-school-student/create',
method: 'post',
data: data
})
}
// 更新驾校学员
export function updateDlDriveSchoolStudent(data) {
return request({
url: '/base/dl-drive-school-student/update',
method: 'put',
data: data
})
}
// 删除驾校学员
export function deleteDlDriveSchoolStudent(id) {
return request({
url: '/base/dl-drive-school-student/delete?id=' + id,
method: 'delete'
})
}
// 获得驾校学员
export function getDlDriveSchoolStudent(id) {
return request({
url: '/base/dl-drive-school-student/get?id=' + id,
method: 'get'
})
}
// 获得驾校学员分页
export function getDlDriveSchoolStudentPage(params) {
return request({
url: '/base/dl-drive-school-student/page',
method: 'get',
params
})
}
// 导出驾校学员 Excel
export function exportDlDriveSchoolStudentExcel(params) {
return request({
url: '/base/dl-drive-school-student/export-excel',
method: 'get',
params,
responseType: 'blob'
})
}