Commit 950088ad51b2646ed32ea7d448cbae5db93cf294

Authored by boyang
2 parents 490847a3 86129810

Merge branch 'dev' into 'master'

Dev



See merge request !28
Showing 22 changed files with 1696 additions and 5469 deletions
.umirc.ts
@@ -139,9 +139,20 @@ export default defineConfig({ @@ -139,9 +139,20 @@ export default defineConfig({
139 { 139 {
140 name: '课题组管理', 140 name: '课题组管理',
141 path: '/researchGroup', 141 path: '/researchGroup',
142 - component: './ResearchGroup',  
143 icon: 'AccountBookOutlined', 142 icon: 'AccountBookOutlined',
144 access: 'canReadAdminAndSales', 143 access: 'canReadAdminAndSales',
  144 + routes: [
  145 + {
  146 + name: '课题组列表',
  147 + path: 'researchGroup',
  148 + component: './ResearchGroup/ResearchGroup',
  149 + },
  150 + {
  151 + name: '课题组风险名单',
  152 + path: 'researchGroupAccess',
  153 + component: './ResearchGroup/ResearchGroupAccess',
  154 + },
  155 + ],
145 }, 156 },
146 { 157 {
147 name: '分期账单', 158 name: '分期账单',
src/pages/Order/FeedBack/OrderList.tsx
@@ -2585,9 +2585,11 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => { @@ -2585,9 +2585,11 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) => {
2585 </span> 2585 </span>
2586 </div> 2586 </div>
2587 <span> 2587 <span>
2588 - <span className="text-[#8C8C8C]">联系人:</span> 2588 + <span className="text-[#8C8C8C]">课题组:</span>
2589 <span className="text-slate-700"> 2589 <span className="text-slate-700">
2590 - {record.institutionContactName + ' '} 2590 + {record.institutionContactName
  2591 + ? record.institutionContactName + ' '
  2592 + : '空'}
2591 </span> 2593 </span>
2592 </span> 2594 </span>
2593 </> 2595 </>
src/pages/Order/OrderList/OrderList.tsx
@@ -2627,9 +2627,11 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) =&gt; { @@ -2627,9 +2627,11 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) =&gt; {
2627 </span> 2627 </span>
2628 </div> 2628 </div>
2629 <span> 2629 <span>
2630 - <span className="text-[#8C8C8C]">联系人:</span> 2630 + <span className="text-[#8C8C8C]">课题组:</span>
2631 <span className="text-slate-700"> 2631 <span className="text-slate-700">
2632 - {record.institutionContactName + ' '} 2632 + {record.institutionContactName
  2633 + ? record.institutionContactName + ' '
  2634 + : '空'}
2633 </span> 2635 </span>
2634 </span> 2636 </span>
2635 </> 2637 </>
src/pages/Order/OrderWarning/components/OrderDrawer.tsx
@@ -11,6 +11,10 @@ import { @@ -11,6 +11,10 @@ import {
11 postKingdeeRepMaterialUnit, 11 postKingdeeRepMaterialUnit,
12 postKingdeeRepMeasureUnit, 12 postKingdeeRepMeasureUnit,
13 postPrepaidPhoneAvailableList, 13 postPrepaidPhoneAvailableList,
  14 + postResearchGroupsNameSet,
  15 + postServiceConstCompanyType,
  16 + postServiceConstOrderSource,
  17 + postServiceConstPlatformType,
14 postServiceOrderAddOrder, 18 postServiceOrderAddOrder,
15 postServiceOrderAfterSalesQuerySnapshotOrder, 19 postServiceOrderAfterSalesQuerySnapshotOrder,
16 postServiceOrderApplyAfterSales, 20 postServiceOrderApplyAfterSales,
@@ -28,17 +32,21 @@ import { getTeacherCustomFieldNumber } from &#39;@/utils/kingdee&#39;; @@ -28,17 +32,21 @@ import { getTeacherCustomFieldNumber } from &#39;@/utils/kingdee&#39;;
28 import { getSalesCodeOptions } from '@/utils/order'; 32 import { getSalesCodeOptions } from '@/utils/order';
29 import { getDefaultString } from '@/utils/StringUtil'; 33 import { getDefaultString } from '@/utils/StringUtil';
30 import { 34 import {
31 - DrawerForm,  
32 FormListActionType, 35 FormListActionType,
  36 + ModalForm,
33 ProCard, 37 ProCard,
  38 + ProFormDatePicker,
34 ProFormDateTimePicker, 39 ProFormDateTimePicker,
  40 + ProFormDependency,
35 ProFormDigit, 41 ProFormDigit,
36 ProFormList, 42 ProFormList,
  43 + ProFormRadio,
37 ProFormSelect, 44 ProFormSelect,
38 ProFormText, 45 ProFormText,
39 ProFormTextArea, 46 ProFormTextArea,
40 ProFormUploadDragger, 47 ProFormUploadDragger,
41 } from '@ant-design/pro-components'; 48 } from '@ant-design/pro-components';
  49 +import { Group } from '@ant-design/pro-form';
42 import { Button, Form, message, Modal } from 'antd'; 50 import { Button, Form, message, Modal } from 'antd';
43 import { cloneDeep } from 'lodash'; 51 import { cloneDeep } from 'lodash';
44 import { useEffect, useRef, useState } from 'react'; 52 import { useEffect, useRef, useState } from 'react';
@@ -48,15 +56,15 @@ import { @@ -48,15 +56,15 @@ import {
48 INVOCING_STATUS_OPTIONS_OLD, 56 INVOCING_STATUS_OPTIONS_OLD,
49 PAYEE_OPTIONS, 57 PAYEE_OPTIONS,
50 PAYMENT_CHANNEL_OPTIONS, 58 PAYMENT_CHANNEL_OPTIONS,
51 - PAYMENT_METHOD_OPTIONS, 59 + PAYMENT_METHOD_OPTIONS_4_ADD,
52 PRODUCT_BELONG_DEPARTMENT_OPTIONS, 60 PRODUCT_BELONG_DEPARTMENT_OPTIONS,
53 SHIPPING_WAREHOUSE_OPTIONS, 61 SHIPPING_WAREHOUSE_OPTIONS,
54 -} from '../../constant'; 62 +} from '../constant';
55 import KingdeeCustomerModal from './KingdeeCustomerModal'; 63 import KingdeeCustomerModal from './KingdeeCustomerModal';
56 64
57 export default ({ onClose, data, subOrders, orderOptType }) => { 65 export default ({ onClose, data, subOrders, orderOptType }) => {
58 const [invoicingStatus, setInvoicingStatus] = useState(''); 66 const [invoicingStatus, setInvoicingStatus] = useState('');
59 - const [salesCodeOptions] = useState([]); 67 + const [salesCodeOptions, setSalesCodeOptions] = useState([]);
60 const [submitBtnLoading, setSubmitBtnLoading] = useState(false); 68 const [submitBtnLoading, setSubmitBtnLoading] = useState(false);
61 const [drawerTitle, setDrawerTitle] = useState(''); 69 const [drawerTitle, setDrawerTitle] = useState('');
62 const [hasLocalData, setHasLocalData] = useState(false); 70 const [hasLocalData, setHasLocalData] = useState(false);
@@ -80,41 +88,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -80,41 +88,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
80 const [district, setDistrict] = useState(''); 88 const [district, setDistrict] = useState('');
81 // const [productCustomerContactOptions, setProductCustomerContactOptions] = 89 // const [productCustomerContactOptions, setProductCustomerContactOptions] =
82 // useState([]); //客户的收货人选项 90 // useState([]); //客户的收货人选项
83 - const [form] = Form.useForm<{  
84 - isLocalData: boolean;  
85 - salesCode: '';  
86 - customerName: '';  
87 - customerContactNumber: '';  
88 - institution: '';  
89 - institutionContactName: '';  
90 - customerShippingAddress: '';  
91 - totalPayment: '';  
92 - paymentChannel: '';  
93 - paymentMethod: '';  
94 - productBelongBusiness: '';  
95 - invoicingStatus: '';  
96 - invoiceIdentificationNumber: '';  
97 - invoicingTime: '';  
98 - bank: '';  
99 - bankAccountNumber: '';  
100 - deleteSubOrderLists: [];  
101 - filePaths: [];  
102 - notes: '';  
103 - invoiceFirst: boolean;  
104 - list: [  
105 - {  
106 - productCode: '';  
107 - productName: '';  
108 - quantity: '';  
109 - productPrice: '';  
110 - parameters: '';  
111 - subOrderPayment: '';  
112 - unit: '';  
113 - serialNumber: '';  
114 - notes: '';  
115 - },  
116 - ];  
117 - }>(); 91 + const [form] = Form.useForm();
118 const [accountOptions, setAccountOptions] = useState<any>([]); 92 const [accountOptions, setAccountOptions] = useState<any>([]);
119 93
120 let copyData = cloneDeep(data); 94 let copyData = cloneDeep(data);
@@ -134,7 +108,8 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -134,7 +108,8 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
134 */ 108 */
135 const loadSalesCodeOptions = async () => { 109 const loadSalesCodeOptions = async () => {
136 let options = await getSalesCodeOptions(); 110 let options = await getSalesCodeOptions();
137 - console.log('options ', JSON.stringify(options)); 111 + setSalesCodeOptions(options);
  112 +
138 if (optType('copy') || optType('edit')) { 113 if (optType('copy') || optType('edit')) {
139 let includeFlag = false; 114 let includeFlag = false;
140 //销售代码校验,如果是旧的销售代码,则提示并清空 115 //销售代码校验,如果是旧的销售代码,则提示并清空
@@ -623,6 +598,21 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -623,6 +598,21 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
623 form.setFieldValue('totalPayment', totalPayment); 598 form.setFieldValue('totalPayment', totalPayment);
624 } 599 }
625 600
  601 + /*function computeTotalPayment() {
  602 + let list = form.getFieldValue('list');
  603 + let totalPaymentInMicro = 0; // 以"1 万分"为单位计算
  604 +
  605 + list?.forEach((subOrder: any) => {
  606 + let subOrderPayment = subOrder?.subOrderPayment;
  607 + if (subOrderPayment !== '' && subOrderPayment !== undefined) {
  608 + totalPaymentInMicro += Math.round(subOrderPayment * 10000); // 转换成整数(1 万分)
  609 + }
  610 + });
  611 +
  612 + let totalPayment = totalPaymentInMicro / 10000; // 计算完后转换回元
  613 + form.setFieldValue('totalPayment', totalPayment.toFixed(2)); // 保留 4 位小数
  614 + }*/
  615 +
626 /** 616 /**
627 * 检查用户额度 617 * 检查用户额度
628 * @param option 618 * @param option
@@ -751,18 +741,6 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -751,18 +741,6 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
751 } 741 }
752 } 742 }
753 743
754 - const validateContactNumber = (_: any, value: any) => {  
755 - const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;  
756 - const phoneRegex = /^\d{1,11}(-\d{1,11})?$/;  
757 -  
758 - if (emailRegex.test(value) || phoneRegex.test(value)) {  
759 - return Promise.resolve();  
760 - }  
761 - return Promise.reject(  
762 - new Error('联系方式必须是邮箱或手机号格式(不能包含空格等特殊符号)'),  
763 - );  
764 - };  
765 -  
766 /** 744 /**
767 * 刪除草稿数据 745 * 刪除草稿数据
768 */ 746 */
@@ -782,22 +760,14 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -782,22 +760,14 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
782 760
783 return ( 761 return (
784 <> 762 <>
785 - <DrawerForm<{ 763 + <ModalForm<{
786 isLocalData: any; 764 isLocalData: any;
787 deleteSubOrderLists: any; 765 deleteSubOrderLists: any;
788 name: string; 766 name: string;
789 company: string; 767 company: string;
790 }> 768 }>
791 open 769 open
792 - width="35%"  
793 - title={drawerTitle}  
794 - resize={{  
795 - onResize() {  
796 - console.log('resize!');  
797 - },  
798 - maxWidth: window.innerWidth * 0.8,  
799 - minWidth: 400,  
800 - }} 770 + width={1000}
801 onFinishFailed={() => { 771 onFinishFailed={() => {
802 message.error('表单项存在错误,请检查'); 772 message.error('表单项存在错误,请检查');
803 setSubmitBtnLoading(false); 773 setSubmitBtnLoading(false);
@@ -841,21 +811,27 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -841,21 +811,27 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
841 }} 811 }}
842 form={form} 812 form={form}
843 autoFocusFirstInput 813 autoFocusFirstInput
844 - drawerProps={{ 814 + modalProps={{
845 destroyOnClose: true, 815 destroyOnClose: true,
846 - maskClosable: false,  
847 - extra: [  
848 - <Button  
849 - key="useLocalData"  
850 - hidden={!hasLocalData}  
851 - type="link"  
852 - onClick={() => {  
853 - useLocalFormData();  
854 - }} 816 + maskClosable: true,
  817 + title: (
  818 + <div
  819 + style={{ display: 'flex', alignItems: 'center', width: '100%' }}
855 > 820 >
856 - 使用草稿  
857 - </Button>,  
858 - ], 821 + <span>{drawerTitle}</span>
  822 + {hasLocalData && (
  823 + <Button
  824 + key="useLocalData"
  825 + type="link"
  826 + onClick={() => {
  827 + useLocalFormData();
  828 + }}
  829 + >
  830 + 使用草稿
  831 + </Button>
  832 + )}
  833 + </div>
  834 + ),
859 }} 835 }}
860 submitTimeout={2000} 836 submitTimeout={2000}
861 onFinish={async (values) => { 837 onFinish={async (values) => {
@@ -869,11 +845,46 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -869,11 +845,46 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
869 }); 845 });
870 return item; 846 return item;
871 }); 847 });
872 - 848 + list = list.map((item, index) => {
  849 + // //记录部门修改时间
  850 + if (
  851 + optType('edit') &&
  852 + copyData?.subOrderInformationLists[index]
  853 + ?.productBelongBusiness &&
  854 + item.productBelongBusiness !==
  855 + copyData?.subOrderInformationLists[index]?.productBelongBusiness
  856 + ) {
  857 + const date = new Date();
  858 + const year = date.getFullYear();
  859 + const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始,需要加1
  860 + const day = String(date.getDate()).padStart(2, '0');
  861 + const hours = String(date.getHours()).padStart(2, '0');
  862 + const minutes = String(date.getMinutes()).padStart(2, '0');
  863 + const seconds = String(date.getSeconds()).padStart(2, '0');
  864 +
  865 + const formattedDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
  866 + values.productBelongBusinessUpdateTime = formattedDate;
  867 + } else if (optType('add') || optType('copy')) {
  868 + const date = new Date();
  869 + const year = date.getFullYear();
  870 + const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始,需要加1
  871 + const day = String(date.getDate()).padStart(2, '0');
  872 + const hours = String(date.getHours()).padStart(2, '0');
  873 + const minutes = String(date.getMinutes()).padStart(2, '0');
  874 + const seconds = String(date.getSeconds()).padStart(2, '0');
  875 + const formattedDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
  876 + values.productBelongBusinessUpdateTime = formattedDate;
  877 + } else {
  878 + values.productBelongBusinessUpdateTime =
  879 + data.productBelongBusinessUpdateTime;
  880 + }
  881 + return item;
  882 + });
873 values.list = list; 883 values.list = list;
874 values.institution = values.institution?.trim(); 884 values.institution = values.institution?.trim();
875 values.institutionContactName = values.institutionContactName?.trim(); 885 values.institutionContactName = values.institutionContactName?.trim();
876 values.customerName = values.customerNameString.trim(); 886 values.customerName = values.customerNameString.trim();
  887 +
877 // values.customerShippingAddress = 888 // values.customerShippingAddress =
878 // province + city + district + values.customerShippingAddress; 889 // province + city + district + values.customerShippingAddress;
879 890
@@ -907,7 +918,6 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -907,7 +918,6 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
907 }); 918 });
908 let diff = originIds.filter((item) => !curIds.includes(item)); 919 let diff = originIds.filter((item) => !curIds.includes(item));
909 values.deleteSubOrderLists = diff; 920 values.deleteSubOrderLists = diff;
910 -  
911 if (optType('edit')) { 921 if (optType('edit')) {
912 values.province = province; 922 values.province = province;
913 values.city = city; 923 values.city = city;
@@ -1129,7 +1139,10 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -1129,7 +1139,10 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1129 console.log(form.getFieldValue('id')); 1139 console.log(form.getFieldValue('id'));
1130 if (form.getFieldValue('id') !== undefined) { 1140 if (form.getFieldValue('id') !== undefined) {
1131 const resp = await postDistrictSelOrderProvince({ 1141 const resp = await postDistrictSelOrderProvince({
1132 - data: form.getFieldValue('id'), 1142 + data: {
  1143 + oId: form.getFieldValue('id'),
  1144 + orderType: orderOptType,
  1145 + },
1133 }); 1146 });
1134 if (resp && resp.data) { 1147 if (resp && resp.data) {
1135 if (resp.data.province) { 1148 if (resp.data.province) {
@@ -1193,10 +1206,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -1193,10 +1206,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1193 loadAccountOptions(v.target.value); 1206 loadAccountOptions(v.target.value);
1194 }, 1207 },
1195 }} 1208 }}
1196 - rules={[  
1197 - { required: true, message: '联系方式必填' },  
1198 - { validator: validateContactNumber },  
1199 - ]} 1209 + rules={[{ required: true, message: '联系方式必填' }]}
1200 /> 1210 />
1201 <ProFormText 1211 <ProFormText
1202 width="lg" 1212 width="lg"
@@ -1206,45 +1216,163 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -1206,45 +1216,163 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1206 placeholder="请输入单位" 1216 placeholder="请输入单位"
1207 rules={[{ required: true, message: '单位必填' }]} 1217 rules={[{ required: true, message: '单位必填' }]}
1208 /> 1218 />
1209 - <ProFormText 1219 + {/*<ProFormText
1210 width="lg" 1220 width="lg"
1211 key="institutionContactName" 1221 key="institutionContactName"
1212 name="institutionContactName" 1222 name="institutionContactName"
1213 label="课题组" 1223 label="课题组"
1214 placeholder="请输入课题组" 1224 placeholder="请输入课题组"
1215 rules={[{ required: true, message: '课题组必填' }]} 1225 rules={[{ required: true, message: '课题组必填' }]}
1216 - />  
1217 - {/*<ProFormSelect  
1218 - key={'institutionContactName'} 1226 + />*/}
  1227 + <Group>
  1228 + <ProFormSelect
  1229 + request={async () => {
  1230 + const res = await postServiceConstCompanyType();
  1231 + return Object.entries(res?.data).map(([value, label]) => ({
  1232 + label,
  1233 + value,
  1234 + }));
  1235 + }}
1219 width="md" 1236 width="md"
1220 - showSearch  
1221 - name="institutionContactName"  
1222 - rules={[{ required: true, message: '请输入课题组名称!' }]}  
1223 - request={async (value) => {  
1224 - const keywords = value.keyWords;  
1225 - const res = await postResearchGroupsNameSet({  
1226 - data: {  
1227 - groupName: keywords,  
1228 - },  
1229 - });  
1230 - let options = res?.data?.map((c: any) => {  
1231 - return {  
1232 - label: c,  
1233 - value: c,  
1234 - key: c,  
1235 - };  
1236 - });  
1237 - return options; 1237 + onChange={() => {
  1238 + form.setFieldValue('platformType', '');
1238 }} 1239 }}
1239 - fieldProps={{  
1240 - filterOption() {  
1241 - return true;  
1242 - }, 1240 + rules={[{ required: true, message: '单位类型必填' }]}
  1241 + name="companyType"
  1242 + label="单位类型"
  1243 + />
  1244 + <ProFormDependency name={['companyType']}>
  1245 + {({ companyType }) => {
  1246 + const renderInstitutionContactName = () => (
  1247 + <>
  1248 + <ProFormSelect
  1249 + key="institutionContactName"
  1250 + width="md"
  1251 + showSearch
  1252 + name="institutionContactName"
  1253 + rules={[{ required: true, message: '请输入课题组名称!' }]}
  1254 + request={async (value) => {
  1255 + const keywords = value?.keyWords || '';
  1256 + const res = await postResearchGroupsNameSet({
  1257 + data: { status: 'ADD_AUDIT_PASS', groupName: keywords },
  1258 + });
  1259 + return Object.entries(res?.data || {}).map(
  1260 + ([researchGroupsId, researchGroupsName]) => ({
  1261 + label: researchGroupsName,
  1262 + value: researchGroupsName, // 使用 researchGroupsId 作为 value
  1263 + key: researchGroupsId,
  1264 + id: researchGroupsId,
  1265 + }),
  1266 + );
  1267 + }}
  1268 + fieldProps={{
  1269 + filterOption: () => true,
  1270 + onChange: (_, option) => {
  1271 + form.setFieldsValue({
  1272 + researchGroupId: option?.id || '',
  1273 + });
  1274 + },
  1275 + }}
  1276 + debounceTime={1000}
  1277 + label="课题组名称"
  1278 + placeholder="请输入名称"
  1279 + />
  1280 + <ProFormText
  1281 + hidden={true}
  1282 + key="researchGroupId"
  1283 + name="researchGroupId"
  1284 + ></ProFormText>
  1285 + </>
  1286 + );
  1287 + const renderPlatformType = (fieldKey) => (
  1288 + <ProFormSelect
  1289 + key={fieldKey}
  1290 + width="md"
  1291 + showSearch
  1292 + name="platformType"
  1293 + rules={[{ required: true, message: '请选择平台类型!' }]}
  1294 + request={async () => {
  1295 + const res = await postServiceConstPlatformType({
  1296 + query: { companyType },
  1297 + });
  1298 + return Object.entries(res?.data).map(([value, label]) => ({
  1299 + label,
  1300 + value,
  1301 + }));
  1302 + }}
  1303 + fieldProps={{
  1304 + filterOption: (input, option) =>
  1305 + option?.label.toLowerCase().includes(input.toLowerCase()), // 自定义搜索过滤逻辑
  1306 + }}
  1307 + debounceTime={1000}
  1308 + label="平台类型"
  1309 + placeholder="请输入平台类型"
  1310 + />
  1311 + );
  1312 +
  1313 + if (companyType === 'school') {
  1314 + return renderInstitutionContactName();
  1315 + } else if (
  1316 + ['firm', 'ECommercePlatform', 'otherPlatform'].includes(
  1317 + companyType,
  1318 + )
  1319 + ) {
  1320 + return (
  1321 + <Group>
  1322 + {['ECommercePlatform', 'otherPlatform'].includes(
  1323 + companyType,
  1324 + ) && renderPlatformType(`platformType_${companyType}`)}
  1325 + <ProFormText
  1326 + width="md"
  1327 + name="institutionContactName"
  1328 + label="课题组名称"
  1329 + placeholder="请输入名称"
  1330 + />
  1331 + </Group>
  1332 + );
  1333 + } else if (companyType === 'officialWebsite') {
  1334 + return (
  1335 + <Group>
  1336 + <ProFormSelect
  1337 + request={async () => {
  1338 + const res = await postServiceConstOrderSource();
  1339 + return Object.entries(res?.data).map(
  1340 + ([value, label]) => ({
  1341 + label,
  1342 + value,
  1343 + }),
  1344 + );
  1345 + }}
  1346 + width="md"
  1347 + name="orderSource"
  1348 + label="订单来源"
  1349 + />
  1350 + <ProFormDependency name={['orderSource']}>
  1351 + {({ orderSource }) => {
  1352 + if (orderSource === 'school') {
  1353 + return renderInstitutionContactName();
  1354 + } else if (orderSource === 'company') {
  1355 + return (
  1356 + <ProFormText
  1357 + width="md"
  1358 + name="institutionContactName"
  1359 + label="课题组名称"
  1360 + placeholder="请输入名称"
  1361 + />
  1362 + );
  1363 + }
  1364 + return null;
  1365 + }}
  1366 + </ProFormDependency>
  1367 + </Group>
  1368 + );
  1369 + } else {
  1370 + return renderInstitutionContactName();
  1371 + }
1243 }} 1372 }}
1244 - debounceTime={1000}  
1245 - label="课题组名称"  
1246 - placeholder="请输入名称"  
1247 - />*/} 1373 + </ProFormDependency>
  1374 + </Group>
  1375 +
1248 <div 1376 <div
1249 style={{ 1377 style={{
1250 display: 'flex', 1378 display: 'flex',
@@ -1315,7 +1443,10 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -1315,7 +1443,10 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1315 console.log(form.getFieldValue('id')); 1443 console.log(form.getFieldValue('id'));
1316 if (form.getFieldValue('id')) { 1444 if (form.getFieldValue('id')) {
1317 const resp = await postDistrictSelOrderProvince({ 1445 const resp = await postDistrictSelOrderProvince({
1318 - data: form.getFieldValue('id'), 1446 + data: {
  1447 + oId: form.getFieldValue('id'),
  1448 + orderType: orderOptType,
  1449 + },
1319 }); 1450 });
1320 if ( 1451 if (
1321 resp.data.province !== null && 1452 resp.data.province !== null &&
@@ -1375,7 +1506,10 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -1375,7 +1506,10 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1375 let districtOptions = []; 1506 let districtOptions = [];
1376 if (form.getFieldValue('id')) { 1507 if (form.getFieldValue('id')) {
1377 const resp = await postDistrictSelOrderProvince({ 1508 const resp = await postDistrictSelOrderProvince({
1378 - data: form.getFieldValue('id'), 1509 + data: {
  1510 + oId: form.getFieldValue('id'),
  1511 + orderType: orderOptType,
  1512 + },
1379 }); 1513 });
1380 if (resp.data.city !== null && resp.data.city !== undefined) { 1514 if (resp.data.city !== null && resp.data.city !== undefined) {
1381 let res = await postDistrictSelectByNameAndLevel({ 1515 let res = await postDistrictSelectByNameAndLevel({
@@ -1477,7 +1611,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -1477,7 +1611,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1477 onChange={(val: any) => { 1611 onChange={(val: any) => {
1478 setPaymentMethod(val); 1612 setPaymentMethod(val);
1479 }} 1613 }}
1480 - options={enumToSelect(PAYMENT_METHOD_OPTIONS)} 1614 + options={enumToSelect(PAYMENT_METHOD_OPTIONS_4_ADD)}
1481 rules={[{ required: true, message: '支付方式必填' }]} 1615 rules={[{ required: true, message: '支付方式必填' }]}
1482 disabled={optType('after-sales-check')} 1616 disabled={optType('after-sales-check')}
1483 /> 1617 />
@@ -1561,7 +1695,34 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -1561,7 +1695,34 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1561 form.setFieldValue('invoiceFirst', false); 1695 form.setFieldValue('invoiceFirst', false);
1562 } 1696 }
1563 }} 1697 }}
1564 - rules={[{ required: true, message: '是否需要开票必填' }]} 1698 + rules={[
  1699 + { required: true, message: '是否需要开票必填' },
  1700 + {
  1701 + validator: (_, value) => {
  1702 + // 自定义校验逻辑
  1703 + if (
  1704 + form.getFieldValue('paymentMethod') ===
  1705 + 'WITHHOLDING_ADVANCE_DEPOSIT' &&
  1706 + value !== 'UN_INVOICE'
  1707 + ) {
  1708 + return Promise.reject('扣预存订单不能开票');
  1709 + }
  1710 + return Promise.resolve();
  1711 + },
  1712 + },
  1713 + {
  1714 + validator: (_, value) => {
  1715 + // 自定义校验逻辑
  1716 + if (
  1717 + form.getFieldValue('totalPayment') === 0 &&
  1718 + value !== 'UN_INVOICE'
  1719 + ) {
  1720 + return Promise.reject('金额为0订单不能开票');
  1721 + }
  1722 + return Promise.resolve();
  1723 + },
  1724 + },
  1725 + ]}
1565 /> 1726 />
1566 <ProFormSelect 1727 <ProFormSelect
1567 placeholder="是否开票后发货" 1728 placeholder="是否开票后发货"
@@ -1750,6 +1911,9 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -1750,6 +1911,9 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1750 value: listMeta?.record?.materialId, 1911 value: listMeta?.record?.materialId,
1751 }} 1912 }}
1752 fieldProps={{ 1913 fieldProps={{
  1914 + popupMatchSelectWidth: false,
  1915 + listHeight: 400,
  1916 + dropdownStyle: { width: '55%' },
1753 filterOption() { 1917 filterOption() {
1754 return true; 1918 return true;
1755 }, 1919 },
@@ -1946,6 +2110,76 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -1946,6 +2110,76 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1946 rules={[{ required: true, message: '所属事业部必填' }]} 2110 rules={[{ required: true, message: '所属事业部必填' }]}
1947 disabled={optType('after-sales-check')} 2111 disabled={optType('after-sales-check')}
1948 />, 2112 />,
  2113 +
  2114 + <Group key="selfDevelop">
  2115 + <ProFormRadio.Group
  2116 + key="selfDevelop"
  2117 + name="selfDevelop"
  2118 + label="是否自研产品"
  2119 + initialValue={false}
  2120 + options={[
  2121 + {
  2122 + label: '是',
  2123 + value: true,
  2124 + },
  2125 + {
  2126 + label: '否',
  2127 + value: false,
  2128 + },
  2129 + ]}
  2130 + rules={[{ required: true, message: '是否自研产品必填' }]}
  2131 + />
  2132 + <ProFormDependency name={['selfDevelop']}>
  2133 + {({ selfDevelop }) => {
  2134 + if (selfDevelop) {
  2135 + return (
  2136 + <ProFormDatePicker
  2137 + name="deliveryDatetime"
  2138 + label="产品交期(填写前请先与工程师沟通)"
  2139 + rules={[
  2140 + { required: true, message: '产品交期必填' },
  2141 + ]}
  2142 + />
  2143 + );
  2144 + }
  2145 + }}
  2146 + </ProFormDependency>
  2147 + </Group>,
  2148 + <ProFormRadio.Group
  2149 + key="proxy"
  2150 + name="proxy"
  2151 + label="是否代买代购"
  2152 + //hidden={true}
  2153 + initialValue={true}
  2154 + options={[
  2155 + {
  2156 + label: '是',
  2157 + value: true,
  2158 + },
  2159 + {
  2160 + label: '否',
  2161 + value: false,
  2162 + },
  2163 + ]}
  2164 + />,
  2165 + <ProFormRadio.Group
  2166 + key="discount"
  2167 + name="discount"
  2168 + label="是否竞标/打折"
  2169 + //hidden={true}
  2170 + initialValue={true}
  2171 + options={[
  2172 + {
  2173 + label: '是',
  2174 + value: true,
  2175 + },
  2176 + {
  2177 + label: '否',
  2178 + value: false,
  2179 + },
  2180 + ]}
  2181 + />,
  2182 +
1949 <ProFormSelect 2183 <ProFormSelect
1950 key={'shippingWarehouse' + listMeta.index} 2184 key={'shippingWarehouse' + listMeta.index}
1951 placeholder="请选择发货仓库" 2185 placeholder="请选择发货仓库"
@@ -1997,7 +2231,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; { @@ -1997,7 +2231,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1997 }} 2231 }}
1998 actionRef={actionRef} 2232 actionRef={actionRef}
1999 ></ProFormList> 2233 ></ProFormList>
2000 - </DrawerForm> 2234 + </ModalForm>
2001 {kingdeeCstomerModalVisible && ( 2235 {kingdeeCstomerModalVisible && (
2002 <KingdeeCustomerModal 2236 <KingdeeCustomerModal
2003 setVisible={setKingdeeCstomerModalVisible} 2237 setVisible={setKingdeeCstomerModalVisible}
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/components/AuditModal.tsx renamed to src/pages/ResearchGroup/ResearchGroup/components/AuditModal.tsx
src/pages/ResearchGroup/components/ImportModal.tsx renamed to src/pages/ResearchGroup/ResearchGroup/components/ImportModal.tsx
src/pages/ResearchGroup/components/PointsExchangeModal.tsx renamed to src/pages/ResearchGroup/ResearchGroup/components/PointsExchangeModal.tsx
src/pages/ResearchGroup/components/PointsExchangeRecordsModal.tsx renamed to src/pages/ResearchGroup/ResearchGroup/components/PointsExchangeRecordsModal.tsx
src/pages/ResearchGroup/components/ResearchGroupAddModal.tsx renamed to src/pages/ResearchGroup/ResearchGroup/components/ResearchGroupAddModal.tsx
src/pages/ResearchGroup/components/ResearchGroupMemberRequestAddModal.tsx renamed to src/pages/ResearchGroup/ResearchGroup/components/ResearchGroupMemberRequestAddModal.tsx
1 import { RESPONSE_CODE } from '@/constants/enum'; 1 import { RESPONSE_CODE } from '@/constants/enum';
2 import { 2 import {
3 - postCanrdApiUserAddressList, postCanrdApiUserList, 3 + postCanrdApiUserAddressList,
  4 + postCanrdApiUserList,
4 postResearchGroupMemberRequestsAdd, 5 postResearchGroupMemberRequestsAdd,
5 postResearchGroupMemberRequestsDetail, 6 postResearchGroupMemberRequestsDetail,
6 postResearchGroupMemberRequestsEdit, 7 postResearchGroupMemberRequestsEdit,
@@ -25,7 +26,7 @@ import { useEffect, useState } from &#39;react&#39;; @@ -25,7 +26,7 @@ import { useEffect, useState } from &#39;react&#39;;
25 import '../index.less'; 26 import '../index.less';
26 27
27 // import { cloneDeep } from 'lodash'; 28 // import { cloneDeep } from 'lodash';
28 -export default ({ setVisible, requestId, onClose,type }) => { 29 +export default ({ setVisible, requestId, onClose, type }) => {
29 const [form] = Form.useForm(); 30 const [form] = Form.useForm();
30 const [memberOptions, setMemberOptions] = useState<any[]>([]); 31 const [memberOptions, setMemberOptions] = useState<any[]>([]);
31 const [requestInfo, setRequestInfo] = useState<any>(null); 32 const [requestInfo, setRequestInfo] = useState<any>(null);
@@ -201,7 +202,7 @@ export default ({ setVisible, requestId, onClose,type }) =&gt; { @@ -201,7 +202,7 @@ export default ({ setVisible, requestId, onClose,type }) =&gt; {
201 } 202 }
202 values.members = memberObjs; 203 values.members = memberObjs;
203 } 204 }
204 -//预存账号对象封装 205 + //预存账号对象封装
205 if (values.accounts) { 206 if (values.accounts) {
206 let accountObjs: any[] = []; 207 let accountObjs: any[] = [];
207 for (let accountOption of accountOptions) { 208 for (let accountOption of accountOptions) {
@@ -349,214 +350,215 @@ export default ({ setVisible, requestId, onClose,type }) =&gt; { @@ -349,214 +350,215 @@ export default ({ setVisible, requestId, onClose,type }) =&gt; {
349 }} 350 }}
350 /> 351 />
351 </ProForm.Group> 352 </ProForm.Group>
352 - {type==='ADD_ACCOUNT'&& 353 + {type === 'ADD_ACCOUNT' && (
  354 + <ProFormSelect
  355 + name="accounts"
  356 + key="accounts"
  357 + width="lg"
  358 + showSearch
  359 + label="绑定预存账号(可多选)"
  360 + placeholder="请选择预存账号"
  361 + onChange={(_, option) => {
  362 + autoAccountSelectOptions(option);
  363 + }}
  364 + //rules={[{ required: true, message: '请至少选择绑定一个预存账号' }]}
  365 + fieldProps={{
  366 + mode: 'multiple',
  367 + filterOption() {
  368 + return true;
  369 + },
  370 + optionItemRender(item: any) {
  371 + let name =
  372 + item.label +
  373 + ' | ' +
  374 + item.institution +
  375 + ' | ' +
  376 + item.nowMoney +
  377 + '¥' +
  378 + ' | ' +
  379 + item.phone;
  380 + return (
  381 + <div title={name}>
  382 + <span style={{ color: '#333333' }}>{name}</span>
  383 + </div>
  384 + );
  385 + },
  386 + }}
  387 + rules={[{ required: true, message: '请至少添加一个账号' }]}
  388 + debounceTime={1000}
  389 + request={async (value, {}) => {
  390 + const keywords = value.keyWords;
  391 + let body = {
  392 + keywords: keywords,
  393 + pageSize: 20,
  394 + researchGroupId: undefined,
  395 + };
  396 +
  397 + if (requestCount === 1) {
  398 + body.researchGroupId = form.getFieldValue('groupId');
  399 + }
  400 +
  401 + const res = await postCanrdApiUserList({
  402 + data: body,
  403 + });
  404 + let options = res?.data?.data?.map((c: any) => {
  405 + return {
  406 + ...c,
  407 + label: c.realName,
  408 + value: c.uid,
  409 + key: c.uid,
  410 + };
  411 + });
  412 +
  413 + setRequestCount(requestCount + 1);
  414 + return options;
  415 + }}
  416 + />
  417 + )}
  418 + {type !== 'ADD_ACCOUNT' && (
  419 + <>
353 <ProFormSelect 420 <ProFormSelect
354 - name="accounts"  
355 - key="accounts"  
356 - width="lg"  
357 - showSearch  
358 - label="绑定预存账号(可多选)"  
359 - placeholder="请选择预存账号"  
360 - onChange={(_, option) => {  
361 - autoAccountSelectOptions(option);  
362 - }}  
363 - //rules={[{ required: true, message: '请至少选择绑定一个预存账号' }]}  
364 - fieldProps={{  
365 - mode: 'multiple',  
366 - filterOption() {  
367 - return true;  
368 - },  
369 - optionItemRender(item: any) {  
370 - let name =  
371 - item.label +  
372 - ' | ' +  
373 - item.institution +  
374 - ' | ' +  
375 - item.nowMoney +  
376 - '¥' +  
377 - ' | ' +  
378 - item.phone;  
379 - return (  
380 - <div title={name}>  
381 - <span style={{ color: '#333333' }}>{name}</span>  
382 - </div>  
383 - );  
384 - },  
385 - }}  
386 - rules={[{ required: true, message: '请至少添加一个账号' }]}  
387 - debounceTime={1000}  
388 - request={async (value, {}) => {  
389 - const keywords = value.keyWords;  
390 - let body = {  
391 - keywords: keywords,  
392 - pageSize: 20,  
393 - researchGroupId: undefined,  
394 - };  
395 -  
396 - if (requestCount === 1) {  
397 - body.researchGroupId = form.getFieldValue('groupId');  
398 - }  
399 -  
400 - const res = await postCanrdApiUserList({  
401 - data: body,  
402 - });  
403 - let options = res?.data?.data?.map((c: any) => {  
404 - return {  
405 - ...c,  
406 - label: c.realName,  
407 - value: c.uid,  
408 - key: c.uid,  
409 - };  
410 - });  
411 -  
412 - setRequestCount(requestCount + 1);  
413 - return options;  
414 - }} 421 + name="members"
  422 + key="members"
  423 + width="lg"
  424 + showSearch
  425 + label="课题组成员"
  426 + placeholder="请添加课题组成员"
  427 + rules={[{ required: true, message: '请至少添加一个成员' }]}
  428 + fieldProps={{
  429 + mode: 'multiple',
  430 + filterOption() {
  431 + return true;
  432 + },
  433 + optionItemRender(item: any) {
  434 + let name = item.realName + ' | ' + item.phone;
  435 + return (
  436 + <div title={name}>
  437 + <span style={{ color: '#333333' }}>{name}</span>
  438 + </div>
  439 + );
  440 + },
  441 + }}
  442 + options={memberOptions}
415 /> 443 />
416 - }  
417 - {  
418 - type!=='ADD_ACCOUNT'&&  
419 - <>  
420 - <ProFormSelect  
421 - name="members"  
422 - key="members"  
423 - width="lg"  
424 - showSearch  
425 - label="课题组成员"  
426 - placeholder="请添加课题组成员"  
427 - rules={[{ required: true, message: '请至少添加一个成员' }]}  
428 - fieldProps={{  
429 - mode: 'multiple',  
430 - filterOption() {  
431 - return true;  
432 - },  
433 - optionItemRender(item: any) {  
434 - let name = item.realName + ' | ' + item.phone;  
435 - return (  
436 - <div title={name}>  
437 - <span style={{ color: '#333333' }}>{name}</span> 444 +
  445 + <ProCard
  446 + title="选择或自定义课题组成员信息"
  447 + bordered
  448 + tooltip="从【客户信息】选择框中可以直接搜索客户,选中后自动添加到【课题组成员】中。也可以自定义输入【客户名称】和【手机号】,点击添加按钮手动添加到【课题组成员】中。"
  449 + >
  450 + <ProForm.Group>
  451 + <ProFormSelect
  452 + key="customerName"
  453 + label="客户信息(选择)"
  454 + width="lg"
  455 + showSearch
  456 + name="customerName"
  457 + placeholder="请选择客户信息"
  458 + onChange={(_, option) => {
  459 + autoFillCustomerInfo(option);
  460 + }}
  461 + fieldProps={{
  462 + filterOption() {
  463 + return true;
  464 + },
  465 + optionItemRender(item: any) {
  466 + if (item.type === 'add') {
  467 + return (
  468 + <div title={item.name + '(新增客户)'}>
  469 + <span style={{ color: '#333333' }}>
  470 + {item.name}
  471 + </span>
  472 + {' | '}
  473 + <span style={{ color: 'orange' }}>自定义</span>
  474 + </div>
  475 + );
  476 + }
  477 +
  478 + let title = '';
  479 + let spanText = '';
  480 + let realName = item.realName;
  481 + let phone = item.phone;
  482 +
  483 + title =
  484 + getDefaultString(realName) +
  485 + '|' +
  486 + getDefaultString(phone);
  487 +
  488 + spanText =
  489 + getDefaultString(realName) +
  490 + '|' +
  491 + getDefaultString(phone);
  492 + return (
  493 + <div title={title}>
  494 + <span style={{ color: '#333333' }}>{spanText}</span>
438 </div> 495 </div>
439 - );  
440 - }, 496 + );
  497 + },
  498 + }}
  499 + debounceTime={1000}
  500 + request={async (value, {}) => {
  501 + const keywords = value.keyWords;
  502 + if (keywords === '') {
  503 + return [];
  504 + }
  505 + const res = await postCanrdApiUserAddressList({
  506 + data: { keywords: keywords },
  507 + });
  508 + let options = res?.data?.map((c: any) => {
  509 + return {
  510 + ...c,
  511 + label: c.name,
  512 + value: c.id,
  513 + key: c.id,
  514 + };
  515 + });
  516 +
  517 + //对options去重,realName和phone唯一
  518 + options = deduplicateOptions(options);
  519 +
  520 + //第一个商品默认为要新增客户
  521 + if (keywords.trim() !== '') {
  522 + options.unshift({
  523 + name: keywords,
  524 + type: 'add',
  525 + label: keywords,
  526 + value: 3.1415926,
  527 + key: keywords,
  528 + });
  529 + }
  530 +
  531 + return options;
  532 + }}
  533 + />
  534 + </ProForm.Group>
  535 +
  536 + <ProForm.Group>
  537 + <ProFormText
  538 + name="realName"
  539 + label="客户名称(自定义)"
  540 + placeholder="请输入客户名称"
  541 + rules={[{ required: false, message: '请输入客户名称' }]}
  542 + />
  543 + <ProFormText
  544 + name="phone"
  545 + label="手机号(自定义)"
  546 + width="md"
  547 + placeholder="请输入手机号"
  548 + rules={[{ required: false, message: '请输入手机号' }]}
  549 + />
  550 + </ProForm.Group>
  551 + <Button
  552 + type="primary"
  553 + onClick={() => {
  554 + addCustomMember();
441 }} 555 }}
442 - options={memberOptions}  
443 - />  
444 -  
445 - <ProCard  
446 - title="选择或自定义课题组成员信息"  
447 - bordered  
448 - tooltip="从【客户信息】选择框中可以直接搜索客户,选中后自动添加到【课题组成员】中。也可以自定义输入【客户名称】和【手机号】,点击添加按钮手动添加到【课题组成员】中。"  
449 > 556 >
450 - <ProForm.Group>  
451 - <ProFormSelect  
452 - key="customerName"  
453 - label="客户信息(选择)"  
454 - width="lg"  
455 - showSearch  
456 - name="customerName"  
457 - placeholder="请选择客户信息"  
458 - onChange={(_, option) => {  
459 - autoFillCustomerInfo(option);  
460 - }}  
461 - fieldProps={{  
462 - filterOption() {  
463 - return true;  
464 - },  
465 - optionItemRender(item: any) {  
466 - if (item.type === 'add') {  
467 - return (  
468 - <div title={item.name + '(新增客户)'}>  
469 - <span style={{ color: '#333333' }}>{item.name}</span>  
470 - {' | '}  
471 - <span style={{ color: 'orange' }}>自定义</span>  
472 - </div>  
473 - );  
474 - }  
475 -  
476 - let title = '';  
477 - let spanText = '';  
478 - let realName = item.realName;  
479 - let phone = item.phone;  
480 -  
481 - title =  
482 - getDefaultString(realName) +  
483 - '|' +  
484 - getDefaultString(phone);  
485 -  
486 - spanText =  
487 - getDefaultString(realName) +  
488 - '|' +  
489 - getDefaultString(phone);  
490 - return (  
491 - <div title={title}>  
492 - <span style={{ color: '#333333' }}>{spanText}</span>  
493 - </div>  
494 - );  
495 - },  
496 - }}  
497 - debounceTime={1000}  
498 - request={async (value, {}) => {  
499 - const keywords = value.keyWords;  
500 - if (keywords === '') {  
501 - return [];  
502 - }  
503 - const res = await postCanrdApiUserAddressList({  
504 - data: { keywords: keywords },  
505 - });  
506 - let options = res?.data?.map((c: any) => {  
507 - return {  
508 - ...c,  
509 - label: c.name,  
510 - value: c.id,  
511 - key: c.id,  
512 - };  
513 - });  
514 -  
515 - //对options去重,realName和phone唯一  
516 - options = deduplicateOptions(options);  
517 -  
518 - //第一个商品默认为要新增客户  
519 - if (keywords.trim() !== '') {  
520 - options.unshift({  
521 - name: keywords,  
522 - type: 'add',  
523 - label: keywords,  
524 - value: 3.1415926,  
525 - key: keywords,  
526 - });  
527 - }  
528 -  
529 - return options;  
530 - }}  
531 - />  
532 - </ProForm.Group>  
533 -  
534 - <ProForm.Group>  
535 - <ProFormText  
536 - name="realName"  
537 - label="客户名称(自定义)"  
538 - placeholder="请输入客户名称"  
539 - rules={[{ required: false, message: '请输入客户名称' }]}  
540 - />  
541 - <ProFormText  
542 - name="phone"  
543 - label="手机号(自定义)"  
544 - width="md"  
545 - placeholder="请输入手机号"  
546 - rules={[{ required: false, message: '请输入手机号' }]}  
547 - />  
548 - </ProForm.Group>  
549 - <Button  
550 - type="primary"  
551 - onClick={() => {  
552 - addCustomMember();  
553 - }}  
554 - >  
555 - 添加  
556 - </Button>  
557 - </ProCard>  
558 - </>  
559 - } 557 + 添加
  558 + </Button>
  559 + </ProCard>
  560 + </>
  561 + )}
560 562
561 <ProFormTextArea 563 <ProFormTextArea
562 name="requestNotes" 564 name="requestNotes"
src/pages/ResearchGroup/constant.tsx renamed to src/pages/ResearchGroup/ResearchGroup/constant.tsx
src/pages/ResearchGroup/index.css renamed to src/pages/ResearchGroup/ResearchGroup/index.css
src/pages/ResearchGroup/index.less renamed to src/pages/ResearchGroup/ResearchGroup/index.less
src/pages/ResearchGroup/index.tsx renamed to src/pages/ResearchGroup/ResearchGroup/index.tsx
@@ -38,7 +38,7 @@ import { @@ -38,7 +38,7 @@ import {
38 RESEARCH_GROUP_MEMBER_REQUEST_COLUMNS, 38 RESEARCH_GROUP_MEMBER_REQUEST_COLUMNS,
39 } from './constant'; 39 } from './constant';
40 import './index.less'; 40 import './index.less';
41 -const PrepaidPage = () => { 41 +const ResearchGroupListPage = () => {
42 const researchGroupActionRef = useRef<ActionType>(); 42 const researchGroupActionRef = useRef<ActionType>();
43 const memberApplyActionRef = useRef<ActionType>(); 43 const memberApplyActionRef = useRef<ActionType>();
44 const [researchGroupAddModalVisible, setResearchGroupAddModalVisible] = 44 const [researchGroupAddModalVisible, setResearchGroupAddModalVisible] =
@@ -855,4 +855,4 @@ const PrepaidPage = () =&gt; { @@ -855,4 +855,4 @@ const PrepaidPage = () =&gt; {
855 ); 855 );
856 }; 856 };
857 857
858 -export default PrepaidPage; 858 +export default ResearchGroupListPage;
src/pages/ResearchGroup/ResearchGroupAccess/components/AddModal.tsx 0 → 100644
  1 +import { RESPONSE_CODE } from '@/constants/enum';
  2 +import {
  3 + postResearchGroupsAccessAddBlackList,
  4 + postResearchGroupsAccessAddWhiteList,
  5 + postResearchGroupsList,
  6 + postResearchGroupsNameSet,
  7 +} from '@/services';
  8 +import { Form, Input, Modal, Select, message } from 'antd';
  9 +import { forwardRef, useImperativeHandle, useState } from 'react';
  10 +
  11 +import '../index.css';
  12 +
  13 +export type AddModalProps = {
  14 + setVisible: (visible: boolean) => void;
  15 +};
  16 +
  17 +export type AddModalRef = {
  18 + show: (accessType: 'WHITELIST' | 'BLACKLIST', onSuccess: () => void) => void;
  19 +};
  20 +
  21 +const AddModal = forwardRef<AddModalRef, AddModalProps>((props, ref) => {
  22 + const { setVisible } = props;
  23 + const [form] = Form.useForm();
  24 + const [visible, setModalVisible] = useState(false);
  25 + const [loading, setLoading] = useState(false);
  26 + const [accessTypeState, setAccessTypeState] = useState<
  27 + 'WHITELIST' | 'BLACKLIST'
  28 + >('WHITELIST');
  29 + const [onSuccessCallback, setOnSuccessCallback] = useState<() => void>(
  30 + () => {},
  31 + );
  32 + const [groupOptions, setGroupOptions] = useState<
  33 + { label: string; value: string; id: string }[]
  34 + >([]);
  35 + const [companyOptions, setCompanyOptions] = useState<
  36 + { label: string; value: string; id: string }[]
  37 + >([]);
  38 + const [searchLoading, setSearchLoading] = useState(false);
  39 + const [companyLoading, setCompanyLoading] = useState(false);
  40 +
  41 + useImperativeHandle(ref, () => ({
  42 + show: (accessType, onSuccess) => {
  43 + form.resetFields();
  44 + setAccessTypeState(accessType);
  45 + setOnSuccessCallback(() => onSuccess);
  46 + setModalVisible(true);
  47 + // 重置选项
  48 + setCompanyOptions([]);
  49 + setGroupOptions([]);
  50 + },
  51 + }));
  52 +
  53 + const handleCancel = () => {
  54 + setModalVisible(false);
  55 + setVisible(false);
  56 + };
  57 +
  58 + const handleOk = async () => {
  59 + try {
  60 + const values = await form.validateFields();
  61 + setLoading(true);
  62 +
  63 + const requestData = {
  64 + ...values,
  65 + accessType: accessTypeState,
  66 + };
  67 +
  68 + let res;
  69 + if (accessTypeState === 'WHITELIST') {
  70 + res = await postResearchGroupsAccessAddWhiteList({ data: requestData });
  71 + } else {
  72 + res = await postResearchGroupsAccessAddBlackList({ data: requestData });
  73 + }
  74 +
  75 + if (res && res.result === RESPONSE_CODE.SUCCESS) {
  76 + message.success('添加成功');
  77 + setModalVisible(false);
  78 + setVisible(false);
  79 + onSuccessCallback();
  80 + } else {
  81 + message.error(res?.message || '添加失败');
  82 + }
  83 + } catch (error) {
  84 + console.error('验证表单失败:', error);
  85 + } finally {
  86 + setLoading(false);
  87 + }
  88 + };
  89 +
  90 + // 搜索课题组
  91 + const handleSearch = async (value: string) => {
  92 + if (!value) return;
  93 +
  94 + try {
  95 + setSearchLoading(true);
  96 + // 完全模仿原始代码,使用data包裹参数
  97 + const res = await postResearchGroupsNameSet({
  98 + data: { status: 'ADD_AUDIT_PASS', groupName: value },
  99 + });
  100 +
  101 + if (res?.data) {
  102 + const options = Object.entries(res.data).map(
  103 + ([researchGroupsId, researchGroupsName]) => ({
  104 + label: researchGroupsName as string,
  105 + value: researchGroupsName as string,
  106 + key: researchGroupsId,
  107 + id: researchGroupsId,
  108 + }),
  109 + );
  110 + setGroupOptions(options);
  111 + }
  112 + } catch (error) {
  113 + console.error('获取课题组列表失败', error);
  114 + } finally {
  115 + setSearchLoading(false);
  116 + }
  117 + };
  118 +
  119 + // 根据课题组名称查询单位名称列表
  120 + const fetchCompanyNamesByGroupName = async (groupName: string) => {
  121 + if (!groupName) return;
  122 +
  123 + try {
  124 + setCompanyLoading(true);
  125 + // 使用postResearchGroupsList接口查询单位名称
  126 + const res = await postResearchGroupsList({
  127 + data: {
  128 + current: 1,
  129 + pageSize: 100,
  130 + groupName: groupName,
  131 + },
  132 + });
  133 +
  134 + if (res?.data?.data) {
  135 + // 提取所有相同groupName的不同companyName
  136 + const companySet = new Set<string>();
  137 + const companyIdMap = new Map<string, string>();
  138 +
  139 + res.data.data.forEach((item: any) => {
  140 + if (item.groupName === groupName && item.companyName) {
  141 + companySet.add(item.companyName);
  142 + companyIdMap.set(item.companyName, item.id); // 保存id用于提交
  143 + }
  144 + });
  145 +
  146 + // 转换为选项格式
  147 + const companies = Array.from(companySet).map((name) => ({
  148 + label: name,
  149 + value: name,
  150 + id: companyIdMap.get(name) || '',
  151 + }));
  152 + setCompanyOptions(companies);
  153 + // 如果只有一个选项,自动选中
  154 + if (companies.length === 1) {
  155 + form.setFieldsValue({
  156 + companyName: companies[0].value,
  157 + groupId: companies[0].id,
  158 + });
  159 + }
  160 + }
  161 + } catch (error) {
  162 + console.error('获取单位名称列表失败', error);
  163 + } finally {
  164 + setCompanyLoading(false);
  165 + }
  166 + };
  167 +
  168 + const title =
  169 + accessTypeState === 'WHITELIST' ? '添加课题组白名单' : '添加课题组风险名单';
  170 +
  171 + return (
  172 + <Modal
  173 + title={title}
  174 + open={visible}
  175 + onOk={handleOk}
  176 + onCancel={handleCancel}
  177 + confirmLoading={loading}
  178 + maskClosable={true}
  179 + destroyOnClose
  180 + >
  181 + <Form form={form} layout="vertical" name="add_form" initialValues={{}}>
  182 + <Form.Item name="groupId" style={{ display: 'none' }}>
  183 + <Input type="hidden" />
  184 + </Form.Item>
  185 +
  186 + <Form.Item
  187 + name="groupName"
  188 + label="课题组名称"
  189 + rules={[{ required: true, message: '请输入课题组名称!' }]}
  190 + >
  191 + <Select
  192 + showSearch
  193 + placeholder="请输入名称"
  194 + filterOption={false}
  195 + onSearch={handleSearch}
  196 + loading={searchLoading}
  197 + options={groupOptions}
  198 + onChange={(value, option: any) => {
  199 + // 清空公司选项
  200 + form.setFieldsValue({
  201 + companyName: undefined,
  202 + });
  203 +
  204 + // 保存研究组ID
  205 + if (option) {
  206 + form.setFieldsValue({
  207 + groupId: option.id || '',
  208 + });
  209 +
  210 + // 触发查询关联的单位名称
  211 + fetchCompanyNamesByGroupName(value);
  212 + }
  213 + }}
  214 + />
  215 + </Form.Item>
  216 +
  217 + <Form.Item
  218 + name="companyName"
  219 + label="单位名称"
  220 + rules={[{ required: true, message: '请选择单位名称' }]}
  221 + >
  222 + <Select
  223 + placeholder="请选择单位名称"
  224 + loading={companyLoading}
  225 + options={companyOptions}
  226 + disabled={companyOptions.length === 0}
  227 + onChange={(_, option: any) => {
  228 + if (option && option.id) {
  229 + form.setFieldsValue({
  230 + groupId: option.id,
  231 + });
  232 + }
  233 + }}
  234 + />
  235 + </Form.Item>
  236 +
  237 + <Form.Item name="remark" label="添加原因">
  238 + <Input.TextArea rows={3} placeholder="请输入添加原因" />
  239 + </Form.Item>
  240 + </Form>
  241 + </Modal>
  242 + );
  243 +});
  244 +
  245 +export default AddModal;
src/pages/ResearchGroup/ResearchGroupAccess/constant.tsx 0 → 100644
  1 +import { formatDateTime } from '@/utils';
  2 +
  3 +export const RESEARCH_GROUP_ACCESS_WHITELIST_COLUMNS = [
  4 + {
  5 + title: '序号',
  6 + dataIndex: 'index',
  7 + valueType: 'index',
  8 + width: 70,
  9 + },
  10 + {
  11 + title: 'ID',
  12 + dataIndex: 'id',
  13 + key: 'id',
  14 + hideInSearch: true,
  15 + hideInTable: true,
  16 + },
  17 + {
  18 + title: '课题组名称',
  19 + dataIndex: 'groupName',
  20 + key: 'groupName',
  21 + fieldProps: {
  22 + placeholder: '请输入课题组名称',
  23 + },
  24 + },
  25 + {
  26 + title: '单位名称',
  27 + dataIndex: 'companyName',
  28 + key: 'companyName',
  29 + hideInSearch: true,
  30 + },
  31 + {
  32 + title: '添加原因',
  33 + dataIndex: 'remark',
  34 + key: 'remark',
  35 + hideInSearch: true,
  36 + width: 400,
  37 + },
  38 + {
  39 + title: '添加时间',
  40 + dataIndex: 'createTime',
  41 + key: 'createTime',
  42 + valueType: 'text',
  43 + hideInSearch: true,
  44 + render: (_: any, record: any) =>
  45 + record.createTime ? formatDateTime(record.createTime) : '-',
  46 + },
  47 + {
  48 + title: '添加人',
  49 + dataIndex: 'createByName',
  50 + key: 'createByName',
  51 + hideInSearch: true,
  52 + },
  53 +];
  54 +
  55 +export const RESEARCH_GROUP_ACCESS_BLACKLIST_COLUMNS = [
  56 + {
  57 + title: '序号',
  58 + dataIndex: 'index',
  59 + valueType: 'index',
  60 + width: 70,
  61 + },
  62 + {
  63 + title: 'ID',
  64 + dataIndex: 'id',
  65 + key: 'id',
  66 + hideInSearch: true,
  67 + hideInTable: true,
  68 + },
  69 + {
  70 + title: '课题组名称',
  71 + dataIndex: 'groupName',
  72 + key: 'groupName',
  73 + fieldProps: {
  74 + placeholder: '请输入课题组名称',
  75 + },
  76 + },
  77 + {
  78 + title: '单位名称',
  79 + dataIndex: 'companyName',
  80 + key: 'companyName',
  81 + hideInSearch: true,
  82 + },
  83 + {
  84 + title: '添加原因',
  85 + dataIndex: 'remark',
  86 + key: 'remark',
  87 + hideInSearch: true,
  88 + width: 400,
  89 + },
  90 + {
  91 + title: '添加时间',
  92 + dataIndex: 'createTime',
  93 + key: 'createTime',
  94 + valueType: 'text',
  95 + hideInSearch: true,
  96 + render: (_: any, record: any) =>
  97 + record.createTime ? formatDateTime(record.createTime) : '-',
  98 + },
  99 + {
  100 + title: '添加人',
  101 + dataIndex: 'createByName',
  102 + key: 'createByName',
  103 + hideInSearch: true,
  104 + },
  105 +];
src/pages/ResearchGroup/ResearchGroupAccess/index.css 0 → 100644
  1 +.research-group-index td,
  2 +.research-group-access-container td {
  3 + font-family: 'San Francisco', 'Helvetica Neue', Helvetica, Arial,
  4 + 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'Heiti SC',
  5 + 'WenQuanYi Micro Hei', sans-serif;
  6 + font-size: 13px;
  7 +}
src/pages/ResearchGroup/ResearchGroupAccess/index.less 0 → 100644
  1 +.research-group-access-container {
  2 + width: 100%;
  3 + padding: 16px;
  4 + background-color: #fff;
  5 +
  6 + .ant-pro-table {
  7 + .ant-pro-card-body {
  8 + padding: 16px;
  9 + }
  10 + }
  11 +}
src/pages/ResearchGroup/ResearchGroupAccess/index.tsx 0 → 100644
  1 +import { RESPONSE_CODE } from '@/constants/enum';
  2 +import { getUserInfo } from '@/utils';
  3 +import { PlusOutlined } from '@ant-design/icons';
  4 +import { ActionType, ProTable } from '@ant-design/pro-components';
  5 +import { Button, Popconfirm, Tabs, message } from 'antd';
  6 +import { useMemo, useRef, useState } from 'react';
  7 +
  8 +import {
  9 + postResearchGroupsAccessBlackList,
  10 + postResearchGroupsAccessDeleteBlackList,
  11 + postResearchGroupsAccessDeleteWhiteList,
  12 + postResearchGroupsAccessWhiteList,
  13 +} from '@/services';
  14 +
  15 +import './index.css';
  16 +import './index.less';
  17 +
  18 +import {
  19 + RESEARCH_GROUP_ACCESS_BLACKLIST_COLUMNS,
  20 + RESEARCH_GROUP_ACCESS_WHITELIST_COLUMNS,
  21 +} from './constant';
  22 +
  23 +import AddModal, { AddModalRef } from './components/AddModal';
  24 +
  25 +const ResearchGroupAccessPage = () => {
  26 + const whitelistActionRef = useRef<ActionType>();
  27 + const blacklistActionRef = useRef<ActionType>();
  28 + const [activeKey, setActiveKey] = useState<string>('1');
  29 + const addModalRef = useRef<AddModalRef>(null);
  30 +
  31 + const reloadWhitelistTable = () => {
  32 + whitelistActionRef.current?.reload();
  33 + };
  34 +
  35 + const reloadBlacklistTable = () => {
  36 + blacklistActionRef.current?.reload();
  37 + };
  38 +
  39 + const handleDeleteWhitelist = async (id: number) => {
  40 + const res = await postResearchGroupsAccessDeleteWhiteList({ data: { id } });
  41 + if (res && res.result === RESPONSE_CODE.SUCCESS) {
  42 + message.success('删除成功');
  43 + reloadWhitelistTable();
  44 + } else {
  45 + message.error(res?.message || '删除失败');
  46 + }
  47 + };
  48 +
  49 + const handleDeleteBlacklist = async (id: number) => {
  50 + const res = await postResearchGroupsAccessDeleteBlackList({ data: { id } });
  51 + if (res && res.result === RESPONSE_CODE.SUCCESS) {
  52 + message.success('删除成功');
  53 + reloadBlacklistTable();
  54 + } else {
  55 + message.error(res?.message || '删除失败');
  56 + }
  57 + };
  58 +
  59 + const handleAddClick = () => {
  60 + const accessType = activeKey === '1' ? 'WHITELIST' : 'BLACKLIST';
  61 + const onSuccess =
  62 + activeKey === '1' ? reloadWhitelistTable : reloadBlacklistTable;
  63 + addModalRef.current?.show(accessType, onSuccess);
  64 + };
  65 +
  66 + const WhitelistTab = () => {
  67 + // Check if the current user has permission to add/delete
  68 + const hasPermission = useMemo(() => {
  69 + const userInfo = getUserInfo();
  70 + return userInfo?.username === 'canrd' || userInfo?.username === 'D-Tina';
  71 + }, []);
  72 + return (
  73 + <ProTable
  74 + actionRef={whitelistActionRef}
  75 + rowKey="id"
  76 + search={{
  77 + labelWidth: 120,
  78 + defaultCollapsed: false,
  79 + }}
  80 + pagination={{
  81 + pageSize: 10,
  82 + }}
  83 + toolBarRender={() =>
  84 + hasPermission
  85 + ? [
  86 + <Button key="add" type="primary" onClick={handleAddClick}>
  87 + <PlusOutlined /> 添加
  88 + </Button>,
  89 + ]
  90 + : []
  91 + }
  92 + request={async (params) => {
  93 + const { current, pageSize, ...rest } = params;
  94 + const res = await postResearchGroupsAccessWhiteList({
  95 + data: {
  96 + current: current || 1,
  97 + pageSize: pageSize || 10,
  98 + ...rest,
  99 + },
  100 + });
  101 + if (res && res.result === RESPONSE_CODE.SUCCESS) {
  102 + return {
  103 + data: res.data?.data || [],
  104 + success: true,
  105 + total: res.data?.total || 0,
  106 + };
  107 + }
  108 + return {
  109 + data: [],
  110 + success: false,
  111 + total: 0,
  112 + };
  113 + }}
  114 + columns={[
  115 + ...RESEARCH_GROUP_ACCESS_WHITELIST_COLUMNS,
  116 + {
  117 + title: '操作',
  118 + dataIndex: 'option',
  119 + valueType: 'option',
  120 + render: (_, record) =>
  121 + hasPermission
  122 + ? [
  123 + <Popconfirm
  124 + key="delete"
  125 + title="确定要删除吗?"
  126 + onConfirm={() => handleDeleteWhitelist(record.id)}
  127 + >
  128 + <a style={{ color: '#ff4d4f' }}>删除</a>
  129 + </Popconfirm>,
  130 + ]
  131 + : [],
  132 + },
  133 + ]}
  134 + />
  135 + );
  136 + };
  137 +
  138 + const BlacklistTab = () => {
  139 + // Check if the current user has permission to add/delete
  140 + const hasPermission = useMemo(() => {
  141 + const userInfo = getUserInfo();
  142 + return userInfo?.username === 'canrd' || userInfo?.username === 'D-Tina';
  143 + }, []);
  144 + return (
  145 + <ProTable
  146 + actionRef={blacklistActionRef}
  147 + rowKey="id"
  148 + search={{
  149 + labelWidth: 120,
  150 + defaultCollapsed: false,
  151 + }}
  152 + pagination={{
  153 + pageSize: 10,
  154 + }}
  155 + toolBarRender={() =>
  156 + hasPermission
  157 + ? [
  158 + <Button key="add" type="primary" onClick={handleAddClick}>
  159 + <PlusOutlined /> 添加
  160 + </Button>,
  161 + ]
  162 + : []
  163 + }
  164 + request={async (params) => {
  165 + const { current, pageSize, ...rest } = params;
  166 + const res = await postResearchGroupsAccessBlackList({
  167 + data: {
  168 + current: current || 1,
  169 + pageSize: pageSize || 10,
  170 + ...rest,
  171 + },
  172 + });
  173 + if (res && res.result === RESPONSE_CODE.SUCCESS) {
  174 + return {
  175 + data: res.data?.data || [],
  176 + success: true,
  177 + total: res.data?.total || 0,
  178 + };
  179 + }
  180 + return {
  181 + data: [],
  182 + success: false,
  183 + total: 0,
  184 + };
  185 + }}
  186 + columns={[
  187 + ...RESEARCH_GROUP_ACCESS_BLACKLIST_COLUMNS,
  188 + {
  189 + title: '操作',
  190 + dataIndex: 'option',
  191 + valueType: 'option',
  192 + render: (_, record) =>
  193 + hasPermission
  194 + ? [
  195 + <Popconfirm
  196 + key="delete"
  197 + title="确定要删除吗?"
  198 + onConfirm={() => handleDeleteBlacklist(record.id)}
  199 + >
  200 + <a style={{ color: '#ff4d4f' }}>删除</a>
  201 + </Popconfirm>,
  202 + ]
  203 + : [],
  204 + },
  205 + ]}
  206 + />
  207 + );
  208 + };
  209 +
  210 + // 空函数保留作为回调,但不做任何操作
  211 + // eslint-disable-next-line @typescript-eslint/no-unused-vars
  212 + const setAddModalVisible = (_: boolean) => {
  213 + // 我们不再需要在父组件中跟踪模态框状态
  214 + };
  215 +
  216 + return (
  217 + <div className="research-group-index">
  218 + <Tabs
  219 + defaultActiveKey="whitelist"
  220 + onChange={setActiveKey}
  221 + items={[
  222 + {
  223 + key: 'whitelist',
  224 + label: '课题组白名单',
  225 + children: <WhitelistTab />,
  226 + },
  227 + {
  228 + key: 'blacklist',
  229 + label: '课题组风险名单',
  230 + children: <BlacklistTab />,
  231 + },
  232 + ]}
  233 + />
  234 + <AddModal ref={addModalRef} setVisible={setAddModalVisible} />
  235 + </div>
  236 + );
  237 +};
  238 +
  239 +export default ResearchGroupAccessPage;
src/services/definition.ts
@@ -4099,6 +4099,79 @@ export interface ResearchGroupRequestsDto { @@ -4099,6 +4099,79 @@ export interface ResearchGroupRequestsDto {
4099 updateTime?: string; 4099 updateTime?: string;
4100 } 4100 }
4101 4101
  4102 +export interface ResearchGroupsAccessDTO {
  4103 + /**
  4104 + * @description
  4105 + * 访问类型: WHITELIST, BLACKLIST
  4106 + */
  4107 + accessType?: string;
  4108 + /**
  4109 + * @description
  4110 + * 单位名称
  4111 + */
  4112 + companyName?: string;
  4113 + /**
  4114 + * @description
  4115 + * 创建人ID
  4116 + */
  4117 + createBy?: string;
  4118 + /**
  4119 + * @description
  4120 + * 创建人姓名
  4121 + */
  4122 + createByName?: string;
  4123 + /**
  4124 + * @description
  4125 + * 创建时间
  4126 + * @format date-time
  4127 + */
  4128 + createTime?: string;
  4129 + /**
  4130 + * @description
  4131 + * 删除标志
  4132 + * @format int32
  4133 + */
  4134 + deleteFlag?: number;
  4135 + /**
  4136 + * @description
  4137 + * 课题组名称
  4138 + */
  4139 + groupName?: string;
  4140 + /**
  4141 + * @description
  4142 + * 主键id
  4143 + * @format int64
  4144 + */
  4145 + id?: number;
  4146 + /**
  4147 + * @description
  4148 + * 添加原因
  4149 + */
  4150 + remark?: string;
  4151 + /**
  4152 + * @description
  4153 + * 更新人ID
  4154 + */
  4155 + updateBy?: string;
  4156 + /**
  4157 + * @description
  4158 + * 更新人姓名
  4159 + */
  4160 + updateByName?: string;
  4161 + /**
  4162 + * @description
  4163 + * 更新时间
  4164 + * @format date-time
  4165 + */
  4166 + updateTime?: string;
  4167 + /**
  4168 + * @description
  4169 + * 版本号
  4170 + * @format int32
  4171 + */
  4172 + version?: number;
  4173 +}
  4174 +
4102 export interface ResearchGroupsDTO { 4175 export interface ResearchGroupsDTO {
4103 accounts?: Array<ResearchGroupAccounts>; 4176 accounts?: Array<ResearchGroupAccounts>;
4104 /** 4177 /**
@@ -5609,6 +5682,13 @@ export interface SalesRechargePrepaymentUpdateRequest { @@ -5609,6 +5682,13 @@ export interface SalesRechargePrepaymentUpdateRequest {
5609 salesCode?: string; 5682 salesCode?: string;
5610 } 5683 }
5611 5684
  5685 +export interface ServerResultTsgBoolean {
  5686 + data?: boolean;
  5687 + message?: string;
  5688 + /** @format int32 */
  5689 + result?: number;
  5690 +}
  5691 +
5612 /** 5692 /**
5613 * @description 5693 * @description
5614 * 开票添加对象 5694 * 开票添加对象
src/services/request.ts
@@ -134,6 +134,7 @@ import type { @@ -134,6 +134,7 @@ import type {
134 ResearchGroupMemberRequestDetailRequest, 134 ResearchGroupMemberRequestDetailRequest,
135 ResearchGroupMemberRequestsRequest, 135 ResearchGroupMemberRequestsRequest,
136 ResearchGroupRequestsDto, 136 ResearchGroupRequestsDto,
  137 + ResearchGroupsAccessDTO,
137 ResearchGroupsDTO, 138 ResearchGroupsDTO,
138 ResetPwdVO, 139 ResetPwdVO,
139 SalOrderSaveDto, 140 SalOrderSaveDto,
@@ -144,6 +145,7 @@ import type { @@ -144,6 +145,7 @@ import type {
144 SalesRechargePrepaymentUpdateRequest, 145 SalesRechargePrepaymentUpdateRequest,
145 SaveReply, 146 SaveReply,
146 ServerResult, 147 ServerResult,
  148 + ServerResultTsgBoolean,
147 ShippingWarehouseChangeDto, 149 ShippingWarehouseChangeDto,
148 StoreOrderInvoiceRequest, 150 StoreOrderInvoiceRequest,
149 SysLogQueryVO, 151 SysLogQueryVO,
@@ -14332,6 +14334,432 @@ export const postResearchGroupMemberRequestsList = /* #__PURE__ */ (() =&gt; { @@ -14332,6 +14334,432 @@ export const postResearchGroupMemberRequestsList = /* #__PURE__ */ (() =&gt; {
14332 return request; 14334 return request;
14333 })(); 14335 })();
14334 14336
  14337 +/** @description request parameter type for postResearchGroupsAccessAddBlackList */
  14338 +export interface PostResearchGroupsAccessAddBlackListOption {
  14339 + /**
  14340 + * @description
  14341 + * request
  14342 + */
  14343 + body: {
  14344 + /**
  14345 + @description
  14346 + request */
  14347 + request: ResearchGroupsAccessDTO;
  14348 + };
  14349 +}
  14350 +
  14351 +/** @description response type for postResearchGroupsAccessAddBlackList */
  14352 +export interface PostResearchGroupsAccessAddBlackListResponse {
  14353 + /**
  14354 + * @description
  14355 + * OK
  14356 + */
  14357 + 200: ServerResultTsgBoolean;
  14358 + /**
  14359 + * @description
  14360 + * Created
  14361 + */
  14362 + 201: any;
  14363 + /**
  14364 + * @description
  14365 + * Unauthorized
  14366 + */
  14367 + 401: any;
  14368 + /**
  14369 + * @description
  14370 + * Forbidden
  14371 + */
  14372 + 403: any;
  14373 + /**
  14374 + * @description
  14375 + * Not Found
  14376 + */
  14377 + 404: any;
  14378 +}
  14379 +
  14380 +export type PostResearchGroupsAccessAddBlackListResponseSuccess =
  14381 + PostResearchGroupsAccessAddBlackListResponse[200];
  14382 +/**
  14383 + * @description
  14384 + * 添加黑名单
  14385 + * @tags research-groups-access-controller
  14386 + * @produces *
  14387 + * @consumes application/json
  14388 + */
  14389 +export const postResearchGroupsAccessAddBlackList = /* #__PURE__ */ (() => {
  14390 + const method = 'post';
  14391 + const url = '/research/groups/access/addBlackList';
  14392 + function request(
  14393 + option: PostResearchGroupsAccessAddBlackListOption,
  14394 + ): Promise<PostResearchGroupsAccessAddBlackListResponseSuccess> {
  14395 + return requester(request.url, {
  14396 + method: request.method,
  14397 + ...option,
  14398 + }) as unknown as Promise<PostResearchGroupsAccessAddBlackListResponseSuccess>;
  14399 + }
  14400 +
  14401 + /** http method */
  14402 + request.method = method;
  14403 + /** request url */
  14404 + request.url = url;
  14405 + return request;
  14406 +})();
  14407 +
  14408 +/** @description request parameter type for postResearchGroupsAccessAddWhiteList */
  14409 +export interface PostResearchGroupsAccessAddWhiteListOption {
  14410 + /**
  14411 + * @description
  14412 + * request
  14413 + */
  14414 + body: {
  14415 + /**
  14416 + @description
  14417 + request */
  14418 + request: ResearchGroupsAccessDTO;
  14419 + };
  14420 +}
  14421 +
  14422 +/** @description response type for postResearchGroupsAccessAddWhiteList */
  14423 +export interface PostResearchGroupsAccessAddWhiteListResponse {
  14424 + /**
  14425 + * @description
  14426 + * OK
  14427 + */
  14428 + 200: ServerResultTsgBoolean;
  14429 + /**
  14430 + * @description
  14431 + * Created
  14432 + */
  14433 + 201: any;
  14434 + /**
  14435 + * @description
  14436 + * Unauthorized
  14437 + */
  14438 + 401: any;
  14439 + /**
  14440 + * @description
  14441 + * Forbidden
  14442 + */
  14443 + 403: any;
  14444 + /**
  14445 + * @description
  14446 + * Not Found
  14447 + */
  14448 + 404: any;
  14449 +}
  14450 +
  14451 +export type PostResearchGroupsAccessAddWhiteListResponseSuccess =
  14452 + PostResearchGroupsAccessAddWhiteListResponse[200];
  14453 +/**
  14454 + * @description
  14455 + * 添加白名单
  14456 + * @tags research-groups-access-controller
  14457 + * @produces *
  14458 + * @consumes application/json
  14459 + */
  14460 +export const postResearchGroupsAccessAddWhiteList = /* #__PURE__ */ (() => {
  14461 + const method = 'post';
  14462 + const url = '/research/groups/access/addWhiteList';
  14463 + function request(
  14464 + option: PostResearchGroupsAccessAddWhiteListOption,
  14465 + ): Promise<PostResearchGroupsAccessAddWhiteListResponseSuccess> {
  14466 + return requester(request.url, {
  14467 + method: request.method,
  14468 + ...option,
  14469 + }) as unknown as Promise<PostResearchGroupsAccessAddWhiteListResponseSuccess>;
  14470 + }
  14471 +
  14472 + /** http method */
  14473 + request.method = method;
  14474 + /** request url */
  14475 + request.url = url;
  14476 + return request;
  14477 +})();
  14478 +
  14479 +/** @description request parameter type for postResearchGroupsAccessBlackList */
  14480 +export interface PostResearchGroupsAccessBlackListOption {
  14481 + /**
  14482 + * @description
  14483 + * request
  14484 + */
  14485 + body: {
  14486 + /**
  14487 + @description
  14488 + request */
  14489 + request: ResearchGroupListRequest;
  14490 + };
  14491 +}
  14492 +
  14493 +/** @description response type for postResearchGroupsAccessBlackList */
  14494 +export interface PostResearchGroupsAccessBlackListResponse {
  14495 + /**
  14496 + * @description
  14497 + * OK
  14498 + */
  14499 + 200: ServerResult;
  14500 + /**
  14501 + * @description
  14502 + * Created
  14503 + */
  14504 + 201: any;
  14505 + /**
  14506 + * @description
  14507 + * Unauthorized
  14508 + */
  14509 + 401: any;
  14510 + /**
  14511 + * @description
  14512 + * Forbidden
  14513 + */
  14514 + 403: any;
  14515 + /**
  14516 + * @description
  14517 + * Not Found
  14518 + */
  14519 + 404: any;
  14520 +}
  14521 +
  14522 +export type PostResearchGroupsAccessBlackListResponseSuccess =
  14523 + PostResearchGroupsAccessBlackListResponse[200];
  14524 +/**
  14525 + * @description
  14526 + * 查询黑名单列表
  14527 + * @tags research-groups-access-controller
  14528 + * @produces *
  14529 + * @consumes application/json
  14530 + */
  14531 +export const postResearchGroupsAccessBlackList = /* #__PURE__ */ (() => {
  14532 + const method = 'post';
  14533 + const url = '/research/groups/access/blackList';
  14534 + function request(
  14535 + option: PostResearchGroupsAccessBlackListOption,
  14536 + ): Promise<PostResearchGroupsAccessBlackListResponseSuccess> {
  14537 + return requester(request.url, {
  14538 + method: request.method,
  14539 + ...option,
  14540 + }) as unknown as Promise<PostResearchGroupsAccessBlackListResponseSuccess>;
  14541 + }
  14542 +
  14543 + /** http method */
  14544 + request.method = method;
  14545 + /** request url */
  14546 + request.url = url;
  14547 + return request;
  14548 +})();
  14549 +
  14550 +/** @description request parameter type for postResearchGroupsAccessDeleteBlackList */
  14551 +export interface PostResearchGroupsAccessDeleteBlackListOption {
  14552 + /**
  14553 + * @description
  14554 + * request
  14555 + */
  14556 + body: {
  14557 + /**
  14558 + @description
  14559 + request */
  14560 + request: ResearchGroupsAccessDTO;
  14561 + };
  14562 +}
  14563 +
  14564 +/** @description response type for postResearchGroupsAccessDeleteBlackList */
  14565 +export interface PostResearchGroupsAccessDeleteBlackListResponse {
  14566 + /**
  14567 + * @description
  14568 + * OK
  14569 + */
  14570 + 200: ServerResultTsgBoolean;
  14571 + /**
  14572 + * @description
  14573 + * Created
  14574 + */
  14575 + 201: any;
  14576 + /**
  14577 + * @description
  14578 + * Unauthorized
  14579 + */
  14580 + 401: any;
  14581 + /**
  14582 + * @description
  14583 + * Forbidden
  14584 + */
  14585 + 403: any;
  14586 + /**
  14587 + * @description
  14588 + * Not Found
  14589 + */
  14590 + 404: any;
  14591 +}
  14592 +
  14593 +export type PostResearchGroupsAccessDeleteBlackListResponseSuccess =
  14594 + PostResearchGroupsAccessDeleteBlackListResponse[200];
  14595 +/**
  14596 + * @description
  14597 + * 删除黑名单
  14598 + * @tags research-groups-access-controller
  14599 + * @produces *
  14600 + * @consumes application/json
  14601 + */
  14602 +export const postResearchGroupsAccessDeleteBlackList = /* #__PURE__ */ (() => {
  14603 + const method = 'post';
  14604 + const url = '/research/groups/access/deleteBlackList';
  14605 + function request(
  14606 + option: PostResearchGroupsAccessDeleteBlackListOption,
  14607 + ): Promise<PostResearchGroupsAccessDeleteBlackListResponseSuccess> {
  14608 + return requester(request.url, {
  14609 + method: request.method,
  14610 + ...option,
  14611 + }) as unknown as Promise<PostResearchGroupsAccessDeleteBlackListResponseSuccess>;
  14612 + }
  14613 +
  14614 + /** http method */
  14615 + request.method = method;
  14616 + /** request url */
  14617 + request.url = url;
  14618 + return request;
  14619 +})();
  14620 +
  14621 +/** @description request parameter type for postResearchGroupsAccessDeleteWhiteList */
  14622 +export interface PostResearchGroupsAccessDeleteWhiteListOption {
  14623 + /**
  14624 + * @description
  14625 + * request
  14626 + */
  14627 + body: {
  14628 + /**
  14629 + @description
  14630 + request */
  14631 + request: ResearchGroupsAccessDTO;
  14632 + };
  14633 +}
  14634 +
  14635 +/** @description response type for postResearchGroupsAccessDeleteWhiteList */
  14636 +export interface PostResearchGroupsAccessDeleteWhiteListResponse {
  14637 + /**
  14638 + * @description
  14639 + * OK
  14640 + */
  14641 + 200: ServerResultTsgBoolean;
  14642 + /**
  14643 + * @description
  14644 + * Created
  14645 + */
  14646 + 201: any;
  14647 + /**
  14648 + * @description
  14649 + * Unauthorized
  14650 + */
  14651 + 401: any;
  14652 + /**
  14653 + * @description
  14654 + * Forbidden
  14655 + */
  14656 + 403: any;
  14657 + /**
  14658 + * @description
  14659 + * Not Found
  14660 + */
  14661 + 404: any;
  14662 +}
  14663 +
  14664 +export type PostResearchGroupsAccessDeleteWhiteListResponseSuccess =
  14665 + PostResearchGroupsAccessDeleteWhiteListResponse[200];
  14666 +/**
  14667 + * @description
  14668 + * 删除白名单
  14669 + * @tags research-groups-access-controller
  14670 + * @produces *
  14671 + * @consumes application/json
  14672 + */
  14673 +export const postResearchGroupsAccessDeleteWhiteList = /* #__PURE__ */ (() => {
  14674 + const method = 'post';
  14675 + const url = '/research/groups/access/deleteWhiteList';
  14676 + function request(
  14677 + option: PostResearchGroupsAccessDeleteWhiteListOption,
  14678 + ): Promise<PostResearchGroupsAccessDeleteWhiteListResponseSuccess> {
  14679 + return requester(request.url, {
  14680 + method: request.method,
  14681 + ...option,
  14682 + }) as unknown as Promise<PostResearchGroupsAccessDeleteWhiteListResponseSuccess>;
  14683 + }
  14684 +
  14685 + /** http method */
  14686 + request.method = method;
  14687 + /** request url */
  14688 + request.url = url;
  14689 + return request;
  14690 +})();
  14691 +
  14692 +/** @description request parameter type for postResearchGroupsAccessWhiteList */
  14693 +export interface PostResearchGroupsAccessWhiteListOption {
  14694 + /**
  14695 + * @description
  14696 + * request
  14697 + */
  14698 + body: {
  14699 + /**
  14700 + @description
  14701 + request */
  14702 + request: ResearchGroupListRequest;
  14703 + };
  14704 +}
  14705 +
  14706 +/** @description response type for postResearchGroupsAccessWhiteList */
  14707 +export interface PostResearchGroupsAccessWhiteListResponse {
  14708 + /**
  14709 + * @description
  14710 + * OK
  14711 + */
  14712 + 200: ServerResult;
  14713 + /**
  14714 + * @description
  14715 + * Created
  14716 + */
  14717 + 201: any;
  14718 + /**
  14719 + * @description
  14720 + * Unauthorized
  14721 + */
  14722 + 401: any;
  14723 + /**
  14724 + * @description
  14725 + * Forbidden
  14726 + */
  14727 + 403: any;
  14728 + /**
  14729 + * @description
  14730 + * Not Found
  14731 + */
  14732 + 404: any;
  14733 +}
  14734 +
  14735 +export type PostResearchGroupsAccessWhiteListResponseSuccess =
  14736 + PostResearchGroupsAccessWhiteListResponse[200];
  14737 +/**
  14738 + * @description
  14739 + * 查询白名单列表
  14740 + * @tags research-groups-access-controller
  14741 + * @produces *
  14742 + * @consumes application/json
  14743 + */
  14744 +export const postResearchGroupsAccessWhiteList = /* #__PURE__ */ (() => {
  14745 + const method = 'post';
  14746 + const url = '/research/groups/access/whiteList';
  14747 + function request(
  14748 + option: PostResearchGroupsAccessWhiteListOption,
  14749 + ): Promise<PostResearchGroupsAccessWhiteListResponseSuccess> {
  14750 + return requester(request.url, {
  14751 + method: request.method,
  14752 + ...option,
  14753 + }) as unknown as Promise<PostResearchGroupsAccessWhiteListResponseSuccess>;
  14754 + }
  14755 +
  14756 + /** http method */
  14757 + request.method = method;
  14758 + /** request url */
  14759 + request.url = url;
  14760 + return request;
  14761 +})();
  14762 +
14335 /** @description request parameter type for postResearchGroupsAdd */ 14763 /** @description request parameter type for postResearchGroupsAdd */
14336 export interface PostResearchGroupsAddOption { 14764 export interface PostResearchGroupsAddOption {
14337 /** 14765 /**