|
|
@@ -17,7 +17,8 @@ import {
|
|
|
ElSwitch,
|
|
|
ElTag,
|
|
|
ElDescriptions,
|
|
|
- ElDescriptionsItem
|
|
|
+ ElDescriptionsItem,
|
|
|
+ ElMention
|
|
|
} from 'element-plus'
|
|
|
import {
|
|
|
getBalanceLog,
|
|
|
@@ -47,19 +48,6 @@ const props = defineProps({
|
|
|
})
|
|
|
const localUserDetail = ref<userData>({ ...props.userDetail })
|
|
|
|
|
|
-watch(
|
|
|
- () => props.userDetail,
|
|
|
- (newVal) => {
|
|
|
- localUserDetail.value = { ...newVal }
|
|
|
- if (typeof newVal.birthday == 'number') {
|
|
|
- localUserDetail.value.birthday = newVal.birthday ? formatToDate(newVal.birthday * 1000) : ''
|
|
|
- localUserDetail.value.is_promoter = newVal.is_promoter == 1 ? true : false
|
|
|
- localUserDetail.value.status = newVal.status == 1 ? true : false
|
|
|
- }
|
|
|
- },
|
|
|
- { deep: true, immediate: true }
|
|
|
-)
|
|
|
-
|
|
|
const rules = ref<FormRules>({
|
|
|
phone: [required('请填写手机号'), phone()],
|
|
|
pwd: [{}],
|
|
|
@@ -95,7 +83,6 @@ const userRecordList = ref([
|
|
|
page: 1,
|
|
|
limit: 10,
|
|
|
total: 0,
|
|
|
- request: getBrokerageLog,
|
|
|
data: [],
|
|
|
loading: true,
|
|
|
columns: [
|
|
|
@@ -116,7 +103,8 @@ const userRecordList = ref([
|
|
|
field: 'type'
|
|
|
},
|
|
|
{
|
|
|
- label: '备注'
|
|
|
+ label: '备注',
|
|
|
+ field: 'mark'
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
@@ -127,7 +115,6 @@ const userRecordList = ref([
|
|
|
limit: 10,
|
|
|
total: 0,
|
|
|
loading: true,
|
|
|
- request: getBalanceLog,
|
|
|
data: [],
|
|
|
columns: [
|
|
|
{
|
|
|
@@ -147,7 +134,8 @@ const userRecordList = ref([
|
|
|
field: 'type'
|
|
|
},
|
|
|
{
|
|
|
- label: '备注'
|
|
|
+ label: '备注',
|
|
|
+ field: 'mark'
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
@@ -158,7 +146,6 @@ const userRecordList = ref([
|
|
|
limit: 10,
|
|
|
total: 100,
|
|
|
loading: true,
|
|
|
- request: getSpreadList,
|
|
|
data: [],
|
|
|
columns: [
|
|
|
{
|
|
|
@@ -185,19 +172,43 @@ const changeTable = (row: any) => {
|
|
|
const element = userRecordList.value[index]
|
|
|
if (row == element.type) {
|
|
|
if (element.loading) {
|
|
|
- element
|
|
|
- .request(
|
|
|
+ if (element.type == '1') {
|
|
|
+ getSpreadList(
|
|
|
{
|
|
|
page: element.page,
|
|
|
limit: element.limit
|
|
|
},
|
|
|
props.userDetail.uid
|
|
|
- )
|
|
|
- .then((res) => {
|
|
|
+ ).then((res) => {
|
|
|
element.data = res.data.list
|
|
|
element.total = res.data.total
|
|
|
element.loading = false
|
|
|
})
|
|
|
+ } else if (element.type == '2') {
|
|
|
+ getBalanceLog(
|
|
|
+ {
|
|
|
+ page: element.page,
|
|
|
+ limit: element.limit
|
|
|
+ },
|
|
|
+ props.userDetail.uid as number
|
|
|
+ ).then((res) => {
|
|
|
+ element.data = res.data.data
|
|
|
+ element.total = res.data.count
|
|
|
+ element.loading = false
|
|
|
+ })
|
|
|
+ } else if (element.type == '3') {
|
|
|
+ getBrokerageLog(
|
|
|
+ {
|
|
|
+ page: element.page,
|
|
|
+ limit: element.limit
|
|
|
+ },
|
|
|
+ props.userDetail.uid
|
|
|
+ ).then((res) => {
|
|
|
+ element.data = res.data.data
|
|
|
+ element.total = res.data.count
|
|
|
+ element.loading = false
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
break
|
|
|
}
|
|
|
@@ -241,11 +252,32 @@ const getLabel = (list, id) => {
|
|
|
// 如果找到匹配的元素,则返回该元素的标签;否则,返回null
|
|
|
return item ? item.label : null
|
|
|
}
|
|
|
+const activeName = ref('base')
|
|
|
+
|
|
|
+watch(
|
|
|
+ () => props.userDetail,
|
|
|
+ (newVal) => {
|
|
|
+ localUserDetail.value = { ...newVal }
|
|
|
+ if (typeof newVal.birthday == 'number') {
|
|
|
+ localUserDetail.value.birthday = newVal.birthday ? formatToDate(newVal.birthday * 1000) : ''
|
|
|
+ localUserDetail.value.is_promoter = newVal.is_promoter == 1 ? true : false
|
|
|
+ localUserDetail.value.status = newVal.status == 1 ? true : false
|
|
|
+ }
|
|
|
+ const ar = userRecordList.value
|
|
|
+ activeName.value = 'base'
|
|
|
+ for (let i = 0; i < ar.length; i++) {
|
|
|
+ const it = ar[i]
|
|
|
+ it.loading = true
|
|
|
+ it.page = 1
|
|
|
+ }
|
|
|
+ },
|
|
|
+ { deep: true, immediate: true }
|
|
|
+)
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
- <ElTabs type="border-card" @tab-change="changeTable">
|
|
|
- <ElTabPane label="用户信息">
|
|
|
+ <ElTabs v-model="activeName" type="border-card" @tab-change="changeTable">
|
|
|
+ <ElTabPane label="用户信息" name="base">
|
|
|
<div v-show="modelValue" class="p-20px">
|
|
|
<el-form label-width="110px" inline :rules="rules" :model="localUserDetail">
|
|
|
<ElDivider content-position="left"
|
|
|
@@ -391,7 +423,7 @@ const getLabel = (list, id) => {
|
|
|
v-for="(item, index) in userRecordList"
|
|
|
:key="index"
|
|
|
>
|
|
|
- <ElTable v-loading="item.loading" :data="item.data" stripe>
|
|
|
+ <ElTable v-loading="item.loading" :data="item.data" stripe table-layout="auto">
|
|
|
<ElTableColumn
|
|
|
v-for="(ls, ind) in item.columns"
|
|
|
:key="ind"
|