Merge branch 'main' of http://120.76.84.145:10101/gitblit/r/H5/JiaShiDa
| | |
| | | import { PlusOutlined } from '@ant-design/icons'; |
| | | import { useRef, useState } from 'react'; |
| | | import { customRequest } from '@/utils/utils'; |
| | | import { applyRefund } from '../service'; |
| | | |
| | | const RefundApplyModal = ({ visible, onCancel, orderId, onSuccess }) => { |
| | | const [form] = Form.useForm(); |
| | |
| | | justifyContent: 'center', |
| | | height: '100%', |
| | | color: '#8c8c8c', |
| | | border: '1px dashed #d9d9d9', |
| | | borderRadius: 4, |
| | | backgroundColor: '#fafafa', |
| | | }}> |
| | | <PlusOutlined style={{ fontSize: 24, marginBottom: 8 }} /> |
| | | <div style={{ fontSize: 12 }}>上传图片</div> |
| | |
| | | import { exportExcell } from '@/utils/utils' |
| | | import { PageContainer, ProTable } from '@ant-design/pro-components'; |
| | | import { Button, Space, Tag } from 'antd'; |
| | | import { useRef } from 'react'; |
| | | import { useRef, useState } from 'react'; |
| | | import { getPromotionPageList } from '../service'; |
| | | import { message } from 'antd'; |
| | | |
| | | const PromotionRecord = ({ companyId }) => { |
| | | const actionRef = useRef(); |
| | | const [exportData, setExportData] = useState({}) |
| | | |
| | | const columns = [ |
| | | { |
| | |
| | | hideInSearch: true, |
| | | render: (text, record) => { |
| | | const roleMap = { |
| | | 1: { text: '游客', color: 'default' }, |
| | | 1: { text: '游客', color: 'blue' }, |
| | | 2: { text: '营销员', color: 'blue' }, |
| | | 3: { text: '合伙人', color: 'green' }, |
| | | 3: { text: '合伙人', color: 'blue' }, |
| | | 4: { text: '经销商', color: 'blue' }, |
| | | 5: { text: '股东', color: 'blue' }, |
| | | }; |
| | | const role = roleMap[record.lastRoleName] || { text: '未知', color: 'default' }; |
| | | return <Tag color={role.color}>{role.text}</Tag>; |
| | |
| | | hideInSearch: true, |
| | | render: (text, record) => { |
| | | const roleMap = { |
| | | 1: { text: '游客', color: 'default' }, |
| | | 1: { text: '游客', color: 'blue' }, |
| | | 2: { text: '营销员', color: 'blue' }, |
| | | 3: { text: '合伙人', color: 'green' }, |
| | | 3: { text: '合伙人', color: 'blue' }, |
| | | 4: { text: '经销商', color: 'blue' }, |
| | | 5: { text: '股东', color: 'blue' }, |
| | | }; |
| | | const role = roleMap[record.roleName] || { text: '未知', color: 'default' }; |
| | | return <Tag color={role.color}>{role.text}</Tag>; |
| | |
| | | ]; |
| | | |
| | | // 处理导出功能 |
| | | const handleExport = async (params) => { |
| | | const handleExport = async () => { |
| | | try { |
| | | // 构建导出参数 |
| | | const exportParams = { |
| | | ...params, |
| | | companyId, |
| | | }; |
| | | exportExcell('推广记录.xlsx', exportParams, '/t-company/export'); |
| | | exportExcell('推广记录.xlsx', exportData, '/t-company/export'); |
| | | message.success('导出成功'); |
| | | } catch (error) { |
| | | message.error('导出失败'); |
| | |
| | | }} |
| | | rowSelection={false} |
| | | request={(params) => { |
| | | setExportData({ ...params, companyId }) |
| | | return buildProTableDataSource(getPromotionPageList, { ...params, companyId }); |
| | | }} |
| | | toolBarRender={(action, selectRows) => [ |
| | |
| | | key="export" |
| | | type="primary" |
| | | onClick={() => { |
| | | handleExport(params); |
| | | handleExport(); |
| | | }} |
| | | > |
| | | 导出Excel |
| | |
| | | align: 'center', |
| | | hideInSearch: true, |
| | | render: (text) => { |
| | | return <Tag color="blue">{text || '默认角色'}</Tag>; |
| | | return <Tag color="blue">{text}</Tag>; |
| | | }, |
| | | }, |
| | | { |
| | |
| | | dataIndex: 'orderPrice', |
| | | align: 'center', |
| | | hideInSearch: true, |
| | | render: (orderPrice) => ( |
| | | <span>{orderPrice ? Number(orderPrice).toFixed(2) : '0.00'}</span> |
| | | ), |
| | | render: (text) => { |
| | | return text ? `¥${Number(text).toFixed(2)}` : '¥0.00'; |
| | | }, |
| | | }, |
| | | { |
| | | title: '本人收益金额', |
| | | title: '推广员收益', |
| | | dataIndex: 'saleProfit', |
| | | align: 'center', |
| | | hideInSearch: true, |
| | | render: (saleProfit) => ( |
| | | <span style={{ color: '#52c41a', fontWeight: 'bold' }}> |
| | | {saleProfit ? Number(saleProfit).toFixed(2) : '0.00'} |
| | | </span> |
| | | ), |
| | | render: (text) => { |
| | | return text ? `¥${Number(text).toFixed(2)}` : '¥0.00'; |
| | | }, |
| | | }, |
| | | { |
| | | title: '合伙人收益', |
| | | dataIndex: 'partnerProfit', |
| | | align: 'center', |
| | | hideInSearch: true, |
| | | render: (text) => { |
| | | return text ? `¥${Number(text).toFixed(2)}` : '¥0.00'; |
| | | }, |
| | | }, |
| | | { |
| | | title: '操作', |
| | |
| | | hideInSearch: true, |
| | | render: (lastRoleName) => { |
| | | const roleMap = { |
| | | 1: { text: '游客', color: 'default' }, |
| | | 1: { text: '游客', color: 'blue' }, |
| | | 2: { text: '营销员', color: 'blue' }, |
| | | 3: { text: '合伙人', color: 'green' }, |
| | | 3: { text: '合伙人', color: 'blue' }, |
| | | 4: { text: '经销商', color: 'blue' }, |
| | | 5: { text: '股东', color: 'blue' }, |
| | | }; |
| | | const role = roleMap[lastRoleName] || { text: '未知', color: 'default' }; |
| | | return <Tag color={role.color}>{role.text}</Tag>; |
| | |
| | | 1: '游客', |
| | | 2: '营销员', |
| | | 3: '合伙人', |
| | | 4: '经销商', |
| | | 5: '股东' |
| | | }; |
| | | return roleMap[roleName] || '未知'; |
| | | }, |
| | |
| | | <PageContainer> |
| | | <div style={{ marginBottom: 24 }}> |
| | | <Space> |
| | | <Access accessible={access.summaryStatistics_search || false}> |
| | | <DatePicker.RangePicker |
| | | value={dateRange.map(date => date ? moment(date) : null)} |
| | | onChange={handleDateChange} |
| | | style={{ width: 300 }} |
| | | /> |
| | | </Access> |
| | | <Access accessible={access.summaryStatistics_search || false}> |
| | | <Button onClick={fetchData} type="primary">查询</Button> |
| | | </Access> |
| | | </Space> |
| | | </div> |
| | | |
| | |
| | | children: '微信支付', |
| | | }, |
| | | { |
| | | label: '定金支付时间', |
| | | children: orderDetail.depositTime || '-', |
| | | }, |
| | | { |
| | | label: '备注', |
| | | children: orderDetail.remark || '-', |
| | | }, |
| | | ]]; |
| | | } else if (status === 3 && paymentType === 1) { |
| | | } else if ((status === 3 || status === 4) && paymentType === 1) { |
| | | // 已支付定金+尾款 |
| | | specificItems = [...specificItems, ...[ |
| | | { |
| | |
| | | children: '微信支付', |
| | | }, |
| | | { |
| | | label: '定金支付时间', |
| | | children: orderDetail.depositTime || '-', |
| | | }, |
| | | { |
| | | label: '已付尾款', |
| | | children: `¥${orderDetail.finalPayment || 0}`, |
| | | }, |
| | |
| | | children: '微信支付', |
| | | }, |
| | | { |
| | | label: '尾款支付时间', |
| | | children: orderDetail.finalPaymentTime || '-', |
| | | }, |
| | | { |
| | | label: '备注', |
| | | children: orderDetail.remark || '-', |
| | | }, |
| | | ]]; |
| | | } else if (status === 3 && paymentType === 2) { |
| | | } else if ((status === 3 || status === 4) && paymentType === 2) { |
| | | // 已支付全款 |
| | | specificItems = [...specificItems, ...[ |
| | | { |
| | |
| | | }, |
| | | { |
| | | label: '支付时间', |
| | | children: orderDetail.depositTime || '-', // 全款支付时间使用订金时间字段 |
| | | children: orderDetail.depositTime || '-', |
| | | }, |
| | | { |
| | | label: '支付方式', |
| | |
| | | </Descriptions> |
| | | |
| | | {/* 营销明细(仅已支付定金+尾款时显示) */} |
| | | {status === 3 && paymentType === 1 && ( |
| | | {((status === 3 || status === 4) && paymentType === 2) && ( |
| | | <div style={{ marginTop: 24 }}> |
| | | <Text strong>营销明细</Text> |
| | | <Descriptions column={3} bordered style={{ marginTop: 8 }}> |
| | |
| | | align: 'center', |
| | | }, |
| | | { |
| | | title: '转让用户手机号', |
| | | dataIndex: 'newUserPhone', |
| | | align: 'newUserPhone', |
| | | hideInSearch: true, |
| | | }, |
| | | { |
| | | title: '操作', |
| | | hideInSearch: true, |
| | | render: (text, record) => { |
| | |
| | | <> |
| | | <Descriptions.Item label="订单编号">{orderDetail.code}</Descriptions.Item> |
| | | <Descriptions.Item label="下单时间">{orderDetail.createTime}</Descriptions.Item> |
| | | <Descriptions.Item label="订单价格">¥{orderDetail.orderPrice || 0}</Descriptions.Item> |
| | | {/* <Descriptions.Item label="订单价格">¥{orderDetail.orderPrice || 0}</Descriptions.Item> */} |
| | | <Descriptions.Item label="用户昵称">{orderDetail.userName}</Descriptions.Item> |
| | | <Descriptions.Item label="用户手机号">{orderDetail.phone}</Descriptions.Item> |
| | | </> |
| | |
| | | columns={columns} |
| | | request={async (params) => { |
| | | const { current, pageSize, ...rest } = params; |
| | | setSearchParams({ |
| | | let obj = { |
| | | ...rest, |
| | | pageNum: current, |
| | | pageSize, |
| | | }); |
| | | const res = await getPhysicalGoodsOrderList({ |
| | | ...rest, |
| | | pageNum: current, |
| | | pageSize, |
| | | }); |
| | | pageSize |
| | | } |
| | | if (obj.physicalGoodsName) { |
| | | obj.name = obj.physicalGoodsName |
| | | } |
| | | setSearchParams(obj); |
| | | const res = await getPhysicalGoodsOrderList(obj); |
| | | return { |
| | | data: res.data?.records || [], |
| | | success: res.code === 200, |
| | |
| | | title: '订单编号', |
| | | dataIndex: 'code', |
| | | width: 180, |
| | | copyable: true, |
| | | ellipsis: true, |
| | | order: 4, |
| | | search: { |
| | |
| | | width="30%" |
| | | centered |
| | | destroyOnHidden |
| | | title={editData.id ? '编辑人员' : '添加人员'} |
| | | title={editData.userId ? '编辑人员' : '添加人员'} |
| | | open={visible} |
| | | onCancel={() => { |
| | | onCancel(false); |
| | |
| | | name="userName" |
| | | label="登录账号" |
| | | width={240} |
| | | disabled={editData.id} |
| | | disabled={editData.userId} |
| | | placeholder="请输入" |
| | | rules={[{ required: true, message: '请输入登录账号' }]} |
| | | addonAfter={<span style={{ color: 'red' }}>账号不可重复</span>} |
| | |
| | | 1: '游客', |
| | | 2: '营销员', |
| | | 3: '合伙人', |
| | | 4: '经销商', |
| | | 5: '股东' |
| | | }; |
| | | |
| | | // 状态映射 |
| | |
| | | 1: { text: '游客' }, |
| | | 2: { text: '营销员' }, |
| | | 3: { text: '合伙人' }, |
| | | 4: { text: '经销商' }, |
| | | 5: { text: '股东' }, |
| | | }, |
| | | render: (text) => userTypeMap[text] || '-', |
| | | }, |
| | |
| | | 1: '游客', |
| | | 2: '营销员', |
| | | 3: '合伙人', |
| | | 4: '经销商', |
| | | 5: '股东' |
| | | }; |
| | | |
| | | // 性别映射 |
| | |
| | | { label: '游客', value: 1 }, |
| | | { label: '营销员', value: 2 }, |
| | | { label: '合伙人', value: 3 }, |
| | | { label: '经销商', value: 4 }, |
| | | { label: '股东', value: 5 }, |
| | | ]; |
| | | |
| | | // 推荐人表格列 |
| | |
| | | { label: '游客', value: 1 }, |
| | | { label: '营销员', value: 2 }, |
| | | { label: '合伙人', value: 3 }, |
| | | { label: '经销商', value: 4 }, |
| | | { label: '股东', value: 5 }, |
| | | ]; |
| | | |
| | | // 推荐人表格列 |
| | |
| | | 1: { text: '游客' }, |
| | | 2: { text: '营销员' }, |
| | | 3: { text: '合伙人' }, |
| | | 4: { text: '经销商' }, |
| | | 5: { text: '股东' }, |
| | | }, |
| | | }, |
| | | { |
| | |
| | | ]} |
| | | request={async (params) => { |
| | | const { current, pageSize, ...rest } = params; |
| | | |
| | | let queryParams = { |
| | | ...rest, |
| | | pageNum: current, |
| | | pageSize, |
| | | }; |
| | | if (queryParams.name) { |
| | | queryParams.nickName = queryParams.name; |
| | | } |
| | | if (queryParams.phone) { |
| | | queryParams.phoneNumber = queryParams.phone; |
| | | } |
| | | // 保存搜索参数,用于导出 |
| | | setSearchParams({ |
| | | ...rest, |
| | | pageNum: current, |
| | | pageSize, |
| | | }); |
| | | setSearchParams(queryParams); |
| | | |
| | | const res = await getUserList({ |
| | | ...rest, |
| | | pageNum: current, |
| | | pageSize, |
| | | }); |
| | | const res = await getUserList(queryParams); |
| | | |
| | | return { |
| | | data: res.data?.records || [], |
| | |
| | | }, |
| | | { |
| | | title: '本人收益金额', |
| | | dataIndex: 'saleProfit', |
| | | dataIndex: 'selfProfit', |
| | | width: 140, |
| | | hideInSearch: true, |
| | | render: (text) => text ? `¥${text}` : '¥0', |
| | |
| | | 1: '游客', |
| | | 2: '营销员', |
| | | 3: '合伙人', |
| | | 4: '经销商', |
| | | 5: '股东' |
| | | }; |
| | | |
| | | // 状态映射 |