Commit e0b4e44b44c1a888ca813190d60c390b6103c3f3

Authored by 曾国涛
1 parent 3fcc4455

chore: 为发票和银行流水页面添加导出按钮

在发票和银行流水页面添加了导出按钮,该按钮允许用户选择所需的数据并将其导出为Excel文件。使用了messageApi来显示导出过程的加载状态。

增加了optionRender属性来在搜索配置中添加导出按钮,并确保按钮位于搜索区域的右侧。

服务端点和文件:
- 在`index.tsx`文件的Invoice页面中添加了导出功能。
- 在`index.tsx`文件的InvoiceVerification页面中添加了导出功能。
- 更新了`definition.ts`文件,对现有的类型定义没有做出修改,保持了一致性。与订单状态和流水号相关的配置。
src/pages/Invoice/Invoice/components/AddBankStatementModal.tsx
... ... @@ -24,6 +24,11 @@ export default ({ getRows, onFinish }) => {
24 24 dataIndex: 'serialNumber',
25 25 },
26 26 {
  27 + title: '流水号',
  28 + hideInTable: true,
  29 + dataIndex: 'serialNumber',
  30 + },
  31 + {
27 32 title: '收款时间',
28 33 dataIndex: 'collectionDatetime',
29 34 hideInSearch: true,
... ...
src/pages/Invoice/Invoice/components/InvoiceVerificationModal.tsx
... ... @@ -20,7 +20,6 @@ export default ({ invoiceId, setVisible, onClose }) => {
20 20 const [bankChooseModalVisible, setBankChooseModalVisible] = useState(false);
21 21 const [invoiceInfo, setInvoiceInfo] = useState({});
22 22 const [relationOrderIds, setRelationOrderIds] = useState([]);
23   - const [setRelationBankStatements] = useState([]);
24 23 const actionRef = useRef<ActionType>();
25 24  
26 25 const loadInvoiceData = async () => {
... ... @@ -31,7 +30,6 @@ export default ({ invoiceId, setVisible, onClose }) =&gt; {
31 30 setInvoiceInfo(res.data);
32 31 setRelationOrderIds(res.data.mainOrderIds);
33 32 console.log('bs:' + res.data.bankStatementDtos);
34   - setRelationBankStatements(res.data.bankStatementDtos);
35 33 }
36 34 };
37 35  
... ... @@ -117,6 +115,18 @@ export default ({ invoiceId, setVisible, onClose }) =&gt; {
117 115 },
118 116 {
119 117 key: '11',
  118 + label: '订单类型',
  119 + children: invoiceInfo?.orderTypeText,
  120 + span: 12,
  121 + },
  122 + {
  123 + key: '12',
  124 + label: '绑定流水号',
  125 + children: invoiceInfo?.serialNumbersTextByOrder,
  126 + span: 12,
  127 + },
  128 + {
  129 + key: '13',
120 130 label: '备注',
121 131 children: invoiceInfo?.notes,
122 132 span: 24,
... ...
src/pages/Invoice/Invoice/components/invoiceWriteOffModal.tsx
... ... @@ -30,24 +30,29 @@ export default ({ getData, triggerButton, readOnly }) =&gt; {
30 30 {
31 31 title: '发票号码',
32 32 dataIndex: 'invoiceNumber',
  33 + ellipsis: true,
33 34 },
34 35 {
35 36 title: '收款方',
36 37 dataIndex: 'payeeText',
  38 + ellipsis: true,
37 39 },
38 40 {
39 41 title: '付款方',
40 42 dataIndex: 'purchaser',
  43 + ellipsis: true,
41 44 },
42 45 {
43 46 title: '金额',
44 47 dataIndex: 'money',
45 48 valueType: 'money',
  49 + ellipsis: true,
46 50 },
47 51 {
48 52 title: '日期',
49 53 dataIndex: 'invoicingTime',
50 54 valueType: 'date',
  55 + ellipsis: true,
51 56 },
52 57 ];
53 58 if (!readOnly) {
... ... @@ -84,24 +89,29 @@ export default ({ getData, triggerButton, readOnly }) =&gt; {
84 89 {
85 90 title: '流水号',
86 91 dataIndex: 'serialNumber',
  92 + ellipsis: true,
87 93 },
88 94 {
89 95 title: '收款方',
90 96 dataIndex: 'payeeText',
  97 + ellipsis: true,
91 98 },
92 99 {
93 100 title: '付款方',
94 101 dataIndex: 'payer',
  102 + ellipsis: true,
95 103 },
96 104 {
97 105 title: '金额',
98 106 dataIndex: 'amount',
99 107 valueType: 'money',
  108 + ellipsis: true,
100 109 },
101 110 {
102 111 title: '日期',
103 112 dataIndex: 'collectionDatetime',
104 113 valueType: 'date',
  114 + ellipsis: true,
105 115 },
106 116 ];
107 117 columns.push({
... ...
src/pages/Invoice/constant.tsx
... ... @@ -78,6 +78,43 @@ export const INVOICE_COLUMNS = [
78 78 hideInTable: true,
79 79 },
80 80 {
  81 + title: '订单状态',
  82 + dataIndex: 'orderTypeText',
  83 + valueType: 'text',
  84 + width: 180,
  85 + },
  86 + {
  87 + title: '绑定流水号',
  88 + dataIndex: 'serialNumbersTextByOrder',
  89 +
  90 + valueType: 'text',
  91 + width: 180,
  92 + },
  93 + {
  94 + title: '是否预付款',
  95 + dataIndex: 'orderIsPrePay',
  96 + valueType: 'select',
  97 + valueEnum: {
  98 + true: {
  99 + text: '是',
  100 + status: true,
  101 + },
  102 + false: {
  103 + text: '否',
  104 + status: false,
  105 + },
  106 + },
  107 + hideInTable: true,
  108 + width: 180,
  109 + },
  110 + {
  111 + title: '绑定流水号',
  112 + dataIndex: 'serialNumberLike',
  113 + hideInTable: true,
  114 + valueType: 'text',
  115 + width: 180,
  116 + },
  117 + {
81 118 title: '购买方',
82 119 dataIndex: 'purchaser',
83 120 valueType: 'text',
... ...