Commit f2c9057fd58eaafc736b002b768801d2ff9fb1ec

Authored by zhongnanhuang
1 parent e0a6e25d

feat: update 发票对账

src/pages/Invoice/constant.tsx
@@ -20,51 +20,61 @@ export const INVOICE_COLUMNS = [ @@ -20,51 +20,61 @@ export const INVOICE_COLUMNS = [
20 dataIndex: 'invoiceNumber', 20 dataIndex: 'invoiceNumber',
21 title: '发票号码', 21 title: '发票号码',
22 valueType: 'text', 22 valueType: 'text',
  23 + width: 80,
23 }, 24 },
24 { 25 {
25 dataIndex: 'invoiceStatus', 26 dataIndex: 'invoiceStatus',
26 title: '发票类型', 27 title: '发票类型',
27 valueType: 'select', 28 valueType: 'select',
  29 + width: 80,
28 }, 30 },
29 { 31 {
30 title: '状态', 32 title: '状态',
31 dataIndex: 'status', 33 dataIndex: 'status',
32 valueType: 'text', 34 valueType: 'text',
  35 + width: 80,
33 }, 36 },
34 { 37 {
35 title: '购买方', 38 title: '购买方',
36 dataIndex: 'purchaser', 39 dataIndex: 'purchaser',
37 valueType: 'text', 40 valueType: 'text',
  41 + width: 80,
38 }, 42 },
39 { 43 {
40 title: '收款单位', 44 title: '收款单位',
41 dataIndex: 'payee', 45 dataIndex: 'payee',
42 valueType: 'text', 46 valueType: 'text',
  47 + width: 80,
43 }, 48 },
44 { 49 {
45 title: '联系人', 50 title: '联系人',
46 dataIndex: 'contacts', 51 dataIndex: 'contacts',
47 valueType: 'text', 52 valueType: 'text',
  53 + width: 80,
48 }, 54 },
49 { 55 {
50 title: '销售', 56 title: '销售',
51 dataIndex: 'sale', 57 dataIndex: 'sale',
52 valueType: 'text', 58 valueType: 'text',
  59 + width: 80,
53 }, 60 },
54 { 61 {
55 title: '金额', 62 title: '金额',
56 dataIndex: 'money', 63 dataIndex: 'money',
57 valueType: 'money', 64 valueType: 'money',
  65 + width: 80,
58 }, 66 },
59 { 67 {
60 title: '开票日期', 68 title: '开票日期',
61 dataIndex: 'invoicingTime', 69 dataIndex: 'invoicingTime',
62 valueType: 'date', 70 valueType: 'date',
  71 + width: 80,
63 }, 72 },
64 { 73 {
65 title: '收款时间', 74 title: '收款时间',
66 dataIndex: 'collectionTime', 75 dataIndex: 'collectionTime',
67 valueType: 'dateTime', 76 valueType: 'dateTime',
  77 + width: 80,
68 }, 78 },
69 { 79 {
70 title: '操作', 80 title: '操作',
src/pages/Invoice/index.tsx
@@ -52,6 +52,7 @@ const InvoicePage = () => { @@ -52,6 +52,7 @@ const InvoicePage = () => {
52 }} 52 }}
53 > 53 >
54 <ProTable<InvoiceItem> 54 <ProTable<InvoiceItem>
  55 + scroll={{ x: true }}
55 columns={INVOICE_COLUMNS} 56 columns={INVOICE_COLUMNS}
56 actionRef={actionRef} 57 actionRef={actionRef}
57 cardBordered 58 cardBordered
src/pages/Order/components/FinancialDrawer.tsx
@@ -12,10 +12,9 @@ import { @@ -12,10 +12,9 @@ import {
12 ProFormText, 12 ProFormText,
13 ProFormTextArea, 13 ProFormTextArea,
14 } from '@ant-design/pro-components'; 14 } from '@ant-design/pro-components';
15 -import { ProFormDigit } from '@ant-design/pro-form';  
16 import { Form, message } from 'antd'; 15 import { Form, message } from 'antd';
17 import { useEffect, useState } from 'react'; 16 import { useEffect, useState } from 'react';
18 -import { INVOCING_STATUS_OPTIONS_OLD, PAYEE_OPTIONS } from '../constant'; 17 +import { INVOCING_STATUS_OPTIONS_OLD } from '../constant';
19 18
20 export default ({ 19 export default ({
21 mainOrder, 20 mainOrder,
@@ -142,31 +141,31 @@ export default ({ @@ -142,31 +141,31 @@ export default ({
142 label="收款时间" 141 label="收款时间"
143 initialValue={subOrders[0]?.collectMoneyTime} 142 initialValue={subOrders[0]?.collectMoneyTime}
144 />, 143 />,
145 - <ProFormText  
146 - width="lg"  
147 - key="invoiceNumber"  
148 - name="invoiceNumber"  
149 - label="发票号码"  
150 - initialValue={subOrders[0]?.invoiceNumber}  
151 - />,  
152 - <ProFormSelect  
153 - key="payee"  
154 - placeholder="选择收款单位"  
155 - name="payee"  
156 - width="lg"  
157 - label="收款单位"  
158 - options={enumToSelect(PAYEE_OPTIONS)}  
159 - initialValue={subOrders[0]?.payee}  
160 - rules={[{ required: true, message: '收款单位必填' }]}  
161 - />, 144 + // <ProFormText
  145 + // width="lg"
  146 + // key="invoiceNumber"
  147 + // name="invoiceNumber"
  148 + // label="发票号码"
  149 + // initialValue={subOrders[0]?.invoiceNumber}
  150 + // />,
  151 + // <ProFormSelect
  152 + // key="payee"
  153 + // placeholder="选择收款单位"
  154 + // name="payee"
  155 + // width="lg"
  156 + // label="收款单位"
  157 + // options={enumToSelect(PAYEE_OPTIONS)}
  158 + // initialValue={subOrders[0]?.payee}
  159 + // rules={[{ required: true, message: '收款单位必填' }]}
  160 + // />,
162 161
163 - <ProFormDigit  
164 - key="money"  
165 - name="money"  
166 - width="lg"  
167 - label="金额"  
168 - rules={[{ required: true, message: '金额必填' }]}  
169 - />, 162 + // <ProFormDigit
  163 + // key="money"
  164 + // name="money"
  165 + // width="lg"
  166 + // label="金额"
  167 + // rules={[{ required: true, message: '金额必填' }]}
  168 + // />,
170 ] 169 ]
171 : ''} 170 : ''}
172 171
src/pages/Order/index.tsx
@@ -201,9 +201,12 @@ const OrderPage = () =&gt; { @@ -201,9 +201,12 @@ const OrderPage = () =&gt; {
201 function copyOrderToClipboard(record: any) { 201 function copyOrderToClipboard(record: any) {
202 let text = ''; 202 let text = '';
203 text += record?.id; 203 text += record?.id;
  204 + text += ',' + record?.salesCode;
204 text += ',' + record?.customerName; 205 text += ',' + record?.customerName;
205 text += ',' + record?.customerContactNumber; 206 text += ',' + record?.customerContactNumber;
206 text += ',' + record?.customerShippingAddress; 207 text += ',' + record?.customerShippingAddress;
  208 + text += ',' + record?.institutionContactName;
  209 + text += ',' + record?.institution;
207 record?.subOrderInformationLists?.forEach((item) => { 210 record?.subOrderInformationLists?.forEach((item) => {
208 text += '\n'; 211 text += '\n';
209 text += item?.productName; 212 text += item?.productName;
@@ -1055,7 +1058,8 @@ const OrderPage = () =&gt; { @@ -1055,7 +1058,8 @@ const OrderPage = () =&gt; {
1055 type="link" 1058 type="link"
1056 onClick={() => { 1059 onClick={() => {
1057 setSelectedRows([optRecord]); 1060 setSelectedRows([optRecord]);
1058 - setOrderDrawerVisible(true); 1061 + // setOrderDrawerVisible(true);
  1062 + setAfterSalesDrawerVisible(true);
1059 setOrderRow(record); 1063 setOrderRow(record);
1060 setOrderOptType('after-sales'); 1064 setOrderOptType('after-sales');
1061 }} 1065 }}
@@ -1927,7 +1931,8 @@ const OrderPage = () =&gt; { @@ -1927,7 +1931,8 @@ const OrderPage = () =&gt; {
1927 return; 1931 return;
1928 } 1932 }
1929 } 1933 }
1930 - setOrderDrawerVisible(true); 1934 + // setOrderDrawerVisible(true);
  1935 + setAfterSalesDrawerVisible(true);
1931 setOrderRow(record); 1936 setOrderRow(record);
1932 setOrderOptType('after-sales'); 1937 setOrderOptType('after-sales');
1933 }} 1938 }}
src/pages/OrderReport/components/OrderStatisticCard.tsx
@@ -7,10 +7,26 @@ import { @@ -7,10 +7,26 @@ import {
7 ProFormDatePicker, 7 ProFormDatePicker,
8 ProFormDigit, 8 ProFormDigit,
9 } from '@ant-design/pro-components'; 9 } from '@ant-design/pro-components';
  10 +import { useLocation } from '@umijs/max';
10 import { Flex, Form, message } from 'antd'; 11 import { Flex, Form, message } from 'antd';
11 -import { useState } from 'react'; 12 +import { useEffect, useState } from 'react';
12 13
13 export default ({ data, statisticsMethod, reFreshData }) => { 14 export default ({ data, statisticsMethod, reFreshData }) => {
  15 + const location = useLocation();
  16 + const [targetEditable, setTargetEditable] = useState(false);
  17 +
  18 + // 使用URLSearchParams来解析查询参数
  19 + const params = new URLSearchParams(location.search);
  20 +
  21 + // 获取名为"param"的查询参数
  22 + useEffect(() => {
  23 + setTargetEditable(true);
  24 + const urlEditable = params.get('editable');
  25 + if (urlEditable === null) {
  26 + setTargetEditable(false);
  27 + }
  28 + }, []);
  29 +
14 const [edit, setEdit] = useState(false); 30 const [edit, setEdit] = useState(false);
15 const [form] = Form.useForm<{ 31 const [form] = Form.useForm<{
16 statisticsMethod: string; 32 statisticsMethod: string;
@@ -121,7 +137,7 @@ export default ({ data, statisticsMethod, reFreshData }) =&gt; { @@ -121,7 +137,7 @@ export default ({ data, statisticsMethod, reFreshData }) =&gt; {
121 '' 137 ''
122 )} 138 )}
123 </span> 139 </span>
124 - {editable ? ( 140 + {editable && targetEditable ? (
125 <EditTwoTone 141 <EditTwoTone
126 style={{ fontSize: '20px' }} 142 style={{ fontSize: '20px' }}
127 onClick={() => { 143 onClick={() => {