From 51738f8f6e60b59666c3c9ace97d251a051bcb14 Mon Sep 17 00:00:00 2001 From: owen Date: Tue, 22 Aug 2023 11:23:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=9A=E5=91=98:=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=BC=9A=E5=91=98=E7=AD=89=E7=BA=A7=EF=BC=8C=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E5=8D=95=E7=8B=AC=E7=9A=84=E8=A1=A8=E5=8D=95=E3=80=81=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/member/user/index.ts | 5 ++ src/views/member/user/UpdateLevelForm.vue | 101 ++++++++++++++++++++++ src/views/member/user/UserForm.vue | 26 +----- src/views/member/user/index.vue | 15 +++- 4 files changed, 121 insertions(+), 26 deletions(-) create mode 100644 src/views/member/user/UpdateLevelForm.vue diff --git a/src/api/member/user/index.ts b/src/api/member/user/index.ts index fbeaba93..2a6b6ccf 100644 --- a/src/api/member/user/index.ts +++ b/src/api/member/user/index.ts @@ -32,3 +32,8 @@ export const getUser = async (id: number) => { export const updateUser = async (data: UserVO) => { return await request.put({ url: `/member/user/update`, data }) } + +// 修改会员用户等级 +export const updateUserLevel = async (data: any) => { + return await request.put({ url: `/member/user/update-level`, data }) +} diff --git a/src/views/member/user/UpdateLevelForm.vue b/src/views/member/user/UpdateLevelForm.vue new file mode 100644 index 00000000..e583f4a9 --- /dev/null +++ b/src/views/member/user/UpdateLevelForm.vue @@ -0,0 +1,101 @@ + + diff --git a/src/views/member/user/UserForm.vue b/src/views/member/user/UserForm.vue index 0b7915a2..0da4ef61 100644 --- a/src/views/member/user/UserForm.vue +++ b/src/views/member/user/UserForm.vue @@ -60,22 +60,6 @@ - - - - - - - - - - - - @@ -95,7 +79,6 @@ 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' import MemberGroupSelect from '@/views/member/group/components/MemberGroupSelect.vue' const { t } = useI18n() // 国际化 @@ -118,18 +101,14 @@ const formData = ref({ birthday: undefined, mark: undefined, tagIds: [], - levelId: undefined, - levelReason: undefined, groupId: undefined }) const formRules = reactive({ mobile: [{ required: true, message: '手机号不能为空', trigger: 'blur' }], - status: [{ required: true, message: '状态不能为空', trigger: 'blur' }], - levelReason: [{ required: true, message: '修改原因不能为空', trigger: 'blur' }] + status: [{ required: true, message: '状态不能为空', trigger: 'blur' }] }) const formRef = ref() // 表单 Ref const areaList = ref([]) // 地区列表 -const originLevelId = ref() // 修改前的会员等级 /** 打开弹窗 */ const open = async (type: string, id?: number) => { @@ -142,7 +121,6 @@ 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 } @@ -194,8 +172,6 @@ const resetForm = () => { birthday: undefined, mark: undefined, tagIds: [], - levelId: undefined, - levelReason: undefined, groupId: undefined } formRef.value?.resetFields() diff --git a/src/views/member/user/index.vue b/src/views/member/user/index.vue index 3a8e4259..8f0444c5 100644 --- a/src/views/member/user/index.vue +++ b/src/views/member/user/index.vue @@ -107,7 +107,7 @@ :formatter="dateFormatter" width="180px" /> - + @@ -131,6 +140,8 @@ + +