Commit c9f296e774b382f94c126f4fe4d168a3dc717f10
1 parent
3a164b6e
feat: 开发确认收货预警回访登记预警
Showing
4 changed files
with
1113 additions
and
1520 deletions
src/pages/Order/Order/components/FeedbackRegistrationModal.tsx
... | ... | @@ -3,14 +3,14 @@ import { Input, Modal } from 'antd'; |
3 | 3 | import { useState } from 'react'; |
4 | 4 | |
5 | 5 | // import { cloneDeep } from 'lodash'; |
6 | -export default ({ subOrders, onClose }) => { | |
6 | +export default ({ setVisible, subOrders, mainOrder, onClose }) => { | |
7 | 7 | const [isModalOpen] = useState(true); |
8 | 8 | const { TextArea } = Input; |
9 | 9 | const [textValue, setTextValue] = useState(''); |
10 | 10 | |
11 | 11 | const handleOk = async () => { |
12 | 12 | console.log(textValue); // 处理输入的文本 |
13 | - console.log(subOrders, '5656subOrders'); | |
13 | + console.log(subOrders, '5656subOrders', mainOrder); | |
14 | 14 | let res = await postServiceOrderFeedbackRegistration({ |
15 | 15 | data: { |
16 | 16 | id: subOrders[0].id, |
... | ... | @@ -23,6 +23,7 @@ export default ({ subOrders, onClose }) => { |
23 | 23 | // onClose(); |
24 | 24 | }; |
25 | 25 | const handleCancel = () => { |
26 | + setVisible(false); | |
26 | 27 | onClose(); |
27 | 28 | // setIsModalOpen(false); |
28 | 29 | // onClose(); | ... | ... |
src/pages/Order/Order/index.tsx
... | ... | @@ -4592,6 +4592,8 @@ const OrderPage = () => { |
4592 | 4592 | |
4593 | 4593 | const [invoiceWarningNum, setInvoiceWarningNum] = useState(0); |
4594 | 4594 | const [invoiceRefundWarningNum, setInvoiceRefundWarningNum] = useState(0); |
4595 | + const [waitConfirmPayment, setWaitConfirmPayment] = useState(0); | |
4596 | + const [waitFeedback, setWaitFeedback] = useState(0); | |
4595 | 4597 | const [open, setOpen] = useState(false); |
4596 | 4598 | const { openCount, setOpenCount } = useModel('count'); |
4597 | 4599 | |
... | ... | @@ -4608,6 +4610,8 @@ const OrderPage = () => { |
4608 | 4610 | } |
4609 | 4611 | setInvoiceWarningNum(res.data.waitConfirmInvoice); |
4610 | 4612 | setInvoiceRefundWarningNum(res.data.waitConfirmReceipt); |
4613 | + setWaitConfirmPayment(res.data.waitConfirmPayment); | |
4614 | + setWaitFeedback(res.data.waitFeedback); | |
4611 | 4615 | } |
4612 | 4616 | |
4613 | 4617 | useEffect(() => { |
... | ... | @@ -4644,7 +4648,7 @@ const OrderPage = () => { |
4644 | 4648 | </Button>, |
4645 | 4649 | ]} |
4646 | 4650 | > |
4647 | - <Row | |
4651 | + {/* <Row | |
4648 | 4652 | gutter={16} |
4649 | 4653 | justify="space-between" // Aligns Cols to the start and end |
4650 | 4654 | align="middle" // Vertically center contents |
... | ... | @@ -4737,15 +4741,264 @@ const OrderPage = () => { |
4737 | 4741 | </Card> |
4738 | 4742 | </div> |
4739 | 4743 | </Col> |
4744 | + </Row> */} | |
4745 | + <Row | |
4746 | + gutter={16} | |
4747 | + justify="space-between" // Aligns Cols to the start and end | |
4748 | + align="middle" // Vertically center contents | |
4749 | + > | |
4750 | + {/* 新增卡片1: 待确认收货订单 */} | |
4751 | + <Col span={6}> | |
4752 | + {' '} | |
4753 | + {/* 修改位置:将 span 改为 6,以保证一行四个卡片 */} | |
4754 | + <div | |
4755 | + style={{ | |
4756 | + display: 'flex', | |
4757 | + justifyContent: 'center', | |
4758 | + marginTop: '20px', | |
4759 | + }} | |
4760 | + > | |
4761 | + <Card | |
4762 | + bordered={true} | |
4763 | + style={{ | |
4764 | + backgroundColor: '#f0f0f0', // 背景颜色 | |
4765 | + width: '200px', // 卡片宽度 | |
4766 | + height: '200px', // 卡片高度 | |
4767 | + display: 'flex', | |
4768 | + alignItems: 'center', | |
4769 | + justifyContent: 'center', | |
4770 | + }} | |
4771 | + > | |
4772 | + <div | |
4773 | + style={{ | |
4774 | + fontWeight: 'bold', // 字体加粗 | |
4775 | + color: 'black', // 字体颜色 | |
4776 | + fontSize: '20px', // 字体大小 | |
4777 | + }} | |
4778 | + > | |
4779 | + <div | |
4780 | + style={{ | |
4781 | + fontWeight: 'bold', // 字体加粗 | |
4782 | + color: 'black', // 字体颜色 | |
4783 | + fontSize: '40px', // 字体大小 | |
4784 | + justifyContent: 'center', | |
4785 | + display: 'flex', | |
4786 | + alignItems: 'center', | |
4787 | + marginBottom: '20px', | |
4788 | + }} | |
4789 | + > | |
4790 | + {waitConfirmPayment} | |
4791 | + </div> | |
4792 | + 待确认收货订单 | |
4793 | + </div> | |
4794 | + </Card> | |
4795 | + </div> | |
4796 | + </Col> | |
4797 | + | |
4798 | + {/* 新增卡片2: 待回访登记订单 */} | |
4799 | + <Col span={6}> | |
4800 | + {' '} | |
4801 | + {/* 修改位置:将 span 改为 6,以保证一行四个卡片 */} | |
4802 | + <div | |
4803 | + style={{ | |
4804 | + display: 'flex', | |
4805 | + justifyContent: 'center', | |
4806 | + marginTop: '20px', | |
4807 | + }} | |
4808 | + > | |
4809 | + <Card | |
4810 | + bordered={true} | |
4811 | + style={{ | |
4812 | + backgroundColor: '#f0f0f0', // 背景颜色 | |
4813 | + width: '200px', // 卡片宽度 | |
4814 | + height: '200px', // 卡片高度 | |
4815 | + display: 'flex', | |
4816 | + alignItems: 'center', | |
4817 | + justifyContent: 'center', | |
4818 | + }} | |
4819 | + > | |
4820 | + <div | |
4821 | + style={{ | |
4822 | + fontWeight: 'bold', // 字体加粗 | |
4823 | + color: 'black', // 字体颜色 | |
4824 | + fontSize: '20px', // 字体大小 | |
4825 | + }} | |
4826 | + > | |
4827 | + <div | |
4828 | + style={{ | |
4829 | + fontWeight: 'bold', // 字体加粗 | |
4830 | + color: 'black', // 字体颜色 | |
4831 | + fontSize: '40px', // 字体大小 | |
4832 | + justifyContent: 'center', | |
4833 | + display: 'flex', | |
4834 | + alignItems: 'center', | |
4835 | + marginBottom: '20px', | |
4836 | + }} | |
4837 | + > | |
4838 | + {waitFeedback} | |
4839 | + </div> | |
4840 | + 待回访登记订单 | |
4841 | + </div> | |
4842 | + </Card> | |
4843 | + </div> | |
4844 | + </Col> | |
4845 | + | |
4846 | + {/* 现有卡片: 发票待确认订单 */} | |
4847 | + <Col span={6}> | |
4848 | + {' '} | |
4849 | + {/* 修改位置:将 span 改为 6,以保证一行四个卡片 */} | |
4850 | + <div | |
4851 | + style={{ | |
4852 | + display: 'flex', | |
4853 | + justifyContent: 'center', | |
4854 | + marginTop: '20px', | |
4855 | + }} | |
4856 | + > | |
4857 | + <Card | |
4858 | + bordered={true} | |
4859 | + style={{ | |
4860 | + backgroundColor: '#f0f0f0', // 背景颜色 | |
4861 | + width: '200px', // 卡片宽度 | |
4862 | + height: '200px', // 卡片高度 | |
4863 | + display: 'flex', | |
4864 | + alignItems: 'center', | |
4865 | + justifyContent: 'center', | |
4866 | + }} | |
4867 | + > | |
4868 | + <div | |
4869 | + style={{ | |
4870 | + fontWeight: 'bold', // 字体加粗 | |
4871 | + color: 'black', // 字体颜色 | |
4872 | + fontSize: '20px', // 字体大小 | |
4873 | + }} | |
4874 | + > | |
4875 | + <div | |
4876 | + style={{ | |
4877 | + fontWeight: 'bold', // 字体加粗 | |
4878 | + color: 'black', // 字体颜色 | |
4879 | + fontSize: '40px', // 字体大小 | |
4880 | + justifyContent: 'center', | |
4881 | + display: 'flex', | |
4882 | + alignItems: 'center', | |
4883 | + marginBottom: '20px', | |
4884 | + }} | |
4885 | + > | |
4886 | + {invoiceWarningNum} | |
4887 | + </div> | |
4888 | + 待确认发票订单 | |
4889 | + </div> | |
4890 | + </Card> | |
4891 | + </div> | |
4892 | + </Col> | |
4893 | + | |
4894 | + {/* 现有卡片: 回款待确认订单 */} | |
4895 | + <Col span={6}> | |
4896 | + {' '} | |
4897 | + {/* 修改位置:将 span 改为 6,以保证一行四个卡片 */} | |
4898 | + <div | |
4899 | + style={{ | |
4900 | + display: 'flex', | |
4901 | + justifyContent: 'center', | |
4902 | + marginTop: '20px', | |
4903 | + }} | |
4904 | + > | |
4905 | + <Card | |
4906 | + bordered={true} | |
4907 | + style={{ | |
4908 | + backgroundColor: '#f0f0f0', // 背景颜色 | |
4909 | + width: '200px', // 卡片宽度 | |
4910 | + height: '200px', // 卡片高度 | |
4911 | + display: 'flex', | |
4912 | + alignItems: 'center', | |
4913 | + justifyContent: 'center', | |
4914 | + }} | |
4915 | + > | |
4916 | + <div | |
4917 | + style={{ | |
4918 | + fontWeight: 'bold', // 字体加粗 | |
4919 | + color: 'black', // 字体颜色 | |
4920 | + fontSize: '20px', // 字体大小 | |
4921 | + }} | |
4922 | + > | |
4923 | + <div | |
4924 | + style={{ | |
4925 | + fontWeight: 'bold', // 字体加粗 | |
4926 | + color: 'black', // 字体颜色 | |
4927 | + fontSize: '40px', // 字体大小 | |
4928 | + justifyContent: 'center', | |
4929 | + display: 'flex', | |
4930 | + alignItems: 'center', | |
4931 | + marginBottom: '20px', | |
4932 | + }} | |
4933 | + > | |
4934 | + {invoiceRefundWarningNum} | |
4935 | + </div> | |
4936 | + 待回款订单 | |
4937 | + </div> | |
4938 | + </Card> | |
4939 | + </div> | |
4940 | + </Col> | |
4740 | 4941 | </Row> |
4741 | - <div style={{ color: 'red', padding: '40px' }}> | |
4742 | - <p>预警说明:</p> | |
4743 | - <p> | |
4744 | - 1、从申请开票之日起,超过5天未【确认发票】的订单在登录时进行第一次提醒,超过15天未【确认发票】将进行每日提醒并锁单。 | |
4745 | - </p> | |
4746 | - <p> | |
4747 | - 2、从【确认发票】之日起,超过15天未【回款】的订单在账号登录时会进行第一次提醒,超过25天未【回款】将进行每日提醒并锁单。 | |
4942 | + | |
4943 | + <div> | |
4944 | + <p | |
4945 | + style={{ | |
4946 | + color: 'red', | |
4947 | + paddingLeft: '20px', | |
4948 | + paddingRight: '20px', | |
4949 | + marginTop: '10px', | |
4950 | + }} | |
4951 | + > | |
4952 | + 预警说明: | |
4748 | 4953 | </p> |
4954 | + <div | |
4955 | + style={{ | |
4956 | + marginLeft: '20px', | |
4957 | + marginRight: '20px', | |
4958 | + marginBottom: '20px', | |
4959 | + }} | |
4960 | + > | |
4961 | + <span style={{ color: 'red' }}>确认收货预警:</span> | |
4962 | + <span> | |
4963 | + 从发货之日起计算,国内超过15天(海外30天)未【确认收货】,将进行确认收货预警提醒,超过30天(海外60天)未确认收货将锁单,并且每次登录都会提醒 | |
4964 | + </span> | |
4965 | + </div> | |
4966 | + <div | |
4967 | + style={{ | |
4968 | + marginLeft: '20px', | |
4969 | + marginRight: '20px', | |
4970 | + marginBottom: '20px', | |
4971 | + }} | |
4972 | + > | |
4973 | + <span style={{ color: 'red' }}>回访登记预警:</span> | |
4974 | + <span> | |
4975 | + 从【确认收货】之日起计算,国内超过15天(海外30天)未【确认收货】,将进行回访登记预警提醒,超过30天(海外30天)未回访登记将锁单,并且每次登录都会提醒 | |
4976 | + </span> | |
4977 | + </div> | |
4978 | + <div | |
4979 | + style={{ | |
4980 | + marginLeft: '20px', | |
4981 | + marginRight: '20px', | |
4982 | + marginBottom: '20px', | |
4983 | + }} | |
4984 | + > | |
4985 | + <span style={{ color: 'red' }}>确认发票预警:</span> | |
4986 | + <span> | |
4987 | + 从【申请开票】之日起,超过5天未和客户确认发票(不开票的订单除外)的订单将会进行第一次提醒;超过15天未和客户确认发票(不开票的订单除外)的订单将会每天进行一次提醒,并限制下单功能 | |
4988 | + </span> | |
4989 | + </div> | |
4990 | + <div | |
4991 | + style={{ | |
4992 | + marginLeft: '20px', | |
4993 | + marginRight: '20px', | |
4994 | + marginBottom: '20px', | |
4995 | + }} | |
4996 | + > | |
4997 | + <span style={{ color: 'red' }}>回款预警:</span> | |
4998 | + <span> | |
4999 | + 从发票确认能之日起,超过15天未确认回款的订单将会进行第一次提醒,超过25天未确认回款的订单将会每天进行并限制下单功能{' '} | |
5000 | + </span> | |
5001 | + </div> | |
4749 | 5002 | </div> |
4750 | 5003 | </Modal> |
4751 | 5004 | <ProTable | ... | ... |
src/pages/Order/OrderWarning/components/FeedbackRegistrationModal.tsx
... | ... | @@ -3,14 +3,14 @@ import { Input, Modal } from 'antd'; |
3 | 3 | import { useState } from 'react'; |
4 | 4 | |
5 | 5 | // import { cloneDeep } from 'lodash'; |
6 | -export default ({ subOrders, onClose }) => { | |
6 | +export default ({ setVisible, subOrders, mainOrder, onClose }) => { | |
7 | 7 | const [isModalOpen] = useState(true); |
8 | 8 | const { TextArea } = Input; |
9 | 9 | const [textValue, setTextValue] = useState(''); |
10 | 10 | |
11 | 11 | const handleOk = async () => { |
12 | 12 | console.log(textValue); // 处理输入的文本 |
13 | - console.log(subOrders, '5656subOrders'); | |
13 | + console.log(subOrders, '5656subOrders', mainOrder); | |
14 | 14 | let res = await postServiceOrderFeedbackRegistration({ |
15 | 15 | data: { |
16 | 16 | id: subOrders[0].id, |
... | ... | @@ -23,6 +23,7 @@ export default ({ subOrders, onClose }) => { |
23 | 23 | // onClose(); |
24 | 24 | }; |
25 | 25 | const handleCancel = () => { |
26 | + setVisible(false); | |
26 | 27 | onClose(); |
27 | 28 | // setIsModalOpen(false); |
28 | 29 | // onClose(); | ... | ... |
src/pages/Order/OrderWarning/index.tsx
... | ... | @@ -67,7 +67,6 @@ import { |
67 | 67 | Radio, |
68 | 68 | Space, |
69 | 69 | Spin, |
70 | - Tabs, | |
71 | 70 | Tag, |
72 | 71 | Tooltip, |
73 | 72 | message, |
... | ... | @@ -199,9 +198,7 @@ const OrderPage = () => { |
199 | 198 | const [subOrderCount, setSubOrderCount] = useState(0); |
200 | 199 | const [sorted] = useState(false); |
201 | 200 | const mainTableRef = useRef<ActionType>(); |
202 | - const mainTableSecondRef = useRef<ActionType>(); | |
203 | 201 | const mainTableFormRef = useRef<ProFormInstance>(); |
204 | - const mainTableSecondFormRef = useRef<ProFormInstance>(); | |
205 | 202 | let [searchParams, setSearchParam] = useState(Object); //表格的查询条件存储 |
206 | 203 | console.log(searchParams); |
207 | 204 | const [messageApi, contextHolder] = message.useMessage(); |
... | ... | @@ -213,7 +210,7 @@ const OrderPage = () => { |
213 | 210 | const [ids, setIds] = useState([]); |
214 | 211 | const [recordOptNode, setRecordOptNode] = useState(null); |
215 | 212 | const roleCode = userInfo?.roleSmallVO?.code; |
216 | - const [activeTabKey, setActiveTabKey] = useState('1'); // **新增状态** | |
213 | + const [activeTabKey, setActiveTabKey] = useState(1); // **新增状态** | |
217 | 214 | |
218 | 215 | const triggerRecordOptNode = async (id) => { |
219 | 216 | const res = await postServiceOrderGetCurrentOptNode({ |
... | ... | @@ -230,12 +227,6 @@ const OrderPage = () => { |
230 | 227 | setSelectedRows([]); |
231 | 228 | setSelectedSubOrderKeys([]); |
232 | 229 | }; |
233 | - const refreshTable2 = () => { | |
234 | - mainTableSecondRef.current?.reload(); | |
235 | - //刷新表格数据的时候,取消选中行 | |
236 | - setSelectedRows([]); | |
237 | - setSelectedSubOrderKeys([]); | |
238 | - }; | |
239 | 230 | |
240 | 231 | /*useEffect(() => { |
241 | 232 | let initAfterInvoicingStatus = async () => { |
... | ... | @@ -2039,6 +2030,20 @@ const OrderPage = () => { |
2039 | 2030 | ) : ( |
2040 | 2031 | '' |
2041 | 2032 | )} |
2033 | + {optRecord.paths?.includes('feedbackRegistration') ? ( | |
2034 | + <Button | |
2035 | + className="p-0" | |
2036 | + type="link" | |
2037 | + onClick={() => { | |
2038 | + createOptObject(optRecord.id, record.id); | |
2039 | + setFeedbackRegistrationModalVisible(true); | |
2040 | + }} | |
2041 | + > | |
2042 | + 回访登记 | |
2043 | + </Button> | |
2044 | + ) : ( | |
2045 | + '' | |
2046 | + )} | |
2042 | 2047 | |
2043 | 2048 | {optRecord.paths?.includes('confirmInvoice') ? ( |
2044 | 2049 | <ButtonConfirm |
... | ... | @@ -4025,58 +4030,6 @@ const OrderPage = () => { |
4025 | 4030 | }, |
4026 | 4031 | ); |
4027 | 4032 | |
4028 | - // 主订单列表 | |
4029 | - const mainOrdersColumns2: ProColumns<OrderType>[] = MAIN_ORDER_COLUMNS.map( | |
4030 | - (item) => { | |
4031 | - //首能账号只能搜索订单编号 | |
4032 | - let canSearchIndex = [ | |
4033 | - 'id', | |
4034 | - 'salesCode', | |
4035 | - 'subNotes', | |
4036 | - 'orderStatus', | |
4037 | - 'createTime', | |
4038 | - 'modifiedAuditStatus', | |
4039 | - ]; | |
4040 | - if (isSupplier() && !canSearchIndex.includes(item.dataIndex)) { | |
4041 | - item.search = false; | |
4042 | - } | |
4043 | - | |
4044 | - canSearchIndex = [ | |
4045 | - 'id', | |
4046 | - 'salesCode', | |
4047 | - 'customerName', | |
4048 | - 'institution', | |
4049 | - 'productName', | |
4050 | - 'orderStatus', | |
4051 | - 'createTime', | |
4052 | - ]; | |
4053 | - | |
4054 | - if (isExaminer() && !canSearchIndex.includes(item.dataIndex)) { | |
4055 | - item.search = false; | |
4056 | - } | |
4057 | - | |
4058 | - if (item.dataIndex === 'name') { | |
4059 | - return { | |
4060 | - ...item, | |
4061 | - title: <OrderTableHeader />, | |
4062 | - render: (text, record) => { | |
4063 | - return <MainOrderColumnRender record={record} />; | |
4064 | - }, | |
4065 | - }; | |
4066 | - } | |
4067 | - | |
4068 | - /** | |
4069 | - * 采购的订单状态筛选内容 | |
4070 | - */ | |
4071 | - if (roleCode === 'procure' && item.dataIndex === 'orderStatus') { | |
4072 | - item.valueEnum = enumToProTableEnumValue( | |
4073 | - PROCURE_PRIMARY_ORDER_STATUS_OPTIONS, | |
4074 | - ); | |
4075 | - } | |
4076 | - return item; | |
4077 | - }, | |
4078 | - ); | |
4079 | - | |
4080 | 4033 | /** |
4081 | 4034 | * 采购可以筛选供应商备注 |
4082 | 4035 | */ |
... | ... | @@ -4088,13 +4041,6 @@ const OrderPage = () => { |
4088 | 4041 | valueType: 'text', |
4089 | 4042 | hideInTable: true, |
4090 | 4043 | }); |
4091 | - mainOrdersColumns2.push({ | |
4092 | - title: '供应商备注', | |
4093 | - width: 120, | |
4094 | - dataIndex: 'supplierNotes', | |
4095 | - valueType: 'text', | |
4096 | - hideInTable: true, | |
4097 | - }); | |
4098 | 4044 | } |
4099 | 4045 | |
4100 | 4046 | /** |
... | ... | @@ -4115,20 +4061,6 @@ const OrderPage = () => { |
4115 | 4061 | }, |
4116 | 4062 | hideInTable: true, |
4117 | 4063 | }); |
4118 | - mainOrdersColumns2.push({ | |
4119 | - title: '采购名称', | |
4120 | - width: 120, | |
4121 | - dataIndex: 'supplierName', | |
4122 | - valueType: 'select', | |
4123 | - request: async () => { | |
4124 | - const res = await postServiceOrderProvideProcurementRoles(); | |
4125 | - let options = res.data?.map((item) => { | |
4126 | - return { label: item, value: item }; | |
4127 | - }); | |
4128 | - return options; | |
4129 | - }, | |
4130 | - hideInTable: true, | |
4131 | - }); | |
4132 | 4064 | } |
4133 | 4065 | |
4134 | 4066 | /** |
... | ... | @@ -4152,23 +4084,6 @@ const OrderPage = () => { |
4152 | 4084 | }, |
4153 | 4085 | hideInTable: true, |
4154 | 4086 | }); |
4155 | - mainOrdersColumns2.push({ | |
4156 | - title: '采购排除', | |
4157 | - width: 120, | |
4158 | - dataIndex: 'excludeProcureNames', | |
4159 | - fieldProps: { | |
4160 | - mode: 'multiple', | |
4161 | - }, | |
4162 | - valueType: 'select', | |
4163 | - request: async () => { | |
4164 | - const res = await postServiceOrderProvideProcurementRoles(); | |
4165 | - let options = res.data?.map((item) => { | |
4166 | - return { label: item, value: item }; | |
4167 | - }); | |
4168 | - return options; | |
4169 | - }, | |
4170 | - hideInTable: true, | |
4171 | - }); | |
4172 | 4087 | } |
4173 | 4088 | |
4174 | 4089 | /** |
... | ... | @@ -4183,14 +4098,6 @@ const OrderPage = () => { |
4183 | 4098 | valueEnum: enumToProTableEnumValue(SHIPPING_WAREHOUSE_OPTIONS), |
4184 | 4099 | hideInTable: true, |
4185 | 4100 | }); |
4186 | - mainOrdersColumns2.push({ | |
4187 | - title: '发货仓库', | |
4188 | - width: 120, | |
4189 | - dataIndex: 'shippingWarehouse', | |
4190 | - valueType: 'select', | |
4191 | - valueEnum: enumToProTableEnumValue(SHIPPING_WAREHOUSE_OPTIONS), | |
4192 | - hideInTable: true, | |
4193 | - }); | |
4194 | 4101 | } |
4195 | 4102 | |
4196 | 4103 | //判断是否是采购,是的话新增一个筛选条件 |
... | ... | @@ -4202,77 +4109,80 @@ const OrderPage = () => { |
4202 | 4109 | hideInTable: true, |
4203 | 4110 | valueEnum: enumToProTableEnumValue(PROCURE_ORDER_STATUS), |
4204 | 4111 | }); |
4205 | - mainOrdersColumns2.push({ | |
4206 | - title: isSupplier() ? '下单状态' : '采购下单状态', | |
4207 | - dataIndex: 'procureOrderStatus', | |
4208 | - valueType: 'select', | |
4209 | - hideInTable: true, | |
4210 | - valueEnum: enumToProTableEnumValue(PROCURE_ORDER_STATUS), | |
4211 | - }); | |
4212 | 4112 | } |
4213 | 4113 | |
4214 | 4114 | //选择天数1 |
4215 | 4115 | const options1 = [ |
4216 | 4116 | { |
4217 | - label: '超过5天', | |
4218 | - value: 5, | |
4219 | - }, | |
4220 | - { | |
4221 | 4117 | label: '超过15天', |
4222 | 4118 | value: 15, |
4223 | 4119 | }, |
4120 | + { | |
4121 | + label: '超过30天', | |
4122 | + value: 30, | |
4123 | + }, | |
4224 | 4124 | ]; |
4225 | - //选择天数 | |
4226 | - const [calDate, setCalDate] = useState<string | null>(null); | |
4227 | - const [calDate2, setCalDate2] = useState<string | null>(null); | |
4228 | - const [value1, setValue1] = useState(); | |
4229 | - const radioOnChange1 = ({ target: { value } }) => { | |
4230 | - const currentDate = new Date(); | |
4231 | - // 创建一个新的日期对象,并在当前日期的基础上加上 daysToAdd 天 | |
4232 | - const newDate = new Date(currentDate); | |
4233 | - newDate.setDate(currentDate.getDate() - value); | |
4234 | - const formattedDate = format(newDate, 'yyyy-MM-dd HH:mm:ss'); | |
4235 | - setCalDate(formattedDate); | |
4236 | - setValue1(value); | |
4237 | - }; | |
4238 | - //选择天数2 | |
4239 | 4125 | const options2 = [ |
4240 | 4126 | { |
4241 | 4127 | label: '超过15天', |
4242 | 4128 | value: 15, |
4243 | 4129 | }, |
4244 | 4130 | { |
4245 | - label: '超过25天', | |
4246 | - value: 25, | |
4131 | + label: '超过30天', | |
4132 | + value: 30, | |
4133 | + }, | |
4134 | + ]; | |
4135 | + const options3 = [ | |
4136 | + { | |
4137 | + label: '超过5天', | |
4138 | + value: 5, | |
4139 | + }, | |
4140 | + { | |
4141 | + label: '超过10天', | |
4142 | + value: 10, | |
4143 | + }, | |
4144 | + ]; | |
4145 | + const options4 = [ | |
4146 | + { | |
4147 | + label: '超过30天', | |
4148 | + value: 30, | |
4149 | + }, | |
4150 | + { | |
4151 | + label: '超过75天', | |
4152 | + value: 75, | |
4153 | + }, | |
4154 | + { | |
4155 | + label: '超过90天', | |
4156 | + value: 90, | |
4157 | + }, | |
4158 | + { | |
4159 | + label: '超过120天', | |
4160 | + value: 120, | |
4247 | 4161 | }, |
4248 | 4162 | ]; |
4249 | - const [value2, setValue2] = useState(); | |
4250 | - const radioOnChange2 = ({ target: { value } }) => { | |
4163 | + //选择天数 | |
4164 | + const [calDate, setCalDate] = useState<string | null>(null); | |
4165 | + const [value1, setValue1] = useState(0); | |
4166 | + const radioOnChange1 = ({ target: { value } }) => { | |
4251 | 4167 | const currentDate = new Date(); |
4252 | - | |
4253 | 4168 | // 创建一个新的日期对象,并在当前日期的基础上加上 daysToAdd 天 |
4254 | 4169 | const newDate = new Date(currentDate); |
4255 | 4170 | newDate.setDate(currentDate.getDate() - value); |
4256 | 4171 | const formattedDate = format(newDate, 'yyyy-MM-dd HH:mm:ss'); |
4257 | - setCalDate2(formattedDate); | |
4258 | - setValue2(value); | |
4259 | - }; | |
4260 | - const confirmInvoice = async () => { | |
4261 | - let flat = [...subOrderSelectedMap.values()].flat().map((item) => item.id); | |
4262 | - const data = await postServiceOrderConfirmInvoice({ | |
4263 | - data: flat, | |
4264 | - }); | |
4265 | - if (data.result === RESPONSE_CODE.SUCCESS) { | |
4266 | - message.success(data.message); | |
4267 | - refreshTable(); | |
4268 | - } | |
4172 | + setCalDate(formattedDate); | |
4173 | + setValue1(value); | |
4174 | + console.log(formattedDate, '5656formattedDate/value', value); | |
4269 | 4175 | }; |
4270 | 4176 | const [invoiceWarningNum, setInvoiceWarningNum] = useState(0); |
4271 | 4177 | const [invoiceRefundWarningNum, setInvoiceRefundWarningNum] = useState(0); |
4178 | + const [waitConfirmPayment, setWaitConfirmPayment] = useState(0); | |
4179 | + const [waitFeedback, setWaitFeedback] = useState(0); | |
4272 | 4180 | async function getInvoiceWarningNum() { |
4273 | 4181 | const res = await postServiceOrderWarningOrderStatistics(); |
4274 | 4182 | setInvoiceWarningNum(res.data.waitConfirmInvoice); |
4275 | 4183 | setInvoiceRefundWarningNum(res.data.waitConfirmReceipt); |
4184 | + setWaitConfirmPayment(res.data.waitConfirmPayment); | |
4185 | + setWaitFeedback(res.data.waitFeedback); | |
4276 | 4186 | } |
4277 | 4187 | useEffect(() => { |
4278 | 4188 | //预警订单数 |
... | ... | @@ -4281,1387 +4191,815 @@ const OrderPage = () => { |
4281 | 4191 | //biaojiup |
4282 | 4192 | // 监听 calDate 变化,触发请求 |
4283 | 4193 | useEffect(() => { |
4284 | - if (calDate) { | |
4285 | - mainTableRef.current?.reload(); | |
4286 | - } | |
4194 | + mainTableRef.current?.reload(); | |
4287 | 4195 | }, [calDate]); |
4288 | - | |
4289 | - const request = async (params: any, sorter: any, filter: any) => { | |
4290 | - let orderIds = mainTableFormRef.current?.getFieldValue('id'); | |
4291 | - let subOrderId = mainTableFormRef.current?.getFieldValue('subOrderId'); | |
4292 | - params.id = params.id || orderIds; | |
4293 | - params.subOrderId = params.subOrderId || subOrderId; | |
4294 | - if (params.id !== '') { | |
4295 | - params.id = params.id?.replace(/ /g, ''); | |
4296 | - if (params.id?.indexOf(',')) { | |
4297 | - params.id = params.id.split(','); | |
4298 | - params.id = params.id.filter((id) => id !== ''); | |
4299 | - } | |
4300 | - } | |
4301 | - params.salesCode = userInfo.username; | |
4302 | - params.condition = filterCondifion; | |
4303 | - params.paymentMethod = 'UNPAID'; | |
4304 | - params.sorted = sorted; | |
4305 | - // params.isDeleteQueryOrder = filterCondifion === 70; | |
4306 | - params.isDeleteQueryOrder = false; | |
4307 | - params.warningStatus = 'invoiceConfirmWarning'; | |
4308 | - // params.invoicingStatusNe = 'UN_INVOICE'; | |
4309 | - if (calDate === 'null') { | |
4310 | - params.applyTimeLe = null; | |
4311 | - } else { | |
4312 | - params.applyTimeLe = calDate; | |
4313 | - } | |
4314 | - params.applyTimeIsNotNull = true; | |
4315 | - setSearchParam(params); | |
4316 | - | |
4317 | - const res = await postServiceOrderQueryServiceOrder({ | |
4318 | - sorter, | |
4319 | - filter, | |
4320 | - data: { ...params, invoicingEndTime: calDate }, | |
4321 | - }); | |
4322 | - console.log(res.data, '5656request'); | |
4323 | - | |
4324 | - const data = res.data; | |
4325 | - setRolePath(data.specialPath); | |
4326 | - setSubOrderCount(data.count); | |
4327 | - setAllMainChecked(false); | |
4328 | - setSelectedMainOrderKeys([]); | |
4329 | - subOrderSelectedMap.clear(); | |
4330 | - mainOrderSelectedMap.clear(); | |
4331 | - setData(data?.data); | |
4332 | - | |
4333 | - mainOrderIdSubOrderIdRelationsMap.clear(); | |
4334 | - for (let row of data?.data) { | |
4335 | - let mianOrderId = row.id; | |
4336 | - let subOrderIds = row.subOrderInformationLists?.map((item) => { | |
4337 | - item.totalPayment = row.totalPayment; | |
4338 | - return item.id; | |
4339 | - }); | |
4340 | - mainOrderIdSubOrderIdRelationsMap.set(mianOrderId, subOrderIds); | |
4341 | - } | |
4342 | - | |
4343 | - return { | |
4344 | - data: data?.data || [], | |
4345 | - total: data?.total || 0, | |
4346 | - }; | |
4347 | - }; | |
4348 | - //biaojidown | |
4349 | - | |
4350 | - //biaojiup2 | |
4351 | - // 监听 calDate 变化,触发请求 | |
4352 | - useEffect(() => { | |
4353 | - if (calDate2) { | |
4354 | - // mainTableRef.current?.reload(); | |
4355 | - mainTableSecondRef.current?.reload(); | |
4356 | - } | |
4357 | - }, [calDate2]); | |
4358 | 4196 | useEffect(() => { |
4359 | - if (activeTabKey === '1') { | |
4360 | - mainTableRef.current?.reload(); // **修改位置:在选择第二个标签时请求request2** | |
4361 | - } | |
4362 | - if (activeTabKey === '2') { | |
4363 | - mainTableSecondRef.current?.reload(); // **修改位置:在选择第二个标签时请求request2** | |
4197 | + if ( | |
4198 | + activeTabKey === 1 || | |
4199 | + activeTabKey === 2 || | |
4200 | + activeTabKey === 3 || | |
4201 | + activeTabKey === 4 | |
4202 | + ) { | |
4203 | + setValue1(0); // 清空 value1 | |
4364 | 4204 | } |
4205 | + // const currentDate = new Date(); | |
4206 | + // const newDate = new Date(currentDate); | |
4207 | + // newDate.setDate(currentDate.getDate() - 0); | |
4208 | + // console.log(value1, '5656value1'); | |
4209 | + mainTableRef.current?.reload(); // **修改位置:在选择第二个标签时请求request2** | |
4365 | 4210 | }, [activeTabKey]); |
4366 | - | |
4367 | - const request2 = async ( | |
4368 | - // 第一个参数 params 查询表单和 params 参数的结合 | |
4369 | - // 第一个参数中一定会有 pageSize 和 current ,这两个参数是 antd 的规范 | |
4370 | - params, | |
4371 | - sorter, | |
4372 | - filter, | |
4373 | - ) => { | |
4374 | - params.warningStatus = 'paymentReceiptStatusWarning'; | |
4375 | - params.paymentMethod = 'UNPAID'; | |
4376 | - params.salesCode = userInfo.username; | |
4377 | - if (calDate2 === 'null') { | |
4378 | - params.invoiceConfirmStatusDatetimeLe = null; | |
4379 | - } else { | |
4380 | - params.invoiceConfirmStatusDatetimeLe = calDate2; | |
4381 | - } | |
4382 | - //订单id处理 | |
4383 | - /** | |
4384 | - * 以params中的id为主,如果params没id,则取url中的id | |
4385 | - * 第一次进来这个页面,url带有id的话,会自动填充到查询表单中,但是第一次查询params不会带这个id进来 | |
4386 | - */ | |
4387 | - let orderIds = mainTableSecondFormRef.current?.getFieldValue('id'); | |
4388 | - let subOrderId = | |
4389 | - mainTableSecondFormRef.current?.getFieldValue('subOrderId'); | |
4390 | - params.id = params.id || orderIds; | |
4391 | - params.subOrderId = params.subOrderId || subOrderId; | |
4392 | - if (params.id !== '') { | |
4393 | - params.id = params.id?.replace(/ /g, ''); | |
4394 | - if (params.id?.indexOf(',')) { | |
4395 | - params.id = params.id.split(','); | |
4396 | - params.id = params.id.filter((id) => { | |
4397 | - return id !== ''; | |
4398 | - }); | |
4399 | - } | |
4400 | - } | |
4401 | - | |
4402 | - params.condition = filterCondifion; | |
4403 | - | |
4404 | - //排序 | |
4405 | - params.sorted = sorted; | |
4406 | - //是否只查看已作废 | |
4407 | - params.isDeleteQueryOrder = filterCondifion === 70; | |
4408 | - params.paymentNotReceipt = true; | |
4409 | - //保存这个搜索条件 | |
4410 | - setSearchParam(params); | |
4411 | - | |
4412 | - //订单标记2 | |
4413 | - const { data } = await postServiceOrderQueryServiceOrder({ | |
4414 | - // ...params, | |
4415 | - // FIXME: remove @ts-ignore | |
4416 | - // @ts-ignore | |
4417 | - sorter, | |
4418 | - filter, | |
4419 | - data: { ...params }, | |
4420 | - }); | |
4421 | - console.log(data, '5656request2'); | |
4422 | - | |
4423 | - setRolePath(data.specialPath); | |
4424 | - setSubOrderCount(data.count); | |
4425 | - setAllMainChecked(false); | |
4426 | - setSelectedMainOrderKeys([]); | |
4427 | - subOrderSelectedMap.clear(); | |
4428 | - mainOrderSelectedMap.clear(); | |
4429 | - setData(data?.data); | |
4430 | - | |
4431 | - //主订单id与子订单id的对照关系保存 | |
4432 | - mainOrderIdSubOrderIdRelationsMap.clear(); | |
4433 | - for (let row of data?.data) { | |
4434 | - let mianOrderId = row.id; | |
4435 | - let subOrderIds = row.subOrderInformationLists?.map((item) => { | |
4436 | - //目前子订单存储的totalPayment不准确,这里重新处理取主订单的totalPayment | |
4437 | - //totalPayment在财务开票计算金额时使用到 | |
4438 | - item.totalPayment = row.totalPayment; | |
4439 | - return item.id; | |
4440 | - }); | |
4441 | - mainOrderIdSubOrderIdRelationsMap.set(mianOrderId, subOrderIds); | |
4211 | + // 修改位置:监听 value1 的变化 | |
4212 | + useEffect(() => { | |
4213 | + if (value1 === 0) { | |
4214 | + // 这里执行你希望在 value1 为 0 时的逻辑 | |
4215 | + mainTableRef.current?.reload(); // 重新请求数据 | |
4442 | 4216 | } |
4217 | + }, [value1]); // 添加了 value1 作为依赖 | |
4443 | 4218 | |
4444 | - return { | |
4445 | - data: data?.data || [], | |
4446 | - total: data?.total || 0, | |
4447 | - }; | |
4448 | - }; | |
4449 | 4219 | //biaojidown2 |
4450 | 4220 | //取消单选,将时间设为null |
4451 | 4221 | const handleSetNull = () => { |
4452 | - setCalDate('null'); // 这应该会触发 useEffect | |
4453 | - }; | |
4454 | - const handleSetNull2 = () => { | |
4455 | - setCalDate2('null'); // 这应该会触发 useEffect | |
4222 | + setCalDate(null); // 这应该会触发 useEffect | |
4456 | 4223 | }; |
4457 | - const tabsItems = [ | |
4224 | + const warningOptions = [ | |
4225 | + { | |
4226 | + value: 1, | |
4227 | + label: ( | |
4228 | + <span> | |
4229 | + 确认收货预警 | |
4230 | + <Badge count={waitConfirmPayment} style={{ marginLeft: 8 }} /> | |
4231 | + </span> | |
4232 | + ), | |
4233 | + }, | |
4458 | 4234 | { |
4459 | - key: '1', | |
4235 | + value: 2, | |
4460 | 4236 | label: ( |
4461 | 4237 | <span> |
4462 | - 发票确认预警 | |
4238 | + 回访登记预警 | |
4239 | + <Badge count={waitFeedback} style={{ marginLeft: 8 }} /> | |
4240 | + </span> | |
4241 | + ), | |
4242 | + }, | |
4243 | + { | |
4244 | + value: 3, | |
4245 | + label: ( | |
4246 | + <span> | |
4247 | + 确认发票预警 | |
4463 | 4248 | <Badge count={invoiceWarningNum} style={{ marginLeft: 8 }} /> |
4464 | 4249 | </span> |
4465 | 4250 | ), |
4466 | - children: ( | |
4467 | - <div> | |
4468 | - <div style={{ position: 'relative' }}> | |
4469 | - {/* <Radio.Group options={options1} onChange={radioOnChange1} value={value1} /> */} | |
4470 | - <Radio.Group | |
4471 | - value={value1} | |
4472 | - onChange={radioOnChange1} | |
4473 | - // 通过 onClick 处理单独 Radio 的点击事件 | |
4474 | - > | |
4475 | - {options1.map((option) => ( | |
4476 | - <Radio | |
4477 | - key={option.value} | |
4478 | - value={option.value} | |
4479 | - onClick={(e) => { | |
4480 | - radioOnChange1( | |
4481 | - e as unknown as React.ChangeEvent<HTMLInputElement>, | |
4482 | - ); | |
4483 | - handleSetNull(); | |
4484 | - }} | |
4485 | - > | |
4486 | - {option.label} | |
4487 | - </Radio> | |
4488 | - ))} | |
4489 | - </Radio.Group> | |
4490 | - <Button | |
4491 | - size="large" | |
4492 | - type="primary" | |
4493 | - onClick={confirmInvoice} | |
4494 | - style={{ position: 'absolute', right: '20px' }} | |
4495 | - > | |
4496 | - 确认发票 | |
4497 | - </Button> | |
4498 | - </div> | |
4499 | - <div style={{ height: '25px' }}></div> | |
4500 | - <ProTable | |
4501 | - id="main-table" | |
4502 | - // tableStyle={{backgroundColor:'red'}} | |
4503 | - | |
4504 | - actionRef={mainTableRef} | |
4505 | - formRef={mainTableFormRef} | |
4506 | - expandIconColumnIndex={-1} | |
4507 | - columns={mainOrdersColumns} | |
4508 | - rowKey="id" | |
4509 | - pagination={{ | |
4510 | - showQuickJumper: true, | |
4511 | - pageSize: pageSize, | |
4512 | - current: currentPage, | |
4513 | - showSizeChanger: true, | |
4514 | - onChange: (page, size) => { | |
4515 | - setPageSize(size); | |
4516 | - setCurrentPage(page); | |
4517 | - }, | |
4518 | - showTotal: (total, range) => { | |
4519 | - return ( | |
4520 | - <> | |
4521 | - <span> | |
4522 | - {'第 ' + | |
4523 | - range[0] + | |
4524 | - '-' + | |
4525 | - range[1] + | |
4526 | - ' 条/总共 ' + | |
4527 | - total + | |
4528 | - ' 条主订单 '} | |
4529 | - </span> | |
4530 | - <span className="text-[#8C8C8C]"> | |
4531 | - {' (' + subOrderCount + ' 条子订单)'} | |
4532 | - </span> | |
4533 | - </> | |
4534 | - ); | |
4535 | - }, | |
4536 | - }} | |
4537 | - // showHeader={false} | |
4538 | - expandedRowKeys={expandedRowKeys} | |
4539 | - // expandable={{ expandedRowRender }} | |
4540 | - dateFormatter="string" | |
4541 | - options={false} | |
4542 | - headerTitle="" | |
4543 | - search={false} | |
4544 | - // labelWidth: 'auto', | |
4545 | - // onCollapse: resize, | |
4546 | - // request={request} | |
4547 | - request={activeTabKey === '1' ? request : null} // **条件请求** | |
4548 | - toolbar={{ | |
4549 | - multipleLine: true, | |
4251 | + }, | |
4252 | + { | |
4253 | + value: 4, | |
4254 | + label: ( | |
4255 | + <span> | |
4256 | + 订单回款预警 | |
4257 | + <Badge count={invoiceRefundWarningNum} style={{ marginLeft: 8 }} /> | |
4258 | + </span> | |
4259 | + ), | |
4260 | + }, | |
4261 | + ]; | |
4262 | + | |
4263 | + return ( | |
4264 | + <div className="order-page-container"> | |
4265 | + <div id="resizeDiv"></div> | |
4266 | + <div key={'activeTabKey'}> | |
4267 | + <Radio.Group | |
4268 | + options={warningOptions} | |
4269 | + onChange={(e) => { | |
4270 | + setActiveTabKey(e.target.value); | |
4271 | + mainTableRef.current?.reload(); // 重新请求数据 | |
4272 | + }} | |
4273 | + value={activeTabKey} | |
4274 | + optionType="button" | |
4275 | + /> | |
4276 | + </div> | |
4277 | + <div style={{ height: '25px' }}></div> | |
4278 | + {/* <Tabs defaultActiveKey="1" items={tabsItems} onChange={() => { }} /> */} | |
4279 | + <Radio.Group | |
4280 | + value={value1} | |
4281 | + onChange={radioOnChange1} | |
4282 | + // 通过 onClick 处理单独 Radio 的点击事件 | |
4283 | + > | |
4284 | + {(activeTabKey === 1 | |
4285 | + ? options1 | |
4286 | + : activeTabKey === 2 | |
4287 | + ? options2 | |
4288 | + : activeTabKey === 3 | |
4289 | + ? options3 | |
4290 | + : options4 | |
4291 | + ).map((option) => ( | |
4292 | + <Radio | |
4293 | + key={option.value} | |
4294 | + value={option.value} | |
4295 | + onClick={(e) => { | |
4296 | + radioOnChange1( | |
4297 | + e as unknown as React.ChangeEvent<HTMLInputElement>, | |
4298 | + ); | |
4299 | + handleSetNull(); | |
4550 | 4300 | }} |
4551 | - // toolBarRender={() => { | |
4552 | - // return toolBarRender(); | |
4553 | - // }} | |
4554 | - /> | |
4301 | + > | |
4302 | + {option.label} | |
4303 | + </Radio> | |
4304 | + ))} | |
4305 | + </Radio.Group> | |
4306 | + <div style={{ height: '25px' }}></div> | |
4307 | + <ProTable | |
4308 | + id="main-table" | |
4309 | + // tableStyle={{backgroundColor:'red'}} | |
4555 | 4310 | |
4556 | - {orderDrawerVisible && ( | |
4557 | - <OrderDrawer | |
4558 | - data={orderOptType === 'add' ? {} : buildMainOrder()} | |
4559 | - subOrders={orderOptType === 'add' ? [] : buildSubOrders()} | |
4560 | - onClose={(isSuccess: boolean) => { | |
4561 | - setOrderDrawerVisible(false); | |
4562 | - clearOptObject(); | |
4563 | - if (isSuccess) { | |
4564 | - refreshTable(); | |
4565 | - } | |
4566 | - }} | |
4567 | - orderOptType={orderOptType} | |
4568 | - /> | |
4569 | - )} | |
4311 | + actionRef={mainTableRef} | |
4312 | + formRef={mainTableFormRef} | |
4313 | + expandIconColumnIndex={-1} | |
4314 | + columns={mainOrdersColumns} | |
4315 | + rowKey="id" | |
4316 | + pagination={{ | |
4317 | + showQuickJumper: true, | |
4318 | + pageSize: pageSize, | |
4319 | + current: currentPage, | |
4320 | + showSizeChanger: true, | |
4321 | + onChange: (page, size) => { | |
4322 | + setPageSize(size); | |
4323 | + setCurrentPage(page); | |
4324 | + }, | |
4325 | + showTotal: (total, range) => { | |
4326 | + return ( | |
4327 | + <> | |
4328 | + <span> | |
4329 | + {'第 ' + | |
4330 | + range[0] + | |
4331 | + '-' + | |
4332 | + range[1] + | |
4333 | + ' 条/总共 ' + | |
4334 | + total + | |
4335 | + ' 条主订单 '} | |
4336 | + </span> | |
4337 | + <span className="text-[#8C8C8C]"> | |
4338 | + {' (' + subOrderCount + ' 条子订单)'} | |
4339 | + </span> | |
4340 | + </> | |
4341 | + ); | |
4342 | + }, | |
4343 | + }} | |
4344 | + // showHeader={false} | |
4345 | + expandedRowKeys={expandedRowKeys} | |
4346 | + // expandable={{ expandedRowRender }} | |
4347 | + dateFormatter="string" | |
4348 | + options={false} | |
4349 | + headerTitle="" | |
4350 | + search={false} | |
4351 | + request={async ( | |
4352 | + // 第一个参数 params 查询表单和 params 参数的结合 | |
4353 | + // 第一个参数中一定会有 pageSize 和 current ,这两个参数是 antd 的规范 | |
4354 | + params, | |
4355 | + sorter, | |
4356 | + filter, | |
4357 | + ) => { | |
4358 | + //订单id处理 | |
4359 | + /** | |
4360 | + * 以params中的id为主,如果params没id,则取url中的id | |
4361 | + * 第一次进来这个页面,url带有id的话,会自动填充到查询表单中,但是第一次查询params不会带这个id进来 | |
4362 | + */ | |
4363 | + let orderIds = mainTableFormRef.current?.getFieldValue('id'); | |
4364 | + let subOrderId = | |
4365 | + mainTableFormRef.current?.getFieldValue('subOrderId'); | |
4366 | + params.id = params.id || orderIds; | |
4367 | + params.subOrderId = params.subOrderId || subOrderId; | |
4368 | + if (params.id !== '') { | |
4369 | + params.id = params.id?.replace(/ /g, ''); | |
4370 | + if (params.id?.indexOf(',')) { | |
4371 | + params.id = params.id.split(','); | |
4372 | + params.id = params.id.filter((id) => { | |
4373 | + return id !== ''; | |
4374 | + }); | |
4375 | + } | |
4376 | + } | |
4570 | 4377 | |
4571 | - {checkVisible && ( | |
4572 | - <CheckModal | |
4573 | - setCheckVisible={(val: boolean) => { | |
4574 | - setCheckVisible(val); | |
4575 | - if (!val) { | |
4576 | - clearOptObject(); | |
4577 | - } | |
4578 | - }} | |
4579 | - data={isMainOrder ? getFirstMainOrder() : buildMainOrder()} | |
4580 | - subOrders={ | |
4581 | - isMainOrder | |
4582 | - ? [...subOrderSelectedMap.values()].flat() | |
4583 | - : buildSubOrders() | |
4584 | - } | |
4585 | - orderCheckType={orderCheckType} | |
4586 | - openOrderDrawer={(type: any, id: any) => { | |
4587 | - setCurrentMainId(id); | |
4588 | - setOrderOptType(type); | |
4589 | - setOrderDrawerVisible(true); | |
4590 | - }} | |
4591 | - onClose={() => { | |
4592 | - clearOptObject(); | |
4593 | - setCheckVisible(false); | |
4594 | - refreshTable(); | |
4595 | - }} | |
4596 | - /> | |
4597 | - )} | |
4598 | - | |
4599 | - {applyForInvoicingVisible && ( | |
4600 | - <ApplyForInvoicingModal | |
4601 | - setCheckVisible={(val: boolean) => { | |
4602 | - setApplyForInvoicingVisible(val); | |
4603 | - if (!val) { | |
4604 | - clearOptObject(); | |
4605 | - } | |
4606 | - }} | |
4607 | - subOrders={ | |
4608 | - isMainOrder | |
4609 | - ? [...subOrderSelectedMap.values()].flat() | |
4610 | - : buildSubOrders() | |
4611 | - } | |
4612 | - totalPayment={getApplyInvoicingTotalPayment()} | |
4613 | - isMainOrder={isMainOrder} | |
4614 | - isEdit={isEdit} | |
4615 | - onClose={() => { | |
4616 | - setApplyForInvoicingVisible(false); | |
4617 | - setIsMainOrder(false); | |
4618 | - clearOptObject(); | |
4619 | - refreshTable(); | |
4620 | - }} | |
4621 | - /> | |
4622 | - )} | |
4623 | - | |
4624 | - {notesEditVisible && ( | |
4625 | - <OrderNotesEditModal | |
4626 | - setNotesEditVisible={(val: boolean) => { | |
4627 | - setNotesEditVisible(val); | |
4628 | - if (!val) { | |
4629 | - clearOptObject(); | |
4630 | - } | |
4631 | - }} | |
4632 | - ids={selectedRows} | |
4633 | - notesType={notesType} | |
4634 | - notes={notes} | |
4635 | - onClose={() => { | |
4636 | - setNotesEditVisible(false); | |
4637 | - setSelectedRows([]); | |
4638 | - setNotes(notes); | |
4639 | - setNotesType(1); | |
4640 | - refreshTable(); | |
4641 | - }} | |
4642 | - /> | |
4643 | - )} | |
4644 | - | |
4645 | - {deliverVisible && ( | |
4646 | - <DeliverModal | |
4647 | - data={buildSubOrders()} | |
4648 | - isSendProduct={isSendProduct} | |
4649 | - setVisible={(val: boolean) => { | |
4650 | - setDeliverVisible(val); | |
4651 | - if (!val) { | |
4652 | - clearOptObject(); | |
4653 | - } | |
4654 | - }} | |
4655 | - sendType={orderCheckType} | |
4656 | - onClose={() => { | |
4657 | - clearOptObject(); | |
4658 | - setDeliverVisible(false); | |
4659 | - setIsSendProduct(false); | |
4660 | - refreshTable(); | |
4661 | - }} | |
4662 | - /> | |
4663 | - )} | |
4664 | - | |
4665 | - {financialVisible && ( | |
4666 | - <FinancialDrawer | |
4667 | - isEdit={isEdit} | |
4668 | - mainOrder={isMainOrder ? getFirstMainOrder() : buildMainOrder()} | |
4669 | - subOrders={ | |
4670 | - isMainOrder | |
4671 | - ? [...subOrderSelectedMap.values()].flat() | |
4672 | - : buildSubOrders() | |
4673 | - } | |
4674 | - isMainOrder={isMainOrder} | |
4675 | - cancel={() => { | |
4676 | - setFinancialVisible(false); | |
4677 | - clearOptObject(); | |
4678 | - setIsMainOrder(false); | |
4679 | - setIsEdit(false); | |
4680 | - }} | |
4681 | - onClose={() => { | |
4682 | - setFinancialVisible(false); | |
4683 | - clearOptObject(); | |
4684 | - refreshTable(); | |
4685 | - setIsMainOrder(false); | |
4686 | - setIsEdit(false); | |
4687 | - }} | |
4688 | - /> | |
4689 | - )} | |
4690 | - | |
4691 | - {financialEditVisible && ( | |
4692 | - <FinancialEditDrawer | |
4693 | - mainOrder={buildMainOrder()} | |
4694 | - subOrders={buildSubOrders()} | |
4695 | - isMainOrder={isMainOrder} | |
4696 | - setVisible={() => { | |
4697 | - setFinancialEditVisible(false); | |
4698 | - clearOptObject(); | |
4699 | - }} | |
4700 | - onClose={() => { | |
4701 | - setFinancialEditVisible(false); | |
4702 | - refreshTable(); | |
4703 | - setIsMainOrder(false); | |
4704 | - clearOptObject(); | |
4705 | - }} | |
4706 | - /> | |
4707 | - )} | |
4708 | - | |
4709 | - {orderPrintVisible && ( | |
4710 | - <OrderPrintModal | |
4711 | - mainOrder={buildMainOrder()} | |
4712 | - subOrders={buildSubOrders()} | |
4713 | - isRePrint={isRePrintOrder} | |
4714 | - setVisible={(val: boolean) => { | |
4715 | - setOrderPrintVisible(val); | |
4716 | - if (!val) { | |
4717 | - clearOptObject(); | |
4718 | - } | |
4719 | - }} | |
4720 | - printOptType={orderCheckType} | |
4721 | - onClose={() => { | |
4722 | - setOrderPrintVisible(false); | |
4723 | - clearOptObject(); | |
4724 | - setIsRePrintOrder(false); | |
4725 | - refreshTable(); | |
4726 | - }} | |
4727 | - /> | |
4728 | - )} | |
4729 | - | |
4730 | - {confirmReceiptVisible && ( | |
4731 | - <ConfirmReceiptModal | |
4732 | - data={buildSubOrders()} | |
4733 | - onClose={() => { | |
4734 | - setConfirmReceiptVisible(false); | |
4735 | - clearOptObject(); | |
4736 | - refreshTable(); | |
4737 | - }} | |
4738 | - /> | |
4739 | - )} | |
4740 | - | |
4741 | - {imagesViewerModalVisible && ( | |
4742 | - <ImagesViewerModal | |
4743 | - optType={imagesViewerOptType} | |
4744 | - setVisible={(val: boolean) => { | |
4745 | - setImagesViewerModalVisible(val); | |
4746 | - if (!val) { | |
4747 | - clearOptObject(); | |
4748 | - } | |
4749 | - }} | |
4750 | - onClose={() => { | |
4751 | - setImagesViewerModalVisible(false); | |
4752 | - }} | |
4753 | - orderRow={buildSubOrders()[0]} | |
4754 | - /> | |
4755 | - )} | |
4756 | - | |
4757 | - {importModalVisible && ( | |
4758 | - <ImportModal | |
4759 | - onClose={() => { | |
4760 | - setImportModalVisible(false); | |
4761 | - refreshTable(); | |
4762 | - }} | |
4763 | - /> | |
4764 | - )} | |
4765 | - | |
4766 | - {attachmentModalVisible && ( | |
4767 | - <AttachmentModal | |
4768 | - data={buildSubOrders()[0]} | |
4769 | - onClose={() => { | |
4770 | - setAttachmentModalVisible(false); | |
4771 | - clearOptObject(); | |
4772 | - }} | |
4773 | - /> | |
4774 | - )} | |
4775 | - | |
4776 | - {historyModalVisible && ( | |
4777 | - <HistoryModal | |
4778 | - subOrders={selectedRows} | |
4779 | - isCancelledOrder={filterCondifion === 70} | |
4780 | - onClose={() => { | |
4781 | - setHistoryModalVisible(false); | |
4782 | - setSelectedRows({}); | |
4783 | - clearOptObject(); | |
4784 | - }} | |
4785 | - /> | |
4786 | - )} | |
4787 | - | |
4788 | - {deliverInfoDrawerVisible && ( | |
4789 | - <DeliverInfoDrawer | |
4790 | - data={buildMainOrder()} | |
4791 | - onClose={() => { | |
4792 | - setDeliverInfoDrawerVisible(false); | |
4793 | - clearOptObject(); | |
4794 | - }} | |
4795 | - /> | |
4796 | - )} | |
4797 | - | |
4798 | - {deliverInfoDrawerVisible && ( | |
4799 | - <DeliverInfoDrawer | |
4800 | - data={buildMainOrder()} | |
4801 | - onClose={() => { | |
4802 | - setDeliverInfoDrawerVisible(false); | |
4803 | - clearOptObject(); | |
4804 | - }} | |
4805 | - /> | |
4806 | - )} | |
4807 | - | |
4808 | - {procureCheckModalVisible && ( | |
4809 | - <ProcureCheckModal | |
4810 | - setCheckVisible={(val: boolean) => { | |
4811 | - setProcureCheckModalVisible(val); | |
4812 | - if (!val) { | |
4813 | - clearOptObject(); | |
4814 | - } | |
4815 | - }} | |
4816 | - isMainOrder={isMainOrder} | |
4817 | - orders={ | |
4818 | - isMainOrder | |
4819 | - ? [...subOrderSelectedMap.values()].flat() | |
4820 | - : buildSubOrders() | |
4821 | - } | |
4822 | - onClose={() => { | |
4823 | - setProcureCheckModalVisible(false); | |
4824 | - clearOptObject(); | |
4825 | - setIsMainOrder(false); | |
4826 | - refreshTable(); | |
4827 | - }} | |
4828 | - /> | |
4829 | - )} | |
4830 | - | |
4831 | - {afterSalesDrawerVisible && ( | |
4832 | - <AfterSalesDrawer | |
4833 | - setVisible={(val: boolean) => { | |
4834 | - setAfterSalesDrawerVisible(val); | |
4835 | - if (!val) { | |
4836 | - clearOptObject(); | |
4837 | - } | |
4838 | - }} | |
4839 | - mainOrder={buildMainOrder()} | |
4840 | - subOrders={buildSubOrders()} | |
4841 | - onClose={() => { | |
4842 | - setAfterSalesDrawerVisible(false); | |
4843 | - clearOptObject(); | |
4844 | - refreshTable(); | |
4845 | - }} | |
4846 | - /> | |
4847 | - )} | |
4848 | - | |
4849 | - {procureConvertModalVisible && ( | |
4850 | - <ProcureConvertModal | |
4851 | - setVisible={(val: boolean) => { | |
4852 | - setProcureConvertModalVisible(val); | |
4853 | - if (!val) { | |
4854 | - clearOptObject(); | |
4855 | - } | |
4856 | - }} | |
4857 | - subOrders={buildSubOrders()} | |
4858 | - onClose={() => { | |
4859 | - setProcureConvertModalVisible(false); | |
4860 | - clearOptObject(); | |
4861 | - refreshTable(); | |
4862 | - }} | |
4863 | - /> | |
4864 | - )} | |
4865 | - | |
4866 | - {financialMergeDrawerVisible && ( | |
4867 | - <FinancialMergeDrawer | |
4868 | - setVisible={(val: boolean) => { | |
4869 | - setFinancialMergeDrawerVisible(val); | |
4870 | - if (!val) { | |
4871 | - clearOptObject(); | |
4872 | - } | |
4873 | - }} | |
4874 | - dataList={ | |
4875 | - isMainOrder | |
4876 | - ? [...subOrderSelectedMap.values()].flat() | |
4877 | - : buildSubOrders() | |
4878 | - } | |
4879 | - onClose={() => { | |
4880 | - setFinancialMergeDrawerVisible(false); | |
4881 | - setIsMainOrder(false); | |
4882 | - clearOptObject(); | |
4883 | - refreshTable(); | |
4884 | - }} | |
4885 | - /> | |
4886 | - )} | |
4887 | - | |
4888 | - {financialReceiptsModalVisible && ( | |
4889 | - <FinancialReceiptsModal | |
4890 | - setVisible={(val: boolean) => { | |
4891 | - setFinancialReceiptsModalVisible(val); | |
4892 | - if (!val) { | |
4893 | - clearOptObject(); | |
4894 | - } | |
4895 | - }} | |
4896 | - datas={selectedRows} | |
4897 | - onClose={() => { | |
4898 | - setFinancialReceiptsModalVisible(false); | |
4899 | - setSelectedRows({}); | |
4900 | - refreshTable(); | |
4901 | - }} | |
4902 | - /> | |
4903 | - )} | |
4904 | - | |
4905 | - {shippingWarehouseChangeModalVisible && ( | |
4906 | - <ShippingWarehouseChangeModal | |
4907 | - setVisible={(val: boolean) => { | |
4908 | - setShippingWarehouseChangeModalVisible(val); | |
4909 | - if (!val) { | |
4910 | - clearOptObject(); | |
4911 | - } | |
4912 | - }} | |
4913 | - subOrderIds={ids} | |
4914 | - originShippingWarehouse={buildSubOrders()[0].shippingWarehouse} | |
4915 | - onClose={() => { | |
4916 | - setShippingWarehouseChangeModalVisible(false); | |
4917 | - clearOptObject(); | |
4918 | - setIds([]); | |
4919 | - refreshTable(); | |
4920 | - }} | |
4921 | - /> | |
4922 | - )} | |
4923 | - {reissueVisible && ( | |
4924 | - <ReissueModal | |
4925 | - setVisible={(val: boolean) => { | |
4926 | - setReissueVisible(val); | |
4927 | - if (!val) { | |
4928 | - clearOptObject(); | |
4929 | - } | |
4930 | - }} | |
4931 | - subOrders={ | |
4932 | - isMainOrder | |
4933 | - ? [...subOrderSelectedMap.values()].flat() | |
4934 | - : buildSubOrders() | |
4935 | - } | |
4936 | - onClose={() => { | |
4937 | - setReissueVisible(false); | |
4938 | - clearOptObject(); | |
4939 | - refreshTable(); | |
4940 | - }} | |
4941 | - /> | |
4942 | - )} | |
4943 | - {reissueVisibleOld && ( | |
4944 | - <ReissueModal_old | |
4945 | - setVisible={(val: boolean) => { | |
4946 | - setReissueVisibleOld(val); | |
4947 | - console.log(reissueVisible); | |
4948 | - if (!val) { | |
4949 | - clearOptObject(); | |
4950 | - } | |
4951 | - }} | |
4952 | - mainOrder={buildMainOrder()} | |
4953 | - subOrders={buildSubOrders()} | |
4954 | - onClose={() => { | |
4955 | - setReissueVisibleOld(false); | |
4956 | - clearOptObject(); | |
4957 | - refreshTable(); | |
4958 | - }} | |
4959 | - /> | |
4960 | - )} | |
4961 | - {productionTimeModalVisible && ( | |
4962 | - <ProductionTimeModal | |
4963 | - setVisible={(val: boolean) => { | |
4964 | - setProductionTimeModalVisible(val); | |
4965 | - if (!val) { | |
4966 | - clearOptObject(); | |
4967 | - } | |
4968 | - }} | |
4969 | - subOrders={buildSubOrders()} | |
4970 | - onClose={() => { | |
4971 | - setProductionTimeModalVisible(false); | |
4972 | - clearOptObject(); | |
4973 | - refreshTable(); | |
4974 | - }} | |
4975 | - /> | |
4976 | - )} | |
4977 | - | |
4978 | - {modifiedDiffModalVisible && ( | |
4979 | - <ModifiedDiffModal | |
4980 | - setVisible={(val: boolean) => { | |
4981 | - setModifiedDiffModalVisible(val); | |
4982 | - if (!val) { | |
4983 | - clearOptObject(); | |
4984 | - } | |
4985 | - }} | |
4986 | - subOrders={buildSubOrders()} | |
4987 | - mainOrder={buildMainOrder()} | |
4988 | - onClose={() => { | |
4989 | - setModifiedDiffModalVisible(false); | |
4990 | - clearOptObject(); | |
4991 | - }} | |
4992 | - /> | |
4993 | - )} | |
4994 | - | |
4995 | - {uploadPayBillModalVisible && ( | |
4996 | - <UploadPayBillModal | |
4997 | - setVisible={(val: boolean) => { | |
4998 | - setUploadPayBillModalVisible(val); | |
4999 | - if (!val) { | |
5000 | - clearOptObject(); | |
5001 | - } | |
5002 | - }} | |
5003 | - subOrders={buildSubOrders()} | |
5004 | - mainOrder={buildMainOrder()} | |
5005 | - onClose={() => { | |
5006 | - setUploadPayBillModalVisible(false); | |
5007 | - clearOptObject(); | |
5008 | - refreshTable(); | |
5009 | - }} | |
5010 | - /> | |
5011 | - )} | |
5012 | - {feedbackRegistrationModalVisible && ( | |
5013 | - <FeedbackRegistrationModal | |
5014 | - setVisible={(val: boolean) => { | |
5015 | - setFeedbackRegistrationModalVisible(val); | |
5016 | - if (!val) { | |
5017 | - clearOptObject(); | |
5018 | - } | |
5019 | - }} | |
5020 | - subOrders={buildSubOrders()} | |
5021 | - mainOrder={buildMainOrder()} | |
5022 | - onClose={() => { | |
5023 | - setFeedbackRegistrationModalVisible(false); | |
5024 | - clearOptObject(); | |
5025 | - refreshTable(); | |
5026 | - }} | |
5027 | - /> | |
5028 | - )} | |
5029 | - {invoicingDrawerFormVisible && ( | |
5030 | - <InvoicingDrawerForm | |
5031 | - dataList={ | |
5032 | - isMainOrder | |
5033 | - ? [...subOrderSelectedMap.values()].flat() | |
5034 | - : buildSubOrders() | |
5035 | - } | |
5036 | - setVisible={(val: boolean) => { | |
5037 | - setInvoicingDrawerFormVisible(val); | |
5038 | - if (!val) { | |
5039 | - clearOptObject(); | |
5040 | - } | |
5041 | - }} | |
5042 | - mainOrder={isMainOrder ? getFirstMainOrder() : buildMainOrder()} | |
5043 | - onClose={() => { | |
5044 | - setInvoicingDrawerFormVisible(false); | |
5045 | - setIsMainOrder(true); | |
5046 | - clearOptObject(); | |
5047 | - refreshTable(); | |
5048 | - }} | |
5049 | - /> | |
5050 | - )} | |
5051 | - {contextHolder} | |
5052 | - <FloatButton.BackTop visibilityHeight={0} /> | |
5053 | - </div> | |
5054 | - ), | |
5055 | - }, | |
5056 | - { | |
5057 | - key: '2', | |
5058 | - label: ( | |
5059 | - <span> | |
5060 | - 订单回款预警 | |
5061 | - <Badge count={invoiceRefundWarningNum} style={{ marginLeft: 8 }} /> | |
5062 | - </span> | |
5063 | - ), | |
5064 | - children: ( | |
5065 | - <div> | |
5066 | - {/* <Radio.Group options={options2} onChange={radioOnChange2} value={value2} /> */} | |
5067 | - <Radio.Group | |
5068 | - value={value2} | |
5069 | - onChange={radioOnChange2} | |
5070 | - // 通过 onClick 处理单独 Radio 的点击事件 | |
5071 | - > | |
5072 | - {options2.map((option) => ( | |
5073 | - <Radio | |
5074 | - key={option.value} | |
5075 | - value={option.value} | |
5076 | - onClick={(e) => { | |
5077 | - radioOnChange2( | |
5078 | - e as unknown as React.ChangeEvent<HTMLInputElement>, | |
5079 | - ); | |
5080 | - handleSetNull2(); | |
5081 | - }} | |
5082 | - > | |
5083 | - {option.label} | |
5084 | - </Radio> | |
5085 | - ))} | |
5086 | - </Radio.Group> | |
5087 | - <div style={{ height: '25px' }}></div> | |
5088 | - <ProTable | |
5089 | - id="main-table" | |
5090 | - // tableStyle={{backgroundColor:'red'}} | |
5091 | - | |
5092 | - actionRef={mainTableSecondRef} | |
5093 | - formRef={mainTableSecondFormRef} | |
5094 | - expandIconColumnIndex={-1} | |
5095 | - columns={mainOrdersColumns2} | |
5096 | - rowKey="id" | |
5097 | - pagination={{ | |
5098 | - showQuickJumper: true, | |
5099 | - pageSize: pageSize, | |
5100 | - current: currentPage, | |
5101 | - showSizeChanger: true, | |
5102 | - onChange: (page, size) => { | |
5103 | - setPageSize(size); | |
5104 | - setCurrentPage(page); | |
5105 | - mainTableSecondRef.current?.reload(); | |
5106 | - }, | |
5107 | - showTotal: (total, range) => { | |
5108 | - return ( | |
5109 | - <> | |
5110 | - <span> | |
5111 | - {'第 ' + | |
5112 | - range[0] + | |
5113 | - '-' + | |
5114 | - range[1] + | |
5115 | - ' 条/总共 ' + | |
5116 | - total + | |
5117 | - ' 条主订单 '} | |
5118 | - </span> | |
5119 | - <span className="text-[#8C8C8C]"> | |
5120 | - {' (' + subOrderCount + ' 条子订单)'} | |
5121 | - </span> | |
5122 | - </> | |
5123 | - ); | |
5124 | - }, | |
5125 | - }} | |
5126 | - // showHeader={false} | |
5127 | - expandedRowKeys={expandedRowKeys} | |
5128 | - // expandable={{ expandedRowRender }} | |
5129 | - dateFormatter="string" | |
5130 | - options={false} | |
5131 | - headerTitle="" | |
5132 | - search={false} | |
5133 | - // labelWidth: 'auto', | |
5134 | - // onCollapse: resize, | |
5135 | - // request={request2} | |
5136 | - request={activeTabKey === '2' ? request2 : null} // **条件请求** | |
5137 | - toolbar={{ | |
5138 | - multipleLine: true, | |
5139 | - }} | |
5140 | - // toolBarRender={() => { | |
5141 | - // return toolBarRender(); | |
5142 | - // }} | |
5143 | - /> | |
5144 | - | |
5145 | - {orderDrawerVisible && ( | |
5146 | - <OrderDrawer | |
5147 | - data={orderOptType === 'add' ? {} : buildMainOrder()} | |
5148 | - subOrders={orderOptType === 'add' ? [] : buildSubOrders()} | |
5149 | - onClose={(isSuccess: boolean) => { | |
5150 | - setOrderDrawerVisible(false); | |
5151 | - clearOptObject(); | |
5152 | - if (isSuccess) { | |
5153 | - refreshTable2(); | |
5154 | - } | |
5155 | - }} | |
5156 | - orderOptType={orderOptType} | |
5157 | - /> | |
5158 | - )} | |
5159 | - | |
5160 | - {checkVisible && ( | |
5161 | - <CheckModal | |
5162 | - setCheckVisible={(val: boolean) => { | |
5163 | - setCheckVisible(val); | |
5164 | - if (!val) { | |
5165 | - clearOptObject(); | |
5166 | - } | |
5167 | - }} | |
5168 | - data={isMainOrder ? getFirstMainOrder() : buildMainOrder()} | |
5169 | - subOrders={ | |
5170 | - isMainOrder | |
5171 | - ? [...subOrderSelectedMap.values()].flat() | |
5172 | - : buildSubOrders() | |
5173 | - } | |
5174 | - orderCheckType={orderCheckType} | |
5175 | - openOrderDrawer={(type: any, id: any) => { | |
5176 | - setCurrentMainId(id); | |
5177 | - setOrderOptType(type); | |
5178 | - setOrderDrawerVisible(true); | |
5179 | - }} | |
5180 | - onClose={() => { | |
5181 | - clearOptObject(); | |
5182 | - setCheckVisible(false); | |
5183 | - refreshTable2(); | |
5184 | - }} | |
5185 | - /> | |
5186 | - )} | |
5187 | - | |
5188 | - {applyForInvoicingVisible && ( | |
5189 | - <ApplyForInvoicingModal | |
5190 | - setCheckVisible={(val: boolean) => { | |
5191 | - setApplyForInvoicingVisible(val); | |
5192 | - if (!val) { | |
5193 | - clearOptObject(); | |
5194 | - } | |
5195 | - }} | |
5196 | - subOrders={ | |
5197 | - isMainOrder | |
5198 | - ? [...subOrderSelectedMap.values()].flat() | |
5199 | - : buildSubOrders() | |
5200 | - } | |
5201 | - totalPayment={getApplyInvoicingTotalPayment()} | |
5202 | - isMainOrder={isMainOrder} | |
5203 | - isEdit={isEdit} | |
5204 | - onClose={() => { | |
5205 | - setApplyForInvoicingVisible(false); | |
5206 | - setIsMainOrder(false); | |
5207 | - clearOptObject(); | |
5208 | - refreshTable2(); | |
5209 | - }} | |
5210 | - /> | |
5211 | - )} | |
5212 | - | |
5213 | - {notesEditVisible && ( | |
5214 | - <OrderNotesEditModal | |
5215 | - setNotesEditVisible={(val: boolean) => { | |
5216 | - setNotesEditVisible(val); | |
5217 | - if (!val) { | |
5218 | - clearOptObject(); | |
5219 | - } | |
5220 | - }} | |
5221 | - ids={selectedRows} | |
5222 | - notesType={notesType} | |
5223 | - notes={notes} | |
5224 | - onClose={() => { | |
5225 | - setNotesEditVisible(false); | |
5226 | - setSelectedRows([]); | |
5227 | - setNotes(notes); | |
5228 | - setNotesType(1); | |
5229 | - refreshTable2(); | |
5230 | - }} | |
5231 | - /> | |
5232 | - )} | |
5233 | - | |
5234 | - {deliverVisible && ( | |
5235 | - <DeliverModal | |
5236 | - data={buildSubOrders()} | |
5237 | - isSendProduct={isSendProduct} | |
5238 | - setVisible={(val: boolean) => { | |
5239 | - setDeliverVisible(val); | |
5240 | - if (!val) { | |
5241 | - clearOptObject(); | |
5242 | - } | |
5243 | - }} | |
5244 | - sendType={orderCheckType} | |
5245 | - onClose={() => { | |
5246 | - clearOptObject(); | |
5247 | - setDeliverVisible(false); | |
5248 | - setIsSendProduct(false); | |
5249 | - refreshTable2(); | |
5250 | - }} | |
5251 | - /> | |
5252 | - )} | |
5253 | - | |
5254 | - {financialVisible && ( | |
5255 | - <FinancialDrawer | |
5256 | - isEdit={isEdit} | |
5257 | - mainOrder={isMainOrder ? getFirstMainOrder() : buildMainOrder()} | |
5258 | - subOrders={ | |
5259 | - isMainOrder | |
5260 | - ? [...subOrderSelectedMap.values()].flat() | |
5261 | - : buildSubOrders() | |
5262 | - } | |
5263 | - isMainOrder={isMainOrder} | |
5264 | - cancel={() => { | |
5265 | - setFinancialVisible(false); | |
5266 | - clearOptObject(); | |
5267 | - setIsMainOrder(false); | |
5268 | - setIsEdit(false); | |
5269 | - }} | |
5270 | - onClose={() => { | |
5271 | - setFinancialVisible(false); | |
5272 | - clearOptObject(); | |
5273 | - refreshTable2(); | |
5274 | - setIsMainOrder(false); | |
5275 | - setIsEdit(false); | |
5276 | - }} | |
5277 | - /> | |
5278 | - )} | |
5279 | - | |
5280 | - {financialEditVisible && ( | |
5281 | - <FinancialEditDrawer | |
5282 | - mainOrder={buildMainOrder()} | |
5283 | - subOrders={buildSubOrders()} | |
5284 | - isMainOrder={isMainOrder} | |
5285 | - setVisible={() => { | |
5286 | - setFinancialEditVisible(false); | |
5287 | - clearOptObject(); | |
5288 | - }} | |
5289 | - onClose={() => { | |
5290 | - setFinancialEditVisible(false); | |
5291 | - refreshTable2(); | |
5292 | - setIsMainOrder(false); | |
5293 | - clearOptObject(); | |
5294 | - }} | |
5295 | - /> | |
5296 | - )} | |
5297 | - | |
5298 | - {orderPrintVisible && ( | |
5299 | - <OrderPrintModal | |
5300 | - mainOrder={buildMainOrder()} | |
5301 | - subOrders={buildSubOrders()} | |
5302 | - isRePrint={isRePrintOrder} | |
5303 | - setVisible={(val: boolean) => { | |
5304 | - setOrderPrintVisible(val); | |
5305 | - if (!val) { | |
5306 | - clearOptObject(); | |
5307 | - } | |
5308 | - }} | |
5309 | - printOptType={orderCheckType} | |
5310 | - onClose={() => { | |
5311 | - setOrderPrintVisible(false); | |
5312 | - clearOptObject(); | |
5313 | - setIsRePrintOrder(false); | |
5314 | - refreshTable2(); | |
5315 | - }} | |
5316 | - /> | |
5317 | - )} | |
5318 | - | |
5319 | - {confirmReceiptVisible && ( | |
5320 | - <ConfirmReceiptModal | |
5321 | - data={buildSubOrders()} | |
5322 | - onClose={() => { | |
5323 | - setConfirmReceiptVisible(false); | |
5324 | - clearOptObject(); | |
5325 | - refreshTable2(); | |
5326 | - }} | |
5327 | - /> | |
5328 | - )} | |
5329 | - | |
5330 | - {imagesViewerModalVisible && ( | |
5331 | - <ImagesViewerModal | |
5332 | - optType={imagesViewerOptType} | |
5333 | - setVisible={(val: boolean) => { | |
5334 | - setImagesViewerModalVisible(val); | |
5335 | - if (!val) { | |
5336 | - clearOptObject(); | |
5337 | - } | |
5338 | - }} | |
5339 | - onClose={() => { | |
5340 | - setImagesViewerModalVisible(false); | |
5341 | - }} | |
5342 | - orderRow={buildSubOrders()[0]} | |
5343 | - /> | |
5344 | - )} | |
5345 | - | |
5346 | - {importModalVisible && ( | |
5347 | - <ImportModal | |
5348 | - onClose={() => { | |
5349 | - setImportModalVisible(false); | |
5350 | - refreshTable2(); | |
5351 | - }} | |
5352 | - /> | |
5353 | - )} | |
5354 | - | |
5355 | - {attachmentModalVisible && ( | |
5356 | - <AttachmentModal | |
5357 | - data={buildSubOrders()[0]} | |
5358 | - onClose={() => { | |
5359 | - setAttachmentModalVisible(false); | |
5360 | - clearOptObject(); | |
5361 | - }} | |
5362 | - /> | |
5363 | - )} | |
5364 | - | |
5365 | - {historyModalVisible && ( | |
5366 | - <HistoryModal | |
5367 | - subOrders={selectedRows} | |
5368 | - isCancelledOrder={filterCondifion === 70} | |
5369 | - onClose={() => { | |
5370 | - setHistoryModalVisible(false); | |
5371 | - setSelectedRows({}); | |
5372 | - clearOptObject(); | |
5373 | - }} | |
5374 | - /> | |
5375 | - )} | |
5376 | - | |
5377 | - {deliverInfoDrawerVisible && ( | |
5378 | - <DeliverInfoDrawer | |
5379 | - data={buildMainOrder()} | |
5380 | - onClose={() => { | |
5381 | - setDeliverInfoDrawerVisible(false); | |
5382 | - clearOptObject(); | |
5383 | - }} | |
5384 | - /> | |
5385 | - )} | |
5386 | - | |
5387 | - {deliverInfoDrawerVisible && ( | |
5388 | - <DeliverInfoDrawer | |
5389 | - data={buildMainOrder()} | |
5390 | - onClose={() => { | |
5391 | - setDeliverInfoDrawerVisible(false); | |
5392 | - clearOptObject(); | |
5393 | - }} | |
5394 | - /> | |
5395 | - )} | |
5396 | - | |
5397 | - {procureCheckModalVisible && ( | |
5398 | - <ProcureCheckModal | |
5399 | - setCheckVisible={(val: boolean) => { | |
5400 | - setProcureCheckModalVisible(val); | |
5401 | - if (!val) { | |
5402 | - clearOptObject(); | |
5403 | - } | |
5404 | - }} | |
5405 | - isMainOrder={isMainOrder} | |
5406 | - orders={ | |
5407 | - isMainOrder | |
5408 | - ? [...subOrderSelectedMap.values()].flat() | |
5409 | - : buildSubOrders() | |
5410 | - } | |
5411 | - onClose={() => { | |
5412 | - setProcureCheckModalVisible(false); | |
5413 | - clearOptObject(); | |
5414 | - setIsMainOrder(false); | |
5415 | - refreshTable2(); | |
5416 | - }} | |
5417 | - /> | |
5418 | - )} | |
5419 | - | |
5420 | - {afterSalesDrawerVisible && ( | |
5421 | - <AfterSalesDrawer | |
5422 | - setVisible={(val: boolean) => { | |
5423 | - setAfterSalesDrawerVisible(val); | |
5424 | - if (!val) { | |
5425 | - clearOptObject(); | |
5426 | - } | |
5427 | - }} | |
5428 | - mainOrder={buildMainOrder()} | |
5429 | - subOrders={buildSubOrders()} | |
5430 | - onClose={() => { | |
5431 | - setAfterSalesDrawerVisible(false); | |
5432 | - clearOptObject(); | |
5433 | - refreshTable2(); | |
5434 | - }} | |
5435 | - /> | |
5436 | - )} | |
5437 | - | |
5438 | - {procureConvertModalVisible && ( | |
5439 | - <ProcureConvertModal | |
5440 | - setVisible={(val: boolean) => { | |
5441 | - setProcureConvertModalVisible(val); | |
5442 | - if (!val) { | |
5443 | - clearOptObject(); | |
5444 | - } | |
5445 | - }} | |
5446 | - subOrders={buildSubOrders()} | |
5447 | - onClose={() => { | |
5448 | - setProcureConvertModalVisible(false); | |
5449 | - clearOptObject(); | |
5450 | - refreshTable2(); | |
5451 | - }} | |
5452 | - /> | |
5453 | - )} | |
5454 | - | |
5455 | - {financialMergeDrawerVisible && ( | |
5456 | - <FinancialMergeDrawer | |
5457 | - setVisible={(val: boolean) => { | |
5458 | - setFinancialMergeDrawerVisible(val); | |
5459 | - if (!val) { | |
5460 | - clearOptObject(); | |
5461 | - } | |
5462 | - }} | |
5463 | - dataList={ | |
5464 | - isMainOrder | |
5465 | - ? [...subOrderSelectedMap.values()].flat() | |
5466 | - : buildSubOrders() | |
5467 | - } | |
5468 | - onClose={() => { | |
5469 | - setFinancialMergeDrawerVisible(false); | |
5470 | - setIsMainOrder(false); | |
5471 | - clearOptObject(); | |
5472 | - refreshTable2(); | |
5473 | - }} | |
5474 | - /> | |
5475 | - )} | |
5476 | - | |
5477 | - {financialReceiptsModalVisible && ( | |
5478 | - <FinancialReceiptsModal | |
5479 | - setVisible={(val: boolean) => { | |
5480 | - setFinancialReceiptsModalVisible(val); | |
5481 | - if (!val) { | |
5482 | - clearOptObject(); | |
5483 | - } | |
5484 | - }} | |
5485 | - datas={selectedRows} | |
5486 | - onClose={() => { | |
5487 | - setFinancialReceiptsModalVisible(false); | |
5488 | - setSelectedRows({}); | |
5489 | - refreshTable2(); | |
5490 | - }} | |
5491 | - /> | |
5492 | - )} | |
5493 | - | |
5494 | - {shippingWarehouseChangeModalVisible && ( | |
5495 | - <ShippingWarehouseChangeModal | |
5496 | - setVisible={(val: boolean) => { | |
5497 | - setShippingWarehouseChangeModalVisible(val); | |
5498 | - if (!val) { | |
5499 | - clearOptObject(); | |
5500 | - } | |
5501 | - }} | |
5502 | - subOrderIds={ids} | |
5503 | - originShippingWarehouse={buildSubOrders()[0].shippingWarehouse} | |
5504 | - onClose={() => { | |
5505 | - setShippingWarehouseChangeModalVisible(false); | |
5506 | - clearOptObject(); | |
5507 | - setIds([]); | |
5508 | - refreshTable2(); | |
5509 | - }} | |
5510 | - /> | |
5511 | - )} | |
5512 | - {reissueVisible && ( | |
5513 | - <ReissueModal | |
5514 | - setVisible={(val: boolean) => { | |
5515 | - setReissueVisible(val); | |
5516 | - if (!val) { | |
5517 | - clearOptObject(); | |
5518 | - } | |
5519 | - }} | |
5520 | - subOrders={ | |
5521 | - isMainOrder | |
5522 | - ? [...subOrderSelectedMap.values()].flat() | |
5523 | - : buildSubOrders() | |
5524 | - } | |
5525 | - onClose={() => { | |
5526 | - setReissueVisible(false); | |
5527 | - clearOptObject(); | |
5528 | - refreshTable2(); | |
5529 | - }} | |
5530 | - /> | |
5531 | - )} | |
5532 | - {reissueVisibleOld && ( | |
5533 | - <ReissueModal_old | |
5534 | - setVisible={(val: boolean) => { | |
5535 | - setReissueVisibleOld(val); | |
5536 | - console.log(reissueVisible); | |
5537 | - if (!val) { | |
5538 | - clearOptObject(); | |
5539 | - } | |
5540 | - }} | |
5541 | - mainOrder={buildMainOrder()} | |
5542 | - subOrders={buildSubOrders()} | |
5543 | - onClose={() => { | |
5544 | - setReissueVisibleOld(false); | |
5545 | - clearOptObject(); | |
5546 | - refreshTable2(); | |
5547 | - }} | |
5548 | - /> | |
5549 | - )} | |
5550 | - {productionTimeModalVisible && ( | |
5551 | - <ProductionTimeModal | |
5552 | - setVisible={(val: boolean) => { | |
5553 | - setProductionTimeModalVisible(val); | |
5554 | - if (!val) { | |
5555 | - clearOptObject(); | |
5556 | - } | |
5557 | - }} | |
5558 | - subOrders={buildSubOrders()} | |
5559 | - onClose={() => { | |
5560 | - setProductionTimeModalVisible(false); | |
5561 | - clearOptObject(); | |
5562 | - refreshTable2(); | |
5563 | - }} | |
5564 | - /> | |
5565 | - )} | |
5566 | - | |
5567 | - {modifiedDiffModalVisible && ( | |
5568 | - <ModifiedDiffModal | |
5569 | - setVisible={(val: boolean) => { | |
5570 | - setModifiedDiffModalVisible(val); | |
5571 | - if (!val) { | |
5572 | - clearOptObject(); | |
5573 | - } | |
5574 | - }} | |
5575 | - subOrders={buildSubOrders()} | |
5576 | - mainOrder={buildMainOrder()} | |
5577 | - onClose={() => { | |
5578 | - setModifiedDiffModalVisible(false); | |
5579 | - clearOptObject(); | |
5580 | - }} | |
5581 | - /> | |
5582 | - )} | |
5583 | - | |
5584 | - {uploadPayBillModalVisible && ( | |
5585 | - <UploadPayBillModal | |
5586 | - setVisible={(val: boolean) => { | |
5587 | - setUploadPayBillModalVisible(val); | |
5588 | - if (!val) { | |
5589 | - clearOptObject(); | |
5590 | - } | |
5591 | - }} | |
5592 | - subOrders={buildSubOrders()} | |
5593 | - mainOrder={buildMainOrder()} | |
5594 | - onClose={() => { | |
5595 | - setUploadPayBillModalVisible(false); | |
5596 | - clearOptObject(); | |
5597 | - refreshTable2(); | |
5598 | - }} | |
5599 | - /> | |
5600 | - )} | |
5601 | - {feedbackRegistrationModalVisible && ( | |
5602 | - <FeedbackRegistrationModal | |
5603 | - setVisible={(val: boolean) => { | |
5604 | - setFeedbackRegistrationModalVisible(val); | |
5605 | - if (!val) { | |
5606 | - clearOptObject(); | |
5607 | - } | |
5608 | - }} | |
5609 | - subOrders={buildSubOrders()} | |
5610 | - mainOrder={buildMainOrder()} | |
5611 | - onClose={() => { | |
5612 | - setFeedbackRegistrationModalVisible(false); | |
5613 | - clearOptObject(); | |
5614 | - refreshTable2(); | |
5615 | - }} | |
5616 | - /> | |
5617 | - )} | |
5618 | - {invoicingDrawerFormVisible && ( | |
5619 | - <InvoicingDrawerForm | |
5620 | - dataList={ | |
5621 | - isMainOrder | |
5622 | - ? [...subOrderSelectedMap.values()].flat() | |
5623 | - : buildSubOrders() | |
5624 | - } | |
5625 | - setVisible={(val: boolean) => { | |
5626 | - setInvoicingDrawerFormVisible(val); | |
5627 | - if (!val) { | |
5628 | - clearOptObject(); | |
5629 | - } | |
5630 | - }} | |
5631 | - mainOrder={isMainOrder ? getFirstMainOrder() : buildMainOrder()} | |
5632 | - onClose={() => { | |
5633 | - setInvoicingDrawerFormVisible(false); | |
5634 | - setIsMainOrder(true); | |
5635 | - clearOptObject(); | |
5636 | - refreshTable2(); | |
5637 | - }} | |
5638 | - /> | |
5639 | - )} | |
5640 | - {contextHolder} | |
5641 | - <FloatButton.BackTop visibilityHeight={0} /> | |
5642 | - </div> | |
5643 | - ), | |
5644 | - }, | |
5645 | - ]; | |
4378 | + params.condition = filterCondifion; | |
4379 | + | |
4380 | + //排序 | |
4381 | + params.sorted = sorted; | |
4382 | + //是否只查看已作废 | |
4383 | + params.isDeleteQueryOrder = filterCondifion === 70; | |
4384 | + let finalParams = { | |
4385 | + ...params, | |
4386 | + }; | |
4387 | + console.log(5656); | |
4388 | + if (value1 === 0) { | |
4389 | + // const currentDate = new Date(); | |
4390 | + // const newDate = new Date(currentDate); | |
4391 | + // newDate.setDate(currentDate.getDate() - 0); | |
4392 | + handleSetNull(); | |
4393 | + } | |
4394 | + if (activeTabKey === 1) { | |
4395 | + // // 第一段代码 | |
4396 | + // if (calDate === 'null') { | |
4397 | + // params.applyTimeLe = null; | |
4398 | + // } else { | |
4399 | + // params.applyTimeLe = calDate; | |
4400 | + // } | |
4401 | + // params.applyTimeIsNotNull = true; // 要求申请时间非空 | |
4402 | + params.orderStatus = 'SHIPPED'; // 发票确认预警 | |
4403 | + params.isDeleteQueryOrder = false; // 强制查询非作废订单 | |
4404 | + params.salesCode = userInfo.username; | |
4405 | + // params.paymentMethod = 'UNPAID'; | |
4406 | + finalParams = { | |
4407 | + ...params, | |
4408 | + statusDatetimeLe: calDate, | |
4409 | + }; | |
4410 | + } else if (activeTabKey === 2) { | |
4411 | + // // 第一段代码 | |
4412 | + // if (calDate === 'null') { | |
4413 | + // params.applyTimeLe = null; | |
4414 | + // } else { | |
4415 | + // params.applyTimeLe = calDate; | |
4416 | + // } | |
4417 | + // params.applyTimeIsNotNull = true; // 要求申请时间非空 | |
4418 | + params.salesCode = userInfo.username; | |
4419 | + params.warningStatus = 'waitFeedbackWarning'; // 发票确认预警 | |
4420 | + params.isDeleteQueryOrder = false; // 强制查询非作废订单 | |
4421 | + // params.paymentMethod = 'UNPAID'; | |
4422 | + finalParams = { | |
4423 | + ...params, | |
4424 | + confirmReceiptDatetimeLe: calDate, | |
4425 | + }; | |
4426 | + } else if (activeTabKey === 3) { | |
4427 | + // 第一段代码 | |
4428 | + // if (calDate === 'null') { | |
4429 | + // params.applyTimeLe = null; | |
4430 | + // } else { | |
4431 | + // params.applyTimeLe = calDate; | |
4432 | + // } | |
4433 | + params.applyTimeIsNotNull = true; // 要求申请时间非空 | |
4434 | + params.salesCode = userInfo.username; | |
4435 | + params.warningStatus = 'invoiceConfirmWarning'; // 发票确认预警 | |
4436 | + params.isDeleteQueryOrder = false; // 强制查询非作废订单 | |
4437 | + params.paymentMethod = 'UNPAID'; | |
4438 | + finalParams = { | |
4439 | + ...params, | |
4440 | + invoicingEndTime: calDate, | |
4441 | + }; | |
4442 | + } else if (activeTabKey === 4) { | |
4443 | + console.log(value1, 56564); | |
4444 | + params.warningStatus = 'paymentReceiptStatusWarning'; // 用于回款预警 | |
4445 | + if (calDate === 'null') { | |
4446 | + params.applyTimeLe = null; | |
4447 | + } else { | |
4448 | + params.applyTimeLe = calDate; | |
4449 | + } | |
4450 | + params.salesCode = userInfo.username; | |
4451 | + params.isDeleteQueryOrder = false; // 强制查询非作废订单 | |
4452 | + params.paymentNotReceipt = true; // 在回款预警中标记未支付订单 | |
4453 | + finalParams = { | |
4454 | + ...params, | |
4455 | + }; | |
4456 | + } | |
5646 | 4457 | |
5647 | - return ( | |
5648 | - <div className="order-page-container"> | |
5649 | - <div id="resizeDiv"></div> | |
5650 | - {/* <Tabs defaultActiveKey="1" items={tabsItems} onChange={() => { }} /> */} | |
5651 | - <Tabs | |
5652 | - defaultActiveKey="1" | |
5653 | - items={tabsItems} | |
5654 | - onChange={(key) => { | |
5655 | - setActiveTabKey(key); // **修改位置:更新 activeTabKey** | |
5656 | - if (key === '1') { | |
5657 | - setActiveTabKey(key); // **修改位置:更新 activeTabKey** | |
5658 | - mainTableRef.current?.reload(); // **请求主订单的 request** | |
5659 | - } else if (key === '2') { | |
5660 | - setActiveTabKey(key); // **修改位置:更新 activeTabKey** | |
5661 | - mainTableSecondRef.current?.reload(); // **请求订单回款的 request2** | |
4458 | + console.log(params, '5656params'); | |
4459 | + | |
4460 | + //保存这个搜索条件 | |
4461 | + setSearchParam(params); | |
4462 | + const { data } = await postServiceOrderQueryServiceOrder({ | |
4463 | + // ...params, | |
4464 | + // FIXME: remove @ts-ignore | |
4465 | + // @ts-ignore | |
4466 | + sorter, | |
4467 | + filter, | |
4468 | + data: finalParams, | |
4469 | + }); | |
4470 | + | |
4471 | + setRolePath(data.specialPath); | |
4472 | + setSubOrderCount(data.count); | |
4473 | + setAllMainChecked(false); | |
4474 | + setSelectedMainOrderKeys([]); | |
4475 | + subOrderSelectedMap.clear(); | |
4476 | + mainOrderSelectedMap.clear(); | |
4477 | + setData(data?.data); | |
4478 | + | |
4479 | + //主订单id与子订单id的对照关系保存 | |
4480 | + mainOrderIdSubOrderIdRelationsMap.clear(); | |
4481 | + for (let row of data?.data) { | |
4482 | + let mianOrderId = row.id; | |
4483 | + let subOrderIds = row.subOrderInformationLists?.map((item) => { | |
4484 | + //目前子订单存储的totalPayment不准确,这里重新处理取主订单的totalPayment | |
4485 | + //totalPayment在财务开票计算金额时使用到 | |
4486 | + item.totalPayment = row.totalPayment; | |
4487 | + return item.id; | |
4488 | + }); | |
4489 | + mainOrderIdSubOrderIdRelationsMap.set(mianOrderId, subOrderIds); | |
5662 | 4490 | } |
4491 | + | |
4492 | + return { | |
4493 | + data: data?.data || [], | |
4494 | + total: data?.total || 0, | |
4495 | + }; | |
4496 | + }} | |
4497 | + toolbar={{ | |
4498 | + multipleLine: true, | |
5663 | 4499 | }} |
4500 | + // toolBarRender={() => { | |
4501 | + // return toolBarRender(); | |
4502 | + // }} | |
5664 | 4503 | /> |
4504 | + | |
4505 | + {orderDrawerVisible && ( | |
4506 | + <OrderDrawer | |
4507 | + data={orderOptType === 'add' ? {} : buildMainOrder()} | |
4508 | + subOrders={orderOptType === 'add' ? [] : buildSubOrders()} | |
4509 | + onClose={(isSuccess: boolean) => { | |
4510 | + setOrderDrawerVisible(false); | |
4511 | + clearOptObject(); | |
4512 | + if (isSuccess) { | |
4513 | + refreshTable(); | |
4514 | + } | |
4515 | + }} | |
4516 | + orderOptType={orderOptType} | |
4517 | + /> | |
4518 | + )} | |
4519 | + | |
4520 | + {checkVisible && ( | |
4521 | + <CheckModal | |
4522 | + setCheckVisible={(val: boolean) => { | |
4523 | + setCheckVisible(val); | |
4524 | + if (!val) { | |
4525 | + clearOptObject(); | |
4526 | + } | |
4527 | + }} | |
4528 | + data={isMainOrder ? getFirstMainOrder() : buildMainOrder()} | |
4529 | + subOrders={ | |
4530 | + isMainOrder | |
4531 | + ? [...subOrderSelectedMap.values()].flat() | |
4532 | + : buildSubOrders() | |
4533 | + } | |
4534 | + orderCheckType={orderCheckType} | |
4535 | + openOrderDrawer={(type: any, id: any) => { | |
4536 | + setCurrentMainId(id); | |
4537 | + setOrderOptType(type); | |
4538 | + setOrderDrawerVisible(true); | |
4539 | + }} | |
4540 | + onClose={() => { | |
4541 | + clearOptObject(); | |
4542 | + setCheckVisible(false); | |
4543 | + refreshTable(); | |
4544 | + }} | |
4545 | + /> | |
4546 | + )} | |
4547 | + | |
4548 | + {applyForInvoicingVisible && ( | |
4549 | + <ApplyForInvoicingModal | |
4550 | + setCheckVisible={(val: boolean) => { | |
4551 | + setApplyForInvoicingVisible(val); | |
4552 | + if (!val) { | |
4553 | + clearOptObject(); | |
4554 | + } | |
4555 | + }} | |
4556 | + subOrders={ | |
4557 | + isMainOrder | |
4558 | + ? [...subOrderSelectedMap.values()].flat() | |
4559 | + : buildSubOrders() | |
4560 | + } | |
4561 | + totalPayment={getApplyInvoicingTotalPayment()} | |
4562 | + isMainOrder={isMainOrder} | |
4563 | + isEdit={isEdit} | |
4564 | + onClose={() => { | |
4565 | + setApplyForInvoicingVisible(false); | |
4566 | + setIsMainOrder(false); | |
4567 | + clearOptObject(); | |
4568 | + refreshTable(); | |
4569 | + }} | |
4570 | + /> | |
4571 | + )} | |
4572 | + | |
4573 | + {notesEditVisible && ( | |
4574 | + <OrderNotesEditModal | |
4575 | + setNotesEditVisible={(val: boolean) => { | |
4576 | + setNotesEditVisible(val); | |
4577 | + if (!val) { | |
4578 | + clearOptObject(); | |
4579 | + } | |
4580 | + }} | |
4581 | + ids={selectedRows} | |
4582 | + notesType={notesType} | |
4583 | + notes={notes} | |
4584 | + onClose={() => { | |
4585 | + setNotesEditVisible(false); | |
4586 | + setSelectedRows([]); | |
4587 | + setNotes(notes); | |
4588 | + setNotesType(1); | |
4589 | + refreshTable(); | |
4590 | + }} | |
4591 | + /> | |
4592 | + )} | |
4593 | + | |
4594 | + {deliverVisible && ( | |
4595 | + <DeliverModal | |
4596 | + data={buildSubOrders()} | |
4597 | + isSendProduct={isSendProduct} | |
4598 | + setVisible={(val: boolean) => { | |
4599 | + setDeliverVisible(val); | |
4600 | + if (!val) { | |
4601 | + clearOptObject(); | |
4602 | + } | |
4603 | + }} | |
4604 | + sendType={orderCheckType} | |
4605 | + onClose={() => { | |
4606 | + clearOptObject(); | |
4607 | + setDeliverVisible(false); | |
4608 | + setIsSendProduct(false); | |
4609 | + refreshTable(); | |
4610 | + }} | |
4611 | + /> | |
4612 | + )} | |
4613 | + | |
4614 | + {financialVisible && ( | |
4615 | + <FinancialDrawer | |
4616 | + isEdit={isEdit} | |
4617 | + mainOrder={isMainOrder ? getFirstMainOrder() : buildMainOrder()} | |
4618 | + subOrders={ | |
4619 | + isMainOrder | |
4620 | + ? [...subOrderSelectedMap.values()].flat() | |
4621 | + : buildSubOrders() | |
4622 | + } | |
4623 | + isMainOrder={isMainOrder} | |
4624 | + cancel={() => { | |
4625 | + setFinancialVisible(false); | |
4626 | + clearOptObject(); | |
4627 | + setIsMainOrder(false); | |
4628 | + setIsEdit(false); | |
4629 | + }} | |
4630 | + onClose={() => { | |
4631 | + setFinancialVisible(false); | |
4632 | + clearOptObject(); | |
4633 | + refreshTable(); | |
4634 | + setIsMainOrder(false); | |
4635 | + setIsEdit(false); | |
4636 | + }} | |
4637 | + /> | |
4638 | + )} | |
4639 | + | |
4640 | + {financialEditVisible && ( | |
4641 | + <FinancialEditDrawer | |
4642 | + mainOrder={buildMainOrder()} | |
4643 | + subOrders={buildSubOrders()} | |
4644 | + isMainOrder={isMainOrder} | |
4645 | + setVisible={() => { | |
4646 | + setFinancialEditVisible(false); | |
4647 | + clearOptObject(); | |
4648 | + }} | |
4649 | + onClose={() => { | |
4650 | + setFinancialEditVisible(false); | |
4651 | + refreshTable(); | |
4652 | + setIsMainOrder(false); | |
4653 | + clearOptObject(); | |
4654 | + }} | |
4655 | + /> | |
4656 | + )} | |
4657 | + | |
4658 | + {orderPrintVisible && ( | |
4659 | + <OrderPrintModal | |
4660 | + mainOrder={buildMainOrder()} | |
4661 | + subOrders={buildSubOrders()} | |
4662 | + isRePrint={isRePrintOrder} | |
4663 | + setVisible={(val: boolean) => { | |
4664 | + setOrderPrintVisible(val); | |
4665 | + if (!val) { | |
4666 | + clearOptObject(); | |
4667 | + } | |
4668 | + }} | |
4669 | + printOptType={orderCheckType} | |
4670 | + onClose={() => { | |
4671 | + setOrderPrintVisible(false); | |
4672 | + clearOptObject(); | |
4673 | + setIsRePrintOrder(false); | |
4674 | + refreshTable(); | |
4675 | + }} | |
4676 | + /> | |
4677 | + )} | |
4678 | + | |
4679 | + {confirmReceiptVisible && ( | |
4680 | + <ConfirmReceiptModal | |
4681 | + data={buildSubOrders()} | |
4682 | + onClose={() => { | |
4683 | + setConfirmReceiptVisible(false); | |
4684 | + clearOptObject(); | |
4685 | + refreshTable(); | |
4686 | + }} | |
4687 | + /> | |
4688 | + )} | |
4689 | + | |
4690 | + {imagesViewerModalVisible && ( | |
4691 | + <ImagesViewerModal | |
4692 | + optType={imagesViewerOptType} | |
4693 | + setVisible={(val: boolean) => { | |
4694 | + setImagesViewerModalVisible(val); | |
4695 | + if (!val) { | |
4696 | + clearOptObject(); | |
4697 | + } | |
4698 | + }} | |
4699 | + onClose={() => { | |
4700 | + setImagesViewerModalVisible(false); | |
4701 | + }} | |
4702 | + orderRow={buildSubOrders()[0]} | |
4703 | + /> | |
4704 | + )} | |
4705 | + | |
4706 | + {importModalVisible && ( | |
4707 | + <ImportModal | |
4708 | + onClose={() => { | |
4709 | + setImportModalVisible(false); | |
4710 | + refreshTable(); | |
4711 | + }} | |
4712 | + /> | |
4713 | + )} | |
4714 | + | |
4715 | + {attachmentModalVisible && ( | |
4716 | + <AttachmentModal | |
4717 | + data={buildSubOrders()[0]} | |
4718 | + onClose={() => { | |
4719 | + setAttachmentModalVisible(false); | |
4720 | + clearOptObject(); | |
4721 | + }} | |
4722 | + /> | |
4723 | + )} | |
4724 | + | |
4725 | + {historyModalVisible && ( | |
4726 | + <HistoryModal | |
4727 | + subOrders={selectedRows} | |
4728 | + isCancelledOrder={filterCondifion === 70} | |
4729 | + onClose={() => { | |
4730 | + setHistoryModalVisible(false); | |
4731 | + setSelectedRows({}); | |
4732 | + clearOptObject(); | |
4733 | + }} | |
4734 | + /> | |
4735 | + )} | |
4736 | + | |
4737 | + {deliverInfoDrawerVisible && ( | |
4738 | + <DeliverInfoDrawer | |
4739 | + data={buildMainOrder()} | |
4740 | + onClose={() => { | |
4741 | + setDeliverInfoDrawerVisible(false); | |
4742 | + clearOptObject(); | |
4743 | + }} | |
4744 | + /> | |
4745 | + )} | |
4746 | + | |
4747 | + {deliverInfoDrawerVisible && ( | |
4748 | + <DeliverInfoDrawer | |
4749 | + data={buildMainOrder()} | |
4750 | + onClose={() => { | |
4751 | + setDeliverInfoDrawerVisible(false); | |
4752 | + clearOptObject(); | |
4753 | + }} | |
4754 | + /> | |
4755 | + )} | |
4756 | + | |
4757 | + {procureCheckModalVisible && ( | |
4758 | + <ProcureCheckModal | |
4759 | + setCheckVisible={(val: boolean) => { | |
4760 | + setProcureCheckModalVisible(val); | |
4761 | + if (!val) { | |
4762 | + clearOptObject(); | |
4763 | + } | |
4764 | + }} | |
4765 | + isMainOrder={isMainOrder} | |
4766 | + orders={ | |
4767 | + isMainOrder | |
4768 | + ? [...subOrderSelectedMap.values()].flat() | |
4769 | + : buildSubOrders() | |
4770 | + } | |
4771 | + onClose={() => { | |
4772 | + setProcureCheckModalVisible(false); | |
4773 | + clearOptObject(); | |
4774 | + setIsMainOrder(false); | |
4775 | + refreshTable(); | |
4776 | + }} | |
4777 | + /> | |
4778 | + )} | |
4779 | + | |
4780 | + {afterSalesDrawerVisible && ( | |
4781 | + <AfterSalesDrawer | |
4782 | + setVisible={(val: boolean) => { | |
4783 | + setAfterSalesDrawerVisible(val); | |
4784 | + if (!val) { | |
4785 | + clearOptObject(); | |
4786 | + } | |
4787 | + }} | |
4788 | + mainOrder={buildMainOrder()} | |
4789 | + subOrders={buildSubOrders()} | |
4790 | + onClose={() => { | |
4791 | + setAfterSalesDrawerVisible(false); | |
4792 | + clearOptObject(); | |
4793 | + refreshTable(); | |
4794 | + }} | |
4795 | + /> | |
4796 | + )} | |
4797 | + | |
4798 | + {procureConvertModalVisible && ( | |
4799 | + <ProcureConvertModal | |
4800 | + setVisible={(val: boolean) => { | |
4801 | + setProcureConvertModalVisible(val); | |
4802 | + if (!val) { | |
4803 | + clearOptObject(); | |
4804 | + } | |
4805 | + }} | |
4806 | + subOrders={buildSubOrders()} | |
4807 | + onClose={() => { | |
4808 | + setProcureConvertModalVisible(false); | |
4809 | + clearOptObject(); | |
4810 | + refreshTable(); | |
4811 | + }} | |
4812 | + /> | |
4813 | + )} | |
4814 | + | |
4815 | + {financialMergeDrawerVisible && ( | |
4816 | + <FinancialMergeDrawer | |
4817 | + setVisible={(val: boolean) => { | |
4818 | + setFinancialMergeDrawerVisible(val); | |
4819 | + if (!val) { | |
4820 | + clearOptObject(); | |
4821 | + } | |
4822 | + }} | |
4823 | + dataList={ | |
4824 | + isMainOrder | |
4825 | + ? [...subOrderSelectedMap.values()].flat() | |
4826 | + : buildSubOrders() | |
4827 | + } | |
4828 | + onClose={() => { | |
4829 | + setFinancialMergeDrawerVisible(false); | |
4830 | + setIsMainOrder(false); | |
4831 | + clearOptObject(); | |
4832 | + refreshTable(); | |
4833 | + }} | |
4834 | + /> | |
4835 | + )} | |
4836 | + | |
4837 | + {financialReceiptsModalVisible && ( | |
4838 | + <FinancialReceiptsModal | |
4839 | + setVisible={(val: boolean) => { | |
4840 | + setFinancialReceiptsModalVisible(val); | |
4841 | + if (!val) { | |
4842 | + clearOptObject(); | |
4843 | + } | |
4844 | + }} | |
4845 | + datas={selectedRows} | |
4846 | + onClose={() => { | |
4847 | + setFinancialReceiptsModalVisible(false); | |
4848 | + setSelectedRows({}); | |
4849 | + refreshTable(); | |
4850 | + }} | |
4851 | + /> | |
4852 | + )} | |
4853 | + | |
4854 | + {shippingWarehouseChangeModalVisible && ( | |
4855 | + <ShippingWarehouseChangeModal | |
4856 | + setVisible={(val: boolean) => { | |
4857 | + setShippingWarehouseChangeModalVisible(val); | |
4858 | + if (!val) { | |
4859 | + clearOptObject(); | |
4860 | + } | |
4861 | + }} | |
4862 | + subOrderIds={ids} | |
4863 | + originShippingWarehouse={buildSubOrders()[0].shippingWarehouse} | |
4864 | + onClose={() => { | |
4865 | + setShippingWarehouseChangeModalVisible(false); | |
4866 | + clearOptObject(); | |
4867 | + setIds([]); | |
4868 | + refreshTable(); | |
4869 | + }} | |
4870 | + /> | |
4871 | + )} | |
4872 | + {reissueVisible && ( | |
4873 | + <ReissueModal | |
4874 | + setVisible={(val: boolean) => { | |
4875 | + setReissueVisible(val); | |
4876 | + if (!val) { | |
4877 | + clearOptObject(); | |
4878 | + } | |
4879 | + }} | |
4880 | + subOrders={ | |
4881 | + isMainOrder | |
4882 | + ? [...subOrderSelectedMap.values()].flat() | |
4883 | + : buildSubOrders() | |
4884 | + } | |
4885 | + onClose={() => { | |
4886 | + setReissueVisible(false); | |
4887 | + clearOptObject(); | |
4888 | + refreshTable(); | |
4889 | + }} | |
4890 | + /> | |
4891 | + )} | |
4892 | + {reissueVisibleOld && ( | |
4893 | + <ReissueModal_old | |
4894 | + setVisible={(val: boolean) => { | |
4895 | + setReissueVisibleOld(val); | |
4896 | + console.log(reissueVisible); | |
4897 | + if (!val) { | |
4898 | + clearOptObject(); | |
4899 | + } | |
4900 | + }} | |
4901 | + mainOrder={buildMainOrder()} | |
4902 | + subOrders={buildSubOrders()} | |
4903 | + onClose={() => { | |
4904 | + setReissueVisibleOld(false); | |
4905 | + clearOptObject(); | |
4906 | + refreshTable(); | |
4907 | + }} | |
4908 | + /> | |
4909 | + )} | |
4910 | + {productionTimeModalVisible && ( | |
4911 | + <ProductionTimeModal | |
4912 | + setVisible={(val: boolean) => { | |
4913 | + setProductionTimeModalVisible(val); | |
4914 | + if (!val) { | |
4915 | + clearOptObject(); | |
4916 | + } | |
4917 | + }} | |
4918 | + subOrders={buildSubOrders()} | |
4919 | + onClose={() => { | |
4920 | + setProductionTimeModalVisible(false); | |
4921 | + clearOptObject(); | |
4922 | + refreshTable(); | |
4923 | + }} | |
4924 | + /> | |
4925 | + )} | |
4926 | + | |
4927 | + {modifiedDiffModalVisible && ( | |
4928 | + <ModifiedDiffModal | |
4929 | + setVisible={(val: boolean) => { | |
4930 | + setModifiedDiffModalVisible(val); | |
4931 | + if (!val) { | |
4932 | + clearOptObject(); | |
4933 | + } | |
4934 | + }} | |
4935 | + subOrders={buildSubOrders()} | |
4936 | + mainOrder={buildMainOrder()} | |
4937 | + onClose={() => { | |
4938 | + setModifiedDiffModalVisible(false); | |
4939 | + clearOptObject(); | |
4940 | + }} | |
4941 | + /> | |
4942 | + )} | |
4943 | + | |
4944 | + {uploadPayBillModalVisible && ( | |
4945 | + <UploadPayBillModal | |
4946 | + setVisible={(val: boolean) => { | |
4947 | + setUploadPayBillModalVisible(val); | |
4948 | + if (!val) { | |
4949 | + clearOptObject(); | |
4950 | + } | |
4951 | + }} | |
4952 | + subOrders={buildSubOrders()} | |
4953 | + mainOrder={buildMainOrder()} | |
4954 | + onClose={() => { | |
4955 | + setUploadPayBillModalVisible(false); | |
4956 | + clearOptObject(); | |
4957 | + refreshTable(); | |
4958 | + }} | |
4959 | + /> | |
4960 | + )} | |
4961 | + {feedbackRegistrationModalVisible && ( | |
4962 | + <FeedbackRegistrationModal | |
4963 | + setVisible={(val: boolean) => { | |
4964 | + setFeedbackRegistrationModalVisible(val); | |
4965 | + if (!val) { | |
4966 | + clearOptObject(); | |
4967 | + } | |
4968 | + }} | |
4969 | + subOrders={buildSubOrders()} | |
4970 | + mainOrder={buildMainOrder()} | |
4971 | + onClose={() => { | |
4972 | + setFeedbackRegistrationModalVisible(false); | |
4973 | + clearOptObject(); | |
4974 | + refreshTable(); | |
4975 | + }} | |
4976 | + /> | |
4977 | + )} | |
4978 | + | |
4979 | + {invoicingDrawerFormVisible && ( | |
4980 | + <InvoicingDrawerForm | |
4981 | + dataList={ | |
4982 | + isMainOrder | |
4983 | + ? [...subOrderSelectedMap.values()].flat() | |
4984 | + : buildSubOrders() | |
4985 | + } | |
4986 | + setVisible={(val: boolean) => { | |
4987 | + setInvoicingDrawerFormVisible(val); | |
4988 | + if (!val) { | |
4989 | + clearOptObject(); | |
4990 | + } | |
4991 | + }} | |
4992 | + mainOrder={isMainOrder ? getFirstMainOrder() : buildMainOrder()} | |
4993 | + onClose={() => { | |
4994 | + setInvoicingDrawerFormVisible(false); | |
4995 | + setIsMainOrder(true); | |
4996 | + clearOptObject(); | |
4997 | + refreshTable(); | |
4998 | + }} | |
4999 | + /> | |
5000 | + )} | |
5001 | + {contextHolder} | |
5002 | + <FloatButton.BackTop visibilityHeight={0} /> | |
5665 | 5003 | </div> |
5666 | 5004 | ); |
5667 | 5005 | }; | ... | ... |