提交 f2e8dae7 作者: 翁进城
#本地
# REACT_APP_BASE_URL='http://192.168.3.100:32015/'
# REACT_APP_BASE_URL='http://10.246.106.74:32015/'
#线上
REACT_APP_BASE_URL = 'https://testapi.sharefly.mmcuav.cn/'
#REACT_APP_BASE_URL = 'https://csfapi.mmcuav.cn/'
NODE_ENV = 'development'
VERSION='2.2.4.230217.Release'
#测试
REACT_APP_BASE_URL = 'https://testapi.sharefly.mmcuav.cn/'
#正式
#REACT_APP_BASE_URL = 'https://csfapi.mmcuav.cn/'
NODE_ENV = 'production'
VERSION='2.2.4.230217.Release'
# 请求接口地址
VITE_REQUEST_BASE_URL = 'https://testapi.sharefly.mmcuav.cn/'
NODE_ENV = 'development'
VERSION = '2.2.4.230217.Release'
#请求接口地址
#VITE_REQUEST_BASE_URL='https://www.iuav.shop'
VITE_REQUEST_BASE_URL='/api'
#旧版接口地址
#VITE_REQUEST_BASE_URL='https://iuav.mmcuav.cn'
#VITE_REQUEST_BASE_URL='https://test.iuav.mmcuav.cn'
#本地测试
#VITE_REQUEST_BASE_URL='http://192.168.3.22:10001'
#VITE_REQUEST_BASE_URL='http://192.168.3.22:8099'
#VITE_REQUEST_BASE_URL='http://192.168.3.23:35150'
#版本
NODE_ENV='development'
VERSION='2.2.4.230217.Release'
# 请求接口地址
VITE_REQUEST_BASE_URL = 'https://testapi.sharefly.mmcuav.cn/'
NODE_ENV = 'development'
VERSION = '2.2.4.230217.Release'
#请求接口地址
VITE_REQUEST_BASE_URL='https://www.iuav.shop'
#VITE_REQUEST_BASE_URL='https://test.iuav.shop'
#旧版接口地址
#VITE_REQUEST_BASE_URL='https://iuav.mmcuav.cn'
#VITE_REQUEST_BASE_URL='https://test.iuav.mmcuav.cn'
#本地测试
#VITE_REQUEST_BASE_URL='http://192.168.3.22:10001'
#VITE_REQUEST_BASE_URL='http://192.168.3.22:8099'
#VITE_REQUEST_BASE_URL='http://192.168.3.23:35150'
#版本
NODE_ENV='development'
VERSION='2.2.4.230217.Release'
......@@ -44,7 +44,7 @@ export interface InterListFunction<D extends object, T> {
// 通用接口封装函数(不分页) 建议用这个
export interface InterFunction<D extends object, T> {
(req?: D): Promise<ResponseType<T>>;
(req: D): Promise<ResponseType<T>>;
}
// 通用接口封装函数(分页了,但又没有分页) 建议用这个
......
import { InterFunction } from '~/api/interface';
// 用户登录
export type BackEndLoginType = InterFunction<
{ accountNo: string; passWord: string },
{
token: string;
userAccountId: number;
accountNo: string;
portType: null;
uid: null;
phoneNum: null;
userName: null;
nickName: null;
}
>;
import axios from '../request';
// 运营人员
export interface operateEntity {
userName: string;
accountNo: string;
id: number;
uid: string;
}
export interface loginEntity {
accountNo: string;
passWord: string;
remember: boolean;
}
import { BackEndLoginType } from '~/api/interface/commonType';
export class CommonAPI {
static Login = (data: Pick<loginEntity, 'accountNo' | 'passWord'>): any => {
return axios.post('userservlet/auth/platformLogin', {
...data,
portType: 1,
});
};
// 上传图片
static commonUpload = (data: FormData) => {
return axios.post('ossservlet/upload/osses', data);
};
// 上传图片
static fileUpload = (data: FormData) => {
return axios.post('ossservlet/upload/oss', data);
};
// 运营人员列表
static operateList(operateName: string) {
return axios.post('orderservlet/ordertask/listOperate', { operateName });
}
// 销售人员列表
static getSaleList() {
return axios.get('userservlet/useraccount/getSaleList');
}
// 用户登录
static BackEndLogin: BackEndLoginType = (params) =>
axios.post('/userapp/auth/backEndLogin', params);
}
......@@ -7,7 +7,6 @@ import {
CouponPageListType,
CouponSaveType,
CouponShutDownType,
ListBrandInfoType,
SplitCouponAddType,
SplitCouponListType,
} from '~/api/interface/couponManage';
......
......@@ -30,4 +30,18 @@ export class ProduceManageAPI {
static editProductSku = (data: unknown) => {
return axios.post('uavgoods/product/spec/editProductSku', data);
};
// 产品规格管理---删除规格
static removeProductSpec = (params: unknown) => {
return axios.get('uavgoods/product/spec/removeProductSpec', { params });
};
// 产品sku管理-编辑单个产品sku时的信息回显
static getProductSkuDetail = (params: unknown) => {
return axios.get('uavgoods/product/spec/getProductSkuDetail', { params });
};
// 产品sku管理-产品规格管理-分页列表
static listPageProductSpec = (params: unknown) => {
return axios.get('uavgoods/product/spec/listPageProductSpec', { params });
};
}
import { useEffect, useState } from 'react';
import { RoleAPI } from '@/api';
import { limitEntity } from '@/api/modules/role';
function useOptionShow(id: number) {
// const [show, setShow] = useState<boolean>(false);
return (JSON.parse(localStorage.getItem('routeList') as string) || []).some(
(v: limitEntity) => v.id === id,
);
// useEffect(() => {
// RoleAPI.getListCuserMenuInfo().then((res: any) => {
// const bol: boolean = res.result.some((v: limitEntity) => v.id === id);
// setShow(bol);
// });
// }, []);
// return show;
}
export default useOptionShow;
import SearchBox, { searchColumns } from '~/components/search-box';
import { useState } from 'react';
import { Button, Card, Table } from 'antd';
import {
ArrowDownOutlined,
ArrowUpOutlined,
DeleteOutlined,
PlusOutlined,
} from '@ant-design/icons';
import { ColumnsType } from 'antd/es/table';
const GoodsList = () => {
const tabList = [
{
key: '1',
tab: '全部',
},
{
key: '2',
tab: '上架中',
},
{
key: '3',
tab: '仓库中',
},
];
const [activeTabKey, setActiveTabKey] = useState<string>('1');
const [searchColumns] = useState<searchColumns[]>([
{
label: '商品名称',
placeholder: '请输入商品名称',
name: '',
type: 'input',
},
{
label: '所属目录',
placeholder: '请选择所属目录',
name: '',
type: 'select',
options: [],
},
{
label: '创建时间',
placeholder: '请输入选择创建时间',
name: '',
type: 'rangePicker',
},
]);
const tableColumns: ColumnsType<any> = [
{ title: '序号', align: 'center' },
{ title: '图片', align: 'center' },
{ title: '商品名称', align: 'center' },
{ title: '所属目录', align: 'center' },
{ title: '创建时间', align: 'center' },
{ title: '状态', align: 'center' },
{
title: '操作',
align: 'center',
render: () => (
<>
<Button type='link'>编辑</Button>
<Button type='link'>详情</Button>
</>
),
},
];
const [tableData] = useState<{ id: number }[]>([{ id: 1 }]);
const onTabChange = (key: string) => {
setActiveTabKey(key);
};
return (
<div className='goods-list'>
<SearchBox
search={searchColumns}
child={
<Button type='primary' icon={<PlusOutlined />}>
新增商品
</Button>
}
/>
<Card tabList={tabList} activeTabKey={activeTabKey} onTabChange={onTabChange}>
<div className='header-operate' style={{ marginBottom: '10px' }}>
<Button type='primary' style={{ marginRight: '10px' }} icon={<ArrowUpOutlined />}>
上架
</Button>
<Button type='primary' style={{ marginRight: '10px' }} icon={<ArrowDownOutlined />}>
下架
</Button>
<Button danger icon={<DeleteOutlined />}>
删除
</Button>
</div>
<Table columns={tableColumns} bordered dataSource={tableData} />
</Card>
</div>
);
};
export default GoodsList;
......@@ -9,9 +9,12 @@
//.ant-select-selector {
// min-width: 200px;
//}
.ant-form-item {
margin-inline-end: 20px;
}
.ant-row {
//margin-bottom:10px;
//margin-bottom:5px;
}
.add-button {
......
import { Button, Checkbox, Form, Input } from 'antd';
import React, { useEffect } from 'react';
import { useEffect } from 'react';
import { LockOutlined, UserOutlined } from '@ant-design/icons';
import { useNavigate } from 'react-router-dom';
import Cookies from 'js-cookie';
import './index.scss';
import { InterDataType, InterReqType } from '~/api/interface';
import { BackEndLoginType } from '~/api/interface/commonType';
import { CommonAPI } from '~/api';
// 请求的类型
type ReqType = InterReqType<BackEndLoginType>;
// 返回的类型
type ResType = InterDataType<BackEndLoginType>;
function LoginView() {
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/ban-ts-comment
// @ts-ignore
const navigate = useNavigate();
const [form] = Form.useForm();
// eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/ban-ts-comment
// @ts-ignore
const onFinish = async (values: any) => {
const [form] = Form.useForm<ReqType>();
// 提交数据
const onFinish = async (values: ReqType) => {
const res = await CommonAPI.BackEndLogin({
accountNo: values?.accountNo,
passWord: values?.passWord,
});
if (res && res.code === '200') {
console.log('提交数据 --->', res);
}
// props
// .login(values)
// .then(async (res: any) => {
......
import { FC, useEffect, useState } from 'react';
import { Form, Modal, Select } from 'antd';
// import { tagLevelEntity } from "@/api/modules/user";
// import { UserAPI } from "@/api";
interface PropsType {
visible: boolean;
closed: any;
data: any;
state: any;
}
// 修改等级标签
interface tagLevelForm {
channelLevelId: number;
mallOperator: number;
mallSaleManager: number;
}
export const ChangeModal: FC<PropsType> = (props) => {
// 父组件传参
const { visible, closed, data, state } = props;
// 个人等级标签
const [tagLevelForm] = Form.useForm<tagLevelForm>();
// 相关运营列表
const [operationList] = useState([]);
// 关闭事件
const handleClosed = () => {
tagLevelForm.resetFields();
closed();
};
// 提交数据
const handleSubmit = () => {
tagLevelForm.validateFields().then(async (value: tagLevelForm) => {
// 提交表单数据
const SubmitFuc = async () => {
// const res: any = await UserAPI.mallUserChangeInfo({
// ...value,
// userAccountId: data.id,
// });
// if (res.code === '200') {
// message.success('修改成功');
// handleClosed();
// } else {
// message.warning(res.message);
// }
};
// 如果之前填过等级标签,现在又删除了的话,调用删除等级标签的接口
if (data.channelClass && !value.channelLevelId) {
// 删除等级标签
// const res: any = await UserAPI.mallUserDeleteInfo({
// userAccountId: data.id,
// });
// if (res && res.code === '200') {
// await SubmitFuc();
// } else {
// message.warning(res.message);
// }
} else {
await SubmitFuc();
}
});
};
// 获取运营人员列表
const getListOperate = () => {
// UserAPI.getKbtUserList({ keyword: '' }).then(({ result }) => {
// if (result) {
// setOperationList(
// result.map((i: any) => {
// return {
// label: `${i.userName || i.nickName}(${i.uid})`,
// value: i.id,
// };
// }),
// );
// }
// });
};
// 组件启动
useEffect(() => {
if (data) {
getListOperate();
tagLevelForm.setFieldsValue({
channelLevelId: data.channelClass || undefined,
mallOperator: data.mallOperator || undefined,
mallSaleManager: data.mallSaleManager || undefined,
});
}
}, [data]);
return (
<Modal open={visible} title='变更' onCancel={handleClosed} destroyOnClose onOk={handleSubmit}>
<Form form={tagLevelForm} labelCol={{ span: 5 }} wrapperCol={{ span: 16 }}>
<Form.Item label='等级标签' name='channelLevelId'>
<Select
placeholder='请选择等级标签'
disabled={!data?.realAuthStatus && !data?.entAuthStatus}
allowClear
>
{state.levelTags.map((item: any, index: number) => (
<Select.Option value={item.id} key={index}>
{item.tagName}
</Select.Option>
))}
</Select>
</Form.Item>
<Form.Item label='相关运营' name='mallOperator'>
<Select placeholder='请选择相关运营' allowClear>
{operationList.map((item: any, index: number) => (
<Select.Option value={item.value} key={index}>
{item.label}
</Select.Option>
))}
</Select>
</Form.Item>
<Form.Item label='相关销售' name='mallSaleManager'>
<Select placeholder='请选择相关销售' allowClear>
{operationList.map((item: any, index: number) => (
<Select.Option value={item.value} key={index}>
{item.label}
</Select.Option>
))}
</Select>
</Form.Item>
</Form>
</Modal>
);
};
import React from 'react';
import { useState } from 'react';
import SearchBox from '~/components/search-box';
import { Button, Table } from 'antd';
import { ColumnsType } from 'antd/es/table';
import { ChangeModal } from '~/pages/customManage/customList/comp/changeModal';
// 表格数据类型
type TableType = any;
function CustomListView() {
return <div>CustomList</div>;
// 是否打开变更弹窗
const [isChangeVisModal, setIsChangeVisModal] = useState<boolean>(false);
// 表格分页配置
const [pagination] = useState({
total: 0,
pageSize: 10,
current: 1,
totalPage: 0,
});
// 表格数据
const [tableData] = useState<TableType>([{ id: 1 }]);
// 需要编辑的数据
const [editData] = useState<TableType[0]>();
// 表格结构
const columns: ColumnsType<TableType[0]> = [
{
title: '用户UID',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '用户名称',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '手机号',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '认证企业',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '企业认证',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '电子签约认证',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '用户来源',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '创建时间',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '账号类型',
dataIndex: 'userName',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '渠道等级',
dataIndex: 'remark',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '上级推荐人',
dataIndex: 'remark',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '推荐伙伴',
dataIndex: 'remark',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '相关运营',
dataIndex: 'remark',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '相关销售',
dataIndex: 'remark',
align: 'center',
render: (_text, _record) => `--`,
},
{
title: '操作',
dataIndex: 'action',
align: 'center',
fixed: 'right',
width: '150px',
render: (_text, _record) => (
<>
<Button
type={'link'}
onClick={() => {
setIsChangeVisModal(true);
}}
>
变更
</Button>
<Button type={'link'} danger>
删除
</Button>
</>
),
},
];
return (
<>
<SearchBox
search={[
{
label: '用户名称',
name: 'keyword',
type: 'input',
placeholder: '请输入UID、用户名称',
},
{
label: '手机号',
name: 'phoneNum',
type: 'input',
placeholder: '请输入用户账号',
},
{
label: '来源',
name: 'form',
type: 'Select',
placeholder: '请选择相关来源',
options: [
{ value: 1, label: '自然流' },
{ value: 2, label: '海报' },
{ value: 3, label: '抖音' },
{ value: 4, label: '公众号' },
{ value: 5, label: '社群' },
{ value: 6, label: '招投标' },
],
},
{
label: '创建时间',
name: 'time',
type: 'rangePicker',
placeholder: '请选择创建时间',
},
{
label: '企业认证',
name: 'enterprise',
type: 'Select',
placeholder: '请选择是否认证',
options: [
{ value: 1, label: '未认证' },
{ value: 2, label: '已认证' },
],
},
{
label: '电子签约认证',
name: 'contract',
type: 'Select',
placeholder: '请选择是否认证',
options: [
{ value: 1, label: '未认证' },
{ value: 2, label: '已认证' },
],
},
]}
searchData={(e: any) => console.log('提交数据 --->', e)}
/>
<Table
size='small'
dataSource={tableData}
columns={columns}
rowKey='id'
scroll={{ x: 1200 }}
pagination={{
total: pagination.total,
pageSize: pagination.pageSize,
current: pagination.current,
showSizeChanger: true,
showQuickJumper: true,
// onChange: (page: number, pageSize: number) =>
// paginationChange(page, pageSize),
showTotal: (total, range) => `当前 ${range[0]}-${range[1]} 条记录 / 共 ${total} 条数据`,
}}
// rowSelection={{ selectedRowKeys, onChange: onSelectChange }}
/>
<ChangeModal
visible={isChangeVisModal}
closed={() => {
setIsChangeVisModal(false);
}}
data={editData}
state={{ levelTags: [] }}
/>
</>
);
}
export default CustomListView;
import { useState } from 'react';
import { Form, Input, message, Modal, Upload, UploadProps } from 'antd';
import { PlusOutlined } from '@ant-design/icons';
import { UploadFile } from 'antd/es/upload/interface';
// import { GoodsAPI, UserAPI } from '~/api';
interface PropsType {
visible: boolean;
closed: any;
data: any;
}
export const ChangeModal = (props: PropsType) => {
// 父组件传参
const { visible, closed, data } = props;
// 表格事件
const [form] = Form.useForm();
// 图片上传文件列表
const [fileList, setFileList] = useState<UploadFile[]>([]);
// 图片是否放大
const [visibleImg, setVisibleImg] = useState<boolean>(false);
// 当前放大图片
const [currentImgList, setCurrentImgList] = useState<{ src: string }[]>([]);
// 预览图片
const handlePreview = (url: string) => {
setVisibleImg(true);
setCurrentImgList([{ src: url }]);
};
// 关闭图片放大
const setVisibleEvent = () => {
setVisibleImg(false);
};
// 判断文件类型
const beforeUpload: UploadProps['beforeUpload'] = ({ size, type }) => {
const isImage = [
'image/gif',
'image/jpg',
'image/png',
'image/bmp',
'image/jpeg',
'image/webp',
].includes(type);
if (!isImage) {
message.warning('请上传图片').then();
return isImage || Upload.LIST_IGNORE;
}
const isLimit = size / 1024 / 1024 <= 2;
if (!isLimit) {
message.warning('图片最大上传2M').then();
return isLimit || Upload.LIST_IGNORE;
}
};
// 上传图片
const handleUpload: UploadProps['customRequest'] = async ({ file }) => {
const { uid, name } = file as { uid: string; name: string };
const formData = new FormData();
formData.append('uploadFile', file as unknown as string);
const res = await GoodsAPI.commonUpload(formData);
if (res && res.code === '200') {
setFileList([
...fileList,
{
uid,
name,
status: 'done',
url: res.result[0],
},
]);
form.setFieldsValue({
vouchers: [...fileList.map((i) => i.url), res.result[0]],
});
} else {
message.warning(res.message);
}
};
// 删除图片
const handleDelete: UploadProps['onRemove'] = (res) => {
const newFileList = fileList.filter((i) => i.uid !== res.uid);
setFileList(newFileList);
};
// 关闭事件
const handleClosed = () => {
setFileList([]);
form.resetFields();
closed();
};
// 触发表单验证
const handleSubmit = () => {
form
.validateFields()
.then(async (values) => {
const { mallUserId } = data;
const res: any = await UserAPI.bountyModify({
...values,
mallUserId,
});
if (res && res.code === '200') {
message.success('操作成功');
await handleClosed();
} else {
message.warning(res.message);
}
})
.catch((err) => {
message.warning(err.errorFields[0].errors[0]).then();
});
};
return (
<>
<Modal
open={visible}
title='奖励金变更'
onCancel={handleClosed}
destroyOnClose
width={768}
onOk={handleSubmit}
>
<Form name='form' form={form} layout='horizontal' labelWrap>
<Form.Item label='账号信息' labelCol={{ span: 5 }} wrapperCol={{ span: 15 }}>
<div>{`${data.uid}(${data.userName})`}</div>
</Form.Item>
<Form.Item
label='金额变动'
name='money'
rules={[{ required: true, message: '请输入金额' }]}
labelCol={{ span: 5 }}
wrapperCol={{ span: 15 }}
>
<Input
placeholder='正数表示充值,负数为扣除'
maxLength={11}
allowClear
type='number'
onInput={(val: any) => {
if (val.target.value.length > 11) val.target.value = val.target.value.slice(0, 11);
}}
/>
</Form.Item>
<Form.Item
label='相关凭证'
name='vouchers'
labelCol={{ span: 5 }}
wrapperCol={{ span: 15 }}
>
<Upload
listType='picture-card'
fileList={fileList}
beforeUpload={beforeUpload}
onPreview={() => {
handlePreview(fileList[0].url || '');
}}
customRequest={handleUpload}
onRemove={handleDelete}
>
{fileList.length >= 5 ? null : (
<div>
<PlusOutlined />
<div style={{ marginTop: 8 }}>上传图片</div>
</div>
)}
</Upload>
</Form.Item>
<Form.Item label='备注' name='remark' labelCol={{ span: 5 }} wrapperCol={{ span: 15 }}>
<Input.TextArea placeholder='请输入备注' maxLength={50} allowClear />
</Form.Item>
<Form.Item
label='操作人员密码'
name='password'
rules={[{ required: true, message: '请输入密码' }]}
labelCol={{ span: 5 }}
wrapperCol={{ span: 15 }}
>
<Input
placeholder='请输入密码'
maxLength={11}
allowClear
type='password'
autoComplete='new-password'
/>
</Form.Item>
</Form>
</Modal>
</>
);
};
import { useEffect, useState } from 'react';
import qs from 'query-string';
import { Button, Image, message, Table } from 'antd';
import { ColumnsType } from 'antd/es/table';
import SearchBox, { searchColumns } from '~/components/search-box';
import { DetailTableType, DetailFormType } from '~/pages/customManage/customMoney/propsType';
// import { UserAPI } from '~/api';
import { ChangeModal } from '~/pages/customManage/customMoney/comp/ChangeModal';
import { moneyFormat } from '~/utils/money';
import { useNavigate, useSearchParams } from 'react-router-dom';
const CustomMoneyDetail = () => {
// 路由操作
const navigate = useNavigate();
// 参数钩子
const [searchParams] = useSearchParams();
// 接收到的参数
const id = searchParams.get('id');
const uid = searchParams.get('uid');
const userName = searchParams.get('userName');
// 是否打开变更弹窗
const [changeVisible, setChangeVisible] = useState<boolean>(false);
// 搜索数据
const [typeOptions, setTypeOptions] = useState<{ name: string; id: number }[]>([]);
// 搜索数据
const [searchColumns, setSearchColumns] = useState<searchColumns[]>([
{
label: '编号',
name: 'payNo',
type: 'input',
placeholder: '请输入交易编号或订单编号',
width: 220,
},
{
label: '日期',
name: 'time',
type: 'rangePicker',
placeholder: '开始时间~结束时间',
},
{
label: '类型',
name: 'type',
type: 'select',
options: [],
placeholder: '请选择变更类型',
},
]);
// 表头
const tableColumns: ColumnsType<DetailTableType> = [
{
title: '交易编号',
dataIndex: 'payNo',
align: 'center',
},
{
title: '交易时间',
dataIndex: 'payTime',
align: 'center',
},
{
title: '相关订单编号',
dataIndex: 'orderTaskNo',
align: 'center',
},
{
title: '相关订单名称',
dataIndex: 'orderTaskName',
align: 'center',
},
{
title: '相关账号',
dataIndex: 'updateUserName',
align: 'center',
},
{
title: '变更类型',
dataIndex: 'payType',
align: 'center',
render: (value) => {
const item = typeOptions.find((i) => i.id === value);
return item ? item.name : value;
},
},
{
title: '变动',
dataIndex: 'amtPaid',
align: 'center',
render: (value) => {
return value > 0 ? `+${moneyFormat(value)}` : moneyFormat(value);
},
},
{
title: '已冻结',
dataIndex: 'cashFreeze',
align: 'center',
render: (value) => {
return moneyFormat(value);
},
},
{
title: '余额',
dataIndex: 'cashAmt',
align: 'center',
render: (value) => {
return moneyFormat(value);
},
},
{
title: '备注',
dataIndex: 'remark',
align: 'center',
},
{
title: '凭证',
dataIndex: 'voucher',
align: 'center',
render: (value) => {
if (value) {
const list = value.split(',');
return (
<div style={{ display: 'flex', justifyContent: 'space-around' }}>
{list.map((i: string, j: number) => (
<Image key={j} style={{ width: '48px', height: '48px' }} src={i} alt='凭证' />
))}
</div>
);
}
return '无';
},
},
];
// 表格数据
const [tableData, setTableData] = useState<DetailTableType[]>([]);
// 表格分页配置
const [pagination, setPagination] = useState({
total: 0,
pageSize: 10,
current: 1,
totalPage: 0,
});
const [query, setQuery] = useState({});
// 新版通用部分(ES6+ for React) ZhangLK 2022/08/30 Start
// 加载列表
const getTableList = async (value = {}) => {
setTableData([{ id: Number(id) }]);
// 只需要修改这个地方的接口即可
// const res: any = await UserAPI.getBountyFlow({
// mallUserId: Number(id),
// pageNo: pagination.current,
// pageSize: pagination.pageSize,
// ...value,
// });
// if (res && res.code === '200') {
// // console.log("res -->", res);
// const { list, pageNo, totalCount, pageSize, totalPage } = res.result; // 解构
// setPagination({
// total: totalCount,
// pageSize,
// current: pageNo,
// totalPage,
// });
// setTableData(list);
// } else {
// message.warning(res.message);
// }
};
// 翻页
const paginationChange = (pageNo: number, pageSize: number) => {
getTableList({ pageNo, pageSize }).then();
};
// 表单提交
const onFinish = (val: DetailFormType) => {
// 在这里对提交的数据做处理,如range转为开始和结束时间
const data = Object.fromEntries(
// 过滤为空项
Object.entries({
...val,
startTime: (val.time && val.time[0]) || undefined,
endTime: (val.time && val.time[1]) || undefined,
pageNo: 1,
}).filter((i) => i[1] !== '' && i[1] !== undefined && i[1] !== null),
);
setQuery(data);
getTableList(data).then();
};
// 返回上一页
const handleBack = () => {
navigate(-1);
};
// 获取所有类型
const getTypeAll = async () => {
// const res: any = await UserAPI.getTypeAll();
// if (res.result && res.result.length != 0) {
// const optionList = res.result.map((v: any) => ({
// id: v.code,
// name: v.status,
// }));
// searchColumns.map((v) => {
// if (v.name === 'type') {
// v.options = optionList;
// }
// });
// setSearchColumns([...searchColumns]);
// setTypeOptions(optionList);
// }
};
// componentDidMount
useEffect(() => {
getTypeAll().then();
getTableList().then();
console.log('searchParams --->', searchParams);
}, []);
return (
<>
<SearchBox
search={searchColumns}
searchData={onFinish}
preFixBtn={
<>
<div>
{uid}({userName})
</div>
<Button
type='primary'
onClick={() => {
setChangeVisible(true);
}}
>
奖励金变更
</Button>
<Button className='backButton' onClick={handleBack}>
返回
</Button>
</>
}
/>
<Table
size='small'
rowKey='id'
dataSource={tableData}
columns={tableColumns}
scroll={{ x: 1500 }}
pagination={{
total: pagination.total,
pageSize: pagination.pageSize,
current: pagination.current,
showSizeChanger: true,
onChange: (page, pageSize) => paginationChange(page, pageSize),
showTotal: (total, range) => `当前 ${range[0]}-${range[1]} 条记录 / 共 ${total} 条数据`,
}}
bordered
/>
<ChangeModal
visible={changeVisible}
closed={() => {
setChangeVisible(false);
getTableList({ ...pagination, ...query }).then();
}}
data={
{
// mallUserId: Number(qs.parse(props.location.search).id),
// uid: qs.parse(props.location.search).uid,
// userName: qs.parse(props.location.search).userName,
}
}
/>
</>
);
};
export default CustomMoneyDetail;
.from-table-wrap{
position: relative;
//padding: 15px 0 0 0;
.header-view{
position: relative;
width: 100%;
min-height: 60px;
height: auto;
background: #fff;
border-radius: 8px;
display: flex;
justify-content: flex-start;
align-content: center;
flex-wrap: wrap;
padding: 15px 20px 5px 20px;
margin: 0 0 10px 0;
.ant-select-selector{
min-width: 200px;
}
.ant-row{
margin-bottom:10px;
}
.add-button{
margin-right: 15px;
}
}
}
.detail-wrap{
position: relative;
width: 100%;
min-height: 60px;
height: auto;
background: #fff;
border-radius: 8px;
padding: 20px 25px;
.ant-descriptions:nth-child(1){
.ant-descriptions-view{
max-width: 600px;
}
}
}
.custom-class{
margin-top: 10vh;
.ant-message-notice-content{
padding: 15px 30px;
position: relative;
pointer-events:none;
span[role="img"]{
display: none;
}
}
.ant-message-notice-content:after{
position: absolute;
pointer-events:auto;
left: 100%;
top: 0px;
content: "X";
border: 1px solid rgba(128,129,133,0.25);
width: 15px;
height: 15px;
display: flex;
justify-content: center;
align-items: center;
border-radius: 50%;
font-weight: 900;
transform: scale(1.3,1.1) translateX(-2px);
color: rgba(128,129,133,0.6);
cursor: pointer;
}
}
import { useEffect, useState } from 'react';
import { Button, Table } from 'antd';
import { EditOutlined } from '@ant-design/icons';
import { ColumnsType } from 'antd/es/table';
import { useNavigate } from 'react-router-dom';
// import { UserAPI } from '@/api';
import SearchBox, { searchColumns } from '~/components/search-box';
// import useOption from '@/common/hook/optionHook';
import { FormType, TableType } from './propsType';
import { moneyFormat } from '~/utils/money';
import qs from 'query-string';
const CustomMoneyView = () => {
// 路由操作
const navigate = useNavigate();
// 搜索数据
const [searchColumns] = useState<searchColumns[]>([
{
label: '用户信息',
name: 'searchKey',
type: 'input',
placeholder: '用户名称/手机号/UID',
width: 180,
},
]);
// 表头
const tableColumns: ColumnsType<TableType> = [
{
title: '用户UID',
dataIndex: 'uid',
align: 'center',
},
{
title: '用户名称',
dataIndex: 'userName',
align: 'center',
render: (_value, record) => {
return record.userName ? record.userName : record.nickName ? record.nickName : `游客用户`;
},
},
{
title: '手机号',
dataIndex: 'phoneNum',
align: 'center',
render: (value) => {
return value || `-`;
},
},
{
title: '已销耗(元)',
dataIndex: 'rebatePaid',
align: 'center',
render: (value) => {
return moneyFormat(value);
},
},
{
title: '已冻结(元)',
dataIndex: 'rebateFreeze',
align: 'center',
render: (value) => {
return moneyFormat(value);
},
},
{
title: '奖励金账户(元)',
dataIndex: 'rcdRebateAmt',
align: 'center',
render: (value) => {
return moneyFormat(value);
},
},
{
title: '操作',
align: 'center',
width: 150,
fixed: 'right',
render: (_value, record, _index) => (
<Button
type='link'
size='small'
icon={<EditOutlined />}
onClick={() => handleDetail(record)}
>
变更
</Button>
),
},
];
// 表格数据
const [tableData, setTableData] = useState<TableType[]>([]);
// 表格分页配置
const [pagination, setPagination] = useState({
total: 0,
pageSize: 10,
current: 1,
totalPage: 0,
});
// 按钮权限
// const btnChange = useOption(21101);
// 新版通用部分(ES6+ for React) ZhangLK 2022/08/30 Start
// 加载列表
const getTableList = async (value = {}) => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
setTableData([{ id: 1, uid: 'UID1234132', userName: '刘旺' }]);
// 只需要修改这个地方的接口即可
// const res: any = await UserAPI.getBountyManageList({
// pageNo: pagination.current,
// pageSize: pagination.pageSize,
// ...value,
// });
// if (res && res.code === '200') {
// // console.log("res -->", res);
// const { list, pageNo, totalCount, pageSize, totalPage } = res.result; // 解构
// setPagination({
// total: totalCount,
// pageSize,
// current: pageNo,
// totalPage,
// });
// setTableData(list);
// } else {
// message.warning(res.message);
// }
};
// 翻页
const paginationChange = (pageNo: number, pageSize: number) => {
getTableList({ pageNo, pageSize }).then();
};
// 表单提交
const onFinish = (val: FormType) => {
// 在这里对提交的数据做处理,如range转为开始和结束时间
const data = Object.fromEntries(
// 过滤为空项
Object.entries({
...val,
pageNo: 1,
}).filter((i) => i[1] !== '' && i[1] !== undefined && i[1] !== null),
);
getTableList(data).then();
};
// 跳转详情
const handleDetail = (record: TableType) => {
const search = {
id: record.id,
uid: record.uid,
userName: record.userName ? record.userName : record.nickName ? record.nickName : `游客用户`,
};
navigate(`/customManage/customMoney/detail?${qs.stringify(search)}`);
// console.log(record);
};
// componentDidMount
useEffect(() => {
getTableList().then();
}, []);
return (
<>
<SearchBox search={searchColumns} searchData={onFinish} />
<Table
size='small'
rowKey='id'
dataSource={tableData}
columns={tableColumns}
scroll={{ x: 1500 }}
pagination={{
total: pagination.total,
pageSize: pagination.pageSize,
current: pagination.current,
showSizeChanger: true,
onChange: (page, pageSize) => paginationChange(page, pageSize),
showTotal: (total, range) => `当前 ${range[0]}-${range[1]} 条记录 / 共 ${total} 条数据`,
}}
bordered
/>
</>
);
};
export default CustomMoneyView;
// 列表筛选表单类型
export interface FormType {
searchKey?: string;
}
// 表格列类型
export interface TableType {
id: number;
phoneNum: string;
rcdRebateAmt: number;
rebateFreeze: number;
rebatePaid: number;
uid: string;
userName: string;
nickName: string;
}
// 详情列表筛选表单类型
export interface DetailFormType {
endTime?: string;
mallUserId?: number;
pageNo?: number;
pageSize?: number;
payNO?: string;
startTime?: string;
type?: number;
time?: string[];
}
// 详情表格列类型
export interface DetailTableType {
amtPaid: number;
cashAmt: number;
cashFreeze: number;
createdTime: string;
id: number;
mallUserId: number;
orderTaskName: string;
orderTaskNo: string;
payNo: string;
payTime: string;
payType: number;
remark: string;
updateUserName: string;
voucher: string;
}
......@@ -23,7 +23,7 @@ function IndustryList() {
// 路由操作
const navigate = useNavigate();
// 表格数据
const [tableData, setTableData] = useState<IndustrySkuType[]>([]);
const [tableData, setTableData] = useState<any>([{ id: 1 }]);
// 加载中
const [loading, setLoading] = useState<boolean>(false);
// 行业列表
......@@ -33,7 +33,7 @@ function IndustryList() {
// 跳转详情
const handleDetail = (record: { id: number }) => {
navigate({
pathname: '/goodsManage/industryManage/detail',
pathname: '/mallManage/industryDetail',
search: `id=${record.id}`,
});
// console.log(record);
......@@ -69,27 +69,15 @@ function IndustryList() {
render: (text: string, record) => {
return (
<div>
{btnDetail ? (
<Button type='link' onClick={() => handleDetail(record)}>
详情
</Button>
) : (
''
)}
{btnEdit ? (
<Button type='link' onClick={() => handleEdit(record)}>
编辑
</Button>
) : (
''
)}
{btnDelete ? (
<Button type='link' onClick={() => openDeleteModal(record)}>
删除
</Button>
) : (
''
)}
<Button type='link' onClick={() => handleDetail(record)}>
详情
</Button>
<Button type='link' onClick={() => handleEdit(record)}>
编辑
</Button>
<Button type='link' onClick={() => openDeleteModal(record)}>
删除
</Button>
</div>
);
},
......@@ -234,11 +222,11 @@ function IndustryList() {
// componentDidMount
useEffect(() => {
query = {};
(async () => {
await getFirstIndustryTypeInfo();
await getTableList();
})();
// query = {};
// (async () => {
// await getFirstIndustryTypeInfo();
// await getTableList();
// })();
}, []);
return (
......
import CommonGoodsList from '~/components/goods/commonGoodsList';
const GoodsList = () => {
return (
<div className='goods-list'>
<CommonGoodsList />
</div>
);
};
export default GoodsList;
......@@ -24,7 +24,7 @@ function ProduceManage() {
// 路由操作
const navigate = useNavigate();
// 表格数据
const [tableData, setTableData] = useState<ProductSkuType[]>([]);
const [tableData, setTableData] = useState<any>([{ id: 1 }]);
// 加载中
const [loading, setLoading] = useState<boolean>(false);
// 产品类型下拉列表
......@@ -42,7 +42,7 @@ function ProduceManage() {
// 跳转详情
const handleDetail = (record: ProductSkuType) => {
navigate({
pathname: '/goodsManage/productManage/detail',
pathname: '/mallManage/produceDetail',
search: `id=${record.id}`,
});
};
......@@ -104,27 +104,15 @@ function ProduceManage() {
render: (text: string, record) => {
return (
<div>
{btnDetail ? (
<Button type='link' onClick={() => handleDetail(record)}>
详情
</Button>
) : (
''
)}
{btnEdit ? (
<Button type='link' onClick={() => handleEdit(record)}>
编辑
</Button>
) : (
''
)}
{btnDelete ? (
<Button type='link' onClick={() => handleDelete(record)}>
删除
</Button>
) : (
''
)}
<Button type='link' onClick={() => handleDetail(record)}>
详情
</Button>
<Button type='link' onClick={() => handleEdit(record)}>
编辑
</Button>
<Button type='link' onClick={() => handleDelete(record)}>
删除
</Button>
</div>
);
},
......@@ -220,12 +208,12 @@ function ProduceManage() {
};
// componentDidMount
useEffect(() => {
query = {};
getMakeList();
getDescList();
(async () => {
await getTableList();
})();
// query = {};
// getMakeList();
// getDescList();
// (async () => {
// await getTableList();
// })();
}, []);
return (
......
import CommonGoodsList from '~/components/goods/commonGoodsList';
const RentList = () => {
return (
<div className='rent-list'>
<CommonGoodsList />
</div>
);
};
export default RentList;
......@@ -14,6 +14,8 @@ import {
SmileOutlined,
TeamOutlined,
ReconciliationOutlined,
SolutionOutlined,
RedEnvelopeOutlined,
} from '@ant-design/icons';
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
......@@ -31,21 +33,29 @@ import DivideOrder from '~/pages/pointManage/divideOrder';
import DivideRules from '~/pages/pointManage/divideRules';
// 客户列表
import CustomListView from '~/pages/customManage/customList';
import { CategoryManage } from '~/api';
import CustomMoneyView from '~/pages/customManage/customMoney';
import CustomMoneyDetail from '~/pages/customManage/customMoney/detail';
// 活动
const ActivityList = React.lazy(() => import('src/pages/activityManage/activityList')); //活动管理
// 服务
const ServiceListView = React.lazy(() => import('~/pages/mallManage/serviceManage/serviceList'));
//商品管理
const ServiceListView = React.lazy(() => import('~/pages/mallManage/serviceManage/serviceList')); //服务列表
const ServiceDetailView = React.lazy(
() => import('~/pages/mallManage/serviceManage/serviceDetail'),
);
); //服务详情
const ServiceIntroduceView = React.lazy(
() => import('~/pages/mallManage/serviceManage/serviceIntroduce'),
);
// 产品
const ProduceListView = React.lazy(() => import('~/pages/mallManage/produceManage/produceList'));
// 行业
const IndustryListView = React.lazy(() => import('~/pages/mallManage/industryManage/industryList'));
); //服务介绍
const RentListView = React.lazy(() => import('~/pages/mallManage/rentGoods/rentList')); //租赁列表
const MallGoodsView = React.lazy(() => import('~/pages/mallManage/mallGoods/goodsList')); //商城商品
const ProduceListView = React.lazy(() => import('~/pages/mallManage/produceManage/produceList')); //产品列表
const ProduceDetailView = React.lazy(
() => import('~/pages/mallManage/produceManage/produceDetail'),
); //产品详情
const IndustryListView = React.lazy(() => import('~/pages/mallManage/industryManage/industryList')); //行业列表
const IndustryDetailView = React.lazy(
() => import('~/pages/mallManage/industryManage/industryDetail'),
); //行业详情
// 订单
const ProductOrderView = React.lazy(() => import('src/pages/orderManage/productOrder')); //销售订单
......@@ -203,23 +213,61 @@ export const routerList: Array<RouteObjectType> = [
},
},
{
path: '/mallManage/rentList',
element: withLoadingComponent(<RentListView />),
meta: {
id: 10130,
icon: <SmileOutlined />,
title: '租赁商品',
},
},
{
path: '/mallManage/mallGoods',
element: withLoadingComponent(<MallGoodsView />),
meta: {
id: 10140,
icon: <SmileOutlined />,
title: '商城商品',
},
},
{
path: '/mallManage/produceList',
element: withLoadingComponent(<ProduceListView />),
meta: {
id: 10130,
id: 10150,
icon: <SmileOutlined />,
title: '产品管理',
},
},
{
path: '/mallManage/produceDetail',
element: withLoadingComponent(<ProduceDetailView />),
meta: {
id: 10160,
icon: <SmileOutlined />,
title: '产品详情',
hidden: true,
},
},
{
path: '/mallManage/industryList',
element: withLoadingComponent(<IndustryListView />),
meta: {
id: 10140,
id: 10170,
icon: <SmileOutlined />,
title: '行业方案',
},
},
{
path: '/mallManage/industryDetail',
element: withLoadingComponent(<IndustryDetailView />),
meta: {
id: 10180,
icon: <SmileOutlined />,
title: '行业详情',
hidden: true,
},
},
],
},
{
......@@ -238,7 +286,26 @@ export const routerList: Array<RouteObjectType> = [
meta: {
id: 26100,
title: '客户列表',
icon: <BarsOutlined />,
icon: <SolutionOutlined />,
},
},
{
path: '/customManage/customMoney',
element: withLoadingComponent(<CustomMoneyView />),
meta: {
id: 26200,
title: '现金管理',
icon: <RedEnvelopeOutlined />,
},
},
{
path: '/customManage/customMoney/detail',
element: withLoadingComponent(<CustomMoneyDetail />),
meta: {
id: 26200,
title: '现金变更',
icon: <RedEnvelopeOutlined />,
hidden: true,
},
},
],
......
......@@ -9,6 +9,13 @@ export default defineConfig({
plugins: [react(), tsconfigPaths()],
server: {
host: '0.0.0.0',
proxy: {
'/api': {
target: 'https://test.iuav.shop',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
},
},
},
envDir: resolve(__dirname, 'env'),
resolve: {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论