This commit is contained in:
PC-202306242200\Administrator
2024-09-26 21:10:41 +08:00
parent 2bac0b8926
commit df17a3cfb7
41 changed files with 246 additions and 46 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -71,7 +71,6 @@ export default ({ values, modalOpenState, onModalOpenState, onSubmit }) => {
<ProFormRadio.Group
label="时间"
name="freezeDate"
initialValue="6月"
rules={[{ required: true, message: '请选择' }]}
options={[
{ label: '6月', value: '6' },

View File

@@ -60,7 +60,7 @@ const RoleForm: React.FC = (props: any) => {
label="设备类型"
name={'deviceType'}
>
<InputNumber addonAfter="W" style={{ width: 150 }} />
<InputNumber addonAfter="KW" style={{ width: 150 }} />
</ProForm.Item>
<ProForm.Item
label="补贴金额"

View File

@@ -28,7 +28,7 @@ const LogTableList: React.FC = () => {
dataIndex: 'deviceType',
valueType: 'text',
render: (_, record) => {
return record?.deviceType + 'W'
return record?.deviceType + 'KW'
},
// renderFormItem: (
// _,

View File

@@ -0,0 +1,183 @@
import { findPage, recordExtract } from '@/services/finance/index';
import { exportData } from '@/utils/func';
import React, { useRef, useEffect, useState } from 'react';
import { useIntl, useAccess } from '@umijs/max';
import { message, Tag, Select, Button } from 'antd';
import { ActionType, PageContainer, ProTable, ProFormSelect } from '@ant-design/pro-components';
import moneyType from '@/assets/json/moneyType.json'
import { usersPage } from '@/services/user/user';
const LogTableList: React.FC = () => {
const actionRef = useRef<ActionType>();
const [shopOption, setShopOption] = useState([]);
const [searchParams, setSearchParams] = useState(null);
const searchShop = async (value) => {
const { success, data } = await usersPage({
userId: value
});
data.records.map((i) => {
i.userName = i.userName + ' ' + i.phone
})
setShopOption(data.records)
}
const columns = [
{
title: 'ID',
dataIndex: 'id',
valueType: 'text',
search: false,
},
{
title: '用户信息',
dataIndex: 'userId',
valueType: 'text',
render: (_: any, record: any) => {
return <div>
<div>ID:{record?.userId}</div>
<div>{record?.userName}</div>
<div>{record?.phone}</div>
</div>
},
renderFormItem: (
_,
{ type, defaultRender, formItemProps, fieldProps, ...rest },
form,
) => {
return <Select
{...fieldProps}
allowClear
showSearch
placeholder="请输入用户名或手机号"
style={{ width: "100%" }}
filterOption={false}
onSearch={
(e) => {
if (!e) {
return;
}
searchShop(e);
}
}
fieldNames={{
label: "userName",
value: "id"
}}
options={shopOption}
/>
},
},
{
title: '记录名称',
dataIndex: 'recordName',
valueType: 'text',
search: false,
},
{
title: '冻结余额',
dataIndex: 'freezePoints',
valueType: 'text',
search: false,
},
{
title: '类型',
dataIndex: 'pointType',
valueType: 'text',
search: false,
render: (_: any, record: any) => {
return _ == 1 ? '收益' : '余额'
},
},
{
title: '记录类型',
dataIndex: 'type',
valueType: 'text',
search: true,
render: (_: any, record: any) => {
let list = moneyType
return list.find((val) => val.id == record.type)?.name
},
renderFormItem: (
_,
{ type, defaultRender, formItemProps, fieldProps, ...rest },
form,
) => {
return <Select
{...fieldProps}
allowClear
style={{ width: "100%" }}
filterOption={false}
fieldNames={{
label: "name",
value: "id"
}}
options={moneyType}
/>
},
},
{
title: '备注',
dataIndex: 'remarks',
valueType: 'text',
search: false,
},
{
title: '创建时间',
dataIndex: 'createTime',
valueType: 'dateRange',
search: {
transform: (value) => {
return {
createTimeBegin: value[0],
createTimeEnd: value[1],
};
},
},
render: (_, record) => {
return record?.createTime
},
},
];
return (
<PageContainer>
<div style={{ width: '100%', float: 'right' }}>
<ProTable
actionRef={actionRef}
rowKey="id"
key="logList"
search={{
labelWidth: 120,
defaultCollapsed: false,
}}
toolBarRender={() => [
// <Button type="primary" onClick={async () => {
// let _res = await recordExtract(searchParams)
// exportData(_res, '积分记录')
// }}>导出</Button>,
]}
request={async (params, sorter, filter) => {
// params.pointType = 2
setSearchParams(params)
let { data } = await findPage(params)
return {
data: data?.records || [],
total: data?.total,
};
}}
columns={columns}
/>
</div>
</PageContainer>
);
};
export default LogTableList;

View File

@@ -32,13 +32,13 @@ const LogTableList: React.FC = () => {
const handleTemp = async (fields) => {
console.log(fields);
const { success } = await importUsersPointsExtract(fields);
if (success) {
try {
const _res = await importUsersPointsExtract(fields);
message.success('导入成功');
actionRef.current?.reload();
setTempFormModal(false);
} catch (error) {
}
};
@@ -171,10 +171,7 @@ const LogTableList: React.FC = () => {
{record.bankCard}
</div>
<div>
{record.idCard}
</div>
<div>
{record.idCard}
{record.subbranchName}
</div>
<div hidden={record.type == 1}>
{record.taxNo}

View File

@@ -32,6 +32,9 @@ const GoodsTableList: React.FC = () => {
dataIndex: 'itemType',
valueType: 'text',
search: false,
render: (_: any, record: any) => {
return record?.itemType ? record?.itemType + 'KW' :'-'
}
},
{
title: '销售价格',

View File

@@ -32,6 +32,9 @@ const GoodsSetMealTableList: React.FC = () => {
dataIndex: 'itemType',
valueType: 'text',
search: false,
render: (_: any, record: any) => {
return record?.itemType ? record?.itemType + 'KW' :'-'
}
},
{
title: '销售价格',

View File

@@ -30,22 +30,19 @@ const LogTableList: React.FC = () => {
useEffect(() => {
getWeiXinCollect().then((res) => {
getWeiXinCollect(searchParams).then((res) => {
setCount1(res.data);
})
getBalance().then((res) => {
getBalance(searchParams).then((res) => {
setCount2(res.data);
})
getCollect().then((res) => {
getCollect(searchParams).then((res) => {
setCount3(res.data);
})
getZhiFuBaoCollect().then((res) => {
getZhiFuBaoCollect(searchParams).then((res) => {
setCount4(res.data);
})
}, []);
}, [searchParams]);
const [shopOption, setShopOption] = useState([]);

View File

@@ -111,7 +111,7 @@ const LogTableList: React.FC = () => {
valueType: 'text',
search: false,
render: (_: any, record: any) => {
return record?.deviceType + 'W'
return record?.deviceType + 'KW'
}
},

View File

@@ -72,3 +72,14 @@ export async function importUsersPointsExtract(body) {
responseType: 'blob'
});
}
export async function findPage(body) {
return request('/api/freeze/findPage', {
method: 'POST',
headers: {
'Content-Type': 'application/json;charset=UTF-8',
},
data: body || {},
});
}

View File

@@ -42,38 +42,42 @@ export async function orderRefund(bodys) {
}
export async function getWeiXinCollect() {
export async function getWeiXinCollect(bodys) {
return request('/api/orders/getWeiXinCollect', {
method: 'GET',
method: 'POST',
headers: {
'Content-Type': 'application/json;charset=UTF-8',
},
data: bodys || {},
});
}
export async function getCollect() {
export async function getCollect(bodys) {
return request('/api/orders/getCollect', {
method: 'GET',
method: 'POST',
headers: {
'Content-Type': 'application/json;charset=UTF-8',
},
data: bodys || {},
});
}
export async function getBalance() {
export async function getBalance(bodys) {
return request('/api/orders/getBalance', {
method: 'GET',
method: 'POST',
headers: {
'Content-Type': 'application/json;charset=UTF-8',
},
data: bodys || {},
});
}
export async function getZhiFuBaoCollect() {
export async function getZhiFuBaoCollect(bodys) {
return request('/api/orders/getZhiFuBaoCollect', {
method: 'GET',
method: 'POST',
headers: {
'Content-Type': 'application/json;charset=UTF-8',
},
data: bodys || {},
});
}