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 @@
+
-
{