master
Joe 1 year ago
parent 01d37732d2
commit 769b5aaf23

@ -1,18 +1,20 @@
import Constants from '@/constants';
import { exportOperationalBusinessDataUsingPost, operationalBusinessDataUsingPost } from '@/services/pop-b2b2c/pbcUserRecordLogController';
import {
pbcUsersPageUsingPost,
} from '@/services/pop-b2b2c/pbcUsersController';
import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
import { ActionType, ProColumns, ProFormInstance, ProTable } from '@ant-design/pro-components';
import { PageContainer } from '@ant-design/pro-layout';
import { Link, useAccess } from '@umijs/max';
import { useSearchParams } from '@umijs/max';
import { Button, message } from 'antd';
import React, { useRef } from 'react';
/**
*
* @param param0
*/
const fetchData = async (params: API.PageVO) => {
const msg = await pbcUsersPageUsingPost(params);
const fetchData = async (params: API.PbcOperationalDashboardDTO) => {
const msg = await operationalBusinessDataUsingPost(params);
return {
data: msg.data?.records,
total: msg.data?.total,
@ -20,12 +22,43 @@ const fetchData = async (params: API.PageVO) => {
} as any;
};
const handleExport = async (values?: API.PbcOperationalDashboardDTO) => {
const hide = message.loading('正在处理', 0);
try {
await exportOperationalBusinessDataUsingPost(
{ ...values },
{
responseType: 'blob',
getResponse: true,
parseResponse: false,
data: { ...values, fileName: '导出' },
},
);
hide();
return false;
} catch (error) {
console.log(error);
hide();
message.error('处理失败,请重试');
return false;
}
};
// eslint-disable-next-line @typescript-eslint/ban-types
const TableList: React.FC<{}> = () => {
const actionRef = useRef<ActionType>();
const access: any = useAccess();
const [searchParams] = useSearchParams();
const userId = searchParams.get('userId');
const userName = searchParams.get('userName');
const ref = useRef<ProFormInstance<API.PbcOperationalBusinessDataVO>>();
const columns: ProColumns<API.PbcBusiness>[] = [
const columns: ProColumns<API.PbcOperationalBusinessDataVO>[] = [
{
title: '序号',
dataIndex: 'serialNumber',
search: false
},
{
title: '商户编号',
dataIndex: 'pbcBusinessCode',
@ -34,6 +67,7 @@ const TableList: React.FC<{}> = () => {
{
title: '商户名称',
dataIndex: 'pbcBusinessName',
search: false
},
{
title: '联系人',
@ -62,7 +96,7 @@ const TableList: React.FC<{}> = () => {
search: false,
},
{
title: '注册日期',
title: '创建日期',
dataIndex: 'pbcCreateAt',
width: 150,
valueType: 'dateTimeRange',
@ -78,14 +112,21 @@ const TableList: React.FC<{}> = () => {
return (
<PageContainer
header={{
title: '',
title: userName || '',
breadcrumb: {},
}}
>
<ProTable<API.PbcBusiness>
columns={columns}
actionRef={actionRef}
request={fetchData}
request={(param: any) => {
const queryParam = {
userId: userId ? parseInt(userId) : undefined,
startDate: param.pbcCreateAt && param.pbcCreateAt.length > 1 ? param.pbcCreateAt[0] : undefined,
endDate: param.pbcCreateAt && param.pbcCreateAt.length > 1 ? param.pbcCreateAt[1] : undefined
}
return fetchData(queryParam);
}}
rowKey="pbcId"
size="small"
bordered
@ -97,6 +138,20 @@ const TableList: React.FC<{}> = () => {
defaultPageSize: 20,
showSizeChanger: true,
}}
formRef={ref}
toolbar={{
actions: [
<Button type="primary" onClick={() => {
const values = ref.current?.getFieldsValue();
const queryParam = {
userId: userId ? parseInt(userId) : undefined,
startDate: values?.pbcCreateAt && values?.pbcCreateAt.length > 1 ? values?.pbcCreateAt[0] : undefined,
endDate: values?.pbcCreateAt && values?.pbcCreateAt.length > 1 ? values?.pbcCreateAt[1] : undefined
}
handleExport(queryParam)
}}></Button>
]
}}
scroll={{
y: 'calc(100vh - 320px)',
}}

@ -1,18 +1,21 @@
import Constants from '@/constants';
import { listAdminTreeUsingGet } from '@/services/pop-b2b2c/pbcCategoryController';
import { exportOperationalProductDataUsingPost, operationalProductDataUsingPost } from '@/services/pop-b2b2c/pbcUserRecordLogController';
import {
pbcUsersPageUsingPost,
} from '@/services/pop-b2b2c/pbcUsersController';
import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
import { ActionType, ProColumns, ProFormInstance, ProTable } from '@ant-design/pro-components';
import { PageContainer } from '@ant-design/pro-layout';
import { useSearchParams } from '@umijs/max';
import { Button, message } from 'antd';
import React, { useRef } from 'react';
/**
*
* @param param0
*/
const fetchData = async (params: API.PageVO) => {
const msg = await pbcUsersPageUsingPost(params);
const fetchData = async (params: API.PbcOperationalDashboardDTO) => {
const msg = await operationalProductDataUsingPost(params);
return {
data: msg.data?.records,
total: msg.data?.total,
@ -20,45 +23,52 @@ const fetchData = async (params: API.PageVO) => {
} as any;
};
const handleExport = async (values?: API.PbcOperationalDashboardDTO) => {
const hide = message.loading('正在处理', 0);
try {
await exportOperationalProductDataUsingPost(
{ ...values },
{
responseType: 'blob',
getResponse: true,
parseResponse: false,
data: { ...values, fileName: '导出' },
},
);
hide();
return false;
} catch (error) {
console.log(error);
hide();
message.error('处理失败,请重试');
return false;
}
};
// eslint-disable-next-line @typescript-eslint/ban-types
const TableList: React.FC<{}> = () => {
const actionRef = useRef<ActionType>();
const [searchParams] = useSearchParams();
const userId = searchParams.get('userId');
const userName = searchParams.get('userName');
const ref = useRef<ProFormInstance<API.PbcOperationalProductVO>>();
const columns: ProColumns<API.PbcProduct>[] = [
{
title: '商品类目',
dataIndex: 'pbcProductCategoryId',
hideInTable: true,
valueType: 'cascader',
fieldProps: {
fieldNames: { label: 'pbcCategoryName', value: 'pbcId', children: 'children' },
},
request: async () => {
const msg = await listAdminTreeUsingGet({ type: 2 });
if (msg.retcode && msg.data) {
return msg.data;
}
return [];
},
},
{
title: '商品大类',
dataIndex: 'pbcProductTopCategoryName',
search: false,
},
const columns: ProColumns<API.PbcOperationalProductVO>[] = [
{
title: '商品中类',
dataIndex: 'pbcProductParentCategoryName',
search: false,
title: '序号',
dataIndex: 'serialNumber',
search: false
},
{
title: '商品类',
title: '商品分类',
dataIndex: 'pbcProductCategoryName',
search: false,
},
{
title: '商品名称',
dataIndex: 'pbcProductTitle',
search: false,
},
{
title: '价格',
@ -70,9 +80,15 @@ const TableList: React.FC<{}> = () => {
dataIndex: 'pbcBusinessName',
search: false,
},
{
title: '创建日期',
dataIndex: 'pbcCreateAt',
hideInTable: true,
valueType: 'dateTimeRange'
},
{
title: '状态',
dataIndex: 'pbcState',
dataIndex: 'pbcProductState',
valueType: 'select',
search: false,
valueEnum: Constants.pbcProductState,
@ -81,14 +97,21 @@ const TableList: React.FC<{}> = () => {
return (
<PageContainer
header={{
title: '',
title: userName || '',
breadcrumb: {},
}}
>
<ProTable<API.PbcBusiness>
columns={columns}
actionRef={actionRef}
request={fetchData}
request={(param: any) => {
const queryParam = {
userId: userId ? parseInt(userId) : undefined,
startDate: param.pbcCreateAt && param.pbcCreateAt.length > 1 ? param.pbcCreateAt[0] : undefined,
endDate: param.pbcCreateAt && param.pbcCreateAt.length > 1 ? param.pbcCreateAt[1] : undefined
}
return fetchData(queryParam);
}}
rowKey="pbcId"
size="small"
bordered
@ -100,6 +123,20 @@ const TableList: React.FC<{}> = () => {
defaultPageSize: 20,
showSizeChanger: true,
}}
formRef={ref}
toolbar={{
actions: [
<Button type="primary" onClick={() => {
const values: any = ref.current?.getFieldsValue();
const queryParam = {
userId: userId ? parseInt(userId) : undefined,
startDate: values?.pbcCreateAt && values?.pbcCreateAt.length > 1 ? values?.pbcCreateAt[0] : undefined,
endDate: values?.pbcCreateAt && values?.pbcCreateAt.length > 1 ? values?.pbcCreateAt[1] : undefined
}
handleExport(queryParam)
}}></Button>
]
}}
scroll={{
y: 'calc(100vh - 320px)',
}}

@ -1,18 +1,18 @@
import { queryAllRoleUsingPost } from '@/services/pop-b2b2c/pbcRoleController';
import {
pbcUsersPageUsingPost,
} from '@/services/pop-b2b2c/pbcUsersController';
import { exportOperationalDashboardUsingPost, operationalDashboardUsingPost } from '@/services/pop-b2b2c/pbcUserRecordLogController';
import { handlePageQuery } from '@/utils/utils';
import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
import { ActionType, ProColumns, ProFormInstance, ProTable } from '@ant-design/pro-components';
import { PageContainer } from '@ant-design/pro-layout';
import { Link } from '@umijs/max';
import { Button, message } from 'antd';
import React, { useRef } from 'react';
/**
*
* @param param0
*/
const fetchData = async (params: API.PageVO) => {
const msg = await pbcUsersPageUsingPost(params);
const fetchData = async (params: API.PbcOperationalDashboardDTO) => {
const msg = await operationalDashboardUsingPost(params);
return {
data: msg.data?.records,
total: msg.data?.total,
@ -20,14 +20,43 @@ const fetchData = async (params: API.PageVO) => {
} as any;
};
const handleExport = async (values?: API.PbcOperationalDashboardDTO) => {
const hide = message.loading('正在处理', 0);
try {
await exportOperationalDashboardUsingPost(
{ ...values },
{
responseType: 'blob',
getResponse: true,
parseResponse: false,
data: { ...values, fileName: '导出' },
},
);
hide();
return false;
} catch (error) {
console.log(error);
hide();
message.error('处理失败,请重试');
return false;
}
};
// eslint-disable-next-line @typescript-eslint/ban-types
const TableList: React.FC<{}> = () => {
const ref = useRef<ProFormInstance<API.PbcUserOperationalDataVO>>();
const actionRef = useRef<ActionType>();
const columns: ProColumns<API.PbcUsers>[] = [
const columns: ProColumns<API.PbcUserOperationalDataVO>[] = [
{
title: '序号',
dataIndex: 'serialNumber',
search: false
},
{
title: '人员姓名',
dataIndex: 'pbcUserNickName'
dataIndex: 'pbcUserName'
},
{
title: '手机号',
@ -53,13 +82,15 @@ const TableList: React.FC<{}> = () => {
},
{
title: '注册商家数',
dataIndex: 'pbcUserMobile',
search: false
dataIndex: 'registeredMerchantCount',
search: false,
render: (text, record) => <Link to={`business-detail?userId=${record.pbcUserId}&userName=${record.pbcUserName}`}>{text}</Link>
},
{
title: '上传商品数',
dataIndex: 'pbcUserMobile',
search: false
dataIndex: 'productUploadCount',
search: false,
render: (text, record) => <Link to={`product-detail?userId=${record.pbcUserId}&userName=${record.pbcUserName}`}>{text}</Link>
},
];
return (
@ -69,23 +100,13 @@ const TableList: React.FC<{}> = () => {
breadcrumb: {},
}}
>
<ProTable<API.PbcUsers>
<ProTable<API.PbcUserOperationalDataVO>
columns={columns}
actionRef={actionRef}
request={(param: any) => {
console.log(param)
let hasUserType = false
if (param.pbcUserType) {
param.pbcUserType = parseInt(param.pbcUserType)
hasUserType = true
}
const queryParam = handlePageQuery(param);
if (!hasUserType && queryParam.filters) {
queryParam.filters.push({
key: 'pbcUserType'.replace(/([A-Z])/g, '_$1').toLowerCase(),
value: 1,
action: '<=',
});
const queryParam = {
userName: param.pbcUserName,
roleId: param.pbcUserRole
}
return fetchData(queryParam);
}}
@ -100,6 +121,19 @@ const TableList: React.FC<{}> = () => {
defaultPageSize: 20,
showSizeChanger: true,
}}
formRef={ref}
toolbar={{
actions: [
<Button type="primary" onClick={() => {
const values = ref.current?.getFieldsValue();
const queryParam = {
userName: values?.pbcUserName,
roleId: values?.pbcUserRole
}
handleExport(queryParam)
}}></Button>
]
}}
scroll={{
y: 'calc(100vh - 320px)',
}}

@ -2,41 +2,41 @@
/* eslint-disable */
import request from '@/utils/request';
/** errorHtml GET /error */
export async function errorHtmlUsingGet(options?: { [key: string]: any }) {
return request<API.ModelAndView>('/error', {
/** error GET /error */
export async function errorUsingGet(options?: { [key: string]: any }) {
return request<Record<string, any>>('/error', {
method: 'GET',
...(options || {}),
});
}
/** errorHtml PUT /error */
export async function errorHtmlUsingPut(options?: { [key: string]: any }) {
return request<API.ModelAndView>('/error', {
/** error PUT /error */
export async function errorUsingPut(options?: { [key: string]: any }) {
return request<Record<string, any>>('/error', {
method: 'PUT',
...(options || {}),
});
}
/** errorHtml POST /error */
export async function errorHtmlUsingPost(options?: { [key: string]: any }) {
return request<API.ModelAndView>('/error', {
/** error POST /error */
export async function errorUsingPost(options?: { [key: string]: any }) {
return request<Record<string, any>>('/error', {
method: 'POST',
...(options || {}),
});
}
/** errorHtml DELETE /error */
export async function errorHtmlUsingDelete(options?: { [key: string]: any }) {
return request<API.ModelAndView>('/error', {
/** error DELETE /error */
export async function errorUsingDelete(options?: { [key: string]: any }) {
return request<Record<string, any>>('/error', {
method: 'DELETE',
...(options || {}),
});
}
/** errorHtml PATCH /error */
export async function errorHtmlUsingPatch(options?: { [key: string]: any }) {
return request<API.ModelAndView>('/error', {
/** error PATCH /error */
export async function errorUsingPatch(options?: { [key: string]: any }) {
return request<Record<string, any>>('/error', {
method: 'PATCH',
...(options || {}),
});

@ -32,6 +32,105 @@ export async function detailUsingPost(
});
}
/** 导出运营人员的导入商户数据 POST /b2b2c/statical/exportOperationalBusinessData */
export async function exportOperationalBusinessDataUsingPost(
body: API.PbcOperationalDashboardDTO,
options?: { [key: string]: any },
) {
return request<API.AjaxResultString_>('/b2b2c/statical/exportOperationalBusinessData', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** 导出运营看板所有数据 POST /b2b2c/statical/exportOperationalDashboard */
export async function exportOperationalDashboardUsingPost(
body: API.PbcOperationalDashboardDTO,
options?: { [key: string]: any },
) {
return request<API.AjaxResultString_>('/b2b2c/statical/exportOperationalDashboard', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** 导出运营人员的导入商品数据 POST /b2b2c/statical/exportOperationalProductData */
export async function exportOperationalProductDataUsingPost(
body: API.PbcOperationalDashboardDTO,
options?: { [key: string]: any },
) {
return request<API.AjaxResultString_>('/b2b2c/statical/exportOperationalProductData', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** 获取运营人员的导入商户数据 POST /b2b2c/statical/operationalBusinessData */
export async function operationalBusinessDataUsingPost(
body: API.PbcOperationalDashboardDTO,
options?: { [key: string]: any },
) {
return request<API.AjaxResultIPagePbcOperationalBusinessDataVO_>(
'/b2b2c/statical/operationalBusinessData',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
},
);
}
/** 运营看板分页 POST /b2b2c/statical/operationalDashboard */
export async function operationalDashboardUsingPost(
body: API.PbcOperationalDashboardDTO,
options?: { [key: string]: any },
) {
return request<API.AjaxResultIPagePbcUserOperationalDataVO_>(
'/b2b2c/statical/operationalDashboard',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
},
);
}
/** 获取运营人员的导入商品数据 POST /b2b2c/statical/operationalProductData */
export async function operationalProductDataUsingPost(
body: API.PbcOperationalDashboardDTO,
options?: { [key: string]: any },
) {
return request<API.AjaxResultIPagePbcOperationalProductVO_>(
'/b2b2c/statical/operationalProductData',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
},
);
}
/** 卖家h5端今日数据 返回参数店铺浏览数businessIndex, 商品浏览数productDetail注册数userRegister收藏数addCollect 卖家h5端今日数据 POST /b2b2c/statical/overview */
export async function overViewUsingPost(options?: { [key: string]: any }) {
return request<API.AjaxResult>('/b2b2c/statical/overview', {

@ -60,6 +60,18 @@ declare namespace API {
retmsg?: string;
};
type AjaxResultIPagePbcOperationalBusinessDataVO_ = {
data?: IPagePbcOperationalBusinessDataVO_;
retcode?: number;
retmsg?: string;
};
type AjaxResultIPagePbcOperationalProductVO_ = {
data?: IPagePbcOperationalProductVO_;
retcode?: number;
retmsg?: string;
};
type AjaxResultIPagePbcProductVO_ = {
data?: IPagePbcProductVO_;
retcode?: number;
@ -90,6 +102,12 @@ declare namespace API {
retmsg?: string;
};
type AjaxResultIPagePbcUserOperationalDataVO_ = {
data?: IPagePbcUserOperationalDataVO_;
retcode?: number;
retmsg?: string;
};
type AjaxResultIPagePbcUsers_ = {
data?: IPagePbcUsers_;
retcode?: number;
@ -526,6 +544,22 @@ declare namespace API {
total?: number;
};
type IPagePbcOperationalBusinessDataVO_ = {
current?: number;
pages?: number;
records?: PbcOperationalBusinessDataVO[];
size?: number;
total?: number;
};
type IPagePbcOperationalProductVO_ = {
current?: number;
pages?: number;
records?: PbcOperationalProductVO[];
size?: number;
total?: number;
};
type IPagePbcProductVO_ = {
current?: number;
pages?: number;
@ -566,6 +600,14 @@ declare namespace API {
total?: number;
};
type IPagePbcUserOperationalDataVO_ = {
current?: number;
pages?: number;
records?: PbcUserOperationalDataVO[];
size?: number;
total?: number;
};
type IPagePbcUsers_ = {
current?: number;
pages?: number;
@ -1074,7 +1116,7 @@ declare namespace API {
/** 来源:微信分享,链接、二维码 */
pbcSourceType?: string;
/** 分享人的id */
shareUserId?: number;
pbcUserId?: number;
};
type PbcBusinessPageDTO = {
@ -1391,11 +1433,13 @@ declare namespace API {
type PbcDashBoardDTO = {
/** 登录前的userid */
anonToken?: string;
/** 商户id */
businessId?: number;
endDate?: string;
/** 登录后的token */
loginToken?: string;
pbcCategoryType?: number;
pbcQueryType?: number;
/** 分享人的id */
pbcUserId?: number;
startDate?: string;
};
@ -1416,6 +1460,99 @@ declare namespace API {
pbcViewTotalNumber?: number;
};
type PbcOperationalBusinessDataVO = {
/** 商户id */
businessId?: number;
/** 运营人员姓名 */
operatorName?: string;
/** 运营人员手机 */
operatorPhone?: string;
/** 商户对公账户 */
pbcBusinessAccount?: string;
/** 商户地址 */
pbcBusinessAddress?: string;
/** 商户区域 */
pbcBusinessArea?: string;
/** 商户对公账户银行 */
pbcBusinessBank?: string;
/** 商户城市 */
pbcBusinessCity?: string;
/** 商户编号, 审核通过后生成 */
pbcBusinessCode?: string;
/** 商户联系人 */
pbcBusinessContact?: string;
/** 商户手机号 */
pbcBusinessContactMobile?: string;
/** 商户联系人身份证 */
pbcBusinessContactUserNo?: string;
/** 商户等级 */
pbcBusinessLevel?: string;
/** 商户主营范围 */
pbcBusinessMainCategory?: string;
/** 商户名称 */
pbcBusinessName?: string;
/** 商户省份 */
pbcBusinessProvince?: string;
/** 开业时间 */
pbcBusinessStartDate?: string;
/** 商户类型 */
pbcBusinessType?: string;
/** 创建时间 */
pbcCreateAt?: string;
/** 社会统一信用代码 */
pbcUnifiedSocialCreditCode?: string;
/** 序号 */
serialNumber?: number;
};
type PbcOperationalDashboardDTO = {
/** 当前页 */
current?: number;
/** 结束日期 */
endDate?: string;
/** 条数 */
pageSize?: number;
/** 角色id */
roleId?: number;
/** 角色名称 */
roleName?: string;
/** 开始日期 */
startDate?: string;
/** 用户表id */
userId?: number;
/** 用户名称 */
userName?: string;
};
type PbcOperationalProductVO = {
/** 运营人员姓名 */
operatorName?: string;
/** 运营人员手机 */
operatorPhone?: string;
/** 商户id */
pbcBusinessId?: number;
/** 商户名称 */
pbcBusinessName?: string;
/** 商品细分类id */
pbcProductCategoryId?: number;
/** 商品细分类 */
pbcProductCategoryName?: string;
/** 商品编号 */
pbcProductCode?: string;
/** 商品价格 */
pbcProductPrice?: string;
/** 货架号 */
pbcProductShelfNumber?: string;
/** 商品状态 */
pbcProductState?: string;
/** 商品标题 */
pbcProductTitle?: string;
/** 商品id */
productId?: number;
/** 序号 */
serialNumber?: number;
};
type PbcProduct = {
/** 商户id */
pbcBusinessId?: number;
@ -2129,6 +2266,29 @@ declare namespace API {
pbcTitle?: string;
};
type PbcUserOperationalDataVO = {
/** 用户邮箱 */
pbcUserEmail?: string;
/** 用户id */
pbcUserId?: number;
/** 用户头像 */
pbcUserImage?: string;
/** 用户手机号 */
pbcUserMobile?: string;
/** 用户姓名 */
pbcUserName?: string;
/** 角色id */
pbcUserRole?: number;
/** 角色名称 */
pbcUserRoleName?: string;
/** 上传商品数 */
productUploadCount?: number;
/** 注册商家数 */
registeredMerchantCount?: number;
/** 序号 */
serialNumber?: number;
};
type PbcUserRegisterDTO = {
/** 商户id */
pbcBusinessId?: number;

Loading…
Cancel
Save