feat(用户管理): 添加汇邦云绑定状态查询功能
- 在用户查询接口和页面中添加hasAb98UserId字段用于筛选绑定状态 - 优化用户详情页openid显示逻辑,使用computed属性统一处理 - 移除用户详情页中冗余的关联信息显示
This commit is contained in:
parent
71e52b3505
commit
ebb7263223
|
|
@ -1,5 +1,6 @@
|
||||||
import { http } from "@/utils/http";
|
import { http } from "@/utils/http";
|
||||||
import { UserBalance } from "./balance";
|
import { UserBalance } from "./balance";
|
||||||
|
import { WxUserDTO } from "../wx/wxUser";
|
||||||
|
|
||||||
export interface Ab98UserDTO {
|
export interface Ab98UserDTO {
|
||||||
/** 主键ID */
|
/** 主键ID */
|
||||||
|
|
@ -73,6 +74,8 @@ export interface Ab98UserDetailDTO {
|
||||||
balanceLimit?: number;
|
balanceLimit?: number;
|
||||||
/** 用户余额实体 */
|
/** 用户余额实体 */
|
||||||
userBalanceEntity?: UserBalance;
|
userBalanceEntity?: UserBalance;
|
||||||
|
/** 微信用户列表 */
|
||||||
|
wxUserList?: WxUserDTO[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Ab98UserQuery extends BasePageQuery {
|
export interface Ab98UserQuery extends BasePageQuery {
|
||||||
|
|
@ -85,6 +88,8 @@ export interface Ab98UserQuery extends BasePageQuery {
|
||||||
/** 身份证号码 */
|
/** 身份证号码 */
|
||||||
idnum?: string;
|
idnum?: string;
|
||||||
tagName?: string;
|
tagName?: string;
|
||||||
|
/** 绑定汇邦云 false未绑定 true已绑定 null 全部 */
|
||||||
|
hasAb98UserId?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AddAb98UserCommand {
|
export interface AddAb98UserCommand {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, watch } from "vue";
|
import { ref, onMounted, watch, computed } from "vue";
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
import { type Ab98UserDetailDTO, getAb98UserDetailApi } from "@/api/ab98/user";
|
import { type Ab98UserDetailDTO, getAb98UserDetailApi } from "@/api/ab98/user";
|
||||||
import { type WxUserDTO, getWxUserDetailApi } from "@/api/wx/wxUser";
|
import { type WxUserDTO, getWxUserDetailApi } from "@/api/wx/wxUser";
|
||||||
|
|
@ -48,6 +48,14 @@ const pagination = ref({
|
||||||
const orderLoading = ref(false);
|
const orderLoading = ref(false);
|
||||||
const activeTab = ref('basic');
|
const activeTab = ref('basic');
|
||||||
|
|
||||||
|
const openid = computed(() => {
|
||||||
|
if (userType.value === 'ab98') {
|
||||||
|
return (userInfo.value as Ab98UserDetailDTO).wxUserList?.[0]?.openid || '';
|
||||||
|
} else {
|
||||||
|
return (userInfo.value as WxUserDTO).openid || '';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
async function fetchOrders() {
|
async function fetchOrders() {
|
||||||
try {
|
try {
|
||||||
orderLoading.value = true;
|
orderLoading.value = true;
|
||||||
|
|
@ -235,7 +243,7 @@ async function handleShowAddTagDialog() {
|
||||||
<template v-if="userType === 'ab98'">
|
<template v-if="userType === 'ab98'">
|
||||||
<el-descriptions class="info-details" :column="2" border>
|
<el-descriptions class="info-details" :column="2" border>
|
||||||
<el-descriptions-item label="会员ID">{{ (userInfo as Ab98UserDetailDTO).ab98UserId }}</el-descriptions-item>
|
<el-descriptions-item label="会员ID">{{ (userInfo as Ab98UserDetailDTO).ab98UserId }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="微信openid">{{ userInfo.openid }}</el-descriptions-item>
|
<el-descriptions-item label="微信openid">{{ openid }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="注册时间" :span="2">{{ userInfo.createTime }}</el-descriptions-item>
|
<el-descriptions-item label="注册时间" :span="2">{{ userInfo.createTime }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="借呗额度" :span="2">{{ formatFenToYuan((userInfo as Ab98UserDetailDTO).balanceLimit) }}
|
<el-descriptions-item label="借呗额度" :span="2">{{ formatFenToYuan((userInfo as Ab98UserDetailDTO).balanceLimit) }}
|
||||||
<el-button type="primary" size="small" @click="handleModifyBalance">
|
<el-button type="primary" size="small" @click="handleModifyBalance">
|
||||||
|
|
@ -260,11 +268,9 @@ async function handleShowAddTagDialog() {
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<el-descriptions class="info-details" :column="2" border>
|
<el-descriptions class="info-details" :column="2" border>
|
||||||
<el-descriptions-item label="微信用户ID">{{ (userInfo as WxUserDTO).wxUserId }}</el-descriptions-item>
|
<el-descriptions-item label="微信用户ID">{{ (userInfo as WxUserDTO).wxUserId }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="OpenID">{{ (userInfo as WxUserDTO).openid }}</el-descriptions-item>
|
<el-descriptions-item label="OpenID">{{ openid }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="创建时间" :span="2">{{ userInfo.createTime }}</el-descriptions-item>
|
<el-descriptions-item label="创建时间" :span="2">{{ userInfo.createTime }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="微信余额" :span="2">{{ formatFenToYuan((userInfo as WxUserDTO).wxBalance) }}</el-descriptions-item>
|
<el-descriptions-item label="微信余额" :span="2">{{ formatFenToYuan((userInfo as WxUserDTO).wxBalance) }}</el-descriptions-item>
|
||||||
<el-descriptions-item label="关联ab98用户ID">{{ (userInfo as WxUserDTO).ab98UserId || '未关联' }}</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="关联企业用户ID">{{ (userInfo as WxUserDTO).qyUserId || '未关联' }}</el-descriptions-item>
|
|
||||||
<el-descriptions-item label="备注" :span="2">{{ (userInfo as WxUserDTO).remark || '无' }}</el-descriptions-item>
|
<el-descriptions-item label="备注" :span="2">{{ (userInfo as WxUserDTO).remark || '无' }}</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ const searchFormParams = reactive<Ab98UserQuery & { search?: string }>({
|
||||||
tel: undefined,
|
tel: undefined,
|
||||||
idnum: undefined,
|
idnum: undefined,
|
||||||
tagName: undefined,
|
tagName: undefined,
|
||||||
|
hasAb98UserId: undefined,
|
||||||
search: undefined
|
search: undefined
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -96,6 +97,7 @@ const handleSearchInput = (value) => {
|
||||||
const resetForm = formEl => {
|
const resetForm = formEl => {
|
||||||
if (!formEl) return;
|
if (!formEl) return;
|
||||||
formEl.resetFields();
|
formEl.resetFields();
|
||||||
|
searchFormParams.hasAb98UserId = undefined;
|
||||||
onSearch();
|
onSearch();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -185,10 +187,17 @@ onMounted(() => {
|
||||||
<el-input v-model="searchFormParams.search" placeholder="请输入姓名/手机号/身份证" clearable class="!w-[300px]"
|
<el-input v-model="searchFormParams.search" placeholder="请输入姓名/手机号/身份证" clearable class="!w-[300px]"
|
||||||
@keydown.enter.prevent="onSearch" @change="handleSearchInput" />
|
@keydown.enter.prevent="onSearch" @change="handleSearchInput" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="tagName">
|
<!-- <el-form-item prop="tagName">
|
||||||
<el-select v-model="searchFormParams.tagName" placeholder="请选择用户标签" clearable class="!w-[160px]">
|
<el-select v-model="searchFormParams.tagName" placeholder="请选择用户标签" clearable class="!w-[160px]">
|
||||||
<el-option v-for="item in tagOptions" :key="item" :label="item" :value="item" />
|
<el-option v-for="item in tagOptions" :key="item" :label="item" :value="item" />
|
||||||
</el-select>
|
</el-select>
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item prop="hasAb98UserId">
|
||||||
|
<el-select v-model="searchFormParams.hasAb98UserId" placeholder="绑定汇邦云状态" clearable class="!w-[160px]">
|
||||||
|
<el-option label="全部" :value="null" />
|
||||||
|
<el-option label="已绑定" :value="true" />
|
||||||
|
<el-option label="未绑定" :value="false" />
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" :icon="useRenderIcon(Search)" :loading="pageLoading" @click="onSearch">
|
<el-button type="primary" :icon="useRenderIcon(Search)" :loading="pageLoading" @click="onSearch">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue