Commit 6329b78d0bd16017a0620e840ecacbdb07da4d71
Merge branch 'feature-PrivatePocket' into dev
Showing
20 changed files
with
1660 additions
and
497 deletions
.umirc.ts
@@ -131,10 +131,30 @@ export default defineConfig({ | @@ -131,10 +131,30 @@ export default defineConfig({ | ||
131 | }, | 131 | }, |
132 | { | 132 | { |
133 | name: '预存管理', | 133 | name: '预存管理', |
134 | - path: '/prepaidManage', | ||
135 | - component: './Prepaid', | 134 | + path: '/prepaid', |
136 | icon: 'AccountBookOutlined', | 135 | icon: 'AccountBookOutlined', |
137 | access: 'canReadAdminAndFinanceAndSales', | 136 | access: 'canReadAdminAndFinanceAndSales', |
137 | + routes: [ | ||
138 | + { | ||
139 | + path: '', | ||
140 | + component: './Prepaid', | ||
141 | + }, | ||
142 | + { | ||
143 | + name: '预存充值', | ||
144 | + path: 'recharge', | ||
145 | + component: './Prepaid/PrepaidRecharge', | ||
146 | + }, | ||
147 | + { | ||
148 | + name: '账号列表', | ||
149 | + path: 'account', | ||
150 | + component: './Prepaid/PrepaidAccount', | ||
151 | + }, | ||
152 | + { | ||
153 | + name: '隐私钱包', | ||
154 | + path: 'privatePocket', | ||
155 | + component: './Prepaid/PrivatePocket', | ||
156 | + }, | ||
157 | + ], | ||
138 | }, | 158 | }, |
139 | { | 159 | { |
140 | name: '课题组管理', | 160 | name: '课题组管理', |
src/pages/Order/FeedBack/OrderList.tsx
@@ -1193,8 +1193,8 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -1193,8 +1193,8 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
1193 | <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> | 1193 | <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> |
1194 | <Tag | 1194 | <Tag |
1195 | color={ | 1195 | color={ |
1196 | - optRecord.invoicingTime === null || | ||
1197 | - optRecord.invoicingTime === undefined | 1196 | + optRecord.afterInvoicingStatus !== 'COMPLETE_INVOICING' && |
1197 | + optRecord.afterInvoicingStatus !== 'PARTIAL_INVOICING' | ||
1198 | ? TAGS_COLOR.get(optRecord.invoicingStatus) | 1198 | ? TAGS_COLOR.get(optRecord.invoicingStatus) |
1199 | : 'success' | 1199 | : 'success' |
1200 | } | 1200 | } |
src/pages/Order/FeedBack/constant.ts
@@ -121,10 +121,10 @@ export const CHECK_TYPE = { | @@ -121,10 +121,10 @@ export const CHECK_TYPE = { | ||
121 | * @param subOrder | 121 | * @param subOrder |
122 | */ | 122 | */ |
123 | export const getNeedInvoicing = (subOrder: any) => { | 123 | export const getNeedInvoicing = (subOrder: any) => { |
124 | - if (subOrder.invoicingTime !== null && subOrder.invoicingTime !== undefined) { | ||
125 | - return '已开票'; | ||
126 | - } | ||
127 | - if (subOrder.afterInvoicingStatus === 'COMPLETE_INVOICING') { | 124 | + if ( |
125 | + subOrder.afterInvoicingStatus === 'COMPLETE_INVOICING' || | ||
126 | + subOrder.afterInvoicingStatus === 'PARTIAL_INVOICING' | ||
127 | + ) { | ||
128 | return '已开票'; | 128 | return '已开票'; |
129 | } | 129 | } |
130 | if (subOrder.afterInvoicingStatus === 'REISSUE') { | 130 | if (subOrder.afterInvoicingStatus === 'REISSUE') { |
@@ -133,6 +133,12 @@ export const getNeedInvoicing = (subOrder: any) => { | @@ -133,6 +133,12 @@ export const getNeedInvoicing = (subOrder: any) => { | ||
133 | if (subOrder.invoicingStatus === 'UN_INVOICE') { | 133 | if (subOrder.invoicingStatus === 'UN_INVOICE') { |
134 | return '不需开票'; | 134 | return '不需开票'; |
135 | } | 135 | } |
136 | + if (subOrder.afterInvoicingStatus === 'WAIT_FLUSH') { | ||
137 | + return '待冲红'; | ||
138 | + } | ||
139 | + if (subOrder.afterInvoicingStatus === 'FLUSHED') { | ||
140 | + return '已冲红'; | ||
141 | + } | ||
136 | return '需要开票'; | 142 | return '需要开票'; |
137 | }; | 143 | }; |
138 | 144 |
src/pages/Order/Order/components/CheckModal.tsx
@@ -85,12 +85,37 @@ export default ({ | @@ -85,12 +85,37 @@ export default ({ | ||
85 | // data: { subOrderIds: subOrderIds }, | 85 | // data: { subOrderIds: subOrderIds }, |
86 | // }); | 86 | // }); |
87 | 87 | ||
88 | + // 检查subOrders是否存在且有元素 | ||
89 | + if (!subOrders || !subOrders.length) { | ||
90 | + // 如果是预存审核类型,直接返回,不需要处理售后信息 | ||
91 | + if (checkType(CHECK_TYPE.PREPAID_AUDIT)) { | ||
92 | + return; | ||
93 | + } | ||
94 | + | ||
95 | + // 对于其他类型,设置一个空的售后信息 | ||
96 | + setAfterSalesInfo( | ||
97 | + <div className="my-5"> | ||
98 | + <Row gutter={[16, 24]}> | ||
99 | + <Col span={24}> | ||
100 | + <span>暂无售后信息</span> | ||
101 | + </Col> | ||
102 | + </Row> | ||
103 | + </div>, | ||
104 | + ); | ||
105 | + return; | ||
106 | + } | ||
107 | + | ||
88 | //附件 | 108 | //附件 |
89 | - let annex = subOrders[0].afterSalesAnnexList; | 109 | + let annex = subOrders[0]?.afterSalesAnnexList || []; |
90 | let index = 1; | 110 | let index = 1; |
91 | let annexLinks = annex?.map((f) => { | 111 | let annexLinks = annex?.map((f) => { |
92 | return ( | 112 | return ( |
93 | - <Button className="p-0 pr-1" type="link" key="key" href={f}> | 113 | + <Button |
114 | + className="p-0 pr-1" | ||
115 | + type="link" | ||
116 | + key={`annex-${index}`} | ||
117 | + href={f} | ||
118 | + > | ||
94 | {'附件' + index++} | 119 | {'附件' + index++} |
95 | </Button> | 120 | </Button> |
96 | ); | 121 | ); |
@@ -126,27 +151,36 @@ export default ({ | @@ -126,27 +151,36 @@ export default ({ | ||
126 | useEffect(() => { | 151 | useEffect(() => { |
127 | if (checkType(CHECK_TYPE.CONFIRM_DELIVER)) { | 152 | if (checkType(CHECK_TYPE.CONFIRM_DELIVER)) { |
128 | setAPopoverTitle('确认发货'); | 153 | setAPopoverTitle('确认发货'); |
154 | + } else if (checkType(CHECK_TYPE.PREPAID_AUDIT)) { | ||
155 | + setAPopoverTitle('预存审核'); | ||
129 | } | 156 | } |
130 | getOrderAfterSalesInfo(); | 157 | getOrderAfterSalesInfo(); |
131 | 158 | ||
132 | let paymentReceiptsImagesList: any[] = []; | 159 | let paymentReceiptsImagesList: any[] = []; |
133 | subOrders?.forEach((item: any) => { | 160 | subOrders?.forEach((item: any) => { |
134 | - if (item.paymentReceiptAnnexList) { | ||
135 | - paymentReceiptsImagesList.push(...item.paymentReceiptAnnexList); | 161 | + if ( |
162 | + item?.paymentReceiptsImages !== null && | ||
163 | + item?.paymentReceiptsImages !== undefined | ||
164 | + ) { | ||
165 | + paymentReceiptsImagesList.push(...item.paymentReceiptsImages); | ||
136 | } | 166 | } |
137 | }); | 167 | }); |
138 | - //去重 | ||
139 | - paymentReceiptsImagesList = [...new Set(paymentReceiptsImagesList)]; | ||
140 | setPymentReceiptsImages(paymentReceiptsImagesList); | 168 | setPymentReceiptsImages(paymentReceiptsImagesList); |
141 | 169 | ||
142 | - //预存审核的凭证 | ||
143 | let proofImages: any[] = []; | 170 | let proofImages: any[] = []; |
171 | + // 从subOrders获取凭证图片 | ||
144 | subOrders?.forEach((item) => { | 172 | subOrders?.forEach((item) => { |
145 | - let images = item.proofImages; | 173 | + let images = item?.proofImages; |
146 | if (images !== null && images !== undefined) { | 174 | if (images !== null && images !== undefined) { |
147 | proofImages.push(...images); | 175 | proofImages.push(...images); |
148 | } | 176 | } |
149 | }); | 177 | }); |
178 | + | ||
179 | + // 对于预存审核,从data对象中获取凭证图片 | ||
180 | + if (checkType(CHECK_TYPE.PREPAID_AUDIT) && data?.proofImages) { | ||
181 | + proofImages = [...data.proofImages]; | ||
182 | + } | ||
183 | + | ||
150 | setPrepaidProofImages(proofImages); | 184 | setPrepaidProofImages(proofImages); |
151 | }, []); | 185 | }, []); |
152 | 186 | ||
@@ -374,12 +408,25 @@ export default ({ | @@ -374,12 +408,25 @@ export default ({ | ||
374 | * @param body | 408 | * @param body |
375 | */ | 409 | */ |
376 | async function doPrepaidAudit(body: any) { | 410 | async function doPrepaidAudit(body: any) { |
377 | - const data = await postPrepaidAudit({ | ||
378 | - data: body, | 411 | + // 确保传递了需要审核的记录ID |
412 | + const auditData = { | ||
413 | + ...body, | ||
414 | + ids: [data?.id], // 使用当前记录的ID | ||
415 | + checkPassOrReject: body.checkPassOrReject, // 通过或驳回 | ||
416 | + checkNotes: body.name, // 审核意见 | ||
417 | + }; | ||
418 | + | ||
419 | + console.log('预存审核参数:', auditData); | ||
420 | + | ||
421 | + const result = await postPrepaidAudit({ | ||
422 | + data: auditData, | ||
379 | }); | 423 | }); |
380 | - if (data.result === RESPONSE_CODE.SUCCESS) { | ||
381 | - message.success(data.message); | 424 | + |
425 | + if (result.result === RESPONSE_CODE.SUCCESS) { | ||
426 | + message.success(result.message); | ||
382 | onClose(); | 427 | onClose(); |
428 | + } else { | ||
429 | + message.error(result.message || '审核失败'); | ||
383 | } | 430 | } |
384 | } | 431 | } |
385 | 432 |
src/pages/Order/OrderList/OrderDrawer.tsx
@@ -230,7 +230,11 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | @@ -230,7 +230,11 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | ||
230 | 230 | ||
231 | // 查询当前手机号允许使用的预存账号 | 231 | // 查询当前手机号允许使用的预存账号 |
232 | if (phone) { | 232 | if (phone) { |
233 | - let res = await postPrepaidPhoneAvailableList({ data: { phone: phone } }); | 233 | + // 从表单中获取 salesCode |
234 | + const salesCode = form.getFieldValue('salesCode'); | ||
235 | + let res = await postPrepaidPhoneAvailableList({ | ||
236 | + data: { phone: phone, salesCode: salesCode }, | ||
237 | + }); | ||
234 | if (res && res.result === RESPONSE_CODE.SUCCESS) { | 238 | if (res && res.result === RESPONSE_CODE.SUCCESS) { |
235 | let uidDetails = res.data; | 239 | let uidDetails = res.data; |
236 | for (let detail of uidDetails) { | 240 | for (let detail of uidDetails) { |
@@ -890,9 +894,44 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | @@ -890,9 +894,44 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | ||
890 | if (typeof values.erpCustomerId !== 'string') { | 894 | if (typeof values.erpCustomerId !== 'string') { |
891 | values.erpCustomerId = values.erpCustomerId?.id; | 895 | values.erpCustomerId = values.erpCustomerId?.id; |
892 | } | 896 | } |
893 | - values.province = province; | ||
894 | - values.city = city; | ||
895 | - values.district = district; | 897 | + |
898 | + // Handle the prepaidUid and privatePocket values for API submission | ||
899 | + if ( | ||
900 | + values.paymentMethod === 'WITHHOLDING_ADVANCE_DEPOSIT' && | ||
901 | + values.prepaidUid | ||
902 | + ) { | ||
903 | + console.log('5656原始表单数据:', { | ||
904 | + prepaidUid: values.prepaidUid, | ||
905 | + realPrepaidUid: values.realPrepaidUid, | ||
906 | + privatePocket: values.privatePocket, | ||
907 | + }); | ||
908 | + | ||
909 | + // 从选项值中提取原始UID (不包含索引后缀) | ||
910 | + const prepaidUidParts = values.prepaidUid.split('_'); | ||
911 | + if (prepaidUidParts.length > 0) { | ||
912 | + // 直接使用第一部分作为实际UID值 (不使用realPrepaidUid) | ||
913 | + values.prepaidUid = parseInt(prepaidUidParts[0], 10); | ||
914 | + console.log('5656使用原始UID进行API提交:', values.prepaidUid); | ||
915 | + } | ||
916 | + | ||
917 | + // 确保privatePocket字段被正确设置 | ||
918 | + // 表单中存储的是字符串'true'或'false',需要转换成布尔值 | ||
919 | + if (values.privatePocket === 'true') { | ||
920 | + values.privatePocket = true; | ||
921 | + console.log('设置privatePocket=true用于API提交'); | ||
922 | + } else { | ||
923 | + values.privatePocket = false; | ||
924 | + console.log('设置privatePocket=false用于API提交'); | ||
925 | + } | ||
926 | + | ||
927 | + console.log('最终API提交数据:', { | ||
928 | + prepaidUid: values.prepaidUid, | ||
929 | + privatePocket: values.privatePocket, | ||
930 | + }); | ||
931 | + } | ||
932 | + | ||
933 | + console.log(values, '5656values'); | ||
934 | + | ||
896 | //新增 | 935 | //新增 |
897 | if (optType('add') || optType('copy')) { | 936 | if (optType('add') || optType('copy')) { |
898 | res = await postServiceOrderAddOrder({ data: values }); | 937 | res = await postServiceOrderAddOrder({ data: values }); |
@@ -1709,6 +1748,10 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | @@ -1709,6 +1748,10 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | ||
1709 | rules={[{ required: true, message: '支付方式必填' }]} | 1748 | rules={[{ required: true, message: '支付方式必填' }]} |
1710 | disabled={optType('after-sales-check')} | 1749 | disabled={optType('after-sales-check')} |
1711 | /> | 1750 | /> |
1751 | + {/* 隐藏字段用于存储真实UID和privatePocket标志 */} | ||
1752 | + <ProFormText name="realPrepaidUid" hidden /> | ||
1753 | + <ProFormText name="privatePocket" hidden /> | ||
1754 | + | ||
1712 | <ProFormSelect | 1755 | <ProFormSelect |
1713 | name="prepaidUid" | 1756 | name="prepaidUid" |
1714 | key="prepaidUid" | 1757 | key="prepaidUid" |
@@ -1716,15 +1759,55 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | @@ -1716,15 +1759,55 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | ||
1716 | hidden={paymentMethod !== 'WITHHOLDING_ADVANCE_DEPOSIT'} | 1759 | hidden={paymentMethod !== 'WITHHOLDING_ADVANCE_DEPOSIT'} |
1717 | showSearch | 1760 | showSearch |
1718 | label="预存账号" | 1761 | label="预存账号" |
1719 | - onChange={(value: any) => { | 1762 | + onChange={(value: any, option: any) => { |
1763 | + console.log(value, '5656value'); | ||
1764 | + console.log(option, '5656option'); | ||
1765 | + | ||
1766 | + if (!option) { | ||
1767 | + form.setFieldValue('prepaidUid', undefined); | ||
1768 | + form.setFieldValue('privatePocket', false); | ||
1769 | + return; | ||
1770 | + } | ||
1771 | + | ||
1772 | + // 从选项中获取真实UID和机构信息 | ||
1773 | + const selectedData = option || {}; | ||
1774 | + const realUid = selectedData.uid; | ||
1775 | + const institution = selectedData.institution; | ||
1776 | + | ||
1777 | + console.log('选中账户信息:', { | ||
1778 | + value: value, | ||
1779 | + realUid: realUid, | ||
1780 | + institution: institution, | ||
1781 | + }); | ||
1782 | + | ||
1720 | //检查用户额度 | 1783 | //检查用户额度 |
1721 | let valid = checkAccountMoney( | 1784 | let valid = checkAccountMoney( |
1722 | - value, | 1785 | + realUid, // 使用真实UID检查额度 |
1723 | form.getFieldValue('totalPayment'), | 1786 | form.getFieldValue('totalPayment'), |
1724 | ); | 1787 | ); |
1788 | + | ||
1725 | if (!valid) { | 1789 | if (!valid) { |
1726 | form.setFieldValue('prepaidUid', undefined); | 1790 | form.setFieldValue('prepaidUid', undefined); |
1791 | + form.setFieldValue('privatePocket', false); | ||
1792 | + return; | ||
1727 | } | 1793 | } |
1794 | + | ||
1795 | + // 如果机构是"隐私钱包",则设置privatePocket为true | ||
1796 | + const isPrivacyWallet = institution === '隐私钱包'; | ||
1797 | + | ||
1798 | + // 设置真实UID和privatePocket标志 | ||
1799 | + form.setFieldValue('realPrepaidUid', realUid); | ||
1800 | + // 存储为字符串'true'或'false',这样在表单中能正确保存 | ||
1801 | + form.setFieldValue( | ||
1802 | + 'privatePocket', | ||
1803 | + isPrivacyWallet ? 'true' : 'false', | ||
1804 | + ); | ||
1805 | + | ||
1806 | + console.log('设置表单数据:', { | ||
1807 | + prepaidUid: value, | ||
1808 | + realPrepaidUid: realUid, | ||
1809 | + privatePocket: isPrivacyWallet, | ||
1810 | + }); | ||
1728 | }} | 1811 | }} |
1729 | placeholder="请选择预存账号" | 1812 | placeholder="请选择预存账号" |
1730 | rules={[ | 1813 | rules={[ |
@@ -1770,7 +1853,17 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | @@ -1770,7 +1853,17 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | ||
1770 | // }); | 1853 | // }); |
1771 | // return options; | 1854 | // return options; |
1772 | // }} | 1855 | // }} |
1773 | - options={accountOptions} | 1856 | + options={accountOptions.map((item, index) => ({ |
1857 | + ...item, | ||
1858 | + // Use index to create unique value | ||
1859 | + value: `${item.value}_${index}`, | ||
1860 | + // Store original values as custom attributes | ||
1861 | + data: { | ||
1862 | + uid: item.value, | ||
1863 | + institution: item.institution, | ||
1864 | + index: index, | ||
1865 | + }, | ||
1866 | + }))} | ||
1774 | /> | 1867 | /> |
1775 | <ProFormSelect | 1868 | <ProFormSelect |
1776 | placeholder="选择是否需要开票" | 1869 | placeholder="选择是否需要开票" |
@@ -2244,7 +2337,6 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | @@ -2244,7 +2337,6 @@ export default ({ onClose, data, subOrders, orderOptType }) => { | ||
2244 | name="proxy" | 2337 | name="proxy" |
2245 | label="是否代买代购" | 2338 | label="是否代买代购" |
2246 | //hidden={true} | 2339 | //hidden={true} |
2247 | - initialValue={true} | ||
2248 | options={[ | 2340 | options={[ |
2249 | { | 2341 | { |
2250 | label: '是', | 2342 | label: '是', |
src/pages/Order/OrderList/OrderList.tsx
@@ -1219,8 +1219,8 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | @@ -1219,8 +1219,8 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { | ||
1219 | <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> | 1219 | <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis"> |
1220 | <Tag | 1220 | <Tag |
1221 | color={ | 1221 | color={ |
1222 | - optRecord.invoicingTime === null || | ||
1223 | - optRecord.invoicingTime === undefined | 1222 | + optRecord.afterInvoicingStatus !== 'COMPLETE_INVOICING' && |
1223 | + optRecord.afterInvoicingStatus !== 'PARTIAL_INVOICING' | ||
1224 | ? TAGS_COLOR.get(optRecord.invoicingStatus) | 1224 | ? TAGS_COLOR.get(optRecord.invoicingStatus) |
1225 | : 'success' | 1225 | : 'success' |
1226 | } | 1226 | } |
src/pages/Order/constant.ts
@@ -74,6 +74,7 @@ export const PAYEE_OPTIONS = { | @@ -74,6 +74,7 @@ export const PAYEE_OPTIONS = { | ||
74 | INNOVATION_PUBLIC_ACCOUNT: '东莞科路得创新科技有限公司', | 74 | INNOVATION_PUBLIC_ACCOUNT: '东莞科路得创新科技有限公司', |
75 | JIANTU_PUBLIC_ACCOUNT: '东莞市坚途新材料科技有限公司', | 75 | JIANTU_PUBLIC_ACCOUNT: '东莞市坚途新材料科技有限公司', |
76 | HUIZHOU_JIANTU_PUBLIC_ACCOUNT: '惠州市坚途新材料科技有限公司', | 76 | HUIZHOU_JIANTU_PUBLIC_ACCOUNT: '惠州市坚途新材料科技有限公司', |
77 | + KEYAN_ACCOUNT: '东莞科沿科技有限公司', | ||
77 | HUIZHOU_EXPERIMENT_PUBLIC_ACCOUNT: '惠州市科路得新材料科技有限公司', | 78 | HUIZHOU_EXPERIMENT_PUBLIC_ACCOUNT: '惠州市科路得新材料科技有限公司', |
78 | KNOWLEDGE_PUBLIC_ACCOUNT: '东莞市科路得知识产权代理有限公司', | 79 | KNOWLEDGE_PUBLIC_ACCOUNT: '东莞市科路得知识产权代理有限公司', |
79 | // ZHUGUANG_ACCEPTANCE_DRAFT: '烛光承兑汇票', | 80 | // ZHUGUANG_ACCEPTANCE_DRAFT: '烛光承兑汇票', |
@@ -135,10 +136,10 @@ export const CHECK_TYPE = { | @@ -135,10 +136,10 @@ export const CHECK_TYPE = { | ||
135 | * @param subOrder | 136 | * @param subOrder |
136 | */ | 137 | */ |
137 | export const getNeedInvoicing = (subOrder: any) => { | 138 | export const getNeedInvoicing = (subOrder: any) => { |
138 | - if (subOrder.invoicingTime !== null && subOrder.invoicingTime !== undefined) { | ||
139 | - return '已开票'; | ||
140 | - } | ||
141 | - if (subOrder.afterInvoicingStatus === 'COMPLETE_INVOICING') { | 139 | + if ( |
140 | + subOrder.afterInvoicingStatus === 'COMPLETE_INVOICING' || | ||
141 | + subOrder.afterInvoicingStatus === 'PARTIAL_INVOICING' | ||
142 | + ) { | ||
142 | return '已开票'; | 143 | return '已开票'; |
143 | } | 144 | } |
144 | if (subOrder.afterInvoicingStatus === 'REISSUE') { | 145 | if (subOrder.afterInvoicingStatus === 'REISSUE') { |
src/pages/Prepaid/PrepaidAccount/index.less
0 → 100644
src/pages/Prepaid/PrepaidAccount/index.tsx
0 → 100644
1 | +import EllipsisDiv from '@/components/Div/EllipsisDiv'; | ||
2 | +import { postCanrdApiUserList } from '@/services'; | ||
3 | +import { getUserInfo } from '@/utils/user'; | ||
4 | +import { ActionType, ProTable } from '@ant-design/pro-components'; | ||
5 | +import { Button } from 'antd'; | ||
6 | +import { useRef, useState } from 'react'; | ||
7 | +import BalanceChangeRecordsModal from '../components/BalanceChangeRecordsModal'; | ||
8 | +import PointsExchangeModal from '../components/PointsExchangeModal'; | ||
9 | +import PointsExchangeRecordsModal from '../components/PointsExchangeRecordsModal'; | ||
10 | +import { ACCOUNT_COLUMNS } from '../constant'; | ||
11 | +import './index.less'; | ||
12 | + | ||
13 | +const PrepaidAccountPage = () => { | ||
14 | + const user = getUserInfo(); | ||
15 | + const accountActionRef = useRef<ActionType>(); | ||
16 | + const [currentOptUserObj, setCurrentOptUserObj] = useState(null); | ||
17 | + const [ | ||
18 | + balanceChangeRecordsModalVisible, | ||
19 | + setBalanceChangeRecordsModalVisible, | ||
20 | + ] = useState<boolean>(false); | ||
21 | + const [pointsExchangeModalVisible, setPointsExchangeModalVisible] = | ||
22 | + useState<boolean>(false); | ||
23 | + const [ | ||
24 | + pointsExchangeRecordsModalVisible, | ||
25 | + setPointsExchangeRecordsModalVisible, | ||
26 | + ] = useState<boolean>(false); | ||
27 | + | ||
28 | + const reloadAccountTable = () => { | ||
29 | + accountActionRef.current?.reload(); | ||
30 | + }; | ||
31 | + | ||
32 | + const getTableCellText = (target: any) => { | ||
33 | + if (!target) { | ||
34 | + return ''; | ||
35 | + } | ||
36 | + | ||
37 | + if (target.props) { | ||
38 | + return target.props.text; | ||
39 | + } | ||
40 | + | ||
41 | + return target; | ||
42 | + }; | ||
43 | + | ||
44 | + const accountColumnsInit = () => { | ||
45 | + let columns = ACCOUNT_COLUMNS.map((item) => { | ||
46 | + let newItem = { ...item }; | ||
47 | + let dataIndex = item.dataIndex; | ||
48 | + | ||
49 | + newItem.render = (text, record) => { | ||
50 | + let textValue = record[dataIndex]; | ||
51 | + return <EllipsisDiv text={getTableCellText(textValue)} />; | ||
52 | + }; | ||
53 | + | ||
54 | + return newItem; | ||
55 | + }); | ||
56 | + | ||
57 | + columns.push({ | ||
58 | + title: '操作', | ||
59 | + valueType: 'option', | ||
60 | + key: 'option', | ||
61 | + fixed: 'right', | ||
62 | + width: 240, | ||
63 | + render: (text, record) => { | ||
64 | + let btns = []; | ||
65 | + btns.push( | ||
66 | + <Button | ||
67 | + className="p-0 ml-2" | ||
68 | + key="points" | ||
69 | + type="link" | ||
70 | + onClick={() => { | ||
71 | + setCurrentOptUserObj(record); | ||
72 | + setPointsExchangeModalVisible(true); | ||
73 | + }} | ||
74 | + > | ||
75 | + 积分兑换 | ||
76 | + </Button>, | ||
77 | + ); | ||
78 | + btns.push( | ||
79 | + <Button | ||
80 | + className="p-0" | ||
81 | + key="view" | ||
82 | + type="link" | ||
83 | + onClick={() => { | ||
84 | + setCurrentOptUserObj(record); | ||
85 | + setBalanceChangeRecordsModalVisible(true); | ||
86 | + }} | ||
87 | + > | ||
88 | + 消费记录 | ||
89 | + </Button>, | ||
90 | + ); | ||
91 | + btns.push( | ||
92 | + <Button | ||
93 | + className="p-0 ml-2" | ||
94 | + key="pointsRecords" | ||
95 | + type="link" | ||
96 | + onClick={() => { | ||
97 | + setCurrentOptUserObj(record); | ||
98 | + setPointsExchangeRecordsModalVisible(true); | ||
99 | + }} | ||
100 | + > | ||
101 | + 积分兑换记录 | ||
102 | + </Button>, | ||
103 | + ); | ||
104 | + return btns; | ||
105 | + }, | ||
106 | + }); | ||
107 | + | ||
108 | + return columns; | ||
109 | + }; | ||
110 | + | ||
111 | + return ( | ||
112 | + <div className="prepaid-account"> | ||
113 | + <ProTable | ||
114 | + columns={accountColumnsInit()} | ||
115 | + actionRef={accountActionRef} | ||
116 | + cardBordered | ||
117 | + pagination={{ | ||
118 | + pageSize: 10, | ||
119 | + }} | ||
120 | + request={async (params) => { | ||
121 | + const res = await postCanrdApiUserList({ | ||
122 | + data: { ...params }, | ||
123 | + }); | ||
124 | + const data = res?.data?.data || []; | ||
125 | + const targetPhones = [ | ||
126 | + '18550286106', | ||
127 | + '15286038815', | ||
128 | + '15202597163', | ||
129 | + '13267086260', | ||
130 | + '15900392469', | ||
131 | + '13529047645', | ||
132 | + ]; | ||
133 | + | ||
134 | + const processedData = data.map((item) => { | ||
135 | + const isAdmin = user.roles.includes('ADMIN'); | ||
136 | + const isSalesManager = user.roles.includes('SALES_MANAGER'); | ||
137 | + if ( | ||
138 | + targetPhones.includes(item.phone) && | ||
139 | + !(isAdmin || isSalesManager) | ||
140 | + ) { | ||
141 | + return { | ||
142 | + ...item, | ||
143 | + nowMoney: '****', | ||
144 | + }; | ||
145 | + } | ||
146 | + return item; | ||
147 | + }); | ||
148 | + return { | ||
149 | + data: processedData, | ||
150 | + total: res?.data?.total || 0, | ||
151 | + }; | ||
152 | + }} | ||
153 | + columnsState={{ | ||
154 | + persistenceKey: 'pro-table-singe-account', | ||
155 | + persistenceType: 'localStorage', | ||
156 | + defaultValue: { | ||
157 | + option: { fixed: 'right', disable: true }, | ||
158 | + }, | ||
159 | + onChange(value) { | ||
160 | + console.log('value: ', value); | ||
161 | + }, | ||
162 | + }} | ||
163 | + rowKey="id" | ||
164 | + search={{ | ||
165 | + labelWidth: 'auto', | ||
166 | + }} | ||
167 | + options={{ | ||
168 | + setting: { | ||
169 | + listsHeight: 400, | ||
170 | + }, | ||
171 | + }} | ||
172 | + form={{}} | ||
173 | + dateFormatter="string" | ||
174 | + headerTitle="账号列表" | ||
175 | + scroll={{ x: 1400 }} | ||
176 | + toolBarRender={() => []} | ||
177 | + /> | ||
178 | + | ||
179 | + {balanceChangeRecordsModalVisible && ( | ||
180 | + <BalanceChangeRecordsModal | ||
181 | + setVisible={setBalanceChangeRecordsModalVisible} | ||
182 | + userInfoObj={currentOptUserObj} | ||
183 | + onClose={() => { | ||
184 | + setBalanceChangeRecordsModalVisible(false); | ||
185 | + reloadAccountTable(); | ||
186 | + }} | ||
187 | + /> | ||
188 | + )} | ||
189 | + | ||
190 | + {pointsExchangeModalVisible && ( | ||
191 | + <PointsExchangeModal | ||
192 | + setVisible={setPointsExchangeModalVisible} | ||
193 | + userInfoObj={ | ||
194 | + currentOptUserObj | ||
195 | + ? { ...currentOptUserObj, relationEntityType: 'USER' } | ||
196 | + : { uid: '', relationEntityType: 'USER' } | ||
197 | + } | ||
198 | + onClose={() => { | ||
199 | + setPointsExchangeModalVisible(false); | ||
200 | + reloadAccountTable(); | ||
201 | + }} | ||
202 | + /> | ||
203 | + )} | ||
204 | + | ||
205 | + {pointsExchangeRecordsModalVisible && ( | ||
206 | + <PointsExchangeRecordsModal | ||
207 | + setVisible={setPointsExchangeRecordsModalVisible} | ||
208 | + userInfoObj={ | ||
209 | + currentOptUserObj | ||
210 | + ? { ...currentOptUserObj, relationEntityType: 'USER' } | ||
211 | + : { uid: '', relationEntityType: 'USER' } | ||
212 | + } | ||
213 | + onClose={() => { | ||
214 | + setPointsExchangeRecordsModalVisible(false); | ||
215 | + }} | ||
216 | + /> | ||
217 | + )} | ||
218 | + </div> | ||
219 | + ); | ||
220 | +}; | ||
221 | + | ||
222 | +export default PrepaidAccountPage; |
src/pages/Prepaid/PrepaidRecharge/index.less
0 → 100644
src/pages/Prepaid/PrepaidRecharge/index.tsx
0 → 100644
1 | +import ButtonConfirm from '@/components/ButtomConfirm'; | ||
2 | +import EllipsisDiv from '@/components/Div/EllipsisDiv'; | ||
3 | +import { RESPONSE_CODE } from '@/constants/enum'; | ||
4 | +import { postPrepaidDelete, postPrepaidList } from '@/services'; | ||
5 | +import { enumValueToLabel, formatDateTime } from '@/utils'; | ||
6 | +import { PlusOutlined } from '@ant-design/icons'; | ||
7 | +import { ActionType, ProTable } from '@ant-design/pro-components'; | ||
8 | +import { Button, Divider, Image, message } from 'antd'; | ||
9 | +import { cloneDeep } from 'lodash'; | ||
10 | +import React, { useRef, useState } from 'react'; | ||
11 | +import CheckModal from '../../Order/Order/components/CheckModal'; | ||
12 | +import { CHECK_TYPE } from '../../Order/constant'; | ||
13 | +import RechargePrepaymentModal from '../components/RechargePrepaymentModal'; | ||
14 | +import { | ||
15 | + PREPAID_STATUS_OPTIONS, | ||
16 | + SALES_RECHARGE_PREPAYMENT_COLUMNS, | ||
17 | +} from '../constant'; | ||
18 | +import './index.less'; | ||
19 | + | ||
20 | +const PrepaidRechargePage = () => { | ||
21 | + const prepaidActionRef = useRef<ActionType>(); | ||
22 | + const [rechargePrepaymentModalVisible, setRechargePrepaymentModalVisible] = | ||
23 | + useState<boolean>(false); | ||
24 | + const [currentOptPrepaymentObj, setCurrentOptPrepaymentObj] = useState(null); | ||
25 | + const [checkVisible, setCheckVisible] = useState<boolean>(false); | ||
26 | + | ||
27 | + const reloadPrepaidTable = () => { | ||
28 | + prepaidActionRef.current?.reload(); | ||
29 | + }; | ||
30 | + | ||
31 | + /** | ||
32 | + * 加载预存充值表格的各个列格式 | ||
33 | + */ | ||
34 | + const prepaidColumnsInit = () => { | ||
35 | + let columns = SALES_RECHARGE_PREPAYMENT_COLUMNS.map((item) => { | ||
36 | + let newItem = { ...item }; | ||
37 | + let dataIndex = item.dataIndex; | ||
38 | + | ||
39 | + newItem.render = (text, record) => { | ||
40 | + let textValue = record[dataIndex]; | ||
41 | + | ||
42 | + if (dataIndex === 'status') { | ||
43 | + textValue = enumValueToLabel(textValue, PREPAID_STATUS_OPTIONS); | ||
44 | + } | ||
45 | + | ||
46 | + if (dataIndex.endsWith('Time')) { | ||
47 | + textValue = formatDateTime(textValue); | ||
48 | + } | ||
49 | + | ||
50 | + if ( | ||
51 | + dataIndex === 'proofImages' && | ||
52 | + textValue !== null && | ||
53 | + textValue !== undefined | ||
54 | + ) { | ||
55 | + return ( | ||
56 | + <Image.PreviewGroup | ||
57 | + className="mr-10" | ||
58 | + preview={{ | ||
59 | + onChange: (current, prev) => | ||
60 | + console.log(`current index: ${current}, prev index: ${prev}`), | ||
61 | + }} | ||
62 | + > | ||
63 | + {textValue.map((item, index) => ( | ||
64 | + <React.Fragment key={index}> | ||
65 | + {index > 0 ? <Divider type="vertical" /> : ''} | ||
66 | + <Image | ||
67 | + className="max-h-[35px] max-w-[45px]" | ||
68 | + src={item} | ||
69 | + title={item} | ||
70 | + />{' '} | ||
71 | + </React.Fragment> | ||
72 | + ))} | ||
73 | + </Image.PreviewGroup> | ||
74 | + ); | ||
75 | + } | ||
76 | + | ||
77 | + return <EllipsisDiv text={textValue} />; | ||
78 | + }; | ||
79 | + | ||
80 | + return newItem; | ||
81 | + }); | ||
82 | + | ||
83 | + columns.push({ | ||
84 | + title: '操作', | ||
85 | + valueType: 'option', | ||
86 | + key: 'option', | ||
87 | + fixed: 'right', | ||
88 | + width: 120, | ||
89 | + render: (text, record) => { | ||
90 | + let btns = []; | ||
91 | + let opts = record.operations; | ||
92 | + if (opts?.includes('modify')) { | ||
93 | + btns.push( | ||
94 | + <Button | ||
95 | + className="p-0" | ||
96 | + key="modify" | ||
97 | + type="link" | ||
98 | + onClick={() => { | ||
99 | + setRechargePrepaymentModalVisible(true); | ||
100 | + setCurrentOptPrepaymentObj(cloneDeep(record)); | ||
101 | + }} | ||
102 | + > | ||
103 | + 编辑 | ||
104 | + </Button>, | ||
105 | + ); | ||
106 | + } | ||
107 | + | ||
108 | + if (opts?.includes('audit')) { | ||
109 | + btns.push( | ||
110 | + <Button | ||
111 | + className="p-0" | ||
112 | + key="view" | ||
113 | + type="link" | ||
114 | + onClick={() => { | ||
115 | + setCurrentOptPrepaymentObj(record); | ||
116 | + setCheckVisible(true); | ||
117 | + }} | ||
118 | + > | ||
119 | + 审核 | ||
120 | + </Button>, | ||
121 | + ); | ||
122 | + } | ||
123 | + | ||
124 | + if (opts?.includes('delete')) { | ||
125 | + btns.push( | ||
126 | + <ButtonConfirm | ||
127 | + key="delete" | ||
128 | + className="p-0" | ||
129 | + title={'确认删除这条预存记录吗?'} | ||
130 | + text="删除" | ||
131 | + onConfirm={async () => { | ||
132 | + let res = await postPrepaidDelete({ | ||
133 | + data: { ids: [record.id] }, | ||
134 | + }); | ||
135 | + if (res && res.result === RESPONSE_CODE.SUCCESS) { | ||
136 | + message.success(res.message); | ||
137 | + reloadPrepaidTable(); | ||
138 | + } | ||
139 | + }} | ||
140 | + />, | ||
141 | + ); | ||
142 | + } | ||
143 | + return btns; | ||
144 | + }, | ||
145 | + }); | ||
146 | + | ||
147 | + return columns; | ||
148 | + }; | ||
149 | + | ||
150 | + return ( | ||
151 | + <div className="prepaid-recharge"> | ||
152 | + <ProTable | ||
153 | + columns={prepaidColumnsInit()} | ||
154 | + actionRef={prepaidActionRef} | ||
155 | + cardBordered | ||
156 | + pagination={{ | ||
157 | + pageSize: 10, | ||
158 | + }} | ||
159 | + request={async (params) => { | ||
160 | + const res = await postPrepaidList({ | ||
161 | + data: { ...params }, | ||
162 | + }); | ||
163 | + return { | ||
164 | + data: res?.data?.data || [], | ||
165 | + total: res?.data?.total || 0, | ||
166 | + }; | ||
167 | + }} | ||
168 | + columnsState={{ | ||
169 | + persistenceKey: 'pro-table-singe-prepaid', | ||
170 | + persistenceType: 'localStorage', | ||
171 | + defaultValue: { | ||
172 | + option: { fixed: 'right', disable: true }, | ||
173 | + }, | ||
174 | + onChange(value) { | ||
175 | + console.log('value: ', value); | ||
176 | + }, | ||
177 | + }} | ||
178 | + rowKey="id" | ||
179 | + search={{ | ||
180 | + labelWidth: 'auto', | ||
181 | + }} | ||
182 | + options={{ | ||
183 | + setting: { | ||
184 | + listsHeight: 400, | ||
185 | + }, | ||
186 | + }} | ||
187 | + form={{}} | ||
188 | + dateFormatter="string" | ||
189 | + headerTitle="预存充值" | ||
190 | + scroll={{ x: 1400 }} | ||
191 | + toolBarRender={() => [ | ||
192 | + <Button | ||
193 | + key="button" | ||
194 | + icon={<PlusOutlined />} | ||
195 | + onClick={() => { | ||
196 | + setCurrentOptPrepaymentObj(null); | ||
197 | + setRechargePrepaymentModalVisible(true); | ||
198 | + }} | ||
199 | + type="primary" | ||
200 | + > | ||
201 | + 新增充值 | ||
202 | + </Button>, | ||
203 | + ]} | ||
204 | + /> | ||
205 | + | ||
206 | + {rechargePrepaymentModalVisible && ( | ||
207 | + <RechargePrepaymentModal | ||
208 | + setVisible={setRechargePrepaymentModalVisible} | ||
209 | + prepaymentObject={currentOptPrepaymentObj} | ||
210 | + onClose={() => { | ||
211 | + setRechargePrepaymentModalVisible(false); | ||
212 | + reloadPrepaidTable(); | ||
213 | + }} | ||
214 | + /> | ||
215 | + )} | ||
216 | + | ||
217 | + {checkVisible && ( | ||
218 | + <CheckModal | ||
219 | + setCheckVisible={setCheckVisible} | ||
220 | + data={currentOptPrepaymentObj} | ||
221 | + subOrders={[]} | ||
222 | + orderCheckType={CHECK_TYPE.PREPAID_AUDIT} | ||
223 | + openOrderDrawer={null} | ||
224 | + onClose={() => { | ||
225 | + setCheckVisible(false); | ||
226 | + reloadPrepaidTable(); | ||
227 | + }} | ||
228 | + /> | ||
229 | + )} | ||
230 | + </div> | ||
231 | + ); | ||
232 | +}; | ||
233 | + | ||
234 | +export default PrepaidRechargePage; |
src/pages/Prepaid/PrivatePocket/components/AddPrivatePocketModal.tsx
0 → 100644
1 | +import { | ||
2 | + postCanrdPrivatePocketSave, | ||
3 | + postServiceOrderQuerySalesCode, | ||
4 | +} from '@/services'; | ||
5 | +import { getUserInfo } from '@/utils/user'; | ||
6 | +import { Form, Input, Modal, Select, message } from 'antd'; | ||
7 | +import React, { useEffect, useState } from 'react'; | ||
8 | + | ||
9 | +interface AddPrivatePocketModalProps { | ||
10 | + visible: boolean; | ||
11 | + onCancel: () => void; | ||
12 | + onSuccess: () => void; | ||
13 | +} | ||
14 | + | ||
15 | +interface SalesCodeItem { | ||
16 | + number: string | null; | ||
17 | + userName: string; | ||
18 | +} | ||
19 | + | ||
20 | +const AddPrivatePocketModal: React.FC<AddPrivatePocketModalProps> = ({ | ||
21 | + visible, | ||
22 | + onCancel, | ||
23 | + onSuccess, | ||
24 | +}) => { | ||
25 | + const [form] = Form.useForm(); | ||
26 | + const [salesCodeList, setSalesCodeList] = useState<SalesCodeItem[]>([]); | ||
27 | + const [loading, setLoading] = useState<boolean>(false); | ||
28 | + const userInfo = getUserInfo(); | ||
29 | + const userName = userInfo?.username || ''; | ||
30 | + | ||
31 | + const fetchSalesCodeList = async () => { | ||
32 | + try { | ||
33 | + const res = await postServiceOrderQuerySalesCode(); | ||
34 | + if (res?.data) { | ||
35 | + setSalesCodeList(res.data); | ||
36 | + } | ||
37 | + } catch (error) { | ||
38 | + console.error('获取销售编码列表失败:', error); | ||
39 | + message.error('获取销售编码列表失败'); | ||
40 | + } | ||
41 | + }; | ||
42 | + | ||
43 | + useEffect(() => { | ||
44 | + if (visible) { | ||
45 | + fetchSalesCodeList(); | ||
46 | + form.resetFields(); | ||
47 | + } | ||
48 | + }, [visible, form]); | ||
49 | + | ||
50 | + const handleSubmit = async () => { | ||
51 | + try { | ||
52 | + const values = await form.validateFields(); | ||
53 | + setLoading(true); | ||
54 | + | ||
55 | + const res = await postCanrdPrivatePocketSave({ | ||
56 | + data: { | ||
57 | + account: values.account, | ||
58 | + salesCode: values.salesCode, | ||
59 | + createByName: userName, | ||
60 | + }, | ||
61 | + }); | ||
62 | + | ||
63 | + if (res?.result === 0 || res?.code === 200 || res?.success) { | ||
64 | + message.success('添加隐私钱包成功'); | ||
65 | + onSuccess(); | ||
66 | + } else { | ||
67 | + message.error(res?.message || '添加失败'); | ||
68 | + } | ||
69 | + } catch (error) { | ||
70 | + console.error('添加隐私钱包失败:', error); | ||
71 | + } finally { | ||
72 | + setLoading(false); | ||
73 | + } | ||
74 | + }; | ||
75 | + | ||
76 | + return ( | ||
77 | + <Modal | ||
78 | + title="添加隐私钱包" | ||
79 | + open={visible} | ||
80 | + onCancel={onCancel} | ||
81 | + onOk={handleSubmit} | ||
82 | + confirmLoading={loading} | ||
83 | + destroyOnClose | ||
84 | + > | ||
85 | + <Form form={form} layout="vertical"> | ||
86 | + <Form.Item | ||
87 | + name="account" | ||
88 | + label="绑定普通账户" | ||
89 | + rules={[{ required: true, message: '请输入手机号' }]} | ||
90 | + > | ||
91 | + <Input placeholder="请输入手机号" /> | ||
92 | + </Form.Item> | ||
93 | + <Form.Item | ||
94 | + name="salesCode" | ||
95 | + label="负责销售" | ||
96 | + rules={[{ required: true, message: '请选择负责销售' }]} | ||
97 | + > | ||
98 | + <Select | ||
99 | + placeholder="请选择负责销售" | ||
100 | + showSearch | ||
101 | + optionFilterProp="children" | ||
102 | + filterOption={(input, option) => | ||
103 | + (option?.label?.toString() || '') | ||
104 | + .toLowerCase() | ||
105 | + .includes(input.toLowerCase()) | ||
106 | + } | ||
107 | + options={salesCodeList.map((item) => ({ | ||
108 | + value: item.userName, | ||
109 | + label: item.userName, | ||
110 | + }))} | ||
111 | + /> | ||
112 | + </Form.Item> | ||
113 | + </Form> | ||
114 | + </Modal> | ||
115 | + ); | ||
116 | +}; | ||
117 | + | ||
118 | +export default AddPrivatePocketModal; |
src/pages/Prepaid/PrivatePocket/constant.tsx
0 → 100644
1 | +export const PRIVATE_POCKET_COLUMNS = [ | ||
2 | + { | ||
3 | + title: '用户ID', | ||
4 | + dataIndex: 'uid', | ||
5 | + key: 'uid', | ||
6 | + valueType: 'text', | ||
7 | + hideInTable: true, | ||
8 | + hideInSearch: true, | ||
9 | + }, | ||
10 | + { | ||
11 | + title: '用户账号', | ||
12 | + dataIndex: 'account', | ||
13 | + key: 'account', | ||
14 | + valueType: 'text', | ||
15 | + fieldProps: { | ||
16 | + placeholder: '请输入用户账号', | ||
17 | + }, | ||
18 | + }, | ||
19 | + { | ||
20 | + title: '真实姓名', | ||
21 | + dataIndex: 'realName', | ||
22 | + key: 'realName', | ||
23 | + valueType: 'text', | ||
24 | + hideInSearch: true, | ||
25 | + }, | ||
26 | + { | ||
27 | + title: '用户余额', | ||
28 | + dataIndex: 'nowMoney', | ||
29 | + key: 'nowMoney', | ||
30 | + valueType: 'money', | ||
31 | + hideInSearch: true, | ||
32 | + }, | ||
33 | + { | ||
34 | + title: '隐私余额', | ||
35 | + dataIndex: 'privateMoney', | ||
36 | + key: 'privateMoney', | ||
37 | + valueType: 'money', | ||
38 | + hideInSearch: true, | ||
39 | + }, | ||
40 | + { | ||
41 | + title: '负责销售', | ||
42 | + dataIndex: 'salesCode', | ||
43 | + key: 'salesCode', | ||
44 | + valueType: 'text', | ||
45 | + fieldProps: { | ||
46 | + placeholder: '请输入负责销售', | ||
47 | + }, | ||
48 | + }, | ||
49 | + { | ||
50 | + title: '创建人', | ||
51 | + dataIndex: 'createByName', | ||
52 | + key: 'createByName', | ||
53 | + valueType: 'text', | ||
54 | + hideInSearch: true, | ||
55 | + }, | ||
56 | + { | ||
57 | + title: '创建时间', | ||
58 | + dataIndex: 'createTime', | ||
59 | + key: 'createTime', | ||
60 | + valueType: 'dateTime', | ||
61 | + hideInSearch: true, | ||
62 | + }, | ||
63 | + // { | ||
64 | + // title: '更新时间', | ||
65 | + // dataIndex: 'updateTime', | ||
66 | + // key: 'updateTime', | ||
67 | + // valueType: 'dateTime', | ||
68 | + // hideInSearch: true, | ||
69 | + // }, | ||
70 | +]; |
src/pages/Prepaid/PrivatePocket/index.less
0 → 100644
src/pages/Prepaid/PrivatePocket/index.tsx
0 → 100644
1 | +import ButtonConfirm from '@/components/ButtomConfirm'; | ||
2 | +import EllipsisDiv from '@/components/Div/EllipsisDiv'; | ||
3 | +import { RESPONSE_CODE } from '@/constants/enum'; | ||
4 | +import { | ||
5 | + postCanrdPrivatePocketDelete, | ||
6 | + postCanrdPrivatePocketList, | ||
7 | +} from '@/services'; | ||
8 | +import { formatDateTime } from '@/utils'; | ||
9 | +import { ActionType, ProTable } from '@ant-design/pro-components'; | ||
10 | +import { Button, message } from 'antd'; | ||
11 | +import { useRef, useState } from 'react'; | ||
12 | +import AddPrivatePocketModal from './components/AddPrivatePocketModal'; | ||
13 | +import { PRIVATE_POCKET_COLUMNS } from './constant'; | ||
14 | +import './index.less'; | ||
15 | + | ||
16 | +const PrivatePocketPage = () => { | ||
17 | + const actionRef = useRef<ActionType>(); | ||
18 | + const [addModalVisible, setAddModalVisible] = useState<boolean>(false); | ||
19 | + | ||
20 | + const reloadTable = () => { | ||
21 | + actionRef.current?.reload(); | ||
22 | + }; | ||
23 | + | ||
24 | + const getTableCellText = (target: any) => { | ||
25 | + if (!target) { | ||
26 | + return ''; | ||
27 | + } | ||
28 | + | ||
29 | + if (target.props) { | ||
30 | + return target.props.text; | ||
31 | + } | ||
32 | + | ||
33 | + return target; | ||
34 | + }; | ||
35 | + | ||
36 | + const columnsInit = () => { | ||
37 | + let columns = PRIVATE_POCKET_COLUMNS.map((item) => { | ||
38 | + let newItem = { ...item }; | ||
39 | + let dataIndex = item.dataIndex; | ||
40 | + | ||
41 | + newItem.render = (text: any, record: any) => { | ||
42 | + let textValue = record[dataIndex]; | ||
43 | + | ||
44 | + if (dataIndex.endsWith('Time')) { | ||
45 | + textValue = formatDateTime(textValue); | ||
46 | + } | ||
47 | + | ||
48 | + return <EllipsisDiv text={getTableCellText(textValue)} />; | ||
49 | + }; | ||
50 | + | ||
51 | + return newItem; | ||
52 | + }); | ||
53 | + | ||
54 | + columns.push({ | ||
55 | + title: '操作', | ||
56 | + valueType: 'option', | ||
57 | + key: 'option', | ||
58 | + width: 120, | ||
59 | + render: (text: any, record: any) => { | ||
60 | + let btns = []; | ||
61 | + | ||
62 | + btns.push( | ||
63 | + <ButtonConfirm | ||
64 | + key="delete" | ||
65 | + className="p-0" | ||
66 | + title={'确认删除这条隐私钱包记录吗?'} | ||
67 | + text="删除" | ||
68 | + onConfirm={async () => { | ||
69 | + let res = await postCanrdPrivatePocketDelete({ | ||
70 | + data: { uid: record.uid }, | ||
71 | + }); | ||
72 | + if (res && res.result === RESPONSE_CODE.SUCCESS) { | ||
73 | + message.success('删除成功'); | ||
74 | + reloadTable(); | ||
75 | + } | ||
76 | + }} | ||
77 | + />, | ||
78 | + ); | ||
79 | + | ||
80 | + return btns; | ||
81 | + }, | ||
82 | + }); | ||
83 | + | ||
84 | + return columns; | ||
85 | + }; | ||
86 | + | ||
87 | + return ( | ||
88 | + <div className="private-pocket-index"> | ||
89 | + <ProTable | ||
90 | + columns={columnsInit()} | ||
91 | + actionRef={actionRef} | ||
92 | + cardBordered | ||
93 | + pagination={{ | ||
94 | + pageSize: 10, | ||
95 | + }} | ||
96 | + request={async (params) => { | ||
97 | + const res = await postCanrdPrivatePocketList({ | ||
98 | + data: { ...params }, | ||
99 | + }); | ||
100 | + const list = res?.data?.data || []; | ||
101 | + return { | ||
102 | + data: list, | ||
103 | + success: true, | ||
104 | + total: res?.data?.total || 0, | ||
105 | + }; | ||
106 | + }} | ||
107 | + columnsState={{ | ||
108 | + persistenceKey: 'pro-table-private-pocket', | ||
109 | + persistenceType: 'localStorage', | ||
110 | + defaultValue: { | ||
111 | + option: { fixed: 'right', disable: true }, | ||
112 | + }, | ||
113 | + onChange(value) { | ||
114 | + console.log('value: ', value); | ||
115 | + }, | ||
116 | + }} | ||
117 | + rowKey="uid" | ||
118 | + search={{ | ||
119 | + labelWidth: 'auto', | ||
120 | + }} | ||
121 | + options={{ | ||
122 | + setting: { | ||
123 | + listsHeight: 400, | ||
124 | + }, | ||
125 | + }} | ||
126 | + form={{}} | ||
127 | + dateFormatter="string" | ||
128 | + headerTitle="隐私钱包" | ||
129 | + scroll={{ x: 1400 }} | ||
130 | + toolBarRender={() => [ | ||
131 | + <Button | ||
132 | + key="add" | ||
133 | + type="primary" | ||
134 | + onClick={() => setAddModalVisible(true)} | ||
135 | + > | ||
136 | + 添加 | ||
137 | + </Button>, | ||
138 | + ]} | ||
139 | + /> | ||
140 | + | ||
141 | + {addModalVisible && ( | ||
142 | + <AddPrivatePocketModal | ||
143 | + visible={addModalVisible} | ||
144 | + onCancel={() => setAddModalVisible(false)} | ||
145 | + onSuccess={() => { | ||
146 | + setAddModalVisible(false); | ||
147 | + reloadTable(); | ||
148 | + }} | ||
149 | + /> | ||
150 | + )} | ||
151 | + </div> | ||
152 | + ); | ||
153 | +}; | ||
154 | + | ||
155 | +export default PrivatePocketPage; |
src/pages/Prepaid/components/RechargePrepaymentModal.tsx
@@ -30,8 +30,10 @@ export default ({ setVisible, prepaymentObject, onClose }) => { | @@ -30,8 +30,10 @@ export default ({ setVisible, prepaymentObject, onClose }) => { | ||
30 | salesCode: string; | 30 | salesCode: string; |
31 | rechargeAmount: number; | 31 | rechargeAmount: number; |
32 | notes: string; | 32 | notes: string; |
33 | + rechargeType: string; // 充值类型 | ||
33 | }>(); | 34 | }>(); |
34 | const [salesCodeOptions, setSalesCodeOptions] = useState([]); | 35 | const [salesCodeOptions, setSalesCodeOptions] = useState([]); |
36 | + const [setRechargeType] = useState<string>('normal'); // 默认普通充值 | ||
35 | const [isCreate, setIsCreate] = useState(true); | 37 | const [isCreate, setIsCreate] = useState(true); |
36 | const [fileList, setFileList] = useState<UploadFile[]>([]); | 38 | const [fileList, setFileList] = useState<UploadFile[]>([]); |
37 | const [previewOpen, setPreviewOpen] = useState(false); | 39 | const [previewOpen, setPreviewOpen] = useState(false); |
@@ -243,7 +245,8 @@ export default ({ setVisible, prepaymentObject, onClose }) => { | @@ -243,7 +245,8 @@ export default ({ setVisible, prepaymentObject, onClose }) => { | ||
243 | }, | 245 | }, |
244 | }} | 246 | }} |
245 | onFinish={async (values) => { | 247 | onFinish={async (values) => { |
246 | - if (fileList.length <= 0) { | 248 | + // 隐私钱包充值不需要凭证 |
249 | + if (values.rechargeType !== 'privatePocket' && fileList.length <= 0) { | ||
247 | message.error('凭证不能为空'); | 250 | message.error('凭证不能为空'); |
248 | return; | 251 | return; |
249 | } | 252 | } |
@@ -278,6 +281,12 @@ export default ({ setVisible, prepaymentObject, onClose }) => { | @@ -278,6 +281,12 @@ export default ({ setVisible, prepaymentObject, onClose }) => { | ||
278 | } | 281 | } |
279 | } | 282 | } |
280 | } | 283 | } |
284 | + // 所有充值类型都传递rechargeType参数 | ||
285 | + // 如果是隐私钱包充值且不需要凭证,直接创建空凭证数组 | ||
286 | + if (values.rechargeType === 'privatePocket' && fileList.length <= 0) { | ||
287 | + values.proofImages = []; | ||
288 | + } | ||
289 | + // 普通充值流程 | ||
281 | let res = await postServiceOrderFileProcess({ | 290 | let res = await postServiceOrderFileProcess({ |
282 | data: formData, | 291 | data: formData, |
283 | }); | 292 | }); |
@@ -302,6 +311,8 @@ export default ({ setVisible, prepaymentObject, onClose }) => { | @@ -302,6 +311,8 @@ export default ({ setVisible, prepaymentObject, onClose }) => { | ||
302 | data: { | 311 | data: { |
303 | ...values, | 312 | ...values, |
304 | customerName: form.getFieldValue('customerNameString'), | 313 | customerName: form.getFieldValue('customerNameString'), |
314 | + // 传递充值类型参数 | ||
315 | + rechargeType: values.rechargeType || 'normal', | ||
305 | }, | 316 | }, |
306 | }); | 317 | }); |
307 | } else { | 318 | } else { |
@@ -312,7 +323,11 @@ export default ({ setVisible, prepaymentObject, onClose }) => { | @@ -312,7 +323,11 @@ export default ({ setVisible, prepaymentObject, onClose }) => { | ||
312 | body.customerName = customerNameString; | 323 | body.customerName = customerNameString; |
313 | } | 324 | } |
314 | res = await postPrepaidUpdate({ | 325 | res = await postPrepaidUpdate({ |
315 | - data: body, | 326 | + data: { |
327 | + ...body, | ||
328 | + // 传递充值类型参数 | ||
329 | + rechargeType: values.rechargeType || 'normal', | ||
330 | + }, | ||
316 | }); | 331 | }); |
317 | } | 332 | } |
318 | 333 | ||
@@ -416,6 +431,21 @@ export default ({ setVisible, prepaymentObject, onClose }) => { | @@ -416,6 +431,21 @@ export default ({ setVisible, prepaymentObject, onClose }) => { | ||
416 | rules={[{ required: true, message: '销售代表必填' }]} | 431 | rules={[{ required: true, message: '销售代表必填' }]} |
417 | options={salesCodeOptions} | 432 | options={salesCodeOptions} |
418 | /> | 433 | /> |
434 | + <ProFormSelect | ||
435 | + name="rechargeType" | ||
436 | + label="充值类型" | ||
437 | + initialValue="normal" | ||
438 | + valueEnum={{ | ||
439 | + normal: '普通充值', | ||
440 | + privatePocket: '隐私钱包充值', | ||
441 | + }} | ||
442 | + fieldProps={{ | ||
443 | + onChange: (value) => { | ||
444 | + setRechargeType(value); | ||
445 | + }, | ||
446 | + }} | ||
447 | + rules={[{ required: true, message: '请选择充值类型' }]} | ||
448 | + /> | ||
419 | <ProFormDigit | 449 | <ProFormDigit |
420 | name="rechargeAmount" | 450 | name="rechargeAmount" |
421 | label="充值金额(¥)" | 451 | label="充值金额(¥)" |
src/pages/Prepaid/index.less
1 | -.prepaid-index td { | ||
2 | - font-family: 'San Francisco', 'Helvetica Neue', Helvetica, Arial, | ||
3 | - 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'Heiti SC', | ||
4 | - 'WenQuanYi Micro Hei', sans-serif; | ||
5 | - font-size: 13px; | 1 | +.prepaid-index { |
2 | + width: 100%; | ||
3 | + padding: 24px; | ||
4 | + | ||
5 | + .prepaid-card { | ||
6 | + height: 180px; | ||
7 | + transition: all 0.3s; | ||
8 | + | ||
9 | + &:hover { | ||
10 | + transform: translateY(-5px); | ||
11 | + box-shadow: 0 5px 15px rgba(0, 0, 0, 10%); | ||
12 | + } | ||
13 | + | ||
14 | + .card-content { | ||
15 | + display: flex; | ||
16 | + flex-direction: column; | ||
17 | + align-items: center; | ||
18 | + justify-content: center; | ||
19 | + height: 100%; | ||
20 | + | ||
21 | + .card-icon { | ||
22 | + font-size: 36px; | ||
23 | + margin-bottom: 16px; | ||
24 | + color: #1890ff; | ||
25 | + } | ||
26 | + | ||
27 | + .card-title { | ||
28 | + font-size: 18px; | ||
29 | + font-weight: 500; | ||
30 | + margin-bottom: 12px; | ||
31 | + } | ||
32 | + | ||
33 | + .card-desc { | ||
34 | + color: rgba(0, 0, 0, 45%); | ||
35 | + text-align: center; | ||
36 | + padding: 0 12px; | ||
37 | + } | ||
38 | + } | ||
39 | + } | ||
40 | + | ||
41 | + td { | ||
42 | + font-family: 'San Francisco', 'Helvetica Neue', Helvetica, Arial, | ||
43 | + 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'Heiti SC', | ||
44 | + 'WenQuanYi Micro Hei', sans-serif; | ||
45 | + font-size: 13px; | ||
46 | + } | ||
6 | } | 47 | } |
src/pages/Prepaid/index.tsx
1 | -import ButtonConfirm from '@/components/ButtomConfirm'; | ||
2 | -import EllipsisDiv from '@/components/Div/EllipsisDiv'; | ||
3 | -import { RESPONSE_CODE } from '@/constants/enum'; | ||
4 | -import {} from '@/pages/Invoice/constant'; | ||
5 | import { | 1 | import { |
6 | - postCanrdApiUserList, | ||
7 | - postPrepaidDelete, | ||
8 | - postPrepaidList, | ||
9 | -} from '@/services'; | ||
10 | -import { enumValueToLabel, formatDateTime } from '@/utils'; | ||
11 | -import { getUserInfo } from '@/utils/user'; | ||
12 | -import { PlusOutlined } from '@ant-design/icons'; | ||
13 | -import { ActionType, ProTable } from '@ant-design/pro-components'; | ||
14 | -import { Button, Divider, Image, Tabs, message } from 'antd'; | ||
15 | -import { cloneDeep } from 'lodash'; | ||
16 | -import React, { useRef, useState } from 'react'; | ||
17 | -import CheckModal from '../Order/Order/components/CheckModal'; | ||
18 | -import { CHECK_TYPE } from '../Order/constant'; | ||
19 | -import BalanceChangeRecordsModal from './components/BalanceChangeRecordsModal'; | ||
20 | -import PointsExchangeModal from './components/PointsExchangeModal'; | ||
21 | -import PointsExchangeRecordsModal from './components/PointsExchangeRecordsModal'; | ||
22 | -import RechargePrepaymentModal from './components/RechargePrepaymentModal'; | ||
23 | -import { | ||
24 | - ACCOUNT_COLUMNS, | ||
25 | - PREPAID_STATUS_OPTIONS, | ||
26 | - SALES_RECHARGE_PREPAYMENT_COLUMNS, | ||
27 | -} from './constant'; | 2 | + CreditCardOutlined, |
3 | + MoneyCollectOutlined, | ||
4 | + UserOutlined, | ||
5 | +} from '@ant-design/icons'; | ||
6 | +import { Card, Col, Row } from 'antd'; | ||
7 | +import { history } from 'umi'; | ||
28 | import './index.less'; | 8 | import './index.less'; |
29 | 9 | ||
30 | const PrepaidPage = () => { | 10 | const PrepaidPage = () => { |
31 | - const user = getUserInfo(); | ||
32 | - const prepaidActionRef = useRef<ActionType>(); | ||
33 | - const accountActionRef = useRef<ActionType>(); | ||
34 | - const [rechargePrepaymentModalVisible, setRechargePrepaymentModalVisible] = | ||
35 | - useState<boolean>(false); | ||
36 | - const [currentOptPrepaymentObj, setCurrentOptPrepaymentObj] = useState(null); | ||
37 | - const [currentOptUserObj, setCurrentOptUserObj] = useState(null); | ||
38 | - const [checkVisible, setCheckVisible] = useState<boolean>(false); | ||
39 | - const [ | ||
40 | - balanceChangeRecordsModalVisible, | ||
41 | - setBalanceChangeRecordsModalVisible, | ||
42 | - ] = useState<boolean>(false); | ||
43 | - const [pointsExchangeModalVisible, setPointsExchangeModalVisible] = | ||
44 | - useState<boolean>(false); | ||
45 | - const [ | ||
46 | - pointsExchangeRecordsModalVisible, | ||
47 | - setPointsExchangeRecordsModalVisible, | ||
48 | - ] = useState<boolean>(false); | ||
49 | - | ||
50 | - const reloadPrepaidTable = () => { | ||
51 | - prepaidActionRef.current?.reload(); | ||
52 | - }; | ||
53 | - | ||
54 | - const reloadAccountTable = () => { | ||
55 | - accountActionRef.current?.reload(); | ||
56 | - }; | ||
57 | - | ||
58 | - const getTableCellText = (target: any) => { | ||
59 | - if (!target) { | ||
60 | - return ''; | ||
61 | - } | ||
62 | - | ||
63 | - if (target.props) { | ||
64 | - return target.props.text; | ||
65 | - } | ||
66 | - | ||
67 | - return target; | ||
68 | - }; | ||
69 | - | ||
70 | - /** | ||
71 | - * 加载发票列表表格的各个列格式 | ||
72 | - */ | ||
73 | - const prepaidColumnsInit = () => { | ||
74 | - let columns = SALES_RECHARGE_PREPAYMENT_COLUMNS.map((item) => { | ||
75 | - let newItem = { ...item }; | ||
76 | - let dataIndex = item.dataIndex; | ||
77 | - | ||
78 | - newItem.render = (text, record) => { | ||
79 | - let textValue = record[dataIndex]; | ||
80 | - | ||
81 | - if (dataIndex === 'status') { | ||
82 | - textValue = enumValueToLabel(textValue, PREPAID_STATUS_OPTIONS); | ||
83 | - } | ||
84 | - | ||
85 | - if (dataIndex.endsWith('Time')) { | ||
86 | - textValue = formatDateTime(textValue); | ||
87 | - } | ||
88 | - | ||
89 | - if ( | ||
90 | - dataIndex === 'proofImages' && | ||
91 | - textValue !== null && | ||
92 | - textValue !== undefined | ||
93 | - ) { | ||
94 | - console.log(textValue); | ||
95 | - return ( | ||
96 | - <Image.PreviewGroup | ||
97 | - className="mr-10" | ||
98 | - preview={{ | ||
99 | - onChange: (current, prev) => | ||
100 | - console.log(`current index: ${current}, prev index: ${prev}`), | ||
101 | - }} | ||
102 | - > | ||
103 | - {textValue.map((item, index) => ( | ||
104 | - <React.Fragment key={index}> | ||
105 | - {index > 0 ? <Divider type="vertical" /> : ''} | ||
106 | - <Image | ||
107 | - className="max-h-[35px] max-w-[45px]" | ||
108 | - src={item} | ||
109 | - title={item} | ||
110 | - />{' '} | ||
111 | - </React.Fragment> | ||
112 | - ))} | ||
113 | - </Image.PreviewGroup> | ||
114 | - ); | ||
115 | - } | ||
116 | - | ||
117 | - return <EllipsisDiv text={textValue} />; | ||
118 | - }; | ||
119 | - | ||
120 | - return newItem; | ||
121 | - }); | ||
122 | - | ||
123 | - columns.push({ | ||
124 | - title: '操作', | ||
125 | - valueType: 'option', | ||
126 | - key: 'option', | ||
127 | - fixed: 'right', | ||
128 | - width: 120, | ||
129 | - render: (text, record) => { | ||
130 | - let btns = []; | ||
131 | - let opts = record.operations; | ||
132 | - if (opts?.includes('modify')) { | ||
133 | - btns.push( | ||
134 | - <Button | ||
135 | - className="p-0" | ||
136 | - key="modify" | ||
137 | - type="link" | ||
138 | - onClick={() => { | ||
139 | - setRechargePrepaymentModalVisible(true); | ||
140 | - setCurrentOptPrepaymentObj(cloneDeep(record)); | ||
141 | - }} | ||
142 | - > | ||
143 | - 编辑 | ||
144 | - </Button>, | ||
145 | - ); | ||
146 | - } | ||
147 | - | ||
148 | - if (opts?.includes('audit')) { | ||
149 | - btns.push( | ||
150 | - <Button | ||
151 | - className="p-0" | ||
152 | - key="view" | ||
153 | - type="link" | ||
154 | - onClick={() => { | ||
155 | - setCurrentOptPrepaymentObj(record); | ||
156 | - setCheckVisible(true); | ||
157 | - }} | ||
158 | - > | ||
159 | - 审核 | ||
160 | - </Button>, | ||
161 | - ); | ||
162 | - } | ||
163 | - | ||
164 | - if (opts?.includes('delete')) { | ||
165 | - btns.push( | ||
166 | - <ButtonConfirm | ||
167 | - key="delete" | ||
168 | - className="p-0" | ||
169 | - title={'确认删除这条预存记录吗?'} | ||
170 | - text="删除" | ||
171 | - onConfirm={async () => { | ||
172 | - let res = await postPrepaidDelete({ | ||
173 | - data: { ids: [record.id] }, | ||
174 | - }); | ||
175 | - if (res && res.result === RESPONSE_CODE.SUCCESS) { | ||
176 | - message.success(res.message); | ||
177 | - reloadPrepaidTable(); | ||
178 | - } | ||
179 | - }} | ||
180 | - />, | ||
181 | - ); | ||
182 | - } | ||
183 | - return btns; | ||
184 | - }, | ||
185 | - }); | ||
186 | - | ||
187 | - return columns; | 11 | + const handleCardClick = (path: string) => { |
12 | + history.push(path); | ||
188 | }; | 13 | }; |
189 | 14 | ||
190 | - const accountColumnsInit = () => { | ||
191 | - let columns = ACCOUNT_COLUMNS.map((item) => { | ||
192 | - let newItem = { ...item }; | ||
193 | - let dataIndex = item.dataIndex; | ||
194 | - | ||
195 | - newItem.render = (text, record) => { | ||
196 | - let textValue = record[dataIndex]; | ||
197 | - return <EllipsisDiv text={getTableCellText(textValue)} />; | ||
198 | - }; | ||
199 | - | ||
200 | - return newItem; | ||
201 | - }); | ||
202 | - | ||
203 | - columns.push({ | ||
204 | - title: '操作', | ||
205 | - valueType: 'option', | ||
206 | - key: 'option', | ||
207 | - fixed: 'right', | ||
208 | - width: 240, | ||
209 | - render: (text, record) => { | ||
210 | - let btns = []; | ||
211 | - btns.push( | ||
212 | - <Button | ||
213 | - className="p-0 ml-2" | ||
214 | - key="points" | ||
215 | - type="link" | ||
216 | - onClick={() => { | ||
217 | - setCurrentOptUserObj(record); | ||
218 | - setPointsExchangeModalVisible(true); | ||
219 | - }} | 15 | + return ( |
16 | + <div className="prepaid-index"> | ||
17 | + <Row gutter={16}> | ||
18 | + <Col span={8}> | ||
19 | + <Card | ||
20 | + hoverable | ||
21 | + className="prepaid-card" | ||
22 | + onClick={() => handleCardClick('/prepaid/recharge')} | ||
220 | > | 23 | > |
221 | - 积分兑换 | ||
222 | - </Button>, | ||
223 | - ); | ||
224 | - btns.push( | ||
225 | - <Button | ||
226 | - className="p-0" | ||
227 | - key="view" | ||
228 | - type="link" | ||
229 | - onClick={() => { | ||
230 | - setCurrentOptUserObj(record); | ||
231 | - setBalanceChangeRecordsModalVisible(true); | ||
232 | - }} | 24 | + <div className="card-content"> |
25 | + <CreditCardOutlined className="card-icon" /> | ||
26 | + <div className="card-title">预存充值</div> | ||
27 | + <div className="card-desc">管理预存充值记录、审核及编辑操作</div> | ||
28 | + </div> | ||
29 | + </Card> | ||
30 | + </Col> | ||
31 | + <Col span={8}> | ||
32 | + <Card | ||
33 | + hoverable | ||
34 | + className="prepaid-card" | ||
35 | + onClick={() => handleCardClick('/prepaid/account')} | ||
233 | > | 36 | > |
234 | - 消费记录 | ||
235 | - </Button>, | ||
236 | - ); | ||
237 | - btns.push( | ||
238 | - <Button | ||
239 | - className="p-0 ml-2" | ||
240 | - key="pointsRecords" | ||
241 | - type="link" | ||
242 | - onClick={() => { | ||
243 | - setCurrentOptUserObj(record); | ||
244 | - setPointsExchangeRecordsModalVisible(true); | ||
245 | - }} | 37 | + <div className="card-content"> |
38 | + <UserOutlined className="card-icon" /> | ||
39 | + <div className="card-title">账号列表</div> | ||
40 | + <div className="card-desc">查看账户信息、积分兑换及消费记录</div> | ||
41 | + </div> | ||
42 | + </Card> | ||
43 | + </Col> | ||
44 | + <Col span={8}> | ||
45 | + <Card | ||
46 | + hoverable | ||
47 | + className="prepaid-card" | ||
48 | + onClick={() => handleCardClick('/prepaid/privatePocket')} | ||
246 | > | 49 | > |
247 | - 积分兑换记录 | ||
248 | - </Button>, | ||
249 | - ); | ||
250 | - return btns; | ||
251 | - }, | ||
252 | - }); | ||
253 | - | ||
254 | - return columns; | ||
255 | - }; | ||
256 | - | ||
257 | - const tabsItems = [ | ||
258 | - { | ||
259 | - key: 1, | ||
260 | - label: '预存充值', | ||
261 | - children: ( | ||
262 | - <ProTable | ||
263 | - columns={prepaidColumnsInit()} | ||
264 | - actionRef={prepaidActionRef} | ||
265 | - cardBordered | ||
266 | - pagination={{ | ||
267 | - pageSize: 10, | ||
268 | - }} | ||
269 | - request={async (params) => { | ||
270 | - const res = await postPrepaidList({ | ||
271 | - data: { ...params }, | ||
272 | - }); | ||
273 | - return { | ||
274 | - data: res?.data?.data || [], | ||
275 | - total: res?.data?.total || 0, | ||
276 | - }; | ||
277 | - }} | ||
278 | - columnsState={{ | ||
279 | - persistenceKey: 'pro-table-singe-prepaid', | ||
280 | - persistenceType: 'localStorage', | ||
281 | - defaultValue: { | ||
282 | - option: { fixed: 'right', disable: true }, | ||
283 | - }, | ||
284 | - onChange(value) { | ||
285 | - console.log('value: ', value); | ||
286 | - }, | ||
287 | - }} | ||
288 | - rowKey="id" | ||
289 | - search={{ | ||
290 | - labelWidth: 'auto', | ||
291 | - }} | ||
292 | - options={{ | ||
293 | - setting: { | ||
294 | - listsHeight: 400, | ||
295 | - }, | ||
296 | - }} | ||
297 | - form={{}} | ||
298 | - dateFormatter="string" | ||
299 | - headerTitle="预存充值" | ||
300 | - scroll={{ x: 1400 }} | ||
301 | - toolBarRender={() => [ | ||
302 | - <Button | ||
303 | - key="button" | ||
304 | - icon={<PlusOutlined />} | ||
305 | - onClick={() => { | ||
306 | - setCurrentOptPrepaymentObj(null); | ||
307 | - setRechargePrepaymentModalVisible(true); | ||
308 | - }} | ||
309 | - type="primary" | ||
310 | - > | ||
311 | - 新增充值 | ||
312 | - </Button>, | ||
313 | - ]} | ||
314 | - /> | ||
315 | - ), | ||
316 | - }, | ||
317 | - { | ||
318 | - key: 2, | ||
319 | - label: '账号列表', | ||
320 | - children: ( | ||
321 | - <ProTable | ||
322 | - columns={accountColumnsInit()} | ||
323 | - actionRef={accountActionRef} | ||
324 | - cardBordered | ||
325 | - pagination={{ | ||
326 | - pageSize: 10, | ||
327 | - }} | ||
328 | - request={async (params) => { | ||
329 | - const res = await postCanrdApiUserList({ | ||
330 | - data: { ...params }, | ||
331 | - }); | ||
332 | - const data = res?.data?.data || []; | ||
333 | - const targetPhones = [ | ||
334 | - '18550286106', | ||
335 | - '15286038815', | ||
336 | - '15202597163', | ||
337 | - '13267086260', | ||
338 | - '15900392469', | ||
339 | - '13529047645', | ||
340 | - ]; | ||
341 | - | ||
342 | - const processedData = data.map((item) => { | ||
343 | - const isAdmin = user.roles.includes('ADMIN'); | ||
344 | - const isSalesManager = user.roles.includes('SALES_MANAGER'); | ||
345 | - if ( | ||
346 | - targetPhones.includes(item.phone) && | ||
347 | - !(isAdmin || isSalesManager) | ||
348 | - ) { | ||
349 | - return { | ||
350 | - ...item, | ||
351 | - nowMoney: '****', | ||
352 | - }; | ||
353 | - } | ||
354 | - return item; | ||
355 | - }); | ||
356 | - return { | ||
357 | - data: processedData, | ||
358 | - total: res?.data?.total || 0, | ||
359 | - }; | ||
360 | - }} | ||
361 | - columnsState={{ | ||
362 | - persistenceKey: 'pro-table-singe-account', | ||
363 | - persistenceType: 'localStorage', | ||
364 | - defaultValue: { | ||
365 | - option: { fixed: 'right', disable: true }, | ||
366 | - }, | ||
367 | - onChange(value) { | ||
368 | - console.log('value: ', value); | ||
369 | - }, | ||
370 | - }} | ||
371 | - rowKey="id" | ||
372 | - search={{ | ||
373 | - labelWidth: 'auto', | ||
374 | - }} | ||
375 | - options={{ | ||
376 | - setting: { | ||
377 | - listsHeight: 400, | ||
378 | - }, | ||
379 | - }} | ||
380 | - form={{}} | ||
381 | - dateFormatter="string" | ||
382 | - headerTitle="账号列表" | ||
383 | - scroll={{ x: 1400 }} | ||
384 | - toolBarRender={() => []} | ||
385 | - /> | ||
386 | - ), | ||
387 | - }, | ||
388 | - ]; | ||
389 | - return ( | ||
390 | - <div className="prepaid-index"> | ||
391 | - <Tabs | ||
392 | - defaultActiveKey="1" | ||
393 | - items={tabsItems} | ||
394 | - onChange={(value) => { | ||
395 | - if (value === '1') { | ||
396 | - reloadPrepaidTable(); | ||
397 | - } else { | ||
398 | - reloadAccountTable(); | ||
399 | - } | ||
400 | - }} | ||
401 | - /> | ||
402 | - | ||
403 | - {rechargePrepaymentModalVisible && ( | ||
404 | - <RechargePrepaymentModal | ||
405 | - setVisible={setRechargePrepaymentModalVisible} | ||
406 | - onClose={() => { | ||
407 | - setRechargePrepaymentModalVisible(false); | ||
408 | - reloadPrepaidTable(); | ||
409 | - }} | ||
410 | - prepaymentObject={currentOptPrepaymentObj} | ||
411 | - /> | ||
412 | - )} | ||
413 | - | ||
414 | - {checkVisible && ( | ||
415 | - <CheckModal | ||
416 | - setCheckVisible={(val: boolean) => { | ||
417 | - setCheckVisible(val); | ||
418 | - }} | ||
419 | - data={[currentOptPrepaymentObj]} | ||
420 | - subOrders={[currentOptPrepaymentObj]} | ||
421 | - orderCheckType={CHECK_TYPE.PREPAID_AUDIT} | ||
422 | - openOrderDrawer={false} | ||
423 | - onClose={() => { | ||
424 | - setCheckVisible(false); | ||
425 | - reloadPrepaidTable(); | ||
426 | - }} | ||
427 | - /> | ||
428 | - )} | ||
429 | - | ||
430 | - {balanceChangeRecordsModalVisible && ( | ||
431 | - <BalanceChangeRecordsModal | ||
432 | - setVisible={(val: boolean) => { | ||
433 | - setBalanceChangeRecordsModalVisible(val); | ||
434 | - }} | ||
435 | - userInfoObj={currentOptUserObj} | ||
436 | - onClose={() => { | ||
437 | - setBalanceChangeRecordsModalVisible(false); | ||
438 | - }} | ||
439 | - /> | ||
440 | - )} | ||
441 | - | ||
442 | - {pointsExchangeModalVisible && currentOptUserObj && ( | ||
443 | - <PointsExchangeModal | ||
444 | - setVisible={(val: boolean) => { | ||
445 | - setPointsExchangeModalVisible(val); | ||
446 | - }} | ||
447 | - userInfoObj={currentOptUserObj} | ||
448 | - onClose={() => { | ||
449 | - setPointsExchangeModalVisible(false); | ||
450 | - reloadAccountTable(); | ||
451 | - }} | ||
452 | - /> | ||
453 | - )} | ||
454 | - | ||
455 | - {pointsExchangeRecordsModalVisible && currentOptUserObj && ( | ||
456 | - <PointsExchangeRecordsModal | ||
457 | - setVisible={(val: boolean) => { | ||
458 | - setPointsExchangeRecordsModalVisible(val); | ||
459 | - }} | ||
460 | - userInfoObj={currentOptUserObj} | ||
461 | - onClose={() => { | ||
462 | - setPointsExchangeRecordsModalVisible(false); | ||
463 | - }} | ||
464 | - /> | ||
465 | - )} | 50 | + <div className="card-content"> |
51 | + <MoneyCollectOutlined className="card-icon" /> | ||
52 | + <div className="card-title">隐私钱包</div> | ||
53 | + <div className="card-desc">管理用户隐私钱包信息</div> | ||
54 | + </div> | ||
55 | + </Card> | ||
56 | + </Col> | ||
57 | + </Row> | ||
466 | </div> | 58 | </div> |
467 | ); | 59 | ); |
468 | }; | 60 | }; |
src/services/definition.ts
@@ -4849,6 +4849,136 @@ export interface UserNowMoneyCheckRequest { | @@ -4849,6 +4849,136 @@ export interface UserNowMoneyCheckRequest { | ||
4849 | uid?: number; | 4849 | uid?: number; |
4850 | } | 4850 | } |
4851 | 4851 | ||
4852 | +export interface UserPrivatePocketBalanceUpdateRequest { | ||
4853 | + /** | ||
4854 | + * @description | ||
4855 | + * 用户账号 | ||
4856 | + */ | ||
4857 | + account: string; | ||
4858 | + /** | ||
4859 | + * @description | ||
4860 | + * 创建人 | ||
4861 | + */ | ||
4862 | + createByName?: string; | ||
4863 | + /** | ||
4864 | + * @description | ||
4865 | + * 用户余额 | ||
4866 | + */ | ||
4867 | + nowMoney?: number; | ||
4868 | + /** | ||
4869 | + * @description | ||
4870 | + * 隐私余额 | ||
4871 | + */ | ||
4872 | + privateMoney?: number; | ||
4873 | + /** | ||
4874 | + * @description | ||
4875 | + * 真实姓名 | ||
4876 | + */ | ||
4877 | + realName?: string; | ||
4878 | + /** | ||
4879 | + * @description | ||
4880 | + * 负责销售 | ||
4881 | + */ | ||
4882 | + salesCode: string; | ||
4883 | + /** | ||
4884 | + * @description | ||
4885 | + * 用户id | ||
4886 | + * @format int32 | ||
4887 | + */ | ||
4888 | + uid?: number; | ||
4889 | +} | ||
4890 | + | ||
4891 | +export interface UserPrivatePocketDeleteRequest { | ||
4892 | + /** | ||
4893 | + * @description | ||
4894 | + * 用户id | ||
4895 | + * @format int32 | ||
4896 | + */ | ||
4897 | + uid: number; | ||
4898 | +} | ||
4899 | + | ||
4900 | +export interface UserPrivatePocketDetailRequest { | ||
4901 | + /** | ||
4902 | + * @description | ||
4903 | + * 用户id | ||
4904 | + * @format int32 | ||
4905 | + */ | ||
4906 | + uid: number; | ||
4907 | +} | ||
4908 | + | ||
4909 | +export interface UserPrivatePocketListRequest { | ||
4910 | + /** | ||
4911 | + * @description | ||
4912 | + * 用户账号 | ||
4913 | + */ | ||
4914 | + account?: string; | ||
4915 | + /** | ||
4916 | + * @description | ||
4917 | + * 当前页 | ||
4918 | + * @format int32 | ||
4919 | + * @example | ||
4920 | + * 1 | ||
4921 | + */ | ||
4922 | + current?: number; | ||
4923 | + /** | ||
4924 | + * @description | ||
4925 | + * 每页大小 | ||
4926 | + * @format int32 | ||
4927 | + * @example | ||
4928 | + * 10 | ||
4929 | + */ | ||
4930 | + pageSize?: number; | ||
4931 | + /** | ||
4932 | + * @description | ||
4933 | + * 真实姓名 | ||
4934 | + */ | ||
4935 | + realName?: string; | ||
4936 | + /** | ||
4937 | + * @description | ||
4938 | + * 负责销售 | ||
4939 | + */ | ||
4940 | + salesCode?: string; | ||
4941 | +} | ||
4942 | + | ||
4943 | +export interface UserPrivatePocketUpdateRequest { | ||
4944 | + /** | ||
4945 | + * @description | ||
4946 | + * 用户账号 | ||
4947 | + */ | ||
4948 | + account: string; | ||
4949 | + /** | ||
4950 | + * @description | ||
4951 | + * 创建人 | ||
4952 | + */ | ||
4953 | + createByName?: string; | ||
4954 | + /** | ||
4955 | + * @description | ||
4956 | + * 用户余额 | ||
4957 | + */ | ||
4958 | + nowMoney?: number; | ||
4959 | + /** | ||
4960 | + * @description | ||
4961 | + * 隐私余额 | ||
4962 | + */ | ||
4963 | + privateMoney?: number; | ||
4964 | + /** | ||
4965 | + * @description | ||
4966 | + * 真实姓名 | ||
4967 | + */ | ||
4968 | + realName?: string; | ||
4969 | + /** | ||
4970 | + * @description | ||
4971 | + * 负责销售 | ||
4972 | + */ | ||
4973 | + salesCode: string; | ||
4974 | + /** | ||
4975 | + * @description | ||
4976 | + * 用户id | ||
4977 | + * @format int32 | ||
4978 | + */ | ||
4979 | + uid?: number; | ||
4980 | +} | ||
4981 | + | ||
4852 | export interface View { | 4982 | export interface View { |
4853 | contentType?: string; | 4983 | contentType?: string; |
4854 | } | 4984 | } |
@@ -5471,6 +5601,11 @@ export interface SalesRechargePrepaymentAuditRequest { | @@ -5471,6 +5601,11 @@ export interface SalesRechargePrepaymentAuditRequest { | ||
5471 | * 手机号 | 5601 | * 手机号 |
5472 | */ | 5602 | */ |
5473 | phone?: string; | 5603 | phone?: string; |
5604 | + /** | ||
5605 | + * @description | ||
5606 | + * 销售代表编码 | ||
5607 | + */ | ||
5608 | + salescode?: string; | ||
5474 | } | 5609 | } |
5475 | 5610 | ||
5476 | export interface SalesRechargePrepaymentCreateRequest { | 5611 | export interface SalesRechargePrepaymentCreateRequest { |
@@ -5511,6 +5646,13 @@ export interface SalesRechargePrepaymentCreateRequest { | @@ -5511,6 +5646,13 @@ export interface SalesRechargePrepaymentCreateRequest { | ||
5511 | rechargeSource?: string; | 5646 | rechargeSource?: string; |
5512 | /** | 5647 | /** |
5513 | * @description | 5648 | * @description |
5649 | + * 充值类型 | ||
5650 | + * @example | ||
5651 | + * normal | ||
5652 | + */ | ||
5653 | + rechargeType?: string; | ||
5654 | + /** | ||
5655 | + * @description | ||
5514 | * 销售代表 | 5656 | * 销售代表 |
5515 | */ | 5657 | */ |
5516 | salesCode?: string; | 5658 | salesCode?: string; |
src/services/request.ts
@@ -168,6 +168,11 @@ import type { | @@ -168,6 +168,11 @@ import type { | ||
168 | UserDetailRequest, | 168 | UserDetailRequest, |
169 | UserListRequest, | 169 | UserListRequest, |
170 | UserNowMoneyCheckRequest, | 170 | UserNowMoneyCheckRequest, |
171 | + UserPrivatePocketBalanceUpdateRequest, | ||
172 | + UserPrivatePocketDeleteRequest, | ||
173 | + UserPrivatePocketDetailRequest, | ||
174 | + UserPrivatePocketListRequest, | ||
175 | + UserPrivatePocketUpdateRequest, | ||
171 | WarningOrderWhiteListDto, | 176 | WarningOrderWhiteListDto, |
172 | WarningUserWhiteListDto, | 177 | WarningUserWhiteListDto, |
173 | } from './definition'; | 178 | } from './definition'; |
@@ -3142,6 +3147,361 @@ export const postCanrdApiUserNowMoneyCheck = /* #__PURE__ */ (() => { | @@ -3142,6 +3147,361 @@ export const postCanrdApiUserNowMoneyCheck = /* #__PURE__ */ (() => { | ||
3142 | return request; | 3147 | return request; |
3143 | })(); | 3148 | })(); |
3144 | 3149 | ||
3150 | +/** @description request parameter type for postCanrdPrivatePocketDelete */ | ||
3151 | +export interface PostCanrdPrivatePocketDeleteOption { | ||
3152 | + /** | ||
3153 | + * @description | ||
3154 | + * request | ||
3155 | + */ | ||
3156 | + body: { | ||
3157 | + /** | ||
3158 | + @description | ||
3159 | + request */ | ||
3160 | + request: UserPrivatePocketDeleteRequest; | ||
3161 | + }; | ||
3162 | +} | ||
3163 | + | ||
3164 | +/** @description response type for postCanrdPrivatePocketDelete */ | ||
3165 | +export interface PostCanrdPrivatePocketDeleteResponse { | ||
3166 | + /** | ||
3167 | + * @description | ||
3168 | + * OK | ||
3169 | + */ | ||
3170 | + 200: ServerResult; | ||
3171 | + /** | ||
3172 | + * @description | ||
3173 | + * Created | ||
3174 | + */ | ||
3175 | + 201: any; | ||
3176 | + /** | ||
3177 | + * @description | ||
3178 | + * Unauthorized | ||
3179 | + */ | ||
3180 | + 401: any; | ||
3181 | + /** | ||
3182 | + * @description | ||
3183 | + * Forbidden | ||
3184 | + */ | ||
3185 | + 403: any; | ||
3186 | + /** | ||
3187 | + * @description | ||
3188 | + * Not Found | ||
3189 | + */ | ||
3190 | + 404: any; | ||
3191 | +} | ||
3192 | + | ||
3193 | +export type PostCanrdPrivatePocketDeleteResponseSuccess = | ||
3194 | + PostCanrdPrivatePocketDeleteResponse[200]; | ||
3195 | +/** | ||
3196 | + * @description | ||
3197 | + * 删除用户隐私钱包 | ||
3198 | + * @tags user-private-pocket-controller | ||
3199 | + * @produces * | ||
3200 | + * @consumes application/json | ||
3201 | + */ | ||
3202 | +export const postCanrdPrivatePocketDelete = /* #__PURE__ */ (() => { | ||
3203 | + const method = 'post'; | ||
3204 | + const url = '/canrd/privatePocket/delete'; | ||
3205 | + function request( | ||
3206 | + option: PostCanrdPrivatePocketDeleteOption, | ||
3207 | + ): Promise<PostCanrdPrivatePocketDeleteResponseSuccess> { | ||
3208 | + return requester(request.url, { | ||
3209 | + method: request.method, | ||
3210 | + ...option, | ||
3211 | + }) as unknown as Promise<PostCanrdPrivatePocketDeleteResponseSuccess>; | ||
3212 | + } | ||
3213 | + | ||
3214 | + /** http method */ | ||
3215 | + request.method = method; | ||
3216 | + /** request url */ | ||
3217 | + request.url = url; | ||
3218 | + return request; | ||
3219 | +})(); | ||
3220 | + | ||
3221 | +/** @description request parameter type for postCanrdPrivatePocketDetail */ | ||
3222 | +export interface PostCanrdPrivatePocketDetailOption { | ||
3223 | + /** | ||
3224 | + * @description | ||
3225 | + * request | ||
3226 | + */ | ||
3227 | + body: { | ||
3228 | + /** | ||
3229 | + @description | ||
3230 | + request */ | ||
3231 | + request: UserPrivatePocketDetailRequest; | ||
3232 | + }; | ||
3233 | +} | ||
3234 | + | ||
3235 | +/** @description response type for postCanrdPrivatePocketDetail */ | ||
3236 | +export interface PostCanrdPrivatePocketDetailResponse { | ||
3237 | + /** | ||
3238 | + * @description | ||
3239 | + * OK | ||
3240 | + */ | ||
3241 | + 200: ServerResult; | ||
3242 | + /** | ||
3243 | + * @description | ||
3244 | + * Created | ||
3245 | + */ | ||
3246 | + 201: any; | ||
3247 | + /** | ||
3248 | + * @description | ||
3249 | + * Unauthorized | ||
3250 | + */ | ||
3251 | + 401: any; | ||
3252 | + /** | ||
3253 | + * @description | ||
3254 | + * Forbidden | ||
3255 | + */ | ||
3256 | + 403: any; | ||
3257 | + /** | ||
3258 | + * @description | ||
3259 | + * Not Found | ||
3260 | + */ | ||
3261 | + 404: any; | ||
3262 | +} | ||
3263 | + | ||
3264 | +export type PostCanrdPrivatePocketDetailResponseSuccess = | ||
3265 | + PostCanrdPrivatePocketDetailResponse[200]; | ||
3266 | +/** | ||
3267 | + * @description | ||
3268 | + * 获取用户隐私钱包详情 | ||
3269 | + * @tags user-private-pocket-controller | ||
3270 | + * @produces * | ||
3271 | + * @consumes application/json | ||
3272 | + */ | ||
3273 | +export const postCanrdPrivatePocketDetail = /* #__PURE__ */ (() => { | ||
3274 | + const method = 'post'; | ||
3275 | + const url = '/canrd/privatePocket/detail'; | ||
3276 | + function request( | ||
3277 | + option: PostCanrdPrivatePocketDetailOption, | ||
3278 | + ): Promise<PostCanrdPrivatePocketDetailResponseSuccess> { | ||
3279 | + return requester(request.url, { | ||
3280 | + method: request.method, | ||
3281 | + ...option, | ||
3282 | + }) as unknown as Promise<PostCanrdPrivatePocketDetailResponseSuccess>; | ||
3283 | + } | ||
3284 | + | ||
3285 | + /** http method */ | ||
3286 | + request.method = method; | ||
3287 | + /** request url */ | ||
3288 | + request.url = url; | ||
3289 | + return request; | ||
3290 | +})(); | ||
3291 | + | ||
3292 | +/** @description request parameter type for postCanrdPrivatePocketList */ | ||
3293 | +export interface PostCanrdPrivatePocketListOption { | ||
3294 | + /** | ||
3295 | + * @description | ||
3296 | + * request | ||
3297 | + */ | ||
3298 | + body: { | ||
3299 | + /** | ||
3300 | + @description | ||
3301 | + request */ | ||
3302 | + request: UserPrivatePocketListRequest; | ||
3303 | + }; | ||
3304 | +} | ||
3305 | + | ||
3306 | +/** @description response type for postCanrdPrivatePocketList */ | ||
3307 | +export interface PostCanrdPrivatePocketListResponse { | ||
3308 | + /** | ||
3309 | + * @description | ||
3310 | + * OK | ||
3311 | + */ | ||
3312 | + 200: ServerResult; | ||
3313 | + /** | ||
3314 | + * @description | ||
3315 | + * Created | ||
3316 | + */ | ||
3317 | + 201: any; | ||
3318 | + /** | ||
3319 | + * @description | ||
3320 | + * Unauthorized | ||
3321 | + */ | ||
3322 | + 401: any; | ||
3323 | + /** | ||
3324 | + * @description | ||
3325 | + * Forbidden | ||
3326 | + */ | ||
3327 | + 403: any; | ||
3328 | + /** | ||
3329 | + * @description | ||
3330 | + * Not Found | ||
3331 | + */ | ||
3332 | + 404: any; | ||
3333 | +} | ||
3334 | + | ||
3335 | +export type PostCanrdPrivatePocketListResponseSuccess = | ||
3336 | + PostCanrdPrivatePocketListResponse[200]; | ||
3337 | +/** | ||
3338 | + * @description | ||
3339 | + * 获取用户隐私钱包列表 | ||
3340 | + * @tags user-private-pocket-controller | ||
3341 | + * @produces * | ||
3342 | + * @consumes application/json | ||
3343 | + */ | ||
3344 | +export const postCanrdPrivatePocketList = /* #__PURE__ */ (() => { | ||
3345 | + const method = 'post'; | ||
3346 | + const url = '/canrd/privatePocket/list'; | ||
3347 | + function request( | ||
3348 | + option: PostCanrdPrivatePocketListOption, | ||
3349 | + ): Promise<PostCanrdPrivatePocketListResponseSuccess> { | ||
3350 | + return requester(request.url, { | ||
3351 | + method: request.method, | ||
3352 | + ...option, | ||
3353 | + }) as unknown as Promise<PostCanrdPrivatePocketListResponseSuccess>; | ||
3354 | + } | ||
3355 | + | ||
3356 | + /** http method */ | ||
3357 | + request.method = method; | ||
3358 | + /** request url */ | ||
3359 | + request.url = url; | ||
3360 | + return request; | ||
3361 | +})(); | ||
3362 | + | ||
3363 | +/** @description request parameter type for postCanrdPrivatePocketSave */ | ||
3364 | +export interface PostCanrdPrivatePocketSaveOption { | ||
3365 | + /** | ||
3366 | + * @description | ||
3367 | + * request | ||
3368 | + */ | ||
3369 | + body: { | ||
3370 | + /** | ||
3371 | + @description | ||
3372 | + request */ | ||
3373 | + request: UserPrivatePocketUpdateRequest; | ||
3374 | + }; | ||
3375 | +} | ||
3376 | + | ||
3377 | +/** @description response type for postCanrdPrivatePocketSave */ | ||
3378 | +export interface PostCanrdPrivatePocketSaveResponse { | ||
3379 | + /** | ||
3380 | + * @description | ||
3381 | + * OK | ||
3382 | + */ | ||
3383 | + 200: ServerResult; | ||
3384 | + /** | ||
3385 | + * @description | ||
3386 | + * Created | ||
3387 | + */ | ||
3388 | + 201: any; | ||
3389 | + /** | ||
3390 | + * @description | ||
3391 | + * Unauthorized | ||
3392 | + */ | ||
3393 | + 401: any; | ||
3394 | + /** | ||
3395 | + * @description | ||
3396 | + * Forbidden | ||
3397 | + */ | ||
3398 | + 403: any; | ||
3399 | + /** | ||
3400 | + * @description | ||
3401 | + * Not Found | ||
3402 | + */ | ||
3403 | + 404: any; | ||
3404 | +} | ||
3405 | + | ||
3406 | +export type PostCanrdPrivatePocketSaveResponseSuccess = | ||
3407 | + PostCanrdPrivatePocketSaveResponse[200]; | ||
3408 | +/** | ||
3409 | + * @description | ||
3410 | + * 保存或更新用户隐私钱包 | ||
3411 | + * @tags user-private-pocket-controller | ||
3412 | + * @produces * | ||
3413 | + * @consumes application/json | ||
3414 | + */ | ||
3415 | +export const postCanrdPrivatePocketSave = /* #__PURE__ */ (() => { | ||
3416 | + const method = 'post'; | ||
3417 | + const url = '/canrd/privatePocket/save'; | ||
3418 | + function request( | ||
3419 | + option: PostCanrdPrivatePocketSaveOption, | ||
3420 | + ): Promise<PostCanrdPrivatePocketSaveResponseSuccess> { | ||
3421 | + return requester(request.url, { | ||
3422 | + method: request.method, | ||
3423 | + ...option, | ||
3424 | + }) as unknown as Promise<PostCanrdPrivatePocketSaveResponseSuccess>; | ||
3425 | + } | ||
3426 | + | ||
3427 | + /** http method */ | ||
3428 | + request.method = method; | ||
3429 | + /** request url */ | ||
3430 | + request.url = url; | ||
3431 | + return request; | ||
3432 | +})(); | ||
3433 | + | ||
3434 | +/** @description request parameter type for postCanrdPrivatePocketUpdateBalance */ | ||
3435 | +export interface PostCanrdPrivatePocketUpdateBalanceOption { | ||
3436 | + /** | ||
3437 | + * @description | ||
3438 | + * request | ||
3439 | + */ | ||
3440 | + body: { | ||
3441 | + /** | ||
3442 | + @description | ||
3443 | + request */ | ||
3444 | + request: UserPrivatePocketBalanceUpdateRequest; | ||
3445 | + }; | ||
3446 | +} | ||
3447 | + | ||
3448 | +/** @description response type for postCanrdPrivatePocketUpdateBalance */ | ||
3449 | +export interface PostCanrdPrivatePocketUpdateBalanceResponse { | ||
3450 | + /** | ||
3451 | + * @description | ||
3452 | + * OK | ||
3453 | + */ | ||
3454 | + 200: ServerResult; | ||
3455 | + /** | ||
3456 | + * @description | ||
3457 | + * Created | ||
3458 | + */ | ||
3459 | + 201: any; | ||
3460 | + /** | ||
3461 | + * @description | ||
3462 | + * Unauthorized | ||
3463 | + */ | ||
3464 | + 401: any; | ||
3465 | + /** | ||
3466 | + * @description | ||
3467 | + * Forbidden | ||
3468 | + */ | ||
3469 | + 403: any; | ||
3470 | + /** | ||
3471 | + * @description | ||
3472 | + * Not Found | ||
3473 | + */ | ||
3474 | + 404: any; | ||
3475 | +} | ||
3476 | + | ||
3477 | +export type PostCanrdPrivatePocketUpdateBalanceResponseSuccess = | ||
3478 | + PostCanrdPrivatePocketUpdateBalanceResponse[200]; | ||
3479 | +/** | ||
3480 | + * @description | ||
3481 | + * 更新用户隐私钱包余额 | ||
3482 | + * @tags user-private-pocket-controller | ||
3483 | + * @produces * | ||
3484 | + * @consumes application/json | ||
3485 | + */ | ||
3486 | +export const postCanrdPrivatePocketUpdateBalance = /* #__PURE__ */ (() => { | ||
3487 | + const method = 'post'; | ||
3488 | + const url = '/canrd/privatePocket/updateBalance'; | ||
3489 | + function request( | ||
3490 | + option: PostCanrdPrivatePocketUpdateBalanceOption, | ||
3491 | + ): Promise<PostCanrdPrivatePocketUpdateBalanceResponseSuccess> { | ||
3492 | + return requester(request.url, { | ||
3493 | + method: request.method, | ||
3494 | + ...option, | ||
3495 | + }) as unknown as Promise<PostCanrdPrivatePocketUpdateBalanceResponseSuccess>; | ||
3496 | + } | ||
3497 | + | ||
3498 | + /** http method */ | ||
3499 | + request.method = method; | ||
3500 | + /** request url */ | ||
3501 | + request.url = url; | ||
3502 | + return request; | ||
3503 | +})(); | ||
3504 | + | ||
3145 | /** @description request parameter type for postCommonAudit */ | 3505 | /** @description request parameter type for postCommonAudit */ |
3146 | export interface PostCommonAuditOption { | 3506 | export interface PostCommonAuditOption { |
3147 | /** | 3507 | /** |