Commit 1db34f9955a3b59de6ea099a3364a1ac0f120151

Authored by 曾国涛
2 parents 19ca3d46 967ee14e
dist.zip 0 → 100644
No preview for this file type
src/pages/Order/OrderWarning/index.tsx
... ... @@ -188,7 +188,9 @@ const OrderPage = () => {
188 188 const [mainOrderSelectedMap] = useState(new Map()); //选中的主订单Map key:主订单id value:主订单数据
189 189 const [subOrderSelectedMap, setSubOrderSelectedMap] = useState(new Map()); //选中的子订单Map key:主订单id value:选中的子订单数据集合
190 190 const [currentOptMainId, setCurrentMainId] = useState<any>(undefined); //当前操作对象的主订单id
  191 + // const [currentOptMainId, setCurrentMainId] = useState<any>(undefined); //当前操作对象的主订单id
191 192 const [curretnOptSubId, setCurretnOptSubId] = useState<any>(undefined); //当前操作对象的子订单id
  193 + // const [curretnOptSubId, setCurretnOptSubId] = useState<any>(undefined); //当前操作对象的子订单id
192 194 const [subOrderCount, setSubOrderCount] = useState(0);
193 195 const [sorted] = useState(false);
194 196 const mainTableRef = useRef<ActionType>();
... ... @@ -206,6 +208,7 @@ const OrderPage = () =&gt; {
206 208 const [ids, setIds] = useState([]);
207 209 const [recordOptNode, setRecordOptNode] = useState(null);
208 210 const roleCode = userInfo?.roleSmallVO?.code;
  211 + const [activeTabKey, setActiveTabKey] = useState('1'); // **新增状态**
209 212  
210 213 const triggerRecordOptNode = async (id) => {
211 214 const res = await postServiceOrderGetCurrentOptNode({
... ... @@ -381,7 +384,7 @@ const OrderPage = () =&gt; {
381 384 * 返回当前操作的主订单数据
382 385 */
383 386 function buildMainOrder() {
384   - if (currentOptMainId === undefined || currentOptMainId === null) {
  387 + if (!currentOptMainId) {
385 388 message.error('页面错误:当前操作的主订单id不存在,请联系系统管理员');
386 389 return;
387 390 }
... ... @@ -393,11 +396,9 @@ const OrderPage = () =&gt; {
393 396 if (matchedData.length > 0) {
394 397 mainOrderClone = cloneDeep(matchedData[0]);
395 398 }
396   -
397   - if (mainOrderClone === null) {
  399 + if (!mainOrderClone) {
398 400 message.error('页面错误:当前操作的主订单数据不存在,请联系系统管理员');
399 401 }
400   -
401 402 return mainOrderClone;
402 403 }
403 404  
... ... @@ -405,7 +406,7 @@ const OrderPage = () =&gt; {
405 406 * 返回当前操作的子订单集合
406 407 */
407 408 function buildSubOrders() {
408   - if (currentOptMainId === undefined || currentOptMainId === null) {
  409 + if (!currentOptMainId) {
409 410 message.error('页面错误:当前操作的主订单id不存在,请联系系统管理员');
410 411 return;
411 412 }
... ... @@ -414,8 +415,10 @@ const OrderPage = () =&gt; {
414 415  
415 416 //如果没有传当前操作的子订单id,说明是操作主订单
416 417 if (curretnOptSubId === undefined || curretnOptSubId === null) {
  418 + // if (!curretnOptSubId) {
417 419 //如果有选中子订单,那么取选中的子订单为操作对象,否则取当前主订单的全部子订单为操作对象
418 420 let currentOptSubOrders = subOrderSelectedMap.get(currentOptMainId);
  421 +
419 422 if (
420 423 currentOptSubOrders === null ||
421 424 currentOptSubOrders === undefined ||
... ... @@ -446,12 +449,10 @@ const OrderPage = () =&gt; {
446 449 }
447 450 }
448 451 }
449   -
450 452 if (cloneSubOrders.length === 0) {
451 453 message.error('页面错误:当前操作的订单数据不存在,请联系系统管理员');
452 454 return;
453 455 }
454   -
455 456 return cloneSubOrders;
456 457 }
457 458  
... ... @@ -3995,6 +3996,58 @@ const OrderPage = () =&gt; {
3995 3996 },
3996 3997 );
3997 3998  
  3999 + // 主订单列表
  4000 + const mainOrdersColumns2: ProColumns<OrderType>[] = MAIN_ORDER_COLUMNS.map(
  4001 + (item) => {
  4002 + //首能账号只能搜索订单编号
  4003 + let canSearchIndex = [
  4004 + 'id',
  4005 + 'salesCode',
  4006 + 'subNotes',
  4007 + 'orderStatus',
  4008 + 'createTime',
  4009 + 'modifiedAuditStatus',
  4010 + ];
  4011 + if (isSupplier() && !canSearchIndex.includes(item.dataIndex)) {
  4012 + item.search = false;
  4013 + }
  4014 +
  4015 + canSearchIndex = [
  4016 + 'id',
  4017 + 'salesCode',
  4018 + 'customerName',
  4019 + 'institution',
  4020 + 'productName',
  4021 + 'orderStatus',
  4022 + 'createTime',
  4023 + ];
  4024 +
  4025 + if (isExaminer() && !canSearchIndex.includes(item.dataIndex)) {
  4026 + item.search = false;
  4027 + }
  4028 +
  4029 + if (item.dataIndex === 'name') {
  4030 + return {
  4031 + ...item,
  4032 + title: <OrderTableHeader />,
  4033 + render: (text, record) => {
  4034 + return <MainOrderColumnRender record={record} />;
  4035 + },
  4036 + };
  4037 + }
  4038 +
  4039 + /**
  4040 + * 采购的订单状态筛选内容
  4041 + */
  4042 + if (roleCode === 'procure' && item.dataIndex === 'orderStatus') {
  4043 + item.valueEnum = enumToProTableEnumValue(
  4044 + PROCURE_PRIMARY_ORDER_STATUS_OPTIONS,
  4045 + );
  4046 + }
  4047 + return item;
  4048 + },
  4049 + );
  4050 +
3998 4051 /**
3999 4052 * 采购可以筛选供应商备注
4000 4053 */
... ... @@ -4006,6 +4059,13 @@ const OrderPage = () =&gt; {
4006 4059 valueType: 'text',
4007 4060 hideInTable: true,
4008 4061 });
  4062 + mainOrdersColumns2.push({
  4063 + title: '供应商备注',
  4064 + width: 120,
  4065 + dataIndex: 'supplierNotes',
  4066 + valueType: 'text',
  4067 + hideInTable: true,
  4068 + });
4009 4069 }
4010 4070  
4011 4071 /**
... ... @@ -4026,6 +4086,20 @@ const OrderPage = () =&gt; {
4026 4086 },
4027 4087 hideInTable: true,
4028 4088 });
  4089 + mainOrdersColumns2.push({
  4090 + title: '采购名称',
  4091 + width: 120,
  4092 + dataIndex: 'supplierName',
  4093 + valueType: 'select',
  4094 + request: async () => {
  4095 + const res = await postServiceOrderProvideProcurementRoles();
  4096 + let options = res.data?.map((item) => {
  4097 + return { label: item, value: item };
  4098 + });
  4099 + return options;
  4100 + },
  4101 + hideInTable: true,
  4102 + });
4029 4103 }
4030 4104  
4031 4105 /**
... ... @@ -4049,6 +4123,23 @@ const OrderPage = () =&gt; {
4049 4123 },
4050 4124 hideInTable: true,
4051 4125 });
  4126 + mainOrdersColumns2.push({
  4127 + title: '采购排除',
  4128 + width: 120,
  4129 + dataIndex: 'excludeProcureNames',
  4130 + fieldProps: {
  4131 + mode: 'multiple',
  4132 + },
  4133 + valueType: 'select',
  4134 + request: async () => {
  4135 + const res = await postServiceOrderProvideProcurementRoles();
  4136 + let options = res.data?.map((item) => {
  4137 + return { label: item, value: item };
  4138 + });
  4139 + return options;
  4140 + },
  4141 + hideInTable: true,
  4142 + });
4052 4143 }
4053 4144  
4054 4145 /**
... ... @@ -4063,6 +4154,14 @@ const OrderPage = () =&gt; {
4063 4154 valueEnum: enumToProTableEnumValue(SHIPPING_WAREHOUSE_OPTIONS),
4064 4155 hideInTable: true,
4065 4156 });
  4157 + mainOrdersColumns2.push({
  4158 + title: '发货仓库',
  4159 + width: 120,
  4160 + dataIndex: 'shippingWarehouse',
  4161 + valueType: 'select',
  4162 + valueEnum: enumToProTableEnumValue(SHIPPING_WAREHOUSE_OPTIONS),
  4163 + hideInTable: true,
  4164 + });
4066 4165 }
4067 4166  
4068 4167 //判断是否是采购,是的话新增一个筛选条件
... ... @@ -4074,6 +4173,13 @@ const OrderPage = () =&gt; {
4074 4173 hideInTable: true,
4075 4174 valueEnum: enumToProTableEnumValue(PROCURE_ORDER_STATUS),
4076 4175 });
  4176 + mainOrdersColumns2.push({
  4177 + title: isSupplier() ? '下单状态' : '采购下单状态',
  4178 + dataIndex: 'procureOrderStatus',
  4179 + valueType: 'select',
  4180 + hideInTable: true,
  4181 + valueEnum: enumToProTableEnumValue(PROCURE_ORDER_STATUS),
  4182 + });
4077 4183 }
4078 4184  
4079 4185 //选择天数1
... ... @@ -4184,6 +4290,7 @@ const OrderPage = () =&gt; {
4184 4290 filter,
4185 4291 data: { ...params, statusDatetimeGe: calDate },
4186 4292 });
  4293 + console.log(res.data, '5656request');
4187 4294  
4188 4295 const data = res.data;
4189 4296 setRolePath(data.specialPath);
... ... @@ -4219,6 +4326,14 @@ const OrderPage = () =&gt; {
4219 4326 mainTableSecondRef.current?.reload();
4220 4327 }
4221 4328 }, [calDate2]);
  4329 + useEffect(() => {
  4330 + if (activeTabKey === '1') {
  4331 + mainTableRef.current?.reload(); // **修改位置:在选择第二个标签时请求request2**
  4332 + }
  4333 + if (activeTabKey === '2') {
  4334 + mainTableSecondRef.current?.reload(); // **修改位置:在选择第二个标签时请求request2**
  4335 + }
  4336 + }, [activeTabKey]);
4222 4337  
4223 4338 const request2 = async (
4224 4339 // 第一个参数 params 查询表单和 params 参数的结合
... ... @@ -4274,6 +4389,7 @@ const OrderPage = () =&gt; {
4274 4389 filter,
4275 4390 data: { ...params },
4276 4391 });
  4392 + console.log(data, '5656request2');
4277 4393  
4278 4394 setRolePath(data.specialPath);
4279 4395 setSubOrderCount(data.count);
... ... @@ -4311,7 +4427,7 @@ const OrderPage = () =&gt; {
4311 4427 };
4312 4428 const tabsItems = [
4313 4429 {
4314   - key: 1,
  4430 + key: '1',
4315 4431 label: (
4316 4432 <span>
4317 4433 发票确认预警
... ... @@ -4398,7 +4514,8 @@ const OrderPage = () =&gt; {
4398 4514 search={false}
4399 4515 // labelWidth: 'auto',
4400 4516 // onCollapse: resize,
4401   - request={request}
  4517 + // request={request}
  4518 + request={activeTabKey === '1' ? request : null} // **条件请求**
4402 4519 toolbar={{
4403 4520 multipleLine: true,
4404 4521 }}
... ... @@ -4891,7 +5008,7 @@ const OrderPage = () =&gt; {
4891 5008 ),
4892 5009 },
4893 5010 {
4894   - key: 2,
  5011 + key: '2',
4895 5012 label: (
4896 5013 <span>
4897 5014 订单回款预警
... ... @@ -4929,7 +5046,7 @@ const OrderPage = () =&gt; {
4929 5046 actionRef={mainTableSecondRef}
4930 5047 formRef={mainTableSecondFormRef}
4931 5048 expandIconColumnIndex={-1}
4932   - columns={mainOrdersColumns}
  5049 + columns={mainOrdersColumns2}
4933 5050 rowKey="id"
4934 5051 pagination={{
4935 5052 showQuickJumper: true,
... ... @@ -4939,6 +5056,7 @@ const OrderPage = () =&gt; {
4939 5056 onChange: (page, size) => {
4940 5057 setPageSize(size);
4941 5058 setCurrentPage(page);
  5059 + mainTableSecondRef.current?.reload();
4942 5060 },
4943 5061 showTotal: (total, range) => {
4944 5062 return (
... ... @@ -4968,7 +5086,8 @@ const OrderPage = () =&gt; {
4968 5086 search={false}
4969 5087 // labelWidth: 'auto',
4970 5088 // onCollapse: resize,
4971   - request={request2}
  5089 + // request={request2}
  5090 + request={activeTabKey === '2' ? request2 : null} // **条件请求**
4972 5091 toolbar={{
4973 5092 multipleLine: true,
4974 5093 }}
... ... @@ -5465,7 +5584,21 @@ const OrderPage = () =&gt; {
5465 5584 return (
5466 5585 <div className="order-page-container">
5467 5586 <div id="resizeDiv"></div>
5468   - <Tabs defaultActiveKey="1" items={tabsItems} onChange={() => {}} />
  5587 + {/* <Tabs defaultActiveKey="1" items={tabsItems} onChange={() => { }} /> */}
  5588 + <Tabs
  5589 + defaultActiveKey="1"
  5590 + items={tabsItems}
  5591 + onChange={(key) => {
  5592 + setActiveTabKey(key); // **修改位置:更新 activeTabKey**
  5593 + if (key === '1') {
  5594 + setActiveTabKey(key); // **修改位置:更新 activeTabKey**
  5595 + mainTableRef.current?.reload(); // **请求主订单的 request**
  5596 + } else if (key === '2') {
  5597 + setActiveTabKey(key); // **修改位置:更新 activeTabKey**
  5598 + mainTableSecondRef.current?.reload(); // **请求订单回款的 request2**
  5599 + }
  5600 + }}
  5601 + />
5469 5602 </div>
5470 5603 );
5471 5604 };
... ...
src/pages/Order/OrderWarning/indexhide.tsx deleted 100644 → 0
1   -import ButtonConfirm from '@/components/ButtomConfirm';
2   -import { RESPONSE_CODE } from '@/constants/enum';
3   -import InvoicingDrawerForm from '@/pages/Order/OrderWarning/components/InvoicingDrawerForm';
4   -import ReissueModal from '@/pages/Order/OrderWarning/components/ReissueModal';
5   -import ReissueModal_old from '@/pages/Order/OrderWarning/components/ReissueModal_old';
6   -import {
7   - postKingdeeRepSalBillOutbound,
8   - postKingdeeRepSalOrderSave,
9   - postServiceConstCanApplyAfterInvoicingStatus,
10   - postServiceInvoiceCancelApply,
11   - postServiceOrderCancelSend,
12   - postServiceOrderGetCurrentOptNode,
13   - postServiceOrderNoNeedSend,
14   - postServiceOrderOrderCancel,
15   - postServiceOrderProcureOrder,
16   - postServiceOrderProcurePrint,
17   - postServiceOrderProvideProcurementRoles,
18   - postServiceOrderQueryServiceOrder,
19   - postServiceOrderSaleCancelInvoicing,
20   - postServiceOrderSalesConfirm,
21   - postServiceOrderWarningOrderStatistics,
22   -} from '@/services';
23   -import {
24   - FloatAdd,
25   - copyToClipboard,
26   - enumToProTableEnumValue,
27   - enumValueToLabel,
28   - formatDateTime,
29   - formatdate,
30   - getAliYunOSSFileNameFromUrl,
31   - isImageName,
32   -} from '@/utils';
33   -import {
34   - getReceivingCompanyOptions,
35   - isAdmin,
36   - isExaminer,
37   - isFinance,
38   - isProcure,
39   - isSales,
40   - isSupplier,
41   - isWarehousekeeper,
42   -} from '@/utils/order';
43   -import { getUserInfo } from '@/utils/user';
44   -import {
45   - ClockCircleTwoTone,
46   - ContainerTwoTone,
47   - CopyOutlined,
48   - CopyTwoTone,
49   - EditTwoTone,
50   - QuestionCircleOutlined,
51   -} from '@ant-design/icons';
52   -import {
53   - ActionType,
54   - ProColumns,
55   - ProFormInstance,
56   - ProTable,
57   -} from '@ant-design/pro-components';
58   -import {
59   - Badge,
60   - Button,
61   - Card,
62   - Checkbox,
63   - Col,
64   - Divider,
65   - Flex,
66   - FloatButton,
67   - Image,
68   - Modal,
69   - Popconfirm,
70   - Radio,
71   - Row,
72   - Space,
73   - Spin,
74   - Tabs,
75   - Tag,
76   - Tooltip,
77   - message,
78   -} from 'antd';
79   -import Base64 from 'base-64';
80   -import { format } from 'date-fns';
81   -import { cloneDeep } from 'lodash';
82   -import React, { Key, useEffect, useRef, useState } from 'react';
83   -import OrderPrintModal from '../../OrderPrint/OrderPrintModal';
84   -import {
85   - AFTER_INVOICING_STATUS,
86   - CHECK_TYPE,
87   - LOGISTICS_STATUS_OPTIONS,
88   - MAIN_ORDER_COLUMNS,
89   - MODIFIED_AUDIT_STATUS_OPTIONS,
90   - ORDER_STATUS_OPTIONS,
91   - PAYEE_OPTIONS,
92   - PAYMENT_CHANNEL_OPTIONS,
93   - PAYMENT_RECEIPTS_STATUS_OPTIONS,
94   - POST_AUDIT_OPTIONS,
95   - PROCURE_ORDER_STATUS,
96   - PROCURE_PRIMARY_ORDER_STATUS_OPTIONS,
97   - PRODUCT_BELONG_DEPARTMENT_OPTIONS,
98   - SHIPPING_WAREHOUSE_OPTIONS,
99   - TAGS_COLOR,
100   - getInvoicingType,
101   - getNeedInvoicing,
102   -} from '../constant';
103   -import AfterSalesDrawer from './components/AfterSalesDrawer';
104   -import ApplyForInvoicingModal from './components/ApplyForInvoicingModal';
105   -import AttachmentModal from './components/AttachmentModal';
106   -import CheckModal from './components/CheckModal';
107   -import ConfirmReceiptModal from './components/ConfirmReceiptModal';
108   -import DeliverInfoDrawer from './components/DeliverInfoDrawer';
109   -import DeliverModal from './components/DeliverModal';
110   -import FinancialDrawer from './components/FinancialDrawer';
111   -import FinancialEditDrawer from './components/FinancialEditDrawer';
112   -import FinancialMergeDrawer from './components/FinancialMergeDrawer';
113   -import FinancialReceiptsModal from './components/FinancialReceiptsModal';
114   -import HistoryModal from './components/HistoryModal';
115   -import ImagesViewerModal from './components/ImagesViewerModal';
116   -import ImportModal from './components/ImportModal';
117   -import ModifiedDiffModal from './components/ModifiedDiffModal';
118   -import OrderDrawer from './components/OrderDrawer';
119   -import OrderNotesEditModal from './components/OrderNotesEditModal';
120   -import ProcureCheckModal from './components/ProcureCheckModal';
121   -import ProcureConvertModal from './components/ProcureConvertModal';
122   -import ProductionTimeModal from './components/ProductionTimeModal';
123   -import ShippingWarehouseChangeModal from './components/ShippingWarehouseChangeModal';
124   -import UploadPayBillModal from './components/UploadPayBillModal';
125   -import './index.less';
126   -import { OrderListItemType, OrderType } from './type.d';
127   -
128   -const OrderPage = () => {
129   - const [orderDrawerVisible, setOrderDrawerVisible] = useState<boolean>(false);
130   - const [checkVisible, setCheckVisible] = useState<boolean>(false);
131   - const [orderPrintVisible, setOrderPrintVisible] = useState<boolean>(false);
132   - const [allMainChecked, setAllMainChecked] = useState(false);
133   - const [imagesViewerModalVisible, setImagesViewerModalVisible] =
134   - useState<boolean>(false);
135   - const [data, setData] = useState([]); //列表数据
136   - const [notesEditVisible, setNotesEditVisible] = useState<boolean>(false);
137   - const [financialMergeDrawerVisible, setFinancialMergeDrawerVisible] =
138   - useState<boolean>(false);
139   - const [attachmentModalVisible, setAttachmentModalVisible] =
140   - useState<boolean>(false);
141   - const [uploadPayBillModalVisible, setUploadPayBillModalVisible] =
142   - useState<boolean>(false);
143   - const [modifiedDiffModalVisible, setModifiedDiffModalVisible] =
144   - useState<boolean>(false);
145   - const [financialReceiptsModalVisible, setFinancialReceiptsModalVisible] =
146   - useState(false);
147   - const [financialVisible, setFinancialVisible] = useState<boolean>(false);
148   - const [financialEditVisible, setFinancialEditVisible] =
149   - useState<boolean>(false);
150   - const [afterSalesDrawerVisible, setAfterSalesDrawerVisible] =
151   - useState<boolean>(false);
152   - const [historyModalVisible, setHistoryModalVisible] =
153   - useState<boolean>(false);
154   - const [isRePrintOrder, setIsRePrintOrder] = useState<boolean>(false);
155   - const [isSendProduct, setIsSendProduct] = useState<boolean>(false);
156   - const [isMainOrder, setIsMainOrder] = useState<boolean>(false);
157   - const [importModalVisible, setImportModalVisible] = useState<boolean>(false);
158   - const [reissueVisible, setReissueVisible] = useState<boolean>(false);
159   - const [reissueVisibleOld, setReissueVisibleOld] = useState<boolean>(false);
160   - const [applyForInvoicingVisible, setApplyForInvoicingVisible] =
161   - useState<boolean>(false);
162   - const [procureCheckModalVisible, setProcureCheckModalVisible] =
163   - useState<boolean>(false);
164   - const [procureConvertModalVisible, setProcureConvertModalVisible] =
165   - useState<boolean>(false);
166   - const [invoicingDrawerFormVisible, setInvoicingDrawerFormVisible] =
167   - useState<boolean>(false);
168   - const [confirmReceiptVisible, setConfirmReceiptVisible] =
169   - useState<boolean>(false);
170   - const [productionTimeModalVisible, setProductionTimeModalVisible] =
171   - useState<boolean>(false);
172   - const [deliverVisible, setDeliverVisible] = useState<boolean>(false);
173   - const [deliverInfoDrawerVisible, setDeliverInfoDrawerVisible] =
174   - useState<boolean>(false);
175   - const [orderOptType, setOrderOptType] = useState<string>('');
176   - const [isEdit, setIsEdit] = useState<boolean>(false);
177   - const [expandedRowKeys] = useState<Key[]>([]);
178   - const [notesType, setNotesType] = useState(1);
179   - const [notes, setNotes] = useState(1);
180   - const [rolePath, setRolePath] = useState([]); //当前角色权限(新增跟打印按钮)
181   - const userInfo = getUserInfo();
182   - // const [tableHeight, setTableHeight] = useState(200);
183   - const [selectedRows, setSelectedRows] = useState([]);
184   - const [mainOrderIdSubOrderIdRelationsMap] = useState(new Map()); //主订单id与子订单id的对照关系,用于主订单子订单的勾选校验,子订单全选中对应的主订单自动勾选上
185   - const [selectedMainOrderKeys, setSelectedMainOrderKeys] = useState<any[]>([]);
186   - const [selectedSubOrderKeys, setSelectedSubOrderKeys] = useState<any[]>([]);
187   - const [pageSize, setPageSize] = useState(10);
188   - const [currentPage, setCurrentPage] = useState(1);
189   - const [orderCheckType, setOrderCheckType] = useState('');
190   - const [imagesViewerOptType, setImagesViewerOptType] = useState('');
191   - const [filterCondifion] = useState(0);
192   - const [mainOrderSelectedMap] = useState(new Map()); //选中的主订单Map key:主订单id value:主订单数据
193   - const [subOrderSelectedMap, setSubOrderSelectedMap] = useState(new Map()); //选中的子订单Map key:主订单id value:选中的子订单数据集合
194   - const [currentOptMainId, setCurrentMainId] = useState<any>(undefined); //当前操作对象的主订单id
195   - const [curretnOptSubId, setCurretnOptSubId] = useState<any>(undefined); //当前操作对象的子订单id
196   - const [subOrderCount, setSubOrderCount] = useState(0);
197   - const [sorted] = useState(false);
198   - const mainTableRef = useRef<ActionType>();
199   - const mainTableFormRef = useRef<ProFormInstance>();
200   - let [setSearchParam] = useState(Object); //表格的查询条件存储
201   - const [contextHolder] = message.useMessage();
202   - const [
203   - shippingWarehouseChangeModalVisible,
204   - setShippingWarehouseChangeModalVisible,
205   - ] = useState(false);
206   - const [setCanApplyAfterInvoicingStatus] = useState([]);
207   - const [ids, setIds] = useState([]);
208   - const [recordOptNode, setRecordOptNode] = useState(null);
209   - const roleCode = userInfo?.roleSmallVO?.code;
210   - const triggerRecordOptNode = async (id) => {
211   - const res = await postServiceOrderGetCurrentOptNode({
212   - query: {
213   - id,
214   - },
215   - });
216   - setRecordOptNode(res.data);
217   - };
218   -
219   - const refreshTable = () => {
220   - mainTableRef.current?.reload();
221   - //刷新表格数据的时候,取消选中行
222   - setSelectedRows([]);
223   - setSelectedSubOrderKeys([]);
224   - };
225   -
226   - useEffect(() => {
227   - // 使用URLSearchParams来解析查询参数
228   - const params = new URLSearchParams(location.search);
229   - const id = params.get('id');
230   - const subOrderId = params.get('subOrderId');
231   - if (id) {
232   - mainTableFormRef.current?.setFieldValue('id', id);
233   - }
234   - if (subOrderId) {
235   - mainTableFormRef.current?.setFieldValue('subOrderId', subOrderId);
236   - }
237   - }, []);
238   -
239   - useEffect(() => {
240   - const initEnum = async () => {
241   - let invoiceTypeRet = await postServiceConstCanApplyAfterInvoicingStatus();
242   - if (invoiceTypeRet.result === RESPONSE_CODE.SUCCESS) {
243   - setCanApplyAfterInvoicingStatus(invoiceTypeRet.data);
244   - }
245   - };
246   - initEnum();
247   - }, []);
248   -
249   - /**
250   - * 复制订单到剪贴板
251   - * @param record
252   - */
253   - function copyOrderToClipboard(record: any) {
254   - let text = '';
255   - text += record?.id;
256   - text += ',' + record?.salesCode;
257   - text += ',' + record?.customerName;
258   -
259   - text += ',' + record?.customerContactNumber;
260   -
261   - text += ',' + record?.customerShippingAddress;
262   -
263   - if (!isSupplier()) {
264   - text += ',' + record?.institutionContactName;
265   - text += ',' + record?.institution;
266   - }
267   - record?.subOrderInformationLists?.forEach((item) => {
268   - text += '\n';
269   - text += item?.productName;
270   - text += ' ' + item?.parameters;
271   - text += ' ' + item?.quantity;
272   - text += ' ' + item?.unit;
273   - if (!isSupplier()) {
274   - text += ' ¥' + item?.subOrderPayment;
275   - }
276   - text += ' ' + item?.id;
277   - });
278   - if (copyToClipboard(text)) {
279   - message.info('已复制到剪贴板');
280   - } else {
281   - message.info('无法复制到剪贴板');
282   - }
283   - }
284   -
285   - const MyToolTip = ({ title, content }) => {
286   - return (
287   - <Tooltip
288   - color="#FFFFFF"
289   - placement="bottom"
290   - title={<div className="px-5 py-4 text-black">{title}</div>}
291   - >
292   - {content}
293   - </Tooltip>
294   - );
295   - };
296   -
297   - /**
298   - * 检查是否可以打印
299   - * @param paths 按钮集合
300   - * @returns
301   - */
302   - function checkePrintable(paths: any) {
303   - if (
304   - !paths?.includes('printOrder') &&
305   - !paths?.includes('supplierPrint') &&
306   - !paths?.includes('procurePrint') &&
307   - !paths?.includes('rePrintOrder')
308   - ) {
309   - return false;
310   - }
311   -
312   - return true;
313   - }
314   -
315   - /**
316   - * 重置当前的操作对象
317   - */
318   - function clearOptObject() {
319   - setCurrentMainId(undefined);
320   - setCurretnOptSubId(undefined);
321   - setIsMainOrder(false);
322   - }
323   -
324   - /**
325   - * 初始化当前的操作对象
326   - * @param subId
327   - * @param mainId
328   - */
329   - function createOptObject(subId: any, mainId: any) {
330   - setCurrentMainId(mainId);
331   - setCurretnOptSubId(subId);
332   - }
333   -
334   - /**
335   - * 检查当前操作是否异常
336   - */
337   - // function checkOptValid() {
338   - // if ((currentOptMainId === undefined || currentOptMainId === null) && (curretnOptSubId === undefined || curretnOptSubId === null)) {
339   - // message.error("页面错误:当前操作对象为空,请联系系统管理员");
340   - // return false;
341   - // }
342   -
343   - // //检查数据是否存在
344   - // //主订单数据
345   - // if (!Array.from(mainOrderIdSubOrderIdRelationsMap.keys()).includes(currentOptMainId)) {
346   - // message.error("页面错误:当前操作主订单对象为空,请联系系统管理员");
347   - // }
348   -
349   - // //子订单
350   - // let allSubIds = [];
351   - // for (const idList of mainOrderIdSubOrderIdRelationsMap.values()) {
352   - // allSubIds.push(...idList);
353   - // }
354   - // if (!allSubIds.includes(curretnOptSubId)) {
355   - // message.error("页面错误:当前操作子订单对象为空,请联系系统管理员");
356   - // return false
357   - // }
358   -
359   - // return true;
360   - // }
361   -
362   - /**
363   - * 获取当前选中子订单的其中一个主订单
364   - */
365   - function getFirstMainOrder() {
366   - let mainId = [...subOrderSelectedMap.values()].flat()[0].mainOrderId;
367   - for (let item of data) {
368   - if (item.id === mainId) {
369   - return item;
370   - }
371   - }
372   -
373   - return null;
374   - }
375   -
376   - /**
377   - * 返回当前操作的主订单数据
378   - */
379   - function buildMainOrder() {
380   - if (currentOptMainId === undefined || currentOptMainId === null) {
381   - message.error('页面错误:当前操作的主订单id不存在,请联系系统管理员');
382   - return;
383   - }
384   -
385   - let mainOrderClone = null;
386   - let matchedData = data.filter((item) => {
387   - return item.id === currentOptMainId;
388   - });
389   - if (matchedData.length > 0) {
390   - mainOrderClone = cloneDeep(matchedData[0]);
391   - }
392   -
393   - if (mainOrderClone === null) {
394   - message.error('页面错误:当前操作的主订单数据不存在,请联系系统管理员');
395   - }
396   -
397   - return mainOrderClone;
398   - }
399   -
400   - /**
401   - * 返回当前操作的子订单集合
402   - */
403   - function buildSubOrders() {
404   - if (currentOptMainId === undefined || currentOptMainId === null) {
405   - message.error('页面错误:当前操作的主订单id不存在,请联系系统管理员');
406   - return;
407   - }
408   -
409   - let cloneSubOrders = [];
410   -
411   - //如果没有传当前操作的子订单id,说明是操作主订单
412   - if (curretnOptSubId === undefined || curretnOptSubId === null) {
413   - //如果有选中子订单,那么取选中的子订单为操作对象,否则取当前主订单的全部子订单为操作对象
414   - let currentOptSubOrders = subOrderSelectedMap.get(currentOptMainId);
415   - if (
416   - currentOptSubOrders === null ||
417   - currentOptSubOrders === undefined ||
418   - currentOptSubOrders.length === 0
419   - ) {
420   - for (let item of data) {
421   - if (item.id === currentOptMainId) {
422   - for (let subOrder of item?.subOrderInformationLists) {
423   - cloneSubOrders.push(cloneDeep(subOrder));
424   - }
425   - }
426   - }
427   - } else {
428   - cloneSubOrders = currentOptSubOrders.map((item) => {
429   - return cloneDeep(item);
430   - });
431   - }
432   - } else {
433   - //操作的是子订单
434   - for (let item of data) {
435   - if (item.id === currentOptMainId) {
436   - for (let subOrder of item?.subOrderInformationLists) {
437   - if (subOrder.id === curretnOptSubId) {
438   - cloneSubOrders.push(cloneDeep(subOrder));
439   - break;
440   - }
441   - }
442   - }
443   - }
444   - }
445   -
446   - if (cloneSubOrders.length === 0) {
447   - message.error('页面错误:当前操作的订单数据不存在,请联系系统管理员');
448   - return;
449   - }
450   -
451   - return cloneSubOrders;
452   - }
453   -
454   - /**
455   - * 获取当前操作申请开票的订单总金额
456   - */
457   - function getApplyInvoicingTotalPayment() {
458   - let subOrders = isMainOrder
459   - ? [...subOrderSelectedMap.values()].flat()
460   - : buildSubOrders();
461   -
462   - let totalPayment = 0;
463   - if (subOrders && subOrders.length > 0) {
464   - let mainIds = subOrders?.map((item: any) => {
465   - return item.mainOrderId;
466   - });
467   -
468   - let uniqueMainIds = [...new Set(mainIds)];
469   -
470   - let dataMap = data.reduce((map, obj: any) => {
471   - map.set(obj.id, obj);
472   - return map;
473   - }, new Map());
474   -
475   - uniqueMainIds.forEach((id: any) => {
476   - let o = dataMap.get(id);
477   - if (o) {
478   - totalPayment = FloatAdd(totalPayment, o.totalPayment);
479   - }
480   - });
481   - }
482   - return totalPayment;
483   - }
484   -
485   - /**
486   - * 根据主订单id,将该主订单下的所有子订单取消选中
487   - */
488   - const removeSelectedSubOrderKeysByMainOrderId = (id: any) => {
489   - let currentMainOrderAllSubOrderIds =
490   - mainOrderIdSubOrderIdRelationsMap.get(id);
491   - if (currentMainOrderAllSubOrderIds) {
492   - let newSelectedSubOrderKeys = selectedSubOrderKeys.filter((item) => {
493   - return !currentMainOrderAllSubOrderIds.includes(item);
494   - });
495   - setSelectedSubOrderKeys(newSelectedSubOrderKeys);
496   - }
497   - };
498   -
499   - /**
500   - * 根据主订单id取消选中主订单
501   - * @param id
502   - */
503   - const removeSelecetMainOrderKeyByMainOrderId = (id: any) => {
504   - if (selectedMainOrderKeys.includes(id)) {
505   - let newSelectedMainOrderKeys = selectedMainOrderKeys.filter((item) => {
506   - return item !== id;
507   - });
508   - setSelectedMainOrderKeys(newSelectedMainOrderKeys);
509   - }
510   - };
511   -
512   - const onCheckboxChange = (record: never) => {
513   - let newSelectedMainOrderKeys = [];
514   - if (selectedMainOrderKeys.includes(record.id)) {
515   - newSelectedMainOrderKeys = selectedMainOrderKeys.filter(
516   - (key) => key !== record.id,
517   - );
518   - removeSelectedSubOrderKeysByMainOrderId(record.id);
519   - setSelectedRows([]);
520   -
521   - //删除选中主订单的信息
522   - mainOrderSelectedMap.delete(record.id);
523   - //删除选中主订单附属子订单的信息
524   - subOrderSelectedMap.delete(record.id);
525   - //总选中按钮取消选中
526   - setAllMainChecked(false);
527   - } else {
528   - newSelectedMainOrderKeys = [...selectedMainOrderKeys, record.id];
529   - //子订单全部自动选中
530   - let subIds = record.subOrderInformationLists?.map((item) => {
531   - return item.id;
532   - });
533   - let newSelectedSubOrderKeys = [...selectedSubOrderKeys];
534   - for (let subId of subIds) {
535   - if (!selectedSubOrderKeys.includes(subId)) {
536   - newSelectedSubOrderKeys.push(subId);
537   - }
538   - }
539   - setSelectedSubOrderKeys(newSelectedSubOrderKeys);
540   -
541   - setSelectedRows(record.subOrderInformationLists);
542   -
543   - //选中主订单
544   - mainOrderSelectedMap.set(record.id, record);
545   - //选中子订单
546   - subOrderSelectedMap.set(record.id, record.subOrderInformationLists);
547   - setSubOrderSelectedMap(new Map(subOrderSelectedMap));
548   -
549   - //如果所有主订单都勾选上了,那么勾选上总选中按钮
550   - if (
551   - mainOrderSelectedMap?.size === mainOrderIdSubOrderIdRelationsMap.size
552   - ) {
553   - setAllMainChecked(true);
554   - }
555   - }
556   - setSelectedMainOrderKeys(newSelectedMainOrderKeys);
557   - };
558   - // const handleTableExpand = (mainOrderIds: any) => {
559   - // setExpandedRowKeys(mainOrderIds);
560   - // };
561   -
562   - const allMainCheckBoxChange = () => {
563   - let checked = !allMainChecked;
564   - setAllMainChecked(checked);
565   -
566   - if (checked) {
567   - let mainOrderIds = data?.map((item) => {
568   - mainOrderSelectedMap.set(item.id, item);
569   - return item.id;
570   - });
571   -
572   - let subOrderIds = [];
573   - for (let subIdList of mainOrderIdSubOrderIdRelationsMap.values()) {
574   - subOrderIds.push(...subIdList);
575   - }
576   -
577   - if (data) {
578   - for (let item of data) {
579   - mainOrderSelectedMap.set(item.id, item);
580   -
581   - subOrderSelectedMap.set(item.id, item.subOrderInformationLists);
582   - }
583   - }
584   -
585   - setSelectedMainOrderKeys(mainOrderIds);
586   - setSelectedSubOrderKeys(subOrderIds);
587   - } else {
588   - setSelectedMainOrderKeys([]);
589   - setSelectedSubOrderKeys([]);
590   - mainOrderSelectedMap.clear();
591   - subOrderSelectedMap.clear();
592   - }
593   - };
594   -
595   - //表头渲染
596   - const OrderTableHeader = () => {
597   - return (
598   - <Flex className="w-full">
599   - <Flex className="w-[1%] ml-[7px]">
600   - <Checkbox
601   - onChange={allMainCheckBoxChange}
602   - checked={allMainChecked}
603   - ></Checkbox>
604   - </Flex>
605   - <Flex className="w-[30%] ml-[1%]">
606   - <span className="font-medium">商品信息</span>
607   - </Flex>
608   - <Flex className="w-[13%]">
609   - <span className="font-medium">交易金额</span>
610   - </Flex>
611   -
612   - {!isSupplier() ? (
613   - <>
614   - <Flex className="w-[10%]">
615   - <span className="font-medium">支付</span>
616   - </Flex>
617   - <Flex className="w-[12%]">
618   - <span className="font-medium">其他</span>
619   - </Flex>
620   - </>
621   - ) : (
622   - ''
623   - )}
624   -
625   - <Flex className="w-[10%]">
626   - <span className="font-medium">交易状态</span>
627   - </Flex>
628   - <Flex className="w-[17%]">
629   - <span className="font-medium">操作</span>
630   - </Flex>
631   - </Flex>
632   - );
633   - };
634   - //子订单内容渲染
635   - const SubOderRander = ({ record, optRecord }) => {
636   - /**
637   - * 获取订单状态标签
638   - * @param optRecord
639   - */
640   - function getOrderStatusTag(optRecord: any): import('react').ReactNode {
641   - console.log(optRecord);
642   -
643   - const orderStatus = optRecord.orderStatus;
644   - const paymentMethod = optRecord.paymentMethod;
645   - let orderStatusTagText = enumValueToLabel(
646   - optRecord.orderStatus,
647   - ORDER_STATUS_OPTIONS,
648   - );
649   -
650   - if (orderStatus === 'WAIT_CONFIRM_DELIVER_AFTER_INVOICE') {
651   - if (optRecord.afterInvoicingStatus !== 'COMPLETE_INVOICING') {
652   - orderStatusTagText = '待开票';
653   - } else {
654   - orderStatusTagText = '待确认发货';
655   - }
656   - }
657   -
658   - //如果是未审核或者领导已审核,付款状态为预付款则需要财务审核【财务待审核】,否则仓库审核【】
659   - if (orderStatus === 'UNAUDITED' || orderStatus === 'LEADER_AUDITED') {
660   - if (paymentMethod === 'PAYMENT_IN_ADVANCE') {
661   - orderStatusTagText = '财务待审核';
662   - } else {
663   - orderStatusTagText = '仓库待审核';
664   - }
665   - }
666   -
667   - //如果是财务已审核,显示为【仓库待审核】
668   - if (orderStatus === 'FINANCE_PROCESS') {
669   - orderStatusTagText = '仓库待审核';
670   - }
671   -
672   - if (orderStatus === 'AUDIT_FAILED') {
673   - return (
674   - <MyToolTip
675   - key="key"
676   - title={optRecord.checkNotes + ' ' + optRecord.postAuditNotes}
677   - content={
678   - <>
679   - <Tag
680   - color={TAGS_COLOR.get(optRecord.orderStatus)}
681   - style={{ marginRight: '4px' }}
682   - >
683   - {orderStatusTagText}
684   - </Tag>
685   - <QuestionCircleOutlined style={{ color: '#C1C1C1' }} />
686   - </>
687   - }
688   - />
689   - );
690   - }
691   -
692   - if (
693   - orderStatus === 'AFTER_SALES_COMPLETION' ||
694   - orderStatus === 'IN_AFTER_SALES'
695   - ) {
696   - return (
697   - <Tag
698   - color={TAGS_COLOR.get(optRecord.orderStatus)}
699   - style={{ marginRight: '4px' }}
700   - >
701   - {orderStatusTagText}
702   - </Tag>
703   - );
704   - }
705   -
706   - if (orderStatus === 'PROCURE_CONVERT_WAREHOUSE_KEEPER') {
707   - return (
708   - <MyToolTip
709   - key="key"
710   - title={optRecord.checkNotes}
711   - content={
712   - <>
713   - <Tag
714   - color={TAGS_COLOR.get(optRecord.orderStatus)}
715   - style={{ marginRight: '4px' }}
716   - >
717   - {orderStatusTagText}
718   - </Tag>
719   - <QuestionCircleOutlined style={{ color: '#C1C1C1' }} />
720   - </>
721   - }
722   - />
723   - );
724   - }
725   -
726   - return (
727   - <Tag key="key" color={TAGS_COLOR.get(optRecord.orderStatus)}>
728   - {orderStatusTagText}
729   - </Tag>
730   - );
731   - }
732   -
733   - /**
734   - * 获取后置审核状态标签
735   - * @param optRecord
736   - */
737   - function getPostAuditStatusTag(optRecord: any): import('react').ReactNode {
738   - return (
739   - <Tag key="key" color={TAGS_COLOR.get(optRecord.postAuditStatus)}>
740   - {enumValueToLabel(optRecord.postAuditStatus, POST_AUDIT_OPTIONS)}
741   - </Tag>
742   - );
743   - }
744   -
745   - //申请开票附件处理
746   - const getAfterAnnexList = () => {
747   - // let links = [];
748   - let afterAnnexList = optRecord.afterAnnexList;
749   - let i = 1;
750   - let images = [];
751   - let otherAnnex = [];
752   - if (afterAnnexList?.length > 0) {
753   - for (let url of afterAnnexList) {
754   - let name = getAliYunOSSFileNameFromUrl(url);
755   - if (isImageName(name)) {
756   - images.push({ name: name, url: url });
757   - } else {
758   - otherAnnex.push({ name: '附件' + i++, url: url });
759   - }
760   - }
761   - }
762   -
763   - return (
764   - <div className="pl-1">
765   - <Image.PreviewGroup
766   - className="mr-10"
767   - preview={{
768   - onChange: (current, prev) =>
769   - console.log(`current index: ${current}, prev index: ${prev}`),
770   - }}
771   - >
772   - {images.map((item, index) => (
773   - <React.Fragment key={index}>
774   - {index > 0 ? <Divider type="vertical" /> : ''}
775   - <Image
776   - className="max-h-[50px] max-w-[70px]"
777   - src={item.url}
778   - title={item.name}
779   - />{' '}
780   - </React.Fragment>
781   - ))}
782   - </Image.PreviewGroup>
783   - {otherAnnex.map((item, index) => {
784   - return (
785   - <Popconfirm
786   - title="下载或预览"
787   - key={index}
788   - onConfirm={() => {
789   - window.open(
790   - '/previewApi/onlinePreview?url=' +
791   - encodeURIComponent(Base64.encode(item.url)),
792   - );
793   - }}
794   - onCancel={() => {
795   - window.open(item.url);
796   - }}
797   - okText="预览"
798   - cancelText="下载"
799   - >
800   - <Button className="px-1" key={index} type="link">
801   - {item.name}
802   - </Button>
803   - </Popconfirm>
804   - );
805   - })}
806   - </div>
807   - );
808   - };
809   -
810   - //财务审核附件处理
811   - const getInvoicingCheckAnnexList = () => {
812   - let invoicingCheckAnnexList = optRecord.invoicingCheckAnnexList;
813   - return (
814   - <div>
815   - <Image.PreviewGroup
816   - className="mr-10"
817   - preview={{
818   - onChange: (current, prev) =>
819   - console.log(`current index: ${current}, prev index: ${prev}`),
820   - }}
821   - >
822   - {invoicingCheckAnnexList.map((url, index) => (
823   - <React.Fragment key={index}>
824   - <Image className="max-h-[50px] max-w-[70px]" src={url} />{' '}
825   - <Divider type="vertical" />
826   - </React.Fragment>
827   - ))}
828   - </Image.PreviewGroup>
829   - </div>
830   - );
831   - };
832   -
833   - return (
834   - <>
835   - <Flex className="w-full border-b-indigo-500">
836   - <Flex vertical className="w-[31%]" gap="small">
837   - {/* 商品名称 */}
838   - <div>
839   - <div
840   - className="overflow-hidden whitespace-no-wrap overflow-ellipsis hover:cursor-pointer"
841   - onClick={() => {
842   - copyToClipboard(optRecord.productName);
843   - message.info('商品名称复制成功:' + optRecord.productName);
844   - }}
845   - title={optRecord.productName}
846   - >
847   - <span className="font-medium text-black ">
848   - {optRecord.productName}
849   - </span>
850   - </div>
851   - <div className="text-xs text-[#8C8C8C]">
852   - <span
853   - className="cursor-pointer"
854   - onClick={() => {
855   - copyToClipboard(optRecord.id);
856   - message.info('子订单编号复制成功:' + optRecord.id);
857   - }}
858   - >
859   - {optRecord.id}
860   - </span>
861   - {(roleCode === 'salesRepresentative' ||
862   - roleCode === 'salesManager') &&
863   - !optRecord.isCurrentUserOrder ? (
864   - <span className="text-[#f44e4e]">(非本账号订单)</span>
865   - ) : (
866   - ''
867   - )}
868   - {optRecord.modifiedOptFlag !== null ? (
869   - <span className="text-[#f44e4e] cursor-pointer">
870   - {optRecord.modifiedOptFlag === 'MODIFY' ? '(修改中)' : ''}
871   - {optRecord.modifiedOptFlag === 'DELETE' ? '(删除中)' : ''}
872   - {optRecord.modifiedOptFlag === 'INSERT' ? '(新增中)' : ''}
873   - </span>
874   - ) : (
875   - ''
876   - )}
877   -
878   - {optRecord.modified ? (
879   - <Tooltip title="点击查看详情">
880   - <span
881   - className="text-[#f44e4e] cursor-pointer"
882   - onClick={async () => {
883   - createOptObject(optRecord.id, record.id);
884   - setModifiedDiffModalVisible(true);
885   - }}
886   - >
887   - (内容有变化)
888   - </span>
889   - </Tooltip>
890   - ) : (
891   - ''
892   - )}
893   - {!optRecord.logicDelete ? (
894   - <span className="text-[#f44e4e]">(已作废)</span>
895   - ) : (
896   - ''
897   - )}
898   - </div>
899   - </div>
900   -
901   - <div
902   - className="overflow-hidden whitespace-no-wrap overflow-ellipsis hover:cursor-pointer"
903   - title={optRecord.parameters}
904   - onClick={() => {
905   - copyToClipboard(optRecord.parameters);
906   - message.info('商品名称复制成功:' + optRecord.parameters);
907   - }}
908   - >
909   - <span className="text-[#8C8C8C]">
910   - 参数:{optRecord.parameters}
911   - </span>
912   - </div>
913   - </Flex>
914   - <Flex className="w-[13%]" vertical gap="small">
915   - {!isSupplier() ? (
916   - <>
917   - <div
918   - className="overflow-hidden whitespace-no-wrap overflow-ellipsis"
919   - title={optRecord.productPrice}
920   - >
921   - <span className="text-[#8C8C8C]">单价:</span>
922   - <span className="text-slate-700">
923   - ¥{optRecord.productPrice}
924   - </span>
925   - </div>
926   - </>
927   - ) : (
928   - ''
929   - )}
930   -
931   - <div
932   - className="overflow-hidden whitespace-no-wrap overflow-ellipsis"
933   - title={optRecord.quantity}
934   - >
935   - <span className="text-[#8C8C8C]">数量:</span>
936   - <span className="text-slate-700">
937   - x{optRecord.quantity + ' '}
938   - </span>
939   - <span className="text-[#8C8C8C]">{optRecord.unit}</span>
940   - </div>
941   -
942   - {!isSupplier() ? (
943   - <div
944   - className="overflow-hidden whitespace-no-wrap overflow-ellipsis"
945   - title={optRecord.subOrderPayment}
946   - >
947   - <span className="text-[#8C8C8C]">合计:</span>
948   - <span className="text-slate-700">
949   - ¥{optRecord.subOrderPayment}
950   - </span>
951   - </div>
952   - ) : (
953   - ''
954   - )}
955   - </Flex>
956   -
957   - <Flex className="w-[10%]" vertical gap="small">
958   - {!isSupplier() ? (
959   - <>
960   - {/* 支付方式 */}
961   - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
962   - <span className="text-slate-700">
963   - {optRecord.paymentMethodText}
964   - </span>
965   - </div>
966   - {/* 支付渠道 */}
967   - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
968   - <span className="text-slate-700">
969   - {enumValueToLabel(
970   - optRecord.paymentChannel,
971   - PAYMENT_CHANNEL_OPTIONS,
972   - )}
973   - </span>
974   - </div>
975   - {/* 回款审核状态 */}
976   - {optRecord.paymentReceiptStatus !== null ? (
977   - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
978   - <Tag
979   - className="hover:cursor-pointer"
980   - onMouseEnter={(e: any) => {
981   - e.target.innerText = '点击查看回款凭证';
982   - }}
983   - onMouseLeave={(e: any) => {
984   - e.target.innerText = enumValueToLabel(
985   - optRecord.paymentReceiptStatus,
986   - PAYMENT_RECEIPTS_STATUS_OPTIONS,
987   - );
988   - }}
989   - onClick={() => {
990   - createOptObject(optRecord.id, record.id);
991   - setImagesViewerOptType('paymentReceipt');
992   - setImagesViewerModalVisible(true);
993   - }}
994   - key="key"
995   - color={TAGS_COLOR.get(optRecord.paymentReceiptStatus)}
996   - >
997   - {enumValueToLabel(
998   - optRecord.paymentReceiptStatus,
999   - PAYMENT_RECEIPTS_STATUS_OPTIONS,
1000   - )}
1001   - </Tag>
1002   - </div>
1003   - ) : (
1004   - ''
1005   - )}
1006   - </>
1007   - ) : (
1008   - ''
1009   - )}
1010   - </Flex>
1011   - <Flex className="w-[13%]" vertical gap="small">
1012   - {!isSupplier() ? (
1013   - <>
1014   - {/* 所属部门 */}
1015   - <div
1016   - className="overflow-hidden whitespace-no-wrap overflow-ellipsis"
1017   - title={enumValueToLabel(
1018   - optRecord.productBelongBusiness,
1019   - PRODUCT_BELONG_DEPARTMENT_OPTIONS,
1020   - )}
1021   - >
1022   - <span className="text-slate-700">
1023   - {enumValueToLabel(
1024   - optRecord.productBelongBusiness,
1025   - PRODUCT_BELONG_DEPARTMENT_OPTIONS,
1026   - )}
1027   - </span>
1028   - </div>
1029   -
1030   - {/* 开票类型 */}
1031   - {optRecord.invoicingStatus !== null ? (
1032   - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1033   - <span className="text-slate-700">
1034   - {getInvoicingType(optRecord)}
1035   - </span>
1036   - </div>
1037   - ) : (
1038   - ''
1039   - )}
1040   -
1041   - {/* 开票状态 */}
1042   - {optRecord.afterInvoicingStatus !== null ? (
1043   - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1044   - <Tooltip
1045   - title={
1046   - optRecord.invoicingUrgentCause !== null &&
1047   - optRecord.afterInvoicingStatus ===
1048   - 'URGENT_INVOICE_AUDITING'
1049   - ? optRecord.invoicingUrgentCause
1050   - : enumValueToLabel(
1051   - optRecord.afterInvoicingStatus,
1052   - AFTER_INVOICING_STATUS,
1053   - )
1054   - }
1055   - >
1056   - <Tag
1057   - color={TAGS_COLOR.get(optRecord.afterInvoicingStatus)}
1058   - >
1059   - {enumValueToLabel(
1060   - optRecord.afterInvoicingStatus,
1061   - AFTER_INVOICING_STATUS,
1062   - )}
1063   - </Tag>
1064   - </Tooltip>
1065   - </div>
1066   - ) : (
1067   - ''
1068   - )}
1069   -
1070   - {/* 是否加急图标显示 */}
1071   - {optRecord.isUrgent ? (
1072   - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1073   - <Tooltip
1074   - title={'期望开票时间:' + formatdate(optRecord.deadline)}
1075   - >
1076   - <Tag color="red">加急开票</Tag>
1077   - </Tooltip>
1078   - </div>
1079   - ) : (
1080   - ''
1081   - )}
1082   -
1083   - {(roleCode === 'warehouseKeeper' || roleCode === 'admin') &&
1084   - optRecord.shippingWarehouse !== null ? (
1085   - <div
1086   - className="overflow-hidden whitespace-no-wrap overflow-ellipsis"
1087   - title={enumValueToLabel(
1088   - optRecord.shippingWarehouse,
1089   - SHIPPING_WAREHOUSE_OPTIONS,
1090   - )}
1091   - >
1092   - <span className="text-slate-700">
1093   - {enumValueToLabel(
1094   - optRecord.shippingWarehouse,
1095   - SHIPPING_WAREHOUSE_OPTIONS,
1096   - )}
1097   - </span>
1098   - </div>
1099   - ) : (
1100   - ''
1101   - )}
1102   -
1103   - {/* 生产时间 */}
1104   - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1105   - {optRecord.productionStartTime !== null ||
1106   - optRecord.productionEndTime !== null ? (
1107   - <MyToolTip
1108   - title={
1109   - formatdate(optRecord.productionStartTime) +
1110   - ' 至 ' +
1111   - formatdate(optRecord.productionEndTime)
1112   - }
1113   - content={
1114   - <Button type="link" size="small" style={{ padding: 0 }}>
1115   - 生产时间
1116   - </Button>
1117   - }
1118   - />
1119   - ) : (
1120   - ''
1121   - )}
1122   - </div>
1123   - </>
1124   - ) : (
1125   - ''
1126   - )}
1127   - </Flex>
1128   -
1129   - <Flex className="w-[10%]" vertical gap="small">
1130   - {/* 开票状态 */}
1131   - {!isSupplier() ? (
1132   - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1133   - <Tag
1134   - color={
1135   - optRecord.invoicingTime === null ||
1136   - optRecord.invoicingTime === undefined
1137   - ? TAGS_COLOR.get(optRecord.invoicingStatus)
1138   - : 'success'
1139   - }
1140   - >
1141   - {getNeedInvoicing(optRecord)}
1142   - </Tag>
1143   - </div>
1144   - ) : (
1145   - ''
1146   - )}
1147   -
1148   - {/* 订单状态 */}
1149   - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1150   - {getOrderStatusTag(optRecord)}
1151   - </div>
1152   -
1153   - {/* 后置审核状态 */}
1154   - {optRecord.postAuditStatus !== null ? (
1155   - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1156   - {getPostAuditStatusTag(optRecord)}
1157   - </div>
1158   - ) : (
1159   - ''
1160   - )}
1161   -
1162   - {/**采购是否已下单状态 */}
1163   - {optRecord.procureOrderStatus !== null &&
1164   - optRecord.procureOrderStatus !== undefined ? (
1165   - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1166   - <Tag color="success">
1167   - {enumValueToLabel(
1168   - optRecord.procureOrderStatus,
1169   - PROCURE_ORDER_STATUS,
1170   - )}
1171   - </Tag>
1172   - </div>
1173   - ) : (
1174   - ''
1175   - )}
1176   -
1177   - {/* 物流信息 */}
1178   - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1179   - {optRecord.orderStatus === 'CONFIRM_RECEIPT' ||
1180   - optRecord.orderStatus === 'AFTER_SALES_COMPLETION' ||
1181   - optRecord.orderStatus === 'IN_AFTER_SALES' ||
1182   - optRecord.orderStatus === 'SHIPPED' ? (
1183   - <MyToolTip
1184   - title={
1185   - optRecord.serialNumber === undefined
1186   - ? '暂无物流信息'
1187   - : enumValueToLabel(
1188   - optRecord.logisticsMethod,
1189   - LOGISTICS_STATUS_OPTIONS,
1190   - ) +
1191   - ' ' +
1192   - optRecord.serialNumber +
1193   - ' ' +
1194   - optRecord.logisticsNotes
1195   - }
1196   - content={
1197   - <Button type="link" size="small" style={{ padding: 0 }}>
1198   - 物流信息
1199   - </Button>
1200   - }
1201   - />
1202   - ) : (
1203   - ''
1204   - )}
1205   -
1206   - {/* 修改审核状态 */}
1207   - {optRecord.modifiedAuditStatus !== null &&
1208   - optRecord.modifiedAuditStatus !== 'AUDIT_FAILURE' ? (
1209   - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1210   - <Tooltip
1211   - title={recordOptNode ? recordOptNode : <Spin />}
1212   - onOpenChange={(open) => {
1213   - console.log('open:' + open);
1214   - console.log('id:' + optRecord.id);
1215   - if (open) {
1216   - triggerRecordOptNode(optRecord.id);
1217   - } else {
1218   - setRecordOptNode(null);
1219   - }
1220   - }}
1221   - >
1222   - <Tag color={TAGS_COLOR.get(optRecord.modifiedAuditStatus)}>
1223   - {enumValueToLabel(
1224   - optRecord.modifiedAuditStatus,
1225   - MODIFIED_AUDIT_STATUS_OPTIONS,
1226   - )}
1227   - </Tag>
1228   - </Tooltip>
1229   - </div>
1230   - ) : (
1231   - ''
1232   - )}
1233   -
1234   - {optRecord.modifiedAuditStatus === 'AUDIT_FAILURE' ? (
1235   - <MyToolTip
1236   - key="key"
1237   - title={optRecord.modifiedAuditNotes}
1238   - content={
1239   - <>
1240   - <Tag
1241   - color={TAGS_COLOR.get(optRecord.modifiedAuditNotes)}
1242   - style={{ marginRight: '4px' }}
1243   - >
1244   - {enumValueToLabel(
1245   - optRecord.modifiedAuditStatus,
1246   - MODIFIED_AUDIT_STATUS_OPTIONS,
1247   - )}
1248   - </Tag>
1249   - <QuestionCircleOutlined style={{ color: '#C1C1C1' }} />
1250   - </>
1251   - }
1252   - />
1253   - ) : (
1254   - ''
1255   - )}
1256   - </div>
1257   - </Flex>
1258   - <Flex className="w-[18%]" wrap="wrap" gap="small">
1259   - {optRecord.paths?.includes('postAudit') ? (
1260   - <Button
1261   - className="p-0"
1262   - type="link"
1263   - onClick={() => {
1264   - createOptObject(optRecord.id, record.id);
1265   - setCheckVisible(true);
1266   - setOrderCheckType(CHECK_TYPE.WAITING_FOR_POST_AUDIT);
1267   - }}
1268   - >
1269   - 后置审核
1270   - </Button>
1271   - ) : (
1272   - ''
1273   - )}
1274   - {/* 加急审核 */}
1275   - {optRecord.paths?.includes('URGENT_INVOICE_AUDITING') ? (
1276   - <Button
1277   - className="p-0"
1278   - type="link"
1279   - onClick={() => {
1280   - console.log('here');
1281   - setCurrentMainId(record.id);
1282   - setCurretnOptSubId(optRecord.id);
1283   - setCheckVisible(true);
1284   - setOrderCheckType(CHECK_TYPE.URGENT_INVOICE_AUDITING);
1285   - }}
1286   - >
1287   - 加急审核(新)
1288   - </Button>
1289   - ) : (
1290   - ''
1291   - )}
1292   - {optRecord.paths?.includes('URGENT_INVOICE_AUDITING_old') ? (
1293   - <Button
1294   - className="p-0"
1295   - type="link"
1296   - onClick={() => {
1297   - console.log('here');
1298   - setCurrentMainId(record.id);
1299   - setCurretnOptSubId(optRecord.id);
1300   - setCheckVisible(true);
1301   - setOrderCheckType(CHECK_TYPE.URGENT_INVOICE_AUDITING_OLD);
1302   - }}
1303   - >
1304   - 加急审核(旧)
1305   - </Button>
1306   - ) : (
1307   - ''
1308   - )}
1309   - {optRecord.paths?.includes('salesConfirm') && (
1310   - <ButtonConfirm
1311   - className="p-0"
1312   - title="是否确认此商城订单信息无误?确认无误之后订单将进入审核流程。"
1313   - text="订单确认"
1314   - onConfirm={async () => {
1315   - let res = await postServiceOrderSalesConfirm({
1316   - data: {
1317   - subOrderIds: [optRecord.id],
1318   - },
1319   - });
1320   -
1321   - if (res && res.result === RESPONSE_CODE.SUCCESS) {
1322   - message.success(res.message);
1323   - refreshTable();
1324   - }
1325   - }}
1326   - />
1327   - )}
1328   - {optRecord.paths?.includes('uploadPaymentReceiptBill') ? (
1329   - <Button
1330   - className="p-0"
1331   - type="link"
1332   - onClick={() => {
1333   - createOptObject(optRecord.id, record.id);
1334   - setUploadPayBillModalVisible(true);
1335   - }}
1336   - >
1337   - 回款
1338   - </Button>
1339   - ) : (
1340   - ''
1341   - )}
1342   - {optRecord.paths?.includes('reissue_old') ? (
1343   - /*optRecord.afterInvoicingStatus==='PARTIAL_INVOICING'||
1344   - optRecord.afterInvoicingStatus==='COMPLETE_INVOICING'*/
1345   - <Button
1346   - className="p-0"
1347   - type="link"
1348   - onClick={() => {
1349   - setCurrentMainId(record.id);
1350   - setReissueVisibleOld(true);
1351   - }}
1352   - >
1353   - 重新开票(旧)
1354   - </Button>
1355   - ) : (
1356   - ''
1357   - )}
1358   - {optRecord.paths?.includes('reissue') ? (
1359   - /*optRecord.afterInvoicingStatus==='PARTIAL_INVOICING'||
1360   - optRecord.afterInvoicingStatus==='COMPLETE_INVOICING'*/
1361   - <Button
1362   - className="p-0"
1363   - type="link"
1364   - onClick={() => {
1365   - setCurrentMainId(record.id);
1366   - setCurretnOptSubId(optRecord.id);
1367   - setReissueVisible(true);
1368   - }}
1369   - >
1370   - 重新开票(新)
1371   - </Button>
1372   - ) : (
1373   - ''
1374   - )}
1375   -
1376   - {optRecord.paths?.includes('confirmReissue_old') ? (
1377   - <Button
1378   - className="p-0"
1379   - type="link"
1380   - onClick={() => {
1381   - setCurrentMainId(record.id);
1382   - setCurretnOptSubId(optRecord.id);
1383   - setCheckVisible(true);
1384   - setOrderCheckType(CHECK_TYPE.CONFIRM_REISSUE_OLD);
1385   - }}
1386   - >
1387   - 重新开票审核(旧)
1388   - </Button>
1389   - ) : (
1390   - ''
1391   - )}
1392   - {optRecord.paths?.includes('confirmReissue') ? (
1393   - <Button
1394   - className="p-0"
1395   - type="link"
1396   - onClick={() => {
1397   - setCurrentMainId(record.id);
1398   - setCurretnOptSubId(optRecord.id);
1399   - setCheckVisible(true);
1400   - setOrderCheckType(CHECK_TYPE.CONFIRM_REISSUE);
1401   - }}
1402   - >
1403   - 重新开票审核(新)
1404   - </Button>
1405   - ) : (
1406   - ''
1407   - )}
1408   -
1409   - {optRecord.paths?.includes('leaderAudit') ? (
1410   - <Button
1411   - className="p-0"
1412   - type="link"
1413   - onClick={() => {
1414   - setCurrentMainId(record.id);
1415   - setCurretnOptSubId(optRecord.id);
1416   - setCheckVisible(true);
1417   - setOrderCheckType(CHECK_TYPE.LEADER_AUDIT);
1418   - }}
1419   - >
1420   - 审核
1421   - </Button>
1422   - ) : (
1423   - ''
1424   - )}
1425   -
1426   - {optRecord.paths?.includes('creditAudit') ? (
1427   - <Button
1428   - className="p-0"
1429   - type="link"
1430   - onClick={() => {
1431   - setCurrentMainId(record.id);
1432   - setCurretnOptSubId(optRecord.id);
1433   - setCheckVisible(true);
1434   - setOrderCheckType(CHECK_TYPE.CREDIT_AUDIT);
1435   - }}
1436   - >
1437   - 赊账审核
1438   - </Button>
1439   - ) : (
1440   - ''
1441   - )}
1442   -
1443   - {optRecord.paths?.includes('auditPaymentReceipt') ? (
1444   - <Button
1445   - className="p-0"
1446   - type="link"
1447   - onClick={() => {
1448   - createOptObject(optRecord.id, record.id);
1449   - setCheckVisible(true);
1450   - setOrderCheckType(CHECK_TYPE.PAYMENT_RECEIPTS_AUDIT);
1451   - }}
1452   - >
1453   - 回款审核
1454   - </Button>
1455   - ) : (
1456   - ''
1457   - )}
1458   -
1459   - {optRecord.paths?.includes('modifiedAuditRequest') ? (
1460   - <Button
1461   - className="p-0"
1462   - type="link"
1463   - onClick={() => {
1464   - createOptObject(optRecord.id, record.id);
1465   - setCheckVisible(true);
1466   - setOrderCheckType(CHECK_TYPE.NODE_OPERATING_AUDIT);
1467   - }}
1468   - >
1469   - 节点修改审核
1470   - </Button>
1471   - ) : (
1472   - ''
1473   - )}
1474   -
1475   - {optRecord.paths?.includes('applyModify') ? (
1476   - <Button
1477   - className="p-0"
1478   - type="link"
1479   - onClick={() => {
1480   - createOptObject(optRecord.id, record.id);
1481   - setOrderDrawerVisible(true);
1482   - setOrderOptType('order-change-normal');
1483   - }}
1484   - >
1485   - 申请修改
1486   - </Button>
1487   - ) : (
1488   - ''
1489   - )}
1490   -
1491   - {optRecord.paths?.includes('modifiedLeaderAuditRequest') ? (
1492   - <Button
1493   - className="p-0"
1494   - type="link"
1495   - onClick={() => {
1496   - createOptObject(optRecord.id, record.id);
1497   - setCheckVisible(true);
1498   - setOrderCheckType(CHECK_TYPE.MODIFY_LEADER_AUDIT);
1499   - }}
1500   - >
1501   - 领导修改审核
1502   - </Button>
1503   - ) : (
1504   - ''
1505   - )}
1506   -
1507   - {optRecord.paths?.includes('shippingWarehouseChangeRequest') ? (
1508   - <Button
1509   - className="p-0"
1510   - type="link"
1511   - onClick={() => {
1512   - setIds([optRecord.id]);
1513   - createOptObject(optRecord.id, record.id);
1514   - setShippingWarehouseChangeModalVisible(true);
1515   - }}
1516   - >
1517   - 修改仓库
1518   - </Button>
1519   - ) : (
1520   - ''
1521   - )}
1522   -
1523   - {optRecord.paths?.includes('saleCancelInvoicing_old') ? (
1524   - <ButtonConfirm
1525   - className="p-0"
1526   - title="确认取消申请开票?"
1527   - text="取消申请(旧)"
1528   - onConfirm={async () => {
1529   - let res = await postServiceOrderSaleCancelInvoicing({
1530   - data: {
1531   - subOrderIds: [optRecord.id],
1532   - },
1533   - });
1534   -
1535   - if (res && res.result === RESPONSE_CODE.SUCCESS) {
1536   - message.success(res.message);
1537   - refreshTable();
1538   - }
1539   - }}
1540   - />
1541   - ) : (
1542   - ''
1543   - )}
1544   - {optRecord.paths?.includes('saleCancelInvoicing') ? (
1545   - <ButtonConfirm
1546   - className="p-0"
1547   - title="确认取消申请开票?"
1548   - text="取消申请(新)"
1549   - onConfirm={async () => {
1550   - let res = await postServiceInvoiceCancelApply({
1551   - data: {
1552   - subOrderIds: [optRecord.id],
1553   - },
1554   - });
1555   -
1556   - if (res && res.result === RESPONSE_CODE.SUCCESS) {
1557   - message.success(res.message);
1558   - refreshTable();
1559   - }
1560   - }}
1561   - />
1562   - ) : (
1563   - ''
1564   - )}
1565   - {optRecord.paths?.includes('noNeedInvoicingEdit') ? (
1566   - <Button
1567   - className="p-0"
1568   - type="link"
1569   - onClick={() => {
1570   - createOptObject(optRecord.id, record.id);
1571   - setFinancialEditVisible(true);
1572   - setIsMainOrder(false);
1573   - }}
1574   - >
1575   - 编辑时间
1576   - </Button>
1577   - ) : (
1578   - ''
1579   - )}
1580   - {optRecord.paths?.includes('sendProduct') ? (
1581   - <Button
1582   - className="p-0"
1583   - type="link"
1584   - onClick={() => {
1585   - createOptObject(optRecord.id, record.id);
1586   - setDeliverVisible(true);
1587   - setIsSendProduct(true);
1588   - setOrderCheckType(CHECK_TYPE.WEARHOUSE_KEEPER);
1589   - }}
1590   - >
1591   - 仓库发货
1592   - </Button>
1593   - ) : (
1594   - ''
1595   - )}
1596   -
1597   - {optRecord.paths?.includes('supplierSendOrder') ? (
1598   - <Button
1599   - className="p-0"
1600   - type="link"
1601   - onClick={() => {
1602   - optRecord.mainOrderId = record.id;
1603   - setSelectedRows([cloneDeep(optRecord)]); //克隆一份数据,避免后续修改污染
1604   - setDeliverVisible(true);
1605   - setIsSendProduct(true);
1606   - setOrderCheckType(CHECK_TYPE.SUPPLIER);
1607   - }}
1608   - >
1609   - 供应商发货
1610   - </Button>
1611   - ) : (
1612   - ''
1613   - )}
1614   -
1615   - {optRecord.paths?.includes('procureSend') ? (
1616   - <Button
1617   - className="p-0"
1618   - type="link"
1619   - onClick={() => {
1620   - createOptObject(optRecord.id, record.id);
1621   - setDeliverVisible(true);
1622   - setIsSendProduct(true);
1623   - setOrderCheckType(CHECK_TYPE.PROCURE);
1624   - }}
1625   - >
1626   - {isSupplier() ? '发货' : '采购发货'}
1627   - </Button>
1628   - ) : (
1629   - ''
1630   - )}
1631   -
1632   - {optRecord.paths?.includes('editProductionTime') ? (
1633   - <Button
1634   - className="p-0"
1635   - type="link"
1636   - onClick={() => {
1637   - createOptObject(optRecord.id, record.id);
1638   - setProductionTimeModalVisible(true);
1639   - }}
1640   - >
1641   - 生产时间
1642   - </Button>
1643   - ) : (
1644   - ''
1645   - )}
1646   -
1647   - {optRecord.paths?.includes('queryAnnex') &&
1648   - optRecord.listAnnex?.length > 0 ? (
1649   - <Button
1650   - className="p-0"
1651   - type="link"
1652   - onClick={() => {
1653   - optRecord.mainOrderId = record.id;
1654   - createOptObject(optRecord.id, record.id);
1655   - setAttachmentModalVisible(true);
1656   - }}
1657   - >
1658   - 附件
1659   - </Button>
1660   - ) : (
1661   - ''
1662   - )}
1663   -
1664   - {optRecord.paths?.includes('modifySendInformation') ? (
1665   - <Button
1666   - className="p-0"
1667   - type="link"
1668   - onClick={() => {
1669   - createOptObject(optRecord.id, record.id);
1670   - setDeliverVisible(true);
1671   - setIsSendProduct(false);
1672   - }}
1673   - >
1674   - 修改发货信息
1675   - </Button>
1676   - ) : (
1677   - ''
1678   - )}
1679   -
1680   - {optRecord.paths?.includes('printOrder') ? (
1681   - <Button
1682   - className="p-0"
1683   - type="link"
1684   - onClick={async () => {
1685   - createOptObject(optRecord.id, record.id);
1686   - setOrderPrintVisible(true);
1687   - setOrderCheckType(CHECK_TYPE.WEARHOUSE_KEEPER);
1688   - }}
1689   - >
1690   - 仓库打印
1691   - </Button>
1692   - ) : (
1693   - ''
1694   - )}
1695   -
1696   - {optRecord.paths?.includes('supplierPrint') ? (
1697   - <Button
1698   - className="p-0"
1699   - type="link"
1700   - onClick={async () => {
1701   - createOptObject(optRecord.id, record.id);
1702   - setOrderPrintVisible(true);
1703   - setOrderCheckType(CHECK_TYPE.SUPPLIER);
1704   - }}
1705   - >
1706   - 供应商打印
1707   - </Button>
1708   - ) : (
1709   - ''
1710   - )}
1711   -
1712   - {optRecord.paths?.includes('procurePrint') ? (
1713   - <ButtonConfirm
1714   - className="p-0"
1715   - title="确认打印?"
1716   - text="采购打印"
1717   - onConfirm={async () => {
1718   - let res = await postServiceOrderProcurePrint({
1719   - data: {
1720   - ids: [optRecord.id],
1721   - },
1722   - });
1723   -
1724   - if (res.result === RESPONSE_CODE.SUCCESS) {
1725   - message.success(res.message);
1726   - refreshTable();
1727   - }
1728   - }}
1729   - />
1730   - ) : (
1731   - // <Button
1732   - // className="p-0"
1733   - // type="link"
1734   - // onClick={async () => {
1735   - // setOrderPrintVisible(true);
1736   - // setSelectedRows([optRecord]);
1737   - // setOrderRow(record);
1738   - // setOrderCheckType(CHECK_TYPE.PROCURE);
1739   - // }}
1740   - // >
1741   - // 采购打印
1742   - // </Button>
1743   - ''
1744   - )}
1745   -
1746   - {optRecord.paths?.includes('editOrder') && false ? (
1747   - <Button
1748   - className="p-0"
1749   - type="link"
1750   - onClick={() => {
1751   - createOptObject(optRecord.id, record.id);
1752   - setFinancialVisible(true);
1753   - setIsEdit(true);
1754   - }}
1755   - >
1756   - 编辑
1757   - </Button>
1758   - ) : (
1759   - ''
1760   - )}
1761   -
1762   - {optRecord.paths?.includes('invoicing') ? (
1763   - <Button
1764   - className="p-0"
1765   - type="link"
1766   - onClick={() => {
1767   - createOptObject(optRecord.id, record.id);
1768   - setFinancialVisible(true);
1769   - setIsEdit(false);
1770   - setIsMainOrder(false);
1771   - }}
1772   - >
1773   - 开票
1774   - </Button>
1775   - ) : (
1776   - ''
1777   - )}
1778   -
1779   - {optRecord.paths?.includes('applyInvoicing') ? (
1780   - <Button
1781   - className="p-0"
1782   - type="link"
1783   - onClick={() => {
1784   - setInvoicingDrawerFormVisible(true);
1785   - createOptObject(optRecord.id, record.id);
1786   - setIsEdit(false);
1787   - setIsMainOrder(false);
1788   - }}
1789   - >
1790   - 申请开票(新)
1791   - </Button>
1792   - ) : (
1793   - ''
1794   - )}
1795   -
1796   - {optRecord.paths?.includes('applyInvoicing_old') ? (
1797   - <Button
1798   - className="p-0"
1799   - type="link"
1800   - onClick={() => {
1801   - setApplyForInvoicingVisible(true);
1802   - createOptObject(optRecord.id, record.id);
1803   - setIsEdit(false);
1804   - setIsMainOrder(false);
1805   - }}
1806   - >
1807   - 申请开票(旧)
1808   - </Button>
1809   - ) : (
1810   - ''
1811   - )}
1812   -
1813   - {optRecord.paths?.includes('checkOrder') ? (
1814   - <Button
1815   - className="p-0"
1816   - type="link"
1817   - onClick={() => {
1818   - setCurrentMainId(record.id);
1819   - setCurretnOptSubId(optRecord.id);
1820   - setCheckVisible(true);
1821   - setOrderCheckType(CHECK_TYPE.WEARHOUSE_KEEPER);
1822   - }}
1823   - >
1824   - 审核
1825   - </Button>
1826   - ) : (
1827   - ''
1828   - )}
1829   -
1830   - {optRecord.paths?.includes('afterSalesCheck') ? (
1831   - <Button
1832   - className="p-0"
1833   - type="link"
1834   - onClick={() => {
1835   - createOptObject(optRecord.id, record.id);
1836   - setCheckVisible(true);
1837   - setOrderCheckType(CHECK_TYPE.AFTER_SALES);
1838   - }}
1839   - >
1840   - 售后审核
1841   - </Button>
1842   - ) : (
1843   - ''
1844   - )}
1845   -
1846   - {optRecord.paths?.includes('financeCheckOrder') ? (
1847   - <Button
1848   - className="p-0"
1849   - type="link"
1850   - onClick={() => {
1851   - createOptObject(optRecord.id, record.id);
1852   - setCheckVisible(true);
1853   - setOrderCheckType(CHECK_TYPE.FINALCIAL);
1854   - }}
1855   - >
1856   - 财务审核
1857   - </Button>
1858   - ) : (
1859   - ''
1860   - )}
1861   -
1862   - {optRecord.paths?.includes('procureCheckOrder') ? (
1863   - <Button
1864   - className="p-0"
1865   - type="link"
1866   - onClick={() => {
1867   - createOptObject(optRecord.id, record.id);
1868   - setOrderCheckType(CHECK_TYPE.PROCURE);
1869   - setProcureCheckModalVisible(true);
1870   - }}
1871   - >
1872   - 采购审核
1873   - </Button>
1874   - ) : (
1875   - ''
1876   - )}
1877   -
1878   - {optRecord.paths?.includes('procureConvertProcure') ? (
1879   - <Button
1880   - className="p-0"
1881   - type="link"
1882   - onClick={() => {
1883   - createOptObject(optRecord.id, record.id);
1884   - setOrderCheckType(CHECK_TYPE.PROCURE);
1885   - setProcureConvertModalVisible(true);
1886   - }}
1887   - >
1888   - 转发
1889   - </Button>
1890   - ) : (
1891   - ''
1892   - )}
1893   -
1894   - {optRecord.paths?.includes('rePrintOrder') ? (
1895   - <Button
1896   - className="p-0"
1897   - type="link"
1898   - onClick={() => {
1899   - createOptObject(optRecord.id, record.id);
1900   - setOrderPrintVisible(true);
1901   - setIsRePrintOrder(true);
1902   - }}
1903   - >
1904   - 重新打印
1905   - </Button>
1906   - ) : (
1907   - ''
1908   - )}
1909   -
1910   - {optRecord.paths?.includes('confirmReceipt') ? (
1911   - <Button
1912   - className="p-0"
1913   - type="link"
1914   - onClick={() => {
1915   - createOptObject(optRecord.id, record.id);
1916   - setConfirmReceiptVisible(true);
1917   - }}
1918   - >
1919   - 确认收货
1920   - </Button>
1921   - ) : (
1922   - ''
1923   - )}
1924   -
1925   - {optRecord.paths?.includes('applyAfterSales') ? (
1926   - <Button
1927   - className="p-0"
1928   - type="link"
1929   - onClick={() => {
1930   - createOptObject(optRecord.id, record.id);
1931   - setOrderDrawerVisible(true);
1932   - setOrderOptType('after_sales');
1933   - }}
1934   - >
1935   - 申请售后
1936   - </Button>
1937   - ) : (
1938   - ''
1939   - )}
1940   -
1941   - {optRecord.paths?.includes('procureOrder') ? (
1942   - <ButtonConfirm
1943   - className="p-0"
1944   - title="是否已下单?"
1945   - text="下单"
1946   - onConfirm={async () => {
1947   - let res = await postServiceOrderProcureOrder({
1948   - data: { subIds: [optRecord.id] },
1949   - });
1950   - if (res.result === RESPONSE_CODE.SUCCESS) {
1951   - message.success(res.message);
1952   - refreshTable();
1953   - return true;
1954   - }
1955   - }}
1956   - />
1957   - ) : (
1958   - ''
1959   - )}
1960   -
1961   - {optRecord.paths?.includes('cancelSend') ? (
1962   - <ButtonConfirm
1963   - className="p-0"
1964   - title="是否取消发货"
1965   - text="取消发货"
1966   - onConfirm={async () => {
1967   - let res = await postServiceOrderCancelSend({
1968   - data: { subIds: [optRecord.id] },
1969   - });
1970   - if (res.result === RESPONSE_CODE.SUCCESS) {
1971   - message.success(res.message);
1972   - refreshTable();
1973   - return true;
1974   - }
1975   - }}
1976   - />
1977   - ) : (
1978   - ''
1979   - )}
1980   -
1981   - {optRecord.paths?.includes('noNeedSend') ? (
1982   - <ButtonConfirm
1983   - className="p-0"
1984   - title="此订单是否无需发货?"
1985   - text="无需发货"
1986   - onConfirm={async () => {
1987   - let res = await postServiceOrderNoNeedSend({
1988   - data: { ids: [optRecord.id] },
1989   - });
1990   - if (res.result === RESPONSE_CODE.SUCCESS) {
1991   - message.success(res.message);
1992   - refreshTable();
1993   - return true;
1994   - }
1995   - }}
1996   - />
1997   - ) : (
1998   - ''
1999   - )}
2000   -
2001   - {optRecord.paths?.includes('viewImages') ? (
2002   - <Button
2003   - className="p-0"
2004   - type="link"
2005   - onClick={() => {
2006   - createOptObject(optRecord.id, record.id);
2007   - setImagesViewerOptType('shippingReceipt');
2008   - setImagesViewerModalVisible(true);
2009   - }}
2010   - >
2011   - 查看收货凭证
2012   - </Button>
2013   - ) : (
2014   - ''
2015   - )}
2016   -
2017   - {optRecord.paths?.includes('confirmDeliver') ? (
2018   - <Button
2019   - className="p-0"
2020   - type="link"
2021   - onClick={() => {
2022   - createOptObject(optRecord.id, record.id);
2023   - setOrderCheckType(CHECK_TYPE.CONFIRM_DELIVER);
2024   - setCheckVisible(true);
2025   - }}
2026   - >
2027   - 确认发货
2028   - </Button>
2029   - ) : (
2030   - ''
2031   - )}
2032   -
2033   - {optRecord.paths?.includes('orderCancel') ? (
2034   - <ButtonConfirm
2035   - className="p-0"
2036   - title="确认作废?"
2037   - text="作废"
2038   - onConfirm={async () => {
2039   - let body = { ids: [optRecord.id], checkIsMainOrderId: false };
2040   - const data = await postServiceOrderOrderCancel({
2041   - data: body,
2042   - });
2043   - if (data.result === RESPONSE_CODE.SUCCESS) {
2044   - message.success(data.message);
2045   - refreshTable();
2046   - }
2047   - }}
2048   - />
2049   - ) : (
2050   - ''
2051   - )}
2052   - </Flex>
2053   - </Flex>
2054   -
2055   - <Flex title={optRecord.notes}>
2056   - <div
2057   - className="max-w-[1100px] overflow-hidden whitespace-normal overflow-ellipsis hover:cursor-pointer"
2058   - onClick={() => {
2059   - copyToClipboard(optRecord.notes);
2060   - message.info('备注复制成功:' + optRecord.notes);
2061   - }}
2062   - >
2063   - <span className="text-[#8C8C8C]">
2064   - 备注:
2065   - {optRecord.notes === null ? '暂无备注' : optRecord.notes}
2066   - </span>
2067   - </div>
2068   - {!isSupplier() && (isSales() || isWarehousekeeper() || isAdmin()) && (
2069   - <EditTwoTone
2070   - className="pl-1 pr-1 hover:curcor-pointer"
2071   - onClick={() => {
2072   - setNotesEditVisible(true);
2073   - setSelectedRows([optRecord.id]);
2074   - setNotes(optRecord.notes);
2075   - setNotesType(1);
2076   - }}
2077   - />
2078   - )}
2079   - </Flex>
2080   -
2081   - {(isProcure() || isWarehousekeeper() || isSales() || isAdmin()) &&
2082   - !isSupplier() ? (
2083   - <div className="pt-2">
2084   - <Flex title={optRecord.supplierName}>
2085   - <div>
2086   - <span className="text-[#8C8C8C]">
2087   - 所属采购:
2088   - {optRecord.supplierName === null
2089   - ? '暂无'
2090   - : optRecord.supplierName}
2091   - </span>
2092   - </div>
2093   -
2094   - <Divider type="vertical" />
2095   -
2096   - <div className="overflow-hidden whitespace-normal overflow-ellipsis hover:cursor-pointer">
2097   - <span className="text-[#8C8C8C]">
2098   - 采购备注:
2099   - {optRecord.procureNotes === null
2100   - ? '暂无备注'
2101   - : optRecord.procureNotes}
2102   - </span>
2103   - </div>
2104   - {/* 编辑备注按钮 */}
2105   - {(isProcure() || isAdmin()) && (
2106   - <EditTwoTone
2107   - className="pl-1 pr-1 hover:curcor-pointer"
2108   - onClick={() => {
2109   - setSelectedRows([optRecord.id]);
2110   - setNotes(optRecord.procureNotes);
2111   - setNotesEditVisible(true);
2112   - setNotesType(2);
2113   - }}
2114   - />
2115   - )}
2116   - </Flex>
2117   -
2118   - {(isAdmin() || isProcure()) && (
2119   - <Flex title={optRecord.supplierNotes}>
2120   - <div className="max-w-[90%] whitespace-no-wrap overflow-hidden overflow-ellipsis">
2121   - <span className="text-[#8C8C8C]">
2122   - 供应商备注:
2123   - {optRecord.supplierNotes === null
2124   - ? '暂无备注'
2125   - : optRecord.supplierNotes}
2126   - </span>
2127   - </div>
2128   - {/* 编辑备注按钮 */}
2129   - <EditTwoTone
2130   - className="pl-1 hover:curcor-pointer"
2131   - onClick={() => {
2132   - setSelectedRows([optRecord.id]);
2133   - setNotes(optRecord.supplierNotes);
2134   - setNotesEditVisible(true);
2135   - setNotesType(3);
2136   - }}
2137   - />
2138   - </Flex>
2139   - )}
2140   - </div>
2141   - ) : (
2142   - ''
2143   - )}
2144   -
2145   - {isAdmin() || isSales() || isFinance() ? (
2146   - <Flex title={optRecord.notes} className="pt-2">
2147   - <div className="flex items-center">
2148   - <div className="flex items-center max-w-[500px]">
2149   - <div className="max-w-md overflow-hidden whitespace-no-wrap overflow-ellipsis">
2150   - <Tooltip
2151   - title={optRecord.applyInvoicingNotes}
2152   - placement="topLeft"
2153   - >
2154   - <span className="text-[#8C8C8C]">
2155   - 申请开票备注:
2156   - {optRecord.applyInvoicingNotes === undefined ||
2157   - optRecord.applyInvoicingNotes === null
2158   - ? '暂无备注'
2159   - : optRecord.applyInvoicingNotes}
2160   - </span>
2161   - </Tooltip>
2162   - </div>
2163   -
2164   - {getAfterAnnexList()}
2165   -
2166   - <Tooltip title="编辑">
2167   - <EditTwoTone
2168   - className="pl-1 hover:curcor-pointer"
2169   - onClick={() => {
2170   - setNotesEditVisible(true);
2171   - setSelectedRows([optRecord.id]);
2172   - setNotes(optRecord.applyInvoicingNotes);
2173   - setNotesType(4);
2174   - }}
2175   - />
2176   - </Tooltip>
2177   - </div>
2178   - <Divider type="vertical" className="mx-5" />
2179   - <div className="flex items-center max-w-[500px]">
2180   - <div className="max-w-md overflow-hidden whitespace-no-wrap overflow-ellipsis">
2181   - <Tooltip title={optRecord.checkNotes} placement="topLeft">
2182   - <span className="text-[#8C8C8C] mr-3">
2183   - 财务审核备注:
2184   - {optRecord.checkNotes === undefined ||
2185   - optRecord.checkNotes === null
2186   - ? '暂无备注'
2187   - : optRecord.checkNotes}
2188   - </span>
2189   - </Tooltip>
2190   - </div>
2191   -
2192   - {getInvoicingCheckAnnexList()}
2193   - </div>
2194   - </div>
2195   - </Flex>
2196   - ) : (
2197   - ''
2198   - )}
2199   -
2200   - {isAdmin() || isSales() || isFinance() ? (
2201   - <Flex title={optRecord.notes} className="pt-2">
2202   - <div className="flex items-center">
2203   - <div className="flex items-center max-w-[500px]">
2204   - <div className="max-w-md overflow-hidden whitespace-no-wrap overflow-ellipsis">
2205   - <Tooltip title={optRecord.reissueNotes} placement="topLeft">
2206   - <span className="text-[#8C8C8C]">
2207   - 重新开票备注:
2208   - {optRecord.reissueNotes === undefined ||
2209   - optRecord.reissueNotes === null
2210   - ? '暂无备注'
2211   - : optRecord.reissueNotes}
2212   - </span>
2213   - </Tooltip>
2214   - </div>
2215   -
2216   - <Tooltip title="编辑">
2217   - <EditTwoTone
2218   - className="pl-1 hover:curcor-pointer"
2219   - onClick={() => {
2220   - setNotesEditVisible(true);
2221   - setSelectedRows([optRecord.id]);
2222   - setNotes(optRecord.reissueNotes);
2223   - setNotesType(5);
2224   - }}
2225   - />
2226   - </Tooltip>
2227   - </div>
2228   - <Divider type="vertical" className="mx-5" />
2229   - </div>
2230   - </Flex>
2231   - ) : (
2232   - ''
2233   - )}
2234   - </>
2235   - );
2236   - };
2237   - const expandedRowRender = (record) => {
2238   - let subOrders = record.subOrderInformationLists;
2239   -
2240   - return (
2241   - <ProTable
2242   - id="sub-table"
2243   - className="w-full "
2244   - showHeader={false}
2245   - columns={[
2246   - {
2247   - title: 'ID',
2248   - dataIndex: 'id',
2249   - key: 'id',
2250   - render: (text: any, optRecord: any) => {
2251   - return <SubOderRander record={record} optRecord={optRecord} />;
2252   - },
2253   - },
2254   - ]}
2255   - rowSelection={{
2256   - onSelect: (row: any) => {
2257   - let subId = row.id;
2258   - let mainId = row.mainOrderId;
2259   - let newSelectedSubOrderKeys = [...selectedSubOrderKeys];
2260   - let currentMainOrderSelectedSubOrderList =
2261   - subOrderSelectedMap.get(mainId);
2262   - if (!selectedSubOrderKeys.includes(subId)) {
2263   - //选中子订单
2264   - newSelectedSubOrderKeys.push(subId);
2265   -
2266   - //在Map中添加对应的主订单中的子订单
2267   - if (currentMainOrderSelectedSubOrderList) {
2268   - currentMainOrderSelectedSubOrderList.push(row);
2269   - } else {
2270   - currentMainOrderSelectedSubOrderList = [row];
2271   - }
2272   -
2273   - //如果该主订单的所有子订单都选中了,那么勾选上主订单
2274   - if (
2275   - currentMainOrderSelectedSubOrderList?.length ===
2276   - mainOrderIdSubOrderIdRelationsMap.get(mainId)?.length
2277   - ) {
2278   - selectedMainOrderKeys.push(mainId, record);
2279   - mainOrderSelectedMap.set(mainId, record);
2280   - }
2281   -
2282   - //如果所有主订单都勾选上了,那么勾选上总选中按钮
2283   - if (
2284   - mainOrderSelectedMap?.size ===
2285   - mainOrderIdSubOrderIdRelationsMap.size
2286   - ) {
2287   - setAllMainChecked(true);
2288   - }
2289   - } else {
2290   - //取消选中子订单
2291   - newSelectedSubOrderKeys = newSelectedSubOrderKeys.filter(
2292   - (item) => {
2293   - return item !== subId;
2294   - },
2295   - );
2296   -
2297   - removeSelecetMainOrderKeyByMainOrderId(mainId); //某个子订单取消勾选了,对应的主订单也要取消勾选
2298   -
2299   - //在Map中删除掉对应的主订单中的子订单
2300   - if (currentMainOrderSelectedSubOrderList) {
2301   - currentMainOrderSelectedSubOrderList =
2302   - currentMainOrderSelectedSubOrderList.filter((item) => {
2303   - return item.id !== subId;
2304   - });
2305   - } else {
2306   - subOrderSelectedMap.set(mainId, [row]);
2307   - }
2308   -
2309   - mainOrderSelectedMap.delete(mainId);
2310   - //总选中按钮取消选中
2311   - setAllMainChecked(false);
2312   - }
2313   -
2314   - //如果该主订单已经没有子订单选中,删除key
2315   - if (currentMainOrderSelectedSubOrderList?.length === 0) {
2316   - subOrderSelectedMap.delete(record.id);
2317   - } else {
2318   - subOrderSelectedMap.set(
2319   - record.id,
2320   - currentMainOrderSelectedSubOrderList,
2321   - );
2322   - }
2323   -
2324   - setSelectedSubOrderKeys(newSelectedSubOrderKeys);
2325   - setSelectedRows(currentMainOrderSelectedSubOrderList);
2326   - },
2327   - selectedRowKeys: selectedSubOrderKeys,
2328   - // 自定义选择项参考: https://ant.design/components/table-cn/#components-table-demo-row-selection-custom
2329   - // 注释该行则默认不显示下拉选项
2330   - // selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT],
2331   - // defaultSelectedRowKeys: [],
2332   - }}
2333   - rowKey="id"
2334   - headerTitle={false}
2335   - search={false}
2336   - options={false}
2337   - dataSource={subOrders}
2338   - pagination={false}
2339   - tableAlertRender={false}
2340   - />
2341   - );
2342   - };
2343   -
2344   - // 主订单内容渲染
2345   - const MainOrderColumnRender = ({ record }: { record: OrderListItemType }) => {
2346   - return (
2347   - <Flex vertical={true}>
2348   - {/* 编号、时间、销售信息 */}
2349   - <Flex
2350   - className="px-4 py-4 bg-white rounded-t-lg"
2351   - justify="space-between"
2352   - >
2353   - <Flex wrap="wrap" gap="middle" vertical>
2354   - <Flex>
2355   - <Flex>
2356   - <Checkbox
2357   - onChange={() => onCheckboxChange(record)}
2358   - checked={selectedMainOrderKeys.includes(record.id)}
2359   - >
2360   - <Space split={<Divider type="vertical" />}>
2361   - <div>
2362   - <span className="text-[#8C8C8C]">订单号:</span>
2363   - <span className="text-slate-700">{record.id}</span>
2364   - {record.modified ? (
2365   - <Tooltip title="点击查看详情">
2366   - <span
2367   - className="text-[#f44e4e] cursor-pointer"
2368   - onClick={async () => {
2369   - createOptObject(null, record.id);
2370   - setModifiedDiffModalVisible(true);
2371   - }}
2372   - >
2373   - (修改过)
2374   - </span>
2375   - </Tooltip>
2376   - ) : (
2377   - ''
2378   - )}
2379   - </div>
2380   - </Space>
2381   - </Checkbox>
2382   - <Tooltip title="点击复制订单号">
2383   - <CopyOutlined
2384   - className="hover:cursor-pointer"
2385   - style={{ color: '#8C8C8C' }}
2386   - onClick={() => {
2387   - copyToClipboard(record.id);
2388   - message.info('订单号复制成功!');
2389   - }}
2390   - />
2391   - </Tooltip>
2392   - <Divider type="vertical" />
2393   - <span>{formatDateTime(record.createTime)}</span>
2394   - <Divider type="vertical" />
2395   - <Space split={<Divider type="vertical" />}>
2396   - <div
2397   - className="hover:cursor-pointer"
2398   - onClick={() => {
2399   - copyToClipboard(record.salesCode);
2400   - message.info('代表复制成功:' + record.salesCode);
2401   - }}
2402   - >
2403   - <span className="text-[#8C8C8C]">代表:</span>
2404   - <span className="text-slate-700">{record.salesCode}</span>
2405   - </div>
2406   - {!isSupplier() ? (
2407   - <>
2408   - <div
2409   - title={record.institution}
2410   - className="whitespace-no-wrap overflow-hidden overflow-ellipsis max-w-[150px]"
2411   - >
2412   - <span className="text-[#8C8C8C]">单位:</span>
2413   - <span className="text-slate-700">
2414   - {record.institution}
2415   - </span>
2416   - </div>
2417   - <span>
2418   - <span className="text-[#8C8C8C]">联系人:</span>
2419   - <span className="text-slate-700">
2420   - {record.institutionContactName + ' '}
2421   - </span>
2422   - </span>
2423   - </>
2424   - ) : (
2425   - ''
2426   - )}
2427   - <div
2428   - title={record.institution}
2429   - className="whitespace-no-wrap overflow-hidden overflow-ellipsis max-w-[150px]"
2430   - >
2431   - <span
2432   - className="hover:cursor-pointer"
2433   - onClick={() => {
2434   - copyToClipboard(record.customerName);
2435   - message.info('收货人复制成功:' + record.customerName);
2436   - }}
2437   - >
2438   - <span className="text-[#8C8C8C]">收货人:</span>
2439   - {!isSupplier() && (
2440   - <Tooltip className="order-tooltip" title="详情">
2441   - <ContainerTwoTone
2442   - className="px-1 hover:curcor-pointer"
2443   - onClick={() => {
2444   - createOptObject(null, record.id);
2445   - setDeliverInfoDrawerVisible(true);
2446   - }}
2447   - />
2448   - </Tooltip>
2449   - )}
2450   - <span className="text-slate-700">
2451   - {record.customerName + ' '}
2452   - </span>
2453   - </span>
2454   - </div>
2455   -
2456   - {isSupplier() ? (
2457   - <div
2458   - title={record.customerShippingAddress}
2459   - className="whitespace-no-wrap overflow-hidden overflow-ellipsis max-w-[400px] hover:cursor-pointer"
2460   - onClick={() => {
2461   - copyToClipboard(record.customerShippingAddress);
2462   - message.info(
2463   - '收货地址复制成功:' + record.customerShippingAddress,
2464   - );
2465   - }}
2466   - >
2467   - <span className="text-[#8C8C8C]">收货地址:</span>
2468   - <span className="text-slate-700">
2469   - {record.customerShippingAddress}
2470   - </span>
2471   - </div>
2472   - ) : (
2473   - ''
2474   - )}
2475   - </Space>
2476   - </Flex>
2477   - </Flex>
2478   -
2479   - {isSupplier() ? (
2480   - <Flex className="pl-6" align="center">
2481   - <Flex
2482   - className="hover:cursor-pointer"
2483   - onClick={() => {
2484   - copyToClipboard(record.customerContactNumber);
2485   - message.info(
2486   - '联系电话复制成功:' + record.customerContactNumber,
2487   - );
2488   - }}
2489   - >
2490   - <span className="text-[#8C8C8C]">联系电话:</span>
2491   - <span className="text-slate-700">
2492   - {record.customerContactNumber + ' '}
2493   - </span>
2494   - </Flex>
2495   - </Flex>
2496   - ) : (
2497   - ''
2498   - )}
2499   -
2500   - <Flex className="pl-6" align="center">
2501   - {roleCode === 'finance' ? (
2502   - <div
2503   - title={enumValueToLabel(
2504   - record.receivingCompany,
2505   - getReceivingCompanyOptions(PAYEE_OPTIONS),
2506   - )}
2507   - className="whitespace-no-wrap overflow-hidden overflow-ellipsis max-w-[400px]"
2508   - >
2509   - <span className="text-[#8C8C8C]">开票收款单位:</span>
2510   - <span className="text-slate-700">
2511   - {record.receivingCompany !== null
2512   - ? enumValueToLabel(
2513   - record.receivingCompany,
2514   - getReceivingCompanyOptions(PAYEE_OPTIONS),
2515   - )
2516   - : '暂无'}
2517   - </span>
2518   - </div>
2519   - ) : (
2520   - ''
2521   - )}
2522   -
2523   - {roleCode === 'finance' ? <Divider type="vertical" /> : ''}
2524   -
2525   - <div title={record.notes}>
2526   - <div
2527   - className="max-w-[850px] whitespace-normal overflow-hidden overflow-ellipsis hover:cursor-pointer"
2528   - onClick={() => {
2529   - copyToClipboard(record.notes);
2530   - message.info('备注复制成功:' + record.notes);
2531   - }}
2532   - >
2533   - <span className="text-[#8C8C8C]">备注:</span>
2534   - <span className="ml-2">
2535   - {record.notes === null ? '暂无备注' : record.notes}
2536   - </span>
2537   - </div>
2538   - </div>
2539   -
2540   - {!isSupplier() ? (
2541   - <Tooltip title="编辑">
2542   - <EditTwoTone
2543   - className="pl-1 hover:curcor-pointer"
2544   - onClick={() => {
2545   - setNotesEditVisible(true);
2546   - setSelectedRows([record.id]);
2547   - setNotes(record.notes);
2548   - setNotesType(0);
2549   - }}
2550   - />
2551   - </Tooltip>
2552   - ) : (
2553   - ''
2554   - )}
2555   -
2556   - {record.goodsWeight !== null ? (
2557   - <div title={record.goodsWeight + 'kg'} className="pl-3">
2558   - <div
2559   - className="max-w-md overflow-hidden whitespace-no-wrap overflow-ellipsis hover:cursor-pointer"
2560   - onClick={() => {
2561   - copyToClipboard(record.goodsWeight + 'kg');
2562   - message.info(
2563   - '包裹重量复制成功:' + record.goodsWeight + 'kg',
2564   - );
2565   - }}
2566   - >
2567   - <span className="text-[#8C8C8C]">包裹重量:</span>
2568   - <span className="ml-2">{record.goodsWeight + 'kg'}</span>
2569   - </div>
2570   - </div>
2571   - ) : (
2572   - ''
2573   - )}
2574   -
2575   - {record.goodsVolume !== null ? (
2576   - <div title={record.goodsVolume + 'm³'} className="pl-3">
2577   - <div
2578   - className="max-w-md overflow-hidden whitespace-no-wrap overflow-ellipsis hover:cursor-pointer"
2579   - onClick={() => {
2580   - copyToClipboard(record.goodsVolume + 'm³');
2581   - message.info(
2582   - '包裹体积复制成功:' + record.goodsVolume + 'm³',
2583   - );
2584   - }}
2585   - >
2586   - <span className="text-[#8C8C8C]">包裹体积:</span>
2587   - <span className="ml-2">{record.goodsVolume + 'm³'}</span>
2588   - </div>
2589   - </div>
2590   - ) : (
2591   - ''
2592   - )}
2593   - </Flex>
2594   - </Flex>
2595   - <Flex wrap="wrap" gap="middle" vertical>
2596   - <Flex justify="flex-end">
2597   - <Flex wrap="wrap" gap="middle" align="center">
2598   - {!isSupplier() ? (
2599   - <div>
2600   - <span className="text-[#8C8C8C]">总金额:¥</span>
2601   - <span className="text-lg font-medium">
2602   - {record.totalPayment}
2603   - </span>
2604   - </div>
2605   - ) : (
2606   - ''
2607   - )}
2608   -
2609   - {rolePath?.includes('addOrder') ? (
2610   - <Tooltip title="复制">
2611   - <CopyTwoTone
2612   - className="hover:cursor-pointer"
2613   - onClick={() => {
2614   - createOptObject(null, record.id);
2615   - copyOrderToClipboard(record);
2616   - setOrderOptType('copy');
2617   - setOrderDrawerVisible(true);
2618   - }}
2619   - />
2620   - </Tooltip>
2621   - ) : (
2622   - <Tooltip title="复制文本">
2623   - <CopyTwoTone
2624   - className="hover:cursor-pointer"
2625   - onClick={() => {
2626   - copyOrderToClipboard(record);
2627   - }}
2628   - />
2629   - </Tooltip>
2630   - )}
2631   - {!isSupplier() ? (
2632   - <Tooltip title="历史">
2633   - <ClockCircleTwoTone
2634   - className="hover:cursor-pointer"
2635   - onClick={() => {
2636   - setHistoryModalVisible(true);
2637   - if (subOrderSelectedMap.get(record.id)?.length) {
2638   - setSelectedRows(subOrderSelectedMap.get(record.id));
2639   - } else {
2640   - setSelectedRows(record.subOrderInformationLists);
2641   - }
2642   - }}
2643   - />
2644   - </Tooltip>
2645   - ) : (
2646   - ''
2647   - )}
2648   - </Flex>
2649   - </Flex>
2650   - <Flex justify="flex-end">
2651   - <Space.Compact direction="vertical" align="end">
2652   - <Space wrap>
2653   - {record.paths?.includes('postAudit') ? (
2654   - <Button
2655   - className="p-0"
2656   - type="link"
2657   - onClick={() => {
2658   - setCurrentMainId(record.id);
2659   - setCurretnOptSubId(null);
2660   - setCheckVisible(true);
2661   - setOrderCheckType(CHECK_TYPE.WAITING_FOR_POST_AUDIT);
2662   - }}
2663   - >
2664   - 后置审核
2665   - </Button>
2666   - ) : (
2667   - ''
2668   - )}
2669   - {record.paths?.includes('URGENT_INVOICE_AUDITING') ? (
2670   - <Button
2671   - className="p-0"
2672   - type="link"
2673   - onClick={() => {
2674   - createOptObject(null, record.id);
2675   - setCheckVisible(true);
2676   - setOrderCheckType(CHECK_TYPE.URGENT_INVOICE_AUDITING);
2677   - }}
2678   - >
2679   - 加急审核(新)
2680   - </Button>
2681   - ) : (
2682   - ''
2683   - )}
2684   - {record.paths?.includes('URGENT_INVOICE_AUDITING_old') ? (
2685   - <Button
2686   - className="p-0"
2687   - type="link"
2688   - onClick={() => {
2689   - createOptObject(null, record.id);
2690   - setCheckVisible(true);
2691   - setOrderCheckType(
2692   - CHECK_TYPE.URGENT_INVOICE_AUDITING_OLD,
2693   - );
2694   - }}
2695   - >
2696   - 加急审核(旧)
2697   - </Button>
2698   - ) : (
2699   - ''
2700   - )}
2701   - {record.paths?.includes('salesConfirm') && (
2702   - <ButtonConfirm
2703   - className="p-0"
2704   - title="是否确认此商城订单信息无误?确认无误之后订单将进入审核流程。"
2705   - text="订单确认"
2706   - onConfirm={async () => {
2707   - let subIds = subOrderSelectedMap
2708   - .get(record.id)
2709   - ?.map((item) => {
2710   - return item.id;
2711   - });
2712   - if (subIds === null || subIds === undefined) {
2713   - subIds = record.subOrderInformationLists.map(
2714   - (item) => {
2715   - return item.id;
2716   - },
2717   - );
2718   - }
2719   - let res = await postServiceOrderSalesConfirm({
2720   - data: {
2721   - subOrderIds: subIds,
2722   - },
2723   - });
2724   -
2725   - if (res && res.result === RESPONSE_CODE.SUCCESS) {
2726   - message.success(res.message);
2727   - refreshTable();
2728   - }
2729   - }}
2730   - />
2731   - )}
2732   - {record.paths?.includes('uploadPaymentReceiptBill') ? (
2733   - <Button
2734   - className="p-0"
2735   - type="link"
2736   - onClick={() => {
2737   - createOptObject(null, record.id);
2738   - setUploadPayBillModalVisible(true);
2739   - }}
2740   - >
2741   - 回款
2742   - </Button>
2743   - ) : (
2744   - ''
2745   - )}
2746   -
2747   - {record.paths?.includes('modifiedAuditRequest') ? (
2748   - <Button
2749   - className="p-0"
2750   - type="link"
2751   - onClick={() => {
2752   - createOptObject(null, record.id);
2753   - setCheckVisible(true);
2754   - setOrderCheckType(CHECK_TYPE.NODE_OPERATING_AUDIT);
2755   - }}
2756   - >
2757   - 节点修改审核
2758   - </Button>
2759   - ) : (
2760   - ''
2761   - )}
2762   -
2763   - {record.paths?.includes('auditPaymentReceipt') ? (
2764   - <Button
2765   - className="p-0"
2766   - type="link"
2767   - onClick={() => {
2768   - createOptObject(null, record.id);
2769   - setCheckVisible(true);
2770   - setOrderCheckType(CHECK_TYPE.PAYMENT_RECEIPTS_AUDIT);
2771   - }}
2772   - >
2773   - 回款审核
2774   - </Button>
2775   - ) : (
2776   - ''
2777   - )}
2778   -
2779   - {record.paths?.includes('modifiedLeaderAuditRequest') ? (
2780   - <Button
2781   - className="p-0"
2782   - type="link"
2783   - onClick={() => {
2784   - createOptObject(null, record.id);
2785   - setCheckVisible(true);
2786   - setOrderCheckType(CHECK_TYPE.MODIFY_LEADER_AUDIT);
2787   - }}
2788   - >
2789   - 领导修改审核
2790   - </Button>
2791   - ) : (
2792   - ''
2793   - )}
2794   -
2795   - {false ? (
2796   - <Button
2797   - className="p-0"
2798   - type="link"
2799   - onClick={() => {
2800   - createOptObject(null, record.id);
2801   - setFinancialReceiptsModalVisible(true);
2802   - setIsEdit(true);
2803   - }}
2804   - >
2805   - 收款记录
2806   - </Button>
2807   - ) : (
2808   - ''
2809   - )}
2810   -
2811   - {record.paths?.includes('reissue_old') ? (
2812   - /*optRecord.afterInvoicingStatus==='PARTIAL_INVOICING'||
2813   - optRecord.afterInvoicingStatus==='COMPLETE_INVOICING'*/
2814   - <Button
2815   - className="p-0"
2816   - type="link"
2817   - onClick={() => {
2818   - setCurrentMainId(record.id);
2819   - setReissueVisibleOld(true);
2820   - console.log(reissueVisible);
2821   - }}
2822   - >
2823   - 重新开票(旧)
2824   - </Button>
2825   - ) : (
2826   - ''
2827   - )}
2828   -
2829   - {record.paths?.includes('confirmReissue_old') ? (
2830   - <Button
2831   - className="p-0"
2832   - type="link"
2833   - onClick={() => {
2834   - setCurrentMainId(record.id);
2835   - setCurretnOptSubId(null);
2836   - setCheckVisible(true);
2837   - setOrderCheckType(CHECK_TYPE.CONFIRM_REISSUE_OLD);
2838   - }}
2839   - >
2840   - 重新开票审核(旧)
2841   - </Button>
2842   - ) : (
2843   - ''
2844   - )}
2845   -
2846   - {record.paths?.includes('reissue') ? (
2847   - /*optRecord.afterInvoicingStatus==='PARTIAL_INVOICING'||
2848   - optRecord.afterInvoicingStatus==='COMPLETE_INVOICING'*/
2849   - <Button
2850   - className="p-0"
2851   - type="link"
2852   - onClick={() => {
2853   - setCurrentMainId(record.id);
2854   - setReissueVisible(true);
2855   - }}
2856   - >
2857   - 重新开票(新)
2858   - </Button>
2859   - ) : (
2860   - ''
2861   - )}
2862   -
2863   - {record.paths?.includes('confirmReissue') ? (
2864   - <Button
2865   - className="p-0"
2866   - type="link"
2867   - onClick={() => {
2868   - setCurrentMainId(record.id);
2869   - setCurretnOptSubId(null);
2870   - setCheckVisible(true);
2871   - setOrderCheckType(CHECK_TYPE.CONFIRM_REISSUE);
2872   - }}
2873   - >
2874   - 重新开票审核(新)
2875   - </Button>
2876   - ) : (
2877   - ''
2878   - )}
2879   -
2880   - {record.paths?.includes('procureOrder') ? (
2881   - <ButtonConfirm
2882   - className="p-0"
2883   - title="是否下单?"
2884   - text="下单"
2885   - onConfirm={async () => {
2886   - let subIds = subOrderSelectedMap
2887   - .get(record.id)
2888   - ?.map((item) => {
2889   - return item.id;
2890   - });
2891   - if (subIds === null || subIds === undefined) {
2892   - subIds = record.subOrderInformationLists.map(
2893   - (item) => {
2894   - return item.id;
2895   - },
2896   - );
2897   - }
2898   - let res = await postServiceOrderProcureOrder({
2899   - data: { subIds: subIds },
2900   - });
2901   - if (res.result === RESPONSE_CODE.SUCCESS) {
2902   - message.success(res.message);
2903   - refreshTable();
2904   - return true;
2905   - }
2906   - }}
2907   - />
2908   - ) : (
2909   - ''
2910   - )}
2911   -
2912   - {record.paths?.includes('cancelSend') ? (
2913   - <ButtonConfirm
2914   - className="p-0"
2915   - title="是否取消发货?"
2916   - text="取消发货"
2917   - onConfirm={async () => {
2918   - let subIds = subOrderSelectedMap
2919   - .get(record.id)
2920   - ?.map((item) => {
2921   - return item.id;
2922   - });
2923   - if (subIds === null || subIds === undefined) {
2924   - subIds = record.subOrderInformationLists.map(
2925   - (item) => {
2926   - return item.id;
2927   - },
2928   - );
2929   - }
2930   - let res = await postServiceOrderCancelSend({
2931   - data: { subIds: subIds },
2932   - });
2933   - if (res.result === RESPONSE_CODE.SUCCESS) {
2934   - message.success(res.message);
2935   - refreshTable();
2936   - return true;
2937   - }
2938   - }}
2939   - />
2940   - ) : (
2941   - ''
2942   - )}
2943   -
2944   - {record.paths?.includes('applyModify') ? (
2945   - <Button
2946   - className="p-0"
2947   - type="link"
2948   - onClick={() => {
2949   - createOptObject(null, record.id);
2950   - setOrderDrawerVisible(true);
2951   - setOrderOptType('order-change-normal');
2952   - }}
2953   - >
2954   - 申请修改
2955   - </Button>
2956   - ) : (
2957   - ''
2958   - )}
2959   -
2960   - {record.paths?.includes('leaderAudit') ? (
2961   - <Button
2962   - className="p-0"
2963   - type="link"
2964   - onClick={() => {
2965   - let selectedSubOrders = subOrderSelectedMap.get(
2966   - record.id,
2967   - );
2968   - setSelectedRows(selectedSubOrders);
2969   - if (selectedSubOrders === undefined) {
2970   - selectedSubOrders = record.subOrderInformationLists;
2971   - }
2972   - for (let i = 0; i < selectedSubOrders.length; i++) {
2973   - if (
2974   - selectedSubOrders[i].orderStatus !==
2975   - 'LEADER_PROCESS'
2976   - ) {
2977   - message.error('请选择领导待审核的子订单进行审核');
2978   - return;
2979   - }
2980   - }
2981   - createOptObject(null, record.id);
2982   - setCheckVisible(true);
2983   - setOrderCheckType(CHECK_TYPE.LEADER_AUDIT);
2984   - }}
2985   - >
2986   - 审核
2987   - </Button>
2988   - ) : (
2989   - ''
2990   - )}
2991   -
2992   - {record.paths?.includes('changeOrderAudit') ? (
2993   - <Button
2994   - className="p-0"
2995   - type="link"
2996   - onClick={() => {
2997   - let selectedSubOrders = subOrderSelectedMap.get(
2998   - record.id,
2999   - );
3000   - setSelectedRows(selectedSubOrders);
3001   - if (selectedSubOrders === undefined) {
3002   - selectedSubOrders = record.subOrderInformationLists;
3003   - }
3004   - for (let i = 0; i < selectedSubOrders.length; i++) {
3005   - if (
3006   - selectedSubOrders[i].orderStatus !==
3007   - 'MODIFY_APPLY_WAIT_FOR_AUDIT'
3008   - ) {
3009   - message.error('请选择[修改待审核]的子订单进行审核');
3010   - return;
3011   - }
3012   - }
3013   - createOptObject(null, record.id);
3014   - setCheckVisible(true);
3015   - setOrderCheckType(
3016   - CHECK_TYPE.MODIFY_APPLY_WAIT_FOR_AUDIT,
3017   - );
3018   - }}
3019   - >
3020   - 审核
3021   - </Button>
3022   - ) : (
3023   - ''
3024   - )}
3025   -
3026   - {record.paths?.includes('creditAudit') ? (
3027   - <Button
3028   - className="p-0"
3029   - type="link"
3030   - onClick={() => {
3031   - let selectedSubOrders = subOrderSelectedMap.get(
3032   - record.id,
3033   - );
3034   - setSelectedRows(selectedSubOrders);
3035   - if (selectedSubOrders === undefined) {
3036   - selectedSubOrders = record.subOrderInformationLists;
3037   - }
3038   - for (let i = 0; i < selectedSubOrders.length; i++) {
3039   - if (
3040   - selectedSubOrders[i].orderStatus !==
3041   - 'CREDIT_CONFIRM'
3042   - ) {
3043   - message.error('请选择[赊账待审核]的子订单进行审核');
3044   - return;
3045   - }
3046   - }
3047   - createOptObject(null, record.id);
3048   - setCheckVisible(true);
3049   - setOrderCheckType(CHECK_TYPE.CREDIT_AUDIT);
3050   - }}
3051   - >
3052   - 赊账审核
3053   - </Button>
3054   - ) : (
3055   - ''
3056   - )}
3057   -
3058   - {record.paths?.includes('editProductionTime') ? (
3059   - <Button
3060   - className="p-0"
3061   - type="link"
3062   - onClick={() => {
3063   - createOptObject(null, record.id);
3064   - setProductionTimeModalVisible(true);
3065   - }}
3066   - >
3067   - 生产时间
3068   - </Button>
3069   - ) : (
3070   - ''
3071   - )}
3072   -
3073   - {record.paths?.includes('procureConvertProcure') ? (
3074   - <Button
3075   - className="p-0"
3076   - type="link"
3077   - onClick={() => {
3078   - let selectedSubOrders = subOrderSelectedMap.get(
3079   - record.id,
3080   - );
3081   - if (selectedSubOrders === undefined) {
3082   - selectedSubOrders = record.subOrderInformationLists;
3083   - }
3084   -
3085   - for (let i = 0; i < selectedSubOrders.length; i++) {
3086   - if (
3087   - !selectedSubOrders[i].paths.includes(
3088   - 'procureConvertProcure',
3089   - )
3090   - ) {
3091   - message.error('请选择允许转发的子订单进行转发');
3092   - return;
3093   - }
3094   - }
3095   - createOptObject(null, record.id);
3096   - setOrderCheckType(CHECK_TYPE.PROCURE);
3097   - setProcureConvertModalVisible(true);
3098   - }}
3099   - >
3100   - 转发
3101   - </Button>
3102   - ) : (
3103   - ''
3104   - )}
3105   - {record.paths?.includes('sendProduct') ? (
3106   - <Button
3107   - className="p-0"
3108   - type="link"
3109   - onClick={() => {
3110   - if (!subOrderSelectedMap.get(record.id)?.length) {
3111   - return message.error('请选择选择子订单');
3112   - }
3113   - createOptObject(null, record.id);
3114   - setDeliverVisible(true);
3115   - setIsSendProduct(true);
3116   - setOrderCheckType(CHECK_TYPE.WEARHOUSE_KEEPER);
3117   - }}
3118   - >
3119   - 仓库发货
3120   - </Button>
3121   - ) : (
3122   - ''
3123   - )}
3124   -
3125   - {/* 供应商发货 */}
3126   - {record.paths?.includes('supplierSendOrder') ? (
3127   - <Button
3128   - className="p-0"
3129   - type="link"
3130   - onClick={() => {
3131   - if (!subOrderSelectedMap.get(record.id)?.length) {
3132   - return message.error('请选择选择子订单');
3133   - }
3134   - createOptObject(null, record.id);
3135   - setDeliverVisible(true);
3136   - setIsSendProduct(true);
3137   - setOrderCheckType(CHECK_TYPE.SUPPLIER);
3138   - }}
3139   - >
3140   - 供应商发货
3141   - </Button>
3142   - ) : (
3143   - ''
3144   - )}
3145   -
3146   - {record.paths?.includes('procureSend') ? (
3147   - <Button
3148   - className="p-0"
3149   - type="link"
3150   - onClick={() => {
3151   - if (!subOrderSelectedMap.get(record.id)?.length) {
3152   - return message.error('请选择选择子订单');
3153   - }
3154   - createOptObject(null, record.id);
3155   - setDeliverVisible(true);
3156   - setIsSendProduct(true);
3157   - setOrderCheckType(CHECK_TYPE.PROCURE);
3158   - }}
3159   - >
3160   - {isSupplier() ? '发货' : '采购发货'}
3161   - </Button>
3162   - ) : (
3163   - ''
3164   - )}
3165   -
3166   - {record.paths?.includes('printOrder') ? (
3167   - <Button
3168   - className="p-0"
3169   - type="link"
3170   - onClick={() => {
3171   - const selectedSubOrders = subOrderSelectedMap.get(
3172   - record.id,
3173   - );
3174   - if (!selectedSubOrders?.length) {
3175   - return message.error('请选择选择子订单');
3176   - }
3177   -
3178   - for (let subOrderRecord of selectedSubOrders) {
3179   - let paths = subOrderRecord.paths;
3180   - if (!checkePrintable(paths)) {
3181   - return message.error('请选择可以打印的子订单');
3182   - }
3183   - }
3184   - createOptObject(null, record.id);
3185   - setOrderPrintVisible(true);
3186   - setOrderCheckType(CHECK_TYPE.WEARHOUSE_KEEPER);
3187   - }}
3188   - >
3189   - 仓库打印
3190   - </Button>
3191   - ) : (
3192   - ''
3193   - )}
3194   -
3195   - {record.paths?.includes('supplierPrint') ? (
3196   - <Button
3197   - className="p-0"
3198   - type="link"
3199   - onClick={() => {
3200   - if (!subOrderSelectedMap.get(record.id)?.length) {
3201   - return message.error('请选择选择子订单');
3202   - }
3203   -
3204   - createOptObject(null, record.id);
3205   - setOrderPrintVisible(true);
3206   - setOrderCheckType(CHECK_TYPE.SUPPLIER);
3207   - }}
3208   - >
3209   - 供应商打印
3210   - </Button>
3211   - ) : (
3212   - ''
3213   - )}
3214   -
3215   - {record.paths?.includes('rePrintOrder') ? (
3216   - <Button
3217   - className="p-0"
3218   - type="link"
3219   - onClick={() => {
3220   - if (!subOrderSelectedMap.get(record.id)?.length) {
3221   - return message.error('请选择选择子订单');
3222   - }
3223   - createOptObject(null, record.id);
3224   - setOrderPrintVisible(true);
3225   - setIsRePrintOrder(true);
3226   - }}
3227   - >
3228   - 重新打印
3229   - </Button>
3230   - ) : (
3231   - ''
3232   - )}
3233   - {record.paths?.includes('confirmReceipt') ? (
3234   - <Button
3235   - className="p-0"
3236   - type="link"
3237   - onClick={() => {
3238   - createOptObject(null, record.id);
3239   - setConfirmReceiptVisible(true);
3240   - }}
3241   - >
3242   - 确认收货
3243   - </Button>
3244   - ) : (
3245   - ''
3246   - )}
3247   - {record.paths?.includes('modifySendInformation') ? (
3248   - <Button
3249   - className="p-0"
3250   - type="link"
3251   - onClick={() => {
3252   - if (!subOrderSelectedMap.get(record.id)?.length) {
3253   - return message.error(
3254   - '请选择已经发货或者已经确认收货的子订单',
3255   - );
3256   - }
3257   - for (let row of subOrderSelectedMap.get(record.id)) {
3258   - if (
3259   - row.orderStatus !== 'CONFIRM_RECEIPT' &&
3260   - row.orderStatus !== 'SHIPPED'
3261   - ) {
3262   - return message.error(
3263   - '请选择已经发货或者已经确认收货的子订单',
3264   - );
3265   - }
3266   - }
3267   - createOptObject(null, record.id);
3268   - setDeliverVisible(true);
3269   - setIsSendProduct(false);
3270   - }}
3271   - >
3272   - 修改发货信息
3273   - </Button>
3274   - ) : (
3275   - ''
3276   - )}
3277   - {record.paths?.includes('invoicing') ? (
3278   - <Button
3279   - type="link"
3280   - className="p-0"
3281   - onClick={() => {
3282   - createOptObject(null, record.id);
3283   - setFinancialVisible(true);
3284   - setIsEdit(false);
3285   - }}
3286   - >
3287   - 开票
3288   - </Button>
3289   - ) : (
3290   - ''
3291   - )}
3292   -
3293   - {record.paths?.includes('applyInvoicing_old') ? (
3294   - <Button
3295   - type="link"
3296   - className="p-0"
3297   - onClick={() => {
3298   - let selectedSubOrders = subOrderSelectedMap.get(
3299   - record.id,
3300   - );
3301   - if (selectedSubOrders === undefined) {
3302   - selectedSubOrders = record.subOrderInformationLists;
3303   - }
3304   - for (let i = 0; i < selectedSubOrders.length; i++) {
3305   - if (
3306   - selectedSubOrders[i].invoicingStatus ===
3307   - 'UN_INVOICE' ||
3308   - selectedSubOrders[i].afterInvoicingStatus ===
3309   - 'APPLY_FOR_INVOICING'
3310   - ) {
3311   - message.error(
3312   - '请选择需要开票且未申请开票的子订单进行申请',
3313   - );
3314   - return;
3315   - }
3316   - }
3317   -
3318   - createOptObject(null, record.id);
3319   - setApplyForInvoicingVisible(true);
3320   - setIsEdit(false);
3321   - setIsMainOrder(false);
3322   - }}
3323   - >
3324   - 申请开票(旧)
3325   - </Button>
3326   - ) : (
3327   - ''
3328   - )}
3329   -
3330   - {record.paths?.includes('applyInvoicing') ? (
3331   - <Button
3332   - type="link"
3333   - className="p-0"
3334   - onClick={() => {
3335   - let selectedSubOrders = subOrderSelectedMap.get(
3336   - record.id,
3337   - );
3338   - if (selectedSubOrders === undefined) {
3339   - selectedSubOrders = record.subOrderInformationLists;
3340   - }
3341   - for (let i = 0; i < selectedSubOrders.length; i++) {
3342   - if (
3343   - selectedSubOrders[i].invoicingStatus ===
3344   - 'UN_INVOICE' ||
3345   - selectedSubOrders[i].afterInvoicingStatus ===
3346   - 'APPLY_FOR_INVOICING'
3347   - ) {
3348   - message.error(
3349   - '请选择需要开票且未申请开票的子订单进行申请',
3350   - );
3351   - return;
3352   - }
3353   - }
3354   -
3355   - createOptObject(null, record.id);
3356   - setInvoicingDrawerFormVisible(true);
3357   - setIsEdit(false);
3358   - setIsMainOrder(false);
3359   - }}
3360   - >
3361   - 申请开票(新)
3362   - </Button>
3363   - ) : (
3364   - ''
3365   - )}
3366   -
3367   - {record.paths?.includes('applyInvoicing') ? (
3368   - <Button
3369   - type="link"
3370   - className="p-0"
3371   - onClick={() => {
3372   - console.log('5656confirm');
3373   - }}
3374   - >
3375   - 确认开票
3376   - </Button>
3377   - ) : (
3378   - ''
3379   - )}
3380   -
3381   - {record.paths?.includes('updateOrder') ? (
3382   - <Button
3383   - className="p-0"
3384   - type="link"
3385   - onClick={() => {
3386   - //勾选的子订单:如果有勾选,后面只校验有勾选的
3387   -
3388   - let selectedSubOrders = subOrderSelectedMap.get(
3389   - record.id,
3390   - );
3391   - if (
3392   - selectedSubOrders === undefined ||
3393   - selectedSubOrders.length === 0
3394   - ) {
3395   - selectedSubOrders = record.subOrderInformationLists;
3396   - }
3397   - for (
3398   - let index = 0;
3399   - index < selectedSubOrders.length;
3400   - index++
3401   - ) {
3402   - let orderStatus =
3403   - selectedSubOrders[index].orderStatus;
3404   - //仓库管理员在审核之后的任何时候都可以编辑
3405   - if (
3406   - roleCode !== 'warehouseKeeper' &&
3407   - roleCode !== 'admin'
3408   - ) {
3409   - //是审核通过及之后的订单
3410   - if (
3411   - orderStatus !== 'UNAUDITED' &&
3412   - orderStatus !== 'AUDIT_FAILED' &&
3413   - orderStatus !== 'LEADER_PROCESS' &&
3414   - orderStatus !== 'SALES_CONFIRM' &&
3415   - orderStatus !== 'CREDIT_CONFIRM'
3416   - ) {
3417   - message.error(
3418   - '请选择【未审核、审核失败、销售待确认、赊账待审核】的订单进行编辑',
3419   - );
3420   - return;
3421   - }
3422   - } else {
3423   - //仓库管理员只能编辑是还未审核的订单
3424   - if (
3425   - roleCode !== 'admin' &&
3426   - (orderStatus === 'UNAUDITED' ||
3427   - orderStatus === 'AUDIT_FAILED')
3428   - ) {
3429   - message.error('请选择已审核的订单进行编辑');
3430   - return;
3431   - }
3432   - }
3433   - }
3434   -
3435   - createOptObject(null, record.id);
3436   - setOrderDrawerVisible(true);
3437   - setOrderOptType('edit');
3438   - }}
3439   - >
3440   - 编辑
3441   - </Button>
3442   - ) : (
3443   - ''
3444   - )}
3445   -
3446   - {record?.subOrderInformationLists[0].paths?.includes(
3447   - 'noNeedInvoicingEdit',
3448   - ) ? (
3449   - <Button
3450   - className="p-0"
3451   - type="link"
3452   - onClick={() => {
3453   - createOptObject(null, record.id);
3454   - setFinancialEditVisible(true);
3455   - setIsMainOrder(true);
3456   - }}
3457   - >
3458   - 财务编辑
3459   - </Button>
3460   - ) : (
3461   - ''
3462   - )}
3463   -
3464   - {record.paths?.includes('checkOrder') ? (
3465   - <Button
3466   - className="p-0"
3467   - type="link"
3468   - onClick={() => {
3469   - let selectedSubOrders = subOrderSelectedMap.get(
3470   - record.id,
3471   - );
3472   - setSelectedRows(selectedSubOrders);
3473   - if (selectedSubOrders === undefined) {
3474   - selectedSubOrders = record.subOrderInformationLists;
3475   - }
3476   - for (let i = 0; i < selectedSubOrders.length; i++) {
3477   - let orderStatus = selectedSubOrders[i].orderStatus;
3478   - if (
3479   - orderStatus !== 'UNAUDITED' &&
3480   - orderStatus !== 'FINANCE_PROCESS' &&
3481   - orderStatus !== 'LEADER_AUDITED'
3482   - ) {
3483   - message.error(
3484   - '请选择未审核或者领导已审核的子订单进行审核',
3485   - );
3486   - return;
3487   - }
3488   - }
3489   -
3490   - createOptObject(null, record.id);
3491   - setCheckVisible(true);
3492   - setOrderCheckType(CHECK_TYPE.WEARHOUSE_KEEPER);
3493   - }}
3494   - >
3495   - 审核
3496   - </Button>
3497   - ) : (
3498   - ''
3499   - )}
3500   -
3501   - {record.paths?.includes('afterSalesCheck') ? (
3502   - <Button
3503   - className="p-0"
3504   - type="link"
3505   - onClick={() => {
3506   - let selectedSubOrders = subOrderSelectedMap.get(
3507   - record.id,
3508   - );
3509   - setSelectedRows(selectedSubOrders);
3510   - if (selectedSubOrders === undefined) {
3511   - selectedSubOrders = record.subOrderInformationLists;
3512   - }
3513   - for (let i = 0; i < selectedSubOrders.length; i++) {
3514   - if (
3515   - selectedSubOrders[i].orderStatus !==
3516   - 'IN_AFTER_SALES'
3517   - ) {
3518   - message.error('请选择售后中的子订单进行审核');
3519   - return;
3520   - }
3521   - }
3522   -
3523   - createOptObject(null, record.id);
3524   - setCheckVisible(true);
3525   - setOrderCheckType(CHECK_TYPE.AFTER_SALES);
3526   - }}
3527   - >
3528   - 售后审核
3529   - </Button>
3530   - ) : (
3531   - ''
3532   - )}
3533   -
3534   - {record.paths?.includes('noNeedSend') ? (
3535   - <ButtonConfirm
3536   - className="p-0"
3537   - title="此订单是否无需发货?"
3538   - text="无需发货"
3539   - onConfirm={async () => {
3540   - let selectedSubOrders = subOrderSelectedMap.get(
3541   - record.id,
3542   - );
3543   - if (selectedSubOrders === undefined) {
3544   - selectedSubOrders = record.subOrderInformationLists;
3545   - }
3546   - setSelectedRows(selectedSubOrders);
3547   - for (let i = 0; i < selectedSubOrders.length; i++) {
3548   - if (
3549   - selectedSubOrders[i].orderStatus !== 'AUDITED' &&
3550   - selectedSubOrders[i].orderStatus !==
3551   - 'PROCURE_PROCESS' &&
3552   - selectedSubOrders[i].orderStatus !==
3553   - 'PROCURE_PROCESS_FOR_MINE' &&
3554   - selectedSubOrders[i].orderStatus !==
3555   - 'PROCURE_WAIT_SHIP' &&
3556   - selectedSubOrders[i].orderStatus !==
3557   - 'SUPPLIER_WAIT_SHIP' &&
3558   - selectedSubOrders[i].orderStatus !== 'WAIT_SHIP'
3559   - ) {
3560   - message.error(
3561   - '请选择未发货的子订单进行无需发货操作',
3562   - );
3563   - return;
3564   - }
3565   - }
3566   -
3567   - const data = await postServiceOrderNoNeedSend({
3568   - data: {
3569   - ids: selectedSubOrders.map((item) => {
3570   - return item.id;
3571   - }),
3572   - },
3573   - });
3574   - if (data.result === RESPONSE_CODE.SUCCESS) {
3575   - message.success(data.message);
3576   - refreshTable();
3577   - }
3578   - }}
3579   - />
3580   - ) : (
3581   - ''
3582   - )}
3583   -
3584   - {record.paths?.includes('saleCancelInvoicing_old') ? (
3585   - <ButtonConfirm
3586   - className="p-0"
3587   - title="确认取消申请开票?"
3588   - text="取消申请(旧)"
3589   - onConfirm={async () => {
3590   - let selectedSubOrders = subOrderSelectedMap.get(
3591   - record.id,
3592   - );
3593   - if (selectedSubOrders === undefined) {
3594   - selectedSubOrders = record.subOrderInformationLists;
3595   - }
3596   -
3597   - console.log(selectedSubOrders);
3598   - for (let i = 0; i < selectedSubOrders.length; i++) {
3599   - if (
3600   - selectedSubOrders[i].afterInvoicingStatus !==
3601   - 'APPLY_FOR_INVOICING'
3602   - ) {
3603   - message.error(
3604   - '请选择已[申请开票]的子订单进行取消申请',
3605   - );
3606   - return;
3607   - }
3608   - }
3609   - let res = await postServiceOrderSaleCancelInvoicing({
3610   - data: {
3611   - subOrderIds: selectedSubOrders.map((item) => {
3612   - return item.id;
3613   - }),
3614   - },
3615   - });
3616   -
3617   - if (res && res.result === RESPONSE_CODE.SUCCESS) {
3618   - message.success(res.message);
3619   - refreshTable();
3620   - }
3621   - }}
3622   - />
3623   - ) : (
3624   - ''
3625   - )}
3626   - {/* 财务审核:主订单暂无 */}
3627   - {record.paths?.includes('financeCheckOrder') ? (
3628   - <Button
3629   - className="p-0"
3630   - type="link"
3631   - onClick={() => {
3632   - let selectedSubOrders = subOrderSelectedMap.get(
3633   - record.id,
3634   - );
3635   - setSelectedRows(selectedSubOrders);
3636   - if (selectedSubOrders === undefined) {
3637   - selectedSubOrders = record.subOrderInformationLists;
3638   - }
3639   - for (let i = 0; i < selectedSubOrders.length; i++) {
3640   - if (
3641   - selectedSubOrders[i].orderStatus !== 'UNAUDITED' &&
3642   - selectedSubOrders[i].orderStatus !==
3643   - 'FINANCE_PROCESS' &&
3644   - selectedSubOrders[i].orderStatus !==
3645   - 'LEADER_AUDITED'
3646   - ) {
3647   - message.error(
3648   - '请选择[未审核]、[财务待审核]、[领导已审核]的子订单进行审核',
3649   - );
3650   - return;
3651   - }
3652   - }
3653   - createOptObject(null, record.id);
3654   - setCheckVisible(true);
3655   - setOrderCheckType(CHECK_TYPE.FINALCIAL);
3656   - }}
3657   - >
3658   - 财务审核
3659   - </Button>
3660   - ) : (
3661   - ''
3662   - )}
3663   -
3664   - {/* 采购审核 */}
3665   - {record.paths?.includes('procureCheckOrder') ? (
3666   - <Button
3667   - className="p-0"
3668   - type="link"
3669   - onClick={() => {
3670   - let selectedSubOrders = subOrderSelectedMap.get(
3671   - record.id,
3672   - );
3673   - setSelectedRows(selectedSubOrders);
3674   - if (selectedSubOrders === undefined) {
3675   - selectedSubOrders = record.subOrderInformationLists;
3676   - }
3677   - for (let i = 0; i < selectedSubOrders.length; i++) {
3678   - if (
3679   - selectedSubOrders[i].orderStatus !==
3680   - 'PROCURE_UN_PROCESS'
3681   - ) {
3682   - message.error('请选择未审核的子订单进行审核');
3683   - return;
3684   - }
3685   - }
3686   -
3687   - createOptObject(null, record.id);
3688   - setProcureCheckModalVisible(true);
3689   - setOrderCheckType(CHECK_TYPE.PROCURE);
3690   - }}
3691   - >
3692   - 采购审核
3693   - </Button>
3694   - ) : (
3695   - ''
3696   - )}
3697   -
3698   - {record.paths?.includes('applyAfterSales') ? (
3699   - <Button
3700   - className="p-0"
3701   - type="link"
3702   - onClick={() => {
3703   - let selectedSubOrders = subOrderSelectedMap.get(
3704   - record.id,
3705   - );
3706   - if (selectedSubOrders === undefined) {
3707   - selectedSubOrders = record.subOrderInformationLists;
3708   - }
3709   - setSelectedRows(selectedSubOrders);
3710   - for (let i = 0; i < selectedSubOrders.length; i++) {
3711   - if (
3712   - selectedSubOrders[i].orderStatus !==
3713   - 'CONFIRM_RECEIPT' &&
3714   - selectedSubOrders[i].orderStatus !==
3715   - 'AFTER_SALES_FAILURE'
3716   - ) {
3717   - message.error('请选择确认收货状态的子订单进行售后');
3718   - return;
3719   - }
3720   - }
3721   -
3722   - createOptObject(null, record.id);
3723   - setOrderDrawerVisible(true);
3724   - setOrderOptType('after-sales');
3725   - }}
3726   - >
3727   - 申请售后
3728   - </Button>
3729   - ) : (
3730   - ''
3731   - )}
3732   -
3733   - {/* {record.paths?.includes('afterSalesCompletion') ? (
3734   - <ButtonConfirm
3735   - className="p-0"
3736   - title="售后是否已完成?"
3737   - text="完成售后"
3738   - onConfirm={async () => {
3739   - let selectedSubOrders = subOrderSelectedMap.get(record.id);
3740   - if (selectedSubOrders === undefined) {
3741   - selectedSubOrders = record.subOrderInformationLists;
3742   - }
3743   - for (let i = 0; i < selectedSubOrders.length; i++) {
3744   - if (
3745   - selectedSubOrders[i].orderStatus !==
3746   - 'IN_AFTER_SALES'
3747   - ) {
3748   - message.error(
3749   - '请选择售后中状态的子订单进行完成售后',
3750   - );
3751   - return false;
3752   - }
3753   - }
3754   -
3755   - const ids = selectedSubOrders?.map((item) => {
3756   - return item.id;
3757   - });
3758   -
3759   - let body = {
3760   - ids: ids,
3761   - };
3762   - const data = await postServiceOrderAfterSalesCompletion(
3763   - {
3764   - data: body,
3765   - },
3766   - );
3767   - if (data.result === RESPONSE_CODE.SUCCESS) {
3768   - message.success(data.message);
3769   - refreshTable();
3770   - }
3771   - }}
3772   - />
3773   - ) : (
3774   - ''
3775   - )} */}
3776   -
3777   - {record.paths?.includes('salOrderSave') ? (
3778   - <ButtonConfirm
3779   - className="p-0"
3780   - title="是否推送至金蝶ERP?"
3781   - text="推送ERP"
3782   - onConfirm={async () => {
3783   - let res = await postKingdeeRepSalOrderSave({
3784   - data: {
3785   - id: record.id,
3786   - },
3787   - });
3788   -
3789   - if (res && res.result === RESPONSE_CODE.SUCCESS) {
3790   - message.success('推送成功');
3791   - mainTableRef.current.reload();
3792   - }
3793   - }}
3794   - />
3795   - ) : (
3796   - ''
3797   - )}
3798   -
3799   - {record.paths?.includes('salBillOutbound') ? (
3800   - <ButtonConfirm
3801   - className="p-0"
3802   - title="是否下推金蝶ERP出库单?"
3803   - text="下推出库"
3804   - onConfirm={async () => {
3805   - let res = await postKingdeeRepSalBillOutbound({
3806   - data: {
3807   - id: record.id,
3808   - },
3809   - });
3810   -
3811   - if (res && res.result === RESPONSE_CODE.SUCCESS) {
3812   - message.success('下推成功');
3813   - mainTableRef.current.reload();
3814   - }
3815   - }}
3816   - />
3817   - ) : (
3818   - ''
3819   - )}
3820   -
3821   - {record.paths?.includes('orderCancel') ? (
3822   - <ButtonConfirm
3823   - className="p-0"
3824   - title="确认作废?"
3825   - text="作废"
3826   - onConfirm={async () => {
3827   - let body = {
3828   - ids: [record.id],
3829   - checkIsMainOrderId: true,
3830   - };
3831   - const data = await postServiceOrderOrderCancel({
3832   - data: body,
3833   - });
3834   - if (data.result === RESPONSE_CODE.SUCCESS) {
3835   - message.success(data.message);
3836   - refreshTable();
3837   - }
3838   - }}
3839   - />
3840   - ) : (
3841   - ''
3842   - )}
3843   -
3844   - {record.paths?.includes('procurePrint') ? (
3845   - <ButtonConfirm
3846   - className="p-0"
3847   - title="确认打印?"
3848   - text="采购打印"
3849   - onConfirm={async () => {
3850   - let selectedSubOrders = subOrderSelectedMap.get(
3851   - record.id,
3852   - );
3853   - if (selectedSubOrders === undefined) {
3854   - selectedSubOrders = record.subOrderInformationLists;
3855   - }
3856   - for (let i = 0; i < selectedSubOrders.length; i++) {
3857   - if (
3858   - selectedSubOrders[i].orderStatus !==
3859   - 'PROCURE_PROCESS_FOR_MINE'
3860   - ) {
3861   - message.error(
3862   - '请选择采购待打印状态的子订单进行打印',
3863   - );
3864   - return false;
3865   - }
3866   - }
3867   -
3868   - const ids = selectedSubOrders?.map((item) => {
3869   - return item.id;
3870   - });
3871   - let res = await postServiceOrderProcurePrint({
3872   - data: {
3873   - ids: ids,
3874   - },
3875   - });
3876   -
3877   - if (res.result === RESPONSE_CODE.SUCCESS) {
3878   - message.success(res.message);
3879   - refreshTable();
3880   - }
3881   - }}
3882   - />
3883   - ) : (
3884   - // <Button
3885   - // className="p-0"
3886   - // type="link"
3887   - // onClick={() => {
3888   - // if (!subOrderSelectedMap.get(record.id)?.length) {
3889   - // return message.error('请选择选择子订单');
3890   - // }
3891   - // setSelectedRows(subOrderSelectedMap.get(record.id));
3892   - // setOrderRow(record);
3893   - // setOrderPrintVisible(true);
3894   - // setOrderCheckType(CHECK_TYPE.PROCURE);
3895   - // }}
3896   - // >
3897   - // 采购打印
3898   - // </Button>
3899   - ''
3900   - )}
3901   - </Space>
3902   - </Space.Compact>
3903   - </Flex>
3904   - </Flex>
3905   - </Flex>
3906   -
3907   - <Flex className="p-0 pb-[24px] pt-[4px] pl-[23px] pr-[5px] bg-white rounded-b-lg">
3908   - {expandedRowRender(record)}
3909   - </Flex>
3910   - </Flex>
3911   - );
3912   - };
3913   -
3914   - // 主订单列表
3915   - const mainOrdersColumns: ProColumns<OrderType>[] = MAIN_ORDER_COLUMNS.map(
3916   - (item) => {
3917   - //首能账号只能搜索订单编号
3918   - let canSearchIndex = [
3919   - 'id',
3920   - 'salesCode',
3921   - 'subNotes',
3922   - 'orderStatus',
3923   - 'createTime',
3924   - 'modifiedAuditStatus',
3925   - ];
3926   - if (isSupplier() && !canSearchIndex.includes(item.dataIndex)) {
3927   - item.search = false;
3928   - }
3929   -
3930   - canSearchIndex = [
3931   - 'id',
3932   - 'salesCode',
3933   - 'customerName',
3934   - 'institution',
3935   - 'productName',
3936   - 'orderStatus',
3937   - 'createTime',
3938   - ];
3939   -
3940   - if (isExaminer() && !canSearchIndex.includes(item.dataIndex)) {
3941   - item.search = false;
3942   - }
3943   -
3944   - if (item.dataIndex === 'name') {
3945   - return {
3946   - ...item,
3947   - title: <OrderTableHeader />,
3948   - render: (text, record) => {
3949   - return <MainOrderColumnRender record={record} />;
3950   - },
3951   - };
3952   - }
3953   -
3954   - /**
3955   - * 采购的订单状态筛选内容
3956   - */
3957   - if (roleCode === 'procure' && item.dataIndex === 'orderStatus') {
3958   - item.valueEnum = enumToProTableEnumValue(
3959   - PROCURE_PRIMARY_ORDER_STATUS_OPTIONS,
3960   - );
3961   - }
3962   - return item;
3963   - },
3964   - );
3965   -
3966   - /**
3967   - * 采购可以筛选供应商备注
3968   - */
3969   - if ((roleCode === 'procure' || roleCode === 'admin') && !isSupplier()) {
3970   - mainOrdersColumns.push({
3971   - title: '供应商备注',
3972   - width: 120,
3973   - dataIndex: 'supplierNotes',
3974   - valueType: 'text',
3975   - hideInTable: true,
3976   - });
3977   - }
3978   -
3979   - /**
3980   - * 采购可以筛选其他采购
3981   - */
3982   - if ((roleCode === 'procure' || roleCode === 'admin') && !isSupplier()) {
3983   - mainOrdersColumns.push({
3984   - title: '采购名称',
3985   - width: 120,
3986   - dataIndex: 'supplierName',
3987   - valueType: 'select',
3988   - request: async () => {
3989   - const res = await postServiceOrderProvideProcurementRoles();
3990   - let options = res.data?.map((item) => {
3991   - return { label: item, value: item };
3992   - });
3993   - return options;
3994   - },
3995   - hideInTable: true,
3996   - });
3997   - }
3998   -
3999   - /**
4000   - * 排除采购
4001   - */
4002   - if ((roleCode === 'procure' || roleCode === 'admin') && !isSupplier()) {
4003   - mainOrdersColumns.push({
4004   - title: '采购排除',
4005   - width: 120,
4006   - dataIndex: 'excludeProcureNames',
4007   - fieldProps: {
4008   - mode: 'multiple',
4009   - },
4010   - valueType: 'select',
4011   - request: async () => {
4012   - const res = await postServiceOrderProvideProcurementRoles();
4013   - let options = res.data?.map((item) => {
4014   - return { label: item, value: item };
4015   - });
4016   - return options;
4017   - },
4018   - hideInTable: true,
4019   - });
4020   - }
4021   -
4022   - /**
4023   - * 仓库可以筛选发货仓库
4024   - */
4025   - if (roleCode === 'warehouseKeeper' || roleCode === 'admin') {
4026   - mainOrdersColumns.push({
4027   - title: '发货仓库',
4028   - width: 120,
4029   - dataIndex: 'shippingWarehouse',
4030   - valueType: 'select',
4031   - valueEnum: enumToProTableEnumValue(SHIPPING_WAREHOUSE_OPTIONS),
4032   - hideInTable: true,
4033   - });
4034   - }
4035   -
4036   - //判断是否是采购,是的话新增一个筛选条件
4037   - if (roleCode === 'procure' || roleCode === 'admin') {
4038   - mainOrdersColumns.push({
4039   - title: isSupplier() ? '下单状态' : '采购下单状态',
4040   - dataIndex: 'procureOrderStatus',
4041   - valueType: 'select',
4042   - hideInTable: true,
4043   - valueEnum: enumToProTableEnumValue(PROCURE_ORDER_STATUS),
4044   - });
4045   - }
4046   -
4047   - //选择天数1
4048   - const options1 = [
4049   - {
4050   - label: '超过15天',
4051   - value: 15,
4052   - },
4053   - {
4054   - label: '超过25天',
4055   - value: 25,
4056   - },
4057   - ];
4058   - //选择天数
4059   - const [calDate, setCalDate] = useState<string | null>(null);
4060   - const [value1, setValue1] = useState();
4061   - const radioOnChange1 = ({ target: { value } }) => {
4062   - console.log('radio1 checked5656', value);
4063   - const currentDate = new Date();
4064   -
4065   - // 创建一个新的日期对象,并在当前日期的基础上加上 daysToAdd 天
4066   - const newDate = new Date(currentDate);
4067   - newDate.setDate(currentDate.getDate() + value);
4068   - const formattedDate = format(newDate, 'yyyy-MM-dd HH:mm:ss');
4069   - console.log(formattedDate, '5656newdate');
4070   - setCalDate(formattedDate);
4071   - setValue1(value);
4072   - };
4073   - //选择天数2
4074   - const options2 = [
4075   - {
4076   - label: '超过15天',
4077   - value: 15,
4078   - },
4079   - {
4080   - label: '超过25天',
4081   - value: 25,
4082   - },
4083   - ];
4084   - const [value2, setValue2] = useState();
4085   - const radioOnChange2 = ({ target: { value } }) => {
4086   - console.log('radio2 checked5656', value);
4087   - setValue2(value);
4088   - };
4089   - const confirmInvoice = () => {
4090   - console.log('5656confirm');
4091   - };
4092   - const [invoiceWarningNum, setInvoiceWarningNum] = useState(1);
4093   - const [invoiceRefundWarningNum, setInvoiceRefundWarningNum] = useState(1);
4094   - async function getInvoiceWarningNum() {
4095   - const res = await postServiceOrderWarningOrderStatistics();
4096   - setInvoiceWarningNum(res.data.waitConfirmInvoice);
4097   - setInvoiceRefundWarningNum(res.data.waitConfirmReceipt);
4098   - }
4099   -
4100   - useEffect(() => {
4101   - //预警订单数
4102   - getInvoiceWarningNum();
4103   - }, []);
4104   - const tabsItems = [
4105   - {
4106   - key: 1,
4107   - label: (
4108   - <span>
4109   - 发票确认预警
4110   - <Badge count={invoiceWarningNum} style={{ marginLeft: 8 }} />
4111   - </span>
4112   - ),
4113   - children: (
4114   - <div>
4115   - <div style={{ position: 'relative' }}>
4116   - <Radio.Group
4117   - options={options1}
4118   - onChange={radioOnChange1}
4119   - value={value1}
4120   - />
4121   - <Button
4122   - size="large"
4123   - type="primary"
4124   - onClick={confirmInvoice}
4125   - style={{ position: 'absolute', right: '20px' }}
4126   - >
4127   - 确认开票
4128   - </Button>
4129   - </div>
4130   - <div style={{ height: '25px' }}></div>
4131   - <ProTable
4132   - id="main-table"
4133   - // tableStyle={{backgroundColor:'red'}}
4134   -
4135   - actionRef={mainTableRef}
4136   - formRef={mainTableFormRef}
4137   - expandIconColumnIndex={-1}
4138   - columns={mainOrdersColumns}
4139   - rowKey="id"
4140   - pagination={{
4141   - showQuickJumper: true,
4142   - pageSize: pageSize,
4143   - current: currentPage,
4144   - showSizeChanger: true,
4145   - onChange: (page, size) => {
4146   - setPageSize(size);
4147   - setCurrentPage(page);
4148   - },
4149   - showTotal: (total, range) => {
4150   - return (
4151   - <>
4152   - <span>
4153   - {'第 ' +
4154   - range[0] +
4155   - '-' +
4156   - range[1] +
4157   - ' 条/总共 ' +
4158   - total +
4159   - ' 条主订单 '}
4160   - </span>
4161   - <span className="text-[#8C8C8C]">
4162   - {' (' + subOrderCount + ' 条子订单)'}
4163   - </span>
4164   - </>
4165   - );
4166   - },
4167   - }}
4168   - // showHeader={false}
4169   - expandedRowKeys={expandedRowKeys}
4170   - // expandable={{ expandedRowRender }}
4171   - dateFormatter="string"
4172   - options={false}
4173   - headerTitle=""
4174   - search={false}
4175   - // labelWidth: 'auto',
4176   - // onCollapse: resize,
4177   - request={async (
4178   - // 第一个参数 params 查询表单和 params 参数的结合
4179   - // 第一个参数中一定会有 pageSize 和 current ,这两个参数是 antd 的规范
4180   - params,
4181   - sorter,
4182   - filter,
4183   - ) => {
4184   - //订单id处理
4185   - /**
4186   - * 以params中的id为主,如果params没id,则取url中的id
4187   - * 第一次进来这个页面,url带有id的话,会自动填充到查询表单中,但是第一次查询params不会带这个id进来
4188   - */
4189   - let orderIds = mainTableFormRef.current?.getFieldValue('id');
4190   - let subOrderId =
4191   - mainTableFormRef.current?.getFieldValue('subOrderId');
4192   - params.id = params.id || orderIds;
4193   - params.subOrderId = params.subOrderId || subOrderId;
4194   - if (params.id !== '') {
4195   - params.id = params.id?.replace(/ /g, '');
4196   - if (params.id?.indexOf(',')) {
4197   - params.id = params.id.split(',');
4198   - params.id = params.id.filter((id) => {
4199   - return id !== '';
4200   - });
4201   - }
4202   - }
4203   -
4204   - params.condition = filterCondifion;
4205   -
4206   - //排序
4207   - params.sorted = sorted;
4208   - //是否只查看已作废
4209   - params.isDeleteQueryOrder = filterCondifion === 70;
4210   - //保存这个搜索条件
4211   - params.orderStatus = 'CONFIRM_RECEIPT';
4212   - params.invoicingStatus = 'UN_INVOICE';
4213   - params.statusDatetimeGe = calDate;
4214   - console.log(params, '5656finalparams');
4215   - setSearchParam(params);
4216   - //订单标记1
4217   - const { data } = await postServiceOrderQueryServiceOrder({
4218   - // ...params,
4219   - // FIXME: remove @ts-ignore
4220   - // @ts-ignore
4221   - sorter,
4222   - filter,
4223   - data: { ...params },
4224   - });
4225   -
4226   - setRolePath(data.specialPath);
4227   - setSubOrderCount(data.count);
4228   - setAllMainChecked(false);
4229   - setSelectedMainOrderKeys([]);
4230   - subOrderSelectedMap.clear();
4231   - mainOrderSelectedMap.clear();
4232   - setData(data?.data);
4233   -
4234   - //主订单id与子订单id的对照关系保存
4235   - mainOrderIdSubOrderIdRelationsMap.clear();
4236   - for (let row of data?.data) {
4237   - let mianOrderId = row.id;
4238   - let subOrderIds = row.subOrderInformationLists?.map((item) => {
4239   - //目前子订单存储的totalPayment不准确,这里重新处理取主订单的totalPayment
4240   - //totalPayment在财务开票计算金额时使用到
4241   - item.totalPayment = row.totalPayment;
4242   - return item.id;
4243   - });
4244   - mainOrderIdSubOrderIdRelationsMap.set(mianOrderId, subOrderIds);
4245   - }
4246   -
4247   - return {
4248   - data: data?.data || [],
4249   - total: data?.total || 0,
4250   - };
4251   - }}
4252   - toolbar={{
4253   - multipleLine: true,
4254   - }}
4255   - // toolBarRender={() => {
4256   - // return toolBarRender();
4257   - // }}
4258   - />
4259   -
4260   - {orderDrawerVisible && (
4261   - <OrderDrawer
4262   - data={orderOptType === 'add' ? {} : buildMainOrder()}
4263   - subOrders={orderOptType === 'add' ? [] : buildSubOrders()}
4264   - onClose={(isSuccess: boolean) => {
4265   - setOrderDrawerVisible(false);
4266   - clearOptObject();
4267   - if (isSuccess) {
4268   - refreshTable();
4269   - }
4270   - }}
4271   - orderOptType={orderOptType}
4272   - />
4273   - )}
4274   -
4275   - {checkVisible && (
4276   - <CheckModal
4277   - setCheckVisible={(val: boolean) => {
4278   - setCheckVisible(val);
4279   - if (!val) {
4280   - clearOptObject();
4281   - }
4282   - }}
4283   - data={isMainOrder ? getFirstMainOrder() : buildMainOrder()}
4284   - subOrders={
4285   - isMainOrder
4286   - ? [...subOrderSelectedMap.values()].flat()
4287   - : buildSubOrders()
4288   - }
4289   - orderCheckType={orderCheckType}
4290   - openOrderDrawer={(type: any, id: any) => {
4291   - setCurrentMainId(id);
4292   - setOrderOptType(type);
4293   - setOrderDrawerVisible(true);
4294   - }}
4295   - onClose={() => {
4296   - clearOptObject();
4297   - setCheckVisible(false);
4298   - refreshTable();
4299   - }}
4300   - />
4301   - )}
4302   -
4303   - {applyForInvoicingVisible && (
4304   - <ApplyForInvoicingModal
4305   - setCheckVisible={(val: boolean) => {
4306   - setApplyForInvoicingVisible(val);
4307   - if (!val) {
4308   - clearOptObject();
4309   - }
4310   - }}
4311   - subOrders={
4312   - isMainOrder
4313   - ? [...subOrderSelectedMap.values()].flat()
4314   - : buildSubOrders()
4315   - }
4316   - totalPayment={getApplyInvoicingTotalPayment()}
4317   - isMainOrder={isMainOrder}
4318   - isEdit={isEdit}
4319   - onClose={() => {
4320   - setApplyForInvoicingVisible(false);
4321   - setIsMainOrder(false);
4322   - clearOptObject();
4323   - refreshTable();
4324   - }}
4325   - />
4326   - )}
4327   -
4328   - {notesEditVisible && (
4329   - <OrderNotesEditModal
4330   - setNotesEditVisible={(val: boolean) => {
4331   - setNotesEditVisible(val);
4332   - if (!val) {
4333   - clearOptObject();
4334   - }
4335   - }}
4336   - ids={selectedRows}
4337   - notesType={notesType}
4338   - notes={notes}
4339   - onClose={() => {
4340   - setNotesEditVisible(false);
4341   - setSelectedRows([]);
4342   - setNotes(notes);
4343   - setNotesType(1);
4344   - refreshTable();
4345   - }}
4346   - />
4347   - )}
4348   -
4349   - {deliverVisible && (
4350   - <DeliverModal
4351   - data={buildSubOrders()}
4352   - isSendProduct={isSendProduct}
4353   - setVisible={(val: boolean) => {
4354   - setDeliverVisible(val);
4355   - if (!val) {
4356   - clearOptObject();
4357   - }
4358   - }}
4359   - sendType={orderCheckType}
4360   - onClose={() => {
4361   - clearOptObject();
4362   - setDeliverVisible(false);
4363   - setIsSendProduct(false);
4364   - refreshTable();
4365   - }}
4366   - />
4367   - )}
4368   -
4369   - {financialVisible && (
4370   - <FinancialDrawer
4371   - isEdit={isEdit}
4372   - mainOrder={isMainOrder ? getFirstMainOrder() : buildMainOrder()}
4373   - subOrders={
4374   - isMainOrder
4375   - ? [...subOrderSelectedMap.values()].flat()
4376   - : buildSubOrders()
4377   - }
4378   - isMainOrder={isMainOrder}
4379   - cancel={() => {
4380   - setFinancialVisible(false);
4381   - clearOptObject();
4382   - setIsMainOrder(false);
4383   - setIsEdit(false);
4384   - }}
4385   - onClose={() => {
4386   - setFinancialVisible(false);
4387   - clearOptObject();
4388   - refreshTable();
4389   - setIsMainOrder(false);
4390   - setIsEdit(false);
4391   - }}
4392   - />
4393   - )}
4394   -
4395   - {financialEditVisible && (
4396   - <FinancialEditDrawer
4397   - mainOrder={buildMainOrder()}
4398   - subOrders={buildSubOrders()}
4399   - isMainOrder={isMainOrder}
4400   - setVisible={() => {
4401   - setFinancialEditVisible(false);
4402   - clearOptObject();
4403   - }}
4404   - onClose={() => {
4405   - setFinancialEditVisible(false);
4406   - refreshTable();
4407   - setIsMainOrder(false);
4408   - clearOptObject();
4409   - }}
4410   - />
4411   - )}
4412   -
4413   - {orderPrintVisible && (
4414   - <OrderPrintModal
4415   - mainOrder={buildMainOrder()}
4416   - subOrders={buildSubOrders()}
4417   - isRePrint={isRePrintOrder}
4418   - setVisible={(val: boolean) => {
4419   - setOrderPrintVisible(val);
4420   - if (!val) {
4421   - clearOptObject();
4422   - }
4423   - }}
4424   - printOptType={orderCheckType}
4425   - onClose={() => {
4426   - setOrderPrintVisible(false);
4427   - clearOptObject();
4428   - setIsRePrintOrder(false);
4429   - refreshTable();
4430   - }}
4431   - />
4432   - )}
4433   -
4434   - {confirmReceiptVisible && (
4435   - <ConfirmReceiptModal
4436   - data={buildSubOrders()}
4437   - onClose={() => {
4438   - setConfirmReceiptVisible(false);
4439   - clearOptObject();
4440   - refreshTable();
4441   - }}
4442   - />
4443   - )}
4444   -
4445   - {imagesViewerModalVisible && (
4446   - <ImagesViewerModal
4447   - optType={imagesViewerOptType}
4448   - setVisible={(val: boolean) => {
4449   - setImagesViewerModalVisible(val);
4450   - if (!val) {
4451   - clearOptObject();
4452   - }
4453   - }}
4454   - onClose={() => {
4455   - setImagesViewerModalVisible(false);
4456   - }}
4457   - orderRow={buildSubOrders()[0]}
4458   - />
4459   - )}
4460   -
4461   - {importModalVisible && (
4462   - <ImportModal
4463   - onClose={() => {
4464   - setImportModalVisible(false);
4465   - refreshTable();
4466   - }}
4467   - />
4468   - )}
4469   -
4470   - {attachmentModalVisible && (
4471   - <AttachmentModal
4472   - data={buildSubOrders()[0]}
4473   - onClose={() => {
4474   - setAttachmentModalVisible(false);
4475   - clearOptObject();
4476   - }}
4477   - />
4478   - )}
4479   -
4480   - {historyModalVisible && (
4481   - <HistoryModal
4482   - subOrders={selectedRows}
4483   - isCancelledOrder={filterCondifion === 70}
4484   - onClose={() => {
4485   - setHistoryModalVisible(false);
4486   - setSelectedRows({});
4487   - clearOptObject();
4488   - }}
4489   - />
4490   - )}
4491   -
4492   - {deliverInfoDrawerVisible && (
4493   - <DeliverInfoDrawer
4494   - data={buildMainOrder()}
4495   - onClose={() => {
4496   - setDeliverInfoDrawerVisible(false);
4497   - clearOptObject();
4498   - }}
4499   - />
4500   - )}
4501   -
4502   - {deliverInfoDrawerVisible && (
4503   - <DeliverInfoDrawer
4504   - data={buildMainOrder()}
4505   - onClose={() => {
4506   - setDeliverInfoDrawerVisible(false);
4507   - clearOptObject();
4508   - }}
4509   - />
4510   - )}
4511   -
4512   - {procureCheckModalVisible && (
4513   - <ProcureCheckModal
4514   - setCheckVisible={(val: boolean) => {
4515   - setProcureCheckModalVisible(val);
4516   - if (!val) {
4517   - clearOptObject();
4518   - }
4519   - }}
4520   - isMainOrder={isMainOrder}
4521   - orders={
4522   - isMainOrder
4523   - ? [...subOrderSelectedMap.values()].flat()
4524   - : buildSubOrders()
4525   - }
4526   - onClose={() => {
4527   - setProcureCheckModalVisible(false);
4528   - clearOptObject();
4529   - setIsMainOrder(false);
4530   - refreshTable();
4531   - }}
4532   - />
4533   - )}
4534   -
4535   - {afterSalesDrawerVisible && (
4536   - <AfterSalesDrawer
4537   - setVisible={(val: boolean) => {
4538   - setAfterSalesDrawerVisible(val);
4539   - if (!val) {
4540   - clearOptObject();
4541   - }
4542   - }}
4543   - mainOrder={buildMainOrder()}
4544   - subOrders={buildSubOrders()}
4545   - onClose={() => {
4546   - setAfterSalesDrawerVisible(false);
4547   - clearOptObject();
4548   - refreshTable();
4549   - }}
4550   - />
4551   - )}
4552   -
4553   - {procureConvertModalVisible && (
4554   - <ProcureConvertModal
4555   - setVisible={(val: boolean) => {
4556   - setProcureConvertModalVisible(val);
4557   - if (!val) {
4558   - clearOptObject();
4559   - }
4560   - }}
4561   - subOrders={buildSubOrders()}
4562   - onClose={() => {
4563   - setProcureConvertModalVisible(false);
4564   - clearOptObject();
4565   - refreshTable();
4566   - }}
4567   - />
4568   - )}
4569   -
4570   - {financialMergeDrawerVisible && (
4571   - <FinancialMergeDrawer
4572   - setVisible={(val: boolean) => {
4573   - setFinancialMergeDrawerVisible(val);
4574   - if (!val) {
4575   - clearOptObject();
4576   - }
4577   - }}
4578   - dataList={
4579   - isMainOrder
4580   - ? [...subOrderSelectedMap.values()].flat()
4581   - : buildSubOrders()
4582   - }
4583   - onClose={() => {
4584   - setFinancialMergeDrawerVisible(false);
4585   - setIsMainOrder(false);
4586   - clearOptObject();
4587   - refreshTable();
4588   - }}
4589   - />
4590   - )}
4591   -
4592   - {financialReceiptsModalVisible && (
4593   - <FinancialReceiptsModal
4594   - setVisible={(val: boolean) => {
4595   - setFinancialReceiptsModalVisible(val);
4596   - if (!val) {
4597   - clearOptObject();
4598   - }
4599   - }}
4600   - datas={selectedRows}
4601   - onClose={() => {
4602   - setFinancialReceiptsModalVisible(false);
4603   - setSelectedRows({});
4604   - refreshTable();
4605   - }}
4606   - />
4607   - )}
4608   -
4609   - {shippingWarehouseChangeModalVisible && (
4610   - <ShippingWarehouseChangeModal
4611   - setVisible={(val: boolean) => {
4612   - setShippingWarehouseChangeModalVisible(val);
4613   - if (!val) {
4614   - clearOptObject();
4615   - }
4616   - }}
4617   - subOrderIds={ids}
4618   - originShippingWarehouse={buildSubOrders()[0].shippingWarehouse}
4619   - onClose={() => {
4620   - setShippingWarehouseChangeModalVisible(false);
4621   - clearOptObject();
4622   - setIds([]);
4623   - refreshTable();
4624   - }}
4625   - />
4626   - )}
4627   - {reissueVisible && (
4628   - <ReissueModal
4629   - setVisible={(val: boolean) => {
4630   - setReissueVisible(val);
4631   - if (!val) {
4632   - clearOptObject();
4633   - }
4634   - }}
4635   - subOrders={
4636   - isMainOrder
4637   - ? [...subOrderSelectedMap.values()].flat()
4638   - : buildSubOrders()
4639   - }
4640   - onClose={() => {
4641   - setReissueVisible(false);
4642   - clearOptObject();
4643   - refreshTable();
4644   - }}
4645   - />
4646   - )}
4647   - {reissueVisibleOld && (
4648   - <ReissueModal_old
4649   - setVisible={(val: boolean) => {
4650   - setReissueVisibleOld(val);
4651   - console.log(reissueVisible);
4652   - if (!val) {
4653   - clearOptObject();
4654   - }
4655   - }}
4656   - mainOrder={buildMainOrder()}
4657   - subOrders={buildSubOrders()}
4658   - onClose={() => {
4659   - setReissueVisibleOld(false);
4660   - clearOptObject();
4661   - refreshTable();
4662   - }}
4663   - />
4664   - )}
4665   - {productionTimeModalVisible && (
4666   - <ProductionTimeModal
4667   - setVisible={(val: boolean) => {
4668   - setProductionTimeModalVisible(val);
4669   - if (!val) {
4670   - clearOptObject();
4671   - }
4672   - }}
4673   - subOrders={buildSubOrders()}
4674   - onClose={() => {
4675   - setProductionTimeModalVisible(false);
4676   - clearOptObject();
4677   - refreshTable();
4678   - }}
4679   - />
4680   - )}
4681   -
4682   - {modifiedDiffModalVisible && (
4683   - <ModifiedDiffModal
4684   - setVisible={(val: boolean) => {
4685   - setModifiedDiffModalVisible(val);
4686   - if (!val) {
4687   - clearOptObject();
4688   - }
4689   - }}
4690   - subOrders={buildSubOrders()}
4691   - mainOrder={buildMainOrder()}
4692   - onClose={() => {
4693   - setModifiedDiffModalVisible(false);
4694   - clearOptObject();
4695   - }}
4696   - />
4697   - )}
4698   -
4699   - {uploadPayBillModalVisible && (
4700   - <UploadPayBillModal
4701   - setVisible={(val: boolean) => {
4702   - setUploadPayBillModalVisible(val);
4703   - if (!val) {
4704   - clearOptObject();
4705   - }
4706   - }}
4707   - subOrders={buildSubOrders()}
4708   - mainOrder={buildMainOrder()}
4709   - onClose={() => {
4710   - setUploadPayBillModalVisible(false);
4711   - clearOptObject();
4712   - refreshTable();
4713   - }}
4714   - />
4715   - )}
4716   - {invoicingDrawerFormVisible && (
4717   - <InvoicingDrawerForm
4718   - dataList={
4719   - isMainOrder
4720   - ? [...subOrderSelectedMap.values()].flat()
4721   - : buildSubOrders()
4722   - }
4723   - setVisible={(val: boolean) => {
4724   - setInvoicingDrawerFormVisible(val);
4725   - if (!val) {
4726   - clearOptObject();
4727   - }
4728   - }}
4729   - mainOrder={isMainOrder ? getFirstMainOrder() : buildMainOrder()}
4730   - onClose={() => {
4731   - setInvoicingDrawerFormVisible(false);
4732   - setIsMainOrder(true);
4733   - clearOptObject();
4734   - refreshTable();
4735   - }}
4736   - />
4737   - )}
4738   - {contextHolder}
4739   - <FloatButton.BackTop visibilityHeight={0} />
4740   - </div>
4741   - ),
4742   - },
4743   - {
4744   - key: 2,
4745   - label: (
4746   - <span>
4747   - 订单回款预警
4748   - <Badge count={invoiceRefundWarningNum} style={{ marginLeft: 8 }} />
4749   - </span>
4750   - ),
4751   - children: (
4752   - <div>
4753   - <Radio.Group
4754   - options={options2}
4755   - onChange={radioOnChange2}
4756   - value={value2}
4757   - />
4758   - <div style={{ height: '25px' }}></div>
4759   - <ProTable
4760   - id="main-table"
4761   - // tableStyle={{backgroundColor:'red'}}
4762   -
4763   - actionRef={mainTableRef}
4764   - formRef={mainTableFormRef}
4765   - expandIconColumnIndex={-1}
4766   - columns={mainOrdersColumns}
4767   - rowKey="id"
4768   - pagination={{
4769   - showQuickJumper: true,
4770   - pageSize: pageSize,
4771   - current: currentPage,
4772   - showSizeChanger: true,
4773   - onChange: (page, size) => {
4774   - setPageSize(size);
4775   - setCurrentPage(page);
4776   - },
4777   - showTotal: (total, range) => {
4778   - return (
4779   - <>
4780   - <span>
4781   - {'第 ' +
4782   - range[0] +
4783   - '-' +
4784   - range[1] +
4785   - ' 条/总共 ' +
4786   - total +
4787   - ' 条主订单 '}
4788   - </span>
4789   - <span className="text-[#8C8C8C]">
4790   - {' (' + subOrderCount + ' 条子订单)'}
4791   - </span>
4792   - </>
4793   - );
4794   - },
4795   - }}
4796   - // showHeader={false}
4797   - expandedRowKeys={expandedRowKeys}
4798   - // expandable={{ expandedRowRender }}
4799   - dateFormatter="string"
4800   - options={false}
4801   - headerTitle=""
4802   - search={false}
4803   - // labelWidth: 'auto',
4804   - // onCollapse: resize,
4805   - request={async (
4806   - // 第一个参数 params 查询表单和 params 参数的结合
4807   - // 第一个参数中一定会有 pageSize 和 current ,这两个参数是 antd 的规范
4808   - params,
4809   - sorter,
4810   - filter,
4811   - ) => {
4812   - params.orderStatus = 'CONFIRM_INVOICE';
4813   - console.log(params, '5656params');
4814   - //订单id处理
4815   - /**
4816   - * 以params中的id为主,如果params没id,则取url中的id
4817   - * 第一次进来这个页面,url带有id的话,会自动填充到查询表单中,但是第一次查询params不会带这个id进来
4818   - */
4819   - let orderIds = mainTableFormRef.current?.getFieldValue('id');
4820   - let subOrderId =
4821   - mainTableFormRef.current?.getFieldValue('subOrderId');
4822   - params.id = params.id || orderIds;
4823   - params.subOrderId = params.subOrderId || subOrderId;
4824   - if (params.id !== '') {
4825   - params.id = params.id?.replace(/ /g, '');
4826   - if (params.id?.indexOf(',')) {
4827   - params.id = params.id.split(',');
4828   - params.id = params.id.filter((id) => {
4829   - return id !== '';
4830   - });
4831   - }
4832   - }
4833   -
4834   - params.condition = filterCondifion;
4835   -
4836   - //排序
4837   - params.sorted = sorted;
4838   - //是否只查看已作废
4839   - params.isDeleteQueryOrder = filterCondifion === 70;
4840   - //保存这个搜索条件
4841   - setSearchParam(params);
4842   -
4843   - //订单标记2
4844   - const { data } = await postServiceOrderQueryServiceOrder({
4845   - // ...params,
4846   - // FIXME: remove @ts-ignore
4847   - // @ts-ignore
4848   - sorter,
4849   - filter,
4850   - data: { ...params },
4851   - });
4852   -
4853   - setRolePath(data.specialPath);
4854   - setSubOrderCount(data.count);
4855   - setAllMainChecked(false);
4856   - setSelectedMainOrderKeys([]);
4857   - subOrderSelectedMap.clear();
4858   - mainOrderSelectedMap.clear();
4859   - setData(data?.data);
4860   -
4861   - //主订单id与子订单id的对照关系保存
4862   - mainOrderIdSubOrderIdRelationsMap.clear();
4863   - for (let row of data?.data) {
4864   - let mianOrderId = row.id;
4865   - let subOrderIds = row.subOrderInformationLists?.map((item) => {
4866   - //目前子订单存储的totalPayment不准确,这里重新处理取主订单的totalPayment
4867   - //totalPayment在财务开票计算金额时使用到
4868   - item.totalPayment = row.totalPayment;
4869   - return item.id;
4870   - });
4871   - mainOrderIdSubOrderIdRelationsMap.set(mianOrderId, subOrderIds);
4872   - }
4873   -
4874   - return {
4875   - data: data?.data || [],
4876   - total: data?.total || 0,
4877   - };
4878   - }}
4879   - toolbar={{
4880   - multipleLine: true,
4881   - }}
4882   - // toolBarRender={() => {
4883   - // return toolBarRender();
4884   - // }}
4885   - />
4886   -
4887   - {orderDrawerVisible && (
4888   - <OrderDrawer
4889   - data={orderOptType === 'add' ? {} : buildMainOrder()}
4890   - subOrders={orderOptType === 'add' ? [] : buildSubOrders()}
4891   - onClose={(isSuccess: boolean) => {
4892   - setOrderDrawerVisible(false);
4893   - clearOptObject();
4894   - if (isSuccess) {
4895   - refreshTable();
4896   - }
4897   - }}
4898   - orderOptType={orderOptType}
4899   - />
4900   - )}
4901   -
4902   - {checkVisible && (
4903   - <CheckModal
4904   - setCheckVisible={(val: boolean) => {
4905   - setCheckVisible(val);
4906   - if (!val) {
4907   - clearOptObject();
4908   - }
4909   - }}
4910   - data={isMainOrder ? getFirstMainOrder() : buildMainOrder()}
4911   - subOrders={
4912   - isMainOrder
4913   - ? [...subOrderSelectedMap.values()].flat()
4914   - : buildSubOrders()
4915   - }
4916   - orderCheckType={orderCheckType}
4917   - openOrderDrawer={(type: any, id: any) => {
4918   - setCurrentMainId(id);
4919   - setOrderOptType(type);
4920   - setOrderDrawerVisible(true);
4921   - }}
4922   - onClose={() => {
4923   - clearOptObject();
4924   - setCheckVisible(false);
4925   - refreshTable();
4926   - }}
4927   - />
4928   - )}
4929   -
4930   - {applyForInvoicingVisible && (
4931   - <ApplyForInvoicingModal
4932   - setCheckVisible={(val: boolean) => {
4933   - setApplyForInvoicingVisible(val);
4934   - if (!val) {
4935   - clearOptObject();
4936   - }
4937   - }}
4938   - subOrders={
4939   - isMainOrder
4940   - ? [...subOrderSelectedMap.values()].flat()
4941   - : buildSubOrders()
4942   - }
4943   - totalPayment={getApplyInvoicingTotalPayment()}
4944   - isMainOrder={isMainOrder}
4945   - isEdit={isEdit}
4946   - onClose={() => {
4947   - setApplyForInvoicingVisible(false);
4948   - setIsMainOrder(false);
4949   - clearOptObject();
4950   - refreshTable();
4951   - }}
4952   - />
4953   - )}
4954   -
4955   - {notesEditVisible && (
4956   - <OrderNotesEditModal
4957   - setNotesEditVisible={(val: boolean) => {
4958   - setNotesEditVisible(val);
4959   - if (!val) {
4960   - clearOptObject();
4961   - }
4962   - }}
4963   - ids={selectedRows}
4964   - notesType={notesType}
4965   - notes={notes}
4966   - onClose={() => {
4967   - setNotesEditVisible(false);
4968   - setSelectedRows([]);
4969   - setNotes(notes);
4970   - setNotesType(1);
4971   - refreshTable();
4972   - }}
4973   - />
4974   - )}
4975   -
4976   - {deliverVisible && (
4977   - <DeliverModal
4978   - data={buildSubOrders()}
4979   - isSendProduct={isSendProduct}
4980   - setVisible={(val: boolean) => {
4981   - setDeliverVisible(val);
4982   - if (!val) {
4983   - clearOptObject();
4984   - }
4985   - }}
4986   - sendType={orderCheckType}
4987   - onClose={() => {
4988   - clearOptObject();
4989   - setDeliverVisible(false);
4990   - setIsSendProduct(false);
4991   - refreshTable();
4992   - }}
4993   - />
4994   - )}
4995   -
4996   - {financialVisible && (
4997   - <FinancialDrawer
4998   - isEdit={isEdit}
4999   - mainOrder={isMainOrder ? getFirstMainOrder() : buildMainOrder()}
5000   - subOrders={
5001   - isMainOrder
5002   - ? [...subOrderSelectedMap.values()].flat()
5003   - : buildSubOrders()
5004   - }
5005   - isMainOrder={isMainOrder}
5006   - cancel={() => {
5007   - setFinancialVisible(false);
5008   - clearOptObject();
5009   - setIsMainOrder(false);
5010   - setIsEdit(false);
5011   - }}
5012   - onClose={() => {
5013   - setFinancialVisible(false);
5014   - clearOptObject();
5015   - refreshTable();
5016   - setIsMainOrder(false);
5017   - setIsEdit(false);
5018   - }}
5019   - />
5020   - )}
5021   -
5022   - {financialEditVisible && (
5023   - <FinancialEditDrawer
5024   - mainOrder={buildMainOrder()}
5025   - subOrders={buildSubOrders()}
5026   - isMainOrder={isMainOrder}
5027   - setVisible={() => {
5028   - setFinancialEditVisible(false);
5029   - clearOptObject();
5030   - }}
5031   - onClose={() => {
5032   - setFinancialEditVisible(false);
5033   - refreshTable();
5034   - setIsMainOrder(false);
5035   - clearOptObject();
5036   - }}
5037   - />
5038   - )}
5039   -
5040   - {orderPrintVisible && (
5041   - <OrderPrintModal
5042   - mainOrder={buildMainOrder()}
5043   - subOrders={buildSubOrders()}
5044   - isRePrint={isRePrintOrder}
5045   - setVisible={(val: boolean) => {
5046   - setOrderPrintVisible(val);
5047   - if (!val) {
5048   - clearOptObject();
5049   - }
5050   - }}
5051   - printOptType={orderCheckType}
5052   - onClose={() => {
5053   - setOrderPrintVisible(false);
5054   - clearOptObject();
5055   - setIsRePrintOrder(false);
5056   - refreshTable();
5057   - }}
5058   - />
5059   - )}
5060   -
5061   - {confirmReceiptVisible && (
5062   - <ConfirmReceiptModal
5063   - data={buildSubOrders()}
5064   - onClose={() => {
5065   - setConfirmReceiptVisible(false);
5066   - clearOptObject();
5067   - refreshTable();
5068   - }}
5069   - />
5070   - )}
5071   -
5072   - {imagesViewerModalVisible && (
5073   - <ImagesViewerModal
5074   - optType={imagesViewerOptType}
5075   - setVisible={(val: boolean) => {
5076   - setImagesViewerModalVisible(val);
5077   - if (!val) {
5078   - clearOptObject();
5079   - }
5080   - }}
5081   - onClose={() => {
5082   - setImagesViewerModalVisible(false);
5083   - }}
5084   - orderRow={buildSubOrders()[0]}
5085   - />
5086   - )}
5087   -
5088   - {importModalVisible && (
5089   - <ImportModal
5090   - onClose={() => {
5091   - setImportModalVisible(false);
5092   - refreshTable();
5093   - }}
5094   - />
5095   - )}
5096   -
5097   - {attachmentModalVisible && (
5098   - <AttachmentModal
5099   - data={buildSubOrders()[0]}
5100   - onClose={() => {
5101   - setAttachmentModalVisible(false);
5102   - clearOptObject();
5103   - }}
5104   - />
5105   - )}
5106   -
5107   - {historyModalVisible && (
5108   - <HistoryModal
5109   - subOrders={selectedRows}
5110   - isCancelledOrder={filterCondifion === 70}
5111   - onClose={() => {
5112   - setHistoryModalVisible(false);
5113   - setSelectedRows({});
5114   - clearOptObject();
5115   - }}
5116   - />
5117   - )}
5118   -
5119   - {deliverInfoDrawerVisible && (
5120   - <DeliverInfoDrawer
5121   - data={buildMainOrder()}
5122   - onClose={() => {
5123   - setDeliverInfoDrawerVisible(false);
5124   - clearOptObject();
5125   - }}
5126   - />
5127   - )}
5128   -
5129   - {deliverInfoDrawerVisible && (
5130   - <DeliverInfoDrawer
5131   - data={buildMainOrder()}
5132   - onClose={() => {
5133   - setDeliverInfoDrawerVisible(false);
5134   - clearOptObject();
5135   - }}
5136   - />
5137   - )}
5138   -
5139   - {procureCheckModalVisible && (
5140   - <ProcureCheckModal
5141   - setCheckVisible={(val: boolean) => {
5142   - setProcureCheckModalVisible(val);
5143   - if (!val) {
5144   - clearOptObject();
5145   - }
5146   - }}
5147   - isMainOrder={isMainOrder}
5148   - orders={
5149   - isMainOrder
5150   - ? [...subOrderSelectedMap.values()].flat()
5151   - : buildSubOrders()
5152   - }
5153   - onClose={() => {
5154   - setProcureCheckModalVisible(false);
5155   - clearOptObject();
5156   - setIsMainOrder(false);
5157   - refreshTable();
5158   - }}
5159   - />
5160   - )}
5161   -
5162   - {afterSalesDrawerVisible && (
5163   - <AfterSalesDrawer
5164   - setVisible={(val: boolean) => {
5165   - setAfterSalesDrawerVisible(val);
5166   - if (!val) {
5167   - clearOptObject();
5168   - }
5169   - }}
5170   - mainOrder={buildMainOrder()}
5171   - subOrders={buildSubOrders()}
5172   - onClose={() => {
5173   - setAfterSalesDrawerVisible(false);
5174   - clearOptObject();
5175   - refreshTable();
5176   - }}
5177   - />
5178   - )}
5179   -
5180   - {procureConvertModalVisible && (
5181   - <ProcureConvertModal
5182   - setVisible={(val: boolean) => {
5183   - setProcureConvertModalVisible(val);
5184   - if (!val) {
5185   - clearOptObject();
5186   - }
5187   - }}
5188   - subOrders={buildSubOrders()}
5189   - onClose={() => {
5190   - setProcureConvertModalVisible(false);
5191   - clearOptObject();
5192   - refreshTable();
5193   - }}
5194   - />
5195   - )}
5196   -
5197   - {financialMergeDrawerVisible && (
5198   - <FinancialMergeDrawer
5199   - setVisible={(val: boolean) => {
5200   - setFinancialMergeDrawerVisible(val);
5201   - if (!val) {
5202   - clearOptObject();
5203   - }
5204   - }}
5205   - dataList={
5206   - isMainOrder
5207   - ? [...subOrderSelectedMap.values()].flat()
5208   - : buildSubOrders()
5209   - }
5210   - onClose={() => {
5211   - setFinancialMergeDrawerVisible(false);
5212   - setIsMainOrder(false);
5213   - clearOptObject();
5214   - refreshTable();
5215   - }}
5216   - />
5217   - )}
5218   -
5219   - {financialReceiptsModalVisible && (
5220   - <FinancialReceiptsModal
5221   - setVisible={(val: boolean) => {
5222   - setFinancialReceiptsModalVisible(val);
5223   - if (!val) {
5224   - clearOptObject();
5225   - }
5226   - }}
5227   - datas={selectedRows}
5228   - onClose={() => {
5229   - setFinancialReceiptsModalVisible(false);
5230   - setSelectedRows({});
5231   - refreshTable();
5232   - }}
5233   - />
5234   - )}
5235   -
5236   - {shippingWarehouseChangeModalVisible && (
5237   - <ShippingWarehouseChangeModal
5238   - setVisible={(val: boolean) => {
5239   - setShippingWarehouseChangeModalVisible(val);
5240   - if (!val) {
5241   - clearOptObject();
5242   - }
5243   - }}
5244   - subOrderIds={ids}
5245   - originShippingWarehouse={buildSubOrders()[0].shippingWarehouse}
5246   - onClose={() => {
5247   - setShippingWarehouseChangeModalVisible(false);
5248   - clearOptObject();
5249   - setIds([]);
5250   - refreshTable();
5251   - }}
5252   - />
5253   - )}
5254   - {reissueVisible && (
5255   - <ReissueModal
5256   - setVisible={(val: boolean) => {
5257   - setReissueVisible(val);
5258   - if (!val) {
5259   - clearOptObject();
5260   - }
5261   - }}
5262   - subOrders={
5263   - isMainOrder
5264   - ? [...subOrderSelectedMap.values()].flat()
5265   - : buildSubOrders()
5266   - }
5267   - onClose={() => {
5268   - setReissueVisible(false);
5269   - clearOptObject();
5270   - refreshTable();
5271   - }}
5272   - />
5273   - )}
5274   - {reissueVisibleOld && (
5275   - <ReissueModal_old
5276   - setVisible={(val: boolean) => {
5277   - setReissueVisibleOld(val);
5278   - console.log(reissueVisible);
5279   - if (!val) {
5280   - clearOptObject();
5281   - }
5282   - }}
5283   - mainOrder={buildMainOrder()}
5284   - subOrders={buildSubOrders()}
5285   - onClose={() => {
5286   - setReissueVisibleOld(false);
5287   - clearOptObject();
5288   - refreshTable();
5289   - }}
5290   - />
5291   - )}
5292   - {productionTimeModalVisible && (
5293   - <ProductionTimeModal
5294   - setVisible={(val: boolean) => {
5295   - setProductionTimeModalVisible(val);
5296   - if (!val) {
5297   - clearOptObject();
5298   - }
5299   - }}
5300   - subOrders={buildSubOrders()}
5301   - onClose={() => {
5302   - setProductionTimeModalVisible(false);
5303   - clearOptObject();
5304   - refreshTable();
5305   - }}
5306   - />
5307   - )}
5308   -
5309   - {modifiedDiffModalVisible && (
5310   - <ModifiedDiffModal
5311   - setVisible={(val: boolean) => {
5312   - setModifiedDiffModalVisible(val);
5313   - if (!val) {
5314   - clearOptObject();
5315   - }
5316   - }}
5317   - subOrders={buildSubOrders()}
5318   - mainOrder={buildMainOrder()}
5319   - onClose={() => {
5320   - setModifiedDiffModalVisible(false);
5321   - clearOptObject();
5322   - }}
5323   - />
5324   - )}
5325   -
5326   - {uploadPayBillModalVisible && (
5327   - <UploadPayBillModal
5328   - setVisible={(val: boolean) => {
5329   - setUploadPayBillModalVisible(val);
5330   - if (!val) {
5331   - clearOptObject();
5332   - }
5333   - }}
5334   - subOrders={buildSubOrders()}
5335   - mainOrder={buildMainOrder()}
5336   - onClose={() => {
5337   - setUploadPayBillModalVisible(false);
5338   - clearOptObject();
5339   - refreshTable();
5340   - }}
5341   - />
5342   - )}
5343   - {invoicingDrawerFormVisible && (
5344   - <InvoicingDrawerForm
5345   - dataList={
5346   - isMainOrder
5347   - ? [...subOrderSelectedMap.values()].flat()
5348   - : buildSubOrders()
5349   - }
5350   - setVisible={(val: boolean) => {
5351   - setInvoicingDrawerFormVisible(val);
5352   - if (!val) {
5353   - clearOptObject();
5354   - }
5355   - }}
5356   - mainOrder={isMainOrder ? getFirstMainOrder() : buildMainOrder()}
5357   - onClose={() => {
5358   - setInvoicingDrawerFormVisible(false);
5359   - setIsMainOrder(true);
5360   - clearOptObject();
5361   - refreshTable();
5362   - }}
5363   - />
5364   - )}
5365   - {contextHolder}
5366   - <FloatButton.BackTop visibilityHeight={0} />
5367   - </div>
5368   - ),
5369   - },
5370   - ];
5371   - const [open, setOpen] = useState(true);
5372   - //隐藏弹窗
5373   - const hideModal = () => {
5374   - setOpen(false);
5375   - };
5376   - return (
5377   - <div className="order-page-container">
5378   - <div id="resizeDiv"></div>
5379   - <Modal
5380   - title="订单预警提醒"
5381   - open={open}
5382   - width={800}
5383   - closable={false}
5384   - footer={[
5385   - <Button key="confirm" size="large" type="primary" onClick={hideModal}>
5386   - 去处理
5387   - </Button>,
5388   - ]}
5389   - >
5390   - <Row
5391   - gutter={16}
5392   - justify="space-between" // Aligns Cols to the start and end
5393   - align="middle" // Vertically center contents
5394   - >
5395   - <Col span={12}>
5396   - <div
5397   - style={{
5398   - display: 'flex',
5399   - justifyContent: 'center',
5400   - marginTop: '20px',
5401   - }}
5402   - >
5403   - <Card
5404   - bordered={true}
5405   - style={{
5406   - backgroundColor: '#f0f0f0', // 背景颜色
5407   - width: '200px', // 卡片宽度
5408   - height: '200px', // 卡片高度
5409   - display: 'flex',
5410   - alignItems: 'center',
5411   - justifyContent: 'center',
5412   - }}
5413   - >
5414   - <div
5415   - style={{
5416   - fontWeight: 'bold', // 字体加粗
5417   - color: 'black', // 字体颜色
5418   - fontSize: '20px', // 字体大小
5419   - }}
5420   - >
5421   - <div
5422   - style={{
5423   - fontWeight: 'bold', // 字体加粗
5424   - color: 'black', // 字体颜色
5425   - fontSize: '40px', // 字体大小
5426   - justifyContent: 'center',
5427   - display: 'flex',
5428   - alignItems: 'center',
5429   - marginBottom: '20px',
5430   - }}
5431   - >
5432   - {invoiceWarningNum}
5433   - </div>
5434   - 发票待确认订单
5435   - </div>
5436   - </Card>
5437   - </div>
5438   - </Col>
5439   - <Col span={12}>
5440   - <div
5441   - style={{
5442   - display: 'flex',
5443   - justifyContent: 'center',
5444   - marginTop: '20px',
5445   - }}
5446   - >
5447   - <Card
5448   - bordered={true}
5449   - style={{
5450   - backgroundColor: '#f0f0f0', // 背景颜色
5451   - width: '200px', // 卡片宽度
5452   - height: '200px', // 卡片高度
5453   - display: 'flex',
5454   - alignItems: 'center',
5455   - justifyContent: 'center',
5456   - }}
5457   - >
5458   - <div
5459   - style={{
5460   - fontWeight: 'bold', // 字体加粗
5461   - color: 'black', // 字体颜色
5462   - fontSize: '20px', // 字体大小
5463   - }}
5464   - >
5465   - <div
5466   - style={{
5467   - fontWeight: 'bold', // 字体加粗
5468   - color: 'black', // 字体颜色
5469   - fontSize: '40px', // 字体大小
5470   - justifyContent: 'center',
5471   - display: 'flex',
5472   - alignItems: 'center',
5473   - marginBottom: '20px',
5474   - }}
5475   - >
5476   - {invoiceRefundWarningNum}
5477   - </div>
5478   - 回款待确认订单
5479   - </div>
5480   - </Card>
5481   - </div>
5482   - </Col>
5483   - </Row>
5484   - <div style={{ color: 'red', padding: '40px' }}>
5485   - <p>预警说明:</p>
5486   - <p>
5487   - 1、从订单确认收货之日起,超过5天未和客户确认发票(不开票的订单除外)的订单将会进行第一次提醒;超过15天未和客户确认发票(不开票的订单除外)的订单将会每天进行一次提醒,并限制下单功能
5488   - </p>
5489   - <p>
5490   - 2、从发票确认之日起,超过15天未确认回款的订单将会进行第一次提醒,超过25天未确认回款的订单将会每天进行一次提醒,并限制下单功能
5491   - </p>
5492   - </div>
5493   - </Modal>
5494   - <Tabs
5495   - defaultActiveKey="1"
5496   - items={tabsItems}
5497   - onChange={(value) => {
5498   - console.log(value, '5656');
5499   - }}
5500   - />
5501   - </div>
5502   - );
5503   -};
5504   -// //选择天数1
5505   -// const options1 = [
5506   -// {
5507   -// label: '超过5天',
5508   -// value: '1',
5509   -// },
5510   -// {
5511   -// label: '超过15天',
5512   -// value: '2',
5513   -// },
5514   -// ];
5515   -// const [value1, setValue1] = useState('Apple');
5516   -// const radioOnChange1 = ({ target: { value } }) => {
5517   -// console.log('radio1 checked', value);
5518   -// setValue1(value);
5519   -// };
5520   -//选择天数2
5521   -
5522   -export default OrderPage;