0424
This commit is contained in:
parent
d3fea212aa
commit
fb1f2df2e0
@ -36,3 +36,6 @@ VUE_APP_IMAGE_URL = 'http://122.51.230.86:9000/'
|
||||
|
||||
#小程序推广码前缀
|
||||
VUE_APP_REPAIR_PREX = 'https://www.lighting-it.cn/share?inviteId='
|
||||
|
||||
# 高德地图密钥
|
||||
VUE_APP_AMAP_KEY = 'd0a6d2fc229e376f6bb20d976b4033ef'
|
||||
|
@ -11,7 +11,7 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="企业简称" prop="simpleName">
|
||||
<el-input v-model="formData.simpleName" placeholder="请输入企业简称" maxlength="255" />
|
||||
<el-input v-model="formData.simpleName" placeholder="请输入企业简称" maxlength="255"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -63,31 +63,36 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系方式" prop="mobilePhone">
|
||||
<el-input type="tel" v-model="formData.mobilePhone" placeholder="请输入联系方式" maxlength="11" />
|
||||
<el-input type="tel" v-model="formData.mobilePhone" placeholder="请输入联系方式" maxlength="11"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="2">
|
||||
<el-col :span="12">
|
||||
<el-form-item v-if="formData.id === undefined" label="管理员登录账号" prop="loginAccount">
|
||||
<el-input v-model="formData.loginAccount" placeholder="请输入管理员登录账号" maxlength="16" />
|
||||
<el-input v-model="formData.loginAccount" placeholder="请输入管理员登录账号" maxlength="16"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item v-if="formData.id === undefined" label="管理员登录密码" prop="password">
|
||||
<el-input v-model="formData.password" placeholder="请输入管理员登录密码" type="password" maxlength="16" show-password />
|
||||
<el-input v-model="formData.password" placeholder="请输入管理员登录密码" type="password" maxlength="16"
|
||||
show-password
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="统一社会信用代码" prop="orgCard">
|
||||
<el-input v-model="formData.orgCard" placeholder="请输入统一社会信用代码" maxlength="18"/>
|
||||
</el-form-item> <el-form-item label="开放服务" prop="serviceCodeArray">
|
||||
<el-select style="width: 100%" v-model="formData.serviceCodeArray" multiple placeholder="请选择开放服务" clearable >
|
||||
</el-form-item>
|
||||
<el-form-item label="开放服务" prop="serviceCodeArray">
|
||||
<el-select style="width: 100%" v-model="formData.serviceCodeArray" multiple placeholder="请选择开放服务"
|
||||
clearable
|
||||
>
|
||||
<el-option v-for="item in packageList" :key="item.id" :label="item.name" :value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="详细地址" prop="address">
|
||||
<el-input v-model="formData.address" placeholder="请输入详细地址" maxlength="255" />
|
||||
<el-input v-model="formData.address" placeholder="请输入详细地址" maxlength="255"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="企业简介">
|
||||
<el-input type="textarea" v-model="formData.corpContent" maxlength="900" placeholder="请输入企业简介"/>
|
||||
@ -96,19 +101,68 @@
|
||||
<el-form-item label="经营范围" prop="business">
|
||||
<el-input type="textarea" v-model="formData.business" maxlength="900" placeholder="请输入经营范围"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="公司图片" prop="photo">
|
||||
<ImageUpload v-model="formData.photo" :limit="1"/>
|
||||
</el-form-item>
|
||||
<el-row :gutter="2">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="营业开始时间" prop="businessStartTime">
|
||||
<el-time-picker
|
||||
v-model="formData.businessStartTime"
|
||||
placeholder="营业开始时间"
|
||||
clearable
|
||||
format="HH:mm"
|
||||
value-format="HH:mm"
|
||||
>
|
||||
</el-time-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="营业结束时间" prop="businessEndTime">
|
||||
<el-time-picker
|
||||
v-model="formData.businessEndTime"
|
||||
placeholder="营业结束时间"
|
||||
clearable
|
||||
format="HH:mm"
|
||||
value-format="HH:mm"
|
||||
>
|
||||
</el-time-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="公司地址" >
|
||||
<el-button @click="mapOpen()" style="margin-right: 20px">点击获取定位</el-button>
|
||||
经度:<el-input type="text" v-model="formData.lgt" style="width: 250px; margin-right: 20px" />
|
||||
纬度:<el-input type="text" v-model="formData.lat" style="width: 250px;" />
|
||||
<!--地址:<el-input type="text" v-model="detailedAddress" style="width: 250px;" />-->
|
||||
</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>
|
||||
|
||||
<el-dialog title="获取地址信息" :visible.sync="mapDialogVisible" width="60%">
|
||||
<el-input type="text" v-model="address" placeholder="输入地址" style="width: 250px;" />
|
||||
<el-button icon="el-icon-search" @click="addrHand"></el-button>
|
||||
<div id="container" style="width: 100%; height: 400px; margin-top: 10px"></div> <!-- 地图容器 -->
|
||||
<div slot="footer" class="dialog-footer2">
|
||||
<el-button @click="mapDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="sure()">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as CompanyApi from '@/api/base/company'
|
||||
import Editor from '@/components/Editor'
|
||||
import {getServicePackageList} from "@/api/system/servicePackage";
|
||||
import { getServicePackageList } from '@/api/system/servicePackage'
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
name: 'CompanyForm',
|
||||
@ -142,10 +196,15 @@ export default {
|
||||
loginAccount: undefined,
|
||||
password: undefined,
|
||||
serviceCodeArray: [],
|
||||
serviceCodes:undefined,
|
||||
serviceCodes: undefined,
|
||||
bankAccount: null,
|
||||
account: null,
|
||||
simpleName: null,
|
||||
photo: null,
|
||||
businessStartTime: null,
|
||||
businessEndTime: null,
|
||||
lat: null,
|
||||
lgt: null
|
||||
},
|
||||
// 表单校验
|
||||
formRules: {
|
||||
@ -157,14 +216,22 @@ export default {
|
||||
legalName: [{ required: true, message: '法人姓名不能为空', trigger: 'blur' }],
|
||||
legalCard: [
|
||||
{ required: true, message: '法人身份证号不能为空', trigger: 'blur' },
|
||||
{ pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/, message: '请输入正确的法人身份证号', trigger: ["blur", "change"] },
|
||||
],
|
||||
{
|
||||
pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/,
|
||||
message: '请输入正确的法人身份证号',
|
||||
trigger: ['blur', 'change']
|
||||
}
|
||||
],
|
||||
serviceCodeArray: [{ required: true, message: '开放服务不能为空', trigger: 'blur' }],
|
||||
contactName: [{ required: true, message: '联系人不能为空', trigger: 'blur' }],
|
||||
mobilePhone: [
|
||||
{ required: true, message: '联系方式不能为空', trigger: 'blur' },
|
||||
{ pattern: /^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/,message: '请输入正确的联系方式', trigger: ["blur", "change"] },
|
||||
],
|
||||
{
|
||||
pattern: /^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/,
|
||||
message: '请输入正确的联系方式',
|
||||
trigger: ['blur', 'change']
|
||||
}
|
||||
],
|
||||
loginAccount: [{ required: true, message: '管理员登录账号不能为空', trigger: 'blur' }, {
|
||||
min: 4,
|
||||
max: 16,
|
||||
@ -177,18 +244,32 @@ export default {
|
||||
message: '管理员登录密码长度在4到16个字符',
|
||||
trigger: 'blur'
|
||||
}]
|
||||
}
|
||||
},
|
||||
// longitude:"",
|
||||
// latitude:"",
|
||||
detailedAddress: "",
|
||||
address: "",
|
||||
apikey: process.env.VUE_APP_AMAP_KEY, // 确保这里填写正确的高德地图 API Key
|
||||
lng: "",
|
||||
lat: "",
|
||||
location: "",
|
||||
map: null, // 地图实例
|
||||
mapDialogVisible: false,
|
||||
marker: null, // 地图标记实例
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 获得服务服务列表
|
||||
getServicePackageList().then(response => {
|
||||
this.packageList = response.data;
|
||||
this.packageList = response.data
|
||||
})
|
||||
},
|
||||
mounted() {
|
||||
this.loadAMapAPI();
|
||||
},
|
||||
methods: {
|
||||
/** 打开弹窗 */
|
||||
async open(id) {
|
||||
/* async open(id) {
|
||||
this.dialogVisible = true
|
||||
this.reset()
|
||||
// 修改时,设置数据
|
||||
@ -203,6 +284,23 @@ export default {
|
||||
}
|
||||
}
|
||||
this.dialogTitle = '新增企业信息'
|
||||
}, */
|
||||
async open(id) {
|
||||
this.dialogVisible = true
|
||||
this.reset()
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
this.formLoading = true
|
||||
try {
|
||||
const res = await CompanyApi.getCompany(id)
|
||||
this.formData = res.data
|
||||
this.dialogTitle = '修改企业信息'
|
||||
} finally {
|
||||
this.formLoading = false
|
||||
}
|
||||
} else {
|
||||
this.dialogTitle = '新增企业信息'
|
||||
}
|
||||
},
|
||||
/** 提交按钮 */
|
||||
async submitForm() {
|
||||
@ -212,7 +310,7 @@ export default {
|
||||
debugger
|
||||
try {
|
||||
const data = this.formData
|
||||
let serviceCodes = this.formData.serviceCodeArray.join(",")
|
||||
let serviceCodes = this.formData.serviceCodeArray.join(',')
|
||||
data.serviceCodes = serviceCodes
|
||||
// 修改的提交
|
||||
if (data.id) {
|
||||
@ -249,13 +347,186 @@ export default {
|
||||
loginAccount: undefined,
|
||||
password: undefined,
|
||||
serviceCodeArray: [],
|
||||
serviceCodes:undefined,
|
||||
serviceCodes: undefined,
|
||||
bankAccount: null,
|
||||
account: null,
|
||||
simpleName: null
|
||||
simpleName: null,
|
||||
photo: null,
|
||||
businessStartTime: null,
|
||||
businessEndTime: null,
|
||||
lat: null,
|
||||
lgt: null
|
||||
}
|
||||
// 同时重置临时定位数据
|
||||
this.lng = "";
|
||||
this.lat = "";
|
||||
this.address = "";
|
||||
this.location = "";
|
||||
// 移除地图上的标记
|
||||
if (this.marker) {
|
||||
this.map.remove(this.marker);
|
||||
this.marker = null;
|
||||
}
|
||||
this.resetForm('formRef')
|
||||
},
|
||||
loadAMapAPI() {
|
||||
const script = document.createElement('script');
|
||||
script.src = `https://webapi.amap.com/maps?v=1.4.15&key=${this.apikey}&plugin=AMap.Geocoder`;
|
||||
document.head.appendChild(script);
|
||||
script.onload = () => {
|
||||
this.initMap();
|
||||
};
|
||||
},
|
||||
initMap() {
|
||||
console.log('AMap:', AMap);
|
||||
this.map = new AMap.Map('container', {
|
||||
resizeEnable: true,
|
||||
// 如果有经纬度则居中到该位置,否则使用默认位置
|
||||
center: this.lng && this.lat ? [this.lng, this.lat] : [116.397428, 39.90923],
|
||||
zoom: 17,
|
||||
zoomControl: true,
|
||||
});
|
||||
|
||||
// 如果已有经纬度数据,添加标记
|
||||
if (this.lng && this.lat) {
|
||||
this.marker = new AMap.Marker({
|
||||
position: [this.lng, this.lat],
|
||||
map: this.map,
|
||||
});
|
||||
}
|
||||
|
||||
// 添加点击事件监听器
|
||||
this.map.on('click', (e) => {
|
||||
this.handleMapClick(e);
|
||||
});
|
||||
},
|
||||
/* addrHand() {
|
||||
if (!this.map) {
|
||||
console.error('地图尚未初始化。');
|
||||
return;
|
||||
}
|
||||
const url = `https://restapi.amap.com/v3/geocode/geo?address=${this.address}&key=${this.apikey}&output=json`;
|
||||
axios.get(url)
|
||||
.then((res) => {
|
||||
console.log('res',res)
|
||||
if (res.data.status === '1' && res.data.geocodes.length > 0) {
|
||||
console.log('地址解析成功:', res.data);
|
||||
const geocodes = res.data.geocodes[0];
|
||||
this.location = geocodes.formatted_address;
|
||||
console.log('地址:', this.location);
|
||||
this.lng = geocodes.location.split(',')[0];
|
||||
this.lat = geocodes.location.split(',')[1];
|
||||
console.log('经度:', this.lng, '纬度:', this.lat);
|
||||
this.addMarker();
|
||||
} else {
|
||||
console.error('地址解析失败:', res.data.info);
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.error('请求出错:', error);
|
||||
});
|
||||
}, */
|
||||
addrHand() {
|
||||
if (!this.address) return;
|
||||
const geocoder = new AMap.Geocoder();
|
||||
geocoder.getLocation(this.address, (status, result) => {
|
||||
if (status === 'complete' && result.geocodes.length > 0) {
|
||||
const geocode = result.geocodes[0];
|
||||
this.lng = geocode.location.lng;
|
||||
this.lat = geocode.location.lat;
|
||||
this.formData.lgt = this.lng; // 同步到表单数据
|
||||
this.formData.lat = this.lat; // 同步到表单数据
|
||||
|
||||
if (this.marker) {
|
||||
this.map.remove(this.marker);
|
||||
}
|
||||
this.marker = new AMap.Marker({
|
||||
position: [this.lng, this.lat],
|
||||
map: this.map,
|
||||
});
|
||||
this.map.setCenter([this.lng, this.lat]);
|
||||
}
|
||||
});
|
||||
},
|
||||
addMarker() {
|
||||
const marker = new AMap.Marker({
|
||||
position: new AMap.LngLat(this.lng, this.lat),
|
||||
map: this.map,
|
||||
});
|
||||
this.map.setCenter(new AMap.LngLat(this.lng, this.lat));
|
||||
},
|
||||
handleMapClick(e) {
|
||||
this.lng = e.lnglat.getLng();
|
||||
this.lat = e.lnglat.getLat();
|
||||
this.formData.lgt = this.lng; // 同步到表单数据
|
||||
this.formData.lat = this.lat; // 同步到表单数据
|
||||
|
||||
if (this.marker) {
|
||||
this.map.remove(this.marker);
|
||||
}
|
||||
this.marker = new AMap.Marker({
|
||||
position: [this.lng, this.lat],
|
||||
map: this.map,
|
||||
});
|
||||
this.reverseGeocode(this.lng, this.lat);
|
||||
},
|
||||
reverseGeocode(lng, lat) {
|
||||
const geocoder = new AMap.Geocoder();
|
||||
geocoder.getAddress([lng, lat], (status, result) => {
|
||||
if (status === 'complete' && result.info === 'OK') {
|
||||
this.location = result.regeocode.formattedAddress;
|
||||
this.address = this.location; // 更新地址输入框
|
||||
}
|
||||
});
|
||||
},
|
||||
mapOpen() {
|
||||
this.mapDialogVisible = true;
|
||||
// 如果是新增操作(formData.id为undefined),清空定位数据
|
||||
if (this.formData.id === undefined) {
|
||||
this.lng = "";
|
||||
this.lat = "";
|
||||
this.address = "";
|
||||
this.formData.lgt = null;
|
||||
this.formData.lat = null;
|
||||
} else {
|
||||
// 编辑操作,使用已有的定位数据
|
||||
if (this.formData.lgt && this.formData.lat) {
|
||||
this.lng = this.formData.lgt;
|
||||
this.lat = this.formData.lat;
|
||||
}
|
||||
}
|
||||
this.loadAMapAPI();
|
||||
},
|
||||
sure(){
|
||||
/* this.longitude = this.lng;
|
||||
this.latitude = this.lat;
|
||||
this.detailedAddress = this.location; */
|
||||
this.formData.lgt = this.lng;
|
||||
this.formData.lat = this.lat;
|
||||
this.mapDialogVisible = false;
|
||||
console.log(this.formData)
|
||||
},
|
||||
// 添加组件销毁时的清理
|
||||
/* beforeDestroy() {
|
||||
if (this.map) {
|
||||
this.map.destroy();
|
||||
}
|
||||
} */
|
||||
beforeDestroy() {
|
||||
if (this.map) {
|
||||
this.map.destroy();
|
||||
}
|
||||
if (this.marker) {
|
||||
this.marker.setMap(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped>
|
||||
.dialog-footer2{
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
</style>
|
||||
|
44
src/views/drivingSchool/DriveSchoolGuide/api/guide.js
Normal file
44
src/views/drivingSchool/DriveSchoolGuide/api/guide.js
Normal file
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询业务办理指南列表
|
||||
export function listGuide(query) {
|
||||
return request({
|
||||
url: '/jx/driveSchool/guide/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询业务办理指南详细
|
||||
export function getGuide(id) {
|
||||
return request({
|
||||
url: '/jx/driveSchool/guide/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增业务办理指南
|
||||
export function addGuide(data) {
|
||||
return request({
|
||||
url: '/jx/driveSchool/guide',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改业务办理指南
|
||||
export function updateGuide(data) {
|
||||
return request({
|
||||
url: '/jx/driveSchool/guide',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除业务办理指南
|
||||
export function delGuide(id) {
|
||||
return request({
|
||||
url: '/jx/driveSchool/guide/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
293
src/views/drivingSchool/DriveSchoolGuide/index.vue
Normal file
293
src/views/drivingSchool/DriveSchoolGuide/index.vue
Normal file
@ -0,0 +1,293 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>-->
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
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"
|
||||
v-hasPermi="['system/driveSchool:test:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system/driveSchool:test:remove']"
|
||||
>删除</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/driveSchool:test:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="testList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="标题" align="center" prop="title" />
|
||||
<el-table-column label="业务办理指南内容" align="center" prop="guide" >
|
||||
<template slot-scope="scope">
|
||||
<el-button @click="viewGuideFun(scope.row.guide)" type="text" >查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="短信提醒内容" align="center" prop="msgText" >
|
||||
<template slot-scope="scope">
|
||||
<el-button @click="viewMsgTextFun(scope.row.msgText)" type="text" >查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" :formatter="formatTime" />
|
||||
<el-table-column label="更新时间" align="center" prop="updateTime" :formatter="formatTime" />
|
||||
<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>
|
||||
</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="标题">
|
||||
<el-input
|
||||
type="text"
|
||||
placeholder="请输入标题"
|
||||
v-model="form.title">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="短信提醒内容">
|
||||
<el-input
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
placeholder="请输入需要短信提醒的内容"
|
||||
v-model="form.msgText">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="业务办理指南内容">
|
||||
<editor v-model="form.guide" :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="40%" append-to-body>
|
||||
<div style="box-sizing: border-box;padding: 15px;overflow: hidden" v-html="guide"></div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="查看" :visible.sync="viewFlagMsg" width="40%" append-to-body>
|
||||
<div style="box-sizing: border-box;padding: 15px;overflow: hidden" v-html="msgText"></div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import editor from '@/components/Editor/index.vue'
|
||||
import { addGuide, delGuide, getGuide, listGuide, updateGuide } from '@/views/drivingSchool/DriveSchoolGuide/api/guide'
|
||||
|
||||
export default {
|
||||
name: "Test",
|
||||
components: {editor},
|
||||
data() {
|
||||
return {
|
||||
viewFlag:false,
|
||||
viewFlagMsg:false,
|
||||
guide:"",
|
||||
msgText:"",
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 合同模板表格数据
|
||||
testList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
deptId: null,
|
||||
guide: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
viewGuideFun(data){
|
||||
this.guide = data;
|
||||
this.viewFlag = true
|
||||
},
|
||||
|
||||
viewMsgTextFun(data){
|
||||
this.msgText = data;
|
||||
this.viewFlagMsg = true
|
||||
},
|
||||
/** 查询合同模板列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listGuide(this.queryParams).then(response => {
|
||||
this.testList = response.data.records;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
title: null,
|
||||
guide: null,
|
||||
createTime: null,
|
||||
createBy: null,
|
||||
updateTime: null,
|
||||
updateBy: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
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
|
||||
getGuide(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) {
|
||||
updateGuide(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addGuide(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除业务办理指南编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delGuide(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
formatTime(row, column, cellValue) {
|
||||
if (!cellValue) return '-';
|
||||
const date = new Date(cellValue);
|
||||
return date.toLocaleString();
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
/* handleExport() {
|
||||
this.download('system/driveSchool/test/export', {
|
||||
...this.queryParams
|
||||
}, `test_${new Date().getTime()}.xlsx`)
|
||||
} */
|
||||
}
|
||||
};
|
||||
</script>
|
@ -9,6 +9,15 @@ export function getSchoolCommissionPage(params) {
|
||||
})
|
||||
}
|
||||
|
||||
// 财务新增提成记录
|
||||
export function createSchoolCommission(data){
|
||||
return request({
|
||||
url: '/drive/school-commission/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 查询考试通过列表
|
||||
export function listPass(query) {
|
||||
return request({
|
||||
@ -51,3 +60,11 @@ export function delPass(id) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 不分页获取课程信息
|
||||
export function getCourseList() {
|
||||
return request({
|
||||
url: '/base/dl-drive-school-course/list',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@ -31,6 +31,15 @@
|
||||
<!-- v-hasPermi="['drive:school-commission:export']">导出</el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
>新增提成记录</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
@ -53,11 +62,88 @@
|
||||
@pagination="getList"/>
|
||||
<!-- <!– 对话框(添加 / 修改) –>-->
|
||||
<!-- <SchoolCommissionForm ref="formRef" @success="getList" />-->
|
||||
|
||||
<!-- 添加或修改提成配置对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||
<el-form ref="form" :model="form" label-width="120px">
|
||||
<el-form-item label="教练" prop="coachUserId">
|
||||
<el-select v-model="form.coachUserId" filterable clearable placeholder="请选择教练" @change="handleCoachChange">
|
||||
<el-option
|
||||
v-for="coach in coachList"
|
||||
:key="coach.userId"
|
||||
:label="coach.name"
|
||||
:value="coach.userId"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="课程" prop="courseId">
|
||||
<el-select v-model="form.courseId" filterable clearable placeholder="请选择课程">
|
||||
<el-option
|
||||
v-for="coach in courseList"
|
||||
:key="coach.id"
|
||||
:label="coach.name"
|
||||
:value="coach.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="学员" prop="studentId">
|
||||
<el-select
|
||||
v-model="form.studentId"
|
||||
filterable
|
||||
remote
|
||||
reserve-keyword
|
||||
clearable
|
||||
placeholder="请输入学员姓名搜索"
|
||||
:remote-method="handleStudentSearch"
|
||||
:loading="studentLoading"
|
||||
@visible-change="handleStudentVisibleChange"
|
||||
@focus="handleStudentFocus"
|
||||
@change="handleStudentChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="student in studentList"
|
||||
:key="student.userId"
|
||||
:label="student.name"
|
||||
:value="student.userId"
|
||||
></el-option>
|
||||
<el-pagination
|
||||
small
|
||||
layout="prev, pager, next"
|
||||
:total="studentTotal"
|
||||
:page-size="studentQueryParams.pageSize"
|
||||
:current-page="studentQueryParams.pageNo"
|
||||
@current-change="handleStudentPageChange"
|
||||
v-if="studentTotal > studentQueryParams.pageSize"
|
||||
></el-pagination>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="科目" prop="subject">
|
||||
<el-select v-model="form.subject" filterable clearable placeholder="请选择科目">
|
||||
<el-option
|
||||
v-for="coach in subjectList"
|
||||
:key="coach.value"
|
||||
:label="coach.label"
|
||||
:value="coach.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="教练提成" prop="commissionAmount">
|
||||
<el-input v-model="form.commissionAmount" placeholder="请输入教练提成" style="width: 210px" />
|
||||
</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>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as SchoolCommissionApi from "./api/pass";
|
||||
import { createSchoolCommission, getCourseList } from './api/pass'
|
||||
import { getDlDriveSchoolStudentPage } from "../student/studentApi/index";
|
||||
import { listCoach } from "../drivingSchoolCar/api/car";
|
||||
// import SchoolCommissionForm from './SchoolCommissionForm.vue';
|
||||
export default {
|
||||
name: "SchoolCommission",
|
||||
@ -91,10 +177,49 @@ export default {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 表单参数
|
||||
form: {},
|
||||
coachList: {},
|
||||
courseList: {},
|
||||
|
||||
studentQueryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
name: null // 用于搜索学生姓名
|
||||
},
|
||||
studentLoading: false, // 学生下拉框加载状态
|
||||
studentTotal: 0, // 学生总数
|
||||
studentList: [], // 学生列表数据
|
||||
studentRemoteMethodTimer: null,
|
||||
subjectList: [
|
||||
{
|
||||
value: "1",
|
||||
label: "科目一"
|
||||
},
|
||||
{
|
||||
value: "2",
|
||||
label: "科目二"
|
||||
},
|
||||
{
|
||||
value: "3",
|
||||
label: "科目三"
|
||||
},
|
||||
{
|
||||
value: "4",
|
||||
label: "科目四"
|
||||
}
|
||||
],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getCourseList();
|
||||
this.getCoachList();
|
||||
this.getStudentList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询列表 */
|
||||
@ -122,6 +247,137 @@ export default {
|
||||
openForm(id) {
|
||||
this.$refs["formRef"].open(id);
|
||||
},
|
||||
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加提成记录";
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
deptId: null,
|
||||
deduct: null,
|
||||
courseSubject: null,
|
||||
createTime: null,
|
||||
createBy: null,
|
||||
updateTime: null,
|
||||
updateBy: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
/* updateDeduct(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}); */
|
||||
} else {
|
||||
createSchoolCommission(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 获取课程列表 */
|
||||
getCourseList() {
|
||||
getCourseList().then(response => {
|
||||
this.courseList = response.data;
|
||||
console.log("课程列表:",this.courseList)
|
||||
})
|
||||
},
|
||||
/** 获取教练列表 */
|
||||
getCoachList() {
|
||||
listCoach().then(response => {
|
||||
this.coachList = response.data;
|
||||
console.log("教练列表:",this.coachList)
|
||||
})
|
||||
},
|
||||
/** 获取学生列表 */
|
||||
async getStudentList() {
|
||||
try {
|
||||
this.studentLoading = true;
|
||||
const response = await getDlDriveSchoolStudentPage(this.studentQueryParams);
|
||||
this.studentList = response.data.records;
|
||||
this.studentTotal = response.data.total;
|
||||
} finally {
|
||||
this.studentLoading = false;
|
||||
}
|
||||
},
|
||||
|
||||
/** 学生下拉框分页变化 */
|
||||
handleStudentPageChange(pageNo) {
|
||||
this.studentQueryParams.pageNo = pageNo;
|
||||
this.getStudentList();
|
||||
},
|
||||
|
||||
/** 学生下拉框远程搜索 */
|
||||
handleStudentSearch(query) {
|
||||
// 防抖处理
|
||||
if (this.studentRemoteMethodTimer) {
|
||||
clearTimeout(this.studentRemoteMethodTimer);
|
||||
}
|
||||
|
||||
this.studentRemoteMethodTimer = setTimeout(() => {
|
||||
this.studentQueryParams.name = query;
|
||||
this.studentQueryParams.pageNo = 1; // 搜索时重置页码
|
||||
this.getStudentList();
|
||||
}, 300);
|
||||
},
|
||||
|
||||
/** 学生下拉框显示状态变化 */
|
||||
handleStudentVisibleChange(visible) {
|
||||
if (visible && this.studentList.length === 0) {
|
||||
this.getStudentList();
|
||||
}
|
||||
},
|
||||
|
||||
/** 学生下拉框获取焦点 */
|
||||
handleStudentFocus() {
|
||||
if (this.studentList.length === 0) {
|
||||
this.getStudentList();
|
||||
}
|
||||
},
|
||||
|
||||
/** 教练选择变化事件 */
|
||||
handleCoachChange(coachUserId) {
|
||||
if (coachUserId) {
|
||||
const selectedCoach = this.coachList.find(coach => coach.userId === coachUserId);
|
||||
if (selectedCoach) {
|
||||
this.form.coachName = selectedCoach.name; // 将教练名称存储到 form.coachName
|
||||
console.log('form',this.form)
|
||||
}
|
||||
} else {
|
||||
this.form.coachName = null; // 清空教练名称
|
||||
}
|
||||
},
|
||||
|
||||
/** 学生选择变化事件 */
|
||||
handleStudentChange(studentId) {
|
||||
if (studentId) {
|
||||
const selectedStudent = this.studentList.find(student => student.userId === studentId);
|
||||
if (selectedStudent) {
|
||||
this.form.studentName = selectedStudent.name; // 将学生名称存储到 form.studentName
|
||||
}
|
||||
} else {
|
||||
this.form.studentName = null; // 清空学生名称
|
||||
}
|
||||
},
|
||||
|
||||
// /** 删除按钮操作 */
|
||||
// async handleDelete(row) {
|
||||
// const id = row.id;
|
||||
|
@ -104,6 +104,9 @@
|
||||
<el-form-item label="其他照片" prop="otherPhoto">
|
||||
<ImageUpload v-model="formData.otherPhoto" />
|
||||
</el-form-item>
|
||||
<el-form-item label="体检报告" prop="examinationReport">
|
||||
<ImageUpload v-model="formData.examinationReport" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm" :disabled="formLoading">确 定</el-button>
|
||||
@ -142,6 +145,7 @@ export default {
|
||||
idPhoto: undefined,
|
||||
lifePhoto: undefined,
|
||||
otherPhoto: undefined,
|
||||
examinationReport: undefined,
|
||||
},
|
||||
// 表单校验
|
||||
formRules: {
|
||||
@ -208,6 +212,7 @@ export default {
|
||||
idPhoto: undefined,
|
||||
lifePhoto: undefined,
|
||||
otherPhoto: undefined,
|
||||
examinationReport:undefined,
|
||||
};
|
||||
this.resetForm("formRef");
|
||||
}
|
||||
|
@ -30,6 +30,7 @@
|
||||
<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="drivingStudentCode"/>
|
||||
<el-table-column label="备注" align="center" prop="remark"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template v-slot="scope">
|
||||
|
Loading…
Reference in New Issue
Block a user