Commit 988069a10c2bf4d84759303b166f04450c549627

Authored by boyang
1 parent a87b84d4

fix: 风险名单bug

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