salary
qsh 6 months ago
parent 1f9be6227c
commit c258155972
  1. 39
      src/api/school/place/index.js
  2. 34
      src/api/school/sch/index.js
  3. BIN
      src/assets/imgs/logo.png
  4. 3
      src/layout/components/Logo/src/Logo.vue
  5. 4
      src/views/Basic/User/UserAssignRoleForm.vue
  6. 4
      src/views/Login/Login.vue
  7. 9
      src/views/Login/components/QrCodeForm.vue
  8. 36
      src/views/SchoolManagement/Place/index.vue
  9. 28
      src/views/SchoolManagement/School/Comp/DialogSchool.vue
  10. 98
      src/views/SchoolManagement/School/index.vue

@ -0,0 +1,39 @@
import request from '@/config/axios'
// 查询列表-分页
export const getPlacePage = async (params) => {
return await request.get({ url: '/admin-api/crm/sch-place/page', params })
}
// 查询列表-不分页
export const getPlaceList = async (params) => {
return await request.get({ url: '/admin-api/crm/sch-place/list', params })
}
// 查询详情
export const getPlace = async (id) => {
return await request.get({ url: '/admin-api/crm/sch-place/get?id=' + id })
}
// 新增
export const createPlace = async (data) => {
return await request.post({ url: '/admin-api/crm/sch-place/create', data: data })
}
// 修改
export const updatePlace = async (params) => {
return await request.put({ url: '/admin-api/crm/sch-place/update', data: params })
}
// 删除
export const deletePlace = async (id) => {
return await request.delete({ url: '/admin-api/crm/sch-place/delete?id=' + id })
}
export const updatePlaceStatus = async (id, status) => {
const data = {
id,
status
}
return request.put({ url: '/admin-api/crm/sch-place/update-status', data: data })
}

@ -0,0 +1,34 @@
import request from '@/config/axios'
// 查询列表
export const getSchoolPage = async (params) => {
return await request.get({ url: '/admin-api/crm/sch-school/page', params })
}
// 查询详情
export const getSchool = async (id) => {
return await request.get({ url: '/admin-api/crm/sch-school/get?id=' + id })
}
// 新增
export const createSchool = async (data) => {
return await request.post({ url: '/admin-api/crm/sch-school/create', data: data })
}
// 修改
export const updateSchool = async (params) => {
return await request.put({ url: '/admin-api/crm/sch-school/update', data: params })
}
// 删除
export const deleteSchool = async (id) => {
return await request.delete({ url: '/admin-api/crm/sch-school/delete?id=' + id })
}
export const updateSchoolStatus = async (id, status) => {
const data = {
id,
status
}
return request.put({ url: '/admin-api/crm/sch-school/update-status', data: data })
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

@ -12,6 +12,7 @@ const appStore = useAppStore()
const show = ref(true)
const title = computed(() => appStore.getAppInfo?.instanceName)
const logoUrl = computed(() => appStore.getAppInfo?.instanceIcon)
const layout = computed(() => appStore.getLayout)
@ -67,7 +68,7 @@ watch(
>
<img
class="w-[calc(var(--logo-height)-10px)] h-[calc(var(--logo-height)-10px)]"
src="@/assets/imgs/logo.png"
:src="logoUrl"
/>
<div
v-if="show"

@ -36,7 +36,7 @@ const formData = ref({
roleIds: []
})
const formRef = ref() // Ref
const roleList = ref([]) //
const roleList = ref<any>([]) //
/** 打开弹窗 */
const open = async (row: UserApi.UserVO) => {
@ -62,7 +62,7 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
if (!formRef) return
if (!formRef.value) return
const valid = await formRef.value.validate()
if (!valid) return
//

@ -9,7 +9,7 @@
>
<!-- 左上角的 logo + 系统标题 -->
<div class="flex items-center relative text-white">
<img alt="" class="w-48px h-48px mr-10px" src="@/assets/imgs/logo.png" />
<img alt="" class="w-48px h-48px mr-10px" :src="appInfo.instanceIcon" />
<span class="text-20px font-bold">{{ underlineToHump(appInfo.instanceName) }}</span>
</div>
<!-- 左边的背景图 + 欢迎语 -->
@ -34,7 +34,7 @@
<!-- 右上角的主题语言选择 -->
<div class="flex justify-between items-center text-white @2xl:justify-end @xl:justify-end">
<div class="flex items-center @2xl:hidden @xl:hidden">
<img alt="" class="w-48px h-48px mr-10px" src="@/assets/imgs/logo.png" />
<img alt="" class="w-48px h-48px mr-10px" :src="appInfo.instanceIcon" />
<span class="text-20px font-bold">{{ underlineToHump(appInfo.instanceName) }}</span>
</div>
<div class="flex justify-end items-center space-x-10px">

@ -5,7 +5,8 @@
</el-col>
<el-col :span="24" style="padding-left: 10px; padding-right: 10px">
<el-card class="mb-10px text-center" shadow="hover">
<Qrcode :logo="logoImg" />
<!-- <Qrcode :logo="logoUrl" /> -->
<Qrcode />
</el-card>
</el-col>
<el-divider class="enter-x">{{ t('login.qrcode') }}</el-divider>
@ -17,12 +18,14 @@
</el-row>
</template>
<script lang="ts" name="QrCodeForm" setup>
import logoImg from '@/assets/imgs/logo.png'
import LoginFormTitle from './LoginFormTitle.vue'
import { LoginStateEnum, useLoginState } from './useLogin'
// import { useAppStore } from '@/store/modules/app'
const { t } = useI18n()
const { handleBackLogin, getLoginState } = useLoginState()
// const appStore = useAppStore()
const getShow = computed(() => unref(getLoginState) === LoginStateEnum.QR_CODE)
// const logoUrl = computed(() => appStore.getAppInfo?.instanceIcon)
</script>

@ -221,6 +221,8 @@
</template>
<script setup name="Place">
import * as PlaceApi from '@/api/school/place'
import FlagRed from '@/assets/imgs/flag/flag_red.png'
import FlagYellow from '@/assets/imgs/flag/flag_yellow.png'
import FlagPurple from '@/assets/imgs/flag/flag_purple.png'
@ -307,36 +309,14 @@ function regeoCode() {
})
}
function getPageData() {
// getMapData().then((resp) => {
// if (resp.code == 200) {
schoolList.value = [{ schoolName: '测试', showInMap: true, schoolId: '0001' }]
tableData.value = [
{
schoolName: '测试',
showInMap: true,
schoolId: '0001',
name: '训练场1',
lat: 31.86119,
lng: 117.283042,
schoolShow: true,
placeId: 'p0001'
},
{
schoolName: '测试',
showInMap: false,
schoolId: '0001',
name: '训练场2',
lat: 31.86219,
lng: 117.281042,
schoolShow: true,
placeId: 'p0002'
}
]
async function getPageData() {
const data = await PlaceApi.getPlaceList()
schoolList.value = data.schoolList || []
tableData.value = data.placeList || []
if (schoolList.value.length) {
currentdeptId.value = schoolList.value[0].schoolId
createMarkersInMap()
// }
// });
}
}
const searchValue = ref('')

@ -9,15 +9,15 @@
>
<el-row :gutter="20">
<el-col :span="12" :offset="0">
<el-form-item label="驾校名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入驾校名称" />
<el-form-item label="驾校名称" prop="schoolName">
<el-input v-model="formData.schoolName" placeholder="请输入驾校名称" />
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="状态" prop="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-form-item>
</el-col>
@ -47,6 +47,8 @@
</Dialog>
</template>
<script name="DialogSchool" setup>
import * as SchoolApi from '@/api/school/sch'
const { t } = useI18n() //
const message = useMessage() //
@ -55,14 +57,14 @@ const dialogTitle = ref('') // 弹窗的标题
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
name: '',
schoolName: '',
leader: '',
phone: '',
status: 1,
status: 0,
remark: ''
})
const formRules = reactive({
name: [{ required: true, message: '驾校名称不能为空', trigger: 'blur' }]
schoolName: [{ required: true, message: '驾校名称不能为空', trigger: 'blur' }]
})
const formRef = ref() // Ref
@ -76,7 +78,7 @@ const open = async (type, id) => {
if (id) {
formLoading.value = true
try {
// formData.value = await UserApi.getUser(id)
formData.value = await SchoolApi.getSchool(id)
} finally {
formLoading.value = false
}
@ -94,12 +96,12 @@ const submitForm = async () => {
//
formLoading.value = true
try {
// const data = formData.value as unknown as UserApi.UserVO
const data = formData.value
if (formType.value === 'create') {
// await UserApi.createUser(data)
await SchoolApi.createSchool(data)
message.success(t('common.createSuccess'))
} else {
// await UserApi.updateUser(data)
await SchoolApi.updateSchool(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
@ -113,10 +115,10 @@ const submitForm = async () => {
/** 重置表单 */
const resetForm = () => {
formData.value = {
name: '',
schoolName: '',
leader: '',
phone: '',
status: 1,
status: 0,
remark: ''
}
formRef.value?.resetFields()

@ -1,31 +1,39 @@
<template>
<div>
<el-form :model="searchForm" ref="searchForm" label-width="0" inline>
<el-form :model="searchForm" label-width="0" inline>
<el-form-item>
<el-input
v-model="searchForm.name"
v-model="searchForm.schoolName"
class="!w-240px"
placeholder="请输入驾校名称"
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button @click="handleQuery"> 搜索 </el-button>
<el-button @click="resetQuery"> 重置 </el-button>
<el-button plain type="primary" @click="openForm('create')"> 新增 </el-button>
<el-button @click="handleQuery" v-hasPermi="['school:school:search']"> 搜索 </el-button>
<el-button @click="resetQuery" v-hasPermi="['school:school:reset']"> 重置 </el-button>
<el-button
plain
type="primary"
@click="openForm('create')"
v-hasPermi="['school:school:add']"
>
新增
</el-button>
</el-form-item>
</el-form>
<!-- 列表 -->
<el-table v-loading="loading" :data="tableList">
<el-table-column label="驾校名称" prop="name" />
<el-table-column label="负责人" prop="" />
<el-table-column label="联系方式" prop="" />
<el-table-column label="驾校名称" prop="schoolName" />
<el-table-column label="负责人" prop="leader" />
<el-table-column label="联系方式" prop="phone" />
<el-table-column label="状态">
<template #default="{ row }">
<el-switch
v-model="row.status"
:active-value="true"
:inactive-value="false"
:active-value="0"
:inactive-value="1"
:disabled="checkPermi(['school:school:update'])"
@change="changeStatus(row)"
/>
</template>
@ -33,15 +41,29 @@
<el-table-column label="创建时间" prop="" />
<el-table-column fixed="right" label="操作" width="150">
<template #default="{ row }">
<el-button link type="primary" @click="openForm(update, row)"> 修改 </el-button>
<el-button link type="danger" @click="handleDelete(row.id)"> 删除 </el-button>
<el-button
link
type="primary"
@click="openForm(update, row)"
v-hasPermi="['school:school:update']"
>
修改
</el-button>
<el-button
link
type="danger"
@click="handleDelete(row.id)"
v-hasPermi="['school:school:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
v-model:limit="searchForm.pageSize"
v-model:page="searchForm.pageNum"
v-model:page="searchForm.pageNo"
:total="total"
@pagination="getList"
/>
@ -49,13 +71,16 @@
</div>
</template>
<script setup name="School">
<script setup schoolName="School">
import DialogSchool from './Comp/DialogSchool.vue'
import * as api from '@/api/school/sch'
import { checkPermi } from '@/utils/permission'
const message = useMessage() //
const searchForm = ref({
name: '',
pageNum: 1,
schoolName: '',
pageNo: 1,
pageSize: 20
})
@ -67,20 +92,27 @@ const schoolDialog = ref()
function resetQuery() {
searchForm.value = {
name: '',
schoolName: '',
pageSize: 20,
pageNum: 1
pageNo: 1
}
getList()
}
function handleQuery() {
searchForm.value.pageNum = 1
searchForm.value.pageNo = 1
getList()
}
function getList() {
tableList.value = [{ name: '测试' }]
async function getList() {
loading.value = true
try {
const data = await api.getSchoolPage(searchForm.value)
tableList.value = data.list
total.value = data.total
} finally {
loading.value = false
}
}
function openForm(type, row = null) {
@ -89,20 +121,36 @@ function openForm(type, row = null) {
async function handleDelete(row) {
try {
console.log(row)
//
await message.delConfirm()
//
// await UserApi.deleteUser(row.id)
await api.deleteSchool(row.id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
function changeStatus(row) {
console.log(row)
async function changeStatus(row) {
try {
//
const text = row.status === CommonStatusEnum.ENABLE ? '启用' : '停用'
await message.confirm('确认要"' + text + '""' + row.schoolName + '"驾校吗?')
//
await api.updateSchoolStatus(row.id, row.status)
//
await getList()
} catch {
//
row.status =
row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE : CommonStatusEnum.ENABLE
}
}
/** 初始化 **/
onMounted(async () => {
await getList()
})
</script>
<style lang="scss" scoped></style>

Loading…
Cancel
Save