店铺调整

This commit is contained in:
BabyBoy 2025-08-02 16:59:18 +08:00
parent 8e1b373819
commit 490dd68ed7
5 changed files with 198 additions and 4 deletions

20
src/api/account/index.ts Normal file
View File

@ -0,0 +1,20 @@
import { AccountQuery } from './types';
import { AxiosPromise } from 'axios';
import request from '@/utils/request';
// 查询租户账户列表
export function getList(query: AccountQuery): AxiosPromise {
return request({
url: '/system/tenant/account/list',
method: 'post',
data: query
});
}
// 查询租户账户列表
export function getDel(query: string): AxiosPromise {
return request({
url: '/system/tenant/account/list',
method: 'delete',
data: query
});
}

20
src/api/account/types.ts Normal file
View File

@ -0,0 +1,20 @@
export interface AccountQuery {
current: number;
size: number;
type: string | number;
tenantName: string;
}
export interface VersionList {
createBy: number;
createTime: string;
id: number;
integralBalance: string;
moneyBalance: string;
revenue: string;
tenantId: number;
totalIntegralBalance: string;
type: number;
updateBy: number;
updateTime: string;
wallet: string;
}

View File

@ -33,6 +33,7 @@ export interface TenantForm {
id: number | string | undefined; id: number | string | undefined;
tenantId: number | string | undefined; tenantId: number | string | undefined;
username: string; username: string;
templateName: string;
password: string; password: string;
storeName: string; storeName: string;
inviteUserName: string; inviteUserName: string;

153
src/views/account/index.vue Normal file
View File

@ -0,0 +1,153 @@
<template>
<div class="p-2">
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="true" class="search">
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
<el-form-item label="类型" prop="type">
<el-select v-model="queryParams.type" placeholder="请选择类型" clearable @keyup.enter="handleQuery">
<el-option label="商家" value="1" />
<el-option label="代理" value="2" />
<el-option label="平台" value="3" />
</el-select>
</el-form-item>
<el-form-item label="商家名称" prop="type">
<el-input v-model="queryParams.tenantName" placeholder="请输入商家名称" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</div>
</transition>
<el-card shadow="hover">
<el-table :data="devices" border style="width: 100%; height: 100%; font-size: 14px">
<el-table-column label="名称" align="center" prop="tenantId" :show-overflow-tooltip="true" />
<el-table-column label="累计积分余额" align="center" prop="totalIntegralBalance" :show-overflow-tooltip="true" />
<el-table-column label="现金余额" align="center" prop="moneyBalance" :show-overflow-tooltip="true" />
<el-table-column label="钱包余额" align="center" prop="wallet" :show-overflow-tooltip="true" />
<el-table-column label="累计收益" align="center" prop="revenue" width="180" />
<el-table-column label="账户类型" align="center" prop="type" width="180">
<template #default="scope">
{{ scope.row.type === 1 ? '商家' : scope.row.type === 2 ? '代理' : '平台' }}
</template>
</el-table-column>
</el-table>
<div class="block">
<pagination
v-if="totalref > 0"
:total="totalref"
v-model:page="queryParams.current"
v-model:limit="queryParams.size"
@pagination="getListList"
/>
</div>
</el-card>
<el-dialog v-model="showRefuteDialog" title="添加" width="600px" append-to-body>
<el-form> </el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="showRefuteDialog = false">取消</el-button>
<el-button type="primary" @click="handleAdd">添加</el-button>
</span>
</template>
</el-dialog>
</div>
</template>
<script setup name="Online" lang="ts">
import { AccountQuery, VersionList } from '@/api/account/types';
import { getList } from '@/api/account/index';
import { propTypes } from '@/utils/propTypes';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { sys_device_type } = toRefs<any>(proxy?.useDict('sys_device_type'));
//
const queryParams = ref<AccountQuery>({
current: 1,
size: 10,
type: '',
tenantName: ''
});
//
const devices = ref<VersionList[]>([]);
//
const totalref = ref<number>(0);
const getListList = async () => {
const res = await getList(queryParams.value);
if (res.code === 200) {
devices.value = res.data.records;
totalref.value = res.data.total;
}
};
const handleQuery = () => {
getListList();
};
const showRefuteDialog = ref(false);
const resetQuery = () => {
queryParams.value = {
current: 1,
size: 10,
type: '',
tenantName: ''
};
getListList();
};
// const headDate = ref<VersionAdd>({
// platformType: '',
// versionCode: '',
// versionName: '',
// downloadUrl: '',
// isForceUpdate: null,
// releaseNotes: '',
// status: null
// });
// const handleAdd = async () => {
// const res = await postAdd(headDate.value);
// if (res.code === 200) {
// ElMessage.success('');
// headDate.value = {
// platformType: '',
// versionCode: '',
// versionName: '',
// downloadUrl: '',
// isForceUpdate: null,
// releaseNotes: '',
// status: null
// };
// showRefuteDialog.value = false;
// getListList();
// }
// };
//
// const handleStatusChange = async (row: any) => {
// const obj = {
// id: row.id,
// status: row.status == 1 ? 0 : 1
// };
// const res = await getupdate(obj);
// if (res.code === 200) {
// ElMessage.success('');
// getListList();
// }
// };
const handldDelOnline = (row: any) => {
ElMessageBox.confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const obj = {
id: row.id
};
// const res = await getDel({ id: row.id });
// if (res.code === 200) {
// ElMessage.success('');
// getListList();
// }
});
};
onMounted(() => {
getListList();
});
</script>

View File

@ -58,9 +58,9 @@
删除 删除
</el-button> </el-button>
</el-col> </el-col>
<el-col :span="1.5"> <!-- <el-col :span="1.5">
<el-button v-hasPermi="['system:tenant:export']" type="warning" plain icon="Download" @click="handleExport">导出</el-button> <el-button v-hasPermi="['system:tenant:export']" type="warning" plain icon="Download" @click="handleExport">导出</el-button>
</el-col> </el-col> -->
<el-col :span="1.5"> <el-col :span="1.5">
<el-button v-if="userId === 1" type="success" plain icon="Refresh" @click="handleSyncTenantDict">同步租户字典</el-button> <el-button v-if="userId === 1" type="success" plain icon="Refresh" @click="handleSyncTenantDict">同步租户字典</el-button>
</el-col> </el-col>
@ -517,7 +517,7 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="证件信息:" prop="certificate"> <el-form-item label="证件信息:" prop="certificate">
<div v-for="fit in tenantForm.certificate.split(',')" :key="fit" class="block"> <div v-for="fit in tenantForm.certificate?.split(',')" :key="fit" class="block">
<el-image style="width: 100px; height: 100px" :src="fit" :fit="fit" /> <el-image style="width: 100px; height: 100px" :src="fit" :fit="fit" />
</div> </div>
</el-form-item> </el-form-item>
@ -1004,7 +1004,7 @@ const handleUpdate = async (row?: TenantVO) => {
await getTenantPackage(); await getTenantPackage();
const _id = row?.id || ids.value[0]; const _id = row?.id || ids.value[0];
const res = await getTenant(_id); const res = await getTenant(_id);
businessTypesjson.value = res.data.businessTypes.split(','); businessTypesjson.value = res.data.businessTypes?.split(',');
Object.assign(form.value, res.data); Object.assign(form.value, res.data);
dialog.visible = true; dialog.visible = true;
dialog.title = '修改租户'; dialog.title = '修改租户';