1
This commit is contained in:
parent
65d436e279
commit
125c295a63
@ -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',
|
||||
|
53
src/views/drivingSchool/schoolCourse/courseApi/index.js
Normal file
53
src/views/drivingSchool/schoolCourse/courseApi/index.js
Normal 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'
|
||||
})
|
||||
}
|
@ -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="驾证类型 1:C1小型手动挡汽车 2:C2小型自动档汽车 3:B1中型客车 4:B2大型货车 5:A1大型客车 6:A2牵引车 7:A3城市公交车 8:D三轮摩托车 9:E两轮摩托车 10:F轻便摩托车"
|
||||
prop="type">
|
||||
<el-select v-model="formData.type"
|
||||
placeholder="请选择驾证类型 1:C1小型手动挡汽车 2:C2小型自动档汽车 3:B1中型客车 4:B2大型货车 5:A1大型客车 6:A2牵引车 7:A3城市公交车 8:D三轮摩托车 9:E两轮摩托车 10:F轻便摩托车">
|
||||
<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,
|
||||
// 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
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>
|
@ -1,308 +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="price">
|
||||
<el-input v-model="form.price" 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();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
@ -310,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>
|
||||
|
@ -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,
|
||||
// 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
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>
|
@ -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 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="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="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" prop="afternoon" />-->
|
||||
<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>仅允许导入xls、xlsx格式文件。</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>
|
||||
|
53
src/views/drivingSchool/student/studentApi/index.js
Normal file
53
src/views/drivingSchool/student/studentApi/index.js
Normal 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'
|
||||
})
|
||||
}
|
Loading…
Reference in New Issue
Block a user