Compare commits
28 Commits
ab0eee51d0
...
72772ec4a1
Author | SHA1 | Date | |
---|---|---|---|
72772ec4a1 | |||
02e26691c0 | |||
cb2c8987a5 | |||
3472c840ce | |||
289a8835cf | |||
d100f33096 | |||
364d174bd9 | |||
c1d73ec544 | |||
e1f3053cc3 | |||
cd09b23027 | |||
fa685ff8e0 | |||
377a444681 | |||
5d7a5a95a2 | |||
f87d23abeb | |||
9bbecc5baa | |||
4957916d25 | |||
48b79ffd7f | |||
65827a624b | |||
8913b2215f | |||
28c65b61cb | |||
9049076e95 | |||
8f083c5940 | |||
84b125f07d | |||
137a31f3aa | |||
9310b89aeb | |||
9d2f48049c | |||
766eff2e35 | |||
eb95f764b9 |
98
.drone.yml
Normal file
98
.drone.yml
Normal file
@ -0,0 +1,98 @@
|
||||
kind: pipeline # 定义对象类型,还有secret和signature两种类型
|
||||
|
||||
type: docker # 定义流水线类型,还有kubernetes、exec、ssh等类型
|
||||
|
||||
name: filesystem-drone # 定义流水线名称
|
||||
|
||||
|
||||
steps: # 定义流水线执行步骤,这些步骤将顺序执行
|
||||
|
||||
- name: package # 流水线名称
|
||||
|
||||
image: maven:3-jdk-8 # 定义创建容器的Docker镜像
|
||||
|
||||
volumes: # 将容器内目录挂载到宿主机,仓库需要开启Trusted设置
|
||||
|
||||
- name: maven-cache
|
||||
|
||||
path: /root/.m2 # 将maven下载依赖的目录挂载出来,防止重复下载
|
||||
|
||||
- name: maven-build
|
||||
|
||||
path: /app/build # 将应用打包好的Jar和执行脚本挂载出来
|
||||
|
||||
commands: # 定义在Docker容器中执行的shell命令
|
||||
|
||||
- mvn package -Dmaven.test.skip=true # 应用打包命令
|
||||
|
||||
# - cd yudao-server/target/
|
||||
# - ls
|
||||
|
||||
- cp yudao-server/target/yudao-server.jar /app/build/yudao-server.jar
|
||||
|
||||
- cp yudao-server/Dockerfile /app/build/Dockerfile
|
||||
|
||||
- cp yudao-server/run.sh /app/build/run.sh
|
||||
|
||||
|
||||
|
||||
- name: copy package
|
||||
|
||||
image: appleboy/drone-ssh # SSH工具镜像
|
||||
|
||||
settings:
|
||||
|
||||
host: 101.43.112.107 # 远程连接地址
|
||||
|
||||
username: root # 远程连接账号
|
||||
|
||||
password:
|
||||
|
||||
from_secret: ssh_password # 从Secret中读取SSH密码
|
||||
|
||||
port: 22 # 远程连接端口
|
||||
|
||||
command_timeout: 5m # 远程执行命令超时时间
|
||||
|
||||
script:
|
||||
# - ls
|
||||
- scp -r /zymail/maven/build root@1.14.205.126:/zymail
|
||||
# - ssh root@1.14.205.126
|
||||
# - ls
|
||||
|
||||
# - chmod +x run.sh # 更改为可执行脚本
|
||||
|
||||
# - ./run.sh # 运行脚本打包应用镜像并运行
|
||||
- name: build-start
|
||||
|
||||
image: appleboy/drone-ssh # SSH工具镜像
|
||||
|
||||
settings:
|
||||
|
||||
host: 1.14.205.126 # 远程连接地址
|
||||
|
||||
username: root # 远程连接账号
|
||||
|
||||
password:
|
||||
|
||||
from_secret: ssh_password # 从Secret中读取SSH密码
|
||||
|
||||
port: 22 # 远程连接端口
|
||||
|
||||
command_timeout: 5m # 远程执行命令超时时间
|
||||
|
||||
script:
|
||||
# - ls
|
||||
- cd /zymail/build
|
||||
- chmod +x run.sh # 更改为可执行脚本
|
||||
- ./run.sh # 运行脚本打包应用镜像并运行
|
||||
|
||||
volumes: # 定义流水线挂载目录,用于共享数据
|
||||
|
||||
- name: maven-build
|
||||
host:
|
||||
path: /zymail/maven/build # 从宿主机中挂载的目录
|
||||
|
||||
- name: maven-cache
|
||||
host:
|
||||
path: /zymail/maven/cache # 从宿主机中挂载的目录
|
44
pom.xml
44
pom.xml
@ -23,7 +23,9 @@
|
||||
<module>yudao-module-mall</module>
|
||||
<module>yudao-module-crm</module>
|
||||
<module>yudao-module-erp</module>
|
||||
<!-- <module>yudao-module-ai</module>-->
|
||||
<module>yudao-module-subscribe</module>
|
||||
|
||||
<!-- <module>yudao-module-ai</module>-->
|
||||
</modules>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
@ -131,35 +133,29 @@
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<!-- 使用 huawei / aliyun 的 Maven 源,提升下载速度 -->
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>huaweicloud</id>
|
||||
<name>huawei</name>
|
||||
<url>https://mirrors.huaweicloud.com/repository/maven/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>aliyunmaven</id>
|
||||
<name>aliyun</name>
|
||||
<id>public</id>
|
||||
<name>aliyun nexus</name>
|
||||
<url>https://maven.aliyun.com/repository/public</url>
|
||||
</repository>
|
||||
|
||||
<repository>
|
||||
<id>spring-milestones</id>
|
||||
<name>Spring Milestones</name>
|
||||
<url>https://repo.spring.io/milestone</url>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>spring-snapshots</id>
|
||||
<name>Spring Snapshots</name>
|
||||
<url>https://repo.spring.io/snapshot</url>
|
||||
<releases>
|
||||
<enabled>false</enabled>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>public</id>
|
||||
<name>aliyun nexus</name>
|
||||
<url>https://maven.aliyun.com/repository/public</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
|
||||
</project>
|
||||
|
23
yudao-admin-vue3/src/api/crm/intelligent.ts
Normal file
23
yudao-admin-vue3/src/api/crm/intelligent.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 跟进记录 API
|
||||
export const FollowUpRecordApi = {
|
||||
// 查询表单列表
|
||||
selectDynamicData: async () => {
|
||||
return await request.get({ url: `/intelligentForm/selectDynamicData`})
|
||||
},
|
||||
|
||||
//添加智能表单
|
||||
saveDynamicData: async (data) => {
|
||||
return await request.post({ url: `/intelligentForm/saveDynamicData`, data })
|
||||
},
|
||||
|
||||
//查询对应表单的采集数据列表
|
||||
collectDataList: async(query) => {
|
||||
return await request.get({
|
||||
url: '/intelligentForm/collectDataList',
|
||||
method: 'get',
|
||||
params: {id:query}
|
||||
})
|
||||
}
|
||||
}
|
52
yudao-admin-vue3/src/api/subscribe/organization/index.ts
Normal file
52
yudao-admin-vue3/src/api/subscribe/organization/index.ts
Normal file
@ -0,0 +1,52 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 机构 VO
|
||||
export interface OrganizationVO {
|
||||
id: number // 机构id
|
||||
name: string // 机构名称
|
||||
phone: string // 机构电话
|
||||
email: string // 机构邮箱
|
||||
picture: string // 机构图片
|
||||
address: string // 机构地址
|
||||
depict: string // 机构简介
|
||||
status: number // 状态
|
||||
}
|
||||
|
||||
// 机构 API
|
||||
export const OrganizationApi = {
|
||||
// 查询机构分页
|
||||
getOrganizationPage: async (params: any) => {
|
||||
return await request.get({ url: `/subscribe/organization/page`, params })
|
||||
},
|
||||
|
||||
// 查询机构详情
|
||||
getOrganization: async (id: number) => {
|
||||
return await request.get({ url: `/subscribe/organization/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增机构
|
||||
createOrganization: async (data: OrganizationVO) => {
|
||||
return await request.post({ url: `/subscribe/organization/create`, data })
|
||||
},
|
||||
|
||||
// 修改机构
|
||||
updateOrganization: async (data: OrganizationVO) => {
|
||||
return await request.put({ url: `/subscribe/organization/update`, data })
|
||||
},
|
||||
|
||||
// 删除机构
|
||||
deleteOrganization: async (id: number) => {
|
||||
return await request.delete({ url: `/subscribe/organization/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出机构 Excel
|
||||
exportOrganization: async (params) => {
|
||||
return await request.download({ url: `/subscribe/organization/export-excel`, params })
|
||||
},
|
||||
|
||||
// 查询机构名称数据
|
||||
getOrganizations: async () => {
|
||||
return await request.get({ url: `/subscribe/organization/getOrganization`})
|
||||
},
|
||||
|
||||
}
|
56
yudao-admin-vue3/src/api/subscribe/staff/index.ts
Normal file
56
yudao-admin-vue3/src/api/subscribe/staff/index.ts
Normal file
@ -0,0 +1,56 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 预约人员 VO
|
||||
export interface StaffVO {
|
||||
id: number // id
|
||||
organizationId: number // 机构id
|
||||
organizationName: string
|
||||
serialNumber: string // 编号
|
||||
type: number // 类型
|
||||
name: string // 名称
|
||||
sex: number // 性别
|
||||
photo: string // 照片
|
||||
phone: string // 手机号
|
||||
serviceTime: string // 服务时间段
|
||||
serviceScope: string // 服务范围
|
||||
sign: number // 约满标记
|
||||
status: number // 状态
|
||||
content: string // 介绍
|
||||
serviceTimeArray: string
|
||||
}
|
||||
|
||||
// 预约人员 API
|
||||
export const StaffApi = {
|
||||
// 查询预约人员分页
|
||||
getStaffPage: async (params: any) => {
|
||||
return await request.get({ url: `/subscribe/staff/page`, params })
|
||||
},
|
||||
|
||||
// 查询预约人员详情
|
||||
getStaff: async (id: number) => {
|
||||
return await request.get({ url: `/subscribe/staff/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增预约人员
|
||||
createStaff: async (data: StaffVO) => {
|
||||
return await request.post({ url: `/subscribe/staff/create`, data })
|
||||
},
|
||||
|
||||
// 修改预约人员
|
||||
updateStaff: async (data: StaffVO) => {
|
||||
return await request.put({ url: `/subscribe/staff/update`, data })
|
||||
},
|
||||
|
||||
// 删除预约人员
|
||||
deleteStaff: async (id: number) => {
|
||||
return await request.delete({ url: `/subscribe/staff/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出预约人员 Excel
|
||||
exportStaff: async (params) => {
|
||||
return await request.download({ url: `/subscribe/staff/export-excel`, params })
|
||||
},
|
||||
|
||||
|
||||
|
||||
}
|
45
yudao-admin-vue3/src/api/subscribe/subscribemanage/index.ts
Normal file
45
yudao-admin-vue3/src/api/subscribe/subscribemanage/index.ts
Normal file
@ -0,0 +1,45 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 预约 VO
|
||||
export interface ManageVO {
|
||||
id: number // 表id
|
||||
userId: number // 用户id
|
||||
type: number // 预约类型
|
||||
staffId: number // 预约人员id
|
||||
subscribeTime: Date // 预约时间
|
||||
subscribeStatus: string // 预约状态
|
||||
checkStatus: number // 审核状态
|
||||
}
|
||||
|
||||
// 预约 API
|
||||
export const ManageApi = {
|
||||
// 查询预约分页
|
||||
getManagePage: async (params: any) => {
|
||||
return await request.get({ url: `/subscribe/manage/page`, params })
|
||||
},
|
||||
|
||||
// 查询预约详情
|
||||
getManage: async (id: number) => {
|
||||
return await request.get({ url: `/subscribe/manage/get?id=` + id })
|
||||
},
|
||||
|
||||
// 新增预约
|
||||
createManage: async (data: ManageVO) => {
|
||||
return await request.post({ url: `/subscribe/manage/create`, data })
|
||||
},
|
||||
|
||||
// 修改预约
|
||||
updateManage: async (data: ManageVO) => {
|
||||
return await request.put({ url: `/subscribe/manage/update`, data })
|
||||
},
|
||||
|
||||
// 删除预约
|
||||
deleteManage: async (id: number) => {
|
||||
return await request.delete({ url: `/subscribe/manage/delete?id=` + id })
|
||||
},
|
||||
|
||||
// 导出预约 Excel
|
||||
exportManage: async (params) => {
|
||||
return await request.download({ url: `/subscribe/manage/export-excel`, params })
|
||||
},
|
||||
}
|
BIN
yudao-admin-vue3/src/assets/imgs/login-back-left.png
Normal file
BIN
yudao-admin-vue3/src/assets/imgs/login-back-left.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 313 KiB |
BIN
yudao-admin-vue3/src/assets/imgs/login-back.png
Normal file
BIN
yudao-admin-vue3/src/assets/imgs/login-back.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 MiB |
@ -108,10 +108,26 @@ export const getDictLabel = (dictType: string, value: any): string => {
|
||||
}
|
||||
|
||||
export enum DICT_TYPE {
|
||||
|
||||
USER_TYPE = 'user_type',
|
||||
COMMON_STATUS = 'common_status',
|
||||
TERMINAL = 'terminal', // 终端
|
||||
DATE_INTERVAL = 'date_interval', // 数据间隔
|
||||
|
||||
//预约:人员管理
|
||||
STALL_SEX = 'stall_sex',
|
||||
STAFF_STATUS = 'staff_status',
|
||||
STAFF_FULL = 'staff_full',
|
||||
STAFF_TYPE = 'staff_type',
|
||||
|
||||
//预约:预约管理
|
||||
SUBSCRIBE_TYPE = 'subscribe_type',
|
||||
SUBSCRIBE_CHECK_STATUS = 'subscribe_check_status',
|
||||
SUBSCRIBE_STATUS = 'subscribe_status',
|
||||
|
||||
//预约:机构管理
|
||||
ORGANIZATION_STATUS = 'organization_status',
|
||||
|
||||
|
||||
// ========== SYSTEM 模块 ==========
|
||||
SYSTEM_USER_SEX = 'system_user_sex',
|
||||
|
@ -1,104 +1,169 @@
|
||||
<template>
|
||||
<div
|
||||
:class="prefixCls"
|
||||
class="relative h-[100%] lt-md:px-10px lt-sm:px-10px lt-xl:px-10px lt-xl:px-10px"
|
||||
>
|
||||
<div class="relative mx-auto h-full flex">
|
||||
<div
|
||||
:class="`${prefixCls}__left flex-1 bg-gray-500 bg-opacity-20 relative p-30px lt-xl:hidden`"
|
||||
>
|
||||
<!-- 左上角的 logo + 系统标题 -->
|
||||
<div class="relative flex items-center text-white">
|
||||
<img alt="" class="mr-10px w-48px" src="@/assets/imgs/zy-logo.jpg" />
|
||||
<span class="text-20px font-bold">{{ underlineToHump(appStore.getTitle) }}</span>
|
||||
</div>
|
||||
<!-- 左边的背景图 + 欢迎语 -->
|
||||
<div class="h-[calc(100%-60px)] flex items-center justify-center">
|
||||
<TransitionGroup
|
||||
appear
|
||||
enter-active-class="animate__animated animate__bounceInLeft"
|
||||
tag="div"
|
||||
>
|
||||
<img key="1" alt="" class="w-350px" src="@/assets/svgs/login-box-bg.svg" />
|
||||
<div key="2" class="text-3xl text-white">{{ t('login.welcome') }}</div>
|
||||
<div key="3" class="mt-5 text-14px font-normal text-white">
|
||||
{{ t('login.message') }}
|
||||
</div>
|
||||
</TransitionGroup>
|
||||
</div>
|
||||
</div>
|
||||
<div class="relative flex-1 p-30px dark:bg-[var(--login-bg-color)] lt-sm:p-10px">
|
||||
<!-- 右上角的主题、语言选择 -->
|
||||
<div
|
||||
class="flex items-center justify-between text-white at-2xl:justify-end at-xl:justify-end"
|
||||
>
|
||||
<div class="flex items-center at-2xl:hidden at-xl:hidden">
|
||||
<img alt="" class="mr-10px w-48px" src="@/assets/imgs/logo.png" />
|
||||
<span class="text-20px font-bold">{{ underlineToHump(appStore.getTitle) }}</span>
|
||||
</div>
|
||||
<div class="flex items-center justify-end space-x-10px">
|
||||
<ThemeSwitch />
|
||||
<LocaleDropdown class="dark:text-white lt-xl:text-white" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- 右边的登录界面 -->
|
||||
<Transition appear enter-active-class="animate__animated animate__bounceInRight">
|
||||
<div
|
||||
class="m-auto h-full w-[100%] flex items-center at-2xl:max-w-500px at-lg:max-w-500px at-md:max-w-500px at-xl:max-w-500px"
|
||||
>
|
||||
<!-- 账号登录 -->
|
||||
<LoginForm class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />
|
||||
<!-- 手机登录 -->
|
||||
<MobileForm class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />
|
||||
<!-- 二维码登录 -->
|
||||
<QrCodeForm class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />
|
||||
<!-- 注册 -->
|
||||
<RegisterForm class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />
|
||||
<!-- 三方登录 -->
|
||||
<SSOLoginVue class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />
|
||||
</div>
|
||||
</Transition>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div :class="prefixCls" class="relative h-[100%] lt-md:px-10px lt-sm:px-10px">
|
||||
<div class="relative mx-auto h-full flex">
|
||||
<!-- <div :class="`${prefixCls}__left flex-1 bg-gray-500 bg-opacity-20 relative p-30px lt-xl:hidden`"> -->
|
||||
<!-- 左上角的 logo + 系统标题 -->
|
||||
<!-- <div class="relative flex items-center text-white">
|
||||
<img alt="" class="mr-10px w-48px" src="@/assets/imgs/zy-logo.jpg" />
|
||||
<span class="text-20px font-bold">{{ underlineToHump(appStore.getTitle) }}</span>
|
||||
</div> -->
|
||||
<!-- 左边的背景图 + 欢迎语 -->
|
||||
<!-- <div class="h-[calc(100%-60px)] flex items-center justify-center">
|
||||
<TransitionGroup appear enter-active-class="animate__animated animate__bounceInLeft" tag="div">
|
||||
<img key="1" alt="" class="w-350px" src="@/assets/svgs/login-box-bg.svg" />
|
||||
<div key="2" class="text-3xl text-white">{{ t('login.welcome') }}</div>
|
||||
<div key="3" class="mt-5 text-14px font-normal text-white">
|
||||
{{ t('login.message') }}
|
||||
</div>
|
||||
</TransitionGroup>
|
||||
</div> -->
|
||||
<!-- </div> -->
|
||||
<div class="login relative flex-1 p-30px dark:bg-[var(--login-bg-color)] lt-sm:p-10px">
|
||||
<!-- 右上角的主题、语言选择 -->
|
||||
<div class="flex items-center justify-between text-white at-2xl:justify-end at-xl:justify-end">
|
||||
<div class="flex items-center at-2xl:hidden at-xl:hidden">
|
||||
<img alt="" class="mr-10px w-48px" src="@/assets/imgs/logo.png" />
|
||||
<span class="text-20px font-bold">{{ underlineToHump(appStore.getTitle) }}</span>
|
||||
</div>
|
||||
<div class="flex items-center justify-end space-x-10px">
|
||||
<ThemeSwitch />
|
||||
<LocaleDropdown class="dark:text-white lt-xl:text-white" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- 右边的登录界面 -->
|
||||
<Transition appear enter-active-class="animate__animated animate__bounceInRight">
|
||||
<!-- at-2xl:max-w-500px at-lg:max-w-500px at-md:max-w-500px at-xl:max-w-500px -->
|
||||
<div class="login-cont m-auto h-full w-[100%] flex items-center ">
|
||||
<div class="xia">
|
||||
<div class="left">
|
||||
<img src="@/assets/imgs/login-back-left.png" alt="" />
|
||||
</div>
|
||||
<div class="right">
|
||||
<!-- 账号登录 -->
|
||||
<LoginForm class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />
|
||||
<!-- 手机登录 -->
|
||||
<MobileForm class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />
|
||||
<!-- 二维码登录 -->
|
||||
<QrCodeForm class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />
|
||||
<!-- 注册 -->
|
||||
<RegisterForm class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />
|
||||
<!-- 三方登录 -->
|
||||
<SSOLoginVue class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-white)" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Transition>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { underlineToHump } from '@/utils'
|
||||
import { underlineToHump } from '@/utils'
|
||||
|
||||
import { useDesign } from '@/hooks/web/useDesign'
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
import { ThemeSwitch } from '@/layout/components/ThemeSwitch'
|
||||
import { LocaleDropdown } from '@/layout/components/LocaleDropdown'
|
||||
import { useDesign } from '@/hooks/web/useDesign'
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
import { ThemeSwitch } from '@/layout/components/ThemeSwitch'
|
||||
import { LocaleDropdown } from '@/layout/components/LocaleDropdown'
|
||||
|
||||
import { LoginForm, MobileForm, QrCodeForm, RegisterForm, SSOLoginVue } from './components'
|
||||
import { LoginForm, MobileForm, QrCodeForm, RegisterForm, SSOLoginVue } from './components'
|
||||
|
||||
defineOptions({ name: 'Login' })
|
||||
defineOptions({ name: 'Login' })
|
||||
|
||||
const { t } = useI18n()
|
||||
const appStore = useAppStore()
|
||||
const { getPrefixCls } = useDesign()
|
||||
const prefixCls = getPrefixCls('login')
|
||||
const { t } = useI18n()
|
||||
const appStore = useAppStore()
|
||||
const { getPrefixCls } = useDesign()
|
||||
const prefixCls = getPrefixCls('login')
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
$prefix-cls: #{$namespace}-login;
|
||||
|
||||
|
||||
|
||||
$prefix-cls: #{$namespace}-login;
|
||||
|
||||
.#{$prefix-cls} {
|
||||
overflow: auto;
|
||||
.#{$prefix-cls} {
|
||||
overflow: auto;
|
||||
|
||||
&__left {
|
||||
&::before {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: -1;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-image: url('@/assets/svgs/login-bg.svg');
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
content: '';
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
&__left {
|
||||
&::before {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: -1;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-image: url('@/assets/svgs/login-bg.svg');
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
content: '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.login{
|
||||
background:url('@/assets/imgs/login-back.png') no-repeat;
|
||||
background-size:cover;
|
||||
.login-cont{
|
||||
width: 800px;
|
||||
height: 100%;
|
||||
background: transparent;
|
||||
border-radius: 21px;
|
||||
display: flex;
|
||||
overflow: hidden;
|
||||
.xia{
|
||||
display:flex;
|
||||
.left{
|
||||
width: 50%;
|
||||
display: flex;
|
||||
img{
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
.right{
|
||||
flex:1;
|
||||
background: white;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@media screen and (min-width:1001px){
|
||||
::v-deep .el-form-item__content{
|
||||
h2{
|
||||
color:black;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width:1000px){
|
||||
.login{
|
||||
background:transparent;
|
||||
background-size:cover;
|
||||
.login-cont{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 21px;
|
||||
display:flex;
|
||||
background: transparent;
|
||||
.xia{
|
||||
.left{
|
||||
width: 50%;
|
||||
display: flex;
|
||||
display:none;
|
||||
img{
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
.right{
|
||||
flex:1;
|
||||
background: transparent !important;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,280 +1,281 @@
|
||||
<template>
|
||||
<div class="app-container" style="display: flex;flex-wrap: wrap">
|
||||
<div class="app-container" style="display: flex;flex-wrap: wrap">
|
||||
|
||||
<!-- <el-col :span="8" v-for="(o, index) in 1" :key="o" :offset="index > 0 ? 2 : 0">-->
|
||||
<!-- <el-col :span="8" v-for="(o, index) in 1" :key="o" :offset="index > 0 ? 2 : 0">-->
|
||||
|
||||
<el-card class="box-card">
|
||||
<div class="container">
|
||||
<el-button type="primary" plain @click="handleAdd" style="border: none;">
|
||||
+ 新建表单
|
||||
</el-button>
|
||||
<el-card class="box-card">
|
||||
<div class="container">
|
||||
<el-button type="primary" plain @click="handleAdd" style="border: none;">
|
||||
+ 新建表单
|
||||
</el-button>
|
||||
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card class="box-card" v-for="o in cardList" :key="o" >
|
||||
<div slot="header" class="clearfix">
|
||||
<span style="font-size: 23px;
|
||||
color: #000000;
|
||||
background-color:#ffffff;
|
||||
border-color: #fdfdff;">{{o.title}}</span>
|
||||
<el-button style="float: right; padding: 3px 0" type="text" @click="handelExtend(o.id)">推广</el-button>
|
||||
</div>
|
||||
<div style="display: flex;justify-content: space-between">
|
||||
<!-- <div style="width: 30%">-->
|
||||
<!-- <div>采购员</div>-->
|
||||
<!-- <p style="font-size: 25px">1</p>-->
|
||||
<!-- </div>-->
|
||||
<div style="width: 30%">
|
||||
<div style="font-size: 18px;
|
||||
color: #999595;
|
||||
background-color:#ffffff;
|
||||
border-color: #fdfdff;">总浏览量</div>
|
||||
<p style="font-size: 25px">{{o.pageView}}</p>
|
||||
</div>
|
||||
<div style="width: 30%">
|
||||
<el-link style="font-size: 18px;
|
||||
color: #999595;
|
||||
background-color:#ffffff;
|
||||
border-color: #fdfdff;"
|
||||
@click="extendList(o.id)">采集数量</el-link>
|
||||
<p style="font-size: 25px" @click="extendList(o.id)">{{o.collectionQuantity}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex;justify-content: space-between">
|
||||
<div>
|
||||
<span style="font-size: 16px;
|
||||
color: #999595;
|
||||
background-color:#ffffff;
|
||||
border-color: #fdfdff;">创建人:{{o.createPeople}}</span>
|
||||
</div>
|
||||
<div style="font-size: 16px;
|
||||
color: #999595;
|
||||
background-color:#ffffff;
|
||||
border-color: #fdfdff;">创建时间:{{o.createTime}}</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
|
||||
<!-- </el-col>-->
|
||||
|
||||
<!-- 添加表单对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
|
||||
<div style="text-align: center">
|
||||
<!-- <el-form-item label="表单标题">-->
|
||||
<div><span>标题</span> <el-input style="border-bottom: 1px solid skyblue;margin-bottom: 10px" v-model="addParams.title" placeholder="请输入表单标题" />
|
||||
</div>
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="字段名称">-->
|
||||
<div v-for="(item,index) in inputarr" key="index" style="margin-bottom: 10px;">
|
||||
<span>字段</span> <el-input style="border: 1px solid #DCDFE6;border-radius: 3px; " v-model="inputarr[index]" placeholder="请输入字段"></el-input>
|
||||
</div>
|
||||
<div>
|
||||
<el-button @click="adinput" style="text-align: center;width: 90%;background-color: rgb(232,244,255);color:#1890ff">添加字段</el-button>
|
||||
</div>
|
||||
|
||||
<!-- </el-form-item>-->
|
||||
</div>
|
||||
<br>
|
||||
<div class="el-input-foot">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 推广链接对话框-->
|
||||
<el-dialog :title="extendTitle" :visible.sync="extendOpen" width="500px" append-to-body>
|
||||
<el-input v-model="extendLink" placeholder="请输入内容" :disabled="true"></el-input>
|
||||
<el-button @click="copyAddress">复制</el-button>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 采集数据列表 -->
|
||||
<el-dialog :title="collectTitle" :visible.sync="collectOpen" append-to-body>
|
||||
<el-table border v-loading="loading" :data="collectLink" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<div >
|
||||
|
||||
</div>
|
||||
<!-- <el-table-column label="编号" align="center" prop="id" />-->
|
||||
<!-- <el-table-column label="id" align="center" prop="dynamicDataId" />-->
|
||||
<!-- <el-table-column v-for="item in collectLink" :label="item.map" align="center" :prop="item" />-->
|
||||
<template v-for="item in Object.keys(collectLink[0])">
|
||||
<el-table-column :label="item">
|
||||
<template #default="scope">
|
||||
<span>{{scope.row[item]}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card class="box-card" v-for="o in cardList" :key="o">
|
||||
<div class="clearfix">
|
||||
<span style="font-size: 23px;
|
||||
color: #000000;
|
||||
background-color:#ffffff;
|
||||
border-color: #fdfdff;">{{o.title}}</span>
|
||||
<el-button style="float: right; padding: 3px 0" type="text" @click="handelExtend(o.id)">推广</el-button>
|
||||
</div>
|
||||
<div style="display: flex;justify-content: space-between">
|
||||
<div style="width: 30%">
|
||||
<div style="font-size: 18px; color: #999595;
|
||||
background-color:#ffffff;
|
||||
border-color: #fdfdff;">总浏览量</div>
|
||||
<p style="font-size: 25px">{{o.pageView}}</p>
|
||||
</div>
|
||||
<div style="width: 30%">
|
||||
<el-link style="font-size: 18px;
|
||||
color: #999595;
|
||||
background-color:#ffffff;
|
||||
border-color: #fdfdff;" @click="extendList(o.id)">采集数量</el-link>
|
||||
<p style="font-size: 25px" @click="extendList(o.id)">{{o.collectionQuantity}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex;justify-content: space-between">
|
||||
<div>
|
||||
<span style="font-size: 16px;
|
||||
color: #999595;
|
||||
background-color:#ffffff;
|
||||
border-color: #fdfdff;">创建人:{{o.createPeople}}</span>
|
||||
</div>
|
||||
<div style="font-size: 16px;
|
||||
color: #999595;
|
||||
background-color:#ffffff;
|
||||
border-color: #fdfdff;">创建时间:{{o.createTime}}</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!-- 添加表单对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500">
|
||||
|
||||
<div style="text-align: center">
|
||||
<!-- <el-form-item label="表单标题">-->
|
||||
<div><span>标题</span> <el-input style="border-bottom: 1px solid skyblue;margin-bottom: 10px"
|
||||
v-model="addParams.title" placeholder="请输入表单标题" />
|
||||
</div>
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="字段名称">-->
|
||||
<div v-for="(item,index) in inputarr" :key="index" style="margin-bottom: 10px;">
|
||||
<span>字段</span>
|
||||
<el-input style="border: 1px solid #DCDFE6;border-radius: 3px; "
|
||||
v-model="inputarr[index]" placeholder="请输入字段" />
|
||||
</div>
|
||||
<div>
|
||||
<el-button @click="adinput"
|
||||
style="text-align: center;width: 90%;background-color: rgb(232,244,255);color:#1890ff">添加字段</el-button>
|
||||
</div>
|
||||
|
||||
<!-- </el-form-item>-->
|
||||
</div>
|
||||
|
||||
<div class="el-input-foot">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 推广链接对话框-->
|
||||
<el-dialog :title="extendTitle" v-model="extendOpen" width="500px" append-to-body>
|
||||
<el-input v-model="extendLink" placeholder="请输入内容" :disabled="true" />
|
||||
<el-button @click="copyAddress">复制</el-button>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 采集数据列表 -->
|
||||
<el-dialog :title="collectTitle" v-model="collectOpen" append-to-body>
|
||||
<el-table border v-loading="loading" :data="collectLink" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<div>
|
||||
|
||||
</div>
|
||||
<!-- <el-table-column label="编号" align="center" prop="id" />-->
|
||||
<!-- <el-table-column label="id" align="center" prop="dynamicDataId" />-->
|
||||
<!-- <el-table-column v-for="item in collectLink" :label="item.map" align="center" :prop="item" />-->
|
||||
<template v-for="(item, index) in Object.keys(collectLink[0])" :key="index">
|
||||
<el-table-column :label="item">
|
||||
<template #default="scope">
|
||||
<span>{{scope.row[item]}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as ArticleCategoryApi from "@/api/mall/promotion/intelligent";
|
||||
export default {
|
||||
name: "Business",
|
||||
dicts: ['stage_type', 'sales_stage'],
|
||||
data() {
|
||||
return {
|
||||
id: '',
|
||||
inputarr:[''],
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
//推广弹出框标题
|
||||
extendTitle: "",
|
||||
//采集数据列表弹出标题
|
||||
collectTitle: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 是否显示推广弹出层
|
||||
extendOpen: false,
|
||||
//是否显示采集数据列表弹出层
|
||||
collectOpen: false,
|
||||
//推广链接数据
|
||||
extendLink: '',
|
||||
//采集数据列表数据
|
||||
collectLink: [{}],
|
||||
//下拉框客户列表
|
||||
customerList: [],
|
||||
//卡片列表
|
||||
cardList: [],
|
||||
addParams: {
|
||||
title:'',
|
||||
pageView:'',
|
||||
collectionQuantity:'',
|
||||
inputarr: []
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getIntelligentList();
|
||||
},
|
||||
methods: {
|
||||
//添加表单
|
||||
adinput(){
|
||||
this.inputarr.push('')
|
||||
console.log(this.inputarr)
|
||||
},
|
||||
getIntelligentList() {
|
||||
this.loading = true;
|
||||
ArticleCategoryApi.selectDynamicData().then(response => {
|
||||
this.cardList = response.data;
|
||||
// this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
},
|
||||
//提交按钮
|
||||
submitForm(){
|
||||
this.addParams.inputarr = this.inputarr
|
||||
this.addParams.pageView = '0'
|
||||
this.addParams.collectionQuantity = '0'
|
||||
ArticleCategoryApi.saveDynamicData(this.addParams).then(response => {
|
||||
// this.cardList = response.data;
|
||||
// this.total = response.total;
|
||||
this.loading = false;
|
||||
this.open = false;
|
||||
this.getIntelligentList();
|
||||
});
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.inputarr = []
|
||||
this.addParams = {
|
||||
title:'',
|
||||
inputarr: []
|
||||
}
|
||||
this.open = true;
|
||||
this.title = "添加表单";
|
||||
},
|
||||
//推广按钮操作
|
||||
handelExtend(id) {
|
||||
this.extendLink = 'http://101.43.112.107/form/extendLink/form?id='+id
|
||||
this.extendOpen = true;
|
||||
this.extendTitle = "推广链接";
|
||||
},
|
||||
//复制按钮操作
|
||||
copyAddress() {
|
||||
const input = document.createElement('input');
|
||||
input.value = this.extendLink;
|
||||
document.body.appendChild(input);
|
||||
input.select();
|
||||
document.execCommand('copy');
|
||||
document.body.removeChild(input);
|
||||
alert('已复制到剪贴板');
|
||||
},
|
||||
//采集数据展示
|
||||
extendList(id){
|
||||
this.collectLink = null;
|
||||
this.id = id
|
||||
this.collectOpen = true;
|
||||
this.collectTitle = "采集数据";
|
||||
ArticleCategoryApi.collectDataList(this.id).then(response => {
|
||||
this.collectLink = response.data
|
||||
});
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
},
|
||||
};
|
||||
import {FollowUpRecordApi} from "@/api/crm/intelligent.ts";
|
||||
export default {
|
||||
name: "Business",
|
||||
dicts: ['stage_type', 'sales_stage'],
|
||||
data() {
|
||||
return {
|
||||
id: '',
|
||||
inputarr: [''],
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
//推广弹出框标题
|
||||
extendTitle: "",
|
||||
//采集数据列表弹出标题
|
||||
collectTitle: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 是否显示推广弹出层
|
||||
extendOpen: false,
|
||||
//是否显示采集数据列表弹出层
|
||||
collectOpen: false,
|
||||
//推广链接数据
|
||||
extendLink: '',
|
||||
//采集数据列表数据
|
||||
collectLink: [{}],
|
||||
//下拉框客户列表
|
||||
customerList: [],
|
||||
//卡片列表
|
||||
cardList: [],
|
||||
addParams: {
|
||||
title: '',
|
||||
pageView: '',
|
||||
collectionQuantity: '',
|
||||
inputarr: []
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getIntelligentList();
|
||||
},
|
||||
methods: {
|
||||
//添加表单
|
||||
adinput() {
|
||||
this.inputarr.push('')
|
||||
console.log(this.inputarr)
|
||||
},
|
||||
getIntelligentList() {
|
||||
this.loading = true;
|
||||
FollowUpRecordApi.selectDynamicData().then(response => {
|
||||
this.cardList = response;
|
||||
console.log(response,'response.data')
|
||||
// this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
},
|
||||
//提交按钮
|
||||
submitForm() {
|
||||
console.log('ssssss')
|
||||
this.addParams.inputarr = this.inputarr
|
||||
this.addParams.pageView = '0'
|
||||
this.addParams.collectionQuantity = '0'
|
||||
FollowUpRecordApi.saveDynamicData(this.addParams).then(response => {
|
||||
// this.cardList = response.data;
|
||||
// this.total = response.total;
|
||||
this.loading = false;
|
||||
this.open = false;
|
||||
this.getIntelligentList();
|
||||
});
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.inputarr = []
|
||||
this.addParams = {
|
||||
title: '',
|
||||
inputarr: []
|
||||
}
|
||||
this.open = true;
|
||||
this.title = "添加表单";
|
||||
},
|
||||
//推广按钮操作
|
||||
handelExtend(id) {
|
||||
this.extendLink = 'http://101.43.112.107/form/extendLink/form?id=' + id
|
||||
this.extendOpen = true;
|
||||
this.extendTitle = "推广链接";
|
||||
},
|
||||
//复制按钮操作
|
||||
copyAddress() {
|
||||
const input = document.createElement('input');
|
||||
input.value = this.extendLink;
|
||||
document.body.appendChild(input);
|
||||
input.select();
|
||||
document.execCommand('copy');
|
||||
document.body.removeChild(input);
|
||||
alert('已复制到剪贴板');
|
||||
},
|
||||
//采集数据展示
|
||||
extendList(id) {
|
||||
this.collectLink = null;
|
||||
this.id = id
|
||||
this.collectOpen = true;
|
||||
this.collectTitle = "采集数据";
|
||||
collectDataList(this.id).then(response => {
|
||||
this.collectLink = response.data
|
||||
});
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.clearfix:before,
|
||||
.clearfix:after {
|
||||
display: table;
|
||||
content: "";
|
||||
}
|
||||
|
||||
.clearfix:before,
|
||||
.clearfix:after {
|
||||
display: table;
|
||||
content: "";
|
||||
}
|
||||
.clearfix:after {
|
||||
clear: both
|
||||
}
|
||||
.clearfix:after {
|
||||
clear: both
|
||||
}
|
||||
|
||||
.box-card {
|
||||
width:32%;
|
||||
margin-bottom: 10px;
|
||||
margin-right:10px;
|
||||
}
|
||||
.box-card {
|
||||
width: 32%;
|
||||
margin-bottom: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100px; /* 可根据需要调整高度 */
|
||||
color: #ccc; /* 灰白色 */
|
||||
}
|
||||
.container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100px;
|
||||
/* 可根据需要调整高度 */
|
||||
color: #ccc;
|
||||
/* 灰白色 */
|
||||
}
|
||||
|
||||
.el-input-foot{
|
||||
padding: 20px;
|
||||
padding-top: 10px;
|
||||
text-align: center;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
::v-deep.el-input--medium{
|
||||
width: 80%;
|
||||
}
|
||||
::v-deep.el-input--medium .el-input__inner{
|
||||
border: none;
|
||||
/* border-bottom:1px solid blue; */
|
||||
}
|
||||
</style>
|
||||
.el-input-foot {
|
||||
padding: 20px;
|
||||
padding-top: 10px;
|
||||
text-align: center;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
::v-deep.el-input--medium {
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
::v-deep.el-input--medium .el-input__inner {
|
||||
border: none;
|
||||
/* border-bottom:1px solid blue; */
|
||||
}
|
||||
</style>
|
@ -36,6 +36,7 @@ const levelOptions = ref<LevelApi.LevelVO[]>([])
|
||||
|
||||
const getList = async () => {
|
||||
levelOptions.value = await LevelApi.getSimpleLevelList()
|
||||
console.log('2222222',levelOptions.value)
|
||||
}
|
||||
|
||||
/** 初始化 */
|
||||
|
@ -0,0 +1,137 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="800px">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="100px"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
<el-form-item label="机构名称" prop="name">
|
||||
<el-input v-model="formData.name" placeholder="请输入机构名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="机构电话" prop="phone">
|
||||
<el-input v-model="formData.phone" placeholder="请输入机构电话" />
|
||||
</el-form-item>
|
||||
<el-form-item label="机构邮箱" prop="email">
|
||||
<el-input v-model="formData.email" placeholder="请输入机构邮箱" />
|
||||
</el-form-item>
|
||||
<el-form-item label="机构图片" prop="picture">
|
||||
<UploadImg v-model="formData.picture" />
|
||||
</el-form-item>
|
||||
<el-form-item label="机构地址" prop="address">
|
||||
<el-input v-model="formData.address" placeholder="请输入机构地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status" >
|
||||
<el-select v-model="formData.status" placeholder="请选择状态" >
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.ORGANIZATION_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="机构简介" prop="depict">
|
||||
<Editor v-model="formData.depict" height="300px" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import { OrganizationApi, OrganizationVO } from '@/api/subscribe/organization'
|
||||
|
||||
/** 机构 表单 */
|
||||
defineOptions({ name: 'OrganizationForm' })
|
||||
|
||||
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({
|
||||
id: undefined,
|
||||
name: undefined,
|
||||
phone: undefined,
|
||||
email: undefined,
|
||||
picture: undefined,
|
||||
address: undefined,
|
||||
depict: undefined,
|
||||
status: undefined,
|
||||
})
|
||||
const formRules = reactive({
|
||||
name: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
|
||||
phone: [{ required: true, message: '手机号不能为空', trigger: 'blur' }],
|
||||
email: [{ required: true, message: '邮箱不能为空', trigger: 'blur' }],
|
||||
picturre: [{ required: true, message: '图片不能为空', trigger: 'blur' }],
|
||||
address: [{ required: true, message: '地址不能为空', trigger: 'blur' }],
|
||||
depict: [{ required: true, message: '简介不能为空', trigger: 'blur' }],
|
||||
status: [{ required: true, message: '状态不能为空', trigger: 'blur' }],
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string, id?: number) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = t('action.' + type)
|
||||
formType.value = type
|
||||
resetForm()
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await OrganizationApi.getOrganization(id)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
// 校验表单
|
||||
await formRef.value.validate()
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formData.value as unknown as OrganizationVO
|
||||
if (formType.value === 'create') {
|
||||
await OrganizationApi.createOrganization(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await OrganizationApi.updateOrganization(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
name: undefined,
|
||||
phone: undefined,
|
||||
email: undefined,
|
||||
picture: undefined,
|
||||
address: undefined,
|
||||
depict: undefined,
|
||||
status: undefined,
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
</script>
|
264
yudao-admin-vue3/src/views/subscribe/organization/index.vue
Normal file
264
yudao-admin-vue3/src/views/subscribe/organization/index.vue
Normal file
@ -0,0 +1,264 @@
|
||||
<template>
|
||||
<ContentWrap>
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="机构名称" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入机构名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="机构电话" prop="phone">
|
||||
<el-input
|
||||
v-model="queryParams.phone"
|
||||
placeholder="请输入机构电话"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="机构邮箱" prop="email">
|
||||
<el-input
|
||||
v-model="queryParams.email"
|
||||
placeholder="请输入机构邮箱"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="机构地址" prop="address">
|
||||
<el-input
|
||||
v-model="queryParams.address"
|
||||
placeholder="请输入机构地址"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select
|
||||
v-model="queryParams.status"
|
||||
placeholder="请选择状态"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.ORGANIZATION_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.createTime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="daterange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@click="openForm('create')"
|
||||
v-hasPermi="['subscribe:organization:create']"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['subscribe:organization:export']"
|
||||
>
|
||||
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="ID" align="center" prop="id" />
|
||||
<el-table-column label="机构名称" align="center" prop="name" />
|
||||
<el-table-column label="机构电话" align="center" prop="phone"/>
|
||||
<el-table-column label="机构邮箱" align="center" prop="email" />
|
||||
<el-table-column label="机构图片" align="center" prop="picture">
|
||||
<template #default="{ row }">
|
||||
<div class="flex">
|
||||
<el-image
|
||||
fit="cover"
|
||||
:src="row.picture"
|
||||
class="flex-none w-50px h-50px"
|
||||
@click="imagePreview(row.picture)"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="机构地址" align="center" prop="address" />
|
||||
<el-table-column label="机构简介" align="center" prop="depict" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.ORGANIZATION_STATUS" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
:formatter="dateFormatter"
|
||||
width="180px"
|
||||
/>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openForm('update', scope.row.id)"
|
||||
v-hasPermi="['subscribe:organization:update']"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
v-hasPermi="['subscribe:organization:delete']"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<OrganizationForm ref="formRef" @success="getList" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import { OrganizationApi, OrganizationVO } from '@/api/subscribe/organization'
|
||||
import OrganizationForm from './OrganizationForm.vue'
|
||||
import {createImageViewer} from "@/components/ImageViewer";
|
||||
|
||||
/** 机构 列表 */
|
||||
defineOptions({ name: 'Organization' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref<OrganizationVO[]>([]) // 列表的数据
|
||||
const total = ref(0) // 列表的总页数
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
name: undefined,
|
||||
phone: undefined,
|
||||
email: undefined,
|
||||
picture: undefined,
|
||||
address: undefined,
|
||||
depict: undefined,
|
||||
status: undefined,
|
||||
createTime: [],
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await OrganizationApi.getOrganizationPage(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const imagePreview = (imgUrl: string) => {
|
||||
createImageViewer({
|
||||
urlList: [imgUrl]
|
||||
})
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value.resetFields()
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
const openForm = (type: string, id?: number) => {
|
||||
formRef.value.open(type, id)
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (id: number) => {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
await message.delConfirm()
|
||||
// 发起删除
|
||||
await OrganizationApi.deleteOrganization(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
// 导出的二次确认
|
||||
await message.exportConfirm()
|
||||
// 发起导出
|
||||
exportLoading.value = true
|
||||
const data = await OrganizationApi.exportOrganization(queryParams)
|
||||
download.excel(data, '机构.xls')
|
||||
} catch {
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
277
yudao-admin-vue3/src/views/subscribe/staff/StaffForm.vue
Normal file
277
yudao-admin-vue3/src/views/subscribe/staff/StaffForm.vue
Normal file
@ -0,0 +1,277 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="800px">
|
||||
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="90px" v-loading="formLoading">
|
||||
<!-- <el-form-item label="所属机构" prop="organizationId">
|
||||
<el-input v-model="formData.organizationId" placeholder="请输入机构id" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="所属机构" prop="organizationId">
|
||||
<el-select v-model="formData.organizationId" placeholder="请选择机构" clearable class="!w-240px">
|
||||
<el-option v-for="organizationNameOptions in option" :key="organizationNameOptions.id"
|
||||
:label="organizationNameOptions.name" :value="organizationNameOptions.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="编号" prop="serialNumber">
|
||||
<el-input v-model="formData.serialNumber" placeholder="请输入编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="type">
|
||||
<el-select v-model="formData.type" placeholder="请选择类型">
|
||||
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.STAFF_TYPE)" :key="dict.value"
|
||||
:label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="formData.name" placeholder="请输入名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="性别" prop="sex">
|
||||
<el-select v-model="formData.sex" placeholder="请选择性别">
|
||||
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.STALL_SEX)" :key="dict.value"
|
||||
:label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="照片" prop="photo">
|
||||
<UploadImg v-model="formData.photo" />
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号" prop="phone">
|
||||
<el-input v-model="formData.phone" placeholder="请输入手机号" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="服务时间段" prop="serviceTime">
|
||||
<div v-for="(item, index) in timeRanges" :key="index" class="time-range">
|
||||
<div class="left">
|
||||
<el-time-select
|
||||
v-model="item.start"
|
||||
:max-time="item.end"
|
||||
class="mr-4"
|
||||
placeholder="开始时间"
|
||||
start="07:00"
|
||||
step="00:05"
|
||||
end="23:30"
|
||||
/>
|
||||
</div>
|
||||
<div class="center">
|
||||
-
|
||||
</div>
|
||||
<div class="right">
|
||||
<el-time-select
|
||||
v-model="item.end"
|
||||
:min-time="item.start"
|
||||
placeholder="结束时间"
|
||||
start="07:00"
|
||||
step="00:05"
|
||||
end="23:30"
|
||||
/>
|
||||
</div>
|
||||
<el-button @click="removeTime(index)" type="danger" size="mini">移除</el-button>
|
||||
</div>
|
||||
|
||||
<el-button @click="addTime" type="primary" size="small">添加时间段</el-button>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="服务范围" prop="serviceScope">
|
||||
<el-input v-model="formData.serviceScope" placeholder="请输入服务范围" />
|
||||
</el-form-item>
|
||||
<el-form-item label="约满标记" prop="sign">
|
||||
<el-select v-model="formData.sign" placeholder="请选择约满标记">
|
||||
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.STAFF_FULL)" :key="dict.value"
|
||||
:label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="formData.status" placeholder="请选择状态">
|
||||
<el-option v-for="dict in getIntDictOptions(DICT_TYPE.STAFF_STATUS)" :key="dict.value"
|
||||
:label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="介绍" prop="content">
|
||||
<Editor v-model="formData.content" height="300px" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import { StaffApi, StaffVO } from '@/api/subscribe/staff'
|
||||
import { OrganizationApi, OrganizationVO } from '@/api/subscribe/organization'
|
||||
|
||||
|
||||
/** 预约人员 表单 */
|
||||
defineOptions({ name: 'StaffForm' })
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
const option = ref<OrganizationVO[]>([]);
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
id: undefined,
|
||||
organizationId: undefined,
|
||||
serialNumber: undefined,
|
||||
type: undefined,
|
||||
name: undefined,
|
||||
sex: undefined,
|
||||
photo: undefined,
|
||||
phone: undefined,
|
||||
serviceTime: '',
|
||||
serviceTimeArray: [{}],
|
||||
serviceScope: undefined,
|
||||
sign: undefined,
|
||||
status: undefined,
|
||||
content: undefined,
|
||||
})
|
||||
const formRules = reactive({
|
||||
organizationId: [{ required: true, message: '所属机构不能为空', trigger: 'blur' }],
|
||||
serialNumber: [{ required: true, message: '编号不能为空', trigger: 'blur' }],
|
||||
type: [{ required: true, message: '类型不能为空', trigger: 'blur' }],
|
||||
name: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
|
||||
sex: [{ required: true, message: '性别不能为空', trigger: 'blur' }],
|
||||
photo: [{ required: true, message: '照片不能为空', trigger: 'blur' }],
|
||||
phone: [{ required: true, message: '手机号不能为空', trigger: 'blur' }],
|
||||
// serviceTime: [{ required: true, message: '服务时间段不能为空', trigger: 'blur' }],
|
||||
serviceScope: [{ required: true, message: '服务范围不能为空', trigger: 'blur' }],
|
||||
sign: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
||||
status: [{ required: true, message: '状态不能为空', trigger: 'blur' }],
|
||||
content: [{ required: true, message: '介绍不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
|
||||
const timeRanges = ref([{ start: '', end: '' }]);
|
||||
|
||||
const addTime = () => {
|
||||
timeRanges.value.push({ start: '', end: '' });
|
||||
};
|
||||
|
||||
const removeTime = (index : number) => {
|
||||
if (timeRanges.value.length > 1) {
|
||||
timeRanges.value.splice(index, 1);
|
||||
}
|
||||
};
|
||||
|
||||
//初始化机构名称下拉框
|
||||
const getOrganizations = async () => {
|
||||
try {
|
||||
option.value = await OrganizationApi.getOrganizations()
|
||||
} finally {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type : string, id ?: number) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = t('action.' + type)
|
||||
timeRanges.value = ([]) //清空timeRanges的数据
|
||||
timeRanges.value.push({ start: '', end: '' }); //再将timeRaanges设置为{ start: '', end: '' }
|
||||
formType.value = type
|
||||
resetForm()
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
timeRanges.value = ([]); //修改页面:组件设置为空
|
||||
formData.value = await StaffApi.getStaff(id)
|
||||
const timeRange = JSON.parse(formData.value.serviceTime)
|
||||
for (var i = 0; i < timeRange.length; i++) {
|
||||
timeRanges.value.push(timeRange[i]); //原有的时间段push上去
|
||||
}
|
||||
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
|
||||
// 校验表单
|
||||
await formRef.value.validate()
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value.serviceTime = JSON.stringify(timeRanges.value);
|
||||
const data = formData.value as unknown as StaffVO
|
||||
if (formType.value === 'create') {
|
||||
await StaffApi.createStaff(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await StaffApi.updateStaff(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
organizationId: undefined,
|
||||
serialNumber: undefined,
|
||||
type: undefined,
|
||||
name: undefined,
|
||||
sex: undefined,
|
||||
photo: undefined,
|
||||
phone: undefined,
|
||||
serviceTime: '',
|
||||
serviceTimeArray: [{}],
|
||||
serviceScope: undefined,
|
||||
sign: undefined,
|
||||
status: undefined,
|
||||
content: undefined,
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getOrganizations()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.time-range {
|
||||
margin-bottom: 10px;
|
||||
margin-right: 40px;
|
||||
/* width: 300px;
|
||||
height: 150px; */
|
||||
display: flex;
|
||||
/* justify-content: space-between; */
|
||||
}
|
||||
|
||||
.left {
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
.center {
|
||||
width: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.right {
|
||||
width: 150px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
/* .separator {
|
||||
text-align: center;
|
||||
}
|
||||
.remove-btn {
|
||||
text-align: right;
|
||||
margin-top: 5px;
|
||||
} */
|
||||
</style>
|
376
yudao-admin-vue3/src/views/subscribe/staff/index.vue
Normal file
376
yudao-admin-vue3/src/views/subscribe/staff/index.vue
Normal file
@ -0,0 +1,376 @@
|
||||
<template>
|
||||
<ContentWrap>
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-form-item label="所属机构" prop="organizationId">
|
||||
<el-select
|
||||
v-model="queryParams.organizationId"
|
||||
placeholder="请选择机构"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="organizationNameOptions in option"
|
||||
:key="organizationNameOptions.id"
|
||||
:label="organizationNameOptions.name"
|
||||
:value="organizationNameOptions.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="编号" prop="serialNumber">
|
||||
<el-input
|
||||
v-model="queryParams.serialNumber"
|
||||
placeholder="请输入编号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="type">
|
||||
<el-select
|
||||
v-model="queryParams.type"
|
||||
placeholder="请选择类型"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.STAFF_TYPE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
placeholder="请输入名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="性别" prop="sex">
|
||||
<el-select
|
||||
v-model="queryParams.sex"
|
||||
placeholder="请选择性别"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.STALL_SEX)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号" prop="phone">
|
||||
<el-input
|
||||
v-model="queryParams.phone"
|
||||
placeholder="请输入手机号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="服务时间段" prop="serviceTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.serviceTime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="daterange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="服务范围" prop="serviceScope">
|
||||
<el-input
|
||||
v-model="queryParams.serviceScope"
|
||||
placeholder="请输入服务范围"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="约满标记" prop="sign">
|
||||
<el-select
|
||||
v-model="queryParams.sign"
|
||||
placeholder="请选择约满标记"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.STAFF_FULL)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select
|
||||
v-model="queryParams.status"
|
||||
placeholder="请选择状态"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.STAFF_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.createTime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="daterange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@click="openForm('create')"
|
||||
v-hasPermi="['subscribe:staff:create']"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['subscribe:staff:export']"
|
||||
>
|
||||
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
|
||||
|
||||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="ID" align="center" prop="id" />
|
||||
<el-table-column label="所属机构" align="center" prop="organizationName" />
|
||||
<el-table-column label="编号" align="center" prop="serialNumber" />
|
||||
<el-table-column label="类型" align="center" prop="type" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.STAFF_TYPE" :value="scope.row.type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="名称" align="center" prop="name" />
|
||||
<el-table-column label="性别" align="center" prop="sex">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.STALL_SEX" :value="scope.row.sex" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="照片" align="center" prop="photo">
|
||||
<template #default="{ row }">
|
||||
<div class="flex">
|
||||
<el-image
|
||||
fit="cover"
|
||||
:src="row.photo"
|
||||
class="flex-none w-50px h-50px"
|
||||
@click="imagePreview(row.photo)"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="手机号" align="center" prop="phone" />
|
||||
<el-table-column label="服务时间段" align="center" prop="serviceTimeArray" width="200" />
|
||||
<el-table-column label="服务范围" align="center" prop="serviceScope" />
|
||||
<el-table-column label="约满标记" align="center" prop="sign" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.STAFF_FULL" :value="scope.row.sign" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.STAFF_STATUS" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="介绍" align="center" prop="content" >
|
||||
<template #default="scope">
|
||||
<div v-html="scope.row.content"></div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
:formatter="dateFormatter"
|
||||
width="180px"
|
||||
/>
|
||||
<el-table-column label="操作" align="center" fixed="right" width="110">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openForm('update', scope.row.id)"
|
||||
v-hasPermi="['subscribe:staff:update']"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
v-hasPermi="['subscribe:staff:delete']"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<StaffForm ref="formRef" @success="getList" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import { StaffApi, StaffVO } from '@/api/subscribe/staff'
|
||||
import StaffForm from './StaffForm.vue'
|
||||
import {createImageViewer} from "@/components/ImageViewer";
|
||||
import { OrganizationApi, OrganizationVO } from '@/api/subscribe/organization'
|
||||
|
||||
/** 预约人员 列表 */
|
||||
defineOptions({ name: 'Staff' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref<StaffVO[]>([]) // 列表的数据
|
||||
const total = ref(0) // 列表的总页数
|
||||
const option = ref<OrganizationVO[]>([]);
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
organizationId: undefined,
|
||||
serialNumber: undefined,
|
||||
type: undefined,
|
||||
name: undefined,
|
||||
sex: undefined,
|
||||
photo: undefined,
|
||||
phone: undefined,
|
||||
serviceTime: undefined,
|
||||
serviceScope: undefined,
|
||||
sign: undefined,
|
||||
status: undefined,
|
||||
content: undefined,
|
||||
createTime: [],
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await StaffApi.getStaffPage(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
//初始化机构名称下拉框
|
||||
const getOrganization = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
option.value = await OrganizationApi.getOrganizations()
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value.resetFields()
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
const openForm = (type: string, id?: number) => {
|
||||
formRef.value.open(type, id)
|
||||
}
|
||||
|
||||
const imagePreview = (imgUrl: string) => {
|
||||
createImageViewer({
|
||||
urlList: [imgUrl]
|
||||
})
|
||||
}
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (id: number) => {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
await message.delConfirm()
|
||||
// 发起删除
|
||||
await StaffApi.deleteStaff(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
// 导出的二次确认
|
||||
await message.exportConfirm()
|
||||
// 发起导出
|
||||
exportLoading.value = true
|
||||
const data = await StaffApi.exportStaff(queryParams)
|
||||
download.excel(data, '预约人员.xls')
|
||||
} catch {
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getList()
|
||||
getOrganization()
|
||||
})
|
||||
</script>
|
@ -0,0 +1,174 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="100px"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
<el-form-item label="用户id" prop="userId">
|
||||
<el-input v-model="formData.userId" placeholder="请输入用户id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="预约类型" prop="type">
|
||||
<el-select v-model="formData.type" placeholder="请选择预约类型">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.SUBSCRIBE_TYPE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属机构" prop="organizationId">
|
||||
<el-select v-model="formData.organizationId" placeholder="请选择机构" clearable class="!w-240px">
|
||||
<el-option v-for="organizationNameOptions in option" :key="organizationNameOptions.id"
|
||||
:label="organizationNameOptions.name" :value="organizationNameOptions.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="预约人员id" prop="staffId">
|
||||
<el-input v-model="formData.staffId" placeholder="请输入预约人员id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="预约时间" prop="subscribeTime">
|
||||
<el-date-picker
|
||||
v-model="formData.subscribeTime"
|
||||
type="date"
|
||||
value-format="x"
|
||||
placeholder="选择预约时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="预约状态" prop="subscribeStatus">
|
||||
<el-radio-group v-model="formData.subscribeStatus">
|
||||
<el-radio label="1">请选择字典生成</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="预约状态" prop="subscribeStatus">
|
||||
<el-select v-model="formData.subscribeStatus" placeholder="请选择预约状态">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.SUBSCRIBE_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核状态" prop="checkStatus">
|
||||
<el-select v-model="formData.checkStatus" placeholder="请选择审核状态">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.SUBSCRIBE_CHECK_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import { ManageApi, ManageVO } from '@/api/subscribe/subscribemanage'
|
||||
import { OrganizationApi, OrganizationVO } from '@/api/subscribe/organization'
|
||||
|
||||
/** 预约 表单 */
|
||||
defineOptions({ name: 'ManageForm' })
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const option = ref<OrganizationVO[]>([]);
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
id: undefined,
|
||||
userId: undefined,
|
||||
type: undefined,
|
||||
staffId: undefined,
|
||||
subscribeTime: undefined,
|
||||
subscribeStatus: undefined,
|
||||
checkStatus: undefined,
|
||||
})
|
||||
const formRules = reactive({
|
||||
userId: [{ required: true, message: '用户不能为空', trigger: 'blur' }],
|
||||
type: [{ required: true, message: '预约类型不能为空', trigger: 'blur' }],
|
||||
staffId: [{ required: true, message: '预约人员不能为空', trigger: 'blur' }],
|
||||
subscribeTime: [{ required: true, message: '预约时间不能为空', trigger: 'blur' }],
|
||||
subscribeStatus: [{ required: true, message: '预约状态不能为空', trigger: 'blur' }],
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
//初始化机构名称下拉框
|
||||
const getOrganizations = async () => {
|
||||
try {
|
||||
option.value = await OrganizationApi.getOrganizations()
|
||||
} finally {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type: string, id?: number) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = t('action.' + type)
|
||||
formType.value = type
|
||||
resetForm()
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await ManageApi.getManage(id)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
// 校验表单
|
||||
await formRef.value.validate()
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formData.value as unknown as ManageVO
|
||||
if (formType.value === 'create') {
|
||||
await ManageApi.createManage(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await ManageApi.updateManage(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getOrganizations()
|
||||
})
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
id: undefined,
|
||||
userId: undefined,
|
||||
type: undefined,
|
||||
staffId: undefined,
|
||||
subscribeTime: undefined,
|
||||
subscribeStatus: undefined,
|
||||
checkStatus: undefined,
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
</script>
|
278
yudao-admin-vue3/src/views/subscribe/subscribemanage/index.vue
Normal file
278
yudao-admin-vue3/src/views/subscribe/subscribemanage/index.vue
Normal file
@ -0,0 +1,278 @@
|
||||
<template>
|
||||
<ContentWrap>
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="100px"
|
||||
>
|
||||
<!-- <el-form-item label="用户" prop="userId">
|
||||
<el-input
|
||||
v-model="queryParams.userId"
|
||||
placeholder="请输入用户"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="预约类型" prop="type">
|
||||
<el-select
|
||||
v-model="queryParams.type"
|
||||
placeholder="请选择预约类型"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.SUBSCRIBE_TYPE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="预约人员" prop="staffName">
|
||||
<el-input
|
||||
v-model="queryParams.staffName"
|
||||
placeholder="请输入预约人员"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="预约时间" prop="subscribeTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.subscribeTime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="daterange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="预约状态" prop="subscribeStatus">
|
||||
<el-select
|
||||
v-model="queryParams.subscribeStatus"
|
||||
placeholder="请选择预约状态"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.SUBSCRIBE_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核状态" prop="checkStatus">
|
||||
<el-select
|
||||
v-model="queryParams.checkStatus"
|
||||
placeholder="请选择审核状态"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.SUBSCRIBE_CHECK_STATUS)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.createTime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="daterange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@click="openForm('create')"
|
||||
v-hasPermi="['subscribe:manage:create']"
|
||||
>
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['subscribe:manage:export']"
|
||||
>
|
||||
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="ID" align="center" prop="id" />
|
||||
<el-table-column label="用户" align="center" prop="userId" />
|
||||
<el-table-column label="预约类型" align="center" prop="type">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.SUBSCRIBE_TYPE" :value="scope.row.type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="预约人员" align="center" prop="staffId" />
|
||||
<el-table-column
|
||||
label="预约时间"
|
||||
align="center"
|
||||
prop="subscribeTime"
|
||||
:formatter="dateFormatter"
|
||||
width="180px"
|
||||
/>
|
||||
<el-table-column label="预约状态" align="center" prop="subscribeStatus" />
|
||||
<el-table-column label="审核状态" align="center" prop="checkStatus">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.SUBSCRIBE_CHECK_STATUS" :value="scope.row.checkStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
:formatter="dateFormatter"
|
||||
width="180px"
|
||||
/>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="openForm('update', scope.row.id)"
|
||||
v-hasPermi="['subscribe:manage:update']"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
v-hasPermi="['subscribe:manage:delete']"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<ManageForm ref="formRef" @success="getList" />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import { ManageApi, ManageVO } from '@/api/subscribe/subscribemanage'
|
||||
import ManageForm from './ManageForm.vue'
|
||||
|
||||
/** 预约 列表 */
|
||||
defineOptions({ name: 'SubscribeManage' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref<ManageVO[]>([]) // 列表的数据
|
||||
const total = ref(0) // 列表的总页数
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
userId: undefined,
|
||||
type: undefined,
|
||||
staffId: undefined,
|
||||
staffName: undefined,
|
||||
subscribeTime: [],
|
||||
subscribeStatus: undefined,
|
||||
checkStatus: undefined,
|
||||
createTime: [],
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await ManageApi.getManagePage(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value.resetFields()
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
const openForm = (type: string, id?: number) => {
|
||||
formRef.value.open(type, id)
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (id: number) => {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
await message.delConfirm()
|
||||
// 发起删除
|
||||
await ManageApi.deleteManage(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
// 导出的二次确认
|
||||
await message.exportConfirm()
|
||||
// 发起导出
|
||||
exportLoading.value = true
|
||||
const data = await ManageApi.exportManage(queryParams)
|
||||
download.excel(data, '预约.xls')
|
||||
} catch {
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
22
yudao-module-subscribe/pom.xml
Normal file
22
yudao-module-subscribe/pom.xml
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>yudao</artifactId>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<modules>
|
||||
<module>yudao-module-subscribe-api</module>
|
||||
<module>yudao-module-subscribe-biz</module>
|
||||
</modules>
|
||||
|
||||
<artifactId>yudao-module-subscribe</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
|
||||
|
||||
</project>
|
21
yudao-module-subscribe/yudao-module-subscribe-api/pom.xml
Normal file
21
yudao-module-subscribe/yudao-module-subscribe-api/pom.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>yudao-module-subscribe</artifactId>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>yudao-module-subscribe-api</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-common</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
@ -0,0 +1,11 @@
|
||||
package cn.iocoder.yudao.module.subscribe.enums;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
||||
|
||||
public interface ErrorCodeConstants {
|
||||
|
||||
ErrorCode MANAGE_NOT_EXISTS = new ErrorCode(11111, "预约不存在");
|
||||
ErrorCode STAFF_NOT_EXISTS = new ErrorCode(22222, "预约人员不存在");
|
||||
ErrorCode ORGANIZATION_NOT_EXISTS = new ErrorCode(33333, "机构不存在");
|
||||
|
||||
}
|
69
yudao-module-subscribe/yudao-module-subscribe-biz/pom.xml
Normal file
69
yudao-module-subscribe/yudao-module-subscribe-biz/pom.xml
Normal file
@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>yudao-module-subscribe</artifactId>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>yudao-module-subscribe-biz</artifactId>
|
||||
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-subscribe-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-system-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 业务组件 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-biz-tenant</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Web 相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- DB 相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-mybatis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Test 测试相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-test</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-excel</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.com.kingbase</groupId>
|
||||
<artifactId>kingbase8</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
@ -0,0 +1,105 @@
|
||||
package cn.iocoder.yudao.module.srbscribe.controller.admin.organization;
|
||||
|
||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.organization.vo.OrganizationPageReqVO;
|
||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.organization.vo.OrganizationRespVO;
|
||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.organization.vo.OrganizationSaveReqVO;
|
||||
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.organization.OrganizationDO;
|
||||
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.organization.OrganizationOptions;
|
||||
import cn.iocoder.yudao.module.srbscribe.service.organization.OrganizationService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 机构")
|
||||
@RestController
|
||||
@RequestMapping("/subscribe/organization")
|
||||
@Validated
|
||||
public class OrganizationController {
|
||||
|
||||
@Resource
|
||||
private OrganizationService organizationService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建机构")
|
||||
@PreAuthorize("@ss.hasPermission('subscribe:organization:create')")
|
||||
public CommonResult<Integer> createOrganization(@Valid @RequestBody OrganizationSaveReqVO createReqVO) {
|
||||
return success(organizationService.createOrganization(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新机构")
|
||||
@PreAuthorize("@ss.hasPermission('subscribe:organization:update')")
|
||||
public CommonResult<Boolean> updateOrganization(@Valid @RequestBody OrganizationSaveReqVO updateReqVO) {
|
||||
organizationService.updateOrganization(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除机构")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('subscribe:organization:delete')")
|
||||
public CommonResult<Boolean> deleteOrganization(@RequestParam("id") Integer id) {
|
||||
organizationService.deleteOrganization(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得机构")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('subscribe:organization:query')")
|
||||
public CommonResult<OrganizationRespVO> getOrganization(@RequestParam("id") Integer id) {
|
||||
OrganizationDO organization = organizationService.getOrganization(id);
|
||||
return success(BeanUtils.toBean(organization, OrganizationRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得机构分页")
|
||||
@PreAuthorize("@ss.hasPermission('subscribe:organization:query')")
|
||||
public CommonResult<PageResult<OrganizationRespVO>> getOrganizationPage(@Valid OrganizationPageReqVO pageReqVO) {
|
||||
PageResult<OrganizationDO> pageResult = organizationService.getOrganizationPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, OrganizationRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出机构 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('subscribe:organization:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportOrganizationExcel(@Valid OrganizationPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<OrganizationDO> list = organizationService.getOrganizationPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "机构.xls", "数据", OrganizationRespVO.class,
|
||||
BeanUtils.toBean(list, OrganizationRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/getOrganization")
|
||||
@Operation(summary = "获得机构名称数据")
|
||||
public CommonResult<List<OrganizationDO>> getOrganization() {
|
||||
List<OrganizationDO> organization = organizationService.getOrganization();
|
||||
return success(organization);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.srbscribe.controller.admin.organization.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 机构分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class OrganizationPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "机构名称", example = "芋艿")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "机构电话")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "机构邮箱")
|
||||
private String email;
|
||||
|
||||
@Schema(description = "机构图片")
|
||||
private String picture;
|
||||
|
||||
@Schema(description = "机构地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "机构简介")
|
||||
private String depict;
|
||||
|
||||
@Schema(description = "状态", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
package cn.iocoder.yudao.module.srbscribe.controller.admin.organization.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
|
||||
@Schema(description = "管理后台 - 机构 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class OrganizationRespVO {
|
||||
|
||||
@Schema(description = "机构id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9041")
|
||||
@ExcelProperty("机构id")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "机构名称", example = "芋艿")
|
||||
@ExcelProperty("机构名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "机构电话")
|
||||
@ExcelProperty("机构电话")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "机构邮箱")
|
||||
@ExcelProperty("机构邮箱")
|
||||
private String email;
|
||||
|
||||
@Schema(description = "机构图片")
|
||||
@ExcelProperty("机构图片")
|
||||
private String picture;
|
||||
|
||||
@Schema(description = "机构地址")
|
||||
@ExcelProperty("机构地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "机构简介")
|
||||
@ExcelProperty("机构简介")
|
||||
private String depict;
|
||||
|
||||
@Schema(description = "状态", example = "1")
|
||||
@ExcelProperty(value = "状态", converter = DictConvert.class)
|
||||
@DictFormat("organization_status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package cn.iocoder.yudao.module.srbscribe.controller.admin.organization.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 机构新增/修改 Request VO")
|
||||
@Data
|
||||
public class OrganizationSaveReqVO {
|
||||
|
||||
@Schema(description = "机构id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9041")
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "机构名称", example = "芋艿")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "机构电话")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "机构邮箱")
|
||||
private String email;
|
||||
|
||||
@Schema(description = "机构图片")
|
||||
private String picture;
|
||||
|
||||
@Schema(description = "机构地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "机构简介")
|
||||
private String depict;
|
||||
|
||||
@Schema(description = "状态", example = "1")
|
||||
private Integer status;
|
||||
|
||||
}
|
@ -0,0 +1,103 @@
|
||||
package cn.iocoder.yudao.module.srbscribe.controller.admin.staff;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.organization.vo.OrganizationRespVO;
|
||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.staff.vo.StaffPageReqVO;
|
||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.staff.vo.StaffRespVO;
|
||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.staff.vo.StaffSaveReqVO;
|
||||
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.organization.OrganizationDO;
|
||||
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.organization.OrganizationOptions;
|
||||
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.staff.StaffDO;
|
||||
import cn.iocoder.yudao.module.srbscribe.service.organization.OrganizationService;
|
||||
import cn.iocoder.yudao.module.srbscribe.service.staff.StaffService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 预约人员")
|
||||
@RestController
|
||||
@RequestMapping("/subscribe/staff")
|
||||
@Validated
|
||||
public class StaffController {
|
||||
|
||||
@Resource
|
||||
private StaffService staffService;
|
||||
|
||||
@Resource
|
||||
private OrganizationService organizationService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建预约人员")
|
||||
@PreAuthorize("@ss.hasPermission('subscribe:staff:create')")
|
||||
public CommonResult<Long> createStaff(@Valid @RequestBody StaffSaveReqVO createReqVO) {
|
||||
return success(staffService.createStaff(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新预约人员")
|
||||
@PreAuthorize("@ss.hasPermission('subscribe:staff:update')")
|
||||
public CommonResult<Boolean> updateStaff(@Valid @RequestBody StaffSaveReqVO updateReqVO) {
|
||||
staffService.updateStaff(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除预约人员")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('subscribe:staff:delete')")
|
||||
public CommonResult<Boolean> deleteStaff(@RequestParam("id") Long id) {
|
||||
staffService.deleteStaff(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得预约人员")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('subscribe:staff:query')")
|
||||
public CommonResult<StaffRespVO> getStaff(@RequestParam("id") Long id) {
|
||||
StaffDO staff = staffService.getStaff(id);
|
||||
return success(BeanUtils.toBean(staff, StaffRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得预约人员分页")
|
||||
@PreAuthorize("@ss.hasPermission('subscribe:staff:query')")
|
||||
public CommonResult<PageResult<StaffRespVO>> getStaffPage(@Valid StaffPageReqVO pageReqVO) {
|
||||
PageResult<StaffDO> pageResult = staffService.getStaffPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, StaffRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出预约人员 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('subscribe:staff:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportStaffExcel(@Valid StaffPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<StaffDO> list = staffService.getStaffPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "预约人员.xls", "数据", StaffRespVO.class,
|
||||
BeanUtils.toBean(list, StaffRespVO.class));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package cn.iocoder.yudao.module.srbscribe.controller.admin.staff.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ServiceTimeVO {
|
||||
private String start;
|
||||
private String end;
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package cn.iocoder.yudao.module.srbscribe.controller.admin.staff.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 预约人员分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class StaffPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "机构id", example = "26075")
|
||||
private Long organizationId;
|
||||
|
||||
@Schema(description = "编号")
|
||||
private String serialNumber;
|
||||
|
||||
@Schema(description = "类型", example = "1")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "名称", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "性别")
|
||||
private Integer sex;
|
||||
|
||||
@Schema(description = "照片")
|
||||
private String photo;
|
||||
|
||||
@Schema(description = "手机号")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "服务时间段")
|
||||
private String serviceTime;
|
||||
|
||||
// @Schema(description = "服务开始时间")
|
||||
// private String serviceStartTime;
|
||||
|
||||
|
||||
|
||||
@Schema(description = "服务范围")
|
||||
private String serviceScope;
|
||||
|
||||
@Schema(description = "约满标记")
|
||||
private Integer sign;
|
||||
|
||||
@Schema(description = "状态", example = "2")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "介绍")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -0,0 +1,86 @@
|
||||
package cn.iocoder.yudao.module.srbscribe.controller.admin.staff.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
|
||||
@Schema(description = "管理后台 - 预约人员 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class StaffRespVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "21490")
|
||||
@ExcelProperty("id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "机构id", example = "26075")
|
||||
@ExcelProperty("机构id")
|
||||
private Long organizationId;
|
||||
|
||||
@Schema(description = "编号")
|
||||
@ExcelProperty("编号")
|
||||
private String serialNumber;
|
||||
|
||||
@Schema(description = "类型", example = "1")
|
||||
@ExcelProperty(value = "类型", converter = DictConvert.class)
|
||||
@DictFormat("staff_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "名称", example = "张三")
|
||||
@ExcelProperty("名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "性别")
|
||||
@ExcelProperty(value = "性别", converter = DictConvert.class)
|
||||
@DictFormat("stall_sex") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private Integer sex;
|
||||
|
||||
@Schema(description = "照片")
|
||||
@ExcelProperty("照片")
|
||||
private String photo;
|
||||
|
||||
@Schema(description = "手机号")
|
||||
@ExcelProperty("手机号")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "服务时间段")
|
||||
@ExcelProperty("服务时间段")
|
||||
private String serviceTime;
|
||||
|
||||
// @Schema(description = "服务开始时间")
|
||||
// private String serviceStartTime;
|
||||
//
|
||||
private String serviceTimeArray;
|
||||
|
||||
@Schema(description = "服务范围")
|
||||
@ExcelProperty("服务范围")
|
||||
private String serviceScope;
|
||||
|
||||
@Schema(description = "约满标记")
|
||||
@ExcelProperty(value = "约满标记", converter = DictConvert.class)
|
||||
@DictFormat("staff_full") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private Integer sign;
|
||||
|
||||
@Schema(description = "状态", example = "2")
|
||||
@ExcelProperty(value = "状态", converter = DictConvert.class)
|
||||
@DictFormat("staff_status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "介绍")
|
||||
@ExcelProperty("介绍")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "所属机构")
|
||||
@ExcelProperty("所属机构")
|
||||
private String organizationName;
|
||||
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package cn.iocoder.yudao.module.srbscribe.controller.admin.staff.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 预约人员新增/修改 Request VO")
|
||||
@Data
|
||||
public class StaffSaveReqVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "21490")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "机构id", example = "26075")
|
||||
private Long organizationId;
|
||||
|
||||
@Schema(description = "编号")
|
||||
private String serialNumber;
|
||||
|
||||
@Schema(description = "类型", example = "1")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "名称", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "性别")
|
||||
private Integer sex;
|
||||
|
||||
@Schema(description = "照片")
|
||||
private String photo;
|
||||
|
||||
@Schema(description = "手机号")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "服务时间段")
|
||||
private String serviceTime;
|
||||
|
||||
@Schema(description = "服务范围")
|
||||
private String serviceScope;
|
||||
|
||||
@Schema(description = "约满标记")
|
||||
private Integer sign;
|
||||
|
||||
@Schema(description = "状态", example = "2")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "介绍")
|
||||
private String content;
|
||||
|
||||
}
|
@ -0,0 +1,97 @@
|
||||
package cn.iocoder.yudao.module.srbscribe.controller.admin.subscribemanage;
|
||||
|
||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.subscribemanage.vo.SubscribeManagePageReqVO;
|
||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.subscribemanage.vo.SubscribeManageRespVO;
|
||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.subscribemanage.vo.SubscribeManageSaveReqVO;
|
||||
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.subscribemanage.SubscribeManageDO;
|
||||
import cn.iocoder.yudao.module.srbscribe.service.subscribemanage.SubscribeManageService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 预约")
|
||||
@RestController
|
||||
@RequestMapping("/subscribe/manage")
|
||||
@Validated
|
||||
public class SubscribeManageController {
|
||||
|
||||
@Resource
|
||||
private SubscribeManageService manageService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建预约")
|
||||
@PreAuthorize("@ss.hasPermission('subscribe:manage:create')")
|
||||
public CommonResult<Long> createManage(@Valid @RequestBody SubscribeManageSaveReqVO createReqVO) {
|
||||
return success(manageService.createManage(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新预约")
|
||||
@PreAuthorize("@ss.hasPermission('subscribe:manage:update')")
|
||||
public CommonResult<Boolean> updateManage(@Valid @RequestBody SubscribeManageSaveReqVO updateReqVO) {
|
||||
manageService.updateManage(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除预约")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('subscribe:manage:delete')")
|
||||
public CommonResult<Boolean> deleteManage(@RequestParam("id") Long id) {
|
||||
manageService.deleteManage(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得预约")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('subscribe:manage:query')")
|
||||
public CommonResult<SubscribeManageRespVO> getManage(@RequestParam("id") Long id) {
|
||||
SubscribeManageDO manage = manageService.getManage(id);
|
||||
return success(BeanUtils.toBean(manage, SubscribeManageRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得预约分页")
|
||||
@PreAuthorize("@ss.hasPermission('subscribe:manage:query')")
|
||||
public CommonResult<PageResult<SubscribeManageRespVO>> getManagePage(@Valid SubscribeManagePageReqVO pageReqVO) {
|
||||
PageResult<SubscribeManageDO> pageResult = manageService.getManagePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, SubscribeManageRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出预约 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('subscribe:manage:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportManageExcel(@Valid SubscribeManagePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<SubscribeManageDO> list = manageService.getManagePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "预约.xls", "数据", SubscribeManageRespVO.class,
|
||||
BeanUtils.toBean(list, SubscribeManageRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.srbscribe.controller.admin.subscribemanage.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 预约分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class SubscribeManagePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "用户id", example = "20637")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "预约类型", example = "2")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "预约人员id", example = "23520")
|
||||
private Long staffId;
|
||||
|
||||
@Schema(description = "预约时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] subscribeTime;
|
||||
|
||||
@Schema(description = "预约状态", example = "1")
|
||||
private String subscribeStatus;
|
||||
|
||||
@Schema(description = "审核状态", example = "1")
|
||||
private Integer checkStatus;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
private String staffName;
|
||||
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package cn.iocoder.yudao.module.srbscribe.controller.admin.subscribemanage.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
|
||||
@Schema(description = "管理后台 - 预约 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class SubscribeManageRespVO {
|
||||
|
||||
@Schema(description = "表id", requiredMode = Schema.RequiredMode.REQUIRED, example = "20273")
|
||||
@ExcelProperty("表id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "用户id", example = "20637")
|
||||
@ExcelProperty("用户id")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "用户姓名")
|
||||
@ExcelProperty("用户姓名")
|
||||
private String userName;
|
||||
|
||||
@Schema(description = "预约类型", example = "2")
|
||||
@ExcelProperty(value = "预约类型", converter = DictConvert.class)
|
||||
@DictFormat("subscribe_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "预约人员id", example = "23520")
|
||||
@ExcelProperty("预约人员id")
|
||||
private Long staffId;
|
||||
|
||||
@Schema(description = "预约人员")
|
||||
@ExcelProperty("预约人员")
|
||||
private String staffName;
|
||||
|
||||
@Schema(description = "预约时间")
|
||||
@ExcelProperty("预约时间")
|
||||
private LocalDateTime subscribeTime;
|
||||
|
||||
@Schema(description = "预约状态", example = "1")
|
||||
@ExcelProperty("预约状态")
|
||||
private String subscribeStatus;
|
||||
|
||||
@Schema(description = "审核状态", example = "1")
|
||||
@ExcelProperty(value = "审核状态", converter = DictConvert.class)
|
||||
@DictFormat("subscribe_check_status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private Integer checkStatus;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package cn.iocoder.yudao.module.srbscribe.controller.admin.subscribemanage.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 预约新增/修改 Request VO")
|
||||
@Data
|
||||
public class SubscribeManageSaveReqVO {
|
||||
|
||||
@Schema(description = "表id", requiredMode = Schema.RequiredMode.REQUIRED, example = "20273")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "用户id", example = "20637")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "预约类型", example = "2")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "预约人员id", example = "23520")
|
||||
private Long staffId;
|
||||
|
||||
@Schema(description = "预约时间")
|
||||
private LocalDateTime subscribeTime;
|
||||
|
||||
@Schema(description = "预约状态", example = "1")
|
||||
private String subscribeStatus;
|
||||
|
||||
@Schema(description = "审核状态", example = "1")
|
||||
private Integer checkStatus;
|
||||
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package cn.iocoder.yudao.module.srbscribe.dal.dataobject.organization;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 机构 DO
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@TableName("subscribe_organization")
|
||||
@KeySequence("subscribe_organization_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class OrganizationDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 机构id
|
||||
*/
|
||||
@TableId
|
||||
private Integer id;
|
||||
/**
|
||||
* 机构名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 机构电话
|
||||
*/
|
||||
private String phone;
|
||||
/**
|
||||
* 机构邮箱
|
||||
*/
|
||||
private String email;
|
||||
/**
|
||||
* 机构图片
|
||||
*/
|
||||
private String picture;
|
||||
/**
|
||||
* 机构地址
|
||||
*/
|
||||
private String address;
|
||||
/**
|
||||
* 机构简介
|
||||
*/
|
||||
private String depict;
|
||||
/**
|
||||
* 状态
|
||||
*
|
||||
* 枚举 {@link TODO organization_status 对应的类}
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package cn.iocoder.yudao.module.srbscribe.dal.dataobject.organization;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class OrganizationOptions {
|
||||
|
||||
private String value;
|
||||
private String label;
|
||||
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package cn.iocoder.yudao.module.srbscribe.dal.dataobject.staff;
|
||||
|
||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.staff.vo.ServiceTimeVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 预约人员 DO
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@TableName("subscribe_staff")
|
||||
@KeySequence("subscribe_staff_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class StaffDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 机构id
|
||||
*/
|
||||
private Long organizationId;
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String serialNumber;
|
||||
/**
|
||||
* 类型
|
||||
*
|
||||
* 枚举 {@link TODO staff_type 对应的类}
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 性别
|
||||
*
|
||||
* 枚举 {@link TODO stall_sex 对应的类}
|
||||
*/
|
||||
private Integer sex;
|
||||
/**
|
||||
* 照片
|
||||
*/
|
||||
private String photo;
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
private String phone;
|
||||
/**
|
||||
* 服务时间段
|
||||
*/
|
||||
private String serviceTime;
|
||||
/**
|
||||
* 服务范围
|
||||
*/
|
||||
private String serviceScope;
|
||||
/**
|
||||
* 约满标记
|
||||
*
|
||||
* 枚举 {@link TODO staff_full 对应的类}
|
||||
*/
|
||||
private Integer sign;
|
||||
/**
|
||||
* 状态
|
||||
*
|
||||
* 枚举 {@link TODO staff_status 对应的类}
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 介绍
|
||||
*/
|
||||
private String content;
|
||||
|
||||
//机构名称
|
||||
@TableField(exist = false)
|
||||
private String organizationName;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String serviceTimeArray ;
|
||||
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package cn.iocoder.yudao.module.srbscribe.dal.dataobject.subscribemanage;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 预约 DO
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@TableName("subscribe_subscribe_manage")
|
||||
@KeySequence("subscribe_subscribe_manage_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SubscribeManageDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 表id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
/**
|
||||
* 预约类型
|
||||
*
|
||||
* 枚举 {@link TODO subscribe_type 对应的类}
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 预约人员id
|
||||
*/
|
||||
private Long staffId;
|
||||
/**
|
||||
* 预约时间
|
||||
*/
|
||||
private LocalDateTime subscribeTime;
|
||||
/**
|
||||
* 预约状态
|
||||
*/
|
||||
private String subscribeStatus;
|
||||
/**
|
||||
* 审核状态
|
||||
*
|
||||
* 枚举 {@link TODO subscribe_check_status 对应的类}
|
||||
*/
|
||||
private Integer checkStatus;
|
||||
|
||||
|
||||
//预约人员名称
|
||||
@TableField(exist=false)
|
||||
private String staffName;
|
||||
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package cn.iocoder.yudao.module.srbscribe.dal.mysql.organization;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.organization.vo.OrganizationPageReqVO;
|
||||
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.organization.OrganizationDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
|
||||
/**
|
||||
* 机构 Mapper
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrganizationMapper extends BaseMapperX<OrganizationDO> {
|
||||
|
||||
default PageResult<OrganizationDO> selectPage(OrganizationPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<OrganizationDO>()
|
||||
.likeIfPresent(OrganizationDO::getName, reqVO.getName())
|
||||
.eqIfPresent(OrganizationDO::getPhone, reqVO.getPhone())
|
||||
.eqIfPresent(OrganizationDO::getEmail, reqVO.getEmail())
|
||||
.likeIfPresent(OrganizationDO::getAddress, reqVO.getAddress())
|
||||
.eqIfPresent(OrganizationDO::getStatus, reqVO.getStatus())
|
||||
.betweenIfPresent(OrganizationDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(OrganizationDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package cn.iocoder.yudao.module.srbscribe.dal.mysql.staff;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.staff.vo.StaffPageReqVO;
|
||||
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.staff.StaffDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 预约人员 Mapper
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface StaffMapper extends BaseMapperX<StaffDO> {
|
||||
|
||||
default PageResult<StaffDO> selectPage(StaffPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<StaffDO>()
|
||||
.eqIfPresent(StaffDO::getOrganizationId, reqVO.getOrganizationId())
|
||||
.eqIfPresent(StaffDO::getSerialNumber, reqVO.getSerialNumber())
|
||||
.eqIfPresent(StaffDO::getType, reqVO.getType())
|
||||
.likeIfPresent(StaffDO::getName, reqVO.getName())
|
||||
.eqIfPresent(StaffDO::getSex, reqVO.getSex())
|
||||
.eqIfPresent(StaffDO::getPhoto, reqVO.getPhoto())
|
||||
.eqIfPresent(StaffDO::getPhone, reqVO.getPhone())
|
||||
// .betweenIfPresent(StaffDO::getServiceTime, reqVO.getServiceTime())
|
||||
.eqIfPresent(StaffDO::getServiceScope, reqVO.getServiceScope())
|
||||
.eqIfPresent(StaffDO::getSign, reqVO.getSign())
|
||||
.eqIfPresent(StaffDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(StaffDO::getContent, reqVO.getContent())
|
||||
.betweenIfPresent(StaffDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(StaffDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.srbscribe.dal.mysql.subscribemanage;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.subscribemanage.vo.SubscribeManagePageReqVO;
|
||||
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.subscribemanage.SubscribeManageDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
|
||||
/**
|
||||
* 预约 Mapper
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface SubscribeManageMapper extends BaseMapperX<SubscribeManageDO> {
|
||||
|
||||
default PageResult<SubscribeManageDO> selectPage(SubscribeManagePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<SubscribeManageDO>()
|
||||
.eqIfPresent(SubscribeManageDO::getUserId, reqVO.getUserId())
|
||||
.eqIfPresent(SubscribeManageDO::getType, reqVO.getType())
|
||||
.eqIfPresent(SubscribeManageDO::getStaffId, reqVO.getStaffId())
|
||||
.betweenIfPresent(SubscribeManageDO::getSubscribeTime, reqVO.getSubscribeTime())
|
||||
.eqIfPresent(SubscribeManageDO::getSubscribeStatus, reqVO.getSubscribeStatus())
|
||||
.eqIfPresent(SubscribeManageDO::getCheckStatus, reqVO.getCheckStatus())
|
||||
.betweenIfPresent(SubscribeManageDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(SubscribeManageDO::getId));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package cn.iocoder.yudao.module.srbscribe.service.organization;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.organization.vo.OrganizationPageReqVO;
|
||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.organization.vo.OrganizationSaveReqVO;
|
||||
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.organization.OrganizationDO;
|
||||
|
||||
import javax.validation.*;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 机构 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface OrganizationService {
|
||||
|
||||
/**
|
||||
* 创建机构
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Integer createOrganization(@Valid OrganizationSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新机构
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateOrganization(@Valid OrganizationSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除机构
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteOrganization(Integer id);
|
||||
|
||||
/**
|
||||
* 获得机构
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 机构
|
||||
*/
|
||||
OrganizationDO getOrganization(Integer id);
|
||||
|
||||
/**
|
||||
* 获得机构分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 机构分页
|
||||
*/
|
||||
PageResult<OrganizationDO> getOrganizationPage(OrganizationPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获取机构所有数据
|
||||
*/
|
||||
List<OrganizationDO> getOrganization();
|
||||
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package cn.iocoder.yudao.module.srbscribe.service.organization;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.organization.vo.OrganizationPageReqVO;
|
||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.organization.vo.OrganizationSaveReqVO;
|
||||
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.organization.OrganizationDO;
|
||||
import cn.iocoder.yudao.module.srbscribe.dal.mysql.organization.OrganizationMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.subscribe.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 机构 Service 实现类
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class OrganizationServiceImpl implements OrganizationService {
|
||||
|
||||
@Resource
|
||||
private OrganizationMapper organizationMapper;
|
||||
|
||||
@Override
|
||||
public Integer createOrganization(OrganizationSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
OrganizationDO organization = BeanUtils.toBean(createReqVO, OrganizationDO.class);
|
||||
organizationMapper.insert(organization);
|
||||
// 返回
|
||||
return organization.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateOrganization(OrganizationSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateOrganizationExists(updateReqVO.getId());
|
||||
// 更新
|
||||
OrganizationDO updateObj = BeanUtils.toBean(updateReqVO, OrganizationDO.class);
|
||||
organizationMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteOrganization(Integer id) {
|
||||
// 校验存在
|
||||
validateOrganizationExists(id);
|
||||
// 删除
|
||||
organizationMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateOrganizationExists(Integer id) {
|
||||
if (organizationMapper.selectById(id) == null) {
|
||||
throw exception(ORGANIZATION_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrganizationDO getOrganization(Integer id) {
|
||||
return organizationMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<OrganizationDO> getOrganizationPage(OrganizationPageReqVO pageReqVO) {
|
||||
return organizationMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrganizationDO> getOrganization() {
|
||||
return organizationMapper.selectList();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.srbscribe.service.staff;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.staff.vo.StaffPageReqVO;
|
||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.staff.vo.StaffSaveReqVO;
|
||||
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.staff.StaffDO;
|
||||
|
||||
import javax.validation.*;
|
||||
|
||||
/**
|
||||
* 预约人员 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface StaffService {
|
||||
|
||||
/**
|
||||
* 创建预约人员
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createStaff(@Valid StaffSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新预约人员
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateStaff(@Valid StaffSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除预约人员
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteStaff(Long id);
|
||||
|
||||
/**
|
||||
* 获得预约人员
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 预约人员
|
||||
*/
|
||||
StaffDO getStaff(Long id);
|
||||
|
||||
/**
|
||||
* 获得预约人员分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 预约人员分页
|
||||
*/
|
||||
PageResult<StaffDO> getStaffPage(StaffPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,101 @@
|
||||
package cn.iocoder.yudao.module.srbscribe.service.staff;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.staff.vo.ServiceTimeVO;
|
||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.staff.vo.StaffPageReqVO;
|
||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.staff.vo.StaffSaveReqVO;
|
||||
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.organization.OrganizationDO;
|
||||
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.staff.StaffDO;
|
||||
import cn.iocoder.yudao.module.srbscribe.dal.mysql.organization.OrganizationMapper;
|
||||
import cn.iocoder.yudao.module.srbscribe.dal.mysql.staff.StaffMapper;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.TypeReference;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.subscribe.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 预约人员 Service 实现类
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class StaffServiceImpl implements StaffService {
|
||||
|
||||
@Resource
|
||||
private StaffMapper staffMapper;
|
||||
|
||||
@Resource
|
||||
private OrganizationMapper organizationMapper;
|
||||
|
||||
@Override
|
||||
public Long createStaff(StaffSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
StaffDO staff = BeanUtils.toBean(createReqVO, StaffDO.class);
|
||||
staffMapper.insert(staff);
|
||||
// 返回
|
||||
return staff.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStaff(StaffSaveReqVO updateReqVO) {
|
||||
JSON.toJSONString(updateReqVO.getServiceTime());
|
||||
// 校验存在
|
||||
validateStaffExists(updateReqVO.getId());
|
||||
// 更新
|
||||
StaffDO updateObj = BeanUtils.toBean(updateReqVO, StaffDO.class);
|
||||
staffMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteStaff(Long id) {
|
||||
// 校验存在
|
||||
validateStaffExists(id);
|
||||
// 删除
|
||||
staffMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateStaffExists(Long id) {
|
||||
if (staffMapper.selectById(id) == null) {
|
||||
throw exception(STAFF_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public StaffDO getStaff(Long id) {
|
||||
return staffMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<StaffDO> getStaffPage(StaffPageReqVO pageReqVO) {
|
||||
PageResult<StaffDO> staffDOPageResult = staffMapper.selectPage(pageReqVO);
|
||||
|
||||
String serviceTime = "";
|
||||
for (int i = 0; i < staffDOPageResult.getList().size(); i++) {
|
||||
StaffDO staffDO = staffDOPageResult.getList().get(i);
|
||||
OrganizationDO organizationDO = organizationMapper.selectOne("id", staffDO.getOrganizationId());
|
||||
staffDO.setOrganizationName(organizationDO.getName());
|
||||
|
||||
//把StringJSON格式serviceTime转成对象
|
||||
List<ServiceTimeVO> serviceTimeVOS = JSON.parseObject(staffDO.getServiceTime(), new TypeReference<List<ServiceTimeVO>>() {});
|
||||
for (int j = 0; j < serviceTimeVOS.size(); j++) {
|
||||
ServiceTimeVO serviceTimeVO = serviceTimeVOS.get(j);
|
||||
serviceTime = serviceTime + serviceTimeVO.getStart() + " - " + serviceTimeVO.getEnd() + " , ";
|
||||
}
|
||||
String replaceAll = serviceTime.replaceAll(",\\s*$", "");
|
||||
staffDO.setServiceTimeArray(replaceAll);
|
||||
serviceTime = "";
|
||||
}
|
||||
|
||||
return staffDOPageResult;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
package cn.iocoder.yudao.module.srbscribe.service.subscribemanage;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.subscribemanage.vo.SubscribeManagePageReqVO;
|
||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.subscribemanage.vo.SubscribeManageSaveReqVO;
|
||||
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.subscribemanage.SubscribeManageDO;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
|
||||
|
||||
/**
|
||||
* 预约 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface SubscribeManageService {
|
||||
|
||||
/**
|
||||
* 创建预约
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createManage(@Valid SubscribeManageSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新预约
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateManage(@Valid SubscribeManageSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除预约
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteManage(Long id);
|
||||
|
||||
/**
|
||||
* 获得预约
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 预约
|
||||
*/
|
||||
SubscribeManageDO getManage(Long id);
|
||||
|
||||
/**
|
||||
* 获得预约分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 预约分页
|
||||
*/
|
||||
PageResult<SubscribeManageDO> getManagePage(SubscribeManagePageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,87 @@
|
||||
package cn.iocoder.yudao.module.srbscribe.service.subscribemanage;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.subscribemanage.vo.SubscribeManagePageReqVO;
|
||||
import cn.iocoder.yudao.module.srbscribe.controller.admin.subscribemanage.vo.SubscribeManageSaveReqVO;
|
||||
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.staff.StaffDO;
|
||||
import cn.iocoder.yudao.module.srbscribe.dal.dataobject.subscribemanage.SubscribeManageDO;
|
||||
import cn.iocoder.yudao.module.srbscribe.dal.mysql.staff.StaffMapper;
|
||||
import cn.iocoder.yudao.module.srbscribe.dal.mysql.subscribemanage.SubscribeManageMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.subscribe.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 预约 Service 实现类
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class SubscribeManageServiceImpl implements SubscribeManageService {
|
||||
|
||||
@Resource
|
||||
private SubscribeManageMapper manageMapper;
|
||||
|
||||
@Resource
|
||||
private StaffMapper staffMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public Long createManage(SubscribeManageSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
SubscribeManageDO manage = BeanUtils.toBean(createReqVO, SubscribeManageDO.class);
|
||||
manageMapper.insert(manage);
|
||||
// 返回
|
||||
return manage.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateManage(SubscribeManageSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateManageExists(updateReqVO.getId());
|
||||
// 更新
|
||||
SubscribeManageDO updateObj = BeanUtils.toBean(updateReqVO, SubscribeManageDO.class);
|
||||
manageMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteManage(Long id) {
|
||||
// 校验存在
|
||||
validateManageExists(id);
|
||||
// 删除
|
||||
manageMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateManageExists(Long id) {
|
||||
if (manageMapper.selectById(id) == null) {
|
||||
throw exception(MANAGE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SubscribeManageDO getManage(Long id) {
|
||||
return manageMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<SubscribeManageDO> getManagePage(SubscribeManagePageReqVO pageReqVO) {
|
||||
|
||||
if (pageReqVO.getStaffName() != null){
|
||||
StaffDO staffDO = staffMapper.selectOne("name", pageReqVO.getStaffName());
|
||||
pageReqVO.setStaffId(staffDO.getId());
|
||||
}
|
||||
|
||||
PageResult<SubscribeManageDO> subscribeManageDOPageResult = manageMapper.selectPage(pageReqVO);
|
||||
for (int i = 0; i < subscribeManageDOPageResult.getList().size(); i++) {
|
||||
SubscribeManageDO subscribeManageDO = subscribeManageDOPageResult.getList().get(i);
|
||||
StaffDO staffDO = staffMapper.selectOne("id", subscribeManageDO.getStaffId());
|
||||
subscribeManageDO.setStaffName(staffDO.getName());//设置预约人员名称
|
||||
}
|
||||
return subscribeManageDOPageResult;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
DELETE FROM "subscribe_subscribe_manage";
|
||||
DELETE FROM "subscribe_organization";
|
||||
DELETE FROM "subscribe_staff";
|
@ -0,0 +1,57 @@
|
||||
CREATE TABLE IF NOT EXISTS "subscribe_subscribe_manage" (
|
||||
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
|
||||
"user_id" bigint,
|
||||
"type" int,
|
||||
"staff_id" bigint,
|
||||
"subscribe_time" varchar,
|
||||
"subscribe_status" varchar,
|
||||
"check_status" int,
|
||||
"create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
"creator" varchar DEFAULT '',
|
||||
"updater" varchar DEFAULT '',
|
||||
"deleted" bit NOT NULL DEFAULT FALSE,
|
||||
"tenant_id" bigint,
|
||||
PRIMARY KEY ("id")
|
||||
) COMMENT '预约表';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "subscribe_organization" (
|
||||
"id" int NOT NULL GENERATED BY DEFAULT AS IDENTITY,
|
||||
"name" varchar,
|
||||
"phone" varchar,
|
||||
"email" varchar,
|
||||
"picture" varchar,
|
||||
"address" varchar,
|
||||
"depict" varchar,
|
||||
"status" int,
|
||||
"create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
"creator" varchar DEFAULT '',
|
||||
"updater" varchar DEFAULT '',
|
||||
"deleted" bit NOT NULL DEFAULT FALSE,
|
||||
"tenant_id" bigint,
|
||||
PRIMARY KEY ("id")
|
||||
) COMMENT '机构';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "subscribe_staff" (
|
||||
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
|
||||
"organization_id" bigint,
|
||||
"serial_number" varchar,
|
||||
"type" int,
|
||||
"name" varchar,
|
||||
"sex" int,
|
||||
"photo" varchar,
|
||||
"phone" varchar,
|
||||
"service_time" varchar,
|
||||
"service_scope" varchar,
|
||||
"sign" int,
|
||||
"status" int,
|
||||
"content" varchar,
|
||||
"create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
"creator" varchar DEFAULT '',
|
||||
"updater" varchar DEFAULT '',
|
||||
"deleted" bit NOT NULL DEFAULT FALSE,
|
||||
"tenant_id" bigint,
|
||||
PRIMARY KEY ("id")
|
||||
) COMMENT '预约人员';
|
@ -1,12 +1,10 @@
|
||||
## AdoptOpenJDK 停止发布 OpenJDK 二进制,而 Eclipse Temurin 是它的延伸,提供更好的稳定性
|
||||
## 感谢复旦核博士的建议!灰子哥,牛皮!
|
||||
FROM eclipse-temurin:8-jre
|
||||
FROM openjdk:8-jre
|
||||
|
||||
## 创建目录,并使用它作为工作目录
|
||||
RUN mkdir -p /yudao-server
|
||||
WORKDIR /yudao-server
|
||||
## 将后端项目的 Jar 文件,复制到镜像中
|
||||
COPY ./target/yudao-server.jar app.jar
|
||||
ADD yudao-server.jar app.jar
|
||||
|
||||
## 设置 TZ 时区
|
||||
ENV TZ=Asia/Shanghai
|
||||
|
@ -65,6 +65,12 @@
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-subscribe-biz</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 商城相关模块。默认注释,保证编译速度-->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
|
16
yudao-server/run.sh
Normal file
16
yudao-server/run.sh
Normal file
@ -0,0 +1,16 @@
|
||||
app_name='zymall'
|
||||
# 定义应用版本
|
||||
app_version='1.0.0'
|
||||
# 定义应用环境
|
||||
#profile_active='prod'
|
||||
echo '----stop container----'
|
||||
docker stop ${app_name}
|
||||
echo '----rm container----'
|
||||
docker rm ${app_name}
|
||||
echo '----rm image----'
|
||||
docker rmi ${app_name}:${app_version}
|
||||
# 打包编译docker镜像
|
||||
echo '----build image----'
|
||||
docker buildx build -f Dockerfile -t ${app_name}:${app_version} .
|
||||
echo '----start container----'
|
||||
docker run -d -p 6127:6127 --name ${app_name} ${app_name}:${app_version}
|
@ -203,8 +203,8 @@ wx:
|
||||
# secret: 333ae72f41552af1e998fe1f54e1584a
|
||||
# appid: wx63c280fe3248a3e7 # wenhualian的接口测试号
|
||||
# secret: 6f270509224a7ae1296bbf1c8cb97aed
|
||||
appid: wxe88f237df9dae1e9 # 众悦科技
|
||||
secret: 18182ef4aacdefd65b5c8063f7b5254e
|
||||
appid: wxa66f2777a5656baf # 众悦科技
|
||||
secret: 2fd77fed89c7722fc6f586093edb1370
|
||||
# appid: wxc4598c446f8a9cb3 # 测试号(Kongdy 提供的)
|
||||
# secret: 4a1a04e07f6a4a0751b39c3064a92c8b
|
||||
config-storage:
|
||||
|
Loading…
x
Reference in New Issue
Block a user