From 9b15c04efc9368e93fb6d7602cbff034badedcd3 Mon Sep 17 00:00:00 2001 From: owen Date: Mon, 21 Aug 2023 21:31:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=9A=E5=91=98=EF=BC=9A=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BC=9A=E5=91=98=E7=AD=89=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 7bef2409262a4075b51b5dbc14d275b5cc3f0a0e) --- src/api/member/level/index.ts | 5 ++ .../level/components/MemberLevelSelect.vue | 46 +++++++++++++++++++ src/views/member/user/UserForm.vue | 35 +++++++++++--- src/views/member/user/index.vue | 13 +++--- 4 files changed, 86 insertions(+), 13 deletions(-) create mode 100644 src/views/member/level/components/MemberLevelSelect.vue diff --git a/src/api/member/level/index.ts b/src/api/member/level/index.ts index 8a069089..a284fd2d 100644 --- a/src/api/member/level/index.ts +++ b/src/api/member/level/index.ts @@ -21,6 +21,11 @@ export const getLevel = async (id: number) => { return await request.get({ url: `/member/level/get?id=` + id }) } +// 查询会员等级 - 精简信息列表 +export const getSimpleLevelList = async () => { + return await request.get({ url: `/member/level/list-all-simple` }) +} + // 新增会员等级 export const createLevel = async (data: LevelVO) => { return await request.post({ url: `/member/level/create`, data }) diff --git a/src/views/member/level/components/MemberLevelSelect.vue b/src/views/member/level/components/MemberLevelSelect.vue new file mode 100644 index 00000000..73e11f1b --- /dev/null +++ b/src/views/member/level/components/MemberLevelSelect.vue @@ -0,0 +1,46 @@ + + + diff --git a/src/views/member/user/UserForm.vue b/src/views/member/user/UserForm.vue index c10d3fea..2a86c63e 100644 --- a/src/views/member/user/UserForm.vue +++ b/src/views/member/user/UserForm.vue @@ -60,6 +60,22 @@ + + + + + + + + + + + + @@ -76,6 +92,7 @@ import * as UserApi from '@/api/member/user' import * as AreaApi from '@/api/system/area' import { defaultProps } from '@/utils/tree' import MemberTagSelect from '@/views/member/tag/components/MemberTagSelect.vue' +import MemberLevelSelect from '@/views/member/level/components/MemberLevelSelect.vue' const { t } = useI18n() // 国际化 const message = useMessage() // 消息弹窗 @@ -87,6 +104,7 @@ const formType = ref('') // 表单的类型:create - 新增;update - 修改 const formData = ref({ id: undefined, mobile: undefined, + password: undefined, status: undefined, nickname: undefined, avatar: undefined, @@ -95,14 +113,18 @@ const formData = ref({ areaId: undefined, birthday: undefined, mark: undefined, - tagIds: [] + tagIds: [], + levelId: undefined, + levelReason: undefined }) const formRules = reactive({ mobile: [{ required: true, message: '手机号不能为空', trigger: 'blur' }], - status: [{ required: true, message: '状态不能为空', trigger: 'blur' }] + status: [{ required: true, message: '状态不能为空', trigger: 'blur' }], + levelReason: [{ required: true, message: '修改原因不能为空', trigger: 'blur' }] }) const formRef = ref() // 表单 Ref const areaList = ref([]) // 地区列表 +const originLevelId = ref() // 修改前的会员等级 /** 打开弹窗 */ const open = async (type: string, id?: number) => { @@ -115,6 +137,7 @@ const open = async (type: string, id?: number) => { formLoading.value = true try { formData.value = await UserApi.getUser(id) + originLevelId.value = formData.value.levelId } finally { formLoading.value = false } @@ -158,9 +181,6 @@ const resetForm = () => { mobile: undefined, password: undefined, status: undefined, - registerIp: undefined, - loginIp: undefined, - loginDate: undefined, nickname: undefined, avatar: undefined, name: undefined, @@ -168,8 +188,9 @@ const resetForm = () => { areaId: undefined, birthday: undefined, mark: undefined, - createTime: undefined, - tagIds: [] + tagIds: [], + levelId: undefined, + levelReason: undefined } formRef.value?.resetFields() } diff --git a/src/views/member/user/index.vue b/src/views/member/user/index.vue index 0389de37..673fd63d 100644 --- a/src/views/member/user/index.vue +++ b/src/views/member/user/index.vue @@ -51,6 +51,9 @@ + + + 搜索 重置 @@ -69,8 +72,8 @@ + - {