驾校联调
This commit is contained in:
41
src/api/school/class/index.js
Normal file
41
src/api/school/class/index.js
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
// 查询列表-分页
|
||||||
|
export const getClassTypePage = async (params) => {
|
||||||
|
return await request.get({ url: '/admin-api/crm/sch-class-type/page', params })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询详情
|
||||||
|
export const getClassType = async (id) => {
|
||||||
|
return await request.get({ url: '/admin-api/crm/sch-class-type/get?id=' + id })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
export const createClassType = async (data) => {
|
||||||
|
return await request.post({ url: '/admin-api/crm/sch-class-type/create', data: data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改
|
||||||
|
export const updateClassType = async (params) => {
|
||||||
|
return await request.put({ url: '/admin-api/crm/sch-class-type/update', data: params })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除
|
||||||
|
export const deleteClassType = async (id) => {
|
||||||
|
return await request.delete({ url: '/admin-api/crm/sch-class-type/delete?typeId=' + id })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改状态
|
||||||
|
export const updateClassTypeStatus = async (data) => {
|
||||||
|
return request.put({ url: '/admin-api/crm/sch-class-type/status/update', data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 批量修改状态
|
||||||
|
export const batchUpdateClassTypeStatus = async (data) => {
|
||||||
|
return request.put({ url: '/admin-api/crm/sch-class-type/status/batch-update', data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 批量删除
|
||||||
|
export const batchDeleteClassType = async (ids) => {
|
||||||
|
return await request.delete({ url: '/admin-api/crm/sch-class-type/batch-delete?ids=' + ids })
|
||||||
|
}
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
import request from '@/config/axios'
|
import request from '@/config/axios'
|
||||||
|
|
||||||
// 查询列表
|
// 查询列表
|
||||||
export const getSchoolPage = async (params) => {
|
export const getSchoolPage = async (params) => {
|
||||||
return await request.get({ url: '/admin-api/crm/sch-school/page', params })
|
return await request.get({ url: '/admin-api/crm/sch-school/page', params })
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { store } from '../index'
|
|||||||
import { DictDataVO } from '@/api/system/dict/types'
|
import { DictDataVO } from '@/api/system/dict/types'
|
||||||
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
||||||
const { wsCache } = useCache('sessionStorage')
|
const { wsCache } = useCache('sessionStorage')
|
||||||
// import { listSimpleDictData } from '@/api/system/dict/dict.data'
|
import { listSimpleDictData } from '@/api/system/dict/dict.data'
|
||||||
|
|
||||||
export interface DictValueType {
|
export interface DictValueType {
|
||||||
value: any
|
value: any
|
||||||
@@ -45,8 +45,7 @@ export const useDictStore = defineStore('dict', {
|
|||||||
this.dictMap = dictMap
|
this.dictMap = dictMap
|
||||||
this.isSetDict = true
|
this.isSetDict = true
|
||||||
} else {
|
} else {
|
||||||
// const res = await listSimpleDictData()
|
const res = await listSimpleDictData()
|
||||||
const res = []
|
|
||||||
// 设置数据
|
// 设置数据
|
||||||
const dictDataMap = new Map<string, any>()
|
const dictDataMap = new Map<string, any>()
|
||||||
res.forEach((dictData: DictDataVO) => {
|
res.forEach((dictData: DictDataVO) => {
|
||||||
@@ -76,8 +75,7 @@ export const useDictStore = defineStore('dict', {
|
|||||||
},
|
},
|
||||||
async resetDict() {
|
async resetDict() {
|
||||||
wsCache.delete(CACHE_KEY.DICT_CACHE)
|
wsCache.delete(CACHE_KEY.DICT_CACHE)
|
||||||
// const res = await listSimpleDictData()
|
const res = await listSimpleDictData()
|
||||||
const res = []
|
|
||||||
// 设置数据
|
// 设置数据
|
||||||
const dictDataMap = new Map<string, any>()
|
const dictDataMap = new Map<string, any>()
|
||||||
res.forEach((dictData: DictDataVO) => {
|
res.forEach((dictData: DictDataVO) => {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
/* left menu end */
|
/* left menu end */
|
||||||
|
|
||||||
/* logo start */
|
/* logo start */
|
||||||
--logo-height: 50px;
|
--logo-height: 40px;
|
||||||
|
|
||||||
--logo-title-text-color: #fff;
|
--logo-title-text-color: #fff;
|
||||||
|
|
||||||
|
|||||||
@@ -110,45 +110,9 @@ export enum DICT_TYPE {
|
|||||||
SYSTEM_MAIL_SEND_STATUS = 'system_mail_send_status',
|
SYSTEM_MAIL_SEND_STATUS = 'system_mail_send_status',
|
||||||
SYSTEM_NOTIFY_TEMPLATE_TYPE = 'system_notify_template_type',
|
SYSTEM_NOTIFY_TEMPLATE_TYPE = 'system_notify_template_type',
|
||||||
|
|
||||||
// ========== INFRA 模块 ==========
|
|
||||||
INFRA_BOOLEAN_STRING = 'infra_boolean_string',
|
|
||||||
INFRA_JOB_STATUS = 'infra_job_status',
|
|
||||||
INFRA_JOB_LOG_STATUS = 'infra_job_log_status',
|
|
||||||
INFRA_API_ERROR_LOG_PROCESS_STATUS = 'infra_api_error_log_process_status',
|
|
||||||
INFRA_CONFIG_TYPE = 'infra_config_type',
|
|
||||||
INFRA_CODEGEN_TEMPLATE_TYPE = 'infra_codegen_template_type',
|
|
||||||
INFRA_CODEGEN_FRONT_TYPE = 'infra_codegen_front_type',
|
|
||||||
INFRA_CODEGEN_SCENE = 'infra_codegen_scene',
|
|
||||||
INFRA_FILE_STORAGE = 'infra_file_storage',
|
|
||||||
|
|
||||||
// ========== BPM 模块 ==========
|
|
||||||
BPM_MODEL_CATEGORY = 'bpm_model_category',
|
|
||||||
BPM_MODEL_FORM_TYPE = 'bpm_model_form_type',
|
|
||||||
BPM_TASK_ASSIGN_RULE_TYPE = 'bpm_task_assign_rule_type',
|
|
||||||
BPM_PROCESS_INSTANCE_STATUS = 'bpm_process_instance_status',
|
|
||||||
BPM_PROCESS_INSTANCE_RESULT = 'bpm_process_instance_result',
|
|
||||||
BPM_TASK_ASSIGN_SCRIPT = 'bpm_task_assign_script',
|
|
||||||
BPM_OA_LEAVE_TYPE = 'bpm_oa_leave_type',
|
|
||||||
|
|
||||||
// ========== PAY 模块 ==========
|
|
||||||
PAY_CHANNEL_WECHAT_VERSION = 'pay_channel_wechat_version', // 微信渠道版本
|
|
||||||
PAY_CHANNEL_ALIPAY_SIGN_TYPE = 'pay_channel_alipay_sign_type', // 支付渠道支付宝算法类型
|
|
||||||
PAY_CHANNEL_ALIPAY_MODE = 'pay_channel_alipay_mode', // 支付宝公钥类型
|
|
||||||
PAY_CHANNEL_ALIPAY_SERVER_TYPE = 'pay_channel_alipay_server_type', // 支付宝网关地址
|
|
||||||
PAY_CHANNEL_CODE_TYPE = 'pay_channel_code_type', // 支付渠道编码类型
|
|
||||||
PAY_ORDER_NOTIFY_STATUS = 'pay_order_notify_status', // 商户支付订单回调状态
|
|
||||||
PAY_ORDER_STATUS = 'pay_order_status', // 商户支付订单状态
|
|
||||||
PAY_ORDER_REFUND_STATUS = 'pay_order_refund_status', // 商户支付订单退款状态
|
|
||||||
PAY_REFUND_ORDER_STATUS = 'pay_refund_order_status', // 退款订单状态
|
|
||||||
PAY_REFUND_ORDER_TYPE = 'pay_refund_order_type', // 退款订单类别
|
|
||||||
|
|
||||||
// ========== MP 模块 ==========
|
|
||||||
MP_AUTO_REPLY_REQUEST_MATCH = 'mp_auto_reply_request_match', // 自动回复请求匹配类型
|
|
||||||
MP_MESSAGE_TYPE = 'mp_message_type', // 消息类型
|
|
||||||
|
|
||||||
// ========== MALL 模块 ==========
|
// ========== MALL 模块 ==========
|
||||||
PRODUCT_UNIT = 'product_unit', // 商品单位
|
PRODUCT_UNIT = 'product_unit', // 商品单位
|
||||||
PRODUCT_SPU_STATUS = 'product_spu_status', //商品状态
|
PRODUCT_SPU_STATUS = 'product_spu_status', //商品状态
|
||||||
// ========== MALL 交易模块 ==========
|
// ========== 驾校管理 ==========
|
||||||
EXPRESS_CHARGE_MODE = 'trade_delivery_express_charge_mode' //快递的计费方式
|
LINCENSE_TYPE = 'license_type' //驾照类型
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,31 +7,33 @@
|
|||||||
v-loading="formLoading"
|
v-loading="formLoading"
|
||||||
:model="formData"
|
:model="formData"
|
||||||
:rules="formRules"
|
:rules="formRules"
|
||||||
label-width="80px"
|
label-width="90px"
|
||||||
>
|
>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="12" :offset="0">
|
<el-col :span="12" :offset="0">
|
||||||
<el-form-item label="驾校">
|
<el-form-item label="驾校/场地" prop="schPlace">
|
||||||
<el-input v-model="formData.schoolName" disabled />
|
<el-cascader
|
||||||
|
:options="props.schoolOption"
|
||||||
|
v-model="formData.schPlace"
|
||||||
|
filterable
|
||||||
|
:props="{ value: 'id' }"
|
||||||
|
show-all-levels
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="场地">
|
|
||||||
<el-input v-model="formData.placeName" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12" :offset="0">
|
<el-col :span="12" :offset="0">
|
||||||
<el-form-item label="班型名称" prop="typeName">
|
<el-form-item label="班型名称" prop="typeName">
|
||||||
<el-input v-model="formData.typeName" placeholder="请输入班型" />
|
<el-input v-model="formData.typeName" placeholder="请输入班型" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
<el-col :span="12" :offset="0">
|
<el-col :span="12" :offset="0">
|
||||||
<el-form-item label="驾照类型" prop="licenseType">
|
<el-form-item label="驾照类型" prop="licenseType">
|
||||||
<el-select v-model="formData.licenseType" placeholder="选择驾照类型">
|
<el-select v-model="formData.licenseType" placeholder="选择驾照类型">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in licenseTypeOption"
|
v-for="item in getDictOptions(DICT_TYPE.LINCENSE_TYPE)"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
:value="item.value"
|
:value="item.value"
|
||||||
@@ -39,18 +41,11 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12" :offset="0">
|
|
||||||
<el-form-item label="排序" prop="orderNum">
|
|
||||||
<el-input-number v-model="formData.orderNum" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12" :offset="0">
|
<el-col :span="12" :offset="0">
|
||||||
<el-form-item label="状态" prop="currentPrice">
|
<el-form-item label="状态" prop="currentPrice">
|
||||||
<el-radio-group v-model="formData.status">
|
<el-radio-group v-model="formData.status">
|
||||||
<el-radio :label="1">启用</el-radio>
|
<el-radio :label="0">启用</el-radio>
|
||||||
<el-radio :label="0">停用</el-radio>
|
<el-radio :label="1">停用</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -64,19 +59,19 @@
|
|||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="报价信息" name="price">
|
<el-tab-pane label="报价信息" name="price">
|
||||||
<el-button type="primary" @click="handleAddPrice" class="mb-10px">新增报价</el-button>
|
<el-button type="primary" @click="handleAddPrice" class="mb-10px">新增报价</el-button>
|
||||||
<el-table :data="formData.priceList">
|
<el-table :data="formData.quotations">
|
||||||
<el-table-column width="160px">
|
<el-table-column width="160px">
|
||||||
<template #header> <Tooltip message="市场价,给客户的报价" />指导价 </template>
|
<template #header> <Tooltip message="市场价,给客户的报价" />指导价 </template>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-input v-if="row.edit" v-model="row.markerPrice" type="number" :min="0" />
|
<el-input v-if="row.edit" v-model="row.guidingPrice" type="number" :min="0" />
|
||||||
<span v-else>{{ row.markerPrice }}</span>
|
<span v-else>{{ row.guidingPrice }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column width="160px">
|
<el-table-column width="160px">
|
||||||
<template #header> <Tooltip message="员工底价,用于核算毛利及提成" />底价 </template>
|
<template #header> <Tooltip message="员工底价,用于核算毛利及提成" />底价 </template>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-input v-if="row.edit" v-model="row.employeePrice" type="number" :min="0" />
|
<el-input v-if="row.edit" v-model="row.minPrice" type="number" :min="0" />
|
||||||
<span v-else>{{ row.employeePrice }}</span>
|
<span v-else>{{ row.minPrice }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column width="160px">
|
<el-table-column width="160px">
|
||||||
@@ -90,14 +85,16 @@
|
|||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-if="row.edit"
|
v-if="row.edit"
|
||||||
v-model="row.startDate"
|
v-model="row.validTime"
|
||||||
type="date"
|
type="date"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
placeholder="选择日期时间"
|
placeholder="选择日期时间"
|
||||||
/>
|
/>
|
||||||
<span v-else>{{ row.startDate }}</span>
|
<span v-else>{{ row.validTime }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="报价日期" width="180px" prop="createTime" />
|
<el-table-column label="报价日期" width="180px" prop="quotationTime" />
|
||||||
<el-table-column label="操作" width="80px">
|
<el-table-column label="操作" width="80px">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<el-button
|
<el-button
|
||||||
@@ -125,17 +122,19 @@
|
|||||||
>
|
>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="12" :offset="0">
|
<el-col :span="12" :offset="0">
|
||||||
<el-form-item label="生效日期" prop="startDate">
|
<el-form-item label="生效日期" prop="validTime">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="comissionForm.startDate"
|
v-model="comissionForm.validTime"
|
||||||
type="date"
|
type="date"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
placeholder="选择日期时间"
|
placeholder="选择日期时间"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12" :offset="0">
|
<el-col :span="12" :offset="0">
|
||||||
<el-form-item label="结算方式">
|
<el-form-item label="结算方式">
|
||||||
<el-radio-group v-model="comissionForm.type">
|
<el-radio-group v-model="comissionForm.percentageType">
|
||||||
<el-radio :label="1">
|
<el-radio :label="1">
|
||||||
<Tooltip message="可配置多级,命中某档位后,按照档位分级结算" />阶梯结算
|
<Tooltip message="可配置多级,命中某档位后,按照档位分级结算" />阶梯结算
|
||||||
</el-radio>
|
</el-radio>
|
||||||
@@ -157,32 +156,32 @@
|
|||||||
v-for="(item, index) in comissionForm.rules"
|
v-for="(item, index) in comissionForm.rules"
|
||||||
:key="index"
|
:key="index"
|
||||||
>
|
>
|
||||||
<el-select v-model="item.type1" style="width: 100px">
|
<el-select v-model="item.ruleParam1" style="width: 100px">
|
||||||
<el-option label="单笔" :value="1" />
|
<el-option label="单笔" :value="1" />
|
||||||
<el-option label="月总" :value="2" />
|
<el-option label="月总" :value="2" />
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-select class="ml-5px" v-model="item.type2" style="width: 100px">
|
<el-select class="ml-5px" v-model="item.ruleParam2" style="width: 100px">
|
||||||
<el-option label="成交额" :value="1" />
|
<el-option label="成交额" :value="1" />
|
||||||
<el-option label="毛利" :value="2" />
|
<el-option label="毛利" :value="2" />
|
||||||
</el-select>
|
</el-select>
|
||||||
<span class="ml-5px">满</span>
|
<span class="ml-5px">满</span>
|
||||||
<el-input
|
<el-input
|
||||||
class="ml-5px"
|
class="ml-5px"
|
||||||
v-model="item.type3"
|
v-model="item.ruleParam3"
|
||||||
placeholder="金额"
|
placeholder="金额"
|
||||||
type="number"
|
type="number"
|
||||||
:min="0"
|
:min="0"
|
||||||
style="width: 100px"
|
style="width: 100px"
|
||||||
/>
|
/>
|
||||||
<span class="ml-5px">元,</span>
|
<span class="ml-5px">元,</span>
|
||||||
<el-select class="ml-5px" v-model="item.type4" style="width: 120px">
|
<el-select class="ml-5px" v-model="item.ruleParam4" style="width: 120px">
|
||||||
<el-option label="按比例" :value="1" />
|
<el-option label="按比例" :value="1" />
|
||||||
<el-option label="按固定金额" :value="2" />
|
<el-option label="按固定金额" :value="2" />
|
||||||
</el-select>
|
</el-select>
|
||||||
<div v-if="item.type4 == 2" class="inline-flex items-center">
|
<div v-if="item.ruleParam4 == 2" class="inline-flex items-center">
|
||||||
<el-input
|
<el-input
|
||||||
class="ml-5px"
|
class="ml-5px"
|
||||||
v-model="item.type7"
|
v-model="item.ruleParam7"
|
||||||
placeholder="金额"
|
placeholder="金额"
|
||||||
type="number"
|
type="number"
|
||||||
:min="0"
|
:min="0"
|
||||||
@@ -192,7 +191,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div v-else class="inline-flex items-center">
|
<div v-else class="inline-flex items-center">
|
||||||
<span class="ml-5px">取</span>
|
<span class="ml-5px">取</span>
|
||||||
<el-select class="ml-5px" v-model="item.type5" style="width: 100px">
|
<el-select class="ml-5px" v-model="item.ruleParam5" style="width: 100px">
|
||||||
<el-option label="按成交额" :value="1" />
|
<el-option label="按成交额" :value="1" />
|
||||||
<el-option label="按底价" :value="2" />
|
<el-option label="按底价" :value="2" />
|
||||||
<el-option label="按毛利" :value="3" />
|
<el-option label="按毛利" :value="3" />
|
||||||
@@ -200,7 +199,7 @@
|
|||||||
<span class="ml-5px">结算</span>
|
<span class="ml-5px">结算</span>
|
||||||
<el-input
|
<el-input
|
||||||
class="ml-5px"
|
class="ml-5px"
|
||||||
v-model="item.type6"
|
v-model="item.ruleParam6"
|
||||||
placeholder="比例"
|
placeholder="比例"
|
||||||
type="number"
|
type="number"
|
||||||
:min="1"
|
:min="1"
|
||||||
@@ -213,16 +212,19 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20" class="mb-10px">
|
<el-row :gutter="20" class="mb-10px">
|
||||||
<el-col :span="24" :offset="0">
|
<el-col :span="24" :offset="0">
|
||||||
<el-button type="primary" @click="sureAddComission">确认新增</el-button>
|
<el-button @click="comissionShow = false">取消新增</el-button>
|
||||||
<el-button @click="comissionShow = false">取消</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-divider>历史结算规则</el-divider>
|
<el-divider>历史结算规则</el-divider>
|
||||||
<el-table :data="formData.comissionList" border>
|
<el-table :data="formData.percentages" border>
|
||||||
<el-table-column prop="startDate" label="生效时间" width="200px" />
|
<el-table-column prop="validTime" label="生效时间" width="200px" />
|
||||||
<el-table-column prop="typeName" label="结算方式" width="120px" />
|
<el-table-column prop="percentageType" label="结算方式" width="120px" />
|
||||||
<el-table-column prop="ruleDesc" label="结算规则" />
|
<el-table-column label="结算规则">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<div v-dompurify-html="row.ruleParam"></div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
@@ -233,27 +235,41 @@
|
|||||||
</Dialog>
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
<script name="DialogClass" setup>
|
<script name="DialogClass" setup>
|
||||||
|
import * as ClassApi from '@/api/school/class'
|
||||||
import { formatDate } from '@/utils/formatTime'
|
import { formatDate } from '@/utils/formatTime'
|
||||||
|
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
|
||||||
|
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
schoolOption: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
const dialogTitle = ref('') // 弹窗的标题
|
const dialogTitle = ref('') // 弹窗的标题
|
||||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||||
const formData = ref({
|
const formData = ref({
|
||||||
name: '',
|
schPlace: [],
|
||||||
leader: '',
|
typeName: '',
|
||||||
phone: '',
|
licenseType: '',
|
||||||
status: 1,
|
status: 1,
|
||||||
remark: ''
|
remark: '',
|
||||||
|
quotations: [],
|
||||||
|
percentages: []
|
||||||
})
|
})
|
||||||
|
|
||||||
const formRules = reactive({
|
const formRules = reactive({
|
||||||
name: [{ required: true, message: '驾校名称不能为空', trigger: 'blur' }]
|
schPlace: { required: true, type: Array, message: '驾校场地不能为空', trigger: 'change' },
|
||||||
|
typeName: { required: true, message: '班型名称不能为空', trigger: 'blur' },
|
||||||
|
licenseType: { required: true, message: '驾照类型不能为空', trigger: 'change' }
|
||||||
})
|
})
|
||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
const currentTab = ref('base')
|
const currentTab = ref('base')
|
||||||
const licenseTypeOption = ref([])
|
|
||||||
|
|
||||||
/** 打开弹窗 */
|
/** 打开弹窗 */
|
||||||
const open = async (type, id) => {
|
const open = async (type, id) => {
|
||||||
@@ -265,7 +281,8 @@ const open = async (type, id) => {
|
|||||||
if (id) {
|
if (id) {
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
// formData.value = await UserApi.getUser(id)
|
formData.value = await ClassApi.getClassType(id)
|
||||||
|
formData.value.schPlace = [formData.value.schoolId, formData.value.placeId]
|
||||||
} finally {
|
} finally {
|
||||||
formLoading.value = false
|
formLoading.value = false
|
||||||
}
|
}
|
||||||
@@ -275,64 +292,35 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
|||||||
|
|
||||||
/** 提交表单 */
|
/** 提交表单 */
|
||||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
const submitForm = async () => {
|
|
||||||
// 校验表单
|
|
||||||
if (!formRef.value) return
|
|
||||||
const valid = await formRef.value.validate()
|
|
||||||
if (!valid) return
|
|
||||||
// 提交请求
|
|
||||||
formLoading.value = true
|
|
||||||
try {
|
|
||||||
// const data = formData.value as unknown as UserApi.UserVO
|
|
||||||
if (formType.value === 'create') {
|
|
||||||
// await UserApi.createUser(data)
|
|
||||||
message.success(t('common.createSuccess'))
|
|
||||||
} else {
|
|
||||||
// await UserApi.updateUser(data)
|
|
||||||
message.success(t('common.updateSuccess'))
|
|
||||||
}
|
|
||||||
dialogVisible.value = false
|
|
||||||
// 发送操作成功的事件
|
|
||||||
emit('success')
|
|
||||||
} finally {
|
|
||||||
formLoading.value = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 重置表单 */
|
/** 重置表单 */
|
||||||
const resetForm = () => {
|
const resetForm = () => {
|
||||||
formData.value = {
|
formData.value = {
|
||||||
name: '',
|
schPlace: [],
|
||||||
leader: '',
|
typeName: '',
|
||||||
phone: '',
|
licenseType: '',
|
||||||
status: 1,
|
status: 0,
|
||||||
remark: '',
|
remark: '',
|
||||||
priceList: [],
|
quotations: [],
|
||||||
comissionList: [
|
percentages: []
|
||||||
{
|
|
||||||
startDate: '2024-01-01',
|
|
||||||
typeName: '阶梯结算',
|
|
||||||
ruleDesc: '月总成交额满0元,按比例取成交额1%'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
formRef.value?.resetFields()
|
formRef.value?.resetFields()
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleAddPrice() {
|
function handleAddPrice() {
|
||||||
formData.value.priceList.push({
|
formData.value.quotations.push({
|
||||||
edit: true,
|
edit: true,
|
||||||
markerPrice: undefined,
|
guidingPrice: undefined,
|
||||||
employeePrice: undefined,
|
minPrice: undefined,
|
||||||
costPrice: undefined,
|
costPrice: undefined,
|
||||||
startDate: undefined,
|
validTime: undefined,
|
||||||
createTime: '2024-05-12'
|
quotationTime: formatDate(new Date(), 'YYYY-MM-DD')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleDeletePrice(row, index) {
|
function handleDeletePrice(row, index) {
|
||||||
if (row.edit) {
|
if (row.edit) {
|
||||||
formData.value.priceList.splice(index, 1)
|
formData.value.quotations.splice(index, 1)
|
||||||
}
|
}
|
||||||
message.success('删除成功')
|
message.success('删除成功')
|
||||||
}
|
}
|
||||||
@@ -345,16 +333,16 @@ const comissionShow = ref(false)
|
|||||||
function handleAddComission() {
|
function handleAddComission() {
|
||||||
comissionShow.value = true
|
comissionShow.value = true
|
||||||
comissionForm.value = {
|
comissionForm.value = {
|
||||||
startDate: formatDate(new Date(), 'YYYY-MM-DD'),
|
validTime: formatDate(new Date(), 'YYYY-MM-DD'),
|
||||||
type: 1,
|
percentageType: 1,
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
type1: 1,
|
ruleParam1: 1,
|
||||||
type2: 1,
|
ruleParam2: 1,
|
||||||
type3: 0,
|
ruleParam3: 0,
|
||||||
type4: 1,
|
ruleParam4: 1,
|
||||||
type5: 1,
|
ruleParam5: 1,
|
||||||
type6: 10
|
ruleParam6: 10
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -362,16 +350,42 @@ function handleAddComission() {
|
|||||||
|
|
||||||
function handleAddRules() {
|
function handleAddRules() {
|
||||||
comissionForm.value.rules.push({
|
comissionForm.value.rules.push({
|
||||||
type1: 1,
|
ruleParam1: 1,
|
||||||
type2: 1,
|
ruleParam2: 1,
|
||||||
type3: 0,
|
ruleParam3: 0,
|
||||||
type4: 1,
|
ruleParam4: 1,
|
||||||
type5: 1,
|
ruleParam5: 1,
|
||||||
type6: 1
|
ruleParam6: 1
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function sureAddComission() {
|
async function submitForm() {
|
||||||
message.success('新增成功')
|
// 校验表单
|
||||||
|
if (!formRef.value) return
|
||||||
|
const valid = await formRef.value.validate()
|
||||||
|
if (!valid) return
|
||||||
|
// 提交请求
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
const data = { ...formData.value }
|
||||||
|
data.schoolId = data.schPlace[0]
|
||||||
|
data.placeId = data.schPlace[1]
|
||||||
|
delete data.schPlace
|
||||||
|
delete data.percentages
|
||||||
|
data.percentages = { ...comissionForm.value }
|
||||||
|
if (formType.value === 'create') {
|
||||||
|
await ClassApi.createClassType(data)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await ClassApi.updateClassType(data)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
dialogVisible.value = false
|
||||||
|
// 发送操作成功的事件
|
||||||
|
emit('success')
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
comissionShow.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -5,6 +5,8 @@
|
|||||||
<el-input
|
<el-input
|
||||||
v-model="searchForm.schoolName"
|
v-model="searchForm.schoolName"
|
||||||
placeholder="请输入驾校名称"
|
placeholder="请输入驾校名称"
|
||||||
|
clearable
|
||||||
|
style="width: 180px"
|
||||||
@keyup.enter="handleQuery"
|
@keyup.enter="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -12,6 +14,8 @@
|
|||||||
<el-input
|
<el-input
|
||||||
v-model="searchForm.placeName"
|
v-model="searchForm.placeName"
|
||||||
placeholder="请输入场地名称"
|
placeholder="请输入场地名称"
|
||||||
|
clearable
|
||||||
|
style="width: 180px"
|
||||||
@keyup.enter="handleQuery"
|
@keyup.enter="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -19,19 +23,21 @@
|
|||||||
<el-input
|
<el-input
|
||||||
v-model="searchForm.className"
|
v-model="searchForm.className"
|
||||||
placeholder="请输入班型名称"
|
placeholder="请输入班型名称"
|
||||||
|
clearable
|
||||||
|
style="width: 180px"
|
||||||
@keyup.enter="handleQuery"
|
@keyup.enter="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-select
|
<el-select
|
||||||
v-model="searchForm.cartypeId"
|
v-model="searchForm.licenseType"
|
||||||
placeholder="请选择驾照类型"
|
placeholder="请选择驾照类型"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
@change="handleQuery"
|
@change="handleQuery"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in cartypeOptions"
|
v-for="item in getDictOptions(DICT_TYPE.LINCENSE_TYPE)"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
:value="item.value"
|
:value="item.value"
|
||||||
@@ -39,11 +45,27 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button plain @click="handleQuery">查询</el-button>
|
<el-button plain @click="handleQuery" v-hasPermi="['school:class:search']">查询</el-button>
|
||||||
<el-button plain @click="handleReset">重置</el-button>
|
<el-button plain @click="handleReset" v-hasPermi="['school:class:reset']">重置</el-button>
|
||||||
<el-button type="primary" plain @click="handleOpenDialog('create')">新增</el-button>
|
<el-button
|
||||||
<el-button type="danger" @click="handleBatchDelete">批量删除</el-button>
|
type="primary"
|
||||||
<el-button type="warning" @click="handleBatchStatus">批量启/停用</el-button>
|
plain
|
||||||
|
@click="handleOpenDialog('create', null)"
|
||||||
|
v-hasPermi="['school:class:add']"
|
||||||
|
>新增</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
@click="handleBatchDelete"
|
||||||
|
v-hasPermi="['school:class:batch-delete']"
|
||||||
|
>批量删除</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
@click="handleBatchStatus"
|
||||||
|
v-hasPermi="['school:class:batch-status']"
|
||||||
|
>批量启/停用</el-button
|
||||||
|
>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
@@ -52,9 +74,10 @@
|
|||||||
<div class="head-container" style="max-height: 700px; overflow-y: auto">
|
<div class="head-container" style="max-height: 700px; overflow-y: auto">
|
||||||
<el-tree
|
<el-tree
|
||||||
ref="tree"
|
ref="tree"
|
||||||
:data="schoolOption.filter((item) => item.label.includes(searchForm.schoolName))"
|
:data="schoolOption"
|
||||||
accordion
|
accordion
|
||||||
node-key="id"
|
node-key="id"
|
||||||
|
highlight-current
|
||||||
:default-expanded-keys="selectNodes.map((item) => item.id)"
|
:default-expanded-keys="selectNodes.map((item) => item.id)"
|
||||||
@node-click="handleNodeClick"
|
@node-click="handleNodeClick"
|
||||||
/>
|
/>
|
||||||
@@ -81,8 +104,9 @@
|
|||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-switch
|
<el-switch
|
||||||
v-model="row.status"
|
v-model="row.status"
|
||||||
:active-value="1"
|
:active-value="0"
|
||||||
:inactive-value="0"
|
:inactive-value="1"
|
||||||
|
:disabled="!checkPermi(['school:class:update'])"
|
||||||
@change="handleChangeStatus(row)"
|
@change="handleChangeStatus(row)"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
@@ -93,11 +117,18 @@
|
|||||||
type="primary"
|
type="primary"
|
||||||
style="padding: 0"
|
style="padding: 0"
|
||||||
text
|
text
|
||||||
@click="handleOpenDialog('update', row)"
|
v-hasPermi="['school:class:update']"
|
||||||
|
@click="handleOpenDialog('update', row.typeId)"
|
||||||
>
|
>
|
||||||
修改
|
修改
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="danger" style="padding: 0" text @click="handleRemove(row)">
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
style="padding: 0"
|
||||||
|
text
|
||||||
|
v-hasPermi="['school:class:delete']"
|
||||||
|
@click="handleRemove(row.typeId)"
|
||||||
|
>
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
@@ -106,7 +137,7 @@
|
|||||||
<!-- 分页 -->
|
<!-- 分页 -->
|
||||||
<Pagination
|
<Pagination
|
||||||
v-model:limit="searchForm.pageSize"
|
v-model:limit="searchForm.pageSize"
|
||||||
v-model:page="searchForm.pageNum"
|
v-model:page="searchForm.pageNo"
|
||||||
:total="total"
|
:total="total"
|
||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
@@ -116,8 +147,8 @@
|
|||||||
<el-form :model="statusForm" ref="statusRef" label-width="80px">
|
<el-form :model="statusForm" ref="statusRef" label-width="80px">
|
||||||
<el-form-item label="选择状态" prop="status">
|
<el-form-item label="选择状态" prop="status">
|
||||||
<el-radio-group v-model="statusForm.status">
|
<el-radio-group v-model="statusForm.status">
|
||||||
<el-radio :label="1"> 启用 </el-radio>
|
<el-radio :label="0"> 启用 </el-radio>
|
||||||
<el-radio :label="2"> 禁用 </el-radio>
|
<el-radio :label="1"> 禁用 </el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
@@ -130,398 +161,66 @@
|
|||||||
</template>
|
</template>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|
||||||
<DialogClass ref="ClassDialog" @success="getList" />
|
<DialogClass ref="ClassDialog" :schoolOption="schoolOption" @success="getList" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="Class">
|
<script setup name="Class">
|
||||||
|
import * as PlaceApi from '@/api/school/place'
|
||||||
|
import * as ClassApi from '@/api/school/class'
|
||||||
import DialogClass from './Comp/DialogClass.vue'
|
import DialogClass from './Comp/DialogClass.vue'
|
||||||
|
import { checkPermi } from '@/utils/permission'
|
||||||
|
|
||||||
|
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
|
||||||
|
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const total = ref(0)
|
const total = ref(0)
|
||||||
|
|
||||||
const tableList = ref([])
|
const tableList = ref([])
|
||||||
// const schoolDialog = ref()
|
|
||||||
|
|
||||||
const searchForm = ref({
|
const searchForm = ref({
|
||||||
schoolName: '',
|
schoolName: undefined,
|
||||||
placeName: undefined,
|
placeName: undefined,
|
||||||
className: undefined,
|
typeName: undefined,
|
||||||
cartypeId: undefined,
|
licenseType: undefined,
|
||||||
pageNum: 1,
|
pageNo: 1,
|
||||||
pageSize: 20
|
pageSize: 20
|
||||||
})
|
})
|
||||||
|
|
||||||
const cartypeOptions = ref([])
|
|
||||||
const schoolOption = ref([])
|
const schoolOption = ref([])
|
||||||
const selectNodes = ref([])
|
const selectNodes = ref([])
|
||||||
|
|
||||||
function getSchoolList() {
|
async function getSchoolList() {
|
||||||
schoolOption.value = [
|
try {
|
||||||
{
|
const data = await PlaceApi.getPlaceList()
|
||||||
id: 179,
|
schoolOption.value = data.schoolList.map((item) => ({
|
||||||
label: '安审驾校',
|
id: item.schoolId,
|
||||||
|
label: item.schoolName,
|
||||||
level: 1,
|
level: 1,
|
||||||
children: [{ id: 308, label: '(皖西)安审驾校已备案', level: 2 }]
|
children: data.placeList
|
||||||
},
|
.filter((place) => item.schoolId === place.schoolId)
|
||||||
{
|
.map((place) => ({
|
||||||
id: 141,
|
id: place.placeId,
|
||||||
label: '通顺驾校',
|
label: place.name,
|
||||||
level: 1,
|
|
||||||
children: [
|
|
||||||
{ id: 173, label: '(皖北)通顺驾校信地报名点', level: 2 },
|
|
||||||
{ id: 320, label: '(皖北)通顺驾校包河花园训练基地《备案》', level: 2 },
|
|
||||||
{ id: 351, label: '(皖西)通顺驾校总校(D)已备案', level: 2 },
|
|
||||||
{ id: 359, label: '(皖北)通顺驾校龙岗训练基地《备案》', level: 2 }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 178,
|
|
||||||
label: '新宇驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [{ id: 243, label: '(皖北)新宇驾校磨店校区《备案》', level: 2 }]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 176,
|
|
||||||
label: '鑫缘驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [{ id: 385, label: '(皖北)鑫缘驾校南二环校区', level: 2 }]
|
|
||||||
},
|
|
||||||
{ id: 194, label: '环宇驾校', level: 1, children: [] },
|
|
||||||
{
|
|
||||||
id: 193,
|
|
||||||
label: '舒城同兴驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [
|
|
||||||
{ id: 414, label: '舒城同兴驾校南港训练场', level: 2 },
|
|
||||||
{ id: 415, label: '同兴驾校杭埠分校训练场', level: 2 },
|
|
||||||
{ id: 416, label: '同兴驾校城区训练场', level: 2 }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{ id: 195, label: '新快捷驾校', level: 1, children: [] },
|
|
||||||
{
|
|
||||||
id: 187,
|
|
||||||
label: '鑫金陵驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [{ id: 405, label: '(皖南)鑫金陵建大校区', level: 2 }]
|
|
||||||
},
|
|
||||||
{ id: 186, label: '途安驾校', level: 1, children: [] },
|
|
||||||
{ id: 163, label: '金灵驾校', level: 1, children: [] },
|
|
||||||
{ id: 185, label: '金湖驾校', level: 1, children: [] },
|
|
||||||
{
|
|
||||||
id: 172,
|
|
||||||
label: '精越驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [
|
|
||||||
{ id: 111, label: '(皖北)精越驾校恒大校区 《夜训》《备案》', level: 2 },
|
|
||||||
{ id: 386, label: '(皖北)精越驾校岗集校区已备案', level: 2 }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 184,
|
|
||||||
label: '宏昌驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [{ id: 394, label: '(皖西)宏昌驾校海棠校区已备案', level: 2 }]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 183,
|
|
||||||
label: '启点驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [
|
|
||||||
{ id: 390, label: '(皖南)启点驾校(高新校区)', level: 2 },
|
|
||||||
{ id: 391, label: '(皖南)启点驾校(蜀山校区)', level: 2 }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 182,
|
|
||||||
label: '泓运驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [
|
|
||||||
{ id: 401, label: '(皖南)泓运驾校临湖校区', level: 2 },
|
|
||||||
{ id: 402, label: '(皖南)泓运始信路总校', level: 2 }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 171,
|
|
||||||
label: '三联驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [
|
|
||||||
{ id: 136, label: '(皖西)三联泰科驾校十里庙校区已备案', level: 2 },
|
|
||||||
{ id: 380, label: '(皖南)三联泰科经开校区', level: 2 }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 181,
|
|
||||||
label: '金冈山驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [{ id: 161, label: '(皖北)金冈山驾校宁国路训练场《备案》', level: 2 }]
|
|
||||||
},
|
|
||||||
{ id: 167, label: '菜鸟学车', level: 1, children: [{ id: 218, label: '众顺驾校', level: 2 }] },
|
|
||||||
{ id: 101, label: '金马驾校', level: 1, children: [] },
|
|
||||||
{
|
|
||||||
id: 161,
|
|
||||||
label: '瑞星驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [{ id: 221, label: '(皖西)瑞星驾校花峰路校区已备案', level: 2 }]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 165,
|
|
||||||
label: '久安驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [{ id: 325, label: '(皖北)久安驾校环湖路训练基地 《备案》', level: 2 }]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 146,
|
|
||||||
label: '金新驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [
|
|
||||||
{ id: 112, label: '(皖北)金新驾校(悠然)京商报名点', level: 2 },
|
|
||||||
{ id: 172, label: '(皖北)金新驾校天水路校区D《备案》', level: 2 },
|
|
||||||
{ id: 229, label: '(皖北)金新驾校磨店分校《备案》', level: 2 },
|
|
||||||
{ id: 232, label: '(皖北)金新驾校新蚌埠路训练场D,B2《备案》', level: 2 },
|
|
||||||
{ id: 233, label: '(皖北)金新驾校澥河路校区《备案》', level: 2 },
|
|
||||||
{ id: 387, label: '(皖北)金新驾校东二环校区《备案》', level: 2 },
|
|
||||||
{ id: 397, label: '(皖北)金新驾校北京路校区《备案》', level: 2 }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 115,
|
|
||||||
label: '畅通驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [{ id: 350, label: '(皖西)畅通临泉路', level: 2 }]
|
|
||||||
},
|
|
||||||
{ id: 117, label: '一级合伙教练场地', level: 1, children: [] },
|
|
||||||
{
|
|
||||||
id: 125,
|
|
||||||
label: '金武联驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [
|
|
||||||
{ id: 163, label: '(皖南)金武联驾校柳树塘校区(已备案)', level: 2 },
|
|
||||||
{ id: 190, label: '(皖北)金武联驾校大店报名点(B2 D)', level: 2 },
|
|
||||||
{
|
|
||||||
id: 222,
|
|
||||||
label: '(皖北)金武联总校训练场(客货运网约车出租车资格证)《备案》',
|
|
||||||
level: 2
|
level: 2
|
||||||
},
|
}))
|
||||||
{ id: 248, label: '(皖西)金武联驾校四里河校区已备案', level: 2 },
|
}))
|
||||||
{ id: 291, label: '(皖南)金冈山李河湾校区', level: 2 },
|
} catch {}
|
||||||
{ id: 301, label: '(皖北)金武联裕溪路训练场《备案》', level: 2 },
|
|
||||||
{ id: 315, label: '(皖北)金新。金武联驾校(杨岗报名大厅)(D)B2', level: 2 },
|
|
||||||
{ id: 346, label: '(皖南)金武联高速时代广场训练基地', level: 2 },
|
|
||||||
{ id: 378, label: '(皖北)金武联大店训练场《备案》', level: 2 }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 126,
|
|
||||||
label: '巢湖顺达驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [
|
|
||||||
{ id: 194, label: '顺达驾校半汤分校', level: 2 },
|
|
||||||
{ id: 265, label: '顺达驾校裕溪路训练基地', level: 2 }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{ id: 128, label: '悠然驾校', level: 1, children: [] },
|
|
||||||
{
|
|
||||||
id: 140,
|
|
||||||
label: '徽安驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [{ id: 162, label: '(皖南)徽安驾校科技训练基地', level: 2 }]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 142,
|
|
||||||
label: '新安驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [
|
|
||||||
{ id: 263, label: '(皖南)新安驾校(已备案)', level: 2 },
|
|
||||||
{ id: 393, label: '(皖南)新安黄山路校区', level: 2 }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 144,
|
|
||||||
label: '万锦驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [
|
|
||||||
{ id: 258, label: '(皖北)万锦驾校磨店《备案》', level: 2 },
|
|
||||||
{ id: 327, label: '(皖南)万锦驾校冬梅路校区(已备案)', level: 2 }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{ id: 123, label: '康庄驾校', level: 1, children: [] },
|
|
||||||
{
|
|
||||||
id: 147,
|
|
||||||
label: '晨泰驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [{ id: 245, label: '(皖北)晨泰驾校金梅路校区《备案》', level: 2 }]
|
|
||||||
},
|
|
||||||
{ id: 158, label: '金岗山驾校(摩托车)', level: 1, children: [] },
|
|
||||||
{ id: 160, label: '陪练陪驾', level: 1, children: [] },
|
|
||||||
{ id: 112, label: '浩宇驾校', level: 1, children: [] },
|
|
||||||
{
|
|
||||||
id: 139,
|
|
||||||
label: '合顺驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [{ id: 332, label: '(皖西)合顺驾校临泉路校区(D)已备案', level: 2 }]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 152,
|
|
||||||
label: '新桥驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [{ id: 389, label: '(皖北)新桥驾校东七训练场《备案》', level: 2 }]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 130,
|
|
||||||
label: '金路驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [{ id: 208, label: '(皖南)金路名邦报名训练基地', level: 2 }]
|
|
||||||
},
|
|
||||||
{ id: 133, label: '众安驾校', level: 1, children: [] },
|
|
||||||
{
|
|
||||||
id: 116,
|
|
||||||
label: '顺通驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [{ id: 410, label: '顺通驾校总校', level: 2 }]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 148,
|
|
||||||
label: '国安驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [
|
|
||||||
{ id: 400, label: '(皖南)国安包公路校区', level: 2 },
|
|
||||||
{ id: 403, label: '(皖南)国安三河校区', level: 2 }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{ id: 135, label: '安申驾校', level: 1, children: [] },
|
|
||||||
{ id: 110, label: '九号驾校', level: 1, children: [{ id: 349, label: '九号驾校', level: 2 }] },
|
|
||||||
{ id: 129, label: '新地驾校', level: 1, children: [] },
|
|
||||||
{
|
|
||||||
id: 113,
|
|
||||||
label: '世纪驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [
|
|
||||||
{ id: 146, label: '(皖西)世纪驾校晨光训练场已备案', level: 2 },
|
|
||||||
{ id: 209, label: '(皖西)世纪驾校桂王路六中训练基地已备案', level: 2 },
|
|
||||||
{ id: 223, label: '(皖西)世纪驾校撮镇义和训练场已备案', level: 2 },
|
|
||||||
{ id: 246, label: '(皖西)世纪驾校包公像训练场已备案', level: 2 }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{ id: 103, label: '起航驾校', level: 1, children: [] },
|
|
||||||
{
|
|
||||||
id: 137,
|
|
||||||
label: '庐州驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [{ id: 155, label: '(皖西)庐州驾校北五里井校区已备案', level: 2 }]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 143,
|
|
||||||
label: '长安驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [
|
|
||||||
{ id: 101, label: '(皖西)长安驾校蜀山校区已备案', level: 2 },
|
|
||||||
{ id: 104, label: '(皖北)长安驾校明光路训练基地《备案》', level: 2 },
|
|
||||||
{ id: 199, label: '(皖北)长安驾校龙岗报名点', level: 2 },
|
|
||||||
{ id: 204, label: '(皖西)长安驾校临泉路总校已备案', level: 2 },
|
|
||||||
{ id: 259, label: '(皖南)长安经开校区(已备案)', level: 2 },
|
|
||||||
{ id: 266, label: '长安驾校名人馆训练基地(C1 C2 已备案)', level: 2 },
|
|
||||||
{ id: 290, label: '(皖北)长安驾校高铁南站报名训练场《备案》', level: 2 },
|
|
||||||
{ id: 300, label: '(皖北)长安驾校龙岗训练场《备案》', level: 2 },
|
|
||||||
{ id: 316, label: '长安驾校万达城报名点(C2 早晚)', level: 2 },
|
|
||||||
{ id: 396, label: '(皖南)长安南七分校', level: 2 }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 153,
|
|
||||||
label: '肥东金荣驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [
|
|
||||||
{ id: 107, label: '金荣驾校', level: 2 },
|
|
||||||
{ id: 181, label: '金荣驾校店埠镇训练基地', level: 2 },
|
|
||||||
{ id: 358, label: '(皖南)金荣驾校报名点', level: 2 }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{ id: 170, label: '和安驾校', level: 1, children: [] },
|
|
||||||
{
|
|
||||||
id: 119,
|
|
||||||
label: '平安驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [
|
|
||||||
{ id: 250, label: '平安驾校总部报名点', level: 2 },
|
|
||||||
{ id: 267, label: '巢湖市平安驾校夏阁训练场', level: 2 },
|
|
||||||
{ id: 312, label: '巢湖平安驾校市区训练场', level: 2 },
|
|
||||||
{ id: 353, label: '巢湖市平安驾校巢湖学院训练场', level: 2 }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{ id: 168, label: '心诚驾校', level: 1, children: [] },
|
|
||||||
{
|
|
||||||
id: 132,
|
|
||||||
label: '新亚驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [{ id: 164, label: '新亚驾校汽车站训练基地C2', level: 2 }]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 138,
|
|
||||||
label: '五星驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [
|
|
||||||
{ id: 134, label: '(皖西)五星驾岗集校训练场', level: 2 },
|
|
||||||
{ id: 192, label: '(皖西)五星驾校岗集报名点', level: 2 },
|
|
||||||
{ id: 269, label: '(皖南)五星驾校总校合作化路训练基地(D已备案)', level: 2 },
|
|
||||||
{ id: 280, label: '(皖南)五星华府训练基地 ', level: 2 },
|
|
||||||
{ id: 388, label: '(皖西)五星驾校黄山路校区', level: 2 },
|
|
||||||
{ id: 399, label: '(皖南)五星明珠校区', level: 2 }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 121,
|
|
||||||
label: '永泰驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [
|
|
||||||
{ id: 234, label: '(皖北)永泰驾校蒙河路校区《备案》', level: 2 },
|
|
||||||
{ id: 314, label: '(皖北)永泰驾校下塘校区《备案》', level: 2 },
|
|
||||||
{ id: 352, label: '(皖北)永泰驾校魏武路校区《备案》', level: 2 }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 111,
|
|
||||||
label: '宏运驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [
|
|
||||||
{ id: 189, label: '(皖西)宏运驾校界首路校区已备案', level: 2 },
|
|
||||||
{ id: 404, label: '(皖北)宏运红旗建材校区《备案》', level: 2 }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{ id: 105, label: '众顺驾校', level: 1, children: [] },
|
|
||||||
{ id: 114, label: '东方驾校', level: 1, children: [] },
|
|
||||||
{ id: 104, label: '信达驾校', level: 1, children: [] },
|
|
||||||
{
|
|
||||||
id: 109,
|
|
||||||
label: '摩托车培训驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [
|
|
||||||
{ id: 374, label: '(抖音)摩托车报名登记用', level: 2 },
|
|
||||||
{ id: 375, label: '非抖音学员摩托车报名登记用', level: 2 },
|
|
||||||
{ id: 413, label: '领航机车(运城滨湖)训练基地', level: 2 }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 145,
|
|
||||||
label: '运程驾校',
|
|
||||||
level: 1,
|
|
||||||
children: [
|
|
||||||
{ id: 139, label: '(皖南)运程蜀山校区', level: 2 },
|
|
||||||
{ id: 150, label: '(皖北)运程驾校北京路校区《备案》', level: 2 }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleNodeClick(data, node) {
|
function handleNodeClick(data, node) {
|
||||||
if (data.level === 1) {
|
if (data.level === 1) {
|
||||||
selectNodes.value = [{ id: data.id, name: data.label }]
|
selectNodes.value = [{ id: data.id, name: data.label }]
|
||||||
|
searchForm.value.schoolName = data.label
|
||||||
} else {
|
} else {
|
||||||
selectNodes.value = [
|
selectNodes.value = [
|
||||||
{ id: node.parent.data.id, name: node.parent.data.label },
|
{ id: node.parent.data.id, name: node.parent.data.label },
|
||||||
{ id: data.id, name: data.label }
|
{ id: data.id, name: data.label }
|
||||||
]
|
]
|
||||||
|
searchForm.value.schoolName = node.parent.data.label
|
||||||
|
searchForm.value.placeName = data.label
|
||||||
}
|
}
|
||||||
handleQuery()
|
handleQuery()
|
||||||
}
|
}
|
||||||
@@ -529,37 +228,42 @@ function handleNodeClick(data, node) {
|
|||||||
const columns = [
|
const columns = [
|
||||||
{ props: 'schoolName', label: '驾校', width: '100px' },
|
{ props: 'schoolName', label: '驾校', width: '100px' },
|
||||||
{ props: 'placeName', label: '场地' },
|
{ props: 'placeName', label: '场地' },
|
||||||
{ props: 'className', label: '班型名称' },
|
{ props: 'typeName', label: '班型名称' },
|
||||||
{ props: 'cartypeName', label: '驾照类型', width: '100px' },
|
{ props: 'licenseType', label: '驾照类型', width: '100px' },
|
||||||
{ props: '', label: '最新报价', width: '100px' },
|
{ props: 'guidingPrice', label: '最新报价', width: '100px' },
|
||||||
{ props: '', label: '最新底价', width: '100px' },
|
{ props: 'minPrice', label: '最新底价', width: '100px' },
|
||||||
{ props: 'remark', label: '备注', width: '100px' }
|
{ props: 'remark', label: '备注', width: '100px' }
|
||||||
]
|
]
|
||||||
|
|
||||||
function handleQuery() {
|
function handleQuery() {
|
||||||
searchForm.value.pageNum = 1
|
searchForm.value.pageNo = 1
|
||||||
getList()
|
getList()
|
||||||
}
|
}
|
||||||
|
|
||||||
function getList() {
|
async function getList() {
|
||||||
tableList.value = [
|
loading.value = true
|
||||||
{ schoolName: '测试驾校', placeName: '测试场地', className: '测试', status: 1 }
|
try {
|
||||||
]
|
const data = await ClassApi.getClassTypePage(searchForm.value)
|
||||||
|
tableList.value = data.list
|
||||||
|
total.value = data.total
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const ClassDialog = ref()
|
const ClassDialog = ref()
|
||||||
function handleOpenDialog(type, row = null) {
|
function handleOpenDialog(type, id = null) {
|
||||||
ClassDialog.value.open(type, row)
|
ClassDialog.value.open(type, id)
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleReset() {
|
function handleReset() {
|
||||||
searchForm.value = {
|
searchForm.value = {
|
||||||
schoolName: '',
|
schoolName: undefined,
|
||||||
placeName: undefined,
|
placeName: undefined,
|
||||||
className: undefined,
|
typeName: undefined,
|
||||||
cartypeId: undefined,
|
licenseType: undefined,
|
||||||
pageSize: 20,
|
pageNo: 1,
|
||||||
pageNum: 1
|
pageSize: 20
|
||||||
}
|
}
|
||||||
getList()
|
getList()
|
||||||
}
|
}
|
||||||
@@ -570,11 +274,10 @@ async function handleBatchDelete(arr = []) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
console.log(arr)
|
|
||||||
// 删除的二次确认
|
// 删除的二次确认
|
||||||
await message.delConfirm()
|
await message.delConfirm()
|
||||||
// 发起删除
|
// 发起删除
|
||||||
// await UserApi.deleteUser(row.id)
|
await ClassApi.batchDeleteClassType(arr || selectRows.value)
|
||||||
message.success(t('common.delSuccess'))
|
message.success(t('common.delSuccess'))
|
||||||
// 刷新列表
|
// 刷新列表
|
||||||
await getList()
|
await getList()
|
||||||
@@ -583,20 +286,19 @@ async function handleBatchDelete(arr = []) {
|
|||||||
|
|
||||||
const selectRows = ref([])
|
const selectRows = ref([])
|
||||||
function handleSelectionChange(selection) {
|
function handleSelectionChange(selection) {
|
||||||
selectRows.value = selection.map((item) => item.classId)
|
selectRows.value = selection.map((item) => item.typeId)
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleRemove(row) {
|
function handleRemove(id) {
|
||||||
handleBatchDelete([row])
|
handleBatchDelete([id])
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleChangeStatus(row) {
|
async function handleChangeStatus(row) {
|
||||||
try {
|
try {
|
||||||
console.log(row)
|
|
||||||
// 删除的二次确认
|
// 删除的二次确认
|
||||||
await message.confirm('是否确认修改状态')
|
await message.confirm('是否确认修改状态')
|
||||||
// 发起删除
|
// 发起删除
|
||||||
// await UserApi.deleteUser(row.id)
|
await ClassApi.updateClassTypeStatus(row.typeId, row.status)
|
||||||
message.success('修改成功')
|
message.success('修改成功')
|
||||||
// 刷新列表
|
// 刷新列表
|
||||||
await getList()
|
await getList()
|
||||||
@@ -604,24 +306,31 @@ async function handleChangeStatus(row) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const batchStatusDialogShow = ref(false)
|
const batchStatusDialogShow = ref(false)
|
||||||
const statusForm = ref({ status: 1 })
|
const statusForm = ref({ status: 0 })
|
||||||
|
|
||||||
function handleBatchStatus() {
|
function handleBatchStatus() {
|
||||||
if (!selectRows.value.length) {
|
if (!selectRows.value.length) {
|
||||||
message.info('请选择表格行!')
|
message.info('请选择表格行!')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
statusForm.value.typeIdList = selectRows.value
|
||||||
|
statusForm.value.status = 0
|
||||||
batchStatusDialogShow.value = true
|
batchStatusDialogShow.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleSureStatus() {
|
async function handleSureStatus() {
|
||||||
console.log(statusForm.value)
|
try {
|
||||||
message.success('保存成功')
|
await ClassApi.batchUpdateClassTypeStatus(statusForm.value)
|
||||||
|
message.success('修改成功')
|
||||||
batchStatusDialogShow.value = false
|
batchStatusDialogShow.value = false
|
||||||
|
// 刷新列表
|
||||||
|
await getList()
|
||||||
|
} catch {}
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getSchoolList()
|
getSchoolList()
|
||||||
|
getList()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,12 @@
|
|||||||
<el-button @click="handleClickSchool(school)">{{
|
<el-button @click="handleClickSchool(school)">{{
|
||||||
`数据管理(${getCount(school.schoolId)})`
|
`数据管理(${getCount(school.schoolId)})`
|
||||||
}}</el-button>
|
}}</el-button>
|
||||||
<el-tooltip content="新增场地" placement="left" effect="dark">
|
<el-tooltip
|
||||||
|
content="新增场地"
|
||||||
|
placement="left"
|
||||||
|
effect="dark"
|
||||||
|
v-if="checkPermi(['school:place:add'])"
|
||||||
|
>
|
||||||
<el-button class="add-place-btn" @click="handleInsertPlace(school.schoolId)">
|
<el-button class="add-place-btn" @click="handleInsertPlace(school.schoolId)">
|
||||||
<Icon icon="ep:plus" />
|
<Icon icon="ep:plus" />
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -184,7 +189,11 @@
|
|||||||
<el-table-column prop="area" label="所属区域" width="110" />
|
<el-table-column prop="area" label="所属区域" width="110" />
|
||||||
<el-table-column label="启用" width="100">
|
<el-table-column label="启用" width="100">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-switch v-model="scope.row.showInMap" @change="changePlaceStatus(scope.row)" />
|
<el-switch
|
||||||
|
v-model="scope.row.showInMap"
|
||||||
|
:disabled="checkPermi(['school:place:update'])"
|
||||||
|
@change="changePlaceStatus(scope.row)"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="100">
|
<el-table-column label="操作" width="100">
|
||||||
@@ -194,6 +203,7 @@
|
|||||||
type="primary"
|
type="primary"
|
||||||
style="padding: 4px 8px"
|
style="padding: 4px 8px"
|
||||||
@click="handleEditPlace(scope.row)"
|
@click="handleEditPlace(scope.row)"
|
||||||
|
v-hasPermi="['school:place:update']"
|
||||||
>
|
>
|
||||||
<Icon icon="ep:edit" />
|
<Icon icon="ep:edit" />
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -222,6 +232,7 @@
|
|||||||
|
|
||||||
<script setup name="Place">
|
<script setup name="Place">
|
||||||
import * as PlaceApi from '@/api/school/place'
|
import * as PlaceApi from '@/api/school/place'
|
||||||
|
import { checkPermi } from '@/utils/permission'
|
||||||
|
|
||||||
import FlagRed from '@/assets/imgs/flag/flag_red.png'
|
import FlagRed from '@/assets/imgs/flag/flag_red.png'
|
||||||
import FlagYellow from '@/assets/imgs/flag/flag_yellow.png'
|
import FlagYellow from '@/assets/imgs/flag/flag_yellow.png'
|
||||||
@@ -310,9 +321,15 @@ function regeoCode() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function getPageData() {
|
async function getPageData() {
|
||||||
|
schoolList.value = []
|
||||||
|
tableData.value = []
|
||||||
const data = await PlaceApi.getPlaceList()
|
const data = await PlaceApi.getPlaceList()
|
||||||
schoolList.value = data.schoolList || []
|
if (data.schoolList) {
|
||||||
tableData.value = data.placeList || []
|
schoolList.value = data.schoolList.map((item) => ({ ...item, showInMap: true }))
|
||||||
|
}
|
||||||
|
if (data.placeList) {
|
||||||
|
tableData.value = data.placeList.map((item) => ({ ...item, showInMap: true, schoolShow: true }))
|
||||||
|
}
|
||||||
if (schoolList.value.length) {
|
if (schoolList.value.length) {
|
||||||
currentdeptId.value = schoolList.value[0].schoolId
|
currentdeptId.value = schoolList.value[0].schoolId
|
||||||
createMarkersInMap()
|
createMarkersInMap()
|
||||||
@@ -376,7 +393,8 @@ function handleInsertPlace(schoolId) {
|
|||||||
phone: undefined,
|
phone: undefined,
|
||||||
schoolId: schoolId,
|
schoolId: schoolId,
|
||||||
showInMap: true,
|
showInMap: true,
|
||||||
flagColor: 'red'
|
flagColor: 'red',
|
||||||
|
recommend: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -415,6 +433,9 @@ function checkPlaceFormValidate() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleClickMarker(ev) {
|
function handleClickMarker(ev) {
|
||||||
|
if (!checkPermi(['school:place:update'])) {
|
||||||
|
return
|
||||||
|
}
|
||||||
placeForm.value = ev.target.getExtData()
|
placeForm.value = ev.target.getExtData()
|
||||||
placeDialogShow.value = true
|
placeDialogShow.value = true
|
||||||
}
|
}
|
||||||
@@ -422,17 +443,15 @@ function handleClickMarker(ev) {
|
|||||||
async function onSubmit() {
|
async function onSubmit() {
|
||||||
// 保存接口
|
// 保存接口
|
||||||
if (checkPlaceFormValidate()) {
|
if (checkPlaceFormValidate()) {
|
||||||
// 先访问接口,返回id插入placeForm
|
try {
|
||||||
// const resp = savePlace(placeForm.value);
|
let resp
|
||||||
const resp = { code: 200, data: 'p00001' }
|
if (placeForm.value.placeId) {
|
||||||
if (resp.code != 200) {
|
resp = await PlaceApi.updatePlace(placeForm.value)
|
||||||
return
|
|
||||||
} else {
|
} else {
|
||||||
message.success('操作成功')
|
resp = await PlaceApi.createPlace(placeForm.value)
|
||||||
}
|
|
||||||
if (!placeForm.value.placeId && resp.data) {
|
|
||||||
placeForm.value.placeId = resp.data
|
placeForm.value.placeId = resp.data
|
||||||
}
|
}
|
||||||
|
message.success('操作成功')
|
||||||
// 移除选点用 的标记
|
// 移除选点用 的标记
|
||||||
dialogMap.value.remove(locationMarker.value)
|
dialogMap.value.remove(locationMarker.value)
|
||||||
// 根据form创建新marker 并添加到地图上
|
// 根据form创建新marker 并添加到地图上
|
||||||
@@ -470,6 +489,9 @@ async function onSubmit() {
|
|||||||
)
|
)
|
||||||
tmpArr1.push(tmpMarker)
|
tmpArr1.push(tmpMarker)
|
||||||
placeMarkerList.value = tmpArr1
|
placeMarkerList.value = tmpArr1
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,18 +33,18 @@
|
|||||||
v-model="row.status"
|
v-model="row.status"
|
||||||
:active-value="0"
|
:active-value="0"
|
||||||
:inactive-value="1"
|
:inactive-value="1"
|
||||||
:disabled="checkPermi(['school:school:update'])"
|
:disabled="!checkPermi(['school:school:update'])"
|
||||||
@change="changeStatus(row)"
|
@change="changeStatus(row)"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="创建时间" prop="" />
|
<el-table-column label="创建时间" prop="createTime" :formatter="dateFormatter" />
|
||||||
<el-table-column fixed="right" label="操作" width="150">
|
<el-table-column fixed="right" label="操作" width="150">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-button
|
<el-button
|
||||||
link
|
link
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="openForm(update, row)"
|
@click="openForm(update, row.schoolId)"
|
||||||
v-hasPermi="['school:school:update']"
|
v-hasPermi="['school:school:update']"
|
||||||
>
|
>
|
||||||
修改
|
修改
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
<el-button
|
<el-button
|
||||||
link
|
link
|
||||||
type="danger"
|
type="danger"
|
||||||
@click="handleDelete(row.id)"
|
@click="handleDelete(row.schoolId)"
|
||||||
v-hasPermi="['school:school:delete']"
|
v-hasPermi="['school:school:delete']"
|
||||||
>
|
>
|
||||||
删除
|
删除
|
||||||
@@ -75,8 +75,11 @@
|
|||||||
import DialogSchool from './Comp/DialogSchool.vue'
|
import DialogSchool from './Comp/DialogSchool.vue'
|
||||||
import * as api from '@/api/school/sch'
|
import * as api from '@/api/school/sch'
|
||||||
import { checkPermi } from '@/utils/permission'
|
import { checkPermi } from '@/utils/permission'
|
||||||
|
import { CommonStatusEnum } from '@/utils/constants'
|
||||||
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
|
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
const searchForm = ref({
|
const searchForm = ref({
|
||||||
schoolName: '',
|
schoolName: '',
|
||||||
@@ -119,12 +122,12 @@ function openForm(type, row = null) {
|
|||||||
schoolDialog.value.open(type, row)
|
schoolDialog.value.open(type, row)
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleDelete(row) {
|
async function handleDelete(id) {
|
||||||
try {
|
try {
|
||||||
// 删除的二次确认
|
// 删除的二次确认
|
||||||
await message.delConfirm()
|
await message.delConfirm()
|
||||||
// 发起删除
|
// 发起删除
|
||||||
await api.deleteSchool(row.id)
|
await api.deleteSchool(id)
|
||||||
message.success(t('common.delSuccess'))
|
message.success(t('common.delSuccess'))
|
||||||
// 刷新列表
|
// 刷新列表
|
||||||
await getList()
|
await getList()
|
||||||
|
|||||||
112
src/views/SchoolManagement/Set/Comp/DialogCartype.vue
Normal file
112
src/views/SchoolManagement/Set/Comp/DialogCartype.vue
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
<template>
|
||||||
|
<Dialog :title="dialogTitle" v-model="dialogVisible" width="500px">
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
v-loading="formLoading"
|
||||||
|
:model="formData"
|
||||||
|
:rules="formRules"
|
||||||
|
label-width="80px"
|
||||||
|
>
|
||||||
|
<el-form-item label="名称" prop="label">
|
||||||
|
<el-input v-model="formData.label" placeholder="请输入名称" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="编码" prop="value">
|
||||||
|
<el-input v-model="formData.value" placeholder="请输入编码" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="排序" prop="sort">
|
||||||
|
<el-input v-model="formData.sort" placeholder="请输入排序" type="number" :min="0" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input
|
||||||
|
type="textarea"
|
||||||
|
v-model="formData.remark"
|
||||||
|
placeholder="请输入备注"
|
||||||
|
:autosize="{ minRows: 4, maxRows: 8 }"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
</template>
|
||||||
|
</Dialog>
|
||||||
|
</template>
|
||||||
|
<script name="DialogCartype" setup>
|
||||||
|
import * as dictApi from '@/api/system/dict/dict.data'
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
|
const dialogTitle = ref('') // 弹窗的标题
|
||||||
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||||
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||||
|
const formData = ref({
|
||||||
|
label: undefined,
|
||||||
|
value: undefined,
|
||||||
|
sort: 1,
|
||||||
|
dictType: 'license_type',
|
||||||
|
status: 0,
|
||||||
|
remark: ''
|
||||||
|
})
|
||||||
|
const formRules = reactive({
|
||||||
|
label: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
|
||||||
|
value: [{ required: true, message: '编码不能为空', trigger: 'blur' }]
|
||||||
|
})
|
||||||
|
const formRef = ref() // 表单 Ref
|
||||||
|
|
||||||
|
/** 打开弹窗 */
|
||||||
|
const open = async (type, id) => {
|
||||||
|
dialogVisible.value = true
|
||||||
|
dialogTitle.value = type == 'update' ? '修改驾照类型' : '新增驾照类型'
|
||||||
|
formType.value = type
|
||||||
|
resetForm()
|
||||||
|
// 修改时,设置数据
|
||||||
|
if (id) {
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
formData.value = await dictApi.getDictData(id)
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
|
/** 提交表单 */
|
||||||
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
|
const submitForm = async () => {
|
||||||
|
// 校验表单
|
||||||
|
if (!formRef.value) return
|
||||||
|
const valid = await formRef.value.validate()
|
||||||
|
if (!valid) return
|
||||||
|
// 提交请求
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
if (formType.value === 'create') {
|
||||||
|
await dictApi.createDictData(formData.value)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await dictApi.updateDictData(formData.value)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
dialogVisible.value = false
|
||||||
|
// 发送操作成功的事件
|
||||||
|
emit('success')
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置表单 */
|
||||||
|
const resetForm = () => {
|
||||||
|
formData.value = {
|
||||||
|
label: undefined,
|
||||||
|
value: undefined,
|
||||||
|
dictType: 'license_type',
|
||||||
|
status: 0,
|
||||||
|
sort: 1,
|
||||||
|
remark: ''
|
||||||
|
}
|
||||||
|
formRef.value?.resetFields()
|
||||||
|
}
|
||||||
|
</script>
|
||||||
113
src/views/SchoolManagement/Set/Comp/SettingCartype.vue
Normal file
113
src/views/SchoolManagement/Set/Comp/SettingCartype.vue
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-form ref="queryForm" :model="searchForm" label-width="0" inline>
|
||||||
|
<el-form-item>
|
||||||
|
<el-input
|
||||||
|
v-model="searchForm.label"
|
||||||
|
placeholder="请输入名称"
|
||||||
|
clearable
|
||||||
|
style="width: 180px"
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button @click="resetQuery">重置</el-button>
|
||||||
|
<el-button type="primary" @click="openForm('create', null)">新增</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<el-table v-loading="loading" :data="tableList">
|
||||||
|
<el-table-column prop="label" label="名称" />
|
||||||
|
<el-table-column prop="value" label="编码" />
|
||||||
|
<el-table-column prop="sort" label="排序" width="100px" />
|
||||||
|
<el-table-column prop="remark" label="备注" />
|
||||||
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
prop="createTime"
|
||||||
|
width="180px"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
/>
|
||||||
|
<el-table-column label="更新人" prop="updator " width="150px" />
|
||||||
|
<el-table-column label="操作">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-button type="primary" text @click="openForm('update', row.id)"> 修改 </el-button>
|
||||||
|
<el-button type="danger" text @click="handleDelete(row.id)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<Pagination
|
||||||
|
v-model:limit="searchForm.pageSize"
|
||||||
|
v-model:page="searchForm.pageNo"
|
||||||
|
:total="total"
|
||||||
|
@pagination="handleQuery"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<DialogCartype ref="cartypeDialog" @success="handleQuery" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup name="CartypeSetting">
|
||||||
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
|
import * as dictApi from '@/api/system/dict/dict.data'
|
||||||
|
import DialogCartype from './DialogCartype.vue'
|
||||||
|
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
|
const searchForm = ref({
|
||||||
|
dictType: 'license_type',
|
||||||
|
label: '',
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 20
|
||||||
|
})
|
||||||
|
|
||||||
|
const total = ref(0)
|
||||||
|
const cartypeDialog = ref()
|
||||||
|
const tableList = ref([])
|
||||||
|
const loading = ref(false)
|
||||||
|
|
||||||
|
function handleQuery() {
|
||||||
|
searchForm.value.pageNo = 1
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
function resetQuery() {
|
||||||
|
searchForm.value = {
|
||||||
|
dictType: 'license_type',
|
||||||
|
label: '',
|
||||||
|
pageSize: 20,
|
||||||
|
pageNo: 1
|
||||||
|
}
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
async function getList() {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const data = await dictApi.getDictDataPage(searchForm.value)
|
||||||
|
tableList.value = data.list
|
||||||
|
total.value = data.total
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function openForm(type, id = null) {
|
||||||
|
cartypeDialog.value.open(type, id)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleDelete(id) {
|
||||||
|
try {
|
||||||
|
// 删除的二次确认
|
||||||
|
await message.delConfirm()
|
||||||
|
// 发起删除
|
||||||
|
await dictApi.deleteDictData(id)
|
||||||
|
message.success(t('common.delSuccess'))
|
||||||
|
// 刷新列表
|
||||||
|
await getList()
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
onMounted(() => {
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped></style>
|
||||||
21
src/views/SchoolManagement/Set/index.vue
Normal file
21
src/views/SchoolManagement/Set/index.vue
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-tabs v-model="tabIndex" type="border-card">
|
||||||
|
<el-tab-pane label="驾照类型" :name="0" v-if="checkPermi(['school:setting:cartype'])">
|
||||||
|
<SettingCartype v-if="tabIndex == 0" />
|
||||||
|
</el-tab-pane>
|
||||||
|
<!-- <el-tab-pane label="销售提成" :name="10" v-if="checkPermi(['basic:setting:comission'])">
|
||||||
|
<BSSalerComission v-if="tabIndex == 10" />
|
||||||
|
</el-tab-pane> -->
|
||||||
|
</el-tabs>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup name="SchoolSetting">
|
||||||
|
import SettingCartype from './Comp/SettingCartype.vue'
|
||||||
|
import { checkPermi } from '@/utils/permission'
|
||||||
|
|
||||||
|
const tabIndex = ref(0)
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped></style>
|
||||||
Reference in New Issue
Block a user