Commit 84323eed4c1cf9741497897b043b278f9e4a4bab

Authored by 曾国涛
2 parents 19ca3d46 5f016613

Merge branch 'warning' of http://39.108.227.113:8001/zhusen/canrd-erp-front into warning

Showing 47 changed files with 8994 additions and 7559 deletions
.umirc.ts
... ... @@ -141,10 +141,21 @@ export default defineConfig({
141 141 },
142 142 {
143 143 name: '客户管理',
144   - path: '/client',
145   - component: './Client',
  144 + path: '/Client',
146 145 icon: 'BookOutlined',
147 146 access: 'canReadAdminAndSales',
  147 + routes: [
  148 + {
  149 + name: '客户列表',
  150 + path: 'clint',
  151 + component: './Client/Client',
  152 + },
  153 + {
  154 + name: '跟进记录',
  155 + path: 'FollowRecord',
  156 + component: './Client/FollowRecord',
  157 + },
  158 + ],
148 159 },
149 160 {
150 161 name: '打印',
... ...
dist.zip 0 → 100644
No preview for this file type
order-erp.service-1.0-SNAPSHOT.jar 0 → 100644
No preview for this file type
src/pages/Client/Components/ClientDrawer.tsx renamed to src/pages/Client/Client/Components/ClientDrawer.tsx
... ... @@ -6,23 +6,34 @@ import {
6 6 postDistrictSelectByNameAndLevel,
7 7 postDistrictSelOrderProvince,
8 8 postServiceConstClientLevels,
  9 + postServiceConstClientSource,
9 10 postServiceConstTradeStatus,
10 11 } from '@/services';
  12 +
11 13 import { enumToSelect } from '@/utils';
12 14 import {
13 15 DrawerForm,
14   - ProFormDateTimePicker,
  16 + ProFormDatePicker,
15 17 ProFormSelect,
16 18 ProFormText,
17 19 } from '@ant-design/pro-components';
18 20 import { Button, Form, message } from 'antd';
  21 +// import { options } from 'node_modules/axios/index.cjs';
19 22 import { useState } from 'react';
20 23  
21 24 export default ({ optType, record, onFinish }) => {
22 25 const [form] = Form.useForm();
  26 + const requirementsEnum = {
  27 + EXPERIMENTAL_EQUIPMENT: '实验设备',
  28 + EXPERIMENTAL_MATERIALS: '实验材料',
  29 + OTHER: '其他',
  30 + PILOT_TEST_VALIDATION_SERVICES: '中式验证服务',
  31 + };
23 32 //省市区
24 33 const [province, setProvince] = useState('');
25 34 const [city, setCity] = useState('');
  35 + const [showReferrers, setShowReferrers] = useState(false); // 控制显示的状态,初始为false
  36 + const [showQuoteDatetime, setShowQuoteDatetime] = useState(false); // 控制显示的状态,初始为false
26 37 const optTypeEnum = {
27 38 add: {
28 39 text: '新增',
... ... @@ -42,7 +53,7 @@ export default ({ optType, record, onFinish }) => {
42 53 },
43 54 edit: {
44 55 text: '编辑',
45   - button: <a type="primary">编辑</a>,
  56 + button: <a type="link">编辑</a>,
46 57 readonly: false,
47 58 onFinish: async (values) => {
48 59 const res = await postAdminClientModifyClientInfo({
... ... @@ -58,11 +69,43 @@ export default ({ optType, record, onFinish }) =&gt; {
58 69 },
59 70 detail: {
60 71 text: '详情',
61   - button: <a type="primary">详情</a>,
  72 + // button: <a type="primary">详情</a>,
62 73 readonly: true,
63 74 },
64 75 };
65 76  
  77 + const handleSourceChange = (value) => {
  78 + if (value === 'REFERRAL_BY_ACQUAINTANCE') {
  79 + setShowReferrers(true);
  80 + } else {
  81 + setShowReferrers(false);
  82 + }
  83 + // 在这里可以添加其他逻辑,比如根据选择更新其他表单项的值
  84 + };
  85 + const handleSchemeChange = (value) => {
  86 + console.log(value);
  87 + if (value === true) {
  88 + setShowQuoteDatetime(true);
  89 + } else {
  90 + setShowQuoteDatetime(false);
  91 + }
  92 + // 在这里可以添加其他逻辑,比如根据选择更新其他表单项的值
  93 + };
  94 +
  95 + // MODIFIED: 增加处理非 JSON 格式字符串的逻辑
  96 + const parsedRecord = record
  97 + ? {
  98 + ...record,
  99 + requirements: (() => {
  100 + try {
  101 + return JSON.parse(record.requirements); // 尝试解析 JSON
  102 + } catch (error) {
  103 + return record.requirements ? record.requirements.split(',') : []; // 如果不是 JSON,则按逗号分隔字符串
  104 + }
  105 + })(),
  106 + }
  107 + : {}; // 如果 record 为空,返回一个空对象
  108 +
66 109 return (
67 110 <DrawerForm
68 111 title={optTypeEnum[optType].text}
... ... @@ -73,7 +116,7 @@ export default ({ optType, record, onFinish }) =&gt; {
73 116 maxWidth: window.innerWidth * 0.8,
74 117 minWidth: 300,
75 118 }}
76   - initialValues={record}
  119 + initialValues={parsedRecord}
77 120 form={form}
78 121 trigger={optTypeEnum[optType].button}
79 122 autoFocusFirstInput
... ... @@ -98,7 +141,7 @@ export default ({ optType, record, onFinish }) =&gt; {
98 141 },
99 142 ]}
100 143 />
101   - <ProFormText
  144 + {/* <ProFormText
102 145 name="companyName"
103 146 label="单位名称"
104 147 placeholder="请输入单位名称"
... ... @@ -108,7 +151,7 @@ export default ({ optType, record, onFinish }) =&gt; {
108 151 message: '请输入单位名称',
109 152 },
110 153 ]}
111   - />
  154 + /> */}
112 155 <div
113 156 style={{
114 157 display: 'flex',
... ... @@ -260,7 +303,7 @@ export default ({ optType, record, onFinish }) =&gt; {
260 303 />
261 304 </div>
262 305 <ProFormText
263   - name="companyAddress"
  306 + name="detailAddress"
264 307 label="详细地址"
265 308 placeholder="请输入单位地址"
266 309 rules={[
... ... @@ -271,6 +314,17 @@ export default ({ optType, record, onFinish }) =&gt; {
271 314 ]}
272 315 />
273 316 <ProFormText
  317 + name="contacts"
  318 + label="联系人"
  319 + placeholder="请输入联系人"
  320 + rules={[
  321 + {
  322 + required: true,
  323 + message: '请输入联系人',
  324 + },
  325 + ]}
  326 + />
  327 + <ProFormText
274 328 name="phoneNumber"
275 329 label="联系电话"
276 330 placeholder="请输入联系电话"
... ... @@ -281,23 +335,52 @@ export default ({ optType, record, onFinish }) =&gt; {
281 335 },
282 336 ]}
283 337 />
284   - <ProFormText
  338 + <ProFormSelect
285 339 name="source"
286 340 label="客户来源"
287   - placeholder="请输入客户来源"
  341 + placeholder="请选择客户来源"
  342 + request={async () => {
  343 + const res = await postServiceConstClientSource();
  344 + return enumToSelect(res.data);
  345 + }}
  346 + rules={[
  347 + {
  348 + required: true,
  349 + message: '请选择客户来源',
  350 + },
  351 + ]}
  352 + fieldProps={{
  353 + onChange: handleSourceChange, // 添加onChange事件处理函数
  354 + }}
288 355 />
289   - <ProFormText
  356 + {showReferrers && (
  357 + <ProFormText
  358 + name="referrers"
  359 + label="推荐人"
  360 + placeholder="请输入推荐人"
  361 + />
  362 + )}
  363 + <ProFormSelect
290 364 name="requirements"
291 365 label="客户需求"
292 366 placeholder="请输入客户需求"
  367 + valueEnum={requirementsEnum}
  368 + fieldProps={{
  369 + mode: 'multiple',
  370 + }}
293 371 rules={[
294 372 {
295 373 required: true,
296 374 message: '请输入客户需求',
  375 + type: 'array',
297 376 },
298 377 ]}
  378 + // request={async () => {
  379 + // const res = await postServiceConstClientRequirements();
  380 + // console.log(res.data, '5656require');
  381 + // return enumToSelect(res.data);
  382 + // }}
299 383 />
300   - <ProFormText name="referrers" label="推荐人" placeholder="请输入推荐人" />
301 384 <ProFormSelect
302 385 name="hasScheme"
303 386 label="是否已报方案"
... ... @@ -318,12 +401,17 @@ export default ({ optType, record, onFinish }) =&gt; {
318 401 message: '请选择是否已报方案',
319 402 },
320 403 ]}
  404 + fieldProps={{
  405 + onChange: handleSchemeChange, // 添加onChange事件处理函数
  406 + }}
321 407 />
322   - <ProFormDateTimePicker
323   - name="quoteDatetime"
324   - label="报价时间"
325   - placeholder="请输入报价时间"
326   - />
  408 + {showQuoteDatetime && (
  409 + <ProFormDatePicker
  410 + name="quoteDatetime"
  411 + label="报价时间"
  412 + placeholder="请输入报价时间"
  413 + />
  414 + )}
327 415 <ProFormSelect
328 416 name="level"
329 417 label="客户等级"
... ... @@ -336,7 +424,17 @@ export default ({ optType, record, onFinish }) =&gt; {
336 424 ]}
337 425 request={async () => {
338 426 const res = await postServiceConstClientLevels();
339   - return enumToSelect(res.data);
  427 + function enumToSelectLevel(data: any) {
  428 + const order = [
  429 + 'PRIMARY_CLIENT',
  430 + 'SECONDARY_CLIENT',
  431 + 'TERTIARY_CLIENT',
  432 + ];
  433 + return order.map((key) => {
  434 + return { label: data[key], value: key };
  435 + });
  436 + }
  437 + return enumToSelectLevel(res.data);
340 438 }}
341 439 />
342 440 <ProFormSelect
... ...
src/pages/Client/Client/Components/ClientImportModal.tsx 0 → 100644
  1 +import { RESPONSE_CODE } from '@/constants/enum';
  2 +import { orderExport } from '@/services/order';
  3 +import { blobToJson } from '@/utils';
  4 +import { ModalForm, ProFormUploadDragger } from '@ant-design/pro-components';
  5 +import { Button, Form, message } from 'antd';
  6 +import { RcFile } from 'antd/es/upload';
  7 +import axios from 'axios';
  8 +
  9 +export default ({ reloadTable }) => {
  10 + const [form] = Form.useForm();
  11 + const [messageApi, contextHolder] = message.useMessage();
  12 + const downloadImportTemplate = () => {
  13 + messageApi.open({
  14 + type: 'loading',
  15 + content: '正在导入...',
  16 + duration: 0,
  17 + });
  18 + orderExport(
  19 + '/api/admin/client/downloadImportTemplate',
  20 + '客户导入模板.xlsx',
  21 + 'post',
  22 + {},
  23 + () => {
  24 + messageApi.destroy();
  25 + },
  26 + );
  27 + };
  28 +
  29 + return (
  30 + <ModalForm
  31 + title="导入客户信息"
  32 + trigger={<Button type="primary">导入客户信息</Button>}
  33 + form={form}
  34 + autoFocusFirstInput
  35 + modalProps={{
  36 + destroyOnClose: true,
  37 + onCancel: () => console.log('run'),
  38 + }}
  39 + submitTimeout={2000}
  40 + onFinish={async (values) => {
  41 + const formData = new FormData();
  42 + values.file.forEach((file) => {
  43 + formData.append('file', file.originFileObj as RcFile);
  44 + });
  45 + axios({
  46 + url: '/api/admin/client/importClient',
  47 + method: 'post',
  48 + responseType: 'blob',
  49 + headers: {
  50 + Authorization: localStorage.getItem('token'),
  51 + 'Content-Type':
  52 + 'multipart/form-data; boundary=----WebKitFormBoundarynl6gT1BKdPWIejNq',
  53 + },
  54 + data: formData,
  55 + })
  56 + .then((response) => {
  57 + let data = response.data;
  58 + if (data.type === 'application/json') {
  59 + blobToJson(data).then((dataJson) => {
  60 + if (dataJson?.result === RESPONSE_CODE.SUCCESS) {
  61 + message.success(dataJson?.message);
  62 + reloadTable();
  63 + } else {
  64 + message.error(dataJson?.message);
  65 + }
  66 + });
  67 + } else {
  68 + message.error('上传失败,已下载错误信息表格');
  69 + // 创建一个新的 Blob 对象,它包含了服务器响应的数据(即你的 Excel 文件)
  70 + const blob = new Blob([response.data]); // Excel 的 MIME 类型
  71 + const downloadUrl = window.URL.createObjectURL(blob);
  72 + const a = document.createElement('a');
  73 + a.href = downloadUrl;
  74 + a.download = '银行流水导入模板.xlsx'; // 你可以为文件命名
  75 + document.body.appendChild(a);
  76 + a.click(); // 模拟点击操作来下载文件
  77 + URL.revokeObjectURL(downloadUrl); // 释放掉 blob 对象所占用的内存
  78 + document.body.removeChild(a);
  79 + }
  80 + })
  81 + .catch((error) => {
  82 + // 处理错误
  83 + message.error('系统出现异常了,请联系管理员', error);
  84 + })
  85 + .finally(() => {});
  86 + return true;
  87 + }}
  88 + >
  89 + <ProFormUploadDragger max={1} label="上传" name="file" />
  90 + <Button type="link" onClick={downloadImportTemplate}>
  91 + 下载导入模板
  92 + </Button>
  93 + {contextHolder}
  94 + </ModalForm>
  95 + );
  96 +};
... ...
src/pages/Client/Client/Components/ClientInformationModal.tsx 0 → 100644
  1 +import { RESPONSE_CODE } from '@/constants/enum';
  2 +import {
  3 + postAdminClientAddOrModifyClientComunicationInfo,
  4 + postAdminClientQueryClientPage,
  5 + postOrderErpOrderStagesUpload,
  6 + postServiceConstClientWay,
  7 +} from '@/services';
  8 +import { enumToSelect } from '@/utils';
  9 +import {
  10 + ModalForm,
  11 + ProFormDateTimePicker,
  12 + ProFormSelect,
  13 + ProFormText,
  14 + ProFormTextArea,
  15 + ProFormUploadDragger,
  16 +} from '@ant-design/pro-components';
  17 +import { Button, Form, message } from 'antd';
  18 +import { RcFile } from 'antd/es/upload';
  19 +export default ({ data, type, reloadTable }) => {
  20 + const [form] = Form.useForm();
  21 + const onfinish = async (values) => {
  22 + const resSearchId = await postAdminClientQueryClientPage({
  23 + data: {
  24 + groupFilter: 'all',
  25 + },
  26 + });
  27 + const matchingItem = resSearchId.data.data.find(
  28 + (item) => item.id === values.name,
  29 + );
  30 + let matchedId;
  31 + if (matchingItem) {
  32 + matchedId = matchingItem.id; // 匹配成功,取出 id
  33 + values.name = matchingItem.name;
  34 + } else {
  35 + matchedId = null; // 如果没有匹配项,可以设置为 null 或其他值
  36 + }
  37 + const res = await postAdminClientAddOrModifyClientComunicationInfo({
  38 + data: {
  39 + ...values,
  40 + clientId: matchedId,
  41 + },
  42 + });
  43 + if (res.result === RESPONSE_CODE.SUCCESS) {
  44 + message.success('新增成功');
  45 + reloadTable();
  46 + return true;
  47 + }
  48 + // 不返回不会关闭弹框
  49 + };
  50 + const editOnfinish = async (values) => {
  51 + // setEditClientId(data.clientId);
  52 + values.clientId = data.clientId;
  53 + console.log(values, '5656editClientId');
  54 +
  55 + // const resSearchId = await postAdminClientQueryClientPage({
  56 + // data: {
  57 + // groupFilter: 'all',
  58 + // },
  59 + // });
  60 + // const matchingItem = resSearchId.data.data.find(
  61 + // (item) => item.id === values.name,
  62 + // );
  63 +
  64 + const res = await postAdminClientAddOrModifyClientComunicationInfo({
  65 + data: {
  66 + ...values,
  67 + },
  68 + });
  69 + if (res.result === RESPONSE_CODE.SUCCESS) {
  70 + message.success('新增成功');
  71 + reloadTable();
  72 + return true;
  73 + }
  74 + // 不返回不会关闭弹框
  75 + };
  76 + const optType = {
  77 + add: {
  78 + readOnly: false,
  79 + title: '新增跟进记录',
  80 + button: (
  81 + <Button size={'middle'} type="primary">
  82 + 新增
  83 + </Button>
  84 + ),
  85 + onFinish: onfinish,
  86 + },
  87 + modify: {
  88 + readOnly: false,
  89 + title: '修改跟进记录',
  90 + button: (
  91 + <Button size={'middle'} type="primary">
  92 + 编辑
  93 + </Button>
  94 + ),
  95 + onFinish: editOnfinish,
  96 + },
  97 + detail: {
  98 + readOnly: true,
  99 + title: '查看跟进记录',
  100 + button: (
  101 + <Button size={'middle'} type="primary" color="red">
  102 + 查看
  103 + </Button>
  104 + ),
  105 + onFinish: () => {},
  106 + },
  107 + };
  108 + return (
  109 + <ModalForm
  110 + title={optType[type].title}
  111 + resize={{
  112 + onResize() {
  113 + console.log('resize!');
  114 + },
  115 + maxWidth: window.innerWidth * 0.8,
  116 + minWidth: 400,
  117 + }}
  118 + form={form}
  119 + trigger={optType[type].button}
  120 + autoFocusFirstInput
  121 + drawerProps={{
  122 + destroyOnClose: true,
  123 + }}
  124 + submitTimeout={2000}
  125 + onFinish={optType[type].onFinish}
  126 + >
  127 + <ProFormSelect
  128 + name="name"
  129 + readonly={optType[type].readOnly}
  130 + fieldProps={{
  131 + labelInValue: false,
  132 + disabled: type === 'modify',
  133 + }}
  134 + initialValue={data ? data?.clientName + '' : null}
  135 + label="客户"
  136 + width="sm"
  137 + request={async () => {
  138 + const res = await postAdminClientQueryClientPage({
  139 + data: {
  140 + groupFilter: 'all',
  141 + },
  142 + });
  143 + console.log(data, '5656data?.nameedit');
  144 + // const namesArray = res.data.data.map((item) => item.name);
  145 + // const formattedObject = res.data.data.reduce((acc, name) => {
  146 + // acc[name] = name; // 将名称作为键和值
  147 + // return acc;
  148 + // }, {});
  149 + // console.log(namesArray, '5656namesArray');
  150 + // const formattedObject = res.data.data.reduce((acc, item) => {
  151 + // acc[item.name] = item.name; // 使用 name 作为键,id 作为值
  152 + // return acc;
  153 + // }, {});
  154 + // return enumToSelect(formattedObject);
  155 + const options = res.data.data.reduce((acc, item) => {
  156 + acc.push({ label: item.name, value: item.id }); // 使用 name 作为 label,id 作为 value
  157 + return acc;
  158 + }, []);
  159 + return options;
  160 + }}
  161 + rules={[
  162 + {
  163 + required: true,
  164 + message: '请选择客户',
  165 + },
  166 + ]}
  167 + ></ProFormSelect>
  168 + <ProFormDateTimePicker
  169 + name="datetime"
  170 + label="日期"
  171 + initialValue={data ? data?.datetime + '' : null}
  172 + placeholder="请选择跟进时间"
  173 + width="sm"
  174 + rules={[
  175 + {
  176 + required: true,
  177 + message: '请选择日期',
  178 + },
  179 + ]}
  180 + />
  181 + <ProFormSelect
  182 + name="way"
  183 + width="sm"
  184 + readonly={optType[type].readOnly}
  185 + fieldProps={{
  186 + labelInValue: false,
  187 + }}
  188 + initialValue={data?.way ? data?.way + '' : null}
  189 + label="类型"
  190 + request={async () => {
  191 + const res = await postServiceConstClientWay();
  192 + return enumToSelect(res.data);
  193 + }}
  194 + rules={[
  195 + {
  196 + required: true,
  197 + message: '请选择跟进类型',
  198 + },
  199 + ]}
  200 + ></ProFormSelect>
  201 + <ProFormTextArea
  202 + name="content"
  203 + label="详情"
  204 + placeholder="请输入详情"
  205 + initialValue={data?.content}
  206 + readonly={optType[type].readOnly}
  207 + rules={[
  208 + {
  209 + required: true,
  210 + message: '请输入详情',
  211 + },
  212 + ]}
  213 + ></ProFormTextArea>
  214 + <ProFormUploadDragger
  215 + label="附件"
  216 + name="attachment"
  217 + action="upload.do"
  218 + hidden={optType[type].readOnly}
  219 + onChange={(info) => {
  220 + const uploadFile = async ({ fileList: newFileList }) => {
  221 + if (newFileList.length > 0) {
  222 + const formData = new FormData();
  223 + formData.append('file', newFileList[0].originFileObj as RcFile);
  224 + const res = await postOrderErpOrderStagesUpload({
  225 + data: formData,
  226 + headers: {
  227 + 'Content-Type':
  228 + 'multipart/form-data; boundary=----WebKitFormBoundarynl6gT1BKdPWIejNq',
  229 + },
  230 + });
  231 + const url = res.data;
  232 + console.log('attachments' + JSON.stringify(url));
  233 + form.setFieldValue('attachments', url);
  234 + } else {
  235 + form.setFieldValue('attachments', null);
  236 + }
  237 + };
  238 + uploadFile(info);
  239 + }}
  240 + max={1}
  241 + />
  242 + <a hidden={!optType[type].readOnly} href={data?.attachments} download>
  243 + 下载附件
  244 + </a>
  245 + <ProFormText
  246 + initialValue={data?.attachments}
  247 + name="attachments"
  248 + hidden
  249 + ></ProFormText>
  250 + <ProFormText initialValue={data?.id} name="id" hidden></ProFormText>
  251 + </ModalForm>
  252 + );
  253 +};
... ...
src/pages/Client/Client/Components/ClientModal.tsx 0 → 100644
  1 +import { RESPONSE_CODE } from '@/constants/enum';
  2 +import {
  3 + postAdminClientAddOrModifyClientComunicationInfo,
  4 + postAdminClientQueryClientPage,
  5 + postOrderErpOrderStagesUpload,
  6 + postServiceConstClientWay,
  7 +} from '@/services';
  8 +import { enumToSelect } from '@/utils';
  9 +import {
  10 + ModalForm,
  11 + ProFormDateTimePicker,
  12 + ProFormSelect,
  13 + ProFormText,
  14 + ProFormTextArea,
  15 + ProFormUploadDragger,
  16 +} from '@ant-design/pro-components';
  17 +import { Button, Form, message } from 'antd';
  18 +import { RcFile } from 'antd/es/upload';
  19 +export default ({ data, type, reloadTable }) => {
  20 + const [form] = Form.useForm();
  21 + const onfinish = async (values) => {
  22 + console.log(data, '5656datatest');
  23 + console.log(values, '5656...values');
  24 + const res = await postAdminClientAddOrModifyClientComunicationInfo({
  25 + data: {
  26 + ...values,
  27 + id: '',
  28 + clientId: data.id,
  29 + },
  30 + });
  31 + if (res.result === RESPONSE_CODE.SUCCESS) {
  32 + message.success('新增成功');
  33 + reloadTable();
  34 + return true;
  35 + }
  36 + // 不返回不会关闭弹框
  37 + };
  38 + const optType = {
  39 + add: {
  40 + readOnly: false,
  41 + title: '新增跟进记录',
  42 + button: (
  43 + <Button size={'small'} type="link">
  44 + 新增跟进
  45 + </Button>
  46 + ),
  47 + onFinish: onfinish,
  48 + },
  49 + add2: {
  50 + readOnly: false,
  51 + title: '新增跟进记录',
  52 + button: (
  53 + <Button size={'middle'} type="primary">
  54 + 新增跟进
  55 + </Button>
  56 + ),
  57 + onFinish: onfinish,
  58 + },
  59 + modify: {
  60 + readOnly: false,
  61 + title: '修改跟进记录',
  62 + button: (
  63 + <Button size={'small'} type="link">
  64 + 编辑
  65 + </Button>
  66 + ),
  67 + onFinish: onfinish,
  68 + },
  69 + detail: {
  70 + readOnly: true,
  71 + title: '查看跟进记录',
  72 + button: (
  73 + <Button size={'small'} type="link">
  74 + 查看
  75 + </Button>
  76 + ),
  77 + onFinish: () => {},
  78 + },
  79 + };
  80 + return (
  81 + <ModalForm
  82 + title={optType[type].title}
  83 + resize={{
  84 + onResize() {
  85 + console.log('resize!');
  86 + },
  87 + maxWidth: window.innerWidth * 0.8,
  88 + minWidth: 400,
  89 + }}
  90 + form={form}
  91 + trigger={optType[type].button}
  92 + autoFocusFirstInput
  93 + drawerProps={{
  94 + destroyOnClose: true,
  95 + }}
  96 + submitTimeout={2000}
  97 + onFinish={optType[type].onFinish}
  98 + >
  99 + <ProFormSelect
  100 + name="sendStoreCode"
  101 + readonly={optType[type].readOnly}
  102 + fieldProps={{
  103 + labelInValue: false,
  104 + }}
  105 + initialValue={data ? data?.name + '' : null}
  106 + label="客户"
  107 + width="sm"
  108 + request={async () => {
  109 + const res = await postAdminClientQueryClientPage({
  110 + data: {
  111 + groupFilter: 'all',
  112 + },
  113 + });
  114 + console.log(data?.datetime, '5656data?.datetime');
  115 + const namesArray = res.data.data.map((item) => item.name);
  116 + return enumToSelect(namesArray);
  117 + }}
  118 + rules={[
  119 + {
  120 + required: true,
  121 + message: '请选择客户',
  122 + },
  123 + ]}
  124 + disabled
  125 + ></ProFormSelect>
  126 + <ProFormDateTimePicker
  127 + name="datetime"
  128 + label="日期"
  129 + initialValue={data.datetime ? data?.datetime + '' : null}
  130 + placeholder="请选择跟进时间"
  131 + width="sm"
  132 + rules={[
  133 + {
  134 + required: true,
  135 + message: '请选择日期',
  136 + },
  137 + ]}
  138 + />
  139 + <ProFormSelect
  140 + name="way"
  141 + width="sm"
  142 + readonly={optType[type].readOnly}
  143 + fieldProps={{
  144 + labelInValue: false,
  145 + }}
  146 + initialValue={data?.way ? data?.way + '' : null}
  147 + label="类型"
  148 + request={async () => {
  149 + const res = await postServiceConstClientWay();
  150 + return enumToSelect(res.data);
  151 + }}
  152 + rules={[
  153 + {
  154 + required: true,
  155 + message: '请选择跟进类型',
  156 + },
  157 + ]}
  158 + ></ProFormSelect>
  159 + <ProFormTextArea
  160 + name="content"
  161 + label="详情"
  162 + placeholder="请输入详情"
  163 + initialValue={data?.content}
  164 + readonly={optType[type].readOnly}
  165 + rules={[
  166 + {
  167 + required: true,
  168 + message: '请输入详情',
  169 + },
  170 + ]}
  171 + ></ProFormTextArea>
  172 + <ProFormUploadDragger
  173 + label="附件"
  174 + name="attachment"
  175 + action="upload.do"
  176 + hidden={optType[type].readOnly}
  177 + onChange={(info) => {
  178 + const uploadFile = async ({ fileList: newFileList }) => {
  179 + if (newFileList.length > 0) {
  180 + const formData = new FormData();
  181 + formData.append('file', newFileList[0].originFileObj as RcFile);
  182 + const res = await postOrderErpOrderStagesUpload({
  183 + data: formData,
  184 + headers: {
  185 + 'Content-Type':
  186 + 'multipart/form-data; boundary=----WebKitFormBoundarynl6gT1BKdPWIejNq',
  187 + },
  188 + });
  189 + const url = res.data;
  190 + console.log('attachments' + JSON.stringify(url));
  191 + form.setFieldValue('attachments', url);
  192 + } else {
  193 + form.setFieldValue('attachments', null);
  194 + }
  195 + };
  196 + uploadFile(info);
  197 + }}
  198 + max={1}
  199 + />
  200 + <a hidden={!optType[type].readOnly} href={data?.attachments} download>
  201 + 下载附件
  202 + </a>
  203 + <ProFormText
  204 + initialValue={data?.attachments}
  205 + name="attachments"
  206 + hidden
  207 + ></ProFormText>
  208 + <ProFormText initialValue={data?.id} name="id" hidden></ProFormText>
  209 + </ModalForm>
  210 + );
  211 +};
... ...
src/pages/Client/Client/Components/CommunicationHistoryModal.tsx 0 → 100644
  1 +import { RESPONSE_CODE } from '@/constants/enum';
  2 +import {
  3 + postAdminClientAddOrModifyClientComunicationInfo,
  4 + postAdminClientQueryClientComunicationInfo,
  5 + postAdminClientRemoveClientComunicationInfo,
  6 + postServiceConstClientWay,
  7 +} from '@/services';
  8 +import { enumToSelect } from '@/utils';
  9 +import {
  10 + ActionType,
  11 + EditableProTable,
  12 + ModalForm,
  13 + ProFormInstance,
  14 +} from '@ant-design/pro-components';
  15 +import { Descriptions, Popconfirm, message } from 'antd';
  16 +import { useEffect, useRef, useState } from 'react';
  17 +import ClientModal from './ClientModal';
  18 +import InformationHistoryModal from './InformationHistoryModal';
  19 +export default ({ record }) => {
  20 + const [editableKeys, setEditableRowKeys] = useState<React.Key[]>([]);
  21 + const [dataSource, setDataSource] = useState();
  22 + const ref = useRef<ProFormInstance>();
  23 + const actionRef = useRef<ActionType>();
  24 + const [refreshKey, setRefreshKey] = useState(0); // 用于强制刷新的键
  25 +
  26 + const reloadInformationHistoryModal = () => {
  27 + actionRef.current.reload(); // 重新加载数据
  28 + console.log('5656flush');
  29 +
  30 + // 更新 refreshKey,强制刷新 CommunicationHistoryModal
  31 + setRefreshKey((prevKey) => prevKey + 1);
  32 + };
  33 + const columns = [
  34 + {
  35 + title: '跟进时间',
  36 + dataIndex: 'datetime',
  37 + width: 50,
  38 + valueType: 'dateTime',
  39 + rules: [{ required: true, message: '请选择时间' }],
  40 + },
  41 + {
  42 + title: '跟进人',
  43 + width: 50,
  44 + rules: [{ required: true, message: '请输入跟进人' }],
  45 + dataIndex: 'updateByName',
  46 + },
  47 + {
  48 + title: '跟进方式',
  49 + width: 50,
  50 + dataIndex: 'way',
  51 + rules: [{ required: true, message: '请选择方式' }],
  52 + render: (text, record) => record.wayText, // 显示 wayText
  53 + request: async () => {
  54 + const res = await postServiceConstClientWay();
  55 + return enumToSelect(res.data);
  56 + },
  57 + },
  58 + {
  59 + title: '内容',
  60 + width: 100,
  61 + valueType: 'textarea',
  62 + rules: [{ required: true, message: '请输入内容' }],
  63 + dataIndex: 'content',
  64 + },
  65 + {
  66 + title: '操作',
  67 + valueType: 'option',
  68 + width: 50,
  69 + render: (text, record, _, action) => [
  70 + // <a
  71 + // key="editable"
  72 + // onClick={() => {
  73 + // action?.startEditable?.(record.tid);
  74 + // }}
  75 + // >
  76 + // 编辑
  77 + // </a>,
  78 + <InformationHistoryModal
  79 + // key={'communicationHistory'}
  80 + key={`communicationHistory-${refreshKey}`} // 使用 refreshKey 来强制更新组件
  81 + data={record}
  82 + // reloadTable={() => {
  83 + // actionRef.current.reload();
  84 + // console.log('5656flush');
  85 + // }}
  86 + reloadTable={reloadInformationHistoryModal}
  87 + />,
  88 + <Popconfirm
  89 + key={'delete'}
  90 + title="删除记录"
  91 + description="确认删除记录?"
  92 + onConfirm={async () => {
  93 + setDataSource(dataSource.filter((item) => item.tid !== record.tid));
  94 + const res = await postAdminClientRemoveClientComunicationInfo({
  95 + query: {
  96 + id: record.id,
  97 + },
  98 + });
  99 + if (res.result === RESPONSE_CODE.SUCCESS) {
  100 + message.success(res.message);
  101 + action?.reload();
  102 + } else {
  103 + message.error('删除失败');
  104 + }
  105 + }}
  106 + okText="是"
  107 + cancelText="否"
  108 + >
  109 + <a type={'danger'}>删除</a>
  110 + </Popconfirm>,
  111 + ],
  112 + },
  113 + ];
  114 + const [name, setName] = useState(''); // 客户名称
  115 + const [contacts, setContacts] = useState(''); // 联系人
  116 + const [sourceText, setSourceText] = useState(''); // 来源文本
  117 + const [phoneNumber, setPhoneNumber] = useState(''); // 联系电话
  118 + const [hasSchemeText, setHasSchemeText] = useState(''); // 报方案状态文本
  119 + const [quoteDatetime, setQuoteDatetime] = useState(null); // 报价时间
  120 + const [referrers, setReferrers] = useState(''); // 推荐人
  121 + const [requirementsText, setRequirementsText] = useState(''); // 需求文本
  122 + const [tradeStatusText, setTradeStatusText] = useState(''); // 跟进状态文本
  123 + const [levelText, setLevelText] = useState(''); // 客户等级文本
  124 + const [createTime, setCreateTime] = useState(null); // 最新沟通时间
  125 + const [address, setAddress] = useState(''); // 客户地址
  126 + const [notes, setNotes] = useState(''); // 备注信息
  127 + const [createByName, setCreateByName] = useState(''); // 创建人
  128 + const [latestObject, setLatestObject] = useState(); // 最新跟进时间
  129 + const [recordSave, setRecordSave] = useState(); //新增跟进
  130 + useEffect(() => {
  131 + const request = async () => {
  132 + const resShow = await postAdminClientQueryClientComunicationInfo({
  133 + data: {
  134 + clientId: record.id,
  135 + },
  136 + });
  137 + if (resShow?.data?.data !== null) {
  138 + const data = resShow?.data?.data;
  139 + // const latest = data.reduce((latest: any, current: any) => {
  140 + // return new Date(current.updateTime) > new Date(latest.updateTime) ? current : latest;
  141 + // });
  142 + // const data = [];
  143 + const latestObject2 =
  144 + data?.length > 0
  145 + ? data.reduce((latest, current) =>
  146 + new Date(current.datetime) > new Date(latest.datetime)
  147 + ? current
  148 + : latest,
  149 + )
  150 + : null; // 或返回其他默认值
  151 + setLatestObject(latestObject2?.datetime);
  152 + }
  153 + setRecordSave(record);
  154 + setName(record.name);
  155 + setContacts(record.contacts);
  156 + setSourceText(record.sourceText);
  157 + setPhoneNumber(record.phoneNumber);
  158 + setHasSchemeText(record.hasSchemeText);
  159 + setQuoteDatetime(record.quoteDatetime);
  160 + setReferrers(record.referrers);
  161 + setRequirementsText(record.requirementsText);
  162 + setTradeStatusText(record.tradeStatusText);
  163 + setLevelText(record.levelText);
  164 + setCreateTime(record.createTime);
  165 + setAddress(record.address);
  166 + setNotes(record.notes);
  167 + setCreateByName(record.createByName);
  168 + };
  169 + request();
  170 + }, []);
  171 + const items = [
  172 + {
  173 + key: '1',
  174 + label: '客户名称',
  175 + children: name, // 客户名称
  176 + },
  177 + {
  178 + key: '2',
  179 + label: '联系人',
  180 + children: contacts, // 联系人
  181 + },
  182 + {
  183 + key: '3',
  184 + label: '来源',
  185 + children: sourceText, // 来源文本
  186 + },
  187 + {
  188 + key: '4',
  189 + label: '联系电话',
  190 + children: phoneNumber, // 联系电话
  191 + },
  192 + {
  193 + key: '5',
  194 + label: '是否已报方案',
  195 + children: hasSchemeText, // 报方案状态文本
  196 + },
  197 + {
  198 + key: '6',
  199 + label: '报价时间',
  200 + children: quoteDatetime, // 报价时间
  201 + },
  202 + {
  203 + key: '7',
  204 + label: '推荐人',
  205 + children: referrers, // 推荐人
  206 + },
  207 + {
  208 + key: '8',
  209 + label: '需求',
  210 + children: requirementsText, // 需求文本
  211 + },
  212 + {
  213 + key: '9',
  214 + label: '跟进状态',
  215 + children: tradeStatusText, // 跟进状态文本
  216 + },
  217 + {
  218 + key: '10',
  219 + label: '客户等级',
  220 + children: levelText, // 客户等级文本
  221 + },
  222 + {
  223 + key: '11',
  224 + label: '创建时间',
  225 + children: createTime, // 最新沟通时间
  226 + },
  227 + {
  228 + key: '12',
  229 + label: '客户地址',
  230 + children: address, // 客户地址
  231 + },
  232 + {
  233 + key: '13',
  234 + label: '备注',
  235 + children: notes, // 备注信息
  236 + },
  237 + {
  238 + key: '14',
  239 + label: '创建人',
  240 + children: createByName, // 创建人
  241 + },
  242 + {
  243 + key: '15',
  244 + label: '最新跟进时间',
  245 + children: latestObject, // 最新跟进时间
  246 + },
  247 + ];
  248 + return (
  249 + <ModalForm
  250 + title="客户详情"
  251 + trigger={<a type="primary">查看</a>}
  252 + modalProps={{
  253 + destroyOnClose: true,
  254 + }}
  255 + onFinish={async () => {
  256 + return true;
  257 + }}
  258 + >
  259 + <Descriptions items={items} column={2} />
  260 + <ClientModal
  261 + key={'add'}
  262 + data={recordSave}
  263 + reloadTable={() => {
  264 + actionRef.current?.reload();
  265 + }}
  266 + type={'add2'}
  267 + />
  268 + ,
  269 + <EditableProTable
  270 + rowKey="tid"
  271 + formRef={ref}
  272 + actionRef={actionRef}
  273 + recordCreatorProps={false}
  274 + // recordCreatorProps={{
  275 + // record: () => ({ tid: (Math.random() * 1000000).toFixed(0) }),
  276 + // }}
  277 + loading={false}
  278 + columns={columns}
  279 + request={async () => {
  280 + const res = await postAdminClientQueryClientComunicationInfo({
  281 + data: {
  282 + clientId: record.id,
  283 + },
  284 + });
  285 + if (res.result === RESPONSE_CODE.SUCCESS) {
  286 + console.log(JSON.stringify(res.data));
  287 + return {
  288 + ...res.data,
  289 + data: res.data.data.map((item) => {
  290 + return {
  291 + ...item,
  292 + tid: (Math.random() * 1000000).toFixed(0),
  293 + };
  294 + }),
  295 + };
  296 + } else {
  297 + message.error('获取失败');
  298 + }
  299 + }}
  300 + value={dataSource}
  301 + onChange={setDataSource}
  302 + editable={{
  303 + type: 'multiple',
  304 + editableKeys,
  305 + onSave: async (rowKey, data, row) => {
  306 + console.log(rowKey, data, row);
  307 + if (data?.way === '拜访') {
  308 + data.way = 'VISIT';
  309 + } else if (data?.way === '电话') {
  310 + data.way = 'PHONE';
  311 + } else if (data?.way === '微信') {
  312 + data.way = 'WECHAT';
  313 + } else if (data?.way === '邮件') {
  314 + data.way = 'EMAIL';
  315 + } else if (data?.way === '其他') {
  316 + data.way = 'OTHER';
  317 + }
  318 + const res = await postAdminClientAddOrModifyClientComunicationInfo({
  319 + data: {
  320 + ...data,
  321 + clientId: record.id,
  322 + },
  323 + });
  324 + if (res.result === RESPONSE_CODE.SUCCESS) {
  325 + message.success(res.message);
  326 + } else {
  327 + message.error('修改失败');
  328 + }
  329 + actionRef.current?.reload();
  330 + },
  331 + onChange: setEditableRowKeys,
  332 + }}
  333 + />
  334 + {/* <Descriptions title="User Info" items={items} column={2} /> */}
  335 + {/*<ProCard title="表格数据" headerBordered collapsible defaultCollapsed>
  336 + <ProFormField
  337 + ignoreFormItem
  338 + fieldProps={{
  339 + style: {
  340 + width: '100%',
  341 + },
  342 + }}
  343 + mode="read"
  344 + valueType="jsonCode"
  345 + text={JSON.stringify(dataSource)}
  346 + />
  347 + </ProCard>*/}
  348 + </ModalForm>
  349 + );
  350 +};
... ...
src/pages/Client/Client/Components/InformationHistoryModal.tsx 0 → 100644
  1 +// import ClientModal from '@/pages/Client/FollowRecord/Components/ClientModal';
  2 +import ClientInformationModal from '@/pages/Client/Client/Components/ClientInformationModal';
  3 +
  4 +import {
  5 + postAdminClientQueryClientComunicationInfo,
  6 + postAdminClientRemoveClientComunicationInfo,
  7 +} from '@/services/request';
  8 +import { ModalForm } from '@ant-design/pro-components';
  9 +import { Button, Descriptions, Space } from 'antd';
  10 +import { useEffect, useRef, useState } from 'react';
  11 +
  12 +export default ({ data, reloadTable }) => {
  13 + console.log(data, '5656datafirstshowclient');
  14 +
  15 + // const [isModalVisible, setIsModalVisible] = useState(false); // 控制 ClientModal 的显示
  16 + const actionRef = useRef(); // 引用 actionRef,方便调用 reload 方法
  17 +
  18 + const [datetime, setDatetime] = useState(); // 跟进日期
  19 + const [createByName, setCreateByName] = useState(''); // 跟进人员
  20 + const [clientName, setClientName] = useState(''); // 客户名称
  21 + // const [clientAddress, setClientAddress] = useState(''); // 客户地址
  22 + const [way, setWay] = useState(); // 类型
  23 + // const [clientNameLike, setClientNameLike] = useState(''); // 客户名称模糊查询
  24 + // const [clientAddressLike, setClientAddressLike] = useState(''); // 客户地址模糊查询
  25 + // const [tradeStatus, setTradeStatus] = useState(''); // 客户状态
  26 + // const [tradeStatusLike, setTradeStatusLike] = useState(''); // 客户状态模糊查询
  27 + const [content, setContent] = useState(''); // 跟进详情
  28 + const [createTime, setCreateTime] = useState(null); // 创建时间
  29 + const [attachments, setAttachments] = useState(); //附件
  30 + const [attachmentsName, setAttachmentsName] = useState(''); // 附件名称
  31 +
  32 + useEffect(() => {
  33 + const request = async () => {
  34 + console.log(data, '5656datasearch');
  35 + const res = await postAdminClientQueryClientComunicationInfo({
  36 + data: {
  37 + id: data.id,
  38 + },
  39 + });
  40 + console.log(res, '5656res');
  41 + const dataSearch = res.data.data[0];
  42 + if (dataSearch) {
  43 + if (dataSearch.attachments) {
  44 + const url = dataSearch.attachments;
  45 + const match = url.match(/aliyuncs\.com\/(.*?)\?/);
  46 + let decodedStr = '';
  47 +
  48 + if (match) {
  49 + // 获取匹配的字符串并进行解码
  50 + const encodedStr = match[1];
  51 + decodedStr = decodeURIComponent(encodedStr);
  52 + setAttachmentsName(decodedStr); // 设置跟进日期
  53 + }
  54 + }
  55 + setDatetime(dataSearch.datetime); // 设置跟进日期
  56 + // setDateRange(data.dateRange || []); // 设置跟进时间范围
  57 + setCreateByName(dataSearch.createByName); // 设置跟进人员
  58 + setClientName(dataSearch.clientName); // 设置客户名称
  59 + // setClientAddress(data.clientAddress || ''); // 设置客户地址
  60 + // setClientNameLike(data.clientNameLike || ''); // 设置客户名称模糊查询
  61 + // setClientAddressLike(data.clientAddressLike || ''); // 设置客户地址模糊查询
  62 + // setTradeStatus(data.tradeStatus || ''); // 设置客户状态
  63 + // setTradeStatusLike(data.tradeStatusLike || ''); // 设置客户状态模糊查询
  64 + setContent(dataSearch.content); // 设置跟进详情
  65 + setCreateTime(dataSearch.createTime); // 设置创建时间
  66 + setWay(dataSearch.wayText);
  67 + setAttachments(dataSearch.attachments);
  68 + }
  69 + console.log(attachments, '5656attachments');
  70 + };
  71 + request();
  72 + }, []);
  73 + const items = [
  74 + {
  75 + key: '1',
  76 + label: '跟进日期',
  77 + children: datetime, // 跟进日期
  78 + },
  79 + {
  80 + key: '2',
  81 + label: '跟进人员',
  82 + children: createByName, // 跟进人员
  83 + },
  84 + {
  85 + key: '3',
  86 + label: '客户名称',
  87 + children: clientName, // 客户名称
  88 + },
  89 + {
  90 + key: '4',
  91 + label: '跟进详情',
  92 + children: content, // 跟进详情
  93 + },
  94 + {
  95 + key: '5',
  96 + label: '创建时间',
  97 + children: createTime, // 创建时间
  98 + },
  99 + {
  100 + key: '6',
  101 + label: '跟进类型',
  102 + children: way, // 跟进类型
  103 + },
  104 + ];
  105 + const handleDelete = async () => {
  106 + console.log(JSON.stringify(data), '5656record');
  107 + // 调用删除接口
  108 + const success = await postAdminClientRemoveClientComunicationInfo({
  109 + query: {
  110 + id: data.id,
  111 + },
  112 + });
  113 + // setIsModalVisible(false);
  114 + if (success) {
  115 + actionRef?.current?.reload(); // 重新加载表格数据
  116 + }
  117 + };
  118 + return (
  119 + <Space>
  120 + <ModalForm
  121 + title="跟进记录"
  122 + trigger={<Button type="link">查看</Button>}
  123 + submitter={{
  124 + resetButtonProps: {
  125 + style: {
  126 + display: 'none',
  127 + },
  128 + },
  129 + submitButtonProps: {
  130 + style: {
  131 + display: 'none',
  132 + },
  133 + },
  134 + render: (props, defaultDoms) => {
  135 + return [
  136 + ...defaultDoms,
  137 + <>
  138 + <ClientInformationModal
  139 + key={'modify'}
  140 + data={data} // 将表单数据传递给 ClientModal
  141 + reloadTable={() => {
  142 + actionRef?.current?.reload(); // 重新加载表格数据
  143 + props.submit();
  144 + reloadTable();
  145 + console.log('5656close');
  146 + }}
  147 + type={'modify'}
  148 + onFinish={() => {
  149 + // setIsModalVisible(false);
  150 + }} // 关闭 Modal
  151 + style={{ marginRight: '10px' }}
  152 + />
  153 + <Button
  154 + key={'delete'}
  155 + onClick={() => {
  156 + handleDelete();
  157 + props.submit();
  158 + reloadTable();
  159 + }}
  160 + type="primary"
  161 + size="middle"
  162 + danger // 使用 danger 属性来将按钮颜色设置为红色
  163 + style={{ marginLeft: '10px' }}
  164 + onFinish={() => {
  165 + actionRef.current.reload();
  166 + }}
  167 + >
  168 + 删除
  169 + </Button>
  170 + </>,
  171 + ];
  172 + },
  173 + }}
  174 + onFinish={async () => {
  175 + // 提交成功后,显示 ClientDrawer
  176 + // setIsModalVisible(true);
  177 + return true;
  178 + }}
  179 + >
  180 + <Descriptions items={items} column={1} />
  181 + {attachmentsName && (
  182 + <a href={attachments} download>
  183 + 附件:{attachmentsName}
  184 + </a>
  185 + )}
  186 + </ModalForm>
  187 + </Space>
  188 + );
  189 +};
... ...
src/pages/Client/index.tsx renamed to src/pages/Client/Client/index.tsx
1   -import ClientDrawer from '@/pages/Client/Components/ClientDrawer';
2   -import ClientImportModal from '@/pages/Client/Components/ClientImportModal';
3   -import ClientStatistic from '@/pages/Client/Components/ClientStatistic';
4   -import CommunicationHistoryModal from '@/pages/Client/Components/CommunicationHistoryModal';
  1 +import ButtonConfirm from '@/components/ButtomConfirm';
  2 +import ClientDrawer from '@/pages/Client/Client/Components/ClientDrawer';
  3 +import ClientImportModal from '@/pages/Client/Client/Components/ClientImportModal';
  4 +import ClientModal from '@/pages/Client/Client/Components/ClientModal';
  5 +import CommunicationHistoryModal from '@/pages/Client/Client/Components/CommunicationHistoryModal';
5 6 import {
  7 + postAdminClientDeleteAdminClient,
  8 + postAdminClientGetStatisticalData,
6 9 postAdminClientQueryClientPage,
7   - postServiceConstClientGroupFilters,
8 10 postServiceConstClientLevels,
  11 + postServiceConstClientRequirements,
  12 + postServiceConstClientSource,
9 13 postServiceConstTradeStatus,
10 14 } from '@/services';
11 15 import { downloadFile } from '@/services/order';
12 16 import { enumToSelect } from '@/utils';
13 17 import type { ActionType } from '@ant-design/pro-components';
14 18 import { ProTable } from '@ant-design/pro-components';
15   -import { Button, Radio, Space, message } from 'antd';
  19 +import { Badge, Button, Radio, Space, message } from 'antd';
16 20 import { useEffect, useRef, useState } from 'react';
17 21  
18 22 const columns = [
... ... @@ -25,23 +29,30 @@ const columns = [
25 29 {
26 30 title: '客户名称',
27 31 dataIndex: 'name',
28   - width: 100,
  32 + width: 150,
29 33 ellipsis: true,
30 34 hideInSearch: true,
31 35 },
  36 + // {
  37 + // title: '单位名称',
  38 + // width: 150,
  39 + // ellipsis: true,
  40 + // dataIndex: 'companyName',
  41 + // hideInSearch: true,
  42 + // },
32 43 {
33   - title: '单位名称',
34   - width: 150,
  44 + title: '客户地址',
  45 + width: 250,
35 46 ellipsis: true,
36   - dataIndex: 'companyName',
37   - hideInSearch: true,
  47 + dataIndex: 'address',
  48 + hideInSearch: false,
38 49 },
39 50 {
40   - title: '单位地址',
41   - width: 250,
  51 + title: '联系人',
  52 + width: 150,
42 53 ellipsis: true,
43   - dataIndex: 'companyAddressText',
44   - hideInSearch: true,
  54 + dataIndex: 'contacts',
  55 + hideInSearch: false,
45 56 },
46 57 {
47 58 title: '联系电话',
... ... @@ -54,10 +65,20 @@ const columns = [
54 65 title: '客户来源',
55 66 width: 150,
56 67 ellipsis: true,
57   - dataIndex: 'source',
  68 + dataIndex: 'sourceText',
58 69 hideInSearch: true,
59 70 },
60 71 {
  72 + title: '客户来源',
  73 + valueType: 'select',
  74 + hideInTable: true,
  75 + dataIndex: 'source',
  76 + request: async () => {
  77 + const res = await postServiceConstClientSource();
  78 + return enumToSelect(res.data);
  79 + },
  80 + },
  81 + {
61 82 title: '推荐人',
62 83 dataIndex: 'referrers',
63 84 width: 150,
... ... @@ -66,12 +87,28 @@ const columns = [
66 87 },
67 88 {
68 89 title: '客户需求',
69   - dataIndex: 'requirements',
70   - width: 150,
  90 + width: 240,
71 91 ellipsis: true,
  92 + dataIndex: 'requirementsText',
72 93 hideInSearch: true,
73 94 },
74 95 {
  96 + title: '客户需求',
  97 + dataIndex: 'requirements',
  98 + valueType: 'select',
  99 + hideInTable: true,
  100 + request: async () => {
  101 + const res = await postServiceConstClientRequirements();
  102 + // function enumToSelect(data: any) {
  103 + // const keys = Object.keys(data);
  104 + // return keys.map((value) => {
  105 + // return { label: data[value], value: value };
  106 + // });
  107 + // }
  108 + return enumToSelect(res.data);
  109 + },
  110 + },
  111 + {
75 112 title: '是否已报方案',
76 113 width: 150,
77 114 ellipsis: true,
... ... @@ -84,7 +121,7 @@ const columns = [
84 121 width: 150,
85 122 ellipsis: true,
86 123 dataIndex: 'quoteDatetime',
87   - valueType: 'dateTime',
  124 + valueType: 'date',
88 125 hideInSearch: true,
89 126 },
90 127 {
... ... @@ -111,26 +148,35 @@ const columns = [
111 148 hideInSearch: true,
112 149 },
113 150 {
114   - title: '最新进时间',
  151 + title: '最新进时间',
115 152 key: 'since',
116 153 width: 150,
117 154 ellipsis: true,
118   - dataIndex: 'latestCommunicationTime',
  155 + dataIndex: 'updateTime',
119 156 valueType: 'dateTime',
120 157 hideInSearch: true,
121 158 },
  159 + // {
  160 + // title: '最新跟进时间',
  161 + // key: 'since',
  162 + // width: 150,
  163 + // ellipsis: true,
  164 + // dataIndex: 'latestCommunicationTime',
  165 + // valueType: 'dateTime',
  166 + // hideInSearch: true,
  167 + // },
122 168 {
123 169 title: '客户名称',
124 170 dataIndex: 'nameLike',
125 171 valueType: 'Text',
126 172 hideInTable: true,
127 173 },
128   - {
129   - title: '单位名称',
130   - dataIndex: 'companyNameLike',
131   - valueType: 'Text',
132   - hideInTable: true,
133   - },
  174 + // {
  175 + // title: '单位名称',
  176 + // dataIndex: 'companyNameLike',
  177 + // valueType: 'Text',
  178 + // hideInTable: true,
  179 + // },
134 180 {
135 181 title: '联系电话',
136 182 dataIndex: 'phoneNumberLike',
... ... @@ -141,6 +187,7 @@ const columns = [
141 187 title: '是否已报方案',
142 188 dataIndex: 'hasScheme',
143 189 valueType: 'select',
  190 + width: 1550,
144 191 valueEnum: {
145 192 true: {
146 193 text: '是',
... ... @@ -160,7 +207,14 @@ const columns = [
160 207 hideInTable: true,
161 208 request: async () => {
162 209 const res = await postServiceConstClientLevels();
163   - return enumToSelect(res.data);
  210 + // 明确指定所需的顺序(后端返回顺序正确,直接修改enumToSelect没作用)
  211 + function enumToSelectLevel(data: any) {
  212 + const order = ['PRIMARY_CLIENT', 'SECONDARY_CLIENT', 'TERTIARY_CLIENT'];
  213 + return order.map((key) => {
  214 + return { label: data[key], value: key };
  215 + });
  216 + }
  217 + return enumToSelectLevel(res.data);
164 218 },
165 219 },
166 220 {
... ... @@ -192,13 +246,25 @@ const columns = [
192 246 title: '操作',
193 247 valueType: 'option',
194 248 key: 'option',
195   - width: 150,
  249 + width: 200,
196 250 render: (text, record, index, action) => {
197   - console.log(JSON.stringify(record));
  251 + const handleDelete = async () => {
  252 + console.log(JSON.stringify(record), '5656record1');
  253 + // 调用删除接口
  254 + const success = await postAdminClientDeleteAdminClient({
  255 + query: {
  256 + id: record.id,
  257 + },
  258 + });
  259 + if (success) {
  260 + action.reload(); // 刷新表格
  261 + }
  262 + };
  263 + console.log(JSON.stringify(record), '5656record2');
198 264 return [
199 265 <CommunicationHistoryModal
200 266 key={'communicationHistory'}
201   - clientId={record.id}
  267 + record={record}
202 268 />,
203 269 <ClientDrawer
204 270 key={'detail'}
... ... @@ -208,6 +274,14 @@ const columns = [
208 274 action.reload();
209 275 }}
210 276 ></ClientDrawer>,
  277 + <ClientModal
  278 + key={'add'}
  279 + data={record}
  280 + reloadTable={() => {
  281 + action?.reload();
  282 + }}
  283 + type={'add'}
  284 + />,
211 285 <ClientDrawer
212 286 key={'edit'}
213 287 record={record}
... ... @@ -216,6 +290,18 @@ const columns = [
216 290 action.reload();
217 291 }}
218 292 ></ClientDrawer>,
  293 + // <a key={'delete'} onClick={handleDelete}>
  294 + // 删除
  295 + // </a>,
  296 + <ButtonConfirm
  297 + key="delete"
  298 + className="p-0"
  299 + title={'删除该客户,客户下的跟进记录会一并删除'}
  300 + text="删除"
  301 + onConfirm={async () => {
  302 + handleDelete();
  303 + }}
  304 + />,
219 305 ];
220 306 },
221 307 },
... ... @@ -224,23 +310,74 @@ const columns = [
224 310 export default () => {
225 311 const [messageApi, contextHolder] = message.useMessage();
226 312 const [groupFilter, setGroupFilter] = useState('All');
227   - const [groupFilterOptions, setGroupFilterDataOptions] = useState([]);
  313 + // const [groupFilterOptions, setGroupFilterDataOptions] = useState([]);
228 314 const actionRef = useRef<ActionType>();
  315 + //获得预警/全部数量
  316 + const [clientStatistic, setClientStatistic] = useState([]);
  317 + // const [allClientStatistic, setAllClientStatistic] = useState([]);
  318 + const [warningClientStatistic, setWarningClientStatistic] = useState([]);
  319 + // const reloadTable = () => {
  320 + // actionRef.current?.reload();
  321 + // };
229 322 useEffect(() => {
230   - const pullGroupFilterDataOptions = async () => {
231   - const res = await postServiceConstClientGroupFilters();
232   - console.log('setGroupFilterDataOptions' + JSON.stringify(res.data));
233   - setGroupFilterDataOptions(enumToSelect(res.data));
  323 + const pullStatistic = async () => {
  324 + let statisticalData = await postAdminClientGetStatisticalData();
  325 + console.log('stati' + JSON.stringify(statisticalData.data));
  326 + setClientStatistic(statisticalData.data);
  327 + setWarningClientStatistic(statisticalData.data[1].value);
  328 + // setAllClientStatistic(statisticalData.data[0].value);
  329 + setTimeout(() => {
  330 + console.log(clientStatistic, '5656groupFilterOptions1');
  331 + // groupFilterOptions[0].label = groupFilterOptions[0].label + '(' + clientStatistic + ')';
  332 + }, 100);
  333 + actionRef.current?.reload(); // 可能需要在这里刷新
234 334 };
235   - pullGroupFilterDataOptions();
  335 + pullStatistic();
236 336 }, []);
  337 + const groupFilterOptions = [
  338 + {
  339 + value: 'All',
  340 + label: <span>全部</span>,
  341 + },
  342 + {
  343 + value: 'WARNING_CLIENT',
  344 + label: (
  345 + <span>
  346 + 预警客户
  347 + <Badge count={warningClientStatistic} style={{ marginLeft: 8 }} />
  348 + </span>
  349 + ),
  350 + },
  351 + ];
  352 + // useEffect(() => {
  353 + // const pullGroupFilterDataOptions = async () => {
  354 + // const res = await postServiceConstClientGroupFilters();
  355 + // // console.log('setGroupFilterDataOptions' + JSON.stringify(res.data));
  356 + // const select = enumToSelect(res.data);
  357 + // console.log(select, '5656selet');
  358 + // setGroupFilterDataOptions(select);
  359 + // };
  360 + // pullGroupFilterDataOptions();
  361 + // }, []);
237 362 useEffect(() => {
  363 + // console.log(groupFilterOptions, '5656groupFilterOptions2');
  364 + console.log(clientStatistic, '5656clientStatistic');
  365 + console.log(warningClientStatistic, '5656warningClientStatistic');
238 366 actionRef.current?.reload();
239 367 }, [groupFilter]);
240 368 return (
241 369 <>
242 370 <Space direction="vertical" size="middle" style={{ display: 'flex' }}>
243   - <ClientStatistic></ClientStatistic>
  371 + <div key={'groupFilter'}>
  372 + <Radio.Group
  373 + options={groupFilterOptions}
  374 + onChange={(e) => {
  375 + setGroupFilter(e.target.value);
  376 + }}
  377 + value={groupFilter}
  378 + optionType="button"
  379 + />
  380 + </div>
244 381 <ProTable
245 382 columns={columns}
246 383 actionRef={actionRef}
... ... @@ -256,6 +393,7 @@ export default () =&gt; {
256 393 return data;
257 394 }}
258 395 search={{
  396 + labelWidth: 'auto',
259 397 optionRender: (searchConfig, formProps, dom) => [
260 398 ...dom.reverse(),
261 399 <Button
... ... @@ -273,6 +411,7 @@ export default () =&gt; {
273 411 'POST',
274 412 values,
275 413 () => {
  414 + console.log(searchConfig, '5656searchConfig');
276 415 messageApi.destroy();
277 416 },
278 417 );
... ... @@ -323,16 +462,6 @@ export default () =&gt; {
323 462 dateFormatter="string"
324 463 headerTitle="高级表格"
325 464 toolBarRender={() => [
326   - <div key={'groupFilter'}>
327   - <Radio.Group
328   - options={groupFilterOptions}
329   - onChange={(e) => {
330   - setGroupFilter(e.target.value);
331   - }}
332   - value={groupFilter}
333   - optionType="button"
334   - />
335   - </div>,
336 465 <ClientDrawer
337 466 optType={'add'}
338 467 key="button"
... ... @@ -340,7 +469,12 @@ export default () =&gt; {
340 469 actionRef.current.reload();
341 470 }}
342 471 ></ClientDrawer>,
343   - <ClientImportModal key="import" />,
  472 + <ClientImportModal
  473 + key="import"
  474 + reloadTable={() => {
  475 + actionRef.current.reload();
  476 + }}
  477 + />,
344 478 ]}
345 479 />
346 480 </Space>
... ...
src/pages/Client/Components/ClientStatistic.tsx deleted 100644 → 0
1   -import { postAdminClientGetStatisticalData } from '@/services';
2   -import { StatisticCard } from '@ant-design/pro-components';
3   -import { useEffect, useState } from 'react';
4   -
5   -export default () => {
6   - const [clientStatistic, setClientStatistic] = useState([]);
7   - useEffect(() => {
8   - const pullStatistic = async () => {
9   - let statisticalData = await postAdminClientGetStatisticalData();
10   - console.log('stati' + JSON.stringify(statisticalData.data));
11   - setClientStatistic(statisticalData.data);
12   - };
13   - pullStatistic();
14   - }, []);
15   - return (
16   - <StatisticCard.Group>
17   - {clientStatistic.map((stat, index) => (
18   - <StatisticCard
19   - key={index}
20   - statistic={{
21   - title: stat.title,
22   - tip: stat.tip || '', // 如果tip不存在,则使用空字符串
23   - value: stat.value,
24   - status: stat.status || 'default', // 如果status不存在,则使用'default'
25   - }}
26   - />
27   - ))}
28   - </StatisticCard.Group>
29   - );
30   -};
src/pages/Client/Components/CommunicationHistoryModal.tsx deleted 100644 → 0
1   -import { RESPONSE_CODE } from '@/constants/enum';
2   -import {
3   - postAdminClientAddOrModifyClientComunicationInfo,
4   - postAdminClientQueryClientComunicationInfo,
5   - postAdminClientRemoveClientComunicationInfo,
6   -} from '@/services';
7   -import {
8   - ActionType,
9   - EditableProTable,
10   - ModalForm,
11   - ProFormInstance,
12   -} from '@ant-design/pro-components';
13   -import { Popconfirm, message } from 'antd';
14   -import { useEffect, useRef, useState } from 'react';
15   -export default ({ clientId }) => {
16   - const [editableKeys, setEditableRowKeys] = useState<React.Key[]>([]);
17   - const [dataSource, setDataSource] = useState();
18   - const ref = useRef<ProFormInstance>();
19   - const actionRef = useRef<ActionType>();
20   - const columns = [
21   - {
22   - title: '跟进时间',
23   - dataIndex: 'datetime',
24   - width: 50,
25   - valueType: 'dateTime',
26   - rules: [{ required: true, message: '请选择时间' }],
27   - },
28   - {
29   - title: '方式',
30   - width: 50,
31   - dataIndex: 'way',
32   - rules: [{ required: true, message: '请选择方式' }],
33   - },
34   - {
35   - title: '内容',
36   - width: 100,
37   - valueType: 'textarea',
38   - rules: [{ required: true, message: '请输入内容' }],
39   - dataIndex: 'content',
40   - },
41   - {
42   - title: '操作',
43   - valueType: 'option',
44   - width: 50,
45   - render: (text, record, _, action) => [
46   - <a
47   - key="editable"
48   - onClick={() => {
49   - action?.startEditable?.(record.tid);
50   - }}
51   - >
52   - 编辑
53   - </a>,
54   - <Popconfirm
55   - key={'delete'}
56   - title="删除记录"
57   - description="确认删除记录?"
58   - onConfirm={async () => {
59   - setDataSource(dataSource.filter((item) => item.tid !== record.tid));
60   - const res = await postAdminClientRemoveClientComunicationInfo({
61   - query: {
62   - id: record.id,
63   - },
64   - });
65   - if (res.result === RESPONSE_CODE.SUCCESS) {
66   - message.success(res.message);
67   - action?.reload();
68   - } else {
69   - message.error('删除失败');
70   - }
71   - }}
72   - okText="是"
73   - cancelText="否"
74   - >
75   - <a type={'danger'}>删除</a>
76   - </Popconfirm>,
77   - ],
78   - },
79   - ];
80   -
81   - useEffect(() => {
82   - console.log('clientId', clientId);
83   - }, []);
84   - return (
85   - <ModalForm
86   - title="跟进记录"
87   - trigger={<a type="primary">跟进记录</a>}
88   - modalProps={{
89   - destroyOnClose: true,
90   - }}
91   - >
92   - <EditableProTable
93   - rowKey="tid"
94   - formRef={ref}
95   - actionRef={actionRef}
96   - recordCreatorProps={{
97   - record: () => ({ tid: (Math.random() * 1000000).toFixed(0) }),
98   - }}
99   - loading={false}
100   - columns={columns}
101   - request={async () => {
102   - const res = await postAdminClientQueryClientComunicationInfo({
103   - data: {
104   - clientId: clientId,
105   - },
106   - });
107   - if (res.result === RESPONSE_CODE.SUCCESS) {
108   - console.log(JSON.stringify(res.data));
109   - return {
110   - ...res.data,
111   - data: res.data.data.map((item) => {
112   - return {
113   - ...item,
114   - tid: (Math.random() * 1000000).toFixed(0),
115   - };
116   - }),
117   - };
118   - } else {
119   - message.error('获取失败');
120   - }
121   - }}
122   - value={dataSource}
123   - onChange={setDataSource}
124   - editable={{
125   - type: 'multiple',
126   - editableKeys,
127   - onSave: async (rowKey, data, row) => {
128   - console.log(rowKey, data, row);
129   - const res = await postAdminClientAddOrModifyClientComunicationInfo({
130   - data: {
131   - ...data,
132   - clientId: clientId,
133   - },
134   - });
135   - if (res.result === RESPONSE_CODE.SUCCESS) {
136   - message.success(res.message);
137   - } else {
138   - message.error('修改失败');
139   - }
140   - actionRef.current?.reload();
141   - },
142   - onChange: setEditableRowKeys,
143   - }}
144   - />
145   - {/*<ProCard title="表格数据" headerBordered collapsible defaultCollapsed>
146   - <ProFormField
147   - ignoreFormItem
148   - fieldProps={{
149   - style: {
150   - width: '100%',
151   - },
152   - }}
153   - mode="read"
154   - valueType="jsonCode"
155   - text={JSON.stringify(dataSource)}
156   - />
157   - </ProCard>*/}
158   - </ModalForm>
159   - );
160   -};
src/pages/Client/Components/ClientImportModal.tsx renamed to src/pages/Client/FollowRecord/Components/ClientImportModal.tsx
src/pages/Client/FollowRecord/Components/ClientModal.tsx 0 → 100644
  1 +import { RESPONSE_CODE } from '@/constants/enum';
  2 +import {
  3 + postAdminClientAddOrModifyClientComunicationInfo,
  4 + postAdminClientQueryClientPage,
  5 + postOrderErpOrderStagesUpload,
  6 + postServiceConstClientWay,
  7 +} from '@/services';
  8 +import { enumToSelect } from '@/utils';
  9 +import {
  10 + ModalForm,
  11 + ProFormDateTimePicker,
  12 + ProFormSelect,
  13 + ProFormText,
  14 + ProFormTextArea,
  15 + ProFormUploadDragger,
  16 +} from '@ant-design/pro-components';
  17 +import { Button, Form, message } from 'antd';
  18 +import { RcFile } from 'antd/es/upload';
  19 +export default ({ data, type, reloadTable }) => {
  20 + const [form] = Form.useForm();
  21 + const onfinish = async (values) => {
  22 + const resSearchId = await postAdminClientQueryClientPage({
  23 + data: {
  24 + groupFilter: 'all',
  25 + },
  26 + });
  27 + const matchingItem = resSearchId.data.data.find(
  28 + (item) => item.id === values.name,
  29 + );
  30 + let matchedId;
  31 + if (matchingItem) {
  32 + matchedId = matchingItem.id; // 匹配成功,取出 id
  33 + values.name = matchingItem.name;
  34 + } else {
  35 + matchedId = null; // 如果没有匹配项,可以设置为 null 或其他值
  36 + }
  37 + const res = await postAdminClientAddOrModifyClientComunicationInfo({
  38 + data: {
  39 + ...values,
  40 + clientId: matchedId,
  41 + },
  42 + });
  43 + if (res.result === RESPONSE_CODE.SUCCESS) {
  44 + message.success('新增成功');
  45 + reloadTable();
  46 + return true;
  47 + }
  48 + // 不返回不会关闭弹框
  49 + };
  50 + const editOnfinish = async (values) => {
  51 + // setEditClientId(data.clientId);
  52 + values.clientId = data.clientId;
  53 + console.log(values, '5656editClientId');
  54 +
  55 + // const resSearchId = await postAdminClientQueryClientPage({
  56 + // data: {
  57 + // groupFilter: 'all',
  58 + // },
  59 + // });
  60 + // const matchingItem = resSearchId.data.data.find(
  61 + // (item) => item.id === values.name,
  62 + // );
  63 +
  64 + const res = await postAdminClientAddOrModifyClientComunicationInfo({
  65 + data: {
  66 + ...values,
  67 + },
  68 + });
  69 + if (res.result === RESPONSE_CODE.SUCCESS) {
  70 + message.success('新增成功');
  71 + reloadTable();
  72 + return true;
  73 + }
  74 + // 不返回不会关闭弹框
  75 + };
  76 + const optType = {
  77 + add: {
  78 + readOnly: false,
  79 + title: '新增跟进记录',
  80 + button: (
  81 + <Button size={'middle'} type="primary">
  82 + 新增
  83 + </Button>
  84 + ),
  85 + onFinish: onfinish,
  86 + },
  87 + modify: {
  88 + readOnly: false,
  89 + title: '修改跟进记录',
  90 + button: (
  91 + <Button size={'middle'} type="primary">
  92 + 编辑
  93 + </Button>
  94 + ),
  95 + onFinish: editOnfinish,
  96 + },
  97 + detail: {
  98 + readOnly: true,
  99 + title: '查看跟进记录',
  100 + button: (
  101 + <Button size={'middle'} type="primary" color="red">
  102 + 查看
  103 + </Button>
  104 + ),
  105 + onFinish: () => {},
  106 + },
  107 + };
  108 + return (
  109 + <ModalForm
  110 + title={optType[type].title}
  111 + resize={{
  112 + onResize() {
  113 + console.log('resize!');
  114 + },
  115 + maxWidth: window.innerWidth * 0.8,
  116 + minWidth: 400,
  117 + }}
  118 + form={form}
  119 + trigger={optType[type].button}
  120 + autoFocusFirstInput
  121 + drawerProps={{
  122 + destroyOnClose: true,
  123 + }}
  124 + submitTimeout={2000}
  125 + onFinish={optType[type].onFinish}
  126 + >
  127 + <ProFormSelect
  128 + name="name"
  129 + readonly={optType[type].readOnly}
  130 + fieldProps={{
  131 + labelInValue: false,
  132 + disabled: type === 'modify',
  133 + }}
  134 + initialValue={data ? data?.clientName + '' : null}
  135 + label="客户"
  136 + width="sm"
  137 + request={async () => {
  138 + const res = await postAdminClientQueryClientPage({
  139 + data: {
  140 + groupFilter: 'all',
  141 + },
  142 + });
  143 + console.log(data, '5656data?.nameedit');
  144 + // const namesArray = res.data.data.map((item) => item.name);
  145 + // const formattedObject = res.data.data.reduce((acc, name) => {
  146 + // acc[name] = name; // 将名称作为键和值
  147 + // return acc;
  148 + // }, {});
  149 + // console.log(namesArray, '5656namesArray');
  150 + // const formattedObject = res.data.data.reduce((acc, item) => {
  151 + // acc[item.name] = item.name; // 使用 name 作为键,id 作为值
  152 + // return acc;
  153 + // }, {});
  154 + // return enumToSelect(formattedObject);
  155 + const options = res.data.data.reduce((acc, item) => {
  156 + acc.push({ label: item.name, value: item.id }); // 使用 name 作为 label,id 作为 value
  157 + return acc;
  158 + }, []);
  159 + return options;
  160 + }}
  161 + rules={[
  162 + {
  163 + required: true,
  164 + message: '请选择客户',
  165 + },
  166 + ]}
  167 + ></ProFormSelect>
  168 + <ProFormDateTimePicker
  169 + name="datetime"
  170 + label="日期"
  171 + initialValue={data ? data?.datetime + '' : null}
  172 + placeholder="请选择跟进时间"
  173 + width="sm"
  174 + rules={[
  175 + {
  176 + required: true,
  177 + message: '请选择日期',
  178 + },
  179 + ]}
  180 + />
  181 + <ProFormSelect
  182 + name="way"
  183 + width="sm"
  184 + readonly={optType[type].readOnly}
  185 + fieldProps={{
  186 + labelInValue: false,
  187 + }}
  188 + initialValue={data?.way ? data?.way + '' : null}
  189 + label="类型"
  190 + request={async () => {
  191 + const res = await postServiceConstClientWay();
  192 + return enumToSelect(res.data);
  193 + }}
  194 + rules={[
  195 + {
  196 + required: true,
  197 + message: '请选择跟进类型',
  198 + },
  199 + ]}
  200 + ></ProFormSelect>
  201 + <ProFormTextArea
  202 + name="content"
  203 + label="详情"
  204 + placeholder="请输入详情"
  205 + initialValue={data?.content}
  206 + readonly={optType[type].readOnly}
  207 + rules={[
  208 + {
  209 + required: true,
  210 + message: '请输入详情',
  211 + },
  212 + ]}
  213 + ></ProFormTextArea>
  214 + <ProFormUploadDragger
  215 + label="附件"
  216 + name="attachment"
  217 + action="upload.do"
  218 + hidden={optType[type].readOnly}
  219 + onChange={(info) => {
  220 + const uploadFile = async ({ fileList: newFileList }) => {
  221 + if (newFileList.length > 0) {
  222 + const formData = new FormData();
  223 + formData.append('file', newFileList[0].originFileObj as RcFile);
  224 + const res = await postOrderErpOrderStagesUpload({
  225 + data: formData,
  226 + headers: {
  227 + 'Content-Type':
  228 + 'multipart/form-data; boundary=----WebKitFormBoundarynl6gT1BKdPWIejNq',
  229 + },
  230 + });
  231 + const url = res.data;
  232 + console.log('attachments' + JSON.stringify(url));
  233 + form.setFieldValue('attachments', url);
  234 + } else {
  235 + form.setFieldValue('attachments', null);
  236 + }
  237 + };
  238 + uploadFile(info);
  239 + }}
  240 + max={1}
  241 + />
  242 + <a hidden={!optType[type].readOnly} href={data?.attachments} download>
  243 + 下载附件
  244 + </a>
  245 + <ProFormText
  246 + initialValue={data?.attachments}
  247 + name="attachments"
  248 + hidden
  249 + ></ProFormText>
  250 + <ProFormText initialValue={data?.id} name="id" hidden></ProFormText>
  251 + </ModalForm>
  252 + );
  253 +};
... ...
src/pages/Client/FollowRecord/Components/CommunicationHistoryModal.tsx 0 → 100644
  1 +import ClientModal from '@/pages/Client/FollowRecord/Components/ClientModal';
  2 +import {
  3 + postAdminClientQueryClientComunicationInfo,
  4 + postAdminClientRemoveClientComunicationInfo,
  5 +} from '@/services/request';
  6 +import { ModalForm } from '@ant-design/pro-components';
  7 +import { Button, Descriptions, Space } from 'antd';
  8 +import { useEffect, useRef, useState } from 'react';
  9 +
  10 +export default ({ data, reloadTable }) => {
  11 + console.log(data, '5656datafirstshowgenjin');
  12 +
  13 + // const [isModalVisible, setIsModalVisible] = useState(false); // 控制 ClientModal 的显示
  14 + const actionRef = useRef(); // 引用 actionRef,方便调用 reload 方法
  15 +
  16 + const [datetime, setDatetime] = useState(); // 跟进日期
  17 + const [createByName, setCreateByName] = useState(''); // 跟进人员
  18 + const [clientName, setClientName] = useState(''); // 客户名称
  19 + // const [clientAddress, setClientAddress] = useState(''); // 客户地址
  20 + const [way, setWay] = useState(); // 类型
  21 + // const [clientNameLike, setClientNameLike] = useState(''); // 客户名称模糊查询
  22 + // const [clientAddressLike, setClientAddressLike] = useState(''); // 客户地址模糊查询
  23 + // const [tradeStatus, setTradeStatus] = useState(''); // 客户状态
  24 + // const [tradeStatusLike, setTradeStatusLike] = useState(''); // 客户状态模糊查询
  25 + const [content, setContent] = useState(''); // 跟进详情
  26 + const [createTime, setCreateTime] = useState(null); // 创建时间
  27 + const [attachments, setAttachments] = useState(); //附件
  28 + const [attachmentsName, setAttachmentsName] = useState(''); // 附件名称
  29 +
  30 + useEffect(() => {
  31 + const request = async () => {
  32 + console.log(data, '5656datasearch');
  33 + const res = await postAdminClientQueryClientComunicationInfo({
  34 + data: {
  35 + id: data.id,
  36 + },
  37 + });
  38 + console.log(res, '5656res');
  39 + const dataSearch = res.data.data[0];
  40 + if (dataSearch) {
  41 + if (dataSearch.attachments) {
  42 + const url = dataSearch.attachments;
  43 + const match = url.match(/aliyuncs\.com\/(.*?)\?/);
  44 + let decodedStr = '';
  45 +
  46 + if (match) {
  47 + // 获取匹配的字符串并进行解码
  48 + const encodedStr = match[1];
  49 + decodedStr = decodeURIComponent(encodedStr);
  50 + setAttachmentsName(decodedStr); // 设置跟进日期
  51 + }
  52 + }
  53 + setDatetime(dataSearch.datetime); // 设置跟进日期
  54 + // setDateRange(data.dateRange || []); // 设置跟进时间范围
  55 + setCreateByName(dataSearch.createByName); // 设置跟进人员
  56 + setClientName(dataSearch.clientName); // 设置客户名称
  57 + // setClientAddress(data.clientAddress || ''); // 设置客户地址
  58 + // setClientNameLike(data.clientNameLike || ''); // 设置客户名称模糊查询
  59 + // setClientAddressLike(data.clientAddressLike || ''); // 设置客户地址模糊查询
  60 + // setTradeStatus(data.tradeStatus || ''); // 设置客户状态
  61 + // setTradeStatusLike(data.tradeStatusLike || ''); // 设置客户状态模糊查询
  62 + setContent(dataSearch.content); // 设置跟进详情
  63 + setCreateTime(dataSearch.createTime); // 设置创建时间
  64 + setWay(dataSearch.wayText);
  65 + setAttachments(dataSearch.attachments);
  66 + }
  67 + console.log(attachments, '5656attachments');
  68 + };
  69 + request();
  70 + }, []);
  71 + const items = [
  72 + {
  73 + key: '1',
  74 + label: '跟进日期',
  75 + children: datetime, // 跟进日期
  76 + },
  77 + {
  78 + key: '2',
  79 + label: '跟进人员',
  80 + children: createByName, // 跟进人员
  81 + },
  82 + {
  83 + key: '3',
  84 + label: '客户名称',
  85 + children: clientName, // 客户名称
  86 + },
  87 + {
  88 + key: '4',
  89 + label: '跟进详情',
  90 + children: content, // 跟进详情
  91 + },
  92 + {
  93 + key: '5',
  94 + label: '创建时间',
  95 + children: createTime, // 创建时间
  96 + },
  97 + {
  98 + key: '6',
  99 + label: '跟进类型',
  100 + children: way, // 跟进类型
  101 + },
  102 + ];
  103 + const handleDelete = async () => {
  104 + console.log(JSON.stringify(data), '5656record');
  105 + // 调用删除接口
  106 + const success = await postAdminClientRemoveClientComunicationInfo({
  107 + query: {
  108 + id: data.id,
  109 + },
  110 + });
  111 + // setIsModalVisible(false);
  112 + if (success) {
  113 + actionRef?.current?.reload(); // 重新加载表格数据
  114 + }
  115 + };
  116 + return (
  117 + <Space>
  118 + <ModalForm
  119 + title="跟进记录"
  120 + trigger={<Button type="link">查看</Button>}
  121 + submitter={{
  122 + resetButtonProps: {
  123 + style: {
  124 + display: 'none',
  125 + },
  126 + },
  127 + submitButtonProps: {
  128 + style: {
  129 + display: 'none',
  130 + },
  131 + },
  132 + render: (props, defaultDoms) => {
  133 + return [
  134 + ...defaultDoms,
  135 + <>
  136 + <ClientModal
  137 + key={'modify'}
  138 + data={data} // 将表单数据传递给 ClientModal
  139 + reloadTable={() => {
  140 + actionRef?.current?.reload(); // 重新加载表格数据
  141 + props.submit();
  142 + reloadTable();
  143 + console.log('5656close');
  144 + }}
  145 + type={'modify'}
  146 + onFinish={() => {
  147 + // setIsModalVisible(false);
  148 + }} // 关闭 Modal
  149 + style={{ marginRight: '10px' }}
  150 + />
  151 + <Button
  152 + key={'delete'}
  153 + onClick={() => {
  154 + handleDelete();
  155 + props.submit();
  156 + reloadTable();
  157 + }}
  158 + type="primary"
  159 + size="middle"
  160 + danger // 使用 danger 属性来将按钮颜色设置为红色
  161 + style={{ marginLeft: '10px' }}
  162 + onFinish={() => {
  163 + actionRef.current.reload();
  164 + }}
  165 + >
  166 + 删除
  167 + </Button>
  168 + </>,
  169 + ];
  170 + },
  171 + }}
  172 + onFinish={async () => {
  173 + // 提交成功后,显示 ClientDrawer
  174 + // setIsModalVisible(true);
  175 + return true;
  176 + }}
  177 + >
  178 + <Descriptions items={items} column={1} />
  179 + {attachmentsName && (
  180 + <a href={attachments} download>
  181 + 附件:{attachmentsName}
  182 + </a>
  183 + )}
  184 + </ModalForm>
  185 + </Space>
  186 + );
  187 +};
... ...
src/pages/Client/FollowRecord/index.tsx 0 → 100644
  1 +import { RESPONSE_CODE } from '@/constants/enum';
  2 +import ClientModal from '@/pages/Client/FollowRecord/Components/ClientModal';
  3 +import CommunicationHistoryModal from '@/pages/Client/FollowRecord/Components/CommunicationHistoryModal';
  4 +import {
  5 + postAdminClientQueryClientComunicationInfo,
  6 + postAdminClientRemoveClientComunicationInfo,
  7 + postServiceConstClientWay,
  8 + postServiceConstTradeStatus,
  9 +} from '@/services';
  10 +import { enumToSelect } from '@/utils';
  11 +import type { ActionType } from '@ant-design/pro-components';
  12 +import { ProTable } from '@ant-design/pro-components';
  13 +import { Button, Space, message } from 'antd';
  14 +import { useRef, useState } from 'react';
  15 +
  16 +export default () => {
  17 + const actionRef = useRef<ActionType>();
  18 + const [refreshKey, setRefreshKey] = useState(0); // 用于强制刷新的键
  19 +
  20 + const reload = () => {
  21 + actionRef.current.reload(); // 重新加载数据
  22 + console.log('5656flush');
  23 +
  24 + // 更新 refreshKey,强制刷新 CommunicationHistoryModal
  25 + setRefreshKey((prevKey) => prevKey + 1);
  26 + };
  27 + //biaoji
  28 + const columns = [
  29 + {
  30 + title: '跟进日期',
  31 + key: 'datetime',
  32 + width: 150,
  33 + ellipsis: true,
  34 + dataIndex: 'datetime',
  35 + valueType: 'dateTime',
  36 + hideInSearch: true,
  37 + // search: {
  38 + // transform: (value) => {
  39 + // if (value) {
  40 + // return {
  41 + // createTimeGe: value[0],
  42 + // createTimeLe: value[1],
  43 + // };
  44 + // }
  45 + // },
  46 + // },
  47 + },
  48 + {
  49 + title: '跟进时间',
  50 + dataIndex: 'dateRange',
  51 + valueType: 'dateRange',
  52 + hideInTable: true,
  53 + search: {
  54 + transform: (value) => {
  55 + if (value) {
  56 + return {
  57 + dateTimeGe: value[0],
  58 + dateTimeLe: value[1],
  59 + };
  60 + }
  61 + },
  62 + },
  63 + },
  64 + {
  65 + title: '跟进人员',
  66 + dataIndex: 'updateByName',
  67 + width: 100,
  68 + ellipsis: true,
  69 + hideInSearch: false,
  70 + },
  71 + {
  72 + title: '客户名称',
  73 + dataIndex: 'clientName',
  74 + width: 150,
  75 + ellipsis: true,
  76 + hideInSearch: true,
  77 + },
  78 + {
  79 + title: '客户地址',
  80 + dataIndex: 'clientAddress',
  81 + width: 250,
  82 + ellipsis: true,
  83 + hideInSearch: true,
  84 + },
  85 + {
  86 + title: '跟进类型',
  87 + dataIndex: 'wayText',
  88 + width: 100,
  89 + ellipsis: true,
  90 + hideInSearch: true,
  91 + },
  92 + {
  93 + title: '跟进类型',
  94 + dataIndex: 'way',
  95 + width: 100,
  96 + ellipsis: true,
  97 + hideInSearch: false,
  98 + hideInTable: true,
  99 + request: async () => {
  100 + const res = await postServiceConstClientWay();
  101 + return enumToSelect(res.data);
  102 + },
  103 + },
  104 + {
  105 + title: '客户名称',
  106 + dataIndex: 'clientNameLike',
  107 + width: 150,
  108 + ellipsis: true,
  109 + hideInSearch: false,
  110 + hideInTable: true,
  111 + },
  112 + {
  113 + title: '客户地址',
  114 + dataIndex: 'clientAddressLike',
  115 + width: 250,
  116 + ellipsis: true,
  117 + hideInSearch: false,
  118 + hideInTable: true,
  119 + },
  120 + {
  121 + title: '客户状态',
  122 + dataIndex: 'tradeStatus',
  123 + width: 100,
  124 + ellipsis: true,
  125 + hideInSearch: true,
  126 + },
  127 + {
  128 + title: '客户状态',
  129 + dataIndex: 'tradeStatusLike',
  130 + width: 100,
  131 + ellipsis: true,
  132 + hideInSearch: false,
  133 + hideInTable: true,
  134 + request: async () => {
  135 + const res = await postServiceConstTradeStatus();
  136 + return enumToSelect(res.data);
  137 + },
  138 + },
  139 + {
  140 + title: '跟进详情',
  141 + dataIndex: 'content',
  142 + width: 250,
  143 + ellipsis: true,
  144 + hideInSearch: false,
  145 + },
  146 + {
  147 + title: '创建时间',
  148 + dataIndex: 'createTime',
  149 + width: 150,
  150 + ellipsis: true,
  151 + hideInSearch: true,
  152 + },
  153 + {
  154 + title: '附件',
  155 + dataIndex: 'attachments',
  156 + width: 150,
  157 + ellipsis: true,
  158 + hideInSearch: true,
  159 + hideInTable: true,
  160 + },
  161 + {
  162 + title: '操作',
  163 + valueType: 'option',
  164 + key: 'option',
  165 + width: 150,
  166 + render: (text, record, index, action) => {
  167 + const handleDelete = async () => {
  168 + // console.log(JSON.stringify(record), '5656record');
  169 + // 调用删除接口
  170 + const success = await postAdminClientRemoveClientComunicationInfo({
  171 + query: {
  172 + id: record.id,
  173 + },
  174 + });
  175 + if (success) {
  176 + action.reload(); // 刷新表格
  177 + }
  178 + };
  179 + return [
  180 + <CommunicationHistoryModal
  181 + // key={'communicationHistory'}
  182 + key={`communicationHistory-${refreshKey}`} // 使用 refreshKey 来强制更新组件
  183 + data={record}
  184 + // reloadTable={() => {
  185 + // actionRef.current.reload();
  186 + // console.log('5656flush');
  187 + // }}
  188 + reloadTable={reload}
  189 + />,
  190 + <>
  191 + <Button
  192 + key={'delete'}
  193 + onClick={() => {
  194 + handleDelete();
  195 + actionRef.current.reload();
  196 + }}
  197 + // reloadTable={() => {
  198 + // actionRef.current.reload();
  199 + // }}
  200 + type="link"
  201 + size="middle"
  202 + // 使用 danger 属性来将按钮颜色设置为红色
  203 + // onFinish={() => {
  204 + // actionRef.current.reload();
  205 + // }}
  206 + >
  207 + 删除
  208 + </Button>
  209 + </>,
  210 + ];
  211 + },
  212 + },
  213 + ];
  214 +
  215 + // useEffect(() => {
  216 + // const pullGroupFilterDataOptions = async () => {
  217 + // const res = await postServiceConstClientGroupFilters();
  218 + // console.log('setGroupFilterDataOptions' + JSON.stringify(res.data));
  219 + // setGroupFilterDataOptions(enumToSelect(res.data));
  220 + // };
  221 + // pullGroupFilterDataOptions();
  222 + // }, []);
  223 + // useEffect(() => {
  224 + // actionRef.current?.reload();
  225 + // }, [groupFilter]);
  226 + return (
  227 + <>
  228 + <Space direction="vertical" size="middle" style={{ display: 'flex' }}>
  229 + <ProTable
  230 + columns={columns}
  231 + actionRef={actionRef}
  232 + cardBordered
  233 + request={async (params) => {
  234 + const res = await postAdminClientQueryClientComunicationInfo({
  235 + data: {
  236 + ...params,
  237 + },
  238 + });
  239 + console.log(params, '5656566params');
  240 + if (res.result === RESPONSE_CODE.SUCCESS) {
  241 + console.log(JSON.stringify(res.data));
  242 + return {
  243 + ...res.data,
  244 + data: res.data.data.map((item) => {
  245 + return {
  246 + ...item,
  247 + tid: (Math.random() * 1000000).toFixed(0),
  248 + };
  249 + }),
  250 + };
  251 + } else {
  252 + message.error('获取失败');
  253 + }
  254 + }}
  255 + search={{
  256 + optionRender: (searchConfig, formProps, dom) => [...dom.reverse()],
  257 + }}
  258 + scroll={{
  259 + x: 1400,
  260 + }}
  261 + editable={{
  262 + type: 'multiple',
  263 + }}
  264 + columnsState={{
  265 + persistenceKey: 'pro-table-singe-demos',
  266 + persistenceType: 'localStorage',
  267 + defaultValue: {
  268 + option: { fixed: 'right', disable: true },
  269 + },
  270 + onChange(value) {
  271 + console.log('value: ', value);
  272 + },
  273 + }}
  274 + rowKey="id"
  275 + options={{
  276 + setting: {
  277 + listsHeight: 400,
  278 + },
  279 + }}
  280 + form={{
  281 + // 由于配置了 transform,提交的参与与定义的不同这里需要转化一下
  282 + syncToUrl: (values, type) => {
  283 + if (type === 'get') {
  284 + return {
  285 + ...values,
  286 + created_at: [values.startTime, values.endTime],
  287 + };
  288 + }
  289 + return values;
  290 + },
  291 + }}
  292 + pagination={{
  293 + pageSize: 5,
  294 + onChange: (page) => console.log(page),
  295 + }}
  296 + dateFormatter="string"
  297 + headerTitle="高级表格"
  298 + toolBarRender={() => [
  299 + <ClientModal
  300 + key={'add'}
  301 + reloadTable={() => {
  302 + actionRef.current.reload();
  303 + }}
  304 + type={'add'}
  305 + />,
  306 + ]}
  307 + />
  308 + </Space>
  309 + {/* {contextHolder} */}
  310 + </>
  311 + );
  312 +};
... ...
src/pages/Order/Order/components/ConfirmReceiptModal.tsx
... ... @@ -107,8 +107,8 @@ export default ({ data, onClose }) =&gt; {
107 107 setPreviewOpen(true);
108 108 setPreviewTitle(
109 109 file.name ||
110   - file.originFileObj?.name ||
111   - file.url!.substring(file.url!.lastIndexOf('/') + 1),
  110 + file.originFileObj?.name ||
  111 + file.url!.substring(file.url!.lastIndexOf('/') + 1),
112 112 );
113 113 };
114 114  
... ...
src/pages/Order/Order/components/DeliverModal.tsx
... ... @@ -260,7 +260,7 @@ const DeliverModal = ({
260 260 serialNumber: item.serialNumber,
261 261 packageNumber:
262 262 item.packageNumber === null ||
263   - item.packageNumber === undefined
  263 + item.packageNumber === undefined
264 264 ? 1
265 265 : item.packageNumber,
266 266 logisticsNotes: item.logisticsNotes,
... ...
src/pages/Order/Order/components/FeedbackRegistrationModal.tsx 0 → 100644
  1 +import { postServiceOrderFeedbackRegistration } from '@/services/request';
  2 +import { Input, Modal } from 'antd';
  3 +import { useState } from 'react';
  4 +
  5 +// import { cloneDeep } from 'lodash';
  6 +export default ({ setVisible, subOrders, mainOrder, onClose }) => {
  7 + const [isModalOpen] = useState(true);
  8 + const { TextArea } = Input;
  9 + const [textValue, setTextValue] = useState('');
  10 +
  11 + const handleOk = async () => {
  12 + console.log(subOrders, '5656subOrders', mainOrder);
  13 + await postServiceOrderFeedbackRegistration({
  14 + data: {
  15 + id: subOrders[0].id,
  16 + feedbackRegistrationContent: textValue,
  17 + },
  18 + });
  19 + onClose();
  20 + // setIsModalOpen(false);
  21 + // onClose();
  22 + };
  23 + const handleCancel = () => {
  24 + setVisible(false);
  25 + onClose();
  26 + // setIsModalOpen(false);
  27 + // onClose();
  28 + };
  29 + const handleChange = (e) => {
  30 + setTextValue(e.target.value);
  31 + };
  32 + return (
  33 + <>
  34 + {/* <ModalForm<{
  35 + filePaths: any;
  36 + }>
  37 + width={500}
  38 + open
  39 + title="回访登记"
  40 + form={form}
  41 + autoFocusFirstInput
  42 + modalProps={{
  43 + okText: '提交',
  44 + cancelText: '取消',
  45 + destroyOnClose: true,
  46 + onCancel: () => {
  47 + setVisible(false);
  48 + },
  49 + }}
  50 + onFinish={async () => {
  51 + onClose();
  52 + }}
  53 + onOpenChange={setVisible}
  54 + >
  55 + <TextArea rows={6} placeholder="请输入" />
  56 + </ModalForm> */}
  57 + <Modal
  58 + title="回访登记"
  59 + open={isModalOpen}
  60 + onOk={handleOk}
  61 + onCancel={handleCancel}
  62 + >
  63 + <TextArea
  64 + rows={6}
  65 + placeholder="请输入"
  66 + onChange={handleChange}
  67 + value={textValue}
  68 + />
  69 + </Modal>
  70 + </>
  71 + );
  72 +};
... ...
src/pages/Order/Order/components/FinancialDrawer.tsx
... ... @@ -144,107 +144,107 @@ export default ({
144 144  
145 145 {invoicingStatus !== 'UN_INVOICE'
146 146 ? [
147   - <ProFormDatePicker
148   - key="invoicingTime"
149   - width="lg"
150   - name="invoicingTime"
151   - label="开票时间"
152   - disabled={isEdit}
153   - rules={[
154   - { required: !isEdit ? true : false, message: '这是必填项' },
155   - ]}
156   - initialValue={subOrders[0]?.invoicingTime}
157   - />,
158   - <ProFormText
159   - key="purchaser"
160   - width="lg"
161   - name="purchaser"
162   - label="抬头名称"
163   - disabled={isEdit}
164   - rules={[
165   - { required: !isEdit ? true : false, message: '这是必填项' },
166   - ]}
167   - initialValue={subOrders[0]?.purchaser}
168   - />,
169   - <ProFormDatePicker
170   - key="financialReceiptIssuanceTime"
171   - width="lg"
172   - name="financialReceiptIssuanceTime"
173   - label="开收据时间"
174   - initialValue={subOrders[0]?.financialReceiptIssuanceTime}
175   - />,
176   - <ProFormDatePicker
177   - key="collectMoneyTime"
178   - width="lg"
179   - name="collectMoneyTime"
180   - label="收款时间"
181   - initialValue={subOrders[0]?.collectMoneyTime}
182   - />,
183   - <ProFormText
184   - width="lg"
185   - key="invoiceNumber"
186   - name="invoiceNumber"
187   - label="发票号码"
188   - initialValue={subOrders[0]?.invoiceNumber}
189   - rules={[{ required: true, message: '发票号码必填' }]}
190   - />,
191   - <div
192   - key="salesChooseReceivingCompany"
193   - hidden={subOrders[0].receivingCompany === null}
194   - >
195   - <span className={'pl-2 text-xs text-gray-400'}>
196   - 销售申请开票时选择了:
197   - {enumValueToLabel(
198   - subOrders[0].receivingCompany,
199   - getReceivingCompanyOptions(PAYEE_OPTIONS),
200   - )}
201   - </span>
202   - <span
203   - hidden={subOrders[0].receivingCompany === 'ANY'}
204   - className={
205   - 'pl-2 text-xs text-[#1677ff] cursor-pointer hover:text-[#64abf7]'
206   - }
207   - onClick={() => {
208   - chooseReceivingCompany(subOrders[0].receivingCompany);
209   - }}
  147 + <ProFormDatePicker
  148 + key="invoicingTime"
  149 + width="lg"
  150 + name="invoicingTime"
  151 + label="开票时间"
  152 + disabled={isEdit}
  153 + rules={[
  154 + { required: !isEdit ? true : false, message: '这是必填项' },
  155 + ]}
  156 + initialValue={subOrders[0]?.invoicingTime}
  157 + />,
  158 + <ProFormText
  159 + key="purchaser"
  160 + width="lg"
  161 + name="purchaser"
  162 + label="抬头名称"
  163 + disabled={isEdit}
  164 + rules={[
  165 + { required: !isEdit ? true : false, message: '这是必填项' },
  166 + ]}
  167 + initialValue={subOrders[0]?.purchaser}
  168 + />,
  169 + <ProFormDatePicker
  170 + key="financialReceiptIssuanceTime"
  171 + width="lg"
  172 + name="financialReceiptIssuanceTime"
  173 + label="开收据时间"
  174 + initialValue={subOrders[0]?.financialReceiptIssuanceTime}
  175 + />,
  176 + <ProFormDatePicker
  177 + key="collectMoneyTime"
  178 + width="lg"
  179 + name="collectMoneyTime"
  180 + label="收款时间"
  181 + initialValue={subOrders[0]?.collectMoneyTime}
  182 + />,
  183 + <ProFormText
  184 + width="lg"
  185 + key="invoiceNumber"
  186 + name="invoiceNumber"
  187 + label="发票号码"
  188 + initialValue={subOrders[0]?.invoiceNumber}
  189 + rules={[{ required: true, message: '发票号码必填' }]}
  190 + />,
  191 + <div
  192 + key="salesChooseReceivingCompany"
  193 + hidden={subOrders[0].receivingCompany === null}
210 194 >
211   - 选择
212   - </span>
213   - </div>,
214   - <ProFormSelect
215   - key="payee"
216   - placeholder="选择收款单位"
217   - name="payee"
218   - width="lg"
219   - showSearch
220   - label="收款单位"
221   - options={enumToSelect(PAYEE_OPTIONS)}
222   - initialValue={subOrders[0]?.payee}
223   - rules={[{ required: true, message: '收款单位必填' }]}
224   - />,
225   -
226   - <div id="total-payment" key="money">
227   - <ProFormDigit
228   - key="money"
229   - name="money"
  195 + <span className={'pl-2 text-xs text-gray-400'}>
  196 + 销售申请开票时选择了:
  197 + {enumValueToLabel(
  198 + subOrders[0].receivingCompany,
  199 + getReceivingCompanyOptions(PAYEE_OPTIONS),
  200 + )}
  201 + </span>
  202 + <span
  203 + hidden={subOrders[0].receivingCompany === 'ANY'}
  204 + className={
  205 + 'pl-2 text-xs text-[#1677ff] cursor-pointer hover:text-[#64abf7]'
  206 + }
  207 + onClick={() => {
  208 + chooseReceivingCompany(subOrders[0].receivingCompany);
  209 + }}
  210 + >
  211 + 选择
  212 + </span>
  213 + </div>,
  214 + <ProFormSelect
  215 + key="payee"
  216 + placeholder="选择收款单位"
  217 + name="payee"
230 218 width="lg"
231   - label="金额"
232   - rules={[{ required: true, message: '金额必填' }]}
233   - tooltip="点击计算,合计所有子订单对应主订单总额"
234   - fieldProps={{
235   - addonAfter: (
236   - <Button
237   - className="rounded-l-none"
238   - type="primary"
239   - onClick={computeTotalPayment}
240   - >
241   - 计算
242   - </Button>
243   - ),
244   - }}
245   - />
246   - </div>,
247   - ]
  219 + showSearch
  220 + label="收款单位"
  221 + options={enumToSelect(PAYEE_OPTIONS)}
  222 + initialValue={subOrders[0]?.payee}
  223 + rules={[{ required: true, message: '收款单位必填' }]}
  224 + />,
  225 +
  226 + <div id="total-payment" key="money">
  227 + <ProFormDigit
  228 + key="money"
  229 + name="money"
  230 + width="lg"
  231 + label="金额"
  232 + rules={[{ required: true, message: '金额必填' }]}
  233 + tooltip="点击计算,合计所有子订单对应主订单总额"
  234 + fieldProps={{
  235 + addonAfter: (
  236 + <Button
  237 + className="rounded-l-none"
  238 + type="primary"
  239 + onClick={computeTotalPayment}
  240 + >
  241 + 计算
  242 + </Button>
  243 + ),
  244 + }}
  245 + />
  246 + </div>,
  247 + ]
248 248 : ''}
249 249  
250 250 <ProFormSelect
... ...
src/pages/Order/Order/components/FinancialEditDrawer.tsx
... ... @@ -130,24 +130,24 @@ export default ({ mainOrder, subOrders, setVisible, isMainOrder, onClose }) =&gt; {
130 130 width="lg"
131 131 name="financialReceiptIssuanceTime"
132 132 label="开收据时间"
133   - // rules={[
134   - // {
135   - // required: !isMainOrder && invoicingStatus === 'UN_INVOICE',
136   - // message: '开收据时间必填',
137   - // },
138   - // ]}
  133 + // rules={[
  134 + // {
  135 + // required: !isMainOrder && invoicingStatus === 'UN_INVOICE',
  136 + // message: '开收据时间必填',
  137 + // },
  138 + // ]}
139 139 />
140 140 <ProFormDatePicker
141 141 key="collectMoneyTime"
142 142 width="lg"
143 143 name="collectMoneyTime"
144 144 label="收款时间"
145   - // rules={[
146   - // {
147   - // required: !isMainOrder && invoicingStatus === 'UN_INVOICE',
148   - // message: '收款时间必填',
149   - // },
150   - // ]}
  145 + // rules={[
  146 + // {
  147 + // required: !isMainOrder && invoicingStatus === 'UN_INVOICE',
  148 + // message: '收款时间必填',
  149 + // },
  150 + // ]}
151 151 />
152 152 </DrawerForm>
153 153 );
... ...
src/pages/Order/Order/components/ImagesViewerModal.tsx
... ... @@ -3,7 +3,7 @@ import { Button, Divider, Image, Modal } from &#39;antd&#39;;
3 3 import { useEffect, useState } from 'react';
4 4 export default ({ setVisible, optType, onClose, orderRow }) => {
5 5 const [images, setImages] = useState<any[]>([]);
6   - const [title, setTitle] = useState("收货凭证");
  6 + const [title, setTitle] = useState('收货凭证');
7 7 const handleOk = () => {
8 8 onClose();
9 9 setVisible(false);
... ... @@ -23,7 +23,7 @@ export default ({ setVisible, optType, onClose, orderRow }) =&gt; {
23 23 }
24 24 useEffect(() => {
25 25 if (optType === 'shippingReceipt') {
26   - setTitle("收货凭证");
  26 + setTitle('收货凭证');
27 27 getImages();
28 28 } else if (optType === 'paymentReceipt') {
29 29 let paymentReceiptsImagesList: any[] = [];
... ... @@ -34,7 +34,6 @@ export default ({ setVisible, optType, onClose, orderRow }) =&gt; {
34 34 paymentReceiptsImagesList = [...new Set(paymentReceiptsImagesList)];
35 35 setImages(paymentReceiptsImagesList);
36 36 }
37   -
38 37 }, []);
39 38  
40 39 return (
... ...
src/pages/Order/Order/components/ModifiedDiffModal.tsx
... ... @@ -106,7 +106,7 @@ export default ({ setVisible, subOrders, mainOrder, onClose }) =&gt; {
106 106 onClick={() => {
107 107 window.open(
108 108 '/previewApi/onlinePreview?url=' +
109   - encodeURIComponent(Base64.encode(item)),
  109 + encodeURIComponent(Base64.encode(item)),
110 110 );
111 111 }}
112 112 >
... ...
src/pages/Order/Order/components/OrderDrawer copy.tsx
... ... @@ -554,7 +554,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
554 554 onChange={(_, option) => {
555 555 autoFillSalesInfo(option);
556 556 }}
557   - // disabled={mainInfoDisbled}
  557 + // disabled={mainInfoDisbled}
558 558 />
559 559  
560 560 <ProFormText
... ... @@ -642,7 +642,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
642 642 },
643 643 }}
644 644 debounceTime={1000}
645   - request={async (value, { }) => {
  645 + request={async (value, {}) => {
646 646 const keywords = value.keyWords;
647 647 const res = await postKingdeeRepCustomer({
648 648 data: { search: keywords },
... ... @@ -740,7 +740,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
740 740 </Button>
741 741 ),
742 742 }}
743   - // disabled={mainInfoDisbled}
  743 + // disabled={mainInfoDisbled}
744 744 />
745 745 </div>
746 746  
... ... @@ -752,7 +752,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
752 752 label="支付渠道"
753 753 options={enumToSelect(PAYMENT_CHANNEL_OPTIONS)}
754 754 rules={[{ required: true, message: '支付渠道必填' }]}
755   - // disabled={mainInfoDisbled}
  755 + // disabled={mainInfoDisbled}
756 756 />
757 757 <ProFormSelect
758 758 placeholder="请输入支付方式"
... ... @@ -762,7 +762,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
762 762 label="支付方式"
763 763 options={enumToSelect(PAYMENT_METHOD_OPTIONS)}
764 764 rules={[{ required: true, message: '支付方式必填' }]}
765   - // disabled={mainInfoDisbled}
  765 + // disabled={mainInfoDisbled}
766 766 />
767 767 <ProFormSelect
768 768 placeholder="选择是否需要开票"
... ... @@ -1094,7 +1094,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1094 1094 options={enumToSelect(PRODUCT_BELONG_DEPARTMENT_OPTIONS)}
1095 1095 initialValue={'EXPERIMENTAL_CONSUMABLES'}
1096 1096 rules={[{ required: true, message: '所属事业部必填' }]}
1097   - // disabled={mainInfoDisbled}
  1097 + // disabled={mainInfoDisbled}
1098 1098 />,
1099 1099 <ProFormTextArea
1100 1100 key={'notes' + listMeta.index}
... ...
src/pages/Order/Order/components/OrderDrawer.tsx
... ... @@ -557,9 +557,9 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
557 557 form.setFieldValue(
558 558 'customerShippingAddress',
559 559 getDefaultString(option.province) +
560   - getDefaultString(option.city) +
561   - getDefaultString(option.district) +
562   - getDefaultString(option.detail),
  560 + getDefaultString(option.city) +
  561 + getDefaultString(option.district) +
  562 + getDefaultString(option.detail),
563 563 );
564 564 form.setFieldValue('customerNameString', option.realName);
565 565  
... ... @@ -642,11 +642,11 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
642 642  
643 643 message.error(
644 644 '用户余额不足,当前预减的金额为:' +
645   - data.subPrice +
646   - ',当前账号余额为:' +
647   - data.nowMoney +
648   - ',当前账号可赊账额度为:' +
649   - data.creditLimit,
  645 + data.subPrice +
  646 + ',当前账号余额为:' +
  647 + data.nowMoney +
  648 + ',当前账号可赊账额度为:' +
  649 + data.creditLimit,
650 650 );
651 651 return false;
652 652 }
... ... @@ -1111,7 +1111,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1111 1111 },
1112 1112 }}
1113 1113 debounceTime={1000}
1114   - request={async (value, { }) => {
  1114 + request={async (value, {}) => {
1115 1115 const keywords = value.keyWords;
1116 1116 if (keywords === '') {
1117 1117 return [];
... ... @@ -1867,7 +1867,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1867 1867 placeholder="请输入商品参数"
1868 1868 disabled={
1869 1869 productParametersDisabledFlagList[listMeta.index] !==
1870   - false || optType('after-sales-check')
  1870 + false || optType('after-sales-check')
1871 1871 }
1872 1872 />,
1873 1873 <ProFormDigit
... ... @@ -1920,7 +1920,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1920 1920 placeholder="请输入商品单位"
1921 1921 disabled={
1922 1922 productParametersDisabledFlagList[listMeta.index] !==
1923   - false || optType('after-sales-check')
  1923 + false || optType('after-sales-check')
1924 1924 }
1925 1925 rules={[{ required: true, message: '商品单位必填' }]}
1926 1926 />,
... ...
src/pages/Order/Order/components/UploadPayBillModal.tsx
  1 +import { RESPONSE_CODE } from '@/constants/enum';
  2 +import {
  3 + postServiceOrderFileProcess,
  4 + postServiceOrderUploadPaymentReceipt,
  5 +} from '@/services';
  6 +import { transImageFile } from '@/utils';
  7 +import { PlusOutlined } from '@ant-design/icons';
1 8 import { ModalForm } from '@ant-design/pro-components';
2 9 import { Form, Modal, Upload, UploadFile, UploadProps, message } from 'antd';
3 10 import { RcFile } from 'antd/lib/upload';
4 11 import { cloneDeep } from 'lodash';
5 12 import { useEffect, useRef, useState } from 'react';
6 13 import { COMFIR_RECEIPT_IMAGES_NUMBER } from '../../constant';
7   -import { PlusOutlined } from '@ant-design/icons';
8   -import { transImageFile } from '@/utils';
9   -import { postServiceOrderFileProcess, postServiceOrderUploadPaymentReceipt } from '@/services';
10   -import { RESPONSE_CODE } from '@/constants/enum';
11 14  
12 15 // import { cloneDeep } from 'lodash';
13 16 export default ({ setVisible, subOrders, mainOrder, onClose }) => {
... ... @@ -25,7 +28,9 @@ export default ({ setVisible, subOrders, mainOrder, onClose }) =&gt; {
25 28 reader.onerror = (error) => reject(error);
26 29 });
27 30  
28   - const subOrderIds = subOrders?.map((item: any) => { return item.id });
  31 + const subOrderIds = subOrders?.map((item: any) => {
  32 + return item.id;
  33 + });
29 34 const fileListObj = useRef<UploadFile[]>([]); //使用引用类型,使得在useEffect里面设置监听事件后,不用更新监听事件也能保持obj与外界一致
30 35 const handleBeforeUpload = (file: any) => {
31 36 setFileList([...fileList, file]);
... ... @@ -80,6 +85,7 @@ export default ({ setVisible, subOrders, mainOrder, onClose }) =&gt; {
80 85  
81 86 if (filteredArray.length >= COMFIR_RECEIPT_IMAGES_NUMBER) {
82 87 message.info('发货照片数量不能超过3');
  88 + console.log(mainOrder);
83 89 return;
84 90 }
85 91 fileListObj.current = filteredArray;
... ... @@ -105,8 +111,8 @@ export default ({ setVisible, subOrders, mainOrder, onClose }) =&gt; {
105 111 setPreviewOpen(true);
106 112 setPreviewTitle(
107 113 file.name ||
108   - file.originFileObj?.name ||
109   - file.url!.substring(file.url!.lastIndexOf('/') + 1),
  114 + file.originFileObj?.name ||
  115 + file.url!.substring(file.url!.lastIndexOf('/') + 1),
110 116 );
111 117 };
112 118 const props: UploadProps = {
... ... @@ -128,7 +134,6 @@ export default ({ setVisible, subOrders, mainOrder, onClose }) =&gt; {
128 134 };
129 135  
130 136 useEffect(() => {
131   -
132 137 document.addEventListener('paste', onPaste);
133 138 return () => {
134 139 document.removeEventListener('paste', onPaste);
... ... @@ -211,14 +216,9 @@ export default ({ setVisible, subOrders, mainOrder, onClose }) =&gt; {
211 216 }}
212 217 onOpenChange={setVisible}
213 218 >
214   -
215   - <div className="pb-4 text-xs decoration-gray-50">
216   - 可复制照片粘贴
217   - </div>
  219 + <div className="pb-4 text-xs decoration-gray-50">可复制照片粘贴</div>
218 220 <Upload {...props}>
219   - {fileList.length < COMFIR_RECEIPT_IMAGES_NUMBER
220   - ? uploadButton
221   - : ''}
  221 + {fileList.length < COMFIR_RECEIPT_IMAGES_NUMBER ? uploadButton : ''}
222 222 </Upload>
223 223 </ModalForm>
224 224  
... ...
src/pages/Order/Order/index.css
1 1 .order-page-container .ant-table .ant-table-middle {
2 2 margin-inline: 0 !important;
3 3 }
  4 +
4 5 .order-page-container td {
5   - font-family: 'San Francisco', 'Helvetica Neue', Helvetica, Arial, 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'Heiti SC', 'WenQuanYi Micro Hei', sans-serif;
  6 + font-family: 'San Francisco', 'Helvetica Neue', Helvetica, Arial,
  7 + 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'Heiti SC',
  8 + 'WenQuanYi Micro Hei', sans-serif;
6 9 font-size: 13px;
7 10 }
  11 +
8 12 #total-payment .ant-input-number-group-addon {
9 13 padding: 0 !important;
10 14 }
  15 +
11 16 .order-page-container table:hover,
12 17 .order-page-container tr:hover,
13 18 .order-page-container thead:hover {
14 19 background: none !important;
15 20 }
  21 +
16 22 #main-table .ant-table-tbody > tr.ant-table-row:hover > td {
17 23 background: none !important;
18 24 }
  25 +
19 26 .order-page-container .ant-pro-card {
20 27 background-color: transparent;
21 28 }
  29 +
22 30 #main-table .ant-table-tbody .ant-table-cell {
23 31 padding: 10px 0 0;
24 32 }
  33 +
25 34 .order-page-container .ant-pagination {
26 35 background-color: #fff !important;
27 36 padding: 10px;
28 37 border-radius: 8px;
29 38 }
  39 +
30 40 .order-page-container .ant-pro-table .ant-form {
31 41 background-color: #fff;
32 42 border-radius: 8px;
33 43 }
  44 +
34 45 #main-table .ant-table-tbody {
35 46 background-color: #f5f5f5;
36 47 }
  48 +
37 49 .order-page-container .ant-pro-card-body {
38 50 padding: 0 !important;
39 51 }
  52 +
40 53 .order-page-container .ant-table-thead .ant-table-cell {
41 54 background-color: #fff !important;
42 55 border-radius: 8px !important;
43 56 }
  57 +
44 58 #sub-table tbody td {
45 59 padding: 10px 0 !important;
46 60 }
  61 +
47 62 #sub-table tbody tr:first-child td:first-child {
48 63 border-top-left-radius: 8px;
49 64 }
  65 +
50 66 #sub-table tbody tr:first-child td:nth-child(2) {
51 67 border-top-right-radius: 8px;
52 68 }
  69 +
53 70 #sub-table tbody tr:last-child td:first-child {
54 71 border-bottom-left-radius: 8px;
55 72 }
  73 +
56 74 #sub-table tbody tr:last-child td:nth-child(2) {
57 75 border-bottom-right-radius: 8px;
58 76 }
  77 +
59 78 #sub-table tbody tr td:first-child {
60 79 border-top: 1px solid #d7d6d6;
  80 +
61 81 /* 设置行与行之间分割线的颜色 */
62 82 border-bottom: 1px solid #d7d6d6;
  83 +
63 84 /* 设置行与行之间分割线的颜色 */
64 85 border-left: 1px solid #d7d6d6;
  86 +
65 87 /* 设置行与行之间分割线的颜色 */
66 88 }
  89 +
67 90 #sub-table tbody tr td:nth-child(2) {
68 91 border-top: 1px solid #d7d6d6;
  92 +
69 93 /* 设置行与行之间分割线的颜色 */
70 94 border-bottom: 1px solid #d7d6d6;
  95 +
71 96 /* 设置行与行之间分割线的颜色 */
72 97 border-right: 1px solid #d7d6d6;
  98 +
73 99 /* 设置行与行之间分割线的颜色 */
74 100 }
... ...
src/pages/Order/Order/index.tsx
... ... @@ -111,6 +111,7 @@ import CheckModal from &#39;./components/CheckModal&#39;;
111 111 import ConfirmReceiptModal from './components/ConfirmReceiptModal';
112 112 import DeliverInfoDrawer from './components/DeliverInfoDrawer';
113 113 import DeliverModal from './components/DeliverModal';
  114 +import FeedbackRegistrationModal from './components/FeedbackRegistrationModal';
114 115 import FinancialDrawer from './components/FinancialDrawer';
115 116 import FinancialEditDrawer from './components/FinancialEditDrawer';
116 117 import FinancialMergeDrawer from './components/FinancialMergeDrawer';
... ... @@ -146,6 +147,10 @@ const OrderPage = () =&gt; {
146 147 useState<boolean>(false);
147 148 const [uploadPayBillModalVisible, setUploadPayBillModalVisible] =
148 149 useState<boolean>(false);
  150 + const [
  151 + feedbackRegistrationModalVisible,
  152 + setFeedbackRegistrationModalVisible,
  153 + ] = useState<boolean>(false);
149 154 const [modifiedDiffModalVisible, setModifiedDiffModalVisible] =
150 155 useState<boolean>(false);
151 156 const [financialReceiptsModalVisible, setFinancialReceiptsModalVisible] =
... ... @@ -690,7 +695,7 @@ const OrderPage = () =&gt; {
690 695 * @param optRecord
691 696 */
692 697 function getOrderStatusTag(optRecord: any): import('react').ReactNode {
693   - console.log(optRecord);
  698 + console.log(optRecord, '5656optRecord');
694 699  
695 700 const orderStatus = optRecord.orderStatus;
696 701 const paymentMethod = optRecord.paymentMethod;
... ... @@ -2095,6 +2100,20 @@ const OrderPage = () =&gt; {
2095 2100 ) : (
2096 2101 ''
2097 2102 )}
  2103 + {optRecord.paths?.includes('feedbackRegistration') ? (
  2104 + <Button
  2105 + className="p-0"
  2106 + type="link"
  2107 + onClick={() => {
  2108 + createOptObject(optRecord.id, record.id);
  2109 + setFeedbackRegistrationModalVisible(true);
  2110 + }}
  2111 + >
  2112 + 回访登记
  2113 + </Button>
  2114 + ) : (
  2115 + ''
  2116 + )}
2098 2117  
2099 2118 {optRecord.paths?.includes('confirmInvoice') ? (
2100 2119 <ButtonConfirm
... ... @@ -2316,6 +2335,31 @@ const OrderPage = () =&gt; {
2316 2335 ) : (
2317 2336 ''
2318 2337 )}
  2338 +
  2339 + {isAdmin() || isSales() ? (
  2340 + <Flex title={optRecord.notes} className="pt-2">
  2341 + <div className="flex items-center">
  2342 + <div className="flex items-center max-w-[500px]">
  2343 + <div className="max-w-md overflow-hidden whitespace-no-wrap overflow-ellipsis">
  2344 + <Tooltip
  2345 + title={optRecord.feedbackRegistrationContent}
  2346 + placement="topLeft"
  2347 + >
  2348 + <span className="text-[#8C8C8C] mr-3">
  2349 + 产品回访登记:
  2350 + {optRecord.feedbackRegistrationContent === undefined ||
  2351 + optRecord.feedbackRegistrationContent === null
  2352 + ? '暂无'
  2353 + : optRecord.feedbackRegistrationContent}
  2354 + </span>
  2355 + </Tooltip>
  2356 + </div>
  2357 + </div>
  2358 + </div>
  2359 + </Flex>
  2360 + ) : (
  2361 + ''
  2362 + )}
2319 2363 </>
2320 2364 );
2321 2365 };
... ... @@ -4548,6 +4592,8 @@ const OrderPage = () =&gt; {
4548 4592  
4549 4593 const [invoiceWarningNum, setInvoiceWarningNum] = useState(0);
4550 4594 const [invoiceRefundWarningNum, setInvoiceRefundWarningNum] = useState(0);
  4595 + const [waitConfirmPayment, setWaitConfirmPayment] = useState(0);
  4596 + const [waitFeedback, setWaitFeedback] = useState(0);
4551 4597 const [open, setOpen] = useState(false);
4552 4598 const { openCount, setOpenCount } = useModel('count');
4553 4599  
... ... @@ -4564,6 +4610,8 @@ const OrderPage = () =&gt; {
4564 4610 }
4565 4611 setInvoiceWarningNum(res.data.waitConfirmInvoice);
4566 4612 setInvoiceRefundWarningNum(res.data.waitConfirmReceipt);
  4613 + setWaitConfirmPayment(res.data.waitConfirmPayment);
  4614 + setWaitFeedback(res.data.waitFeedback);
4567 4615 }
4568 4616  
4569 4617 useEffect(() => {
... ... @@ -4600,7 +4648,7 @@ const OrderPage = () =&gt; {
4600 4648 </Button>,
4601 4649 ]}
4602 4650 >
4603   - <Row
  4651 + {/* <Row
4604 4652 gutter={16}
4605 4653 justify="space-between" // Aligns Cols to the start and end
4606 4654 align="middle" // Vertically center contents
... ... @@ -4693,15 +4741,264 @@ const OrderPage = () =&gt; {
4693 4741 </Card>
4694 4742 </div>
4695 4743 </Col>
  4744 + </Row> */}
  4745 + <Row
  4746 + gutter={16}
  4747 + justify="space-between" // Aligns Cols to the start and end
  4748 + align="middle" // Vertically center contents
  4749 + >
  4750 + {/* 新增卡片1: 待确认收货订单 */}
  4751 + <Col span={6}>
  4752 + {' '}
  4753 + {/* 修改位置:将 span 改为 6,以保证一行四个卡片 */}
  4754 + <div
  4755 + style={{
  4756 + display: 'flex',
  4757 + justifyContent: 'center',
  4758 + marginTop: '20px',
  4759 + }}
  4760 + >
  4761 + <Card
  4762 + bordered={true}
  4763 + style={{
  4764 + backgroundColor: '#f0f0f0', // 背景颜色
  4765 + width: '200px', // 卡片宽度
  4766 + height: '200px', // 卡片高度
  4767 + display: 'flex',
  4768 + alignItems: 'center',
  4769 + justifyContent: 'center',
  4770 + }}
  4771 + >
  4772 + <div
  4773 + style={{
  4774 + fontWeight: 'bold', // 字体加粗
  4775 + color: 'black', // 字体颜色
  4776 + fontSize: '20px', // 字体大小
  4777 + }}
  4778 + >
  4779 + <div
  4780 + style={{
  4781 + fontWeight: 'bold', // 字体加粗
  4782 + color: 'black', // 字体颜色
  4783 + fontSize: '40px', // 字体大小
  4784 + justifyContent: 'center',
  4785 + display: 'flex',
  4786 + alignItems: 'center',
  4787 + marginBottom: '20px',
  4788 + }}
  4789 + >
  4790 + {waitConfirmPayment}
  4791 + </div>
  4792 + 待确认收货订单
  4793 + </div>
  4794 + </Card>
  4795 + </div>
  4796 + </Col>
  4797 +
  4798 + {/* 新增卡片2: 待回访登记订单 */}
  4799 + <Col span={6}>
  4800 + {' '}
  4801 + {/* 修改位置:将 span 改为 6,以保证一行四个卡片 */}
  4802 + <div
  4803 + style={{
  4804 + display: 'flex',
  4805 + justifyContent: 'center',
  4806 + marginTop: '20px',
  4807 + }}
  4808 + >
  4809 + <Card
  4810 + bordered={true}
  4811 + style={{
  4812 + backgroundColor: '#f0f0f0', // 背景颜色
  4813 + width: '200px', // 卡片宽度
  4814 + height: '200px', // 卡片高度
  4815 + display: 'flex',
  4816 + alignItems: 'center',
  4817 + justifyContent: 'center',
  4818 + }}
  4819 + >
  4820 + <div
  4821 + style={{
  4822 + fontWeight: 'bold', // 字体加粗
  4823 + color: 'black', // 字体颜色
  4824 + fontSize: '20px', // 字体大小
  4825 + }}
  4826 + >
  4827 + <div
  4828 + style={{
  4829 + fontWeight: 'bold', // 字体加粗
  4830 + color: 'black', // 字体颜色
  4831 + fontSize: '40px', // 字体大小
  4832 + justifyContent: 'center',
  4833 + display: 'flex',
  4834 + alignItems: 'center',
  4835 + marginBottom: '20px',
  4836 + }}
  4837 + >
  4838 + {waitFeedback}
  4839 + </div>
  4840 + 待回访登记订单
  4841 + </div>
  4842 + </Card>
  4843 + </div>
  4844 + </Col>
  4845 +
  4846 + {/* 现有卡片: 发票待确认订单 */}
  4847 + <Col span={6}>
  4848 + {' '}
  4849 + {/* 修改位置:将 span 改为 6,以保证一行四个卡片 */}
  4850 + <div
  4851 + style={{
  4852 + display: 'flex',
  4853 + justifyContent: 'center',
  4854 + marginTop: '20px',
  4855 + }}
  4856 + >
  4857 + <Card
  4858 + bordered={true}
  4859 + style={{
  4860 + backgroundColor: '#f0f0f0', // 背景颜色
  4861 + width: '200px', // 卡片宽度
  4862 + height: '200px', // 卡片高度
  4863 + display: 'flex',
  4864 + alignItems: 'center',
  4865 + justifyContent: 'center',
  4866 + }}
  4867 + >
  4868 + <div
  4869 + style={{
  4870 + fontWeight: 'bold', // 字体加粗
  4871 + color: 'black', // 字体颜色
  4872 + fontSize: '20px', // 字体大小
  4873 + }}
  4874 + >
  4875 + <div
  4876 + style={{
  4877 + fontWeight: 'bold', // 字体加粗
  4878 + color: 'black', // 字体颜色
  4879 + fontSize: '40px', // 字体大小
  4880 + justifyContent: 'center',
  4881 + display: 'flex',
  4882 + alignItems: 'center',
  4883 + marginBottom: '20px',
  4884 + }}
  4885 + >
  4886 + {invoiceWarningNum}
  4887 + </div>
  4888 + 待确认发票订单
  4889 + </div>
  4890 + </Card>
  4891 + </div>
  4892 + </Col>
  4893 +
  4894 + {/* 现有卡片: 回款待确认订单 */}
  4895 + <Col span={6}>
  4896 + {' '}
  4897 + {/* 修改位置:将 span 改为 6,以保证一行四个卡片 */}
  4898 + <div
  4899 + style={{
  4900 + display: 'flex',
  4901 + justifyContent: 'center',
  4902 + marginTop: '20px',
  4903 + }}
  4904 + >
  4905 + <Card
  4906 + bordered={true}
  4907 + style={{
  4908 + backgroundColor: '#f0f0f0', // 背景颜色
  4909 + width: '200px', // 卡片宽度
  4910 + height: '200px', // 卡片高度
  4911 + display: 'flex',
  4912 + alignItems: 'center',
  4913 + justifyContent: 'center',
  4914 + }}
  4915 + >
  4916 + <div
  4917 + style={{
  4918 + fontWeight: 'bold', // 字体加粗
  4919 + color: 'black', // 字体颜色
  4920 + fontSize: '20px', // 字体大小
  4921 + }}
  4922 + >
  4923 + <div
  4924 + style={{
  4925 + fontWeight: 'bold', // 字体加粗
  4926 + color: 'black', // 字体颜色
  4927 + fontSize: '40px', // 字体大小
  4928 + justifyContent: 'center',
  4929 + display: 'flex',
  4930 + alignItems: 'center',
  4931 + marginBottom: '20px',
  4932 + }}
  4933 + >
  4934 + {invoiceRefundWarningNum}
  4935 + </div>
  4936 + 待回款订单
  4937 + </div>
  4938 + </Card>
  4939 + </div>
  4940 + </Col>
4696 4941 </Row>
4697   - <div style={{ color: 'red', padding: '40px' }}>
4698   - <p>预警说明:</p>
4699   - <p>
4700   - 1、从申请开票之日起,超过5天未【确认发票】的订单在登录时进行第一次提醒,超过15天未【确认发票】将进行每日提醒并锁单。
4701   - </p>
4702   - <p>
4703   - 2、从【确认发票】之日起,超过15天未【回款】的订单在账号登录时会进行第一次提醒,超过25天未【回款】将进行每日提醒并锁单。
  4942 +
  4943 + <div>
  4944 + <p
  4945 + style={{
  4946 + color: 'red',
  4947 + paddingLeft: '20px',
  4948 + paddingRight: '20px',
  4949 + marginTop: '10px',
  4950 + }}
  4951 + >
  4952 + 预警说明:
4704 4953 </p>
  4954 + <div
  4955 + style={{
  4956 + marginLeft: '20px',
  4957 + marginRight: '20px',
  4958 + marginBottom: '20px',
  4959 + }}
  4960 + >
  4961 + <span style={{ color: 'red' }}>确认收货预警:</span>
  4962 + <span>
  4963 + 从发货之日起计算,国内超过15天(海外30天)未【确认收货】,将进行确认收货预警提醒,超过30天(海外60天)未确认收货将锁单,并且每次登录都会提醒
  4964 + </span>
  4965 + </div>
  4966 + <div
  4967 + style={{
  4968 + marginLeft: '20px',
  4969 + marginRight: '20px',
  4970 + marginBottom: '20px',
  4971 + }}
  4972 + >
  4973 + <span style={{ color: 'red' }}>回访登记预警:</span>
  4974 + <span>
  4975 + 从【确认收货】之日起计算,国内超过15天(海外30天)未【确认收货】,将进行回访登记预警提醒,超过30天(海外30天)未回访登记将锁单,并且每次登录都会提醒
  4976 + </span>
  4977 + </div>
  4978 + <div
  4979 + style={{
  4980 + marginLeft: '20px',
  4981 + marginRight: '20px',
  4982 + marginBottom: '20px',
  4983 + }}
  4984 + >
  4985 + <span style={{ color: 'red' }}>确认发票预警:</span>
  4986 + <span>
  4987 + 从【申请开票】之日起,超过5天未和客户确认发票(不开票的订单除外)的订单将会进行第一次提醒;超过15天未和客户确认发票(不开票的订单除外)的订单将会每天进行一次提醒,并限制下单功能
  4988 + </span>
  4989 + </div>
  4990 + <div
  4991 + style={{
  4992 + marginLeft: '20px',
  4993 + marginRight: '20px',
  4994 + marginBottom: '20px',
  4995 + }}
  4996 + >
  4997 + <span style={{ color: 'red' }}>回款预警:</span>
  4998 + <span>
  4999 + 从发票确认能之日起,超过15天未确认回款的订单将会进行第一次提醒,超过25天未确认回款的订单将会每天进行并限制下单功能{' '}
  5000 + </span>
  5001 + </div>
4705 5002 </div>
4706 5003 </Modal>
4707 5004 <ProTable
... ... @@ -5285,6 +5582,24 @@ const OrderPage = () =&gt; {
5285 5582 }}
5286 5583 />
5287 5584 )}
  5585 + {feedbackRegistrationModalVisible && (
  5586 + <FeedbackRegistrationModal
  5587 + setVisible={(val: boolean) => {
  5588 + setFeedbackRegistrationModalVisible(val);
  5589 + if (!val) {
  5590 + clearOptObject();
  5591 + }
  5592 + }}
  5593 + subOrders={buildSubOrders()}
  5594 + mainOrder={buildMainOrder()}
  5595 + onClose={() => {
  5596 + setFeedbackRegistrationModalVisible(false);
  5597 + clearOptObject();
  5598 + refreshTable();
  5599 + }}
  5600 + />
  5601 + )}
  5602 +
5288 5603 {invoicingDrawerFormVisible && (
5289 5604 <InvoicingDrawerForm
5290 5605 dataList={
... ...
src/pages/Order/OrderWarning/components/CheckModal.tsx
... ... @@ -235,8 +235,8 @@ export default ({
235 235 setPreviewOpen(true);
236 236 setPreviewTitle(
237 237 file.name ||
238   - file.originFileObj?.name ||
239   - file.url!.substring(file.url!.lastIndexOf('/') + 1),
  238 + file.originFileObj?.name ||
  239 + file.url!.substring(file.url!.lastIndexOf('/') + 1),
240 240 );
241 241 };
242 242  
... ...
src/pages/Order/OrderWarning/components/ConfirmReceiptModal.tsx
... ... @@ -107,8 +107,8 @@ export default ({ data, onClose }) =&gt; {
107 107 setPreviewOpen(true);
108 108 setPreviewTitle(
109 109 file.name ||
110   - file.originFileObj?.name ||
111   - file.url!.substring(file.url!.lastIndexOf('/') + 1),
  110 + file.originFileObj?.name ||
  111 + file.url!.substring(file.url!.lastIndexOf('/') + 1),
112 112 );
113 113 };
114 114  
... ...
src/pages/Order/OrderWarning/components/DeliverModal.tsx
... ... @@ -260,7 +260,7 @@ const DeliverModal = ({
260 260 serialNumber: item.serialNumber,
261 261 packageNumber:
262 262 item.packageNumber === null ||
263   - item.packageNumber === undefined
  263 + item.packageNumber === undefined
264 264 ? 1
265 265 : item.packageNumber,
266 266 logisticsNotes: item.logisticsNotes,
... ...
src/pages/Order/OrderWarning/components/FeedbackRegistrationModal.tsx 0 → 100644
  1 +import { postServiceOrderFeedbackRegistration } from '@/services/request';
  2 +import { Input, Modal } from 'antd';
  3 +import { useState } from 'react';
  4 +
  5 +// import { cloneDeep } from 'lodash';
  6 +export default ({ setVisible, subOrders, mainOrder, onClose }) => {
  7 + const [isModalOpen] = useState(true);
  8 + const { TextArea } = Input;
  9 + const [textValue, setTextValue] = useState('');
  10 +
  11 + const handleOk = async () => {
  12 + console.log(subOrders, '5656subOrders', mainOrder);
  13 + await postServiceOrderFeedbackRegistration({
  14 + data: {
  15 + id: subOrders[0].id,
  16 + feedbackRegistrationContent: textValue,
  17 + },
  18 + });
  19 + onClose();
  20 + // setIsModalOpen(false);
  21 + // onClose();
  22 + };
  23 + const handleCancel = () => {
  24 + setVisible(false);
  25 + onClose();
  26 + // setIsModalOpen(false);
  27 + // onClose();
  28 + };
  29 + const handleChange = (e) => {
  30 + setTextValue(e.target.value);
  31 + };
  32 + return (
  33 + <>
  34 + {/* <ModalForm<{
  35 + filePaths: any;
  36 + }>
  37 + width={500}
  38 + open
  39 + title="回访登记"
  40 + form={form}
  41 + autoFocusFirstInput
  42 + modalProps={{
  43 + okText: '提交',
  44 + cancelText: '取消',
  45 + destroyOnClose: true,
  46 + onCancel: () => {
  47 + setVisible(false);
  48 + },
  49 + }}
  50 + onFinish={async () => {
  51 + onClose();
  52 + }}
  53 + onOpenChange={setVisible}
  54 + >
  55 + <TextArea rows={6} placeholder="请输入" />
  56 + </ModalForm> */}
  57 + <Modal
  58 + title="回访登记"
  59 + open={isModalOpen}
  60 + onOk={handleOk}
  61 + onCancel={handleCancel}
  62 + >
  63 + <TextArea
  64 + rows={6}
  65 + placeholder="请输入"
  66 + onChange={handleChange}
  67 + value={textValue}
  68 + />
  69 + </Modal>
  70 + </>
  71 + );
  72 +};
... ...
src/pages/Order/OrderWarning/components/FinancialDrawer.tsx
... ... @@ -144,107 +144,107 @@ export default ({
144 144  
145 145 {invoicingStatus !== 'UN_INVOICE'
146 146 ? [
147   - <ProFormDatePicker
148   - key="invoicingTime"
149   - width="lg"
150   - name="invoicingTime"
151   - label="开票时间"
152   - disabled={isEdit}
153   - rules={[
154   - { required: !isEdit ? true : false, message: '这是必填项' },
155   - ]}
156   - initialValue={subOrders[0]?.invoicingTime}
157   - />,
158   - <ProFormText
159   - key="purchaser"
160   - width="lg"
161   - name="purchaser"
162   - label="抬头名称"
163   - disabled={isEdit}
164   - rules={[
165   - { required: !isEdit ? true : false, message: '这是必填项' },
166   - ]}
167   - initialValue={subOrders[0]?.purchaser}
168   - />,
169   - <ProFormDatePicker
170   - key="financialReceiptIssuanceTime"
171   - width="lg"
172   - name="financialReceiptIssuanceTime"
173   - label="开收据时间"
174   - initialValue={subOrders[0]?.financialReceiptIssuanceTime}
175   - />,
176   - <ProFormDatePicker
177   - key="collectMoneyTime"
178   - width="lg"
179   - name="collectMoneyTime"
180   - label="收款时间"
181   - initialValue={subOrders[0]?.collectMoneyTime}
182   - />,
183   - <ProFormText
184   - width="lg"
185   - key="invoiceNumber"
186   - name="invoiceNumber"
187   - label="发票号码"
188   - initialValue={subOrders[0]?.invoiceNumber}
189   - rules={[{ required: true, message: '发票号码必填' }]}
190   - />,
191   - <div
192   - key="salesChooseReceivingCompany"
193   - hidden={subOrders[0].receivingCompany === null}
194   - >
195   - <span className={'pl-2 text-xs text-gray-400'}>
196   - 销售申请开票时选择了:
197   - {enumValueToLabel(
198   - subOrders[0].receivingCompany,
199   - getReceivingCompanyOptions(PAYEE_OPTIONS),
200   - )}
201   - </span>
202   - <span
203   - hidden={subOrders[0].receivingCompany === 'ANY'}
204   - className={
205   - 'pl-2 text-xs text-[#1677ff] cursor-pointer hover:text-[#64abf7]'
206   - }
207   - onClick={() => {
208   - chooseReceivingCompany(subOrders[0].receivingCompany);
209   - }}
  147 + <ProFormDatePicker
  148 + key="invoicingTime"
  149 + width="lg"
  150 + name="invoicingTime"
  151 + label="开票时间"
  152 + disabled={isEdit}
  153 + rules={[
  154 + { required: !isEdit ? true : false, message: '这是必填项' },
  155 + ]}
  156 + initialValue={subOrders[0]?.invoicingTime}
  157 + />,
  158 + <ProFormText
  159 + key="purchaser"
  160 + width="lg"
  161 + name="purchaser"
  162 + label="抬头名称"
  163 + disabled={isEdit}
  164 + rules={[
  165 + { required: !isEdit ? true : false, message: '这是必填项' },
  166 + ]}
  167 + initialValue={subOrders[0]?.purchaser}
  168 + />,
  169 + <ProFormDatePicker
  170 + key="financialReceiptIssuanceTime"
  171 + width="lg"
  172 + name="financialReceiptIssuanceTime"
  173 + label="开收据时间"
  174 + initialValue={subOrders[0]?.financialReceiptIssuanceTime}
  175 + />,
  176 + <ProFormDatePicker
  177 + key="collectMoneyTime"
  178 + width="lg"
  179 + name="collectMoneyTime"
  180 + label="收款时间"
  181 + initialValue={subOrders[0]?.collectMoneyTime}
  182 + />,
  183 + <ProFormText
  184 + width="lg"
  185 + key="invoiceNumber"
  186 + name="invoiceNumber"
  187 + label="发票号码"
  188 + initialValue={subOrders[0]?.invoiceNumber}
  189 + rules={[{ required: true, message: '发票号码必填' }]}
  190 + />,
  191 + <div
  192 + key="salesChooseReceivingCompany"
  193 + hidden={subOrders[0].receivingCompany === null}
210 194 >
211   - 选择
212   - </span>
213   - </div>,
214   - <ProFormSelect
215   - key="payee"
216   - placeholder="选择收款单位"
217   - name="payee"
218   - width="lg"
219   - showSearch
220   - label="收款单位"
221   - options={enumToSelect(PAYEE_OPTIONS)}
222   - initialValue={subOrders[0]?.payee}
223   - rules={[{ required: true, message: '收款单位必填' }]}
224   - />,
225   -
226   - <div id="total-payment" key="money">
227   - <ProFormDigit
228   - key="money"
229   - name="money"
  195 + <span className={'pl-2 text-xs text-gray-400'}>
  196 + 销售申请开票时选择了:
  197 + {enumValueToLabel(
  198 + subOrders[0].receivingCompany,
  199 + getReceivingCompanyOptions(PAYEE_OPTIONS),
  200 + )}
  201 + </span>
  202 + <span
  203 + hidden={subOrders[0].receivingCompany === 'ANY'}
  204 + className={
  205 + 'pl-2 text-xs text-[#1677ff] cursor-pointer hover:text-[#64abf7]'
  206 + }
  207 + onClick={() => {
  208 + chooseReceivingCompany(subOrders[0].receivingCompany);
  209 + }}
  210 + >
  211 + 选择
  212 + </span>
  213 + </div>,
  214 + <ProFormSelect
  215 + key="payee"
  216 + placeholder="选择收款单位"
  217 + name="payee"
230 218 width="lg"
231   - label="金额"
232   - rules={[{ required: true, message: '金额必填' }]}
233   - tooltip="点击计算,合计所有子订单对应主订单总额"
234   - fieldProps={{
235   - addonAfter: (
236   - <Button
237   - className="rounded-l-none"
238   - type="primary"
239   - onClick={computeTotalPayment}
240   - >
241   - 计算
242   - </Button>
243   - ),
244   - }}
245   - />
246   - </div>,
247   - ]
  219 + showSearch
  220 + label="收款单位"
  221 + options={enumToSelect(PAYEE_OPTIONS)}
  222 + initialValue={subOrders[0]?.payee}
  223 + rules={[{ required: true, message: '收款单位必填' }]}
  224 + />,
  225 +
  226 + <div id="total-payment" key="money">
  227 + <ProFormDigit
  228 + key="money"
  229 + name="money"
  230 + width="lg"
  231 + label="金额"
  232 + rules={[{ required: true, message: '金额必填' }]}
  233 + tooltip="点击计算,合计所有子订单对应主订单总额"
  234 + fieldProps={{
  235 + addonAfter: (
  236 + <Button
  237 + className="rounded-l-none"
  238 + type="primary"
  239 + onClick={computeTotalPayment}
  240 + >
  241 + 计算
  242 + </Button>
  243 + ),
  244 + }}
  245 + />
  246 + </div>,
  247 + ]
248 248 : ''}
249 249  
250 250 <ProFormSelect
... ...
src/pages/Order/OrderWarning/components/FinancialEditDrawer.tsx
... ... @@ -130,24 +130,24 @@ export default ({ mainOrder, subOrders, setVisible, isMainOrder, onClose }) =&gt; {
130 130 width="lg"
131 131 name="financialReceiptIssuanceTime"
132 132 label="开收据时间"
133   - // rules={[
134   - // {
135   - // required: !isMainOrder && invoicingStatus === 'UN_INVOICE',
136   - // message: '开收据时间必填',
137   - // },
138   - // ]}
  133 + // rules={[
  134 + // {
  135 + // required: !isMainOrder && invoicingStatus === 'UN_INVOICE',
  136 + // message: '开收据时间必填',
  137 + // },
  138 + // ]}
139 139 />
140 140 <ProFormDatePicker
141 141 key="collectMoneyTime"
142 142 width="lg"
143 143 name="collectMoneyTime"
144 144 label="收款时间"
145   - // rules={[
146   - // {
147   - // required: !isMainOrder && invoicingStatus === 'UN_INVOICE',
148   - // message: '收款时间必填',
149   - // },
150   - // ]}
  145 + // rules={[
  146 + // {
  147 + // required: !isMainOrder && invoicingStatus === 'UN_INVOICE',
  148 + // message: '收款时间必填',
  149 + // },
  150 + // ]}
151 151 />
152 152 </DrawerForm>
153 153 );
... ...
src/pages/Order/OrderWarning/components/ImagesViewerModal.tsx
... ... @@ -3,7 +3,7 @@ import { Button, Divider, Image, Modal } from &#39;antd&#39;;
3 3 import { useEffect, useState } from 'react';
4 4 export default ({ setVisible, optType, onClose, orderRow }) => {
5 5 const [images, setImages] = useState<any[]>([]);
6   - const [title, setTitle] = useState("收货凭证");
  6 + const [title, setTitle] = useState('收货凭证');
7 7 const handleOk = () => {
8 8 onClose();
9 9 setVisible(false);
... ... @@ -23,7 +23,7 @@ export default ({ setVisible, optType, onClose, orderRow }) =&gt; {
23 23 }
24 24 useEffect(() => {
25 25 if (optType === 'shippingReceipt') {
26   - setTitle("收货凭证");
  26 + setTitle('收货凭证');
27 27 getImages();
28 28 } else if (optType === 'paymentReceipt') {
29 29 let paymentReceiptsImagesList: any[] = [];
... ... @@ -34,7 +34,6 @@ export default ({ setVisible, optType, onClose, orderRow }) =&gt; {
34 34 paymentReceiptsImagesList = [...new Set(paymentReceiptsImagesList)];
35 35 setImages(paymentReceiptsImagesList);
36 36 }
37   -
38 37 }, []);
39 38  
40 39 return (
... ...
src/pages/Order/OrderWarning/components/ModifiedDiffModal.tsx
... ... @@ -106,7 +106,7 @@ export default ({ setVisible, subOrders, mainOrder, onClose }) =&gt; {
106 106 onClick={() => {
107 107 window.open(
108 108 '/previewApi/onlinePreview?url=' +
109   - encodeURIComponent(Base64.encode(item)),
  109 + encodeURIComponent(Base64.encode(item)),
110 110 );
111 111 }}
112 112 >
... ...
src/pages/Order/OrderWarning/components/OrderDrawer.tsx
... ... @@ -556,9 +556,9 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
556 556 form.setFieldValue(
557 557 'customerShippingAddress',
558 558 getDefaultString(option.province) +
559   - getDefaultString(option.city) +
560   - getDefaultString(option.district) +
561   - getDefaultString(option.detail),
  559 + getDefaultString(option.city) +
  560 + getDefaultString(option.district) +
  561 + getDefaultString(option.detail),
562 562 );
563 563 form.setFieldValue('customerNameString', option.realName);
564 564  
... ... @@ -641,11 +641,11 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
641 641  
642 642 message.error(
643 643 '用户余额不足,当前预减的金额为:' +
644   - data.subPrice +
645   - ',当前账号余额为:' +
646   - data.nowMoney +
647   - ',当前账号可赊账额度为:' +
648   - data.creditLimit,
  644 + data.subPrice +
  645 + ',当前账号余额为:' +
  646 + data.nowMoney +
  647 + ',当前账号可赊账额度为:' +
  648 + data.creditLimit,
649 649 );
650 650 return false;
651 651 }
... ... @@ -1110,7 +1110,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1110 1110 },
1111 1111 }}
1112 1112 debounceTime={1000}
1113   - request={async (value, { }) => {
  1113 + request={async (value, {}) => {
1114 1114 const keywords = value.keyWords;
1115 1115 if (keywords === '') {
1116 1116 return [];
... ... @@ -1865,7 +1865,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1865 1865 placeholder="请输入商品参数"
1866 1866 disabled={
1867 1867 productParametersDisabledFlagList[listMeta.index] !==
1868   - false || optType('after-sales-check')
  1868 + false || optType('after-sales-check')
1869 1869 }
1870 1870 />,
1871 1871 <ProFormDigit
... ... @@ -1918,7 +1918,7 @@ export default ({ onClose, data, subOrders, orderOptType }) =&gt; {
1918 1918 placeholder="请输入商品单位"
1919 1919 disabled={
1920 1920 productParametersDisabledFlagList[listMeta.index] !==
1921   - false || optType('after-sales-check')
  1921 + false || optType('after-sales-check')
1922 1922 }
1923 1923 rules={[{ required: true, message: '商品单位必填' }]}
1924 1924 />,
... ...
src/pages/Order/OrderWarning/components/UploadPayBillModal.tsx
  1 +import { RESPONSE_CODE } from '@/constants/enum';
  2 +import {
  3 + postServiceOrderFileProcess,
  4 + postServiceOrderUploadPaymentReceipt,
  5 +} from '@/services';
  6 +import { transImageFile } from '@/utils';
  7 +import { PlusOutlined } from '@ant-design/icons';
1 8 import { ModalForm } from '@ant-design/pro-components';
2 9 import { Form, Modal, Upload, UploadFile, UploadProps, message } from 'antd';
3 10 import { RcFile } from 'antd/lib/upload';
4 11 import { cloneDeep } from 'lodash';
5 12 import { useEffect, useRef, useState } from 'react';
6 13 import { COMFIR_RECEIPT_IMAGES_NUMBER } from '../../constant';
7   -import { PlusOutlined } from '@ant-design/icons';
8   -import { transImageFile } from '@/utils';
9   -import { postServiceOrderFileProcess, postServiceOrderUploadPaymentReceipt } from '@/services';
10   -import { RESPONSE_CODE } from '@/constants/enum';
11 14  
12 15 // import { cloneDeep } from 'lodash';
13 16 export default ({ setVisible, subOrders, mainOrder, onClose }) => {
... ... @@ -25,7 +28,9 @@ export default ({ setVisible, subOrders, mainOrder, onClose }) =&gt; {
25 28 reader.onerror = (error) => reject(error);
26 29 });
27 30  
28   - const subOrderIds = subOrders?.map((item: any) => { return item.id });
  31 + const subOrderIds = subOrders?.map((item: any) => {
  32 + return item.id;
  33 + });
29 34 const fileListObj = useRef<UploadFile[]>([]); //使用引用类型,使得在useEffect里面设置监听事件后,不用更新监听事件也能保持obj与外界一致
30 35 const handleBeforeUpload = (file: any) => {
31 36 setFileList([...fileList, file]);
... ... @@ -105,8 +110,8 @@ export default ({ setVisible, subOrders, mainOrder, onClose }) =&gt; {
105 110 setPreviewOpen(true);
106 111 setPreviewTitle(
107 112 file.name ||
108   - file.originFileObj?.name ||
109   - file.url!.substring(file.url!.lastIndexOf('/') + 1),
  113 + file.originFileObj?.name ||
  114 + file.url!.substring(file.url!.lastIndexOf('/') + 1),
110 115 );
111 116 };
112 117 const props: UploadProps = {
... ... @@ -128,7 +133,6 @@ export default ({ setVisible, subOrders, mainOrder, onClose }) =&gt; {
128 133 };
129 134  
130 135 useEffect(() => {
131   -
132 136 document.addEventListener('paste', onPaste);
133 137 return () => {
134 138 document.removeEventListener('paste', onPaste);
... ... @@ -206,19 +210,15 @@ export default ({ setVisible, subOrders, mainOrder, onClose }) =&gt; {
206 210 }
207 211 } else {
208 212 message.success('上传失败');
  213 + console.log(mainOrder);
209 214 }
210 215 onClose();
211 216 }}
212 217 onOpenChange={setVisible}
213 218 >
214   -
215   - <div className="pb-4 text-xs decoration-gray-50">
216   - 可复制照片粘贴
217   - </div>
  219 + <div className="pb-4 text-xs decoration-gray-50">可复制照片粘贴</div>
218 220 <Upload {...props}>
219   - {fileList.length < COMFIR_RECEIPT_IMAGES_NUMBER
220   - ? uploadButton
221   - : ''}
  221 + {fileList.length < COMFIR_RECEIPT_IMAGES_NUMBER ? uploadButton : ''}
222 222 </Upload>
223 223 </ModalForm>
224 224  
... ...
src/pages/Order/OrderWarning/index.tsx
... ... @@ -67,7 +67,6 @@ import {
67 67 Radio,
68 68 Space,
69 69 Spin,
70   - Tabs,
71 70 Tag,
72 71 Tooltip,
73 72 message,
... ... @@ -103,6 +102,7 @@ import CheckModal from &#39;./components/CheckModal&#39;;
103 102 import ConfirmReceiptModal from './components/ConfirmReceiptModal';
104 103 import DeliverInfoDrawer from './components/DeliverInfoDrawer';
105 104 import DeliverModal from './components/DeliverModal';
  105 +import FeedbackRegistrationModal from './components/FeedbackRegistrationModal';
106 106 import FinancialDrawer from './components/FinancialDrawer';
107 107 import FinancialEditDrawer from './components/FinancialEditDrawer';
108 108 import FinancialMergeDrawer from './components/FinancialMergeDrawer';
... ... @@ -136,6 +136,10 @@ const OrderPage = () =&gt; {
136 136 useState<boolean>(false);
137 137 const [uploadPayBillModalVisible, setUploadPayBillModalVisible] =
138 138 useState<boolean>(false);
  139 + const [
  140 + feedbackRegistrationModalVisible,
  141 + setFeedbackRegistrationModalVisible,
  142 + ] = useState<boolean>(false);
139 143 const [modifiedDiffModalVisible, setModifiedDiffModalVisible] =
140 144 useState<boolean>(false);
141 145 const [financialReceiptsModalVisible, setFinancialReceiptsModalVisible] =
... ... @@ -188,13 +192,13 @@ const OrderPage = () =&gt; {
188 192 const [mainOrderSelectedMap] = useState(new Map()); //选中的主订单Map key:主订单id value:主订单数据
189 193 const [subOrderSelectedMap, setSubOrderSelectedMap] = useState(new Map()); //选中的子订单Map key:主订单id value:选中的子订单数据集合
190 194 const [currentOptMainId, setCurrentMainId] = useState<any>(undefined); //当前操作对象的主订单id
  195 + // const [currentOptMainId, setCurrentMainId] = useState<any>(undefined); //当前操作对象的主订单id
191 196 const [curretnOptSubId, setCurretnOptSubId] = useState<any>(undefined); //当前操作对象的子订单id
  197 + // const [curretnOptSubId, setCurretnOptSubId] = useState<any>(undefined); //当前操作对象的子订单id
192 198 const [subOrderCount, setSubOrderCount] = useState(0);
193 199 const [sorted] = useState(false);
194 200 const mainTableRef = useRef<ActionType>();
195   - const mainTableSecondRef = useRef<ActionType>();
196 201 const mainTableFormRef = useRef<ProFormInstance>();
197   - const mainTableSecondFormRef = useRef<ProFormInstance>();
198 202 let [searchParams, setSearchParam] = useState(Object); //表格的查询条件存储
199 203 console.log(searchParams);
200 204 const [messageApi, contextHolder] = message.useMessage();
... ... @@ -206,6 +210,7 @@ const OrderPage = () =&gt; {
206 210 const [ids, setIds] = useState([]);
207 211 const [recordOptNode, setRecordOptNode] = useState(null);
208 212 const roleCode = userInfo?.roleSmallVO?.code;
  213 + const [activeTabKey, setActiveTabKey] = useState(1); // **新增状态**
209 214  
210 215 const triggerRecordOptNode = async (id) => {
211 216 const res = await postServiceOrderGetCurrentOptNode({
... ... @@ -222,12 +227,6 @@ const OrderPage = () =&gt; {
222 227 setSelectedRows([]);
223 228 setSelectedSubOrderKeys([]);
224 229 };
225   - const refreshTable2 = () => {
226   - mainTableSecondRef.current?.reload();
227   - //刷新表格数据的时候,取消选中行
228   - setSelectedRows([]);
229   - setSelectedSubOrderKeys([]);
230   - };
231 230  
232 231 /*useEffect(() => {
233 232 let initAfterInvoicingStatus = async () => {
... ... @@ -381,7 +380,7 @@ const OrderPage = () =&gt; {
381 380 * 返回当前操作的主订单数据
382 381 */
383 382 function buildMainOrder() {
384   - if (currentOptMainId === undefined || currentOptMainId === null) {
  383 + if (!currentOptMainId) {
385 384 message.error('页面错误:当前操作的主订单id不存在,请联系系统管理员');
386 385 return;
387 386 }
... ... @@ -393,11 +392,9 @@ const OrderPage = () =&gt; {
393 392 if (matchedData.length > 0) {
394 393 mainOrderClone = cloneDeep(matchedData[0]);
395 394 }
396   -
397   - if (mainOrderClone === null) {
  395 + if (!mainOrderClone) {
398 396 message.error('页面错误:当前操作的主订单数据不存在,请联系系统管理员');
399 397 }
400   -
401 398 return mainOrderClone;
402 399 }
403 400  
... ... @@ -405,7 +402,7 @@ const OrderPage = () =&gt; {
405 402 * 返回当前操作的子订单集合
406 403 */
407 404 function buildSubOrders() {
408   - if (currentOptMainId === undefined || currentOptMainId === null) {
  405 + if (!currentOptMainId) {
409 406 message.error('页面错误:当前操作的主订单id不存在,请联系系统管理员');
410 407 return;
411 408 }
... ... @@ -414,8 +411,10 @@ const OrderPage = () =&gt; {
414 411  
415 412 //如果没有传当前操作的子订单id,说明是操作主订单
416 413 if (curretnOptSubId === undefined || curretnOptSubId === null) {
  414 + // if (!curretnOptSubId) {
417 415 //如果有选中子订单,那么取选中的子订单为操作对象,否则取当前主订单的全部子订单为操作对象
418 416 let currentOptSubOrders = subOrderSelectedMap.get(currentOptMainId);
  417 +
419 418 if (
420 419 currentOptSubOrders === null ||
421 420 currentOptSubOrders === undefined ||
... ... @@ -446,12 +445,10 @@ const OrderPage = () =&gt; {
446 445 }
447 446 }
448 447 }
449   -
450 448 if (cloneSubOrders.length === 0) {
451 449 message.error('页面错误:当前操作的订单数据不存在,请联系系统管理员');
452 450 return;
453 451 }
454   -
455 452 return cloneSubOrders;
456 453 }
457 454  
... ... @@ -2033,6 +2030,20 @@ const OrderPage = () =&gt; {
2033 2030 ) : (
2034 2031 ''
2035 2032 )}
  2033 + {optRecord.paths?.includes('feedbackRegistration') ? (
  2034 + <Button
  2035 + className="p-0"
  2036 + type="link"
  2037 + onClick={() => {
  2038 + createOptObject(optRecord.id, record.id);
  2039 + setFeedbackRegistrationModalVisible(true);
  2040 + }}
  2041 + >
  2042 + 回访登记
  2043 + </Button>
  2044 + ) : (
  2045 + ''
  2046 + )}
2036 2047  
2037 2048 {optRecord.paths?.includes('confirmInvoice') ? (
2038 2049 <ButtonConfirm
... ... @@ -2254,6 +2265,30 @@ const OrderPage = () =&gt; {
2254 2265 ) : (
2255 2266 ''
2256 2267 )}
  2268 + {isAdmin() || isSales() ? (
  2269 + <Flex title={optRecord.notes} className="pt-2">
  2270 + <div className="flex items-center">
  2271 + <div className="flex items-center max-w-[500px]">
  2272 + <div className="max-w-md overflow-hidden whitespace-no-wrap overflow-ellipsis">
  2273 + <Tooltip
  2274 + title={optRecord.feedbackRegistrationContent}
  2275 + placement="topLeft"
  2276 + >
  2277 + <span className="text-[#8C8C8C] mr-3">
  2278 + 产品回访登记:
  2279 + {optRecord.feedbackRegistrationContent === undefined ||
  2280 + optRecord.feedbackRegistrationContent === null
  2281 + ? '暂无'
  2282 + : optRecord.feedbackRegistrationContent}
  2283 + </span>
  2284 + </Tooltip>
  2285 + </div>
  2286 + </div>
  2287 + </div>
  2288 + </Flex>
  2289 + ) : (
  2290 + ''
  2291 + )}
2257 2292 </>
2258 2293 );
2259 2294 };
... ... @@ -4079,65 +4114,75 @@ const OrderPage = () =&gt; {
4079 4114 //选择天数1
4080 4115 const options1 = [
4081 4116 {
4082   - label: '超过5天',
4083   - value: 5,
4084   - },
4085   - {
4086 4117 label: '超过15天',
4087 4118 value: 15,
4088 4119 },
  4120 + {
  4121 + label: '超过30天',
  4122 + value: 30,
  4123 + },
4089 4124 ];
4090   - //选择天数
4091   - const [calDate, setCalDate] = useState<string | null>(null);
4092   - const [calDate2, setCalDate2] = useState<string | null>(null);
4093   - const [value1, setValue1] = useState();
4094   - const radioOnChange1 = ({ target: { value } }) => {
4095   - const currentDate = new Date();
4096   - // 创建一个新的日期对象,并在当前日期的基础上加上 daysToAdd 天
4097   - const newDate = new Date(currentDate);
4098   - newDate.setDate(currentDate.getDate() - value);
4099   - const formattedDate = format(newDate, 'yyyy-MM-dd HH:mm:ss');
4100   - setCalDate(formattedDate);
4101   - setValue1(value);
4102   - };
4103   - //选择天数2
4104 4125 const options2 = [
4105 4126 {
4106 4127 label: '超过15天',
4107 4128 value: 15,
4108 4129 },
4109 4130 {
4110   - label: '超过25天',
4111   - value: 25,
  4131 + label: '超过30天',
  4132 + value: 30,
4112 4133 },
4113 4134 ];
4114   - const [value2, setValue2] = useState();
4115   - const radioOnChange2 = ({ target: { value } }) => {
  4135 + const options3 = [
  4136 + {
  4137 + label: '超过5天',
  4138 + value: 5,
  4139 + },
  4140 + {
  4141 + label: '超过10天',
  4142 + value: 10,
  4143 + },
  4144 + ];
  4145 + const options4 = [
  4146 + {
  4147 + label: '超过30天',
  4148 + value: 30,
  4149 + },
  4150 + {
  4151 + label: '超过75天',
  4152 + value: 75,
  4153 + },
  4154 + {
  4155 + label: '超过90天',
  4156 + value: 90,
  4157 + },
  4158 + {
  4159 + label: '超过120天',
  4160 + value: 120,
  4161 + },
  4162 + ];
  4163 + //选择天数
  4164 + const [calDate, setCalDate] = useState<string | null>(null);
  4165 + const [value1, setValue1] = useState(0);
  4166 + const radioOnChange1 = ({ target: { value } }) => {
4116 4167 const currentDate = new Date();
4117   -
4118 4168 // 创建一个新的日期对象,并在当前日期的基础上加上 daysToAdd 天
4119 4169 const newDate = new Date(currentDate);
4120 4170 newDate.setDate(currentDate.getDate() - value);
4121 4171 const formattedDate = format(newDate, 'yyyy-MM-dd HH:mm:ss');
4122   - setCalDate2(formattedDate);
4123   - setValue2(value);
4124   - };
4125   - const confirmInvoice = async () => {
4126   - let flat = [...subOrderSelectedMap.values()].flat().map((item) => item.id);
4127   - const data = await postServiceOrderConfirmInvoice({
4128   - data: flat,
4129   - });
4130   - if (data.result === RESPONSE_CODE.SUCCESS) {
4131   - message.success(data.message);
4132   - refreshTable();
4133   - }
  4172 + setCalDate(formattedDate);
  4173 + setValue1(value);
  4174 + console.log(formattedDate, '5656formattedDate/value', value);
4134 4175 };
4135 4176 const [invoiceWarningNum, setInvoiceWarningNum] = useState(0);
4136 4177 const [invoiceRefundWarningNum, setInvoiceRefundWarningNum] = useState(0);
  4178 + const [waitConfirmPayment, setWaitConfirmPayment] = useState(0);
  4179 + const [waitFeedback, setWaitFeedback] = useState(0);
4137 4180 async function getInvoiceWarningNum() {
4138 4181 const res = await postServiceOrderWarningOrderStatistics();
4139 4182 setInvoiceWarningNum(res.data.waitConfirmInvoice);
4140 4183 setInvoiceRefundWarningNum(res.data.waitConfirmReceipt);
  4184 + setWaitConfirmPayment(res.data.waitConfirmPayment);
  4185 + setWaitFeedback(res.data.waitFeedback);
4141 4186 }
4142 4187 useEffect(() => {
4143 4188 //预警订单数
... ... @@ -4146,1326 +4191,815 @@ const OrderPage = () =&gt; {
4146 4191 //biaojiup
4147 4192 // 监听 calDate 变化,触发请求
4148 4193 useEffect(() => {
4149   - if (calDate) {
4150   - mainTableRef.current?.reload();
4151   - }
  4194 + mainTableRef.current?.reload();
4152 4195 }, [calDate]);
4153   -
4154   - const request = async (params: any, sorter: any, filter: any) => {
4155   - let orderIds = mainTableFormRef.current?.getFieldValue('id');
4156   - let subOrderId = mainTableFormRef.current?.getFieldValue('subOrderId');
4157   - params.id = params.id || orderIds;
4158   - params.subOrderId = params.subOrderId || subOrderId;
4159   - if (params.id !== '') {
4160   - params.id = params.id?.replace(/ /g, '');
4161   - if (params.id?.indexOf(',')) {
4162   - params.id = params.id.split(',');
4163   - params.id = params.id.filter((id) => id !== '');
4164   - }
4165   - }
4166   - params.salesCode = userInfo.username;
4167   - params.condition = filterCondifion;
4168   - params.paymentMethod = 'UNPAID';
4169   - params.sorted = sorted;
4170   - // params.isDeleteQueryOrder = filterCondifion === 70;
4171   - params.isDeleteQueryOrder = false;
4172   - params.invoiceConfirmStatusNe = 'CONFIRMED';
4173   - params.invoicingStatusNe = 'UN_INVOICE';
4174   - if (calDate === 'null') {
4175   - params.applyTimeLe = null;
4176   - } else {
4177   - params.applyTimeLe = calDate;
4178   - }
4179   - params.applyTimeIsNotNull = true;
4180   - setSearchParam(params);
4181   -
4182   - const res = await postServiceOrderQueryServiceOrder({
4183   - sorter,
4184   - filter,
4185   - data: { ...params, statusDatetimeGe: calDate },
4186   - });
4187   -
4188   - const data = res.data;
4189   - setRolePath(data.specialPath);
4190   - setSubOrderCount(data.count);
4191   - setAllMainChecked(false);
4192   - setSelectedMainOrderKeys([]);
4193   - subOrderSelectedMap.clear();
4194   - mainOrderSelectedMap.clear();
4195   - setData(data?.data);
4196   -
4197   - mainOrderIdSubOrderIdRelationsMap.clear();
4198   - for (let row of data?.data) {
4199   - let mianOrderId = row.id;
4200   - let subOrderIds = row.subOrderInformationLists?.map((item) => {
4201   - item.totalPayment = row.totalPayment;
4202   - return item.id;
4203   - });
4204   - mainOrderIdSubOrderIdRelationsMap.set(mianOrderId, subOrderIds);
4205   - }
4206   -
4207   - return {
4208   - data: data?.data || [],
4209   - total: data?.total || 0,
4210   - };
4211   - };
4212   - //biaojidown
4213   -
4214   - //biaojiup2
4215   - // 监听 calDate 变化,触发请求
4216 4196 useEffect(() => {
4217   - if (calDate2) {
4218   - // mainTableRef.current?.reload();
4219   - mainTableSecondRef.current?.reload();
4220   - }
4221   - }, [calDate2]);
4222   -
4223   - const request2 = async (
4224   - // 第一个参数 params 查询表单和 params 参数的结合
4225   - // 第一个参数中一定会有 pageSize 和 current ,这两个参数是 antd 的规范
4226   - params,
4227   - sorter,
4228   - filter,
4229   - ) => {
4230   - params.invoiceConfirmStatus = 'CONFIRMED';
4231   - params.paymentMethod = 'UNPAID';
4232   - params.salesCode = userInfo.username;
4233   - if (calDate2 === 'null') {
4234   - params.invoiceConfirmStatusDatetimeLe = null;
4235   - } else {
4236   - params.invoiceConfirmStatusDatetimeLe = calDate2;
4237   - }
4238   - //订单id处理
4239   - /**
4240   - * 以params中的id为主,如果params没id,则取url中的id
4241   - * 第一次进来这个页面,url带有id的话,会自动填充到查询表单中,但是第一次查询params不会带这个id进来
4242   - */
4243   - let orderIds = mainTableSecondFormRef.current?.getFieldValue('id');
4244   - let subOrderId =
4245   - mainTableSecondFormRef.current?.getFieldValue('subOrderId');
4246   - params.id = params.id || orderIds;
4247   - params.subOrderId = params.subOrderId || subOrderId;
4248   - if (params.id !== '') {
4249   - params.id = params.id?.replace(/ /g, '');
4250   - if (params.id?.indexOf(',')) {
4251   - params.id = params.id.split(',');
4252   - params.id = params.id.filter((id) => {
4253   - return id !== '';
4254   - });
4255   - }
  4197 + if (
  4198 + activeTabKey === 1 ||
  4199 + activeTabKey === 2 ||
  4200 + activeTabKey === 3 ||
  4201 + activeTabKey === 4
  4202 + ) {
  4203 + setValue1(0); // 清空 value1
4256 4204 }
4257   -
4258   - params.condition = filterCondifion;
4259   -
4260   - //排序
4261   - params.sorted = sorted;
4262   - //是否只查看已作废
4263   - params.isDeleteQueryOrder = filterCondifion === 70;
4264   - params.paymentNotReceipt = true;
4265   - //保存这个搜索条件
4266   - setSearchParam(params);
4267   -
4268   - //订单标记2
4269   - const { data } = await postServiceOrderQueryServiceOrder({
4270   - // ...params,
4271   - // FIXME: remove @ts-ignore
4272   - // @ts-ignore
4273   - sorter,
4274   - filter,
4275   - data: { ...params },
4276   - });
4277   -
4278   - setRolePath(data.specialPath);
4279   - setSubOrderCount(data.count);
4280   - setAllMainChecked(false);
4281   - setSelectedMainOrderKeys([]);
4282   - subOrderSelectedMap.clear();
4283   - mainOrderSelectedMap.clear();
4284   - setData(data?.data);
4285   -
4286   - //主订单id与子订单id的对照关系保存
4287   - mainOrderIdSubOrderIdRelationsMap.clear();
4288   - for (let row of data?.data) {
4289   - let mianOrderId = row.id;
4290   - let subOrderIds = row.subOrderInformationLists?.map((item) => {
4291   - //目前子订单存储的totalPayment不准确,这里重新处理取主订单的totalPayment
4292   - //totalPayment在财务开票计算金额时使用到
4293   - item.totalPayment = row.totalPayment;
4294   - return item.id;
4295   - });
4296   - mainOrderIdSubOrderIdRelationsMap.set(mianOrderId, subOrderIds);
  4205 + // const currentDate = new Date();
  4206 + // const newDate = new Date(currentDate);
  4207 + // newDate.setDate(currentDate.getDate() - 0);
  4208 + // console.log(value1, '5656value1');
  4209 + mainTableRef.current?.reload(); // **修改位置:在选择第二个标签时请求request2**
  4210 + }, [activeTabKey]);
  4211 + // 修改位置:监听 value1 的变化
  4212 + useEffect(() => {
  4213 + if (value1 === 0) {
  4214 + // 这里执行你希望在 value1 为 0 时的逻辑
  4215 + mainTableRef.current?.reload(); // 重新请求数据
4297 4216 }
  4217 + }, [value1]); // 添加了 value1 作为依赖
4298 4218  
4299   - return {
4300   - data: data?.data || [],
4301   - total: data?.total || 0,
4302   - };
4303   - };
4304 4219 //biaojidown2
4305 4220 //取消单选,将时间设为null
4306 4221 const handleSetNull = () => {
4307   - setCalDate('null'); // 这应该会触发 useEffect
4308   - };
4309   - const handleSetNull2 = () => {
4310   - setCalDate2('null'); // 这应该会触发 useEffect
  4222 + setCalDate(null); // 这应该会触发 useEffect
4311 4223 };
4312   - const tabsItems = [
  4224 + const warningOptions = [
4313 4225 {
4314   - key: 1,
  4226 + value: 1,
4315 4227 label: (
4316 4228 <span>
4317   - 发票确认预警
4318   - <Badge count={invoiceWarningNum} style={{ marginLeft: 8 }} />
  4229 + 确认收货预警
  4230 + <Badge count={waitConfirmPayment} style={{ marginLeft: 8 }} />
4319 4231 </span>
4320 4232 ),
4321   - children: (
4322   - <div>
4323   - <div style={{ position: 'relative' }}>
4324   - {/* <Radio.Group options={options1} onChange={radioOnChange1} value={value1} /> */}
4325   - <Radio.Group
4326   - value={value1}
4327   - onChange={radioOnChange1}
4328   - // 通过 onClick 处理单独 Radio 的点击事件
4329   - >
4330   - {options1.map((option) => (
4331   - <Radio
4332   - key={option.value}
4333   - value={option.value}
4334   - onClick={(e) => {
4335   - radioOnChange1(
4336   - e as unknown as React.ChangeEvent<HTMLInputElement>,
4337   - );
4338   - handleSetNull();
4339   - }}
4340   - >
4341   - {option.label}
4342   - </Radio>
4343   - ))}
4344   - </Radio.Group>
4345   - <Button
4346   - size="large"
4347   - type="primary"
4348   - onClick={confirmInvoice}
4349   - style={{ position: 'absolute', right: '20px' }}
4350   - >
4351   - 确认发票
4352   - </Button>
4353   - </div>
4354   - <div style={{ height: '25px' }}></div>
4355   - <ProTable
4356   - id="main-table"
4357   - // tableStyle={{backgroundColor:'red'}}
4358   -
4359   - actionRef={mainTableRef}
4360   - formRef={mainTableFormRef}
4361   - expandIconColumnIndex={-1}
4362   - columns={mainOrdersColumns}
4363   - rowKey="id"
4364   - pagination={{
4365   - showQuickJumper: true,
4366   - pageSize: pageSize,
4367   - current: currentPage,
4368   - showSizeChanger: true,
4369   - onChange: (page, size) => {
4370   - setPageSize(size);
4371   - setCurrentPage(page);
4372   - },
4373   - showTotal: (total, range) => {
4374   - return (
4375   - <>
4376   - <span>
4377   - {'第 ' +
4378   - range[0] +
4379   - '-' +
4380   - range[1] +
4381   - ' 条/总共 ' +
4382   - total +
4383   - ' 条主订单 '}
4384   - </span>
4385   - <span className="text-[#8C8C8C]">
4386   - {' (' + subOrderCount + ' 条子订单)'}
4387   - </span>
4388   - </>
4389   - );
4390   - },
4391   - }}
4392   - // showHeader={false}
4393   - expandedRowKeys={expandedRowKeys}
4394   - // expandable={{ expandedRowRender }}
4395   - dateFormatter="string"
4396   - options={false}
4397   - headerTitle=""
4398   - search={false}
4399   - // labelWidth: 'auto',
4400   - // onCollapse: resize,
4401   - request={request}
4402   - toolbar={{
4403   - multipleLine: true,
4404   - }}
4405   - // toolBarRender={() => {
4406   - // return toolBarRender();
4407   - // }}
4408   - />
4409   -
4410   - {orderDrawerVisible && (
4411   - <OrderDrawer
4412   - data={orderOptType === 'add' ? {} : buildMainOrder()}
4413   - subOrders={orderOptType === 'add' ? [] : buildSubOrders()}
4414   - onClose={(isSuccess: boolean) => {
4415   - setOrderDrawerVisible(false);
4416   - clearOptObject();
4417   - if (isSuccess) {
4418   - refreshTable();
4419   - }
4420   - }}
4421   - orderOptType={orderOptType}
4422   - />
4423   - )}
4424   -
4425   - {checkVisible && (
4426   - <CheckModal
4427   - setCheckVisible={(val: boolean) => {
4428   - setCheckVisible(val);
4429   - if (!val) {
4430   - clearOptObject();
4431   - }
4432   - }}
4433   - data={isMainOrder ? getFirstMainOrder() : buildMainOrder()}
4434   - subOrders={
4435   - isMainOrder
4436   - ? [...subOrderSelectedMap.values()].flat()
4437   - : buildSubOrders()
4438   - }
4439   - orderCheckType={orderCheckType}
4440   - openOrderDrawer={(type: any, id: any) => {
4441   - setCurrentMainId(id);
4442   - setOrderOptType(type);
4443   - setOrderDrawerVisible(true);
4444   - }}
4445   - onClose={() => {
4446   - clearOptObject();
4447   - setCheckVisible(false);
4448   - refreshTable();
4449   - }}
4450   - />
4451   - )}
4452   -
4453   - {applyForInvoicingVisible && (
4454   - <ApplyForInvoicingModal
4455   - setCheckVisible={(val: boolean) => {
4456   - setApplyForInvoicingVisible(val);
4457   - if (!val) {
4458   - clearOptObject();
4459   - }
4460   - }}
4461   - subOrders={
4462   - isMainOrder
4463   - ? [...subOrderSelectedMap.values()].flat()
4464   - : buildSubOrders()
4465   - }
4466   - totalPayment={getApplyInvoicingTotalPayment()}
4467   - isMainOrder={isMainOrder}
4468   - isEdit={isEdit}
4469   - onClose={() => {
4470   - setApplyForInvoicingVisible(false);
4471   - setIsMainOrder(false);
4472   - clearOptObject();
4473   - refreshTable();
4474   - }}
4475   - />
4476   - )}
4477   -
4478   - {notesEditVisible && (
4479   - <OrderNotesEditModal
4480   - setNotesEditVisible={(val: boolean) => {
4481   - setNotesEditVisible(val);
4482   - if (!val) {
4483   - clearOptObject();
4484   - }
4485   - }}
4486   - ids={selectedRows}
4487   - notesType={notesType}
4488   - notes={notes}
4489   - onClose={() => {
4490   - setNotesEditVisible(false);
4491   - setSelectedRows([]);
4492   - setNotes(notes);
4493   - setNotesType(1);
4494   - refreshTable();
4495   - }}
4496   - />
4497   - )}
4498   -
4499   - {deliverVisible && (
4500   - <DeliverModal
4501   - data={buildSubOrders()}
4502   - isSendProduct={isSendProduct}
4503   - setVisible={(val: boolean) => {
4504   - setDeliverVisible(val);
4505   - if (!val) {
4506   - clearOptObject();
4507   - }
4508   - }}
4509   - sendType={orderCheckType}
4510   - onClose={() => {
4511   - clearOptObject();
4512   - setDeliverVisible(false);
4513   - setIsSendProduct(false);
4514   - refreshTable();
4515   - }}
4516   - />
4517   - )}
4518   -
4519   - {financialVisible && (
4520   - <FinancialDrawer
4521   - isEdit={isEdit}
4522   - mainOrder={isMainOrder ? getFirstMainOrder() : buildMainOrder()}
4523   - subOrders={
4524   - isMainOrder
4525   - ? [...subOrderSelectedMap.values()].flat()
4526   - : buildSubOrders()
4527   - }
4528   - isMainOrder={isMainOrder}
4529   - cancel={() => {
4530   - setFinancialVisible(false);
4531   - clearOptObject();
4532   - setIsMainOrder(false);
4533   - setIsEdit(false);
4534   - }}
4535   - onClose={() => {
4536   - setFinancialVisible(false);
4537   - clearOptObject();
4538   - refreshTable();
4539   - setIsMainOrder(false);
4540   - setIsEdit(false);
4541   - }}
4542   - />
4543   - )}
4544   -
4545   - {financialEditVisible && (
4546   - <FinancialEditDrawer
4547   - mainOrder={buildMainOrder()}
4548   - subOrders={buildSubOrders()}
4549   - isMainOrder={isMainOrder}
4550   - setVisible={() => {
4551   - setFinancialEditVisible(false);
4552   - clearOptObject();
4553   - }}
4554   - onClose={() => {
4555   - setFinancialEditVisible(false);
4556   - refreshTable();
4557   - setIsMainOrder(false);
4558   - clearOptObject();
4559   - }}
4560   - />
4561   - )}
4562   -
4563   - {orderPrintVisible && (
4564   - <OrderPrintModal
4565   - mainOrder={buildMainOrder()}
4566   - subOrders={buildSubOrders()}
4567   - isRePrint={isRePrintOrder}
4568   - setVisible={(val: boolean) => {
4569   - setOrderPrintVisible(val);
4570   - if (!val) {
4571   - clearOptObject();
4572   - }
4573   - }}
4574   - printOptType={orderCheckType}
4575   - onClose={() => {
4576   - setOrderPrintVisible(false);
4577   - clearOptObject();
4578   - setIsRePrintOrder(false);
4579   - refreshTable();
4580   - }}
4581   - />
4582   - )}
4583   -
4584   - {confirmReceiptVisible && (
4585   - <ConfirmReceiptModal
4586   - data={buildSubOrders()}
4587   - onClose={() => {
4588   - setConfirmReceiptVisible(false);
4589   - clearOptObject();
4590   - refreshTable();
4591   - }}
4592   - />
4593   - )}
4594   -
4595   - {imagesViewerModalVisible && (
4596   - <ImagesViewerModal
4597   - optType={imagesViewerOptType}
4598   - setVisible={(val: boolean) => {
4599   - setImagesViewerModalVisible(val);
4600   - if (!val) {
4601   - clearOptObject();
4602   - }
4603   - }}
4604   - onClose={() => {
4605   - setImagesViewerModalVisible(false);
4606   - }}
4607   - orderRow={buildSubOrders()[0]}
4608   - />
4609   - )}
4610   -
4611   - {importModalVisible && (
4612   - <ImportModal
4613   - onClose={() => {
4614   - setImportModalVisible(false);
4615   - refreshTable();
4616   - }}
4617   - />
4618   - )}
4619   -
4620   - {attachmentModalVisible && (
4621   - <AttachmentModal
4622   - data={buildSubOrders()[0]}
4623   - onClose={() => {
4624   - setAttachmentModalVisible(false);
4625   - clearOptObject();
4626   - }}
4627   - />
4628   - )}
4629   -
4630   - {historyModalVisible && (
4631   - <HistoryModal
4632   - subOrders={selectedRows}
4633   - isCancelledOrder={filterCondifion === 70}
4634   - onClose={() => {
4635   - setHistoryModalVisible(false);
4636   - setSelectedRows({});
4637   - clearOptObject();
4638   - }}
4639   - />
4640   - )}
4641   -
4642   - {deliverInfoDrawerVisible && (
4643   - <DeliverInfoDrawer
4644   - data={buildMainOrder()}
4645   - onClose={() => {
4646   - setDeliverInfoDrawerVisible(false);
4647   - clearOptObject();
4648   - }}
4649   - />
4650   - )}
4651   -
4652   - {deliverInfoDrawerVisible && (
4653   - <DeliverInfoDrawer
4654   - data={buildMainOrder()}
4655   - onClose={() => {
4656   - setDeliverInfoDrawerVisible(false);
4657   - clearOptObject();
4658   - }}
4659   - />
4660   - )}
4661   -
4662   - {procureCheckModalVisible && (
4663   - <ProcureCheckModal
4664   - setCheckVisible={(val: boolean) => {
4665   - setProcureCheckModalVisible(val);
4666   - if (!val) {
4667   - clearOptObject();
4668   - }
4669   - }}
4670   - isMainOrder={isMainOrder}
4671   - orders={
4672   - isMainOrder
4673   - ? [...subOrderSelectedMap.values()].flat()
4674   - : buildSubOrders()
4675   - }
4676   - onClose={() => {
4677   - setProcureCheckModalVisible(false);
4678   - clearOptObject();
4679   - setIsMainOrder(false);
4680   - refreshTable();
4681   - }}
4682   - />
4683   - )}
4684   -
4685   - {afterSalesDrawerVisible && (
4686   - <AfterSalesDrawer
4687   - setVisible={(val: boolean) => {
4688   - setAfterSalesDrawerVisible(val);
4689   - if (!val) {
4690   - clearOptObject();
4691   - }
4692   - }}
4693   - mainOrder={buildMainOrder()}
4694   - subOrders={buildSubOrders()}
4695   - onClose={() => {
4696   - setAfterSalesDrawerVisible(false);
4697   - clearOptObject();
4698   - refreshTable();
4699   - }}
4700   - />
4701   - )}
4702   -
4703   - {procureConvertModalVisible && (
4704   - <ProcureConvertModal
4705   - setVisible={(val: boolean) => {
4706   - setProcureConvertModalVisible(val);
4707   - if (!val) {
4708   - clearOptObject();
4709   - }
4710   - }}
4711   - subOrders={buildSubOrders()}
4712   - onClose={() => {
4713   - setProcureConvertModalVisible(false);
4714   - clearOptObject();
4715   - refreshTable();
4716   - }}
4717   - />
4718   - )}
4719   -
4720   - {financialMergeDrawerVisible && (
4721   - <FinancialMergeDrawer
4722   - setVisible={(val: boolean) => {
4723   - setFinancialMergeDrawerVisible(val);
4724   - if (!val) {
4725   - clearOptObject();
4726   - }
4727   - }}
4728   - dataList={
4729   - isMainOrder
4730   - ? [...subOrderSelectedMap.values()].flat()
4731   - : buildSubOrders()
4732   - }
4733   - onClose={() => {
4734   - setFinancialMergeDrawerVisible(false);
4735   - setIsMainOrder(false);
4736   - clearOptObject();
4737   - refreshTable();
4738   - }}
4739   - />
4740   - )}
4741   -
4742   - {financialReceiptsModalVisible && (
4743   - <FinancialReceiptsModal
4744   - setVisible={(val: boolean) => {
4745   - setFinancialReceiptsModalVisible(val);
4746   - if (!val) {
4747   - clearOptObject();
4748   - }
4749   - }}
4750   - datas={selectedRows}
4751   - onClose={() => {
4752   - setFinancialReceiptsModalVisible(false);
4753   - setSelectedRows({});
4754   - refreshTable();
4755   - }}
4756   - />
4757   - )}
4758   -
4759   - {shippingWarehouseChangeModalVisible && (
4760   - <ShippingWarehouseChangeModal
4761   - setVisible={(val: boolean) => {
4762   - setShippingWarehouseChangeModalVisible(val);
4763   - if (!val) {
4764   - clearOptObject();
4765   - }
4766   - }}
4767   - subOrderIds={ids}
4768   - originShippingWarehouse={buildSubOrders()[0].shippingWarehouse}
4769   - onClose={() => {
4770   - setShippingWarehouseChangeModalVisible(false);
4771   - clearOptObject();
4772   - setIds([]);
4773   - refreshTable();
4774   - }}
4775   - />
4776   - )}
4777   - {reissueVisible && (
4778   - <ReissueModal
4779   - setVisible={(val: boolean) => {
4780   - setReissueVisible(val);
4781   - if (!val) {
4782   - clearOptObject();
4783   - }
4784   - }}
4785   - subOrders={
4786   - isMainOrder
4787   - ? [...subOrderSelectedMap.values()].flat()
4788   - : buildSubOrders()
4789   - }
4790   - onClose={() => {
4791   - setReissueVisible(false);
4792   - clearOptObject();
4793   - refreshTable();
4794   - }}
4795   - />
4796   - )}
4797   - {reissueVisibleOld && (
4798   - <ReissueModal_old
4799   - setVisible={(val: boolean) => {
4800   - setReissueVisibleOld(val);
4801   - console.log(reissueVisible);
4802   - if (!val) {
4803   - clearOptObject();
4804   - }
4805   - }}
4806   - mainOrder={buildMainOrder()}
4807   - subOrders={buildSubOrders()}
4808   - onClose={() => {
4809   - setReissueVisibleOld(false);
4810   - clearOptObject();
4811   - refreshTable();
4812   - }}
4813   - />
4814   - )}
4815   - {productionTimeModalVisible && (
4816   - <ProductionTimeModal
4817   - setVisible={(val: boolean) => {
4818   - setProductionTimeModalVisible(val);
4819   - if (!val) {
4820   - clearOptObject();
4821   - }
4822   - }}
4823   - subOrders={buildSubOrders()}
4824   - onClose={() => {
4825   - setProductionTimeModalVisible(false);
4826   - clearOptObject();
4827   - refreshTable();
4828   - }}
4829   - />
4830   - )}
4831   -
4832   - {modifiedDiffModalVisible && (
4833   - <ModifiedDiffModal
4834   - setVisible={(val: boolean) => {
4835   - setModifiedDiffModalVisible(val);
4836   - if (!val) {
4837   - clearOptObject();
4838   - }
4839   - }}
4840   - subOrders={buildSubOrders()}
4841   - mainOrder={buildMainOrder()}
4842   - onClose={() => {
4843   - setModifiedDiffModalVisible(false);
4844   - clearOptObject();
4845   - }}
4846   - />
4847   - )}
4848   -
4849   - {uploadPayBillModalVisible && (
4850   - <UploadPayBillModal
4851   - setVisible={(val: boolean) => {
4852   - setUploadPayBillModalVisible(val);
4853   - if (!val) {
4854   - clearOptObject();
4855   - }
4856   - }}
4857   - subOrders={buildSubOrders()}
4858   - mainOrder={buildMainOrder()}
4859   - onClose={() => {
4860   - setUploadPayBillModalVisible(false);
4861   - clearOptObject();
4862   - refreshTable();
4863   - }}
4864   - />
4865   - )}
4866   - {invoicingDrawerFormVisible && (
4867   - <InvoicingDrawerForm
4868   - dataList={
4869   - isMainOrder
4870   - ? [...subOrderSelectedMap.values()].flat()
4871   - : buildSubOrders()
4872   - }
4873   - setVisible={(val: boolean) => {
4874   - setInvoicingDrawerFormVisible(val);
4875   - if (!val) {
4876   - clearOptObject();
4877   - }
4878   - }}
4879   - mainOrder={isMainOrder ? getFirstMainOrder() : buildMainOrder()}
4880   - onClose={() => {
4881   - setInvoicingDrawerFormVisible(false);
4882   - setIsMainOrder(true);
4883   - clearOptObject();
4884   - refreshTable();
4885   - }}
4886   - />
4887   - )}
4888   - {contextHolder}
4889   - <FloatButton.BackTop visibilityHeight={0} />
4890   - </div>
  4233 + },
  4234 + {
  4235 + value: 2,
  4236 + label: (
  4237 + <span>
  4238 + 回访登记预警
  4239 + <Badge count={waitFeedback} style={{ marginLeft: 8 }} />
  4240 + </span>
4891 4241 ),
4892 4242 },
4893 4243 {
4894   - key: 2,
  4244 + value: 3,
  4245 + label: (
  4246 + <span>
  4247 + 确认发票预警
  4248 + <Badge count={invoiceWarningNum} style={{ marginLeft: 8 }} />
  4249 + </span>
  4250 + ),
  4251 + },
  4252 + {
  4253 + value: 4,
4895 4254 label: (
4896 4255 <span>
4897 4256 订单回款预警
4898 4257 <Badge count={invoiceRefundWarningNum} style={{ marginLeft: 8 }} />
4899 4258 </span>
4900 4259 ),
4901   - children: (
4902   - <div>
4903   - {/* <Radio.Group options={options2} onChange={radioOnChange2} value={value2} /> */}
4904   - <Radio.Group
4905   - value={value2}
4906   - onChange={radioOnChange2}
4907   - // 通过 onClick 处理单独 Radio 的点击事件
4908   - >
4909   - {options2.map((option) => (
4910   - <Radio
4911   - key={option.value}
4912   - value={option.value}
4913   - onClick={(e) => {
4914   - radioOnChange2(
4915   - e as unknown as React.ChangeEvent<HTMLInputElement>,
4916   - );
4917   - handleSetNull2();
4918   - }}
4919   - >
4920   - {option.label}
4921   - </Radio>
4922   - ))}
4923   - </Radio.Group>
4924   - <div style={{ height: '25px' }}></div>
4925   - <ProTable
4926   - id="main-table"
4927   - // tableStyle={{backgroundColor:'red'}}
4928   -
4929   - actionRef={mainTableSecondRef}
4930   - formRef={mainTableSecondFormRef}
4931   - expandIconColumnIndex={-1}
4932   - columns={mainOrdersColumns}
4933   - rowKey="id"
4934   - pagination={{
4935   - showQuickJumper: true,
4936   - pageSize: pageSize,
4937   - current: currentPage,
4938   - showSizeChanger: true,
4939   - onChange: (page, size) => {
4940   - setPageSize(size);
4941   - setCurrentPage(page);
4942   - },
4943   - showTotal: (total, range) => {
4944   - return (
4945   - <>
4946   - <span>
4947   - {'第 ' +
4948   - range[0] +
4949   - '-' +
4950   - range[1] +
4951   - ' 条/总共 ' +
4952   - total +
4953   - ' 条主订单 '}
4954   - </span>
4955   - <span className="text-[#8C8C8C]">
4956   - {' (' + subOrderCount + ' 条子订单)'}
4957   - </span>
4958   - </>
4959   - );
4960   - },
4961   - }}
4962   - // showHeader={false}
4963   - expandedRowKeys={expandedRowKeys}
4964   - // expandable={{ expandedRowRender }}
4965   - dateFormatter="string"
4966   - options={false}
4967   - headerTitle=""
4968   - search={false}
4969   - // labelWidth: 'auto',
4970   - // onCollapse: resize,
4971   - request={request2}
4972   - toolbar={{
4973   - multipleLine: true,
4974   - }}
4975   - // toolBarRender={() => {
4976   - // return toolBarRender();
4977   - // }}
4978   - />
4979   -
4980   - {orderDrawerVisible && (
4981   - <OrderDrawer
4982   - data={orderOptType === 'add' ? {} : buildMainOrder()}
4983   - subOrders={orderOptType === 'add' ? [] : buildSubOrders()}
4984   - onClose={(isSuccess: boolean) => {
4985   - setOrderDrawerVisible(false);
4986   - clearOptObject();
4987   - if (isSuccess) {
4988   - refreshTable2();
4989   - }
4990   - }}
4991   - orderOptType={orderOptType}
4992   - />
4993   - )}
4994   -
4995   - {checkVisible && (
4996   - <CheckModal
4997   - setCheckVisible={(val: boolean) => {
4998   - setCheckVisible(val);
4999   - if (!val) {
5000   - clearOptObject();
5001   - }
5002   - }}
5003   - data={isMainOrder ? getFirstMainOrder() : buildMainOrder()}
5004   - subOrders={
5005   - isMainOrder
5006   - ? [...subOrderSelectedMap.values()].flat()
5007   - : buildSubOrders()
5008   - }
5009   - orderCheckType={orderCheckType}
5010   - openOrderDrawer={(type: any, id: any) => {
5011   - setCurrentMainId(id);
5012   - setOrderOptType(type);
5013   - setOrderDrawerVisible(true);
5014   - }}
5015   - onClose={() => {
5016   - clearOptObject();
5017   - setCheckVisible(false);
5018   - refreshTable2();
5019   - }}
5020   - />
5021   - )}
5022   -
5023   - {applyForInvoicingVisible && (
5024   - <ApplyForInvoicingModal
5025   - setCheckVisible={(val: boolean) => {
5026   - setApplyForInvoicingVisible(val);
5027   - if (!val) {
5028   - clearOptObject();
5029   - }
5030   - }}
5031   - subOrders={
5032   - isMainOrder
5033   - ? [...subOrderSelectedMap.values()].flat()
5034   - : buildSubOrders()
5035   - }
5036   - totalPayment={getApplyInvoicingTotalPayment()}
5037   - isMainOrder={isMainOrder}
5038   - isEdit={isEdit}
5039   - onClose={() => {
5040   - setApplyForInvoicingVisible(false);
5041   - setIsMainOrder(false);
5042   - clearOptObject();
5043   - refreshTable2();
5044   - }}
5045   - />
5046   - )}
5047   -
5048   - {notesEditVisible && (
5049   - <OrderNotesEditModal
5050   - setNotesEditVisible={(val: boolean) => {
5051   - setNotesEditVisible(val);
5052   - if (!val) {
5053   - clearOptObject();
5054   - }
5055   - }}
5056   - ids={selectedRows}
5057   - notesType={notesType}
5058   - notes={notes}
5059   - onClose={() => {
5060   - setNotesEditVisible(false);
5061   - setSelectedRows([]);
5062   - setNotes(notes);
5063   - setNotesType(1);
5064   - refreshTable2();
5065   - }}
5066   - />
5067   - )}
5068   -
5069   - {deliverVisible && (
5070   - <DeliverModal
5071   - data={buildSubOrders()}
5072   - isSendProduct={isSendProduct}
5073   - setVisible={(val: boolean) => {
5074   - setDeliverVisible(val);
5075   - if (!val) {
5076   - clearOptObject();
5077   - }
5078   - }}
5079   - sendType={orderCheckType}
5080   - onClose={() => {
5081   - clearOptObject();
5082   - setDeliverVisible(false);
5083   - setIsSendProduct(false);
5084   - refreshTable2();
5085   - }}
5086   - />
5087   - )}
5088   -
5089   - {financialVisible && (
5090   - <FinancialDrawer
5091   - isEdit={isEdit}
5092   - mainOrder={isMainOrder ? getFirstMainOrder() : buildMainOrder()}
5093   - subOrders={
5094   - isMainOrder
5095   - ? [...subOrderSelectedMap.values()].flat()
5096   - : buildSubOrders()
5097   - }
5098   - isMainOrder={isMainOrder}
5099   - cancel={() => {
5100   - setFinancialVisible(false);
5101   - clearOptObject();
5102   - setIsMainOrder(false);
5103   - setIsEdit(false);
5104   - }}
5105   - onClose={() => {
5106   - setFinancialVisible(false);
5107   - clearOptObject();
5108   - refreshTable2();
5109   - setIsMainOrder(false);
5110   - setIsEdit(false);
5111   - }}
5112   - />
5113   - )}
5114   -
5115   - {financialEditVisible && (
5116   - <FinancialEditDrawer
5117   - mainOrder={buildMainOrder()}
5118   - subOrders={buildSubOrders()}
5119   - isMainOrder={isMainOrder}
5120   - setVisible={() => {
5121   - setFinancialEditVisible(false);
5122   - clearOptObject();
5123   - }}
5124   - onClose={() => {
5125   - setFinancialEditVisible(false);
5126   - refreshTable2();
5127   - setIsMainOrder(false);
5128   - clearOptObject();
5129   - }}
5130   - />
5131   - )}
5132   -
5133   - {orderPrintVisible && (
5134   - <OrderPrintModal
5135   - mainOrder={buildMainOrder()}
5136   - subOrders={buildSubOrders()}
5137   - isRePrint={isRePrintOrder}
5138   - setVisible={(val: boolean) => {
5139   - setOrderPrintVisible(val);
5140   - if (!val) {
5141   - clearOptObject();
5142   - }
5143   - }}
5144   - printOptType={orderCheckType}
5145   - onClose={() => {
5146   - setOrderPrintVisible(false);
5147   - clearOptObject();
5148   - setIsRePrintOrder(false);
5149   - refreshTable2();
5150   - }}
5151   - />
5152   - )}
5153   -
5154   - {confirmReceiptVisible && (
5155   - <ConfirmReceiptModal
5156   - data={buildSubOrders()}
5157   - onClose={() => {
5158   - setConfirmReceiptVisible(false);
5159   - clearOptObject();
5160   - refreshTable2();
5161   - }}
5162   - />
5163   - )}
5164   -
5165   - {imagesViewerModalVisible && (
5166   - <ImagesViewerModal
5167   - optType={imagesViewerOptType}
5168   - setVisible={(val: boolean) => {
5169   - setImagesViewerModalVisible(val);
5170   - if (!val) {
5171   - clearOptObject();
5172   - }
5173   - }}
5174   - onClose={() => {
5175   - setImagesViewerModalVisible(false);
5176   - }}
5177   - orderRow={buildSubOrders()[0]}
5178   - />
5179   - )}
5180   -
5181   - {importModalVisible && (
5182   - <ImportModal
5183   - onClose={() => {
5184   - setImportModalVisible(false);
5185   - refreshTable2();
5186   - }}
5187   - />
5188   - )}
5189   -
5190   - {attachmentModalVisible && (
5191   - <AttachmentModal
5192   - data={buildSubOrders()[0]}
5193   - onClose={() => {
5194   - setAttachmentModalVisible(false);
5195   - clearOptObject();
5196   - }}
5197   - />
5198   - )}
5199   -
5200   - {historyModalVisible && (
5201   - <HistoryModal
5202   - subOrders={selectedRows}
5203   - isCancelledOrder={filterCondifion === 70}
5204   - onClose={() => {
5205   - setHistoryModalVisible(false);
5206   - setSelectedRows({});
5207   - clearOptObject();
5208   - }}
5209   - />
5210   - )}
5211   -
5212   - {deliverInfoDrawerVisible && (
5213   - <DeliverInfoDrawer
5214   - data={buildMainOrder()}
5215   - onClose={() => {
5216   - setDeliverInfoDrawerVisible(false);
5217   - clearOptObject();
5218   - }}
5219   - />
5220   - )}
5221   -
5222   - {deliverInfoDrawerVisible && (
5223   - <DeliverInfoDrawer
5224   - data={buildMainOrder()}
5225   - onClose={() => {
5226   - setDeliverInfoDrawerVisible(false);
5227   - clearOptObject();
5228   - }}
5229   - />
5230   - )}
5231   -
5232   - {procureCheckModalVisible && (
5233   - <ProcureCheckModal
5234   - setCheckVisible={(val: boolean) => {
5235   - setProcureCheckModalVisible(val);
5236   - if (!val) {
5237   - clearOptObject();
5238   - }
5239   - }}
5240   - isMainOrder={isMainOrder}
5241   - orders={
5242   - isMainOrder
5243   - ? [...subOrderSelectedMap.values()].flat()
5244   - : buildSubOrders()
5245   - }
5246   - onClose={() => {
5247   - setProcureCheckModalVisible(false);
5248   - clearOptObject();
5249   - setIsMainOrder(false);
5250   - refreshTable2();
5251   - }}
5252   - />
5253   - )}
5254   -
5255   - {afterSalesDrawerVisible && (
5256   - <AfterSalesDrawer
5257   - setVisible={(val: boolean) => {
5258   - setAfterSalesDrawerVisible(val);
5259   - if (!val) {
5260   - clearOptObject();
5261   - }
5262   - }}
5263   - mainOrder={buildMainOrder()}
5264   - subOrders={buildSubOrders()}
5265   - onClose={() => {
5266   - setAfterSalesDrawerVisible(false);
5267   - clearOptObject();
5268   - refreshTable2();
5269   - }}
5270   - />
5271   - )}
5272   -
5273   - {procureConvertModalVisible && (
5274   - <ProcureConvertModal
5275   - setVisible={(val: boolean) => {
5276   - setProcureConvertModalVisible(val);
5277   - if (!val) {
5278   - clearOptObject();
5279   - }
5280   - }}
5281   - subOrders={buildSubOrders()}
5282   - onClose={() => {
5283   - setProcureConvertModalVisible(false);
5284   - clearOptObject();
5285   - refreshTable2();
5286   - }}
5287   - />
5288   - )}
5289   -
5290   - {financialMergeDrawerVisible && (
5291   - <FinancialMergeDrawer
5292   - setVisible={(val: boolean) => {
5293   - setFinancialMergeDrawerVisible(val);
5294   - if (!val) {
5295   - clearOptObject();
5296   - }
5297   - }}
5298   - dataList={
5299   - isMainOrder
5300   - ? [...subOrderSelectedMap.values()].flat()
5301   - : buildSubOrders()
5302   - }
5303   - onClose={() => {
5304   - setFinancialMergeDrawerVisible(false);
5305   - setIsMainOrder(false);
5306   - clearOptObject();
5307   - refreshTable2();
5308   - }}
5309   - />
5310   - )}
5311   -
5312   - {financialReceiptsModalVisible && (
5313   - <FinancialReceiptsModal
5314   - setVisible={(val: boolean) => {
5315   - setFinancialReceiptsModalVisible(val);
5316   - if (!val) {
5317   - clearOptObject();
5318   - }
5319   - }}
5320   - datas={selectedRows}
5321   - onClose={() => {
5322   - setFinancialReceiptsModalVisible(false);
5323   - setSelectedRows({});
5324   - refreshTable2();
5325   - }}
5326   - />
5327   - )}
5328   -
5329   - {shippingWarehouseChangeModalVisible && (
5330   - <ShippingWarehouseChangeModal
5331   - setVisible={(val: boolean) => {
5332   - setShippingWarehouseChangeModalVisible(val);
5333   - if (!val) {
5334   - clearOptObject();
5335   - }
5336   - }}
5337   - subOrderIds={ids}
5338   - originShippingWarehouse={buildSubOrders()[0].shippingWarehouse}
5339   - onClose={() => {
5340   - setShippingWarehouseChangeModalVisible(false);
5341   - clearOptObject();
5342   - setIds([]);
5343   - refreshTable2();
5344   - }}
5345   - />
5346   - )}
5347   - {reissueVisible && (
5348   - <ReissueModal
5349   - setVisible={(val: boolean) => {
5350   - setReissueVisible(val);
5351   - if (!val) {
5352   - clearOptObject();
5353   - }
5354   - }}
5355   - subOrders={
5356   - isMainOrder
5357   - ? [...subOrderSelectedMap.values()].flat()
5358   - : buildSubOrders()
5359   - }
5360   - onClose={() => {
5361   - setReissueVisible(false);
5362   - clearOptObject();
5363   - refreshTable2();
5364   - }}
5365   - />
5366   - )}
5367   - {reissueVisibleOld && (
5368   - <ReissueModal_old
5369   - setVisible={(val: boolean) => {
5370   - setReissueVisibleOld(val);
5371   - console.log(reissueVisible);
5372   - if (!val) {
5373   - clearOptObject();
5374   - }
5375   - }}
5376   - mainOrder={buildMainOrder()}
5377   - subOrders={buildSubOrders()}
5378   - onClose={() => {
5379   - setReissueVisibleOld(false);
5380   - clearOptObject();
5381   - refreshTable2();
5382   - }}
5383   - />
5384   - )}
5385   - {productionTimeModalVisible && (
5386   - <ProductionTimeModal
5387   - setVisible={(val: boolean) => {
5388   - setProductionTimeModalVisible(val);
5389   - if (!val) {
5390   - clearOptObject();
5391   - }
5392   - }}
5393   - subOrders={buildSubOrders()}
5394   - onClose={() => {
5395   - setProductionTimeModalVisible(false);
5396   - clearOptObject();
5397   - refreshTable2();
5398   - }}
5399   - />
5400   - )}
5401   -
5402   - {modifiedDiffModalVisible && (
5403   - <ModifiedDiffModal
5404   - setVisible={(val: boolean) => {
5405   - setModifiedDiffModalVisible(val);
5406   - if (!val) {
5407   - clearOptObject();
5408   - }
5409   - }}
5410   - subOrders={buildSubOrders()}
5411   - mainOrder={buildMainOrder()}
5412   - onClose={() => {
5413   - setModifiedDiffModalVisible(false);
5414   - clearOptObject();
5415   - }}
5416   - />
5417   - )}
5418   -
5419   - {uploadPayBillModalVisible && (
5420   - <UploadPayBillModal
5421   - setVisible={(val: boolean) => {
5422   - setUploadPayBillModalVisible(val);
5423   - if (!val) {
5424   - clearOptObject();
5425   - }
5426   - }}
5427   - subOrders={buildSubOrders()}
5428   - mainOrder={buildMainOrder()}
5429   - onClose={() => {
5430   - setUploadPayBillModalVisible(false);
5431   - clearOptObject();
5432   - refreshTable2();
5433   - }}
5434   - />
5435   - )}
5436   - {invoicingDrawerFormVisible && (
5437   - <InvoicingDrawerForm
5438   - dataList={
5439   - isMainOrder
5440   - ? [...subOrderSelectedMap.values()].flat()
5441   - : buildSubOrders()
5442   - }
5443   - setVisible={(val: boolean) => {
5444   - setInvoicingDrawerFormVisible(val);
5445   - if (!val) {
5446   - clearOptObject();
5447   - }
5448   - }}
5449   - mainOrder={isMainOrder ? getFirstMainOrder() : buildMainOrder()}
5450   - onClose={() => {
5451   - setInvoicingDrawerFormVisible(false);
5452   - setIsMainOrder(true);
5453   - clearOptObject();
5454   - refreshTable2();
5455   - }}
5456   - />
5457   - )}
5458   - {contextHolder}
5459   - <FloatButton.BackTop visibilityHeight={0} />
5460   - </div>
5461   - ),
5462 4260 },
5463 4261 ];
5464 4262  
5465 4263 return (
5466 4264 <div className="order-page-container">
5467 4265 <div id="resizeDiv"></div>
5468   - <Tabs defaultActiveKey="1" items={tabsItems} onChange={() => {}} />
  4266 + <div key={'activeTabKey'}>
  4267 + <Radio.Group
  4268 + options={warningOptions}
  4269 + onChange={(e) => {
  4270 + setActiveTabKey(e.target.value);
  4271 + mainTableRef.current?.reload(); // 重新请求数据
  4272 + }}
  4273 + value={activeTabKey}
  4274 + optionType="button"
  4275 + />
  4276 + </div>
  4277 + <div style={{ height: '25px' }}></div>
  4278 + {/* <Tabs defaultActiveKey="1" items={tabsItems} onChange={() => { }} /> */}
  4279 + <Radio.Group
  4280 + value={value1}
  4281 + onChange={radioOnChange1}
  4282 + // 通过 onClick 处理单独 Radio 的点击事件
  4283 + >
  4284 + {(activeTabKey === 1
  4285 + ? options1
  4286 + : activeTabKey === 2
  4287 + ? options2
  4288 + : activeTabKey === 3
  4289 + ? options3
  4290 + : options4
  4291 + ).map((option) => (
  4292 + <Radio
  4293 + key={option.value}
  4294 + value={option.value}
  4295 + onClick={(e) => {
  4296 + radioOnChange1(
  4297 + e as unknown as React.ChangeEvent<HTMLInputElement>,
  4298 + );
  4299 + handleSetNull();
  4300 + }}
  4301 + >
  4302 + {option.label}
  4303 + </Radio>
  4304 + ))}
  4305 + </Radio.Group>
  4306 + <div style={{ height: '25px' }}></div>
  4307 + <ProTable
  4308 + id="main-table"
  4309 + // tableStyle={{backgroundColor:'red'}}
  4310 +
  4311 + actionRef={mainTableRef}
  4312 + formRef={mainTableFormRef}
  4313 + expandIconColumnIndex={-1}
  4314 + columns={mainOrdersColumns}
  4315 + rowKey="id"
  4316 + pagination={{
  4317 + showQuickJumper: true,
  4318 + pageSize: pageSize,
  4319 + current: currentPage,
  4320 + showSizeChanger: true,
  4321 + onChange: (page, size) => {
  4322 + setPageSize(size);
  4323 + setCurrentPage(page);
  4324 + },
  4325 + showTotal: (total, range) => {
  4326 + return (
  4327 + <>
  4328 + <span>
  4329 + {'第 ' +
  4330 + range[0] +
  4331 + '-' +
  4332 + range[1] +
  4333 + ' 条/总共 ' +
  4334 + total +
  4335 + ' 条主订单 '}
  4336 + </span>
  4337 + <span className="text-[#8C8C8C]">
  4338 + {' (' + subOrderCount + ' 条子订单)'}
  4339 + </span>
  4340 + </>
  4341 + );
  4342 + },
  4343 + }}
  4344 + // showHeader={false}
  4345 + expandedRowKeys={expandedRowKeys}
  4346 + // expandable={{ expandedRowRender }}
  4347 + dateFormatter="string"
  4348 + options={false}
  4349 + headerTitle=""
  4350 + search={false}
  4351 + request={async (
  4352 + // 第一个参数 params 查询表单和 params 参数的结合
  4353 + // 第一个参数中一定会有 pageSize 和 current ,这两个参数是 antd 的规范
  4354 + params,
  4355 + sorter,
  4356 + filter,
  4357 + ) => {
  4358 + //订单id处理
  4359 + /**
  4360 + * 以params中的id为主,如果params没id,则取url中的id
  4361 + * 第一次进来这个页面,url带有id的话,会自动填充到查询表单中,但是第一次查询params不会带这个id进来
  4362 + */
  4363 + let orderIds = mainTableFormRef.current?.getFieldValue('id');
  4364 + let subOrderId =
  4365 + mainTableFormRef.current?.getFieldValue('subOrderId');
  4366 + params.id = params.id || orderIds;
  4367 + params.subOrderId = params.subOrderId || subOrderId;
  4368 + if (params.id !== '') {
  4369 + params.id = params.id?.replace(/ /g, '');
  4370 + if (params.id?.indexOf(',')) {
  4371 + params.id = params.id.split(',');
  4372 + params.id = params.id.filter((id) => {
  4373 + return id !== '';
  4374 + });
  4375 + }
  4376 + }
  4377 +
  4378 + params.condition = filterCondifion;
  4379 +
  4380 + //排序
  4381 + params.sorted = sorted;
  4382 + //是否只查看已作废
  4383 + params.isDeleteQueryOrder = filterCondifion === 70;
  4384 + let finalParams = {
  4385 + ...params,
  4386 + };
  4387 + console.log(5656);
  4388 + if (value1 === 0) {
  4389 + // const currentDate = new Date();
  4390 + // const newDate = new Date(currentDate);
  4391 + // newDate.setDate(currentDate.getDate() - 0);
  4392 + handleSetNull();
  4393 + }
  4394 + if (activeTabKey === 1) {
  4395 + // // 第一段代码
  4396 + // if (calDate === 'null') {
  4397 + // params.applyTimeLe = null;
  4398 + // } else {
  4399 + // params.applyTimeLe = calDate;
  4400 + // }
  4401 + // params.applyTimeIsNotNull = true; // 要求申请时间非空
  4402 + params.orderStatus = 'SHIPPED'; // 发票确认预警
  4403 + params.isDeleteQueryOrder = false; // 强制查询非作废订单
  4404 + params.salesCode = userInfo.username;
  4405 + // params.paymentMethod = 'UNPAID';
  4406 + finalParams = {
  4407 + ...params,
  4408 + statusDatetimeLe: calDate,
  4409 + };
  4410 + } else if (activeTabKey === 2) {
  4411 + // // 第一段代码
  4412 + // if (calDate === 'null') {
  4413 + // params.applyTimeLe = null;
  4414 + // } else {
  4415 + // params.applyTimeLe = calDate;
  4416 + // }
  4417 + // params.applyTimeIsNotNull = true; // 要求申请时间非空
  4418 + params.salesCode = userInfo.username;
  4419 + params.warningStatus = 'waitFeedbackWarning'; // 发票确认预警
  4420 + params.isDeleteQueryOrder = false; // 强制查询非作废订单
  4421 + // params.paymentMethod = 'UNPAID';
  4422 + finalParams = {
  4423 + ...params,
  4424 + confirmReceiptDatetimeLe: calDate,
  4425 + };
  4426 + } else if (activeTabKey === 3) {
  4427 + // 第一段代码
  4428 + // if (calDate === 'null') {
  4429 + // params.applyTimeLe = null;
  4430 + // } else {
  4431 + // params.applyTimeLe = calDate;
  4432 + // }
  4433 + params.applyTimeIsNotNull = true; // 要求申请时间非空
  4434 + params.salesCode = userInfo.username;
  4435 + params.warningStatus = 'invoiceConfirmWarning'; // 发票确认预警
  4436 + params.isDeleteQueryOrder = false; // 强制查询非作废订单
  4437 + params.paymentMethod = 'UNPAID';
  4438 + finalParams = {
  4439 + ...params,
  4440 + invoicingEndTime: calDate,
  4441 + };
  4442 + } else if (activeTabKey === 4) {
  4443 + console.log(value1, 56564);
  4444 + params.warningStatus = 'paymentReceiptStatusWarning'; // 用于回款预警
  4445 + if (calDate === 'null') {
  4446 + params.applyTimeLe = null;
  4447 + } else {
  4448 + params.applyTimeLe = calDate;
  4449 + }
  4450 + params.salesCode = userInfo.username;
  4451 + params.isDeleteQueryOrder = false; // 强制查询非作废订单
  4452 + params.paymentNotReceipt = true; // 在回款预警中标记未支付订单
  4453 + finalParams = {
  4454 + ...params,
  4455 + };
  4456 + }
  4457 +
  4458 + console.log(params, '5656params');
  4459 +
  4460 + //保存这个搜索条件
  4461 + setSearchParam(params);
  4462 + const { data } = await postServiceOrderQueryServiceOrder({
  4463 + // ...params,
  4464 + // FIXME: remove @ts-ignore
  4465 + // @ts-ignore
  4466 + sorter,
  4467 + filter,
  4468 + data: finalParams,
  4469 + });
  4470 +
  4471 + setRolePath(data.specialPath);
  4472 + setSubOrderCount(data.count);
  4473 + setAllMainChecked(false);
  4474 + setSelectedMainOrderKeys([]);
  4475 + subOrderSelectedMap.clear();
  4476 + mainOrderSelectedMap.clear();
  4477 + setData(data?.data);
  4478 +
  4479 + //主订单id与子订单id的对照关系保存
  4480 + mainOrderIdSubOrderIdRelationsMap.clear();
  4481 + for (let row of data?.data) {
  4482 + let mianOrderId = row.id;
  4483 + let subOrderIds = row.subOrderInformationLists?.map((item) => {
  4484 + //目前子订单存储的totalPayment不准确,这里重新处理取主订单的totalPayment
  4485 + //totalPayment在财务开票计算金额时使用到
  4486 + item.totalPayment = row.totalPayment;
  4487 + return item.id;
  4488 + });
  4489 + mainOrderIdSubOrderIdRelationsMap.set(mianOrderId, subOrderIds);
  4490 + }
  4491 +
  4492 + return {
  4493 + data: data?.data || [],
  4494 + total: data?.total || 0,
  4495 + };
  4496 + }}
  4497 + toolbar={{
  4498 + multipleLine: true,
  4499 + }}
  4500 + // toolBarRender={() => {
  4501 + // return toolBarRender();
  4502 + // }}
  4503 + />
  4504 +
  4505 + {orderDrawerVisible && (
  4506 + <OrderDrawer
  4507 + data={orderOptType === 'add' ? {} : buildMainOrder()}
  4508 + subOrders={orderOptType === 'add' ? [] : buildSubOrders()}
  4509 + onClose={(isSuccess: boolean) => {
  4510 + setOrderDrawerVisible(false);
  4511 + clearOptObject();
  4512 + if (isSuccess) {
  4513 + refreshTable();
  4514 + }
  4515 + }}
  4516 + orderOptType={orderOptType}
  4517 + />
  4518 + )}
  4519 +
  4520 + {checkVisible && (
  4521 + <CheckModal
  4522 + setCheckVisible={(val: boolean) => {
  4523 + setCheckVisible(val);
  4524 + if (!val) {
  4525 + clearOptObject();
  4526 + }
  4527 + }}
  4528 + data={isMainOrder ? getFirstMainOrder() : buildMainOrder()}
  4529 + subOrders={
  4530 + isMainOrder
  4531 + ? [...subOrderSelectedMap.values()].flat()
  4532 + : buildSubOrders()
  4533 + }
  4534 + orderCheckType={orderCheckType}
  4535 + openOrderDrawer={(type: any, id: any) => {
  4536 + setCurrentMainId(id);
  4537 + setOrderOptType(type);
  4538 + setOrderDrawerVisible(true);
  4539 + }}
  4540 + onClose={() => {
  4541 + clearOptObject();
  4542 + setCheckVisible(false);
  4543 + refreshTable();
  4544 + }}
  4545 + />
  4546 + )}
  4547 +
  4548 + {applyForInvoicingVisible && (
  4549 + <ApplyForInvoicingModal
  4550 + setCheckVisible={(val: boolean) => {
  4551 + setApplyForInvoicingVisible(val);
  4552 + if (!val) {
  4553 + clearOptObject();
  4554 + }
  4555 + }}
  4556 + subOrders={
  4557 + isMainOrder
  4558 + ? [...subOrderSelectedMap.values()].flat()
  4559 + : buildSubOrders()
  4560 + }
  4561 + totalPayment={getApplyInvoicingTotalPayment()}
  4562 + isMainOrder={isMainOrder}
  4563 + isEdit={isEdit}
  4564 + onClose={() => {
  4565 + setApplyForInvoicingVisible(false);
  4566 + setIsMainOrder(false);
  4567 + clearOptObject();
  4568 + refreshTable();
  4569 + }}
  4570 + />
  4571 + )}
  4572 +
  4573 + {notesEditVisible && (
  4574 + <OrderNotesEditModal
  4575 + setNotesEditVisible={(val: boolean) => {
  4576 + setNotesEditVisible(val);
  4577 + if (!val) {
  4578 + clearOptObject();
  4579 + }
  4580 + }}
  4581 + ids={selectedRows}
  4582 + notesType={notesType}
  4583 + notes={notes}
  4584 + onClose={() => {
  4585 + setNotesEditVisible(false);
  4586 + setSelectedRows([]);
  4587 + setNotes(notes);
  4588 + setNotesType(1);
  4589 + refreshTable();
  4590 + }}
  4591 + />
  4592 + )}
  4593 +
  4594 + {deliverVisible && (
  4595 + <DeliverModal
  4596 + data={buildSubOrders()}
  4597 + isSendProduct={isSendProduct}
  4598 + setVisible={(val: boolean) => {
  4599 + setDeliverVisible(val);
  4600 + if (!val) {
  4601 + clearOptObject();
  4602 + }
  4603 + }}
  4604 + sendType={orderCheckType}
  4605 + onClose={() => {
  4606 + clearOptObject();
  4607 + setDeliverVisible(false);
  4608 + setIsSendProduct(false);
  4609 + refreshTable();
  4610 + }}
  4611 + />
  4612 + )}
  4613 +
  4614 + {financialVisible && (
  4615 + <FinancialDrawer
  4616 + isEdit={isEdit}
  4617 + mainOrder={isMainOrder ? getFirstMainOrder() : buildMainOrder()}
  4618 + subOrders={
  4619 + isMainOrder
  4620 + ? [...subOrderSelectedMap.values()].flat()
  4621 + : buildSubOrders()
  4622 + }
  4623 + isMainOrder={isMainOrder}
  4624 + cancel={() => {
  4625 + setFinancialVisible(false);
  4626 + clearOptObject();
  4627 + setIsMainOrder(false);
  4628 + setIsEdit(false);
  4629 + }}
  4630 + onClose={() => {
  4631 + setFinancialVisible(false);
  4632 + clearOptObject();
  4633 + refreshTable();
  4634 + setIsMainOrder(false);
  4635 + setIsEdit(false);
  4636 + }}
  4637 + />
  4638 + )}
  4639 +
  4640 + {financialEditVisible && (
  4641 + <FinancialEditDrawer
  4642 + mainOrder={buildMainOrder()}
  4643 + subOrders={buildSubOrders()}
  4644 + isMainOrder={isMainOrder}
  4645 + setVisible={() => {
  4646 + setFinancialEditVisible(false);
  4647 + clearOptObject();
  4648 + }}
  4649 + onClose={() => {
  4650 + setFinancialEditVisible(false);
  4651 + refreshTable();
  4652 + setIsMainOrder(false);
  4653 + clearOptObject();
  4654 + }}
  4655 + />
  4656 + )}
  4657 +
  4658 + {orderPrintVisible && (
  4659 + <OrderPrintModal
  4660 + mainOrder={buildMainOrder()}
  4661 + subOrders={buildSubOrders()}
  4662 + isRePrint={isRePrintOrder}
  4663 + setVisible={(val: boolean) => {
  4664 + setOrderPrintVisible(val);
  4665 + if (!val) {
  4666 + clearOptObject();
  4667 + }
  4668 + }}
  4669 + printOptType={orderCheckType}
  4670 + onClose={() => {
  4671 + setOrderPrintVisible(false);
  4672 + clearOptObject();
  4673 + setIsRePrintOrder(false);
  4674 + refreshTable();
  4675 + }}
  4676 + />
  4677 + )}
  4678 +
  4679 + {confirmReceiptVisible && (
  4680 + <ConfirmReceiptModal
  4681 + data={buildSubOrders()}
  4682 + onClose={() => {
  4683 + setConfirmReceiptVisible(false);
  4684 + clearOptObject();
  4685 + refreshTable();
  4686 + }}
  4687 + />
  4688 + )}
  4689 +
  4690 + {imagesViewerModalVisible && (
  4691 + <ImagesViewerModal
  4692 + optType={imagesViewerOptType}
  4693 + setVisible={(val: boolean) => {
  4694 + setImagesViewerModalVisible(val);
  4695 + if (!val) {
  4696 + clearOptObject();
  4697 + }
  4698 + }}
  4699 + onClose={() => {
  4700 + setImagesViewerModalVisible(false);
  4701 + }}
  4702 + orderRow={buildSubOrders()[0]}
  4703 + />
  4704 + )}
  4705 +
  4706 + {importModalVisible && (
  4707 + <ImportModal
  4708 + onClose={() => {
  4709 + setImportModalVisible(false);
  4710 + refreshTable();
  4711 + }}
  4712 + />
  4713 + )}
  4714 +
  4715 + {attachmentModalVisible && (
  4716 + <AttachmentModal
  4717 + data={buildSubOrders()[0]}
  4718 + onClose={() => {
  4719 + setAttachmentModalVisible(false);
  4720 + clearOptObject();
  4721 + }}
  4722 + />
  4723 + )}
  4724 +
  4725 + {historyModalVisible && (
  4726 + <HistoryModal
  4727 + subOrders={selectedRows}
  4728 + isCancelledOrder={filterCondifion === 70}
  4729 + onClose={() => {
  4730 + setHistoryModalVisible(false);
  4731 + setSelectedRows({});
  4732 + clearOptObject();
  4733 + }}
  4734 + />
  4735 + )}
  4736 +
  4737 + {deliverInfoDrawerVisible && (
  4738 + <DeliverInfoDrawer
  4739 + data={buildMainOrder()}
  4740 + onClose={() => {
  4741 + setDeliverInfoDrawerVisible(false);
  4742 + clearOptObject();
  4743 + }}
  4744 + />
  4745 + )}
  4746 +
  4747 + {deliverInfoDrawerVisible && (
  4748 + <DeliverInfoDrawer
  4749 + data={buildMainOrder()}
  4750 + onClose={() => {
  4751 + setDeliverInfoDrawerVisible(false);
  4752 + clearOptObject();
  4753 + }}
  4754 + />
  4755 + )}
  4756 +
  4757 + {procureCheckModalVisible && (
  4758 + <ProcureCheckModal
  4759 + setCheckVisible={(val: boolean) => {
  4760 + setProcureCheckModalVisible(val);
  4761 + if (!val) {
  4762 + clearOptObject();
  4763 + }
  4764 + }}
  4765 + isMainOrder={isMainOrder}
  4766 + orders={
  4767 + isMainOrder
  4768 + ? [...subOrderSelectedMap.values()].flat()
  4769 + : buildSubOrders()
  4770 + }
  4771 + onClose={() => {
  4772 + setProcureCheckModalVisible(false);
  4773 + clearOptObject();
  4774 + setIsMainOrder(false);
  4775 + refreshTable();
  4776 + }}
  4777 + />
  4778 + )}
  4779 +
  4780 + {afterSalesDrawerVisible && (
  4781 + <AfterSalesDrawer
  4782 + setVisible={(val: boolean) => {
  4783 + setAfterSalesDrawerVisible(val);
  4784 + if (!val) {
  4785 + clearOptObject();
  4786 + }
  4787 + }}
  4788 + mainOrder={buildMainOrder()}
  4789 + subOrders={buildSubOrders()}
  4790 + onClose={() => {
  4791 + setAfterSalesDrawerVisible(false);
  4792 + clearOptObject();
  4793 + refreshTable();
  4794 + }}
  4795 + />
  4796 + )}
  4797 +
  4798 + {procureConvertModalVisible && (
  4799 + <ProcureConvertModal
  4800 + setVisible={(val: boolean) => {
  4801 + setProcureConvertModalVisible(val);
  4802 + if (!val) {
  4803 + clearOptObject();
  4804 + }
  4805 + }}
  4806 + subOrders={buildSubOrders()}
  4807 + onClose={() => {
  4808 + setProcureConvertModalVisible(false);
  4809 + clearOptObject();
  4810 + refreshTable();
  4811 + }}
  4812 + />
  4813 + )}
  4814 +
  4815 + {financialMergeDrawerVisible && (
  4816 + <FinancialMergeDrawer
  4817 + setVisible={(val: boolean) => {
  4818 + setFinancialMergeDrawerVisible(val);
  4819 + if (!val) {
  4820 + clearOptObject();
  4821 + }
  4822 + }}
  4823 + dataList={
  4824 + isMainOrder
  4825 + ? [...subOrderSelectedMap.values()].flat()
  4826 + : buildSubOrders()
  4827 + }
  4828 + onClose={() => {
  4829 + setFinancialMergeDrawerVisible(false);
  4830 + setIsMainOrder(false);
  4831 + clearOptObject();
  4832 + refreshTable();
  4833 + }}
  4834 + />
  4835 + )}
  4836 +
  4837 + {financialReceiptsModalVisible && (
  4838 + <FinancialReceiptsModal
  4839 + setVisible={(val: boolean) => {
  4840 + setFinancialReceiptsModalVisible(val);
  4841 + if (!val) {
  4842 + clearOptObject();
  4843 + }
  4844 + }}
  4845 + datas={selectedRows}
  4846 + onClose={() => {
  4847 + setFinancialReceiptsModalVisible(false);
  4848 + setSelectedRows({});
  4849 + refreshTable();
  4850 + }}
  4851 + />
  4852 + )}
  4853 +
  4854 + {shippingWarehouseChangeModalVisible && (
  4855 + <ShippingWarehouseChangeModal
  4856 + setVisible={(val: boolean) => {
  4857 + setShippingWarehouseChangeModalVisible(val);
  4858 + if (!val) {
  4859 + clearOptObject();
  4860 + }
  4861 + }}
  4862 + subOrderIds={ids}
  4863 + originShippingWarehouse={buildSubOrders()[0].shippingWarehouse}
  4864 + onClose={() => {
  4865 + setShippingWarehouseChangeModalVisible(false);
  4866 + clearOptObject();
  4867 + setIds([]);
  4868 + refreshTable();
  4869 + }}
  4870 + />
  4871 + )}
  4872 + {reissueVisible && (
  4873 + <ReissueModal
  4874 + setVisible={(val: boolean) => {
  4875 + setReissueVisible(val);
  4876 + if (!val) {
  4877 + clearOptObject();
  4878 + }
  4879 + }}
  4880 + subOrders={
  4881 + isMainOrder
  4882 + ? [...subOrderSelectedMap.values()].flat()
  4883 + : buildSubOrders()
  4884 + }
  4885 + onClose={() => {
  4886 + setReissueVisible(false);
  4887 + clearOptObject();
  4888 + refreshTable();
  4889 + }}
  4890 + />
  4891 + )}
  4892 + {reissueVisibleOld && (
  4893 + <ReissueModal_old
  4894 + setVisible={(val: boolean) => {
  4895 + setReissueVisibleOld(val);
  4896 + console.log(reissueVisible);
  4897 + if (!val) {
  4898 + clearOptObject();
  4899 + }
  4900 + }}
  4901 + mainOrder={buildMainOrder()}
  4902 + subOrders={buildSubOrders()}
  4903 + onClose={() => {
  4904 + setReissueVisibleOld(false);
  4905 + clearOptObject();
  4906 + refreshTable();
  4907 + }}
  4908 + />
  4909 + )}
  4910 + {productionTimeModalVisible && (
  4911 + <ProductionTimeModal
  4912 + setVisible={(val: boolean) => {
  4913 + setProductionTimeModalVisible(val);
  4914 + if (!val) {
  4915 + clearOptObject();
  4916 + }
  4917 + }}
  4918 + subOrders={buildSubOrders()}
  4919 + onClose={() => {
  4920 + setProductionTimeModalVisible(false);
  4921 + clearOptObject();
  4922 + refreshTable();
  4923 + }}
  4924 + />
  4925 + )}
  4926 +
  4927 + {modifiedDiffModalVisible && (
  4928 + <ModifiedDiffModal
  4929 + setVisible={(val: boolean) => {
  4930 + setModifiedDiffModalVisible(val);
  4931 + if (!val) {
  4932 + clearOptObject();
  4933 + }
  4934 + }}
  4935 + subOrders={buildSubOrders()}
  4936 + mainOrder={buildMainOrder()}
  4937 + onClose={() => {
  4938 + setModifiedDiffModalVisible(false);
  4939 + clearOptObject();
  4940 + }}
  4941 + />
  4942 + )}
  4943 +
  4944 + {uploadPayBillModalVisible && (
  4945 + <UploadPayBillModal
  4946 + setVisible={(val: boolean) => {
  4947 + setUploadPayBillModalVisible(val);
  4948 + if (!val) {
  4949 + clearOptObject();
  4950 + }
  4951 + }}
  4952 + subOrders={buildSubOrders()}
  4953 + mainOrder={buildMainOrder()}
  4954 + onClose={() => {
  4955 + setUploadPayBillModalVisible(false);
  4956 + clearOptObject();
  4957 + refreshTable();
  4958 + }}
  4959 + />
  4960 + )}
  4961 + {feedbackRegistrationModalVisible && (
  4962 + <FeedbackRegistrationModal
  4963 + setVisible={(val: boolean) => {
  4964 + setFeedbackRegistrationModalVisible(val);
  4965 + if (!val) {
  4966 + clearOptObject();
  4967 + }
  4968 + }}
  4969 + subOrders={buildSubOrders()}
  4970 + mainOrder={buildMainOrder()}
  4971 + onClose={() => {
  4972 + setFeedbackRegistrationModalVisible(false);
  4973 + clearOptObject();
  4974 + refreshTable();
  4975 + }}
  4976 + />
  4977 + )}
  4978 +
  4979 + {invoicingDrawerFormVisible && (
  4980 + <InvoicingDrawerForm
  4981 + dataList={
  4982 + isMainOrder
  4983 + ? [...subOrderSelectedMap.values()].flat()
  4984 + : buildSubOrders()
  4985 + }
  4986 + setVisible={(val: boolean) => {
  4987 + setInvoicingDrawerFormVisible(val);
  4988 + if (!val) {
  4989 + clearOptObject();
  4990 + }
  4991 + }}
  4992 + mainOrder={isMainOrder ? getFirstMainOrder() : buildMainOrder()}
  4993 + onClose={() => {
  4994 + setInvoicingDrawerFormVisible(false);
  4995 + setIsMainOrder(true);
  4996 + clearOptObject();
  4997 + refreshTable();
  4998 + }}
  4999 + />
  5000 + )}
  5001 + {contextHolder}
  5002 + <FloatButton.BackTop visibilityHeight={0} />
5469 5003 </div>
5470 5004 );
5471 5005 };
... ...
src/pages/Order/OrderWarning/indexhide.tsx deleted 100644 → 0
1   -import ButtonConfirm from '@/components/ButtomConfirm';
2   -import { RESPONSE_CODE } from '@/constants/enum';
3   -import InvoicingDrawerForm from '@/pages/Order/OrderWarning/components/InvoicingDrawerForm';
4   -import ReissueModal from '@/pages/Order/OrderWarning/components/ReissueModal';
5   -import ReissueModal_old from '@/pages/Order/OrderWarning/components/ReissueModal_old';
6   -import {
7   - postKingdeeRepSalBillOutbound,
8   - postKingdeeRepSalOrderSave,
9   - postServiceConstCanApplyAfterInvoicingStatus,
10   - postServiceInvoiceCancelApply,
11   - postServiceOrderCancelSend,
12   - postServiceOrderGetCurrentOptNode,
13   - postServiceOrderNoNeedSend,
14   - postServiceOrderOrderCancel,
15   - postServiceOrderProcureOrder,
16   - postServiceOrderProcurePrint,
17   - postServiceOrderProvideProcurementRoles,
18   - postServiceOrderQueryServiceOrder,
19   - postServiceOrderSaleCancelInvoicing,
20   - postServiceOrderSalesConfirm,
21   - postServiceOrderWarningOrderStatistics,
22   -} from '@/services';
23   -import {
24   - FloatAdd,
25   - copyToClipboard,
26   - enumToProTableEnumValue,
27   - enumValueToLabel,
28   - formatDateTime,
29   - formatdate,
30   - getAliYunOSSFileNameFromUrl,
31   - isImageName,
32   -} from '@/utils';
33   -import {
34   - getReceivingCompanyOptions,
35   - isAdmin,
36   - isExaminer,
37   - isFinance,
38   - isProcure,
39   - isSales,
40   - isSupplier,
41   - isWarehousekeeper,
42   -} from '@/utils/order';
43   -import { getUserInfo } from '@/utils/user';
44   -import {
45   - ClockCircleTwoTone,
46   - ContainerTwoTone,
47   - CopyOutlined,
48   - CopyTwoTone,
49   - EditTwoTone,
50   - QuestionCircleOutlined,
51   -} from '@ant-design/icons';
52   -import {
53   - ActionType,
54   - ProColumns,
55   - ProFormInstance,
56   - ProTable,
57   -} from '@ant-design/pro-components';
58   -import {
59   - Badge,
60   - Button,
61   - Card,
62   - Checkbox,
63   - Col,
64   - Divider,
65   - Flex,
66   - FloatButton,
67   - Image,
68   - Modal,
69   - Popconfirm,
70   - Radio,
71   - Row,
72   - Space,
73   - Spin,
74   - Tabs,
75   - Tag,
76   - Tooltip,
77   - message,
78   -} from 'antd';
79   -import Base64 from 'base-64';
80   -import { format } from 'date-fns';
81   -import { cloneDeep } from 'lodash';
82   -import React, { Key, useEffect, useRef, useState } from 'react';
83   -import OrderPrintModal from '../../OrderPrint/OrderPrintModal';
84   -import {
85   - AFTER_INVOICING_STATUS,
86   - CHECK_TYPE,
87   - LOGISTICS_STATUS_OPTIONS,
88   - MAIN_ORDER_COLUMNS,
89   - MODIFIED_AUDIT_STATUS_OPTIONS,
90   - ORDER_STATUS_OPTIONS,
91   - PAYEE_OPTIONS,
92   - PAYMENT_CHANNEL_OPTIONS,
93   - PAYMENT_RECEIPTS_STATUS_OPTIONS,
94   - POST_AUDIT_OPTIONS,
95   - PROCURE_ORDER_STATUS,
96   - PROCURE_PRIMARY_ORDER_STATUS_OPTIONS,
97   - PRODUCT_BELONG_DEPARTMENT_OPTIONS,
98   - SHIPPING_WAREHOUSE_OPTIONS,
99   - TAGS_COLOR,
100   - getInvoicingType,
101   - getNeedInvoicing,
102   -} from '../constant';
103   -import AfterSalesDrawer from './components/AfterSalesDrawer';
104   -import ApplyForInvoicingModal from './components/ApplyForInvoicingModal';
105   -import AttachmentModal from './components/AttachmentModal';
106   -import CheckModal from './components/CheckModal';
107   -import ConfirmReceiptModal from './components/ConfirmReceiptModal';
108   -import DeliverInfoDrawer from './components/DeliverInfoDrawer';
109   -import DeliverModal from './components/DeliverModal';
110   -import FinancialDrawer from './components/FinancialDrawer';
111   -import FinancialEditDrawer from './components/FinancialEditDrawer';
112   -import FinancialMergeDrawer from './components/FinancialMergeDrawer';
113   -import FinancialReceiptsModal from './components/FinancialReceiptsModal';
114   -import HistoryModal from './components/HistoryModal';
115   -import ImagesViewerModal from './components/ImagesViewerModal';
116   -import ImportModal from './components/ImportModal';
117   -import ModifiedDiffModal from './components/ModifiedDiffModal';
118   -import OrderDrawer from './components/OrderDrawer';
119   -import OrderNotesEditModal from './components/OrderNotesEditModal';
120   -import ProcureCheckModal from './components/ProcureCheckModal';
121   -import ProcureConvertModal from './components/ProcureConvertModal';
122   -import ProductionTimeModal from './components/ProductionTimeModal';
123   -import ShippingWarehouseChangeModal from './components/ShippingWarehouseChangeModal';
124   -import UploadPayBillModal from './components/UploadPayBillModal';
125   -import './index.less';
126   -import { OrderListItemType, OrderType } from './type.d';
127   -
128   -const OrderPage = () => {
129   - const [orderDrawerVisible, setOrderDrawerVisible] = useState<boolean>(false);
130   - const [checkVisible, setCheckVisible] = useState<boolean>(false);
131   - const [orderPrintVisible, setOrderPrintVisible] = useState<boolean>(false);
132   - const [allMainChecked, setAllMainChecked] = useState(false);
133   - const [imagesViewerModalVisible, setImagesViewerModalVisible] =
134   - useState<boolean>(false);
135   - const [data, setData] = useState([]); //列表数据
136   - const [notesEditVisible, setNotesEditVisible] = useState<boolean>(false);
137   - const [financialMergeDrawerVisible, setFinancialMergeDrawerVisible] =
138   - useState<boolean>(false);
139   - const [attachmentModalVisible, setAttachmentModalVisible] =
140   - useState<boolean>(false);
141   - const [uploadPayBillModalVisible, setUploadPayBillModalVisible] =
142   - useState<boolean>(false);
143   - const [modifiedDiffModalVisible, setModifiedDiffModalVisible] =
144   - useState<boolean>(false);
145   - const [financialReceiptsModalVisible, setFinancialReceiptsModalVisible] =
146   - useState(false);
147   - const [financialVisible, setFinancialVisible] = useState<boolean>(false);
148   - const [financialEditVisible, setFinancialEditVisible] =
149   - useState<boolean>(false);
150   - const [afterSalesDrawerVisible, setAfterSalesDrawerVisible] =
151   - useState<boolean>(false);
152   - const [historyModalVisible, setHistoryModalVisible] =
153   - useState<boolean>(false);
154   - const [isRePrintOrder, setIsRePrintOrder] = useState<boolean>(false);
155   - const [isSendProduct, setIsSendProduct] = useState<boolean>(false);
156   - const [isMainOrder, setIsMainOrder] = useState<boolean>(false);
157   - const [importModalVisible, setImportModalVisible] = useState<boolean>(false);
158   - const [reissueVisible, setReissueVisible] = useState<boolean>(false);
159   - const [reissueVisibleOld, setReissueVisibleOld] = useState<boolean>(false);
160   - const [applyForInvoicingVisible, setApplyForInvoicingVisible] =
161   - useState<boolean>(false);
162   - const [procureCheckModalVisible, setProcureCheckModalVisible] =
163   - useState<boolean>(false);
164   - const [procureConvertModalVisible, setProcureConvertModalVisible] =
165   - useState<boolean>(false);
166   - const [invoicingDrawerFormVisible, setInvoicingDrawerFormVisible] =
167   - useState<boolean>(false);
168   - const [confirmReceiptVisible, setConfirmReceiptVisible] =
169   - useState<boolean>(false);
170   - const [productionTimeModalVisible, setProductionTimeModalVisible] =
171   - useState<boolean>(false);
172   - const [deliverVisible, setDeliverVisible] = useState<boolean>(false);
173   - const [deliverInfoDrawerVisible, setDeliverInfoDrawerVisible] =
174   - useState<boolean>(false);
175   - const [orderOptType, setOrderOptType] = useState<string>('');
176   - const [isEdit, setIsEdit] = useState<boolean>(false);
177   - const [expandedRowKeys] = useState<Key[]>([]);
178   - const [notesType, setNotesType] = useState(1);
179   - const [notes, setNotes] = useState(1);
180   - const [rolePath, setRolePath] = useState([]); //当前角色权限(新增跟打印按钮)
181   - const userInfo = getUserInfo();
182   - // const [tableHeight, setTableHeight] = useState(200);
183   - const [selectedRows, setSelectedRows] = useState([]);
184   - const [mainOrderIdSubOrderIdRelationsMap] = useState(new Map()); //主订单id与子订单id的对照关系,用于主订单子订单的勾选校验,子订单全选中对应的主订单自动勾选上
185   - const [selectedMainOrderKeys, setSelectedMainOrderKeys] = useState<any[]>([]);
186   - const [selectedSubOrderKeys, setSelectedSubOrderKeys] = useState<any[]>([]);
187   - const [pageSize, setPageSize] = useState(10);
188   - const [currentPage, setCurrentPage] = useState(1);
189   - const [orderCheckType, setOrderCheckType] = useState('');
190   - const [imagesViewerOptType, setImagesViewerOptType] = useState('');
191   - const [filterCondifion] = useState(0);
192   - const [mainOrderSelectedMap] = useState(new Map()); //选中的主订单Map key:主订单id value:主订单数据
193   - const [subOrderSelectedMap, setSubOrderSelectedMap] = useState(new Map()); //选中的子订单Map key:主订单id value:选中的子订单数据集合
194   - const [currentOptMainId, setCurrentMainId] = useState<any>(undefined); //当前操作对象的主订单id
195   - const [curretnOptSubId, setCurretnOptSubId] = useState<any>(undefined); //当前操作对象的子订单id
196   - const [subOrderCount, setSubOrderCount] = useState(0);
197   - const [sorted] = useState(false);
198   - const mainTableRef = useRef<ActionType>();
199   - const mainTableFormRef = useRef<ProFormInstance>();
200   - let [setSearchParam] = useState(Object); //表格的查询条件存储
201   - const [contextHolder] = message.useMessage();
202   - const [
203   - shippingWarehouseChangeModalVisible,
204   - setShippingWarehouseChangeModalVisible,
205   - ] = useState(false);
206   - const [setCanApplyAfterInvoicingStatus] = useState([]);
207   - const [ids, setIds] = useState([]);
208   - const [recordOptNode, setRecordOptNode] = useState(null);
209   - const roleCode = userInfo?.roleSmallVO?.code;
210   - const triggerRecordOptNode = async (id) => {
211   - const res = await postServiceOrderGetCurrentOptNode({
212   - query: {
213   - id,
214   - },
215   - });
216   - setRecordOptNode(res.data);
217   - };
218   -
219   - const refreshTable = () => {
220   - mainTableRef.current?.reload();
221   - //刷新表格数据的时候,取消选中行
222   - setSelectedRows([]);
223   - setSelectedSubOrderKeys([]);
224   - };
225   -
226   - useEffect(() => {
227   - // 使用URLSearchParams来解析查询参数
228   - const params = new URLSearchParams(location.search);
229   - const id = params.get('id');
230   - const subOrderId = params.get('subOrderId');
231   - if (id) {
232   - mainTableFormRef.current?.setFieldValue('id', id);
233   - }
234   - if (subOrderId) {
235   - mainTableFormRef.current?.setFieldValue('subOrderId', subOrderId);
236   - }
237   - }, []);
238   -
239   - useEffect(() => {
240   - const initEnum = async () => {
241   - let invoiceTypeRet = await postServiceConstCanApplyAfterInvoicingStatus();
242   - if (invoiceTypeRet.result === RESPONSE_CODE.SUCCESS) {
243   - setCanApplyAfterInvoicingStatus(invoiceTypeRet.data);
244   - }
245   - };
246   - initEnum();
247   - }, []);
248   -
249   - /**
250   - * 复制订单到剪贴板
251   - * @param record
252   - */
253   - function copyOrderToClipboard(record: any) {
254   - let text = '';
255   - text += record?.id;
256   - text += ',' + record?.salesCode;
257   - text += ',' + record?.customerName;
258   -
259   - text += ',' + record?.customerContactNumber;
260   -
261   - text += ',' + record?.customerShippingAddress;
262   -
263   - if (!isSupplier()) {
264   - text += ',' + record?.institutionContactName;
265   - text += ',' + record?.institution;
266   - }
267   - record?.subOrderInformationLists?.forEach((item) => {
268   - text += '\n';
269   - text += item?.productName;
270   - text += ' ' + item?.parameters;
271   - text += ' ' + item?.quantity;
272   - text += ' ' + item?.unit;
273   - if (!isSupplier()) {
274   - text += ' ¥' + item?.subOrderPayment;
275   - }
276   - text += ' ' + item?.id;
277   - });
278   - if (copyToClipboard(text)) {
279   - message.info('已复制到剪贴板');
280   - } else {
281   - message.info('无法复制到剪贴板');
282   - }
283   - }
284   -
285   - const MyToolTip = ({ title, content }) => {
286   - return (
287   - <Tooltip
288   - color="#FFFFFF"
289   - placement="bottom"
290   - title={<div className="px-5 py-4 text-black">{title}</div>}
291   - >
292   - {content}
293   - </Tooltip>
294   - );
295   - };
296   -
297   - /**
298   - * 检查是否可以打印
299   - * @param paths 按钮集合
300   - * @returns
301   - */
302   - function checkePrintable(paths: any) {
303   - if (
304   - !paths?.includes('printOrder') &&
305   - !paths?.includes('supplierPrint') &&
306   - !paths?.includes('procurePrint') &&
307   - !paths?.includes('rePrintOrder')
308   - ) {
309   - return false;
310   - }
311   -
312   - return true;
313   - }
314   -
315   - /**
316   - * 重置当前的操作对象
317   - */
318   - function clearOptObject() {
319   - setCurrentMainId(undefined);
320   - setCurretnOptSubId(undefined);
321   - setIsMainOrder(false);
322   - }
323   -
324   - /**
325   - * 初始化当前的操作对象
326   - * @param subId
327   - * @param mainId
328   - */
329   - function createOptObject(subId: any, mainId: any) {
330   - setCurrentMainId(mainId);
331   - setCurretnOptSubId(subId);
332   - }
333   -
334   - /**
335   - * 检查当前操作是否异常
336   - */
337   - // function checkOptValid() {
338   - // if ((currentOptMainId === undefined || currentOptMainId === null) && (curretnOptSubId === undefined || curretnOptSubId === null)) {
339   - // message.error("页面错误:当前操作对象为空,请联系系统管理员");
340   - // return false;
341   - // }
342   -
343   - // //检查数据是否存在
344   - // //主订单数据
345   - // if (!Array.from(mainOrderIdSubOrderIdRelationsMap.keys()).includes(currentOptMainId)) {
346   - // message.error("页面错误:当前操作主订单对象为空,请联系系统管理员");
347   - // }
348   -
349   - // //子订单
350   - // let allSubIds = [];
351   - // for (const idList of mainOrderIdSubOrderIdRelationsMap.values()) {
352   - // allSubIds.push(...idList);
353   - // }
354   - // if (!allSubIds.includes(curretnOptSubId)) {
355   - // message.error("页面错误:当前操作子订单对象为空,请联系系统管理员");
356   - // return false
357   - // }
358   -
359   - // return true;
360   - // }
361   -
362   - /**
363   - * 获取当前选中子订单的其中一个主订单
364   - */
365   - function getFirstMainOrder() {
366   - let mainId = [...subOrderSelectedMap.values()].flat()[0].mainOrderId;
367   - for (let item of data) {
368   - if (item.id === mainId) {
369   - return item;
370   - }
371   - }
372   -
373   - return null;
374   - }
375   -
376   - /**
377   - * 返回当前操作的主订单数据
378   - */
379   - function buildMainOrder() {
380   - if (currentOptMainId === undefined || currentOptMainId === null) {
381   - message.error('页面错误:当前操作的主订单id不存在,请联系系统管理员');
382   - return;
383   - }
384   -
385   - let mainOrderClone = null;
386   - let matchedData = data.filter((item) => {
387   - return item.id === currentOptMainId;
388   - });
389   - if (matchedData.length > 0) {
390   - mainOrderClone = cloneDeep(matchedData[0]);
391   - }
392   -
393   - if (mainOrderClone === null) {
394   - message.error('页面错误:当前操作的主订单数据不存在,请联系系统管理员');
395   - }
396   -
397   - return mainOrderClone;
398   - }
399   -
400   - /**
401   - * 返回当前操作的子订单集合
402   - */
403   - function buildSubOrders() {
404   - if (currentOptMainId === undefined || currentOptMainId === null) {
405   - message.error('页面错误:当前操作的主订单id不存在,请联系系统管理员');
406   - return;
407   - }
408   -
409   - let cloneSubOrders = [];
410   -
411   - //如果没有传当前操作的子订单id,说明是操作主订单
412   - if (curretnOptSubId === undefined || curretnOptSubId === null) {
413   - //如果有选中子订单,那么取选中的子订单为操作对象,否则取当前主订单的全部子订单为操作对象
414   - let currentOptSubOrders = subOrderSelectedMap.get(currentOptMainId);
415   - if (
416   - currentOptSubOrders === null ||
417   - currentOptSubOrders === undefined ||
418   - currentOptSubOrders.length === 0
419   - ) {
420   - for (let item of data) {
421   - if (item.id === currentOptMainId) {
422   - for (let subOrder of item?.subOrderInformationLists) {
423   - cloneSubOrders.push(cloneDeep(subOrder));
424   - }
425   - }
426   - }
427   - } else {
428   - cloneSubOrders = currentOptSubOrders.map((item) => {
429   - return cloneDeep(item);
430   - });
431   - }
432   - } else {
433   - //操作的是子订单
434   - for (let item of data) {
435   - if (item.id === currentOptMainId) {
436   - for (let subOrder of item?.subOrderInformationLists) {
437   - if (subOrder.id === curretnOptSubId) {
438   - cloneSubOrders.push(cloneDeep(subOrder));
439   - break;
440   - }
441   - }
442   - }
443   - }
444   - }
445   -
446   - if (cloneSubOrders.length === 0) {
447   - message.error('页面错误:当前操作的订单数据不存在,请联系系统管理员');
448   - return;
449   - }
450   -
451   - return cloneSubOrders;
452   - }
453   -
454   - /**
455   - * 获取当前操作申请开票的订单总金额
456   - */
457   - function getApplyInvoicingTotalPayment() {
458   - let subOrders = isMainOrder
459   - ? [...subOrderSelectedMap.values()].flat()
460   - : buildSubOrders();
461   -
462   - let totalPayment = 0;
463   - if (subOrders && subOrders.length > 0) {
464   - let mainIds = subOrders?.map((item: any) => {
465   - return item.mainOrderId;
466   - });
467   -
468   - let uniqueMainIds = [...new Set(mainIds)];
469   -
470   - let dataMap = data.reduce((map, obj: any) => {
471   - map.set(obj.id, obj);
472   - return map;
473   - }, new Map());
474   -
475   - uniqueMainIds.forEach((id: any) => {
476   - let o = dataMap.get(id);
477   - if (o) {
478   - totalPayment = FloatAdd(totalPayment, o.totalPayment);
479   - }
480   - });
481   - }
482   - return totalPayment;
483   - }
484   -
485   - /**
486   - * 根据主订单id,将该主订单下的所有子订单取消选中
487   - */
488   - const removeSelectedSubOrderKeysByMainOrderId = (id: any) => {
489   - let currentMainOrderAllSubOrderIds =
490   - mainOrderIdSubOrderIdRelationsMap.get(id);
491   - if (currentMainOrderAllSubOrderIds) {
492   - let newSelectedSubOrderKeys = selectedSubOrderKeys.filter((item) => {
493   - return !currentMainOrderAllSubOrderIds.includes(item);
494   - });
495   - setSelectedSubOrderKeys(newSelectedSubOrderKeys);
496   - }
497   - };
498   -
499   - /**
500   - * 根据主订单id取消选中主订单
501   - * @param id
502   - */
503   - const removeSelecetMainOrderKeyByMainOrderId = (id: any) => {
504   - if (selectedMainOrderKeys.includes(id)) {
505   - let newSelectedMainOrderKeys = selectedMainOrderKeys.filter((item) => {
506   - return item !== id;
507   - });
508   - setSelectedMainOrderKeys(newSelectedMainOrderKeys);
509   - }
510   - };
511   -
512   - const onCheckboxChange = (record: never) => {
513   - let newSelectedMainOrderKeys = [];
514   - if (selectedMainOrderKeys.includes(record.id)) {
515   - newSelectedMainOrderKeys = selectedMainOrderKeys.filter(
516   - (key) => key !== record.id,
517   - );
518   - removeSelectedSubOrderKeysByMainOrderId(record.id);
519   - setSelectedRows([]);
520   -
521   - //删除选中主订单的信息
522   - mainOrderSelectedMap.delete(record.id);
523   - //删除选中主订单附属子订单的信息
524   - subOrderSelectedMap.delete(record.id);
525   - //总选中按钮取消选中
526   - setAllMainChecked(false);
527   - } else {
528   - newSelectedMainOrderKeys = [...selectedMainOrderKeys, record.id];
529   - //子订单全部自动选中
530   - let subIds = record.subOrderInformationLists?.map((item) => {
531   - return item.id;
532   - });
533   - let newSelectedSubOrderKeys = [...selectedSubOrderKeys];
534   - for (let subId of subIds) {
535   - if (!selectedSubOrderKeys.includes(subId)) {
536   - newSelectedSubOrderKeys.push(subId);
537   - }
538   - }
539   - setSelectedSubOrderKeys(newSelectedSubOrderKeys);
540   -
541   - setSelectedRows(record.subOrderInformationLists);
542   -
543   - //选中主订单
544   - mainOrderSelectedMap.set(record.id, record);
545   - //选中子订单
546   - subOrderSelectedMap.set(record.id, record.subOrderInformationLists);
547   - setSubOrderSelectedMap(new Map(subOrderSelectedMap));
548   -
549   - //如果所有主订单都勾选上了,那么勾选上总选中按钮
550   - if (
551   - mainOrderSelectedMap?.size === mainOrderIdSubOrderIdRelationsMap.size
552   - ) {
553   - setAllMainChecked(true);
554   - }
555   - }
556   - setSelectedMainOrderKeys(newSelectedMainOrderKeys);
557   - };
558   - // const handleTableExpand = (mainOrderIds: any) => {
559   - // setExpandedRowKeys(mainOrderIds);
560   - // };
561   -
562   - const allMainCheckBoxChange = () => {
563   - let checked = !allMainChecked;
564   - setAllMainChecked(checked);
565   -
566   - if (checked) {
567   - let mainOrderIds = data?.map((item) => {
568   - mainOrderSelectedMap.set(item.id, item);
569   - return item.id;
570   - });
571   -
572   - let subOrderIds = [];
573   - for (let subIdList of mainOrderIdSubOrderIdRelationsMap.values()) {
574   - subOrderIds.push(...subIdList);
575   - }
576   -
577   - if (data) {
578   - for (let item of data) {
579   - mainOrderSelectedMap.set(item.id, item);
580   -
581   - subOrderSelectedMap.set(item.id, item.subOrderInformationLists);
582   - }
583   - }
584   -
585   - setSelectedMainOrderKeys(mainOrderIds);
586   - setSelectedSubOrderKeys(subOrderIds);
587   - } else {
588   - setSelectedMainOrderKeys([]);
589   - setSelectedSubOrderKeys([]);
590   - mainOrderSelectedMap.clear();
591   - subOrderSelectedMap.clear();
592   - }
593   - };
594   -
595   - //表头渲染
596   - const OrderTableHeader = () => {
597   - return (
598   - <Flex className="w-full">
599   - <Flex className="w-[1%] ml-[7px]">
600   - <Checkbox
601   - onChange={allMainCheckBoxChange}
602   - checked={allMainChecked}
603   - ></Checkbox>
604   - </Flex>
605   - <Flex className="w-[30%] ml-[1%]">
606   - <span className="font-medium">商品信息</span>
607   - </Flex>
608   - <Flex className="w-[13%]">
609   - <span className="font-medium">交易金额</span>
610   - </Flex>
611   -
612   - {!isSupplier() ? (
613   - <>
614   - <Flex className="w-[10%]">
615   - <span className="font-medium">支付</span>
616   - </Flex>
617   - <Flex className="w-[12%]">
618   - <span className="font-medium">其他</span>
619   - </Flex>
620   - </>
621   - ) : (
622   - ''
623   - )}
624   -
625   - <Flex className="w-[10%]">
626   - <span className="font-medium">交易状态</span>
627   - </Flex>
628   - <Flex className="w-[17%]">
629   - <span className="font-medium">操作</span>
630   - </Flex>
631   - </Flex>
632   - );
633   - };
634   - //子订单内容渲染
635   - const SubOderRander = ({ record, optRecord }) => {
636   - /**
637   - * 获取订单状态标签
638   - * @param optRecord
639   - */
640   - function getOrderStatusTag(optRecord: any): import('react').ReactNode {
641   - console.log(optRecord);
642   -
643   - const orderStatus = optRecord.orderStatus;
644   - const paymentMethod = optRecord.paymentMethod;
645   - let orderStatusTagText = enumValueToLabel(
646   - optRecord.orderStatus,
647   - ORDER_STATUS_OPTIONS,
648   - );
649   -
650   - if (orderStatus === 'WAIT_CONFIRM_DELIVER_AFTER_INVOICE') {
651   - if (optRecord.afterInvoicingStatus !== 'COMPLETE_INVOICING') {
652   - orderStatusTagText = '待开票';
653   - } else {
654   - orderStatusTagText = '待确认发货';
655   - }
656   - }
657   -
658   - //如果是未审核或者领导已审核,付款状态为预付款则需要财务审核【财务待审核】,否则仓库审核【】
659   - if (orderStatus === 'UNAUDITED' || orderStatus === 'LEADER_AUDITED') {
660   - if (paymentMethod === 'PAYMENT_IN_ADVANCE') {
661   - orderStatusTagText = '财务待审核';
662   - } else {
663   - orderStatusTagText = '仓库待审核';
664   - }
665   - }
666   -
667   - //如果是财务已审核,显示为【仓库待审核】
668   - if (orderStatus === 'FINANCE_PROCESS') {
669   - orderStatusTagText = '仓库待审核';
670   - }
671   -
672   - if (orderStatus === 'AUDIT_FAILED') {
673   - return (
674   - <MyToolTip
675   - key="key"
676   - title={optRecord.checkNotes + ' ' + optRecord.postAuditNotes}
677   - content={
678   - <>
679   - <Tag
680   - color={TAGS_COLOR.get(optRecord.orderStatus)}
681   - style={{ marginRight: '4px' }}
682   - >
683   - {orderStatusTagText}
684   - </Tag>
685   - <QuestionCircleOutlined style={{ color: '#C1C1C1' }} />
686   - </>
687   - }
688   - />
689   - );
690   - }
691   -
692   - if (
693   - orderStatus === 'AFTER_SALES_COMPLETION' ||
694   - orderStatus === 'IN_AFTER_SALES'
695   - ) {
696   - return (
697   - <Tag
698   - color={TAGS_COLOR.get(optRecord.orderStatus)}
699   - style={{ marginRight: '4px' }}
700   - >
701   - {orderStatusTagText}
702   - </Tag>
703   - );
704   - }
705   -
706   - if (orderStatus === 'PROCURE_CONVERT_WAREHOUSE_KEEPER') {
707   - return (
708   - <MyToolTip
709   - key="key"
710   - title={optRecord.checkNotes}
711   - content={
712   - <>
713   - <Tag
714   - color={TAGS_COLOR.get(optRecord.orderStatus)}
715   - style={{ marginRight: '4px' }}
716   - >
717   - {orderStatusTagText}
718   - </Tag>
719   - <QuestionCircleOutlined style={{ color: '#C1C1C1' }} />
720   - </>
721   - }
722   - />
723   - );
724   - }
725   -
726   - return (
727   - <Tag key="key" color={TAGS_COLOR.get(optRecord.orderStatus)}>
728   - {orderStatusTagText}
729   - </Tag>
730   - );
731   - }
732   -
733   - /**
734   - * 获取后置审核状态标签
735   - * @param optRecord
736   - */
737   - function getPostAuditStatusTag(optRecord: any): import('react').ReactNode {
738   - return (
739   - <Tag key="key" color={TAGS_COLOR.get(optRecord.postAuditStatus)}>
740   - {enumValueToLabel(optRecord.postAuditStatus, POST_AUDIT_OPTIONS)}
741   - </Tag>
742   - );
743   - }
744   -
745   - //申请开票附件处理
746   - const getAfterAnnexList = () => {
747   - // let links = [];
748   - let afterAnnexList = optRecord.afterAnnexList;
749   - let i = 1;
750   - let images = [];
751   - let otherAnnex = [];
752   - if (afterAnnexList?.length > 0) {
753   - for (let url of afterAnnexList) {
754   - let name = getAliYunOSSFileNameFromUrl(url);
755   - if (isImageName(name)) {
756   - images.push({ name: name, url: url });
757   - } else {
758   - otherAnnex.push({ name: '附件' + i++, url: url });
759   - }
760   - }
761   - }
762   -
763   - return (
764   - <div className="pl-1">
765   - <Image.PreviewGroup
766   - className="mr-10"
767   - preview={{
768   - onChange: (current, prev) =>
769   - console.log(`current index: ${current}, prev index: ${prev}`),
770   - }}
771   - >
772   - {images.map((item, index) => (
773   - <React.Fragment key={index}>
774   - {index > 0 ? <Divider type="vertical" /> : ''}
775   - <Image
776   - className="max-h-[50px] max-w-[70px]"
777   - src={item.url}
778   - title={item.name}
779   - />{' '}
780   - </React.Fragment>
781   - ))}
782   - </Image.PreviewGroup>
783   - {otherAnnex.map((item, index) => {
784   - return (
785   - <Popconfirm
786   - title="下载或预览"
787   - key={index}
788   - onConfirm={() => {
789   - window.open(
790   - '/previewApi/onlinePreview?url=' +
791   - encodeURIComponent(Base64.encode(item.url)),
792   - );
793   - }}
794   - onCancel={() => {
795   - window.open(item.url);
796   - }}
797   - okText="预览"
798   - cancelText="下载"
799   - >
800   - <Button className="px-1" key={index} type="link">
801   - {item.name}
802   - </Button>
803   - </Popconfirm>
804   - );
805   - })}
806   - </div>
807   - );
808   - };
809   -
810   - //财务审核附件处理
811   - const getInvoicingCheckAnnexList = () => {
812   - let invoicingCheckAnnexList = optRecord.invoicingCheckAnnexList;
813   - return (
814   - <div>
815   - <Image.PreviewGroup
816   - className="mr-10"
817   - preview={{
818   - onChange: (current, prev) =>
819   - console.log(`current index: ${current}, prev index: ${prev}`),
820   - }}
821   - >
822   - {invoicingCheckAnnexList.map((url, index) => (
823   - <React.Fragment key={index}>
824   - <Image className="max-h-[50px] max-w-[70px]" src={url} />{' '}
825   - <Divider type="vertical" />
826   - </React.Fragment>
827   - ))}
828   - </Image.PreviewGroup>
829   - </div>
830   - );
831   - };
832   -
833   - return (
834   - <>
835   - <Flex className="w-full border-b-indigo-500">
836   - <Flex vertical className="w-[31%]" gap="small">
837   - {/* 商品名称 */}
838   - <div>
839   - <div
840   - className="overflow-hidden whitespace-no-wrap overflow-ellipsis hover:cursor-pointer"
841   - onClick={() => {
842   - copyToClipboard(optRecord.productName);
843   - message.info('商品名称复制成功:' + optRecord.productName);
844   - }}
845   - title={optRecord.productName}
846   - >
847   - <span className="font-medium text-black ">
848   - {optRecord.productName}
849   - </span>
850   - </div>
851   - <div className="text-xs text-[#8C8C8C]">
852   - <span
853   - className="cursor-pointer"
854   - onClick={() => {
855   - copyToClipboard(optRecord.id);
856   - message.info('子订单编号复制成功:' + optRecord.id);
857   - }}
858   - >
859   - {optRecord.id}
860   - </span>
861   - {(roleCode === 'salesRepresentative' ||
862   - roleCode === 'salesManager') &&
863   - !optRecord.isCurrentUserOrder ? (
864   - <span className="text-[#f44e4e]">(非本账号订单)</span>
865   - ) : (
866   - ''
867   - )}
868   - {optRecord.modifiedOptFlag !== null ? (
869   - <span className="text-[#f44e4e] cursor-pointer">
870   - {optRecord.modifiedOptFlag === 'MODIFY' ? '(修改中)' : ''}
871   - {optRecord.modifiedOptFlag === 'DELETE' ? '(删除中)' : ''}
872   - {optRecord.modifiedOptFlag === 'INSERT' ? '(新增中)' : ''}
873   - </span>
874   - ) : (
875   - ''
876   - )}
877   -
878   - {optRecord.modified ? (
879   - <Tooltip title="点击查看详情">
880   - <span
881   - className="text-[#f44e4e] cursor-pointer"
882   - onClick={async () => {
883   - createOptObject(optRecord.id, record.id);
884   - setModifiedDiffModalVisible(true);
885   - }}
886   - >
887   - (内容有变化)
888   - </span>
889   - </Tooltip>
890   - ) : (
891   - ''
892   - )}
893   - {!optRecord.logicDelete ? (
894   - <span className="text-[#f44e4e]">(已作废)</span>
895   - ) : (
896   - ''
897   - )}
898   - </div>
899   - </div>
900   -
901   - <div
902   - className="overflow-hidden whitespace-no-wrap overflow-ellipsis hover:cursor-pointer"
903   - title={optRecord.parameters}
904   - onClick={() => {
905   - copyToClipboard(optRecord.parameters);
906   - message.info('商品名称复制成功:' + optRecord.parameters);
907   - }}
908   - >
909   - <span className="text-[#8C8C8C]">
910   - 参数:{optRecord.parameters}
911   - </span>
912   - </div>
913   - </Flex>
914   - <Flex className="w-[13%]" vertical gap="small">
915   - {!isSupplier() ? (
916   - <>
917   - <div
918   - className="overflow-hidden whitespace-no-wrap overflow-ellipsis"
919   - title={optRecord.productPrice}
920   - >
921   - <span className="text-[#8C8C8C]">单价:</span>
922   - <span className="text-slate-700">
923   - ¥{optRecord.productPrice}
924   - </span>
925   - </div>
926   - </>
927   - ) : (
928   - ''
929   - )}
930   -
931   - <div
932   - className="overflow-hidden whitespace-no-wrap overflow-ellipsis"
933   - title={optRecord.quantity}
934   - >
935   - <span className="text-[#8C8C8C]">数量:</span>
936   - <span className="text-slate-700">
937   - x{optRecord.quantity + ' '}
938   - </span>
939   - <span className="text-[#8C8C8C]">{optRecord.unit}</span>
940   - </div>
941   -
942   - {!isSupplier() ? (
943   - <div
944   - className="overflow-hidden whitespace-no-wrap overflow-ellipsis"
945   - title={optRecord.subOrderPayment}
946   - >
947   - <span className="text-[#8C8C8C]">合计:</span>
948   - <span className="text-slate-700">
949   - ¥{optRecord.subOrderPayment}
950   - </span>
951   - </div>
952   - ) : (
953   - ''
954   - )}
955   - </Flex>
956   -
957   - <Flex className="w-[10%]" vertical gap="small">
958   - {!isSupplier() ? (
959   - <>
960   - {/* 支付方式 */}
961   - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
962   - <span className="text-slate-700">
963   - {optRecord.paymentMethodText}
964   - </span>
965   - </div>
966   - {/* 支付渠道 */}
967   - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
968   - <span className="text-slate-700">
969   - {enumValueToLabel(
970   - optRecord.paymentChannel,
971   - PAYMENT_CHANNEL_OPTIONS,
972   - )}
973   - </span>
974   - </div>
975   - {/* 回款审核状态 */}
976   - {optRecord.paymentReceiptStatus !== null ? (
977   - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
978   - <Tag
979   - className="hover:cursor-pointer"
980   - onMouseEnter={(e: any) => {
981   - e.target.innerText = '点击查看回款凭证';
982   - }}
983   - onMouseLeave={(e: any) => {
984   - e.target.innerText = enumValueToLabel(
985   - optRecord.paymentReceiptStatus,
986   - PAYMENT_RECEIPTS_STATUS_OPTIONS,
987   - );
988   - }}
989   - onClick={() => {
990   - createOptObject(optRecord.id, record.id);
991   - setImagesViewerOptType('paymentReceipt');
992   - setImagesViewerModalVisible(true);
993   - }}
994   - key="key"
995   - color={TAGS_COLOR.get(optRecord.paymentReceiptStatus)}
996   - >
997   - {enumValueToLabel(
998   - optRecord.paymentReceiptStatus,
999   - PAYMENT_RECEIPTS_STATUS_OPTIONS,
1000   - )}
1001   - </Tag>
1002   - </div>
1003   - ) : (
1004   - ''
1005   - )}
1006   - </>
1007   - ) : (
1008   - ''
1009   - )}
1010   - </Flex>
1011   - <Flex className="w-[13%]" vertical gap="small">
1012   - {!isSupplier() ? (
1013   - <>
1014   - {/* 所属部门 */}
1015   - <div
1016   - className="overflow-hidden whitespace-no-wrap overflow-ellipsis"
1017   - title={enumValueToLabel(
1018   - optRecord.productBelongBusiness,
1019   - PRODUCT_BELONG_DEPARTMENT_OPTIONS,
1020   - )}
1021   - >
1022   - <span className="text-slate-700">
1023   - {enumValueToLabel(
1024   - optRecord.productBelongBusiness,
1025   - PRODUCT_BELONG_DEPARTMENT_OPTIONS,
1026   - )}
1027   - </span>
1028   - </div>
1029   -
1030   - {/* 开票类型 */}
1031   - {optRecord.invoicingStatus !== null ? (
1032   - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1033   - <span className="text-slate-700">
1034   - {getInvoicingType(optRecord)}
1035   - </span>
1036   - </div>
1037   - ) : (
1038   - ''
1039   - )}
1040   -
1041   - {/* 开票状态 */}
1042   - {optRecord.afterInvoicingStatus !== null ? (
1043   - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1044   - <Tooltip
1045   - title={
1046   - optRecord.invoicingUrgentCause !== null &&
1047   - optRecord.afterInvoicingStatus ===
1048   - 'URGENT_INVOICE_AUDITING'
1049   - ? optRecord.invoicingUrgentCause
1050   - : enumValueToLabel(
1051   - optRecord.afterInvoicingStatus,
1052   - AFTER_INVOICING_STATUS,
1053   - )
1054   - }
1055   - >
1056   - <Tag
1057   - color={TAGS_COLOR.get(optRecord.afterInvoicingStatus)}
1058   - >
1059   - {enumValueToLabel(
1060   - optRecord.afterInvoicingStatus,
1061   - AFTER_INVOICING_STATUS,
1062   - )}
1063   - </Tag>
1064   - </Tooltip>
1065   - </div>
1066   - ) : (
1067   - ''
1068   - )}
1069   -
1070   - {/* 是否加急图标显示 */}
1071   - {optRecord.isUrgent ? (
1072   - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1073   - <Tooltip
1074   - title={'期望开票时间:' + formatdate(optRecord.deadline)}
1075   - >
1076   - <Tag color="red">加急开票</Tag>
1077   - </Tooltip>
1078   - </div>
1079   - ) : (
1080   - ''
1081   - )}
1082   -
1083   - {(roleCode === 'warehouseKeeper' || roleCode === 'admin') &&
1084   - optRecord.shippingWarehouse !== null ? (
1085   - <div
1086   - className="overflow-hidden whitespace-no-wrap overflow-ellipsis"
1087   - title={enumValueToLabel(
1088   - optRecord.shippingWarehouse,
1089   - SHIPPING_WAREHOUSE_OPTIONS,
1090   - )}
1091   - >
1092   - <span className="text-slate-700">
1093   - {enumValueToLabel(
1094   - optRecord.shippingWarehouse,
1095   - SHIPPING_WAREHOUSE_OPTIONS,
1096   - )}
1097   - </span>
1098   - </div>
1099   - ) : (
1100   - ''
1101   - )}
1102   -
1103   - {/* 生产时间 */}
1104   - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1105   - {optRecord.productionStartTime !== null ||
1106   - optRecord.productionEndTime !== null ? (
1107   - <MyToolTip
1108   - title={
1109   - formatdate(optRecord.productionStartTime) +
1110   - ' 至 ' +
1111   - formatdate(optRecord.productionEndTime)
1112   - }
1113   - content={
1114   - <Button type="link" size="small" style={{ padding: 0 }}>
1115   - 生产时间
1116   - </Button>
1117   - }
1118   - />
1119   - ) : (
1120   - ''
1121   - )}
1122   - </div>
1123   - </>
1124   - ) : (
1125   - ''
1126   - )}
1127   - </Flex>
1128   -
1129   - <Flex className="w-[10%]" vertical gap="small">
1130   - {/* 开票状态 */}
1131   - {!isSupplier() ? (
1132   - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1133   - <Tag
1134   - color={
1135   - optRecord.invoicingTime === null ||
1136   - optRecord.invoicingTime === undefined
1137   - ? TAGS_COLOR.get(optRecord.invoicingStatus)
1138   - : 'success'
1139   - }
1140   - >
1141   - {getNeedInvoicing(optRecord)}
1142   - </Tag>
1143   - </div>
1144   - ) : (
1145   - ''
1146   - )}
1147   -
1148   - {/* 订单状态 */}
1149   - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1150   - {getOrderStatusTag(optRecord)}
1151   - </div>
1152   -
1153   - {/* 后置审核状态 */}
1154   - {optRecord.postAuditStatus !== null ? (
1155   - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1156   - {getPostAuditStatusTag(optRecord)}
1157   - </div>
1158   - ) : (
1159   - ''
1160   - )}
1161   -
1162   - {/**采购是否已下单状态 */}
1163   - {optRecord.procureOrderStatus !== null &&
1164   - optRecord.procureOrderStatus !== undefined ? (
1165   - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1166   - <Tag color="success">
1167   - {enumValueToLabel(
1168   - optRecord.procureOrderStatus,
1169   - PROCURE_ORDER_STATUS,
1170   - )}
1171   - </Tag>
1172   - </div>
1173   - ) : (
1174   - ''
1175   - )}
1176   -
1177   - {/* 物流信息 */}
1178   - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1179   - {optRecord.orderStatus === 'CONFIRM_RECEIPT' ||
1180   - optRecord.orderStatus === 'AFTER_SALES_COMPLETION' ||
1181   - optRecord.orderStatus === 'IN_AFTER_SALES' ||
1182   - optRecord.orderStatus === 'SHIPPED' ? (
1183   - <MyToolTip
1184   - title={
1185   - optRecord.serialNumber === undefined
1186   - ? '暂无物流信息'
1187   - : enumValueToLabel(
1188   - optRecord.logisticsMethod,
1189   - LOGISTICS_STATUS_OPTIONS,
1190   - ) +
1191   - ' ' +
1192   - optRecord.serialNumber +
1193   - ' ' +
1194   - optRecord.logisticsNotes
1195   - }
1196   - content={
1197   - <Button type="link" size="small" style={{ padding: 0 }}>
1198   - 物流信息
1199   - </Button>
1200   - }
1201   - />
1202   - ) : (
1203   - ''
1204   - )}
1205   -
1206   - {/* 修改审核状态 */}
1207   - {optRecord.modifiedAuditStatus !== null &&
1208   - optRecord.modifiedAuditStatus !== 'AUDIT_FAILURE' ? (
1209   - <div className="overflow-hidden whitespace-no-wrap overflow-ellipsis">
1210   - <Tooltip
1211   - title={recordOptNode ? recordOptNode : <Spin />}
1212   - onOpenChange={(open) => {
1213   - console.log('open:' + open);
1214   - console.log('id:' + optRecord.id);
1215   - if (open) {
1216   - triggerRecordOptNode(optRecord.id);
1217   - } else {
1218   - setRecordOptNode(null);
1219   - }
1220   - }}
1221   - >
1222   - <Tag color={TAGS_COLOR.get(optRecord.modifiedAuditStatus)}>
1223   - {enumValueToLabel(
1224   - optRecord.modifiedAuditStatus,
1225   - MODIFIED_AUDIT_STATUS_OPTIONS,
1226   - )}
1227   - </Tag>
1228   - </Tooltip>
1229   - </div>
1230   - ) : (
1231   - ''
1232   - )}
1233   -
1234   - {optRecord.modifiedAuditStatus === 'AUDIT_FAILURE' ? (
1235   - <MyToolTip
1236   - key="key"
1237   - title={optRecord.modifiedAuditNotes}
1238   - content={
1239   - <>
1240   - <Tag
1241   - color={TAGS_COLOR.get(optRecord.modifiedAuditNotes)}
1242   - style={{ marginRight: '4px' }}
1243   - >
1244   - {enumValueToLabel(
1245   - optRecord.modifiedAuditStatus,
1246   - MODIFIED_AUDIT_STATUS_OPTIONS,
1247   - )}
1248   - </Tag>
1249   - <QuestionCircleOutlined style={{ color: '#C1C1C1' }} />
1250   - </>
1251   - }
1252   - />
1253   - ) : (
1254   - ''
1255   - )}
1256   - </div>
1257   - </Flex>
1258   - <Flex className="w-[18%]" wrap="wrap" gap="small">
1259   - {optRecord.paths?.includes('postAudit') ? (
1260   - <Button
1261   - className="p-0"
1262   - type="link"
1263   - onClick={() => {
1264   - createOptObject(optRecord.id, record.id);
1265   - setCheckVisible(true);
1266   - setOrderCheckType(CHECK_TYPE.WAITING_FOR_POST_AUDIT);
1267   - }}
1268   - >
1269   - 后置审核
1270   - </Button>
1271   - ) : (
1272   - ''
1273   - )}
1274   - {/* 加急审核 */}
1275   - {optRecord.paths?.includes('URGENT_INVOICE_AUDITING') ? (
1276   - <Button
1277   - className="p-0"
1278   - type="link"
1279   - onClick={() => {
1280   - console.log('here');
1281   - setCurrentMainId(record.id);
1282   - setCurretnOptSubId(optRecord.id);
1283   - setCheckVisible(true);
1284   - setOrderCheckType(CHECK_TYPE.URGENT_INVOICE_AUDITING);
1285   - }}
1286   - >
1287   - 加急审核(新)
1288   - </Button>
1289   - ) : (
1290   - ''
1291   - )}
1292   - {optRecord.paths?.includes('URGENT_INVOICE_AUDITING_old') ? (
1293   - <Button
1294   - className="p-0"
1295   - type="link"
1296   - onClick={() => {
1297   - console.log('here');
1298   - setCurrentMainId(record.id);
1299   - setCurretnOptSubId(optRecord.id);
1300   - setCheckVisible(true);
1301   - setOrderCheckType(CHECK_TYPE.URGENT_INVOICE_AUDITING_OLD);
1302   - }}
1303   - >
1304   - 加急审核(旧)
1305   - </Button>
1306   - ) : (
1307   - ''
1308   - )}
1309   - {optRecord.paths?.includes('salesConfirm') && (
1310   - <ButtonConfirm
1311   - className="p-0"
1312   - title="是否确认此商城订单信息无误?确认无误之后订单将进入审核流程。"
1313   - text="订单确认"
1314   - onConfirm={async () => {
1315   - let res = await postServiceOrderSalesConfirm({
1316   - data: {
1317   - subOrderIds: [optRecord.id],
1318   - },
1319   - });
1320   -
1321   - if (res && res.result === RESPONSE_CODE.SUCCESS) {
1322   - message.success(res.message);
1323   - refreshTable();
1324   - }
1325   - }}
1326   - />
1327   - )}
1328   - {optRecord.paths?.includes('uploadPaymentReceiptBill') ? (
1329   - <Button
1330   - className="p-0"
1331   - type="link"
1332   - onClick={() => {
1333   - createOptObject(optRecord.id, record.id);
1334   - setUploadPayBillModalVisible(true);
1335   - }}
1336   - >
1337   - 回款
1338   - </Button>
1339   - ) : (
1340   - ''
1341   - )}
1342   - {optRecord.paths?.includes('reissue_old') ? (
1343   - /*optRecord.afterInvoicingStatus==='PARTIAL_INVOICING'||
1344   - optRecord.afterInvoicingStatus==='COMPLETE_INVOICING'*/
1345   - <Button
1346   - className="p-0"
1347   - type="link"
1348   - onClick={() => {
1349   - setCurrentMainId(record.id);
1350   - setReissueVisibleOld(true);
1351   - }}
1352   - >
1353   - 重新开票(旧)
1354   - </Button>
1355   - ) : (
1356   - ''
1357   - )}
1358   - {optRecord.paths?.includes('reissue') ? (
1359   - /*optRecord.afterInvoicingStatus==='PARTIAL_INVOICING'||
1360   - optRecord.afterInvoicingStatus==='COMPLETE_INVOICING'*/
1361   - <Button
1362   - className="p-0"
1363   - type="link"
1364   - onClick={() => {
1365   - setCurrentMainId(record.id);
1366   - setCurretnOptSubId(optRecord.id);
1367   - setReissueVisible(true);
1368   - }}
1369   - >
1370   - 重新开票(新)
1371   - </Button>
1372   - ) : (
1373   - ''
1374   - )}
1375   -
1376   - {optRecord.paths?.includes('confirmReissue_old') ? (
1377   - <Button
1378   - className="p-0"
1379   - type="link"
1380   - onClick={() => {
1381   - setCurrentMainId(record.id);
1382   - setCurretnOptSubId(optRecord.id);
1383   - setCheckVisible(true);
1384   - setOrderCheckType(CHECK_TYPE.CONFIRM_REISSUE_OLD);
1385   - }}
1386   - >
1387   - 重新开票审核(旧)
1388   - </Button>
1389   - ) : (
1390   - ''
1391   - )}
1392   - {optRecord.paths?.includes('confirmReissue') ? (
1393   - <Button
1394   - className="p-0"
1395   - type="link"
1396   - onClick={() => {
1397   - setCurrentMainId(record.id);
1398   - setCurretnOptSubId(optRecord.id);
1399   - setCheckVisible(true);
1400   - setOrderCheckType(CHECK_TYPE.CONFIRM_REISSUE);
1401   - }}
1402   - >
1403   - 重新开票审核(新)
1404   - </Button>
1405   - ) : (
1406   - ''
1407   - )}
1408   -
1409   - {optRecord.paths?.includes('leaderAudit') ? (
1410   - <Button
1411   - className="p-0"
1412   - type="link"
1413   - onClick={() => {
1414   - setCurrentMainId(record.id);
1415   - setCurretnOptSubId(optRecord.id);
1416   - setCheckVisible(true);
1417   - setOrderCheckType(CHECK_TYPE.LEADER_AUDIT);
1418   - }}
1419   - >
1420   - 审核
1421   - </Button>
1422   - ) : (
1423   - ''
1424   - )}
1425   -
1426   - {optRecord.paths?.includes('creditAudit') ? (
1427   - <Button
1428   - className="p-0"
1429   - type="link"
1430   - onClick={() => {
1431   - setCurrentMainId(record.id);
1432   - setCurretnOptSubId(optRecord.id);
1433   - setCheckVisible(true);
1434   - setOrderCheckType(CHECK_TYPE.CREDIT_AUDIT);
1435   - }}
1436   - >
1437   - 赊账审核
1438   - </Button>
1439   - ) : (
1440   - ''
1441   - )}
1442   -
1443   - {optRecord.paths?.includes('auditPaymentReceipt') ? (
1444   - <Button
1445   - className="p-0"
1446   - type="link"
1447   - onClick={() => {
1448   - createOptObject(optRecord.id, record.id);
1449   - setCheckVisible(true);
1450   - setOrderCheckType(CHECK_TYPE.PAYMENT_RECEIPTS_AUDIT);
1451   - }}
1452   - >
1453   - 回款审核
1454   - </Button>
1455   - ) : (
1456   - ''
1457   - )}
1458   -
1459   - {optRecord.paths?.includes('modifiedAuditRequest') ? (
1460   - <Button
1461   - className="p-0"
1462   - type="link"
1463   - onClick={() => {
1464   - createOptObject(optRecord.id, record.id);
1465   - setCheckVisible(true);
1466   - setOrderCheckType(CHECK_TYPE.NODE_OPERATING_AUDIT);
1467   - }}
1468   - >
1469   - 节点修改审核
1470   - </Button>
1471   - ) : (
1472   - ''
1473   - )}
1474   -
1475   - {optRecord.paths?.includes('applyModify') ? (
1476   - <Button
1477   - className="p-0"
1478   - type="link"
1479   - onClick={() => {
1480   - createOptObject(optRecord.id, record.id);
1481   - setOrderDrawerVisible(true);
1482   - setOrderOptType('order-change-normal');
1483   - }}
1484   - >
1485   - 申请修改
1486   - </Button>
1487   - ) : (
1488   - ''
1489   - )}
1490   -
1491   - {optRecord.paths?.includes('modifiedLeaderAuditRequest') ? (
1492   - <Button
1493   - className="p-0"
1494   - type="link"
1495   - onClick={() => {
1496   - createOptObject(optRecord.id, record.id);
1497   - setCheckVisible(true);
1498   - setOrderCheckType(CHECK_TYPE.MODIFY_LEADER_AUDIT);
1499   - }}
1500   - >
1501   - 领导修改审核
1502   - </Button>
1503   - ) : (
1504   - ''
1505   - )}
1506   -
1507   - {optRecord.paths?.includes('shippingWarehouseChangeRequest') ? (
1508   - <Button
1509   - className="p-0"
1510   - type="link"
1511   - onClick={() => {
1512   - setIds([optRecord.id]);
1513   - createOptObject(optRecord.id, record.id);
1514   - setShippingWarehouseChangeModalVisible(true);
1515   - }}
1516   - >
1517   - 修改仓库
1518   - </Button>
1519   - ) : (
1520   - ''
1521   - )}
1522   -
1523   - {optRecord.paths?.includes('saleCancelInvoicing_old') ? (
1524   - <ButtonConfirm
1525   - className="p-0"
1526   - title="确认取消申请开票?"
1527   - text="取消申请(旧)"
1528   - onConfirm={async () => {
1529   - let res = await postServiceOrderSaleCancelInvoicing({
1530   - data: {
1531   - subOrderIds: [optRecord.id],
1532   - },
1533   - });
1534   -
1535   - if (res && res.result === RESPONSE_CODE.SUCCESS) {
1536   - message.success(res.message);
1537   - refreshTable();
1538   - }
1539   - }}
1540   - />
1541   - ) : (
1542   - ''
1543   - )}
1544   - {optRecord.paths?.includes('saleCancelInvoicing') ? (
1545   - <ButtonConfirm
1546   - className="p-0"
1547   - title="确认取消申请开票?"
1548   - text="取消申请(新)"
1549   - onConfirm={async () => {
1550   - let res = await postServiceInvoiceCancelApply({
1551   - data: {
1552   - subOrderIds: [optRecord.id],
1553   - },
1554   - });
1555   -
1556   - if (res && res.result === RESPONSE_CODE.SUCCESS) {
1557   - message.success(res.message);
1558   - refreshTable();
1559   - }
1560   - }}
1561   - />
1562   - ) : (
1563   - ''
1564   - )}
1565   - {optRecord.paths?.includes('noNeedInvoicingEdit') ? (
1566   - <Button
1567   - className="p-0"
1568   - type="link"
1569   - onClick={() => {
1570   - createOptObject(optRecord.id, record.id);
1571   - setFinancialEditVisible(true);
1572   - setIsMainOrder(false);
1573   - }}
1574   - >
1575   - 编辑时间
1576   - </Button>
1577   - ) : (
1578   - ''
1579   - )}
1580   - {optRecord.paths?.includes('sendProduct') ? (
1581   - <Button
1582   - className="p-0"
1583   - type="link"
1584   - onClick={() => {
1585   - createOptObject(optRecord.id, record.id);
1586   - setDeliverVisible(true);
1587   - setIsSendProduct(true);
1588   - setOrderCheckType(CHECK_TYPE.WEARHOUSE_KEEPER);
1589   - }}
1590   - >
1591   - 仓库发货
1592   - </Button>
1593   - ) : (
1594   - ''
1595   - )}
1596   -
1597   - {optRecord.paths?.includes('supplierSendOrder') ? (
1598   - <Button
1599   - className="p-0"
1600   - type="link"
1601   - onClick={() => {
1602   - optRecord.mainOrderId = record.id;
1603   - setSelectedRows([cloneDeep(optRecord)]); //克隆一份数据,避免后续修改污染
1604   - setDeliverVisible(true);
1605   - setIsSendProduct(true);
1606   - setOrderCheckType(CHECK_TYPE.SUPPLIER);
1607   - }}
1608   - >
1609   - 供应商发货
1610   - </Button>
1611   - ) : (
1612   - ''
1613   - )}
1614   -
1615   - {optRecord.paths?.includes('procureSend') ? (
1616   - <Button
1617   - className="p-0"
1618   - type="link"
1619   - onClick={() => {
1620   - createOptObject(optRecord.id, record.id);
1621   - setDeliverVisible(true);
1622   - setIsSendProduct(true);
1623   - setOrderCheckType(CHECK_TYPE.PROCURE);
1624   - }}
1625   - >
1626   - {isSupplier() ? '发货' : '采购发货'}
1627   - </Button>
1628   - ) : (
1629   - ''
1630   - )}
1631   -
1632   - {optRecord.paths?.includes('editProductionTime') ? (
1633   - <Button
1634   - className="p-0"
1635   - type="link"
1636   - onClick={() => {
1637   - createOptObject(optRecord.id, record.id);
1638   - setProductionTimeModalVisible(true);
1639   - }}
1640   - >
1641   - 生产时间
1642   - </Button>
1643   - ) : (
1644   - ''
1645   - )}
1646   -
1647   - {optRecord.paths?.includes('queryAnnex') &&
1648   - optRecord.listAnnex?.length > 0 ? (
1649   - <Button
1650   - className="p-0"
1651   - type="link"
1652   - onClick={() => {
1653   - optRecord.mainOrderId = record.id;
1654   - createOptObject(optRecord.id, record.id);
1655   - setAttachmentModalVisible(true);
1656   - }}
1657   - >
1658   - 附件
1659   - </Button>
1660   - ) : (
1661   - ''
1662   - )}
1663   -
1664   - {optRecord.paths?.includes('modifySendInformation') ? (
1665   - <Button
1666   - className="p-0"
1667   - type="link"
1668   - onClick={() => {
1669   - createOptObject(optRecord.id, record.id);
1670   - setDeliverVisible(true);
1671   - setIsSendProduct(false);
1672   - }}
1673   - >
1674   - 修改发货信息
1675   - </Button>
1676   - ) : (
1677   - ''
1678   - )}
1679   -
1680   - {optRecord.paths?.includes('printOrder') ? (
1681   - <Button
1682   - className="p-0"
1683   - type="link"
1684   - onClick={async () => {
1685   - createOptObject(optRecord.id, record.id);
1686   - setOrderPrintVisible(true);
1687   - setOrderCheckType(CHECK_TYPE.WEARHOUSE_KEEPER);
1688   - }}
1689   - >
1690   - 仓库打印
1691   - </Button>
1692   - ) : (
1693   - ''
1694   - )}
1695   -
1696   - {optRecord.paths?.includes('supplierPrint') ? (
1697   - <Button
1698   - className="p-0"
1699   - type="link"
1700   - onClick={async () => {
1701   - createOptObject(optRecord.id, record.id);
1702   - setOrderPrintVisible(true);
1703   - setOrderCheckType(CHECK_TYPE.SUPPLIER);
1704   - }}
1705   - >
1706   - 供应商打印
1707   - </Button>
1708   - ) : (
1709   - ''
1710   - )}
1711   -
1712   - {optRecord.paths?.includes('procurePrint') ? (
1713   - <ButtonConfirm
1714   - className="p-0"
1715   - title="确认打印?"
1716   - text="采购打印"
1717   - onConfirm={async () => {
1718   - let res = await postServiceOrderProcurePrint({
1719   - data: {
1720   - ids: [optRecord.id],
1721   - },
1722   - });
1723   -
1724   - if (res.result === RESPONSE_CODE.SUCCESS) {
1725   - message.success(res.message);
1726   - refreshTable();
1727   - }
1728   - }}
1729   - />
1730   - ) : (
1731   - // <Button
1732   - // className="p-0"
1733   - // type="link"
1734   - // onClick={async () => {
1735   - // setOrderPrintVisible(true);
1736   - // setSelectedRows([optRecord]);
1737   - // setOrderRow(record);
1738   - // setOrderCheckType(CHECK_TYPE.PROCURE);
1739   - // }}
1740   - // >
1741   - // 采购打印
1742   - // </Button>
1743   - ''
1744   - )}
1745   -
1746   - {optRecord.paths?.includes('editOrder') && false ? (
1747   - <Button
1748   - className="p-0"
1749   - type="link"
1750   - onClick={() => {
1751   - createOptObject(optRecord.id, record.id);
1752   - setFinancialVisible(true);
1753   - setIsEdit(true);
1754   - }}
1755   - >
1756   - 编辑
1757   - </Button>
1758   - ) : (
1759   - ''
1760   - )}
1761   -
1762   - {optRecord.paths?.includes('invoicing') ? (
1763   - <Button
1764   - className="p-0"
1765   - type="link"
1766   - onClick={() => {
1767   - createOptObject(optRecord.id, record.id);
1768   - setFinancialVisible(true);
1769   - setIsEdit(false);
1770   - setIsMainOrder(false);
1771   - }}
1772   - >
1773   - 开票
1774   - </Button>
1775   - ) : (
1776   - ''
1777   - )}
1778   -
1779   - {optRecord.paths?.includes('applyInvoicing') ? (
1780   - <Button
1781   - className="p-0"
1782   - type="link"
1783   - onClick={() => {
1784   - setInvoicingDrawerFormVisible(true);
1785   - createOptObject(optRecord.id, record.id);
1786   - setIsEdit(false);
1787   - setIsMainOrder(false);
1788   - }}
1789   - >
1790   - 申请开票(新)
1791   - </Button>
1792   - ) : (
1793   - ''
1794   - )}
1795   -
1796   - {optRecord.paths?.includes('applyInvoicing_old') ? (
1797   - <Button
1798   - className="p-0"
1799   - type="link"
1800   - onClick={() => {
1801   - setApplyForInvoicingVisible(true);
1802   - createOptObject(optRecord.id, record.id);
1803   - setIsEdit(false);
1804   - setIsMainOrder(false);
1805   - }}
1806   - >
1807   - 申请开票(旧)
1808   - </Button>
1809   - ) : (
1810   - ''
1811   - )}
1812   -
1813   - {optRecord.paths?.includes('checkOrder') ? (
1814   - <Button
1815   - className="p-0"
1816   - type="link"
1817   - onClick={() => {
1818   - setCurrentMainId(record.id);
1819   - setCurretnOptSubId(optRecord.id);
1820   - setCheckVisible(true);
1821   - setOrderCheckType(CHECK_TYPE.WEARHOUSE_KEEPER);
1822   - }}
1823   - >
1824   - 审核
1825   - </Button>
1826   - ) : (
1827   - ''
1828   - )}
1829   -
1830   - {optRecord.paths?.includes('afterSalesCheck') ? (
1831   - <Button
1832   - className="p-0"
1833   - type="link"
1834   - onClick={() => {
1835   - createOptObject(optRecord.id, record.id);
1836   - setCheckVisible(true);
1837   - setOrderCheckType(CHECK_TYPE.AFTER_SALES);
1838   - }}
1839   - >
1840   - 售后审核
1841   - </Button>
1842   - ) : (
1843   - ''
1844   - )}
1845   -
1846   - {optRecord.paths?.includes('financeCheckOrder') ? (
1847   - <Button
1848   - className="p-0"
1849   - type="link"
1850   - onClick={() => {
1851   - createOptObject(optRecord.id, record.id);
1852   - setCheckVisible(true);
1853   - setOrderCheckType(CHECK_TYPE.FINALCIAL);
1854   - }}
1855   - >
1856   - 财务审核
1857   - </Button>
1858   - ) : (
1859   - ''
1860   - )}
1861   -
1862   - {optRecord.paths?.includes('procureCheckOrder') ? (
1863   - <Button
1864   - className="p-0"
1865   - type="link"
1866   - onClick={() => {
1867   - createOptObject(optRecord.id, record.id);
1868   - setOrderCheckType(CHECK_TYPE.PROCURE);
1869   - setProcureCheckModalVisible(true);
1870   - }}
1871   - >
1872   - 采购审核
1873   - </Button>
1874   - ) : (
1875   - ''
1876   - )}
1877   -
1878   - {optRecord.paths?.includes('procureConvertProcure') ? (
1879   - <Button
1880   - className="p-0"
1881   - type="link"
1882   - onClick={() => {
1883   - createOptObject(optRecord.id, record.id);
1884   - setOrderCheckType(CHECK_TYPE.PROCURE);
1885   - setProcureConvertModalVisible(true);
1886   - }}
1887   - >
1888   - 转发
1889   - </Button>
1890   - ) : (
1891   - ''
1892   - )}
1893   -
1894   - {optRecord.paths?.includes('rePrintOrder') ? (
1895   - <Button
1896   - className="p-0"
1897   - type="link"
1898   - onClick={() => {
1899   - createOptObject(optRecord.id, record.id);
1900   - setOrderPrintVisible(true);
1901   - setIsRePrintOrder(true);
1902   - }}
1903   - >
1904   - 重新打印
1905   - </Button>
1906   - ) : (
1907   - ''
1908   - )}
1909   -
1910   - {optRecord.paths?.includes('confirmReceipt') ? (
1911   - <Button
1912   - className="p-0"
1913   - type="link"
1914   - onClick={() => {
1915   - createOptObject(optRecord.id, record.id);
1916   - setConfirmReceiptVisible(true);
1917   - }}
1918   - >
1919   - 确认收货
1920   - </Button>
1921   - ) : (
1922   - ''
1923   - )}
1924   -
1925   - {optRecord.paths?.includes('applyAfterSales') ? (
1926   - <Button
1927   - className="p-0"
1928   - type="link"
1929   - onClick={() => {
1930   - createOptObject(optRecord.id, record.id);
1931   - setOrderDrawerVisible(true);
1932   - setOrderOptType('after_sales');
1933   - }}
1934   - >
1935   - 申请售后
1936   - </Button>
1937   - ) : (
1938   - ''
1939   - )}
1940   -
1941   - {optRecord.paths?.includes('procureOrder') ? (
1942   - <ButtonConfirm
1943   - className="p-0"
1944   - title="是否已下单?"
1945   - text="下单"
1946   - onConfirm={async () => {
1947   - let res = await postServiceOrderProcureOrder({
1948   - data: { subIds: [optRecord.id] },
1949   - });
1950   - if (res.result === RESPONSE_CODE.SUCCESS) {
1951   - message.success(res.message);
1952   - refreshTable();
1953   - return true;
1954   - }
1955   - }}
1956   - />
1957   - ) : (
1958   - ''
1959   - )}
1960   -
1961   - {optRecord.paths?.includes('cancelSend') ? (
1962   - <ButtonConfirm
1963   - className="p-0"
1964   - title="是否取消发货"
1965   - text="取消发货"
1966   - onConfirm={async () => {
1967   - let res = await postServiceOrderCancelSend({
1968   - data: { subIds: [optRecord.id] },
1969   - });
1970   - if (res.result === RESPONSE_CODE.SUCCESS) {
1971   - message.success(res.message);
1972   - refreshTable();
1973   - return true;
1974   - }
1975   - }}
1976   - />
1977   - ) : (
1978   - ''
1979   - )}
1980   -
1981   - {optRecord.paths?.includes('noNeedSend') ? (
1982   - <ButtonConfirm
1983   - className="p-0"
1984   - title="此订单是否无需发货?"
1985   - text="无需发货"
1986   - onConfirm={async () => {
1987   - let res = await postServiceOrderNoNeedSend({
1988   - data: { ids: [optRecord.id] },
1989   - });
1990   - if (res.result === RESPONSE_CODE.SUCCESS) {
1991   - message.success(res.message);
1992   - refreshTable();
1993   - return true;
1994   - }
1995   - }}
1996   - />
1997   - ) : (
1998   - ''
1999   - )}
2000   -
2001   - {optRecord.paths?.includes('viewImages') ? (
2002   - <Button
2003   - className="p-0"
2004   - type="link"
2005   - onClick={() => {
2006   - createOptObject(optRecord.id, record.id);
2007   - setImagesViewerOptType('shippingReceipt');
2008   - setImagesViewerModalVisible(true);
2009   - }}
2010   - >
2011   - 查看收货凭证
2012   - </Button>
2013   - ) : (
2014   - ''
2015   - )}
2016   -
2017   - {optRecord.paths?.includes('confirmDeliver') ? (
2018   - <Button
2019   - className="p-0"
2020   - type="link"
2021   - onClick={() => {
2022   - createOptObject(optRecord.id, record.id);
2023   - setOrderCheckType(CHECK_TYPE.CONFIRM_DELIVER);
2024   - setCheckVisible(true);
2025   - }}
2026   - >
2027   - 确认发货
2028   - </Button>
2029   - ) : (
2030   - ''
2031   - )}
2032   -
2033   - {optRecord.paths?.includes('orderCancel') ? (
2034   - <ButtonConfirm
2035   - className="p-0"
2036   - title="确认作废?"
2037   - text="作废"
2038   - onConfirm={async () => {
2039   - let body = { ids: [optRecord.id], checkIsMainOrderId: false };
2040   - const data = await postServiceOrderOrderCancel({
2041   - data: body,
2042   - });
2043   - if (data.result === RESPONSE_CODE.SUCCESS) {
2044   - message.success(data.message);
2045   - refreshTable();
2046   - }
2047   - }}
2048   - />
2049   - ) : (
2050   - ''
2051   - )}
2052   - </Flex>
2053   - </Flex>
2054   -
2055   - <Flex title={optRecord.notes}>
2056   - <div
2057   - className="max-w-[1100px] overflow-hidden whitespace-normal overflow-ellipsis hover:cursor-pointer"
2058   - onClick={() => {
2059   - copyToClipboard(optRecord.notes);
2060   - message.info('备注复制成功:' + optRecord.notes);
2061   - }}
2062   - >
2063   - <span className="text-[#8C8C8C]">
2064   - 备注:
2065   - {optRecord.notes === null ? '暂无备注' : optRecord.notes}
2066   - </span>
2067   - </div>
2068   - {!isSupplier() && (isSales() || isWarehousekeeper() || isAdmin()) && (
2069   - <EditTwoTone
2070   - className="pl-1 pr-1 hover:curcor-pointer"
2071   - onClick={() => {
2072   - setNotesEditVisible(true);
2073   - setSelectedRows([optRecord.id]);
2074   - setNotes(optRecord.notes);
2075   - setNotesType(1);
2076   - }}
2077   - />
2078   - )}
2079   - </Flex>
2080   -
2081   - {(isProcure() || isWarehousekeeper() || isSales() || isAdmin()) &&
2082   - !isSupplier() ? (
2083   - <div className="pt-2">
2084   - <Flex title={optRecord.supplierName}>
2085   - <div>
2086   - <span className="text-[#8C8C8C]">
2087   - 所属采购:
2088   - {optRecord.supplierName === null
2089   - ? '暂无'
2090   - : optRecord.supplierName}
2091   - </span>
2092   - </div>
2093   -
2094   - <Divider type="vertical" />
2095   -
2096   - <div className="overflow-hidden whitespace-normal overflow-ellipsis hover:cursor-pointer">
2097   - <span className="text-[#8C8C8C]">
2098   - 采购备注:
2099   - {optRecord.procureNotes === null
2100   - ? '暂无备注'
2101   - : optRecord.procureNotes}
2102   - </span>
2103   - </div>
2104   - {/* 编辑备注按钮 */}
2105   - {(isProcure() || isAdmin()) && (
2106   - <EditTwoTone
2107   - className="pl-1 pr-1 hover:curcor-pointer"
2108   - onClick={() => {
2109   - setSelectedRows([optRecord.id]);
2110   - setNotes(optRecord.procureNotes);
2111   - setNotesEditVisible(true);
2112   - setNotesType(2);
2113   - }}
2114   - />
2115   - )}
2116   - </Flex>
2117   -
2118   - {(isAdmin() || isProcure()) && (
2119   - <Flex title={optRecord.supplierNotes}>
2120   - <div className="max-w-[90%] whitespace-no-wrap overflow-hidden overflow-ellipsis">
2121   - <span className="text-[#8C8C8C]">
2122   - 供应商备注:
2123   - {optRecord.supplierNotes === null
2124   - ? '暂无备注'
2125   - : optRecord.supplierNotes}
2126   - </span>
2127   - </div>
2128   - {/* 编辑备注按钮 */}
2129   - <EditTwoTone
2130   - className="pl-1 hover:curcor-pointer"
2131   - onClick={() => {
2132   - setSelectedRows([optRecord.id]);
2133   - setNotes(optRecord.supplierNotes);
2134   - setNotesEditVisible(true);
2135   - setNotesType(3);
2136   - }}
2137   - />
2138   - </Flex>
2139   - )}
2140   - </div>
2141   - ) : (
2142   - ''
2143   - )}
2144   -
2145   - {isAdmin() || isSales() || isFinance() ? (
2146   - <Flex title={optRecord.notes} className="pt-2">
2147   - <div className="flex items-center">
2148   - <div className="flex items-center max-w-[500px]">
2149   - <div className="max-w-md overflow-hidden whitespace-no-wrap overflow-ellipsis">
2150   - <Tooltip
2151   - title={optRecord.applyInvoicingNotes}
2152   - placement="topLeft"
2153   - >
2154   - <span className="text-[#8C8C8C]">
2155   - 申请开票备注:
2156   - {optRecord.applyInvoicingNotes === undefined ||
2157   - optRecord.applyInvoicingNotes === null
2158   - ? '暂无备注'
2159   - : optRecord.applyInvoicingNotes}
2160   - </span>
2161   - </Tooltip>
2162   - </div>
2163   -
2164   - {getAfterAnnexList()}
2165   -
2166   - <Tooltip title="编辑">
2167   - <EditTwoTone
2168   - className="pl-1 hover:curcor-pointer"
2169   - onClick={() => {
2170   - setNotesEditVisible(true);
2171   - setSelectedRows([optRecord.id]);
2172   - setNotes(optRecord.applyInvoicingNotes);
2173   - setNotesType(4);
2174   - }}
2175   - />
2176   - </Tooltip>
2177   - </div>
2178   - <Divider type="vertical" className="mx-5" />
2179   - <div className="flex items-center max-w-[500px]">
2180   - <div className="max-w-md overflow-hidden whitespace-no-wrap overflow-ellipsis">
2181   - <Tooltip title={optRecord.checkNotes} placement="topLeft">
2182   - <span className="text-[#8C8C8C] mr-3">
2183   - 财务审核备注:
2184   - {optRecord.checkNotes === undefined ||
2185   - optRecord.checkNotes === null
2186   - ? '暂无备注'
2187   - : optRecord.checkNotes}
2188   - </span>
2189   - </Tooltip>
2190   - </div>
2191   -
2192   - {getInvoicingCheckAnnexList()}
2193   - </div>
2194   - </div>
2195   - </Flex>
2196   - ) : (
2197   - ''
2198   - )}
2199   -
2200   - {isAdmin() || isSales() || isFinance() ? (
2201   - <Flex title={optRecord.notes} className="pt-2">
2202   - <div className="flex items-center">
2203   - <div className="flex items-center max-w-[500px]">
2204   - <div className="max-w-md overflow-hidden whitespace-no-wrap overflow-ellipsis">
2205   - <Tooltip title={optRecord.reissueNotes} placement="topLeft">
2206   - <span className="text-[#8C8C8C]">
2207   - 重新开票备注:
2208   - {optRecord.reissueNotes === undefined ||
2209   - optRecord.reissueNotes === null
2210   - ? '暂无备注'
2211   - : optRecord.reissueNotes}
2212   - </span>
2213   - </Tooltip>
2214   - </div>
2215   -
2216   - <Tooltip title="编辑">
2217   - <EditTwoTone
2218   - className="pl-1 hover:curcor-pointer"
2219   - onClick={() => {
2220   - setNotesEditVisible(true);
2221   - setSelectedRows([optRecord.id]);
2222   - setNotes(optRecord.reissueNotes);
2223   - setNotesType(5);
2224   - }}
2225   - />
2226   - </Tooltip>
2227   - </div>
2228   - <Divider type="vertical" className="mx-5" />
2229   - </div>
2230   - </Flex>
2231   - ) : (
2232   - ''
2233   - )}
2234   - </>
2235   - );
2236   - };
2237   - const expandedRowRender = (record) => {
2238   - let subOrders = record.subOrderInformationLists;
2239   -
2240   - return (
2241   - <ProTable
2242   - id="sub-table"
2243   - className="w-full "
2244   - showHeader={false}
2245   - columns={[
2246   - {
2247   - title: 'ID',
2248   - dataIndex: 'id',
2249   - key: 'id',
2250   - render: (text: any, optRecord: any) => {
2251   - return <SubOderRander record={record} optRecord={optRecord} />;
2252   - },
2253   - },
2254   - ]}
2255   - rowSelection={{
2256   - onSelect: (row: any) => {
2257   - let subId = row.id;
2258   - let mainId = row.mainOrderId;
2259   - let newSelectedSubOrderKeys = [...selectedSubOrderKeys];
2260   - let currentMainOrderSelectedSubOrderList =
2261   - subOrderSelectedMap.get(mainId);
2262   - if (!selectedSubOrderKeys.includes(subId)) {
2263   - //选中子订单
2264   - newSelectedSubOrderKeys.push(subId);
2265   -
2266   - //在Map中添加对应的主订单中的子订单
2267   - if (currentMainOrderSelectedSubOrderList) {
2268   - currentMainOrderSelectedSubOrderList.push(row);
2269   - } else {
2270   - currentMainOrderSelectedSubOrderList = [row];
2271   - }
2272   -
2273   - //如果该主订单的所有子订单都选中了,那么勾选上主订单
2274   - if (
2275   - currentMainOrderSelectedSubOrderList?.length ===
2276   - mainOrderIdSubOrderIdRelationsMap.get(mainId)?.length
2277   - ) {
2278   - selectedMainOrderKeys.push(mainId, record);
2279   - mainOrderSelectedMap.set(mainId, record);
2280   - }
2281   -
2282   - //如果所有主订单都勾选上了,那么勾选上总选中按钮
2283   - if (
2284   - mainOrderSelectedMap?.size ===
2285   - mainOrderIdSubOrderIdRelationsMap.size
2286   - ) {
2287   - setAllMainChecked(true);
2288   - }
2289   - } else {
2290   - //取消选中子订单
2291   - newSelectedSubOrderKeys = newSelectedSubOrderKeys.filter(
2292   - (item) => {
2293   - return item !== subId;
2294   - },
2295   - );
2296   -
2297   - removeSelecetMainOrderKeyByMainOrderId(mainId); //某个子订单取消勾选了,对应的主订单也要取消勾选
2298   -
2299   - //在Map中删除掉对应的主订单中的子订单
2300   - if (currentMainOrderSelectedSubOrderList) {
2301   - currentMainOrderSelectedSubOrderList =
2302   - currentMainOrderSelectedSubOrderList.filter((item) => {
2303   - return item.id !== subId;
2304   - });
2305   - } else {
2306   - subOrderSelectedMap.set(mainId, [row]);
2307   - }
2308   -
2309   - mainOrderSelectedMap.delete(mainId);
2310   - //总选中按钮取消选中
2311   - setAllMainChecked(false);
2312   - }
2313   -
2314   - //如果该主订单已经没有子订单选中,删除key
2315   - if (currentMainOrderSelectedSubOrderList?.length === 0) {
2316   - subOrderSelectedMap.delete(record.id);
2317   - } else {
2318   - subOrderSelectedMap.set(
2319   - record.id,
2320   - currentMainOrderSelectedSubOrderList,
2321   - );
2322   - }
2323   -
2324   - setSelectedSubOrderKeys(newSelectedSubOrderKeys);
2325   - setSelectedRows(currentMainOrderSelectedSubOrderList);
2326   - },
2327   - selectedRowKeys: selectedSubOrderKeys,
2328   - // 自定义选择项参考: https://ant.design/components/table-cn/#components-table-demo-row-selection-custom
2329   - // 注释该行则默认不显示下拉选项
2330   - // selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT],
2331   - // defaultSelectedRowKeys: [],
2332   - }}
2333   - rowKey="id"
2334   - headerTitle={false}
2335   - search={false}
2336   - options={false}
2337   - dataSource={subOrders}
2338   - pagination={false}
2339   - tableAlertRender={false}
2340   - />
2341   - );
2342   - };
2343   -
2344   - // 主订单内容渲染
2345   - const MainOrderColumnRender = ({ record }: { record: OrderListItemType }) => {
2346   - return (
2347   - <Flex vertical={true}>
2348   - {/* 编号、时间、销售信息 */}
2349   - <Flex
2350   - className="px-4 py-4 bg-white rounded-t-lg"
2351   - justify="space-between"
2352   - >
2353   - <Flex wrap="wrap" gap="middle" vertical>
2354   - <Flex>
2355   - <Flex>
2356   - <Checkbox
2357   - onChange={() => onCheckboxChange(record)}
2358   - checked={selectedMainOrderKeys.includes(record.id)}
2359   - >
2360   - <Space split={<Divider type="vertical" />}>
2361   - <div>
2362   - <span className="text-[#8C8C8C]">订单号:</span>
2363   - <span className="text-slate-700">{record.id}</span>
2364   - {record.modified ? (
2365   - <Tooltip title="点击查看详情">
2366   - <span
2367   - className="text-[#f44e4e] cursor-pointer"
2368   - onClick={async () => {
2369   - createOptObject(null, record.id);
2370   - setModifiedDiffModalVisible(true);
2371   - }}
2372   - >
2373   - (修改过)
2374   - </span>
2375   - </Tooltip>
2376   - ) : (
2377   - ''
2378   - )}
2379   - </div>
2380   - </Space>
2381   - </Checkbox>
2382   - <Tooltip title="点击复制订单号">
2383   - <CopyOutlined
2384   - className="hover:cursor-pointer"
2385   - style={{ color: '#8C8C8C' }}
2386   - onClick={() => {
2387   - copyToClipboard(record.id);
2388   - message.info('订单号复制成功!');
2389   - }}
2390   - />
2391   - </Tooltip>
2392   - <Divider type="vertical" />
2393   - <span>{formatDateTime(record.createTime)}</span>
2394   - <Divider type="vertical" />
2395   - <Space split={<Divider type="vertical" />}>
2396   - <div
2397   - className="hover:cursor-pointer"
2398   - onClick={() => {
2399   - copyToClipboard(record.salesCode);
2400   - message.info('代表复制成功:' + record.salesCode);
2401   - }}
2402   - >
2403   - <span className="text-[#8C8C8C]">代表:</span>
2404   - <span className="text-slate-700">{record.salesCode}</span>
2405   - </div>
2406   - {!isSupplier() ? (
2407   - <>
2408   - <div
2409   - title={record.institution}
2410   - className="whitespace-no-wrap overflow-hidden overflow-ellipsis max-w-[150px]"
2411   - >
2412   - <span className="text-[#8C8C8C]">单位:</span>
2413   - <span className="text-slate-700">
2414   - {record.institution}
2415   - </span>
2416   - </div>
2417   - <span>
2418   - <span className="text-[#8C8C8C]">联系人:</span>
2419   - <span className="text-slate-700">
2420   - {record.institutionContactName + ' '}
2421   - </span>
2422   - </span>
2423   - </>
2424   - ) : (
2425   - ''
2426   - )}
2427   - <div
2428   - title={record.institution}
2429   - className="whitespace-no-wrap overflow-hidden overflow-ellipsis max-w-[150px]"
2430   - >
2431   - <span
2432   - className="hover:cursor-pointer"
2433   - onClick={() => {
2434   - copyToClipboard(record.customerName);
2435   - message.info('收货人复制成功:' + record.customerName);
2436   - }}
2437   - >
2438   - <span className="text-[#8C8C8C]">收货人:</span>
2439   - {!isSupplier() && (
2440   - <Tooltip className="order-tooltip" title="详情">
2441   - <ContainerTwoTone
2442   - className="px-1 hover:curcor-pointer"
2443   - onClick={() => {
2444   - createOptObject(null, record.id);
2445   - setDeliverInfoDrawerVisible(true);
2446   - }}
2447   - />
2448   - </Tooltip>
2449   - )}
2450   - <span className="text-slate-700">
2451   - {record.customerName + ' '}
2452   - </span>
2453   - </span>
2454   - </div>
2455   -
2456   - {isSupplier() ? (
2457   - <div
2458   - title={record.customerShippingAddress}
2459   - className="whitespace-no-wrap overflow-hidden overflow-ellipsis max-w-[400px] hover:cursor-pointer"
2460   - onClick={() => {
2461   - copyToClipboard(record.customerShippingAddress);
2462   - message.info(
2463   - '收货地址复制成功:' + record.customerShippingAddress,
2464   - );
2465   - }}
2466   - >
2467   - <span className="text-[#8C8C8C]">收货地址:</span>
2468   - <span className="text-slate-700">
2469   - {record.customerShippingAddress}
2470   - </span>
2471   - </div>
2472   - ) : (
2473   - ''
2474   - )}
2475   - </Space>
2476   - </Flex>
2477   - </Flex>
2478   -
2479   - {isSupplier() ? (
2480   - <Flex className="pl-6" align="center">
2481   - <Flex
2482   - className="hover:cursor-pointer"
2483   - onClick={() => {
2484   - copyToClipboard(record.customerContactNumber);
2485   - message.info(
2486   - '联系电话复制成功:' + record.customerContactNumber,
2487   - );
2488   - }}
2489   - >
2490   - <span className="text-[#8C8C8C]">联系电话:</span>
2491   - <span className="text-slate-700">
2492   - {record.customerContactNumber + ' '}
2493   - </span>
2494   - </Flex>
2495   - </Flex>
2496   - ) : (
2497   - ''
2498   - )}
2499   -
2500   - <Flex className="pl-6" align="center">
2501   - {roleCode === 'finance' ? (
2502   - <div
2503   - title={enumValueToLabel(
2504   - record.receivingCompany,
2505   - getReceivingCompanyOptions(PAYEE_OPTIONS),
2506   - )}
2507   - className="whitespace-no-wrap overflow-hidden overflow-ellipsis max-w-[400px]"
2508   - >
2509   - <span className="text-[#8C8C8C]">开票收款单位:</span>
2510   - <span className="text-slate-700">
2511   - {record.receivingCompany !== null
2512   - ? enumValueToLabel(
2513   - record.receivingCompany,
2514   - getReceivingCompanyOptions(PAYEE_OPTIONS),
2515   - )
2516   - : '暂无'}
2517   - </span>
2518   - </div>
2519   - ) : (
2520   - ''
2521   - )}
2522   -
2523   - {roleCode === 'finance' ? <Divider type="vertical" /> : ''}
2524   -
2525   - <div title={record.notes}>
2526   - <div
2527   - className="max-w-[850px] whitespace-normal overflow-hidden overflow-ellipsis hover:cursor-pointer"
2528   - onClick={() => {
2529   - copyToClipboard(record.notes);
2530   - message.info('备注复制成功:' + record.notes);
2531   - }}
2532   - >
2533   - <span className="text-[#8C8C8C]">备注:</span>
2534   - <span className="ml-2">
2535   - {record.notes === null ? '暂无备注' : record.notes}
2536   - </span>
2537   - </div>
2538   - </div>
2539   -
2540   - {!isSupplier() ? (
2541   - <Tooltip title="编辑">
2542   - <EditTwoTone
2543   - className="pl-1 hover:curcor-pointer"
2544   - onClick={() => {
2545   - setNotesEditVisible(true);
2546   - setSelectedRows([record.id]);
2547   - setNotes(record.notes);
2548   - setNotesType(0);
2549   - }}
2550   - />
2551   - </Tooltip>
2552   - ) : (
2553   - ''
2554   - )}
2555   -
2556   - {record.goodsWeight !== null ? (
2557   - <div title={record.goodsWeight + 'kg'} className="pl-3">
2558   - <div
2559   - className="max-w-md overflow-hidden whitespace-no-wrap overflow-ellipsis hover:cursor-pointer"
2560   - onClick={() => {
2561   - copyToClipboard(record.goodsWeight + 'kg');
2562   - message.info(
2563   - '包裹重量复制成功:' + record.goodsWeight + 'kg',
2564   - );
2565   - }}
2566   - >
2567   - <span className="text-[#8C8C8C]">包裹重量:</span>
2568   - <span className="ml-2">{record.goodsWeight + 'kg'}</span>
2569   - </div>
2570   - </div>
2571   - ) : (
2572   - ''
2573   - )}
2574   -
2575   - {record.goodsVolume !== null ? (
2576   - <div title={record.goodsVolume + 'm³'} className="pl-3">
2577   - <div
2578   - className="max-w-md overflow-hidden whitespace-no-wrap overflow-ellipsis hover:cursor-pointer"
2579   - onClick={() => {
2580   - copyToClipboard(record.goodsVolume + 'm³');
2581   - message.info(
2582   - '包裹体积复制成功:' + record.goodsVolume + 'm³',
2583   - );
2584   - }}
2585   - >
2586   - <span className="text-[#8C8C8C]">包裹体积:</span>
2587   - <span className="ml-2">{record.goodsVolume + 'm³'}</span>
2588   - </div>
2589   - </div>
2590   - ) : (
2591   - ''
2592   - )}
2593   - </Flex>
2594   - </Flex>
2595   - <Flex wrap="wrap" gap="middle" vertical>
2596   - <Flex justify="flex-end">
2597   - <Flex wrap="wrap" gap="middle" align="center">
2598   - {!isSupplier() ? (
2599   - <div>
2600   - <span className="text-[#8C8C8C]">总金额:¥</span>
2601   - <span className="text-lg font-medium">
2602   - {record.totalPayment}
2603   - </span>
2604   - </div>
2605   - ) : (
2606   - ''
2607   - )}
2608   -
2609   - {rolePath?.includes('addOrder') ? (
2610   - <Tooltip title="复制">
2611   - <CopyTwoTone
2612   - className="hover:cursor-pointer"
2613   - onClick={() => {
2614   - createOptObject(null, record.id);
2615   - copyOrderToClipboard(record);
2616   - setOrderOptType('copy');
2617   - setOrderDrawerVisible(true);
2618   - }}
2619   - />
2620   - </Tooltip>
2621   - ) : (
2622   - <Tooltip title="复制文本">
2623   - <CopyTwoTone
2624   - className="hover:cursor-pointer"
2625   - onClick={() => {
2626   - copyOrderToClipboard(record);
2627   - }}
2628   - />
2629   - </Tooltip>
2630   - )}
2631   - {!isSupplier() ? (
2632   - <Tooltip title="历史">
2633   - <ClockCircleTwoTone
2634   - className="hover:cursor-pointer"
2635   - onClick={() => {
2636   - setHistoryModalVisible(true);
2637   - if (subOrderSelectedMap.get(record.id)?.length) {
2638   - setSelectedRows(subOrderSelectedMap.get(record.id));
2639   - } else {
2640   - setSelectedRows(record.subOrderInformationLists);
2641   - }
2642   - }}
2643   - />
2644   - </Tooltip>
2645   - ) : (
2646   - ''
2647   - )}
2648   - </Flex>
2649   - </Flex>
2650   - <Flex justify="flex-end">
2651   - <Space.Compact direction="vertical" align="end">
2652   - <Space wrap>
2653   - {record.paths?.includes('postAudit') ? (
2654   - <Button
2655   - className="p-0"
2656   - type="link"
2657   - onClick={() => {
2658   - setCurrentMainId(record.id);
2659   - setCurretnOptSubId(null);
2660   - setCheckVisible(true);
2661   - setOrderCheckType(CHECK_TYPE.WAITING_FOR_POST_AUDIT);
2662   - }}
2663   - >
2664   - 后置审核
2665   - </Button>
2666   - ) : (
2667   - ''
2668   - )}
2669   - {record.paths?.includes('URGENT_INVOICE_AUDITING') ? (
2670   - <Button
2671   - className="p-0"
2672   - type="link"
2673   - onClick={() => {
2674   - createOptObject(null, record.id);
2675   - setCheckVisible(true);
2676   - setOrderCheckType(CHECK_TYPE.URGENT_INVOICE_AUDITING);
2677   - }}
2678   - >
2679   - 加急审核(新)
2680   - </Button>
2681   - ) : (
2682   - ''
2683   - )}
2684   - {record.paths?.includes('URGENT_INVOICE_AUDITING_old') ? (
2685   - <Button
2686   - className="p-0"
2687   - type="link"
2688   - onClick={() => {
2689   - createOptObject(null, record.id);
2690   - setCheckVisible(true);
2691   - setOrderCheckType(
2692   - CHECK_TYPE.URGENT_INVOICE_AUDITING_OLD,
2693   - );
2694   - }}
2695   - >
2696   - 加急审核(旧)
2697   - </Button>
2698   - ) : (
2699   - ''
2700   - )}
2701   - {record.paths?.includes('salesConfirm') && (
2702   - <ButtonConfirm
2703   - className="p-0"
2704   - title="是否确认此商城订单信息无误?确认无误之后订单将进入审核流程。"
2705   - text="订单确认"
2706   - onConfirm={async () => {
2707   - let subIds = subOrderSelectedMap
2708   - .get(record.id)
2709   - ?.map((item) => {
2710   - return item.id;
2711   - });
2712   - if (subIds === null || subIds === undefined) {
2713   - subIds = record.subOrderInformationLists.map(
2714   - (item) => {
2715   - return item.id;
2716   - },
2717   - );
2718   - }
2719   - let res = await postServiceOrderSalesConfirm({
2720   - data: {
2721   - subOrderIds: subIds,
2722   - },
2723   - });
2724   -
2725   - if (res && res.result === RESPONSE_CODE.SUCCESS) {
2726   - message.success(res.message);
2727   - refreshTable();
2728   - }
2729   - }}
2730   - />
2731   - )}
2732   - {record.paths?.includes('uploadPaymentReceiptBill') ? (
2733   - <Button
2734   - className="p-0"
2735   - type="link"
2736   - onClick={() => {
2737   - createOptObject(null, record.id);
2738   - setUploadPayBillModalVisible(true);
2739   - }}
2740   - >
2741   - 回款
2742   - </Button>
2743   - ) : (
2744   - ''
2745   - )}
2746   -
2747   - {record.paths?.includes('modifiedAuditRequest') ? (
2748   - <Button
2749   - className="p-0"
2750   - type="link"
2751   - onClick={() => {
2752   - createOptObject(null, record.id);
2753   - setCheckVisible(true);
2754   - setOrderCheckType(CHECK_TYPE.NODE_OPERATING_AUDIT);
2755   - }}
2756   - >
2757   - 节点修改审核
2758   - </Button>
2759   - ) : (
2760   - ''
2761   - )}
2762   -
2763   - {record.paths?.includes('auditPaymentReceipt') ? (
2764   - <Button
2765   - className="p-0"
2766   - type="link"
2767   - onClick={() => {
2768   - createOptObject(null, record.id);
2769   - setCheckVisible(true);
2770   - setOrderCheckType(CHECK_TYPE.PAYMENT_RECEIPTS_AUDIT);
2771   - }}
2772   - >
2773   - 回款审核
2774   - </Button>
2775   - ) : (
2776   - ''
2777   - )}
2778   -
2779   - {record.paths?.includes('modifiedLeaderAuditRequest') ? (
2780   - <Button
2781   - className="p-0"
2782   - type="link"
2783   - onClick={() => {
2784   - createOptObject(null, record.id);
2785   - setCheckVisible(true);
2786   - setOrderCheckType(CHECK_TYPE.MODIFY_LEADER_AUDIT);
2787   - }}
2788   - >
2789   - 领导修改审核
2790   - </Button>
2791   - ) : (
2792   - ''
2793   - )}
2794   -
2795   - {false ? (
2796   - <Button
2797   - className="p-0"
2798   - type="link"
2799   - onClick={() => {
2800   - createOptObject(null, record.id);
2801   - setFinancialReceiptsModalVisible(true);
2802   - setIsEdit(true);
2803   - }}
2804   - >
2805   - 收款记录
2806   - </Button>
2807   - ) : (
2808   - ''
2809   - )}
2810   -
2811   - {record.paths?.includes('reissue_old') ? (
2812   - /*optRecord.afterInvoicingStatus==='PARTIAL_INVOICING'||
2813   - optRecord.afterInvoicingStatus==='COMPLETE_INVOICING'*/
2814   - <Button
2815   - className="p-0"
2816   - type="link"
2817   - onClick={() => {
2818   - setCurrentMainId(record.id);
2819   - setReissueVisibleOld(true);
2820   - console.log(reissueVisible);
2821   - }}
2822   - >
2823   - 重新开票(旧)
2824   - </Button>
2825   - ) : (
2826   - ''
2827   - )}
2828   -
2829   - {record.paths?.includes('confirmReissue_old') ? (
2830   - <Button
2831   - className="p-0"
2832   - type="link"
2833   - onClick={() => {
2834   - setCurrentMainId(record.id);
2835   - setCurretnOptSubId(null);
2836   - setCheckVisible(true);
2837   - setOrderCheckType(CHECK_TYPE.CONFIRM_REISSUE_OLD);
2838   - }}
2839   - >
2840   - 重新开票审核(旧)
2841   - </Button>
2842   - ) : (
2843   - ''
2844   - )}
2845   -
2846   - {record.paths?.includes('reissue') ? (
2847   - /*optRecord.afterInvoicingStatus==='PARTIAL_INVOICING'||
2848   - optRecord.afterInvoicingStatus==='COMPLETE_INVOICING'*/
2849   - <Button
2850   - className="p-0"
2851   - type="link"
2852   - onClick={() => {
2853   - setCurrentMainId(record.id);
2854   - setReissueVisible(true);
2855   - }}
2856   - >
2857   - 重新开票(新)
2858   - </Button>
2859   - ) : (
2860   - ''
2861   - )}
2862   -
2863   - {record.paths?.includes('confirmReissue') ? (
2864   - <Button
2865   - className="p-0"
2866   - type="link"
2867   - onClick={() => {
2868   - setCurrentMainId(record.id);
2869   - setCurretnOptSubId(null);
2870   - setCheckVisible(true);
2871   - setOrderCheckType(CHECK_TYPE.CONFIRM_REISSUE);
2872   - }}
2873   - >
2874   - 重新开票审核(新)
2875   - </Button>
2876   - ) : (
2877   - ''
2878   - )}
2879   -
2880   - {record.paths?.includes('procureOrder') ? (
2881   - <ButtonConfirm
2882   - className="p-0"
2883   - title="是否下单?"
2884   - text="下单"
2885   - onConfirm={async () => {
2886   - let subIds = subOrderSelectedMap
2887   - .get(record.id)
2888   - ?.map((item) => {
2889   - return item.id;
2890   - });
2891   - if (subIds === null || subIds === undefined) {
2892   - subIds = record.subOrderInformationLists.map(
2893   - (item) => {
2894   - return item.id;
2895   - },
2896   - );
2897   - }
2898   - let res = await postServiceOrderProcureOrder({
2899   - data: { subIds: subIds },
2900   - });
2901   - if (res.result === RESPONSE_CODE.SUCCESS) {
2902   - message.success(res.message);
2903   - refreshTable();
2904   - return true;
2905   - }
2906   - }}
2907   - />
2908   - ) : (
2909   - ''
2910   - )}
2911   -
2912   - {record.paths?.includes('cancelSend') ? (
2913   - <ButtonConfirm
2914   - className="p-0"
2915   - title="是否取消发货?"
2916   - text="取消发货"
2917   - onConfirm={async () => {
2918   - let subIds = subOrderSelectedMap
2919   - .get(record.id)
2920   - ?.map((item) => {
2921   - return item.id;
2922   - });
2923   - if (subIds === null || subIds === undefined) {
2924   - subIds = record.subOrderInformationLists.map(
2925   - (item) => {
2926   - return item.id;
2927   - },
2928   - );
2929   - }
2930   - let res = await postServiceOrderCancelSend({
2931   - data: { subIds: subIds },
2932   - });
2933   - if (res.result === RESPONSE_CODE.SUCCESS) {
2934   - message.success(res.message);
2935   - refreshTable();
2936   - return true;
2937   - }
2938   - }}
2939   - />
2940   - ) : (
2941   - ''
2942   - )}
2943   -
2944   - {record.paths?.includes('applyModify') ? (
2945   - <Button
2946   - className="p-0"
2947   - type="link"
2948   - onClick={() => {
2949   - createOptObject(null, record.id);
2950   - setOrderDrawerVisible(true);
2951   - setOrderOptType('order-change-normal');
2952   - }}
2953   - >
2954   - 申请修改
2955   - </Button>
2956   - ) : (
2957   - ''
2958   - )}
2959   -
2960   - {record.paths?.includes('leaderAudit') ? (
2961   - <Button
2962   - className="p-0"
2963   - type="link"
2964   - onClick={() => {
2965   - let selectedSubOrders = subOrderSelectedMap.get(
2966   - record.id,
2967   - );
2968   - setSelectedRows(selectedSubOrders);
2969   - if (selectedSubOrders === undefined) {
2970   - selectedSubOrders = record.subOrderInformationLists;
2971   - }
2972   - for (let i = 0; i < selectedSubOrders.length; i++) {
2973   - if (
2974   - selectedSubOrders[i].orderStatus !==
2975   - 'LEADER_PROCESS'
2976   - ) {
2977   - message.error('请选择领导待审核的子订单进行审核');
2978   - return;
2979   - }
2980   - }
2981   - createOptObject(null, record.id);
2982   - setCheckVisible(true);
2983   - setOrderCheckType(CHECK_TYPE.LEADER_AUDIT);
2984   - }}
2985   - >
2986   - 审核
2987   - </Button>
2988   - ) : (
2989   - ''
2990   - )}
2991   -
2992   - {record.paths?.includes('changeOrderAudit') ? (
2993   - <Button
2994   - className="p-0"
2995   - type="link"
2996   - onClick={() => {
2997   - let selectedSubOrders = subOrderSelectedMap.get(
2998   - record.id,
2999   - );
3000   - setSelectedRows(selectedSubOrders);
3001   - if (selectedSubOrders === undefined) {
3002   - selectedSubOrders = record.subOrderInformationLists;
3003   - }
3004   - for (let i = 0; i < selectedSubOrders.length; i++) {
3005   - if (
3006   - selectedSubOrders[i].orderStatus !==
3007   - 'MODIFY_APPLY_WAIT_FOR_AUDIT'
3008   - ) {
3009   - message.error('请选择[修改待审核]的子订单进行审核');
3010   - return;
3011   - }
3012   - }
3013   - createOptObject(null, record.id);
3014   - setCheckVisible(true);
3015   - setOrderCheckType(
3016   - CHECK_TYPE.MODIFY_APPLY_WAIT_FOR_AUDIT,
3017   - );
3018   - }}
3019   - >
3020   - 审核
3021   - </Button>
3022   - ) : (
3023   - ''
3024   - )}
3025   -
3026   - {record.paths?.includes('creditAudit') ? (
3027   - <Button
3028   - className="p-0"
3029   - type="link"
3030   - onClick={() => {
3031   - let selectedSubOrders = subOrderSelectedMap.get(
3032   - record.id,
3033   - );
3034   - setSelectedRows(selectedSubOrders);
3035   - if (selectedSubOrders === undefined) {
3036   - selectedSubOrders = record.subOrderInformationLists;
3037   - }
3038   - for (let i = 0; i < selectedSubOrders.length; i++) {
3039   - if (
3040   - selectedSubOrders[i].orderStatus !==
3041   - 'CREDIT_CONFIRM'
3042   - ) {
3043   - message.error('请选择[赊账待审核]的子订单进行审核');
3044   - return;
3045   - }
3046   - }
3047   - createOptObject(null, record.id);
3048   - setCheckVisible(true);
3049   - setOrderCheckType(CHECK_TYPE.CREDIT_AUDIT);
3050   - }}
3051   - >
3052   - 赊账审核
3053   - </Button>
3054   - ) : (
3055   - ''
3056   - )}
3057   -
3058   - {record.paths?.includes('editProductionTime') ? (
3059   - <Button
3060   - className="p-0"
3061   - type="link"
3062   - onClick={() => {
3063   - createOptObject(null, record.id);
3064   - setProductionTimeModalVisible(true);
3065   - }}
3066   - >
3067   - 生产时间
3068   - </Button>
3069   - ) : (
3070   - ''
3071   - )}
3072   -
3073   - {record.paths?.includes('procureConvertProcure') ? (
3074   - <Button
3075   - className="p-0"
3076   - type="link"
3077   - onClick={() => {
3078   - let selectedSubOrders = subOrderSelectedMap.get(
3079   - record.id,
3080   - );
3081   - if (selectedSubOrders === undefined) {
3082   - selectedSubOrders = record.subOrderInformationLists;
3083   - }
3084   -
3085   - for (let i = 0; i < selectedSubOrders.length; i++) {
3086   - if (
3087   - !selectedSubOrders[i].paths.includes(
3088   - 'procureConvertProcure',
3089   - )
3090   - ) {
3091   - message.error('请选择允许转发的子订单进行转发');
3092   - return;
3093   - }
3094   - }
3095   - createOptObject(null, record.id);
3096   - setOrderCheckType(CHECK_TYPE.PROCURE);
3097   - setProcureConvertModalVisible(true);
3098   - }}
3099   - >
3100   - 转发
3101   - </Button>
3102   - ) : (
3103   - ''
3104   - )}
3105   - {record.paths?.includes('sendProduct') ? (
3106   - <Button
3107   - className="p-0"
3108   - type="link"
3109   - onClick={() => {
3110   - if (!subOrderSelectedMap.get(record.id)?.length) {
3111   - return message.error('请选择选择子订单');
3112   - }
3113   - createOptObject(null, record.id);
3114   - setDeliverVisible(true);
3115   - setIsSendProduct(true);
3116   - setOrderCheckType(CHECK_TYPE.WEARHOUSE_KEEPER);
3117   - }}
3118   - >
3119   - 仓库发货
3120   - </Button>
3121   - ) : (
3122   - ''
3123   - )}
3124   -
3125   - {/* 供应商发货 */}
3126   - {record.paths?.includes('supplierSendOrder') ? (
3127   - <Button
3128   - className="p-0"
3129   - type="link"
3130   - onClick={() => {
3131   - if (!subOrderSelectedMap.get(record.id)?.length) {
3132   - return message.error('请选择选择子订单');
3133   - }
3134   - createOptObject(null, record.id);
3135   - setDeliverVisible(true);
3136   - setIsSendProduct(true);
3137   - setOrderCheckType(CHECK_TYPE.SUPPLIER);
3138   - }}
3139   - >
3140   - 供应商发货
3141   - </Button>
3142   - ) : (
3143   - ''
3144   - )}
3145   -
3146   - {record.paths?.includes('procureSend') ? (
3147   - <Button
3148   - className="p-0"
3149   - type="link"
3150   - onClick={() => {
3151   - if (!subOrderSelectedMap.get(record.id)?.length) {
3152   - return message.error('请选择选择子订单');
3153   - }
3154   - createOptObject(null, record.id);
3155   - setDeliverVisible(true);
3156   - setIsSendProduct(true);
3157   - setOrderCheckType(CHECK_TYPE.PROCURE);
3158   - }}
3159   - >
3160   - {isSupplier() ? '发货' : '采购发货'}
3161   - </Button>
3162   - ) : (
3163   - ''
3164   - )}
3165   -
3166   - {record.paths?.includes('printOrder') ? (
3167   - <Button
3168   - className="p-0"
3169   - type="link"
3170   - onClick={() => {
3171   - const selectedSubOrders = subOrderSelectedMap.get(
3172   - record.id,
3173   - );
3174   - if (!selectedSubOrders?.length) {
3175   - return message.error('请选择选择子订单');
3176   - }
3177   -
3178   - for (let subOrderRecord of selectedSubOrders) {
3179   - let paths = subOrderRecord.paths;
3180   - if (!checkePrintable(paths)) {
3181   - return message.error('请选择可以打印的子订单');
3182   - }
3183   - }
3184   - createOptObject(null, record.id);
3185   - setOrderPrintVisible(true);
3186   - setOrderCheckType(CHECK_TYPE.WEARHOUSE_KEEPER);
3187   - }}
3188   - >
3189   - 仓库打印
3190   - </Button>
3191   - ) : (
3192   - ''
3193   - )}
3194   -
3195   - {record.paths?.includes('supplierPrint') ? (
3196   - <Button
3197   - className="p-0"
3198   - type="link"
3199   - onClick={() => {
3200   - if (!subOrderSelectedMap.get(record.id)?.length) {
3201   - return message.error('请选择选择子订单');
3202   - }
3203   -
3204   - createOptObject(null, record.id);
3205   - setOrderPrintVisible(true);
3206   - setOrderCheckType(CHECK_TYPE.SUPPLIER);
3207   - }}
3208   - >
3209   - 供应商打印
3210   - </Button>
3211   - ) : (
3212   - ''
3213   - )}
3214   -
3215   - {record.paths?.includes('rePrintOrder') ? (
3216   - <Button
3217   - className="p-0"
3218   - type="link"
3219   - onClick={() => {
3220   - if (!subOrderSelectedMap.get(record.id)?.length) {
3221   - return message.error('请选择选择子订单');
3222   - }
3223   - createOptObject(null, record.id);
3224   - setOrderPrintVisible(true);
3225   - setIsRePrintOrder(true);
3226   - }}
3227   - >
3228   - 重新打印
3229   - </Button>
3230   - ) : (
3231   - ''
3232   - )}
3233   - {record.paths?.includes('confirmReceipt') ? (
3234   - <Button
3235   - className="p-0"
3236   - type="link"
3237   - onClick={() => {
3238   - createOptObject(null, record.id);
3239   - setConfirmReceiptVisible(true);
3240   - }}
3241   - >
3242   - 确认收货
3243   - </Button>
3244   - ) : (
3245   - ''
3246   - )}
3247   - {record.paths?.includes('modifySendInformation') ? (
3248   - <Button
3249   - className="p-0"
3250   - type="link"
3251   - onClick={() => {
3252   - if (!subOrderSelectedMap.get(record.id)?.length) {
3253   - return message.error(
3254   - '请选择已经发货或者已经确认收货的子订单',
3255   - );
3256   - }
3257   - for (let row of subOrderSelectedMap.get(record.id)) {
3258   - if (
3259   - row.orderStatus !== 'CONFIRM_RECEIPT' &&
3260   - row.orderStatus !== 'SHIPPED'
3261   - ) {
3262   - return message.error(
3263   - '请选择已经发货或者已经确认收货的子订单',
3264   - );
3265   - }
3266   - }
3267   - createOptObject(null, record.id);
3268   - setDeliverVisible(true);
3269   - setIsSendProduct(false);
3270   - }}
3271   - >
3272   - 修改发货信息
3273   - </Button>
3274   - ) : (
3275   - ''
3276   - )}
3277   - {record.paths?.includes('invoicing') ? (
3278   - <Button
3279   - type="link"
3280   - className="p-0"
3281   - onClick={() => {
3282   - createOptObject(null, record.id);
3283   - setFinancialVisible(true);
3284   - setIsEdit(false);
3285   - }}
3286   - >
3287   - 开票
3288   - </Button>
3289   - ) : (
3290   - ''
3291   - )}
3292   -
3293   - {record.paths?.includes('applyInvoicing_old') ? (
3294   - <Button
3295   - type="link"
3296   - className="p-0"
3297   - onClick={() => {
3298   - let selectedSubOrders = subOrderSelectedMap.get(
3299   - record.id,
3300   - );
3301   - if (selectedSubOrders === undefined) {
3302   - selectedSubOrders = record.subOrderInformationLists;
3303   - }
3304   - for (let i = 0; i < selectedSubOrders.length; i++) {
3305   - if (
3306   - selectedSubOrders[i].invoicingStatus ===
3307   - 'UN_INVOICE' ||
3308   - selectedSubOrders[i].afterInvoicingStatus ===
3309   - 'APPLY_FOR_INVOICING'
3310   - ) {
3311   - message.error(
3312   - '请选择需要开票且未申请开票的子订单进行申请',
3313   - );
3314   - return;
3315   - }
3316   - }
3317   -
3318   - createOptObject(null, record.id);
3319   - setApplyForInvoicingVisible(true);
3320   - setIsEdit(false);
3321   - setIsMainOrder(false);
3322   - }}
3323   - >
3324   - 申请开票(旧)
3325   - </Button>
3326   - ) : (
3327   - ''
3328   - )}
3329   -
3330   - {record.paths?.includes('applyInvoicing') ? (
3331   - <Button
3332   - type="link"
3333   - className="p-0"
3334   - onClick={() => {
3335   - let selectedSubOrders = subOrderSelectedMap.get(
3336   - record.id,
3337   - );
3338   - if (selectedSubOrders === undefined) {
3339   - selectedSubOrders = record.subOrderInformationLists;
3340   - }
3341   - for (let i = 0; i < selectedSubOrders.length; i++) {
3342   - if (
3343   - selectedSubOrders[i].invoicingStatus ===
3344   - 'UN_INVOICE' ||
3345   - selectedSubOrders[i].afterInvoicingStatus ===
3346   - 'APPLY_FOR_INVOICING'
3347   - ) {
3348   - message.error(
3349   - '请选择需要开票且未申请开票的子订单进行申请',
3350   - );
3351   - return;
3352   - }
3353   - }
3354   -
3355   - createOptObject(null, record.id);
3356   - setInvoicingDrawerFormVisible(true);
3357   - setIsEdit(false);
3358   - setIsMainOrder(false);
3359   - }}
3360   - >
3361   - 申请开票(新)
3362   - </Button>
3363   - ) : (
3364   - ''
3365   - )}
3366   -
3367   - {record.paths?.includes('applyInvoicing') ? (
3368   - <Button
3369   - type="link"
3370   - className="p-0"
3371   - onClick={() => {
3372   - console.log('5656confirm');
3373   - }}
3374   - >
3375   - 确认开票
3376   - </Button>
3377   - ) : (
3378   - ''
3379   - )}
3380   -
3381   - {record.paths?.includes('updateOrder') ? (
3382   - <Button
3383   - className="p-0"
3384   - type="link"
3385   - onClick={() => {
3386   - //勾选的子订单:如果有勾选,后面只校验有勾选的
3387   -
3388   - let selectedSubOrders = subOrderSelectedMap.get(
3389   - record.id,
3390   - );
3391   - if (
3392   - selectedSubOrders === undefined ||
3393   - selectedSubOrders.length === 0
3394   - ) {
3395   - selectedSubOrders = record.subOrderInformationLists;
3396   - }
3397   - for (
3398   - let index = 0;
3399   - index < selectedSubOrders.length;
3400   - index++
3401   - ) {
3402   - let orderStatus =
3403   - selectedSubOrders[index].orderStatus;
3404   - //仓库管理员在审核之后的任何时候都可以编辑
3405   - if (
3406   - roleCode !== 'warehouseKeeper' &&
3407   - roleCode !== 'admin'
3408   - ) {
3409   - //是审核通过及之后的订单
3410   - if (
3411   - orderStatus !== 'UNAUDITED' &&
3412   - orderStatus !== 'AUDIT_FAILED' &&
3413   - orderStatus !== 'LEADER_PROCESS' &&
3414   - orderStatus !== 'SALES_CONFIRM' &&
3415   - orderStatus !== 'CREDIT_CONFIRM'
3416   - ) {
3417   - message.error(
3418   - '请选择【未审核、审核失败、销售待确认、赊账待审核】的订单进行编辑',
3419   - );
3420   - return;
3421   - }
3422   - } else {
3423   - //仓库管理员只能编辑是还未审核的订单
3424   - if (
3425   - roleCode !== 'admin' &&
3426   - (orderStatus === 'UNAUDITED' ||
3427   - orderStatus === 'AUDIT_FAILED')
3428   - ) {
3429   - message.error('请选择已审核的订单进行编辑');
3430   - return;
3431   - }
3432   - }
3433   - }
3434   -
3435   - createOptObject(null, record.id);
3436   - setOrderDrawerVisible(true);
3437   - setOrderOptType('edit');
3438   - }}
3439   - >
3440   - 编辑
3441   - </Button>
3442   - ) : (
3443   - ''
3444   - )}
3445   -
3446   - {record?.subOrderInformationLists[0].paths?.includes(
3447   - 'noNeedInvoicingEdit',
3448   - ) ? (
3449   - <Button
3450   - className="p-0"
3451   - type="link"
3452   - onClick={() => {
3453   - createOptObject(null, record.id);
3454   - setFinancialEditVisible(true);
3455   - setIsMainOrder(true);
3456   - }}
3457   - >
3458   - 财务编辑
3459   - </Button>
3460   - ) : (
3461   - ''
3462   - )}
3463   -
3464   - {record.paths?.includes('checkOrder') ? (
3465   - <Button
3466   - className="p-0"
3467   - type="link"
3468   - onClick={() => {
3469   - let selectedSubOrders = subOrderSelectedMap.get(
3470   - record.id,
3471   - );
3472   - setSelectedRows(selectedSubOrders);
3473   - if (selectedSubOrders === undefined) {
3474   - selectedSubOrders = record.subOrderInformationLists;
3475   - }
3476   - for (let i = 0; i < selectedSubOrders.length; i++) {
3477   - let orderStatus = selectedSubOrders[i].orderStatus;
3478   - if (
3479   - orderStatus !== 'UNAUDITED' &&
3480   - orderStatus !== 'FINANCE_PROCESS' &&
3481   - orderStatus !== 'LEADER_AUDITED'
3482   - ) {
3483   - message.error(
3484   - '请选择未审核或者领导已审核的子订单进行审核',
3485   - );
3486   - return;
3487   - }
3488   - }
3489   -
3490   - createOptObject(null, record.id);
3491   - setCheckVisible(true);
3492   - setOrderCheckType(CHECK_TYPE.WEARHOUSE_KEEPER);
3493   - }}
3494   - >
3495   - 审核
3496   - </Button>
3497   - ) : (
3498   - ''
3499   - )}
3500   -
3501   - {record.paths?.includes('afterSalesCheck') ? (
3502   - <Button
3503   - className="p-0"
3504   - type="link"
3505   - onClick={() => {
3506   - let selectedSubOrders = subOrderSelectedMap.get(
3507   - record.id,
3508   - );
3509   - setSelectedRows(selectedSubOrders);
3510   - if (selectedSubOrders === undefined) {
3511   - selectedSubOrders = record.subOrderInformationLists;
3512   - }
3513   - for (let i = 0; i < selectedSubOrders.length; i++) {
3514   - if (
3515   - selectedSubOrders[i].orderStatus !==
3516   - 'IN_AFTER_SALES'
3517   - ) {
3518   - message.error('请选择售后中的子订单进行审核');
3519   - return;
3520   - }
3521   - }
3522   -
3523   - createOptObject(null, record.id);
3524   - setCheckVisible(true);
3525   - setOrderCheckType(CHECK_TYPE.AFTER_SALES);
3526   - }}
3527   - >
3528   - 售后审核
3529   - </Button>
3530   - ) : (
3531   - ''
3532   - )}
3533   -
3534   - {record.paths?.includes('noNeedSend') ? (
3535   - <ButtonConfirm
3536   - className="p-0"
3537   - title="此订单是否无需发货?"
3538   - text="无需发货"
3539   - onConfirm={async () => {
3540   - let selectedSubOrders = subOrderSelectedMap.get(
3541   - record.id,
3542   - );
3543   - if (selectedSubOrders === undefined) {
3544   - selectedSubOrders = record.subOrderInformationLists;
3545   - }
3546   - setSelectedRows(selectedSubOrders);
3547   - for (let i = 0; i < selectedSubOrders.length; i++) {
3548   - if (
3549   - selectedSubOrders[i].orderStatus !== 'AUDITED' &&
3550   - selectedSubOrders[i].orderStatus !==
3551   - 'PROCURE_PROCESS' &&
3552   - selectedSubOrders[i].orderStatus !==
3553   - 'PROCURE_PROCESS_FOR_MINE' &&
3554   - selectedSubOrders[i].orderStatus !==
3555   - 'PROCURE_WAIT_SHIP' &&
3556   - selectedSubOrders[i].orderStatus !==
3557   - 'SUPPLIER_WAIT_SHIP' &&
3558   - selectedSubOrders[i].orderStatus !== 'WAIT_SHIP'
3559   - ) {
3560   - message.error(
3561   - '请选择未发货的子订单进行无需发货操作',
3562   - );
3563   - return;
3564   - }
3565   - }
3566   -
3567   - const data = await postServiceOrderNoNeedSend({
3568   - data: {
3569   - ids: selectedSubOrders.map((item) => {
3570   - return item.id;
3571   - }),
3572   - },
3573   - });
3574   - if (data.result === RESPONSE_CODE.SUCCESS) {
3575   - message.success(data.message);
3576   - refreshTable();
3577   - }
3578   - }}
3579   - />
3580   - ) : (
3581   - ''
3582   - )}
3583   -
3584   - {record.paths?.includes('saleCancelInvoicing_old') ? (
3585   - <ButtonConfirm
3586   - className="p-0"
3587   - title="确认取消申请开票?"
3588   - text="取消申请(旧)"
3589   - onConfirm={async () => {
3590   - let selectedSubOrders = subOrderSelectedMap.get(
3591   - record.id,
3592   - );
3593   - if (selectedSubOrders === undefined) {
3594   - selectedSubOrders = record.subOrderInformationLists;
3595   - }
3596   -
3597   - console.log(selectedSubOrders);
3598   - for (let i = 0; i < selectedSubOrders.length; i++) {
3599   - if (
3600   - selectedSubOrders[i].afterInvoicingStatus !==
3601   - 'APPLY_FOR_INVOICING'
3602   - ) {
3603   - message.error(
3604   - '请选择已[申请开票]的子订单进行取消申请',
3605   - );
3606   - return;
3607   - }
3608   - }
3609   - let res = await postServiceOrderSaleCancelInvoicing({
3610   - data: {
3611   - subOrderIds: selectedSubOrders.map((item) => {
3612   - return item.id;
3613   - }),
3614   - },
3615   - });
3616   -
3617   - if (res && res.result === RESPONSE_CODE.SUCCESS) {
3618   - message.success(res.message);
3619   - refreshTable();
3620   - }
3621   - }}
3622   - />
3623   - ) : (
3624   - ''
3625   - )}
3626   - {/* 财务审核:主订单暂无 */}
3627   - {record.paths?.includes('financeCheckOrder') ? (
3628   - <Button
3629   - className="p-0"
3630   - type="link"
3631   - onClick={() => {
3632   - let selectedSubOrders = subOrderSelectedMap.get(
3633   - record.id,
3634   - );
3635   - setSelectedRows(selectedSubOrders);
3636   - if (selectedSubOrders === undefined) {
3637   - selectedSubOrders = record.subOrderInformationLists;
3638   - }
3639   - for (let i = 0; i < selectedSubOrders.length; i++) {
3640   - if (
3641   - selectedSubOrders[i].orderStatus !== 'UNAUDITED' &&
3642   - selectedSubOrders[i].orderStatus !==
3643   - 'FINANCE_PROCESS' &&
3644   - selectedSubOrders[i].orderStatus !==
3645   - 'LEADER_AUDITED'
3646   - ) {
3647   - message.error(
3648   - '请选择[未审核]、[财务待审核]、[领导已审核]的子订单进行审核',
3649   - );
3650   - return;
3651   - }
3652   - }
3653   - createOptObject(null, record.id);
3654   - setCheckVisible(true);
3655   - setOrderCheckType(CHECK_TYPE.FINALCIAL);
3656   - }}
3657   - >
3658   - 财务审核
3659   - </Button>
3660   - ) : (
3661   - ''
3662   - )}
3663   -
3664   - {/* 采购审核 */}
3665   - {record.paths?.includes('procureCheckOrder') ? (
3666   - <Button
3667   - className="p-0"
3668   - type="link"
3669   - onClick={() => {
3670   - let selectedSubOrders = subOrderSelectedMap.get(
3671   - record.id,
3672   - );
3673   - setSelectedRows(selectedSubOrders);
3674   - if (selectedSubOrders === undefined) {
3675   - selectedSubOrders = record.subOrderInformationLists;
3676   - }
3677   - for (let i = 0; i < selectedSubOrders.length; i++) {
3678   - if (
3679   - selectedSubOrders[i].orderStatus !==
3680   - 'PROCURE_UN_PROCESS'
3681   - ) {
3682   - message.error('请选择未审核的子订单进行审核');
3683   - return;
3684   - }
3685   - }
3686   -
3687   - createOptObject(null, record.id);
3688   - setProcureCheckModalVisible(true);
3689   - setOrderCheckType(CHECK_TYPE.PROCURE);
3690   - }}
3691   - >
3692   - 采购审核
3693   - </Button>
3694   - ) : (
3695   - ''
3696   - )}
3697   -
3698   - {record.paths?.includes('applyAfterSales') ? (
3699   - <Button
3700   - className="p-0"
3701   - type="link"
3702   - onClick={() => {
3703   - let selectedSubOrders = subOrderSelectedMap.get(
3704   - record.id,
3705   - );
3706   - if (selectedSubOrders === undefined) {
3707   - selectedSubOrders = record.subOrderInformationLists;
3708   - }
3709   - setSelectedRows(selectedSubOrders);
3710   - for (let i = 0; i < selectedSubOrders.length; i++) {
3711   - if (
3712   - selectedSubOrders[i].orderStatus !==
3713   - 'CONFIRM_RECEIPT' &&
3714   - selectedSubOrders[i].orderStatus !==
3715   - 'AFTER_SALES_FAILURE'
3716   - ) {
3717   - message.error('请选择确认收货状态的子订单进行售后');
3718   - return;
3719   - }
3720   - }
3721   -
3722   - createOptObject(null, record.id);
3723   - setOrderDrawerVisible(true);
3724   - setOrderOptType('after-sales');
3725   - }}
3726   - >
3727   - 申请售后
3728   - </Button>
3729   - ) : (
3730   - ''
3731   - )}
3732   -
3733   - {/* {record.paths?.includes('afterSalesCompletion') ? (
3734   - <ButtonConfirm
3735   - className="p-0"
3736   - title="售后是否已完成?"
3737   - text="完成售后"
3738   - onConfirm={async () => {
3739   - let selectedSubOrders = subOrderSelectedMap.get(record.id);
3740   - if (selectedSubOrders === undefined) {
3741   - selectedSubOrders = record.subOrderInformationLists;
3742   - }
3743   - for (let i = 0; i < selectedSubOrders.length; i++) {
3744   - if (
3745   - selectedSubOrders[i].orderStatus !==
3746   - 'IN_AFTER_SALES'
3747   - ) {
3748   - message.error(
3749   - '请选择售后中状态的子订单进行完成售后',
3750   - );
3751   - return false;
3752   - }
3753   - }
3754   -
3755   - const ids = selectedSubOrders?.map((item) => {
3756   - return item.id;
3757   - });
3758   -
3759   - let body = {
3760   - ids: ids,
3761   - };
3762   - const data = await postServiceOrderAfterSalesCompletion(
3763   - {
3764   - data: body,
3765   - },
3766   - );
3767   - if (data.result === RESPONSE_CODE.SUCCESS) {
3768   - message.success(data.message);
3769   - refreshTable();
3770   - }
3771   - }}
3772   - />
3773   - ) : (
3774   - ''
3775   - )} */}
3776   -
3777   - {record.paths?.includes('salOrderSave') ? (
3778   - <ButtonConfirm
3779   - className="p-0"
3780   - title="是否推送至金蝶ERP?"
3781   - text="推送ERP"
3782   - onConfirm={async () => {
3783   - let res = await postKingdeeRepSalOrderSave({
3784   - data: {
3785   - id: record.id,
3786   - },
3787   - });
3788   -
3789   - if (res && res.result === RESPONSE_CODE.SUCCESS) {
3790   - message.success('推送成功');
3791   - mainTableRef.current.reload();
3792   - }
3793   - }}
3794   - />
3795   - ) : (
3796   - ''
3797   - )}
3798   -
3799   - {record.paths?.includes('salBillOutbound') ? (
3800   - <ButtonConfirm
3801   - className="p-0"
3802   - title="是否下推金蝶ERP出库单?"
3803   - text="下推出库"
3804   - onConfirm={async () => {
3805   - let res = await postKingdeeRepSalBillOutbound({
3806   - data: {
3807   - id: record.id,
3808   - },
3809   - });
3810   -
3811   - if (res && res.result === RESPONSE_CODE.SUCCESS) {
3812   - message.success('下推成功');
3813   - mainTableRef.current.reload();
3814   - }
3815   - }}
3816   - />
3817   - ) : (
3818   - ''
3819   - )}
3820   -
3821   - {record.paths?.includes('orderCancel') ? (
3822   - <ButtonConfirm
3823   - className="p-0"
3824   - title="确认作废?"
3825   - text="作废"
3826   - onConfirm={async () => {
3827   - let body = {
3828   - ids: [record.id],
3829   - checkIsMainOrderId: true,
3830   - };
3831   - const data = await postServiceOrderOrderCancel({
3832   - data: body,
3833   - });
3834   - if (data.result === RESPONSE_CODE.SUCCESS) {
3835   - message.success(data.message);
3836   - refreshTable();
3837   - }
3838   - }}
3839   - />
3840   - ) : (
3841   - ''
3842   - )}
3843   -
3844   - {record.paths?.includes('procurePrint') ? (
3845   - <ButtonConfirm
3846   - className="p-0"
3847   - title="确认打印?"
3848   - text="采购打印"
3849   - onConfirm={async () => {
3850   - let selectedSubOrders = subOrderSelectedMap.get(
3851   - record.id,
3852   - );
3853   - if (selectedSubOrders === undefined) {
3854   - selectedSubOrders = record.subOrderInformationLists;
3855   - }
3856   - for (let i = 0; i < selectedSubOrders.length; i++) {
3857   - if (
3858   - selectedSubOrders[i].orderStatus !==
3859   - 'PROCURE_PROCESS_FOR_MINE'
3860   - ) {
3861   - message.error(
3862   - '请选择采购待打印状态的子订单进行打印',
3863   - );
3864   - return false;
3865   - }
3866   - }
3867   -
3868   - const ids = selectedSubOrders?.map((item) => {
3869   - return item.id;
3870   - });
3871   - let res = await postServiceOrderProcurePrint({
3872   - data: {
3873   - ids: ids,
3874   - },
3875   - });
3876   -
3877   - if (res.result === RESPONSE_CODE.SUCCESS) {
3878   - message.success(res.message);
3879   - refreshTable();
3880   - }
3881   - }}
3882   - />
3883   - ) : (
3884   - // <Button
3885   - // className="p-0"
3886   - // type="link"
3887   - // onClick={() => {
3888   - // if (!subOrderSelectedMap.get(record.id)?.length) {
3889   - // return message.error('请选择选择子订单');
3890   - // }
3891   - // setSelectedRows(subOrderSelectedMap.get(record.id));
3892   - // setOrderRow(record);
3893   - // setOrderPrintVisible(true);
3894   - // setOrderCheckType(CHECK_TYPE.PROCURE);
3895   - // }}
3896   - // >
3897   - // 采购打印
3898   - // </Button>
3899   - ''
3900   - )}
3901   - </Space>
3902   - </Space.Compact>
3903   - </Flex>
3904   - </Flex>
3905   - </Flex>
3906   -
3907   - <Flex className="p-0 pb-[24px] pt-[4px] pl-[23px] pr-[5px] bg-white rounded-b-lg">
3908   - {expandedRowRender(record)}
3909   - </Flex>
3910   - </Flex>
3911   - );
3912   - };
3913   -
3914   - // 主订单列表
3915   - const mainOrdersColumns: ProColumns<OrderType>[] = MAIN_ORDER_COLUMNS.map(
3916   - (item) => {
3917   - //首能账号只能搜索订单编号
3918   - let canSearchIndex = [
3919   - 'id',
3920   - 'salesCode',
3921   - 'subNotes',
3922   - 'orderStatus',
3923   - 'createTime',
3924   - 'modifiedAuditStatus',
3925   - ];
3926   - if (isSupplier() && !canSearchIndex.includes(item.dataIndex)) {
3927   - item.search = false;
3928   - }
3929   -
3930   - canSearchIndex = [
3931   - 'id',
3932   - 'salesCode',
3933   - 'customerName',
3934   - 'institution',
3935   - 'productName',
3936   - 'orderStatus',
3937   - 'createTime',
3938   - ];
3939   -
3940   - if (isExaminer() && !canSearchIndex.includes(item.dataIndex)) {
3941   - item.search = false;
3942   - }
3943   -
3944   - if (item.dataIndex === 'name') {
3945   - return {
3946   - ...item,
3947   - title: <OrderTableHeader />,
3948   - render: (text, record) => {
3949   - return <MainOrderColumnRender record={record} />;
3950   - },
3951   - };
3952   - }
3953   -
3954   - /**
3955   - * 采购的订单状态筛选内容
3956   - */
3957   - if (roleCode === 'procure' && item.dataIndex === 'orderStatus') {
3958   - item.valueEnum = enumToProTableEnumValue(
3959   - PROCURE_PRIMARY_ORDER_STATUS_OPTIONS,
3960   - );
3961   - }
3962   - return item;
3963   - },
3964   - );
3965   -
3966   - /**
3967   - * 采购可以筛选供应商备注
3968   - */
3969   - if ((roleCode === 'procure' || roleCode === 'admin') && !isSupplier()) {
3970   - mainOrdersColumns.push({
3971   - title: '供应商备注',
3972   - width: 120,
3973   - dataIndex: 'supplierNotes',
3974   - valueType: 'text',
3975   - hideInTable: true,
3976   - });
3977   - }
3978   -
3979   - /**
3980   - * 采购可以筛选其他采购
3981   - */
3982   - if ((roleCode === 'procure' || roleCode === 'admin') && !isSupplier()) {
3983   - mainOrdersColumns.push({
3984   - title: '采购名称',
3985   - width: 120,
3986   - dataIndex: 'supplierName',
3987   - valueType: 'select',
3988   - request: async () => {
3989   - const res = await postServiceOrderProvideProcurementRoles();
3990   - let options = res.data?.map((item) => {
3991   - return { label: item, value: item };
3992   - });
3993   - return options;
3994   - },
3995   - hideInTable: true,
3996   - });
3997   - }
3998   -
3999   - /**
4000   - * 排除采购
4001   - */
4002   - if ((roleCode === 'procure' || roleCode === 'admin') && !isSupplier()) {
4003   - mainOrdersColumns.push({
4004   - title: '采购排除',
4005   - width: 120,
4006   - dataIndex: 'excludeProcureNames',
4007   - fieldProps: {
4008   - mode: 'multiple',
4009   - },
4010   - valueType: 'select',
4011   - request: async () => {
4012   - const res = await postServiceOrderProvideProcurementRoles();
4013   - let options = res.data?.map((item) => {
4014   - return { label: item, value: item };
4015   - });
4016   - return options;
4017   - },
4018   - hideInTable: true,
4019   - });
4020   - }
4021   -
4022   - /**
4023   - * 仓库可以筛选发货仓库
4024   - */
4025   - if (roleCode === 'warehouseKeeper' || roleCode === 'admin') {
4026   - mainOrdersColumns.push({
4027   - title: '发货仓库',
4028   - width: 120,
4029   - dataIndex: 'shippingWarehouse',
4030   - valueType: 'select',
4031   - valueEnum: enumToProTableEnumValue(SHIPPING_WAREHOUSE_OPTIONS),
4032   - hideInTable: true,
4033   - });
4034   - }
4035   -
4036   - //判断是否是采购,是的话新增一个筛选条件
4037   - if (roleCode === 'procure' || roleCode === 'admin') {
4038   - mainOrdersColumns.push({
4039   - title: isSupplier() ? '下单状态' : '采购下单状态',
4040   - dataIndex: 'procureOrderStatus',
4041   - valueType: 'select',
4042   - hideInTable: true,
4043   - valueEnum: enumToProTableEnumValue(PROCURE_ORDER_STATUS),
4044   - });
4045   - }
4046   -
4047   - //选择天数1
4048   - const options1 = [
4049   - {
4050   - label: '超过15天',
4051   - value: 15,
4052   - },
4053   - {
4054   - label: '超过25天',
4055   - value: 25,
4056   - },
4057   - ];
4058   - //选择天数
4059   - const [calDate, setCalDate] = useState<string | null>(null);
4060   - const [value1, setValue1] = useState();
4061   - const radioOnChange1 = ({ target: { value } }) => {
4062   - console.log('radio1 checked5656', value);
4063   - const currentDate = new Date();
4064   -
4065   - // 创建一个新的日期对象,并在当前日期的基础上加上 daysToAdd 天
4066   - const newDate = new Date(currentDate);
4067   - newDate.setDate(currentDate.getDate() + value);
4068   - const formattedDate = format(newDate, 'yyyy-MM-dd HH:mm:ss');
4069   - console.log(formattedDate, '5656newdate');
4070   - setCalDate(formattedDate);
4071   - setValue1(value);
4072   - };
4073   - //选择天数2
4074   - const options2 = [
4075   - {
4076   - label: '超过15天',
4077   - value: 15,
4078   - },
4079   - {
4080   - label: '超过25天',
4081   - value: 25,
4082   - },
4083   - ];
4084   - const [value2, setValue2] = useState();
4085   - const radioOnChange2 = ({ target: { value } }) => {
4086   - console.log('radio2 checked5656', value);
4087   - setValue2(value);
4088   - };
4089   - const confirmInvoice = () => {
4090   - console.log('5656confirm');
4091   - };
4092   - const [invoiceWarningNum, setInvoiceWarningNum] = useState(1);
4093   - const [invoiceRefundWarningNum, setInvoiceRefundWarningNum] = useState(1);
4094   - async function getInvoiceWarningNum() {
4095   - const res = await postServiceOrderWarningOrderStatistics();
4096   - setInvoiceWarningNum(res.data.waitConfirmInvoice);
4097   - setInvoiceRefundWarningNum(res.data.waitConfirmReceipt);
4098   - }
4099   -
4100   - useEffect(() => {
4101   - //预警订单数
4102   - getInvoiceWarningNum();
4103   - }, []);
4104   - const tabsItems = [
4105   - {
4106   - key: 1,
4107   - label: (
4108   - <span>
4109   - 发票确认预警
4110   - <Badge count={invoiceWarningNum} style={{ marginLeft: 8 }} />
4111   - </span>
4112   - ),
4113   - children: (
4114   - <div>
4115   - <div style={{ position: 'relative' }}>
4116   - <Radio.Group
4117   - options={options1}
4118   - onChange={radioOnChange1}
4119   - value={value1}
4120   - />
4121   - <Button
4122   - size="large"
4123   - type="primary"
4124   - onClick={confirmInvoice}
4125   - style={{ position: 'absolute', right: '20px' }}
4126   - >
4127   - 确认开票
4128   - </Button>
4129   - </div>
4130   - <div style={{ height: '25px' }}></div>
4131   - <ProTable
4132   - id="main-table"
4133   - // tableStyle={{backgroundColor:'red'}}
4134   -
4135   - actionRef={mainTableRef}
4136   - formRef={mainTableFormRef}
4137   - expandIconColumnIndex={-1}
4138   - columns={mainOrdersColumns}
4139   - rowKey="id"
4140   - pagination={{
4141   - showQuickJumper: true,
4142   - pageSize: pageSize,
4143   - current: currentPage,
4144   - showSizeChanger: true,
4145   - onChange: (page, size) => {
4146   - setPageSize(size);
4147   - setCurrentPage(page);
4148   - },
4149   - showTotal: (total, range) => {
4150   - return (
4151   - <>
4152   - <span>
4153   - {'第 ' +
4154   - range[0] +
4155   - '-' +
4156   - range[1] +
4157   - ' 条/总共 ' +
4158   - total +
4159   - ' 条主订单 '}
4160   - </span>
4161   - <span className="text-[#8C8C8C]">
4162   - {' (' + subOrderCount + ' 条子订单)'}
4163   - </span>
4164   - </>
4165   - );
4166   - },
4167   - }}
4168   - // showHeader={false}
4169   - expandedRowKeys={expandedRowKeys}
4170   - // expandable={{ expandedRowRender }}
4171   - dateFormatter="string"
4172   - options={false}
4173   - headerTitle=""
4174   - search={false}
4175   - // labelWidth: 'auto',
4176   - // onCollapse: resize,
4177   - request={async (
4178   - // 第一个参数 params 查询表单和 params 参数的结合
4179   - // 第一个参数中一定会有 pageSize 和 current ,这两个参数是 antd 的规范
4180   - params,
4181   - sorter,
4182   - filter,
4183   - ) => {
4184   - //订单id处理
4185   - /**
4186   - * 以params中的id为主,如果params没id,则取url中的id
4187   - * 第一次进来这个页面,url带有id的话,会自动填充到查询表单中,但是第一次查询params不会带这个id进来
4188   - */
4189   - let orderIds = mainTableFormRef.current?.getFieldValue('id');
4190   - let subOrderId =
4191   - mainTableFormRef.current?.getFieldValue('subOrderId');
4192   - params.id = params.id || orderIds;
4193   - params.subOrderId = params.subOrderId || subOrderId;
4194   - if (params.id !== '') {
4195   - params.id = params.id?.replace(/ /g, '');
4196   - if (params.id?.indexOf(',')) {
4197   - params.id = params.id.split(',');
4198   - params.id = params.id.filter((id) => {
4199   - return id !== '';
4200   - });
4201   - }
4202   - }
4203   -
4204   - params.condition = filterCondifion;
4205   -
4206   - //排序
4207   - params.sorted = sorted;
4208   - //是否只查看已作废
4209   - params.isDeleteQueryOrder = filterCondifion === 70;
4210   - //保存这个搜索条件
4211   - params.orderStatus = 'CONFIRM_RECEIPT';
4212   - params.invoicingStatus = 'UN_INVOICE';
4213   - params.statusDatetimeGe = calDate;
4214   - console.log(params, '5656finalparams');
4215   - setSearchParam(params);
4216   - //订单标记1
4217   - const { data } = await postServiceOrderQueryServiceOrder({
4218   - // ...params,
4219   - // FIXME: remove @ts-ignore
4220   - // @ts-ignore
4221   - sorter,
4222   - filter,
4223   - data: { ...params },
4224   - });
4225   -
4226   - setRolePath(data.specialPath);
4227   - setSubOrderCount(data.count);
4228   - setAllMainChecked(false);
4229   - setSelectedMainOrderKeys([]);
4230   - subOrderSelectedMap.clear();
4231   - mainOrderSelectedMap.clear();
4232   - setData(data?.data);
4233   -
4234   - //主订单id与子订单id的对照关系保存
4235   - mainOrderIdSubOrderIdRelationsMap.clear();
4236   - for (let row of data?.data) {
4237   - let mianOrderId = row.id;
4238   - let subOrderIds = row.subOrderInformationLists?.map((item) => {
4239   - //目前子订单存储的totalPayment不准确,这里重新处理取主订单的totalPayment
4240   - //totalPayment在财务开票计算金额时使用到
4241   - item.totalPayment = row.totalPayment;
4242   - return item.id;
4243   - });
4244   - mainOrderIdSubOrderIdRelationsMap.set(mianOrderId, subOrderIds);
4245   - }
4246   -
4247   - return {
4248   - data: data?.data || [],
4249   - total: data?.total || 0,
4250   - };
4251   - }}
4252   - toolbar={{
4253   - multipleLine: true,
4254   - }}
4255   - // toolBarRender={() => {
4256   - // return toolBarRender();
4257   - // }}
4258   - />
4259   -
4260   - {orderDrawerVisible && (
4261   - <OrderDrawer
4262   - data={orderOptType === 'add' ? {} : buildMainOrder()}
4263   - subOrders={orderOptType === 'add' ? [] : buildSubOrders()}
4264   - onClose={(isSuccess: boolean) => {
4265   - setOrderDrawerVisible(false);
4266   - clearOptObject();
4267   - if (isSuccess) {
4268   - refreshTable();
4269   - }
4270   - }}
4271   - orderOptType={orderOptType}
4272   - />
4273   - )}
4274   -
4275   - {checkVisible && (
4276   - <CheckModal
4277   - setCheckVisible={(val: boolean) => {
4278   - setCheckVisible(val);
4279   - if (!val) {
4280   - clearOptObject();
4281   - }
4282   - }}
4283   - data={isMainOrder ? getFirstMainOrder() : buildMainOrder()}
4284   - subOrders={
4285   - isMainOrder
4286   - ? [...subOrderSelectedMap.values()].flat()
4287   - : buildSubOrders()
4288   - }
4289   - orderCheckType={orderCheckType}
4290   - openOrderDrawer={(type: any, id: any) => {
4291   - setCurrentMainId(id);
4292   - setOrderOptType(type);
4293   - setOrderDrawerVisible(true);
4294   - }}
4295   - onClose={() => {
4296   - clearOptObject();
4297   - setCheckVisible(false);
4298   - refreshTable();
4299   - }}
4300   - />
4301   - )}
4302   -
4303   - {applyForInvoicingVisible && (
4304   - <ApplyForInvoicingModal
4305   - setCheckVisible={(val: boolean) => {
4306   - setApplyForInvoicingVisible(val);
4307   - if (!val) {
4308   - clearOptObject();
4309   - }
4310   - }}
4311   - subOrders={
4312   - isMainOrder
4313   - ? [...subOrderSelectedMap.values()].flat()
4314   - : buildSubOrders()
4315   - }
4316   - totalPayment={getApplyInvoicingTotalPayment()}
4317   - isMainOrder={isMainOrder}
4318   - isEdit={isEdit}
4319   - onClose={() => {
4320   - setApplyForInvoicingVisible(false);
4321   - setIsMainOrder(false);
4322   - clearOptObject();
4323   - refreshTable();
4324   - }}
4325   - />
4326   - )}
4327   -
4328   - {notesEditVisible && (
4329   - <OrderNotesEditModal
4330   - setNotesEditVisible={(val: boolean) => {
4331   - setNotesEditVisible(val);
4332   - if (!val) {
4333   - clearOptObject();
4334   - }
4335   - }}
4336   - ids={selectedRows}
4337   - notesType={notesType}
4338   - notes={notes}
4339   - onClose={() => {
4340   - setNotesEditVisible(false);
4341   - setSelectedRows([]);
4342   - setNotes(notes);
4343   - setNotesType(1);
4344   - refreshTable();
4345   - }}
4346   - />
4347   - )}
4348   -
4349   - {deliverVisible && (
4350   - <DeliverModal
4351   - data={buildSubOrders()}
4352   - isSendProduct={isSendProduct}
4353   - setVisible={(val: boolean) => {
4354   - setDeliverVisible(val);
4355   - if (!val) {
4356   - clearOptObject();
4357   - }
4358   - }}
4359   - sendType={orderCheckType}
4360   - onClose={() => {
4361   - clearOptObject();
4362   - setDeliverVisible(false);
4363   - setIsSendProduct(false);
4364   - refreshTable();
4365   - }}
4366   - />
4367   - )}
4368   -
4369   - {financialVisible && (
4370   - <FinancialDrawer
4371   - isEdit={isEdit}
4372   - mainOrder={isMainOrder ? getFirstMainOrder() : buildMainOrder()}
4373   - subOrders={
4374   - isMainOrder
4375   - ? [...subOrderSelectedMap.values()].flat()
4376   - : buildSubOrders()
4377   - }
4378   - isMainOrder={isMainOrder}
4379   - cancel={() => {
4380   - setFinancialVisible(false);
4381   - clearOptObject();
4382   - setIsMainOrder(false);
4383   - setIsEdit(false);
4384   - }}
4385   - onClose={() => {
4386   - setFinancialVisible(false);
4387   - clearOptObject();
4388   - refreshTable();
4389   - setIsMainOrder(false);
4390   - setIsEdit(false);
4391   - }}
4392   - />
4393   - )}
4394   -
4395   - {financialEditVisible && (
4396   - <FinancialEditDrawer
4397   - mainOrder={buildMainOrder()}
4398   - subOrders={buildSubOrders()}
4399   - isMainOrder={isMainOrder}
4400   - setVisible={() => {
4401   - setFinancialEditVisible(false);
4402   - clearOptObject();
4403   - }}
4404   - onClose={() => {
4405   - setFinancialEditVisible(false);
4406   - refreshTable();
4407   - setIsMainOrder(false);
4408   - clearOptObject();
4409   - }}
4410   - />
4411   - )}
4412   -
4413   - {orderPrintVisible && (
4414   - <OrderPrintModal
4415   - mainOrder={buildMainOrder()}
4416   - subOrders={buildSubOrders()}
4417   - isRePrint={isRePrintOrder}
4418   - setVisible={(val: boolean) => {
4419   - setOrderPrintVisible(val);
4420   - if (!val) {
4421   - clearOptObject();
4422   - }
4423   - }}
4424   - printOptType={orderCheckType}
4425   - onClose={() => {
4426   - setOrderPrintVisible(false);
4427   - clearOptObject();
4428   - setIsRePrintOrder(false);
4429   - refreshTable();
4430   - }}
4431   - />
4432   - )}
4433   -
4434   - {confirmReceiptVisible && (
4435   - <ConfirmReceiptModal
4436   - data={buildSubOrders()}
4437   - onClose={() => {
4438   - setConfirmReceiptVisible(false);
4439   - clearOptObject();
4440   - refreshTable();
4441   - }}
4442   - />
4443   - )}
4444   -
4445   - {imagesViewerModalVisible && (
4446   - <ImagesViewerModal
4447   - optType={imagesViewerOptType}
4448   - setVisible={(val: boolean) => {
4449   - setImagesViewerModalVisible(val);
4450   - if (!val) {
4451   - clearOptObject();
4452   - }
4453   - }}
4454   - onClose={() => {
4455   - setImagesViewerModalVisible(false);
4456   - }}
4457   - orderRow={buildSubOrders()[0]}
4458   - />
4459   - )}
4460   -
4461   - {importModalVisible && (
4462   - <ImportModal
4463   - onClose={() => {
4464   - setImportModalVisible(false);
4465   - refreshTable();
4466   - }}
4467   - />
4468   - )}
4469   -
4470   - {attachmentModalVisible && (
4471   - <AttachmentModal
4472   - data={buildSubOrders()[0]}
4473   - onClose={() => {
4474   - setAttachmentModalVisible(false);
4475   - clearOptObject();
4476   - }}
4477   - />
4478   - )}
4479   -
4480   - {historyModalVisible && (
4481   - <HistoryModal
4482   - subOrders={selectedRows}
4483   - isCancelledOrder={filterCondifion === 70}
4484   - onClose={() => {
4485   - setHistoryModalVisible(false);
4486   - setSelectedRows({});
4487   - clearOptObject();
4488   - }}
4489   - />
4490   - )}
4491   -
4492   - {deliverInfoDrawerVisible && (
4493   - <DeliverInfoDrawer
4494   - data={buildMainOrder()}
4495   - onClose={() => {
4496   - setDeliverInfoDrawerVisible(false);
4497   - clearOptObject();
4498   - }}
4499   - />
4500   - )}
4501   -
4502   - {deliverInfoDrawerVisible && (
4503   - <DeliverInfoDrawer
4504   - data={buildMainOrder()}
4505   - onClose={() => {
4506   - setDeliverInfoDrawerVisible(false);
4507   - clearOptObject();
4508   - }}
4509   - />
4510   - )}
4511   -
4512   - {procureCheckModalVisible && (
4513   - <ProcureCheckModal
4514   - setCheckVisible={(val: boolean) => {
4515   - setProcureCheckModalVisible(val);
4516   - if (!val) {
4517   - clearOptObject();
4518   - }
4519   - }}
4520   - isMainOrder={isMainOrder}
4521   - orders={
4522   - isMainOrder
4523   - ? [...subOrderSelectedMap.values()].flat()
4524   - : buildSubOrders()
4525   - }
4526   - onClose={() => {
4527   - setProcureCheckModalVisible(false);
4528   - clearOptObject();
4529   - setIsMainOrder(false);
4530   - refreshTable();
4531   - }}
4532   - />
4533   - )}
4534   -
4535   - {afterSalesDrawerVisible && (
4536   - <AfterSalesDrawer
4537   - setVisible={(val: boolean) => {
4538   - setAfterSalesDrawerVisible(val);
4539   - if (!val) {
4540   - clearOptObject();
4541   - }
4542   - }}
4543   - mainOrder={buildMainOrder()}
4544   - subOrders={buildSubOrders()}
4545   - onClose={() => {
4546   - setAfterSalesDrawerVisible(false);
4547   - clearOptObject();
4548   - refreshTable();
4549   - }}
4550   - />
4551   - )}
4552   -
4553   - {procureConvertModalVisible && (
4554   - <ProcureConvertModal
4555   - setVisible={(val: boolean) => {
4556   - setProcureConvertModalVisible(val);
4557   - if (!val) {
4558   - clearOptObject();
4559   - }
4560   - }}
4561   - subOrders={buildSubOrders()}
4562   - onClose={() => {
4563   - setProcureConvertModalVisible(false);
4564   - clearOptObject();
4565   - refreshTable();
4566   - }}
4567   - />
4568   - )}
4569   -
4570   - {financialMergeDrawerVisible && (
4571   - <FinancialMergeDrawer
4572   - setVisible={(val: boolean) => {
4573   - setFinancialMergeDrawerVisible(val);
4574   - if (!val) {
4575   - clearOptObject();
4576   - }
4577   - }}
4578   - dataList={
4579   - isMainOrder
4580   - ? [...subOrderSelectedMap.values()].flat()
4581   - : buildSubOrders()
4582   - }
4583   - onClose={() => {
4584   - setFinancialMergeDrawerVisible(false);
4585   - setIsMainOrder(false);
4586   - clearOptObject();
4587   - refreshTable();
4588   - }}
4589   - />
4590   - )}
4591   -
4592   - {financialReceiptsModalVisible && (
4593   - <FinancialReceiptsModal
4594   - setVisible={(val: boolean) => {
4595   - setFinancialReceiptsModalVisible(val);
4596   - if (!val) {
4597   - clearOptObject();
4598   - }
4599   - }}
4600   - datas={selectedRows}
4601   - onClose={() => {
4602   - setFinancialReceiptsModalVisible(false);
4603   - setSelectedRows({});
4604   - refreshTable();
4605   - }}
4606   - />
4607   - )}
4608   -
4609   - {shippingWarehouseChangeModalVisible && (
4610   - <ShippingWarehouseChangeModal
4611   - setVisible={(val: boolean) => {
4612   - setShippingWarehouseChangeModalVisible(val);
4613   - if (!val) {
4614   - clearOptObject();
4615   - }
4616   - }}
4617   - subOrderIds={ids}
4618   - originShippingWarehouse={buildSubOrders()[0].shippingWarehouse}
4619   - onClose={() => {
4620   - setShippingWarehouseChangeModalVisible(false);
4621   - clearOptObject();
4622   - setIds([]);
4623   - refreshTable();
4624   - }}
4625   - />
4626   - )}
4627   - {reissueVisible && (
4628   - <ReissueModal
4629   - setVisible={(val: boolean) => {
4630   - setReissueVisible(val);
4631   - if (!val) {
4632   - clearOptObject();
4633   - }
4634   - }}
4635   - subOrders={
4636   - isMainOrder
4637   - ? [...subOrderSelectedMap.values()].flat()
4638   - : buildSubOrders()
4639   - }
4640   - onClose={() => {
4641   - setReissueVisible(false);
4642   - clearOptObject();
4643   - refreshTable();
4644   - }}
4645   - />
4646   - )}
4647   - {reissueVisibleOld && (
4648   - <ReissueModal_old
4649   - setVisible={(val: boolean) => {
4650   - setReissueVisibleOld(val);
4651   - console.log(reissueVisible);
4652   - if (!val) {
4653   - clearOptObject();
4654   - }
4655   - }}
4656   - mainOrder={buildMainOrder()}
4657   - subOrders={buildSubOrders()}
4658   - onClose={() => {
4659   - setReissueVisibleOld(false);
4660   - clearOptObject();
4661   - refreshTable();
4662   - }}
4663   - />
4664   - )}
4665   - {productionTimeModalVisible && (
4666   - <ProductionTimeModal
4667   - setVisible={(val: boolean) => {
4668   - setProductionTimeModalVisible(val);
4669   - if (!val) {
4670   - clearOptObject();
4671   - }
4672   - }}
4673   - subOrders={buildSubOrders()}
4674   - onClose={() => {
4675   - setProductionTimeModalVisible(false);
4676   - clearOptObject();
4677   - refreshTable();
4678   - }}
4679   - />
4680   - )}
4681   -
4682   - {modifiedDiffModalVisible && (
4683   - <ModifiedDiffModal
4684   - setVisible={(val: boolean) => {
4685   - setModifiedDiffModalVisible(val);
4686   - if (!val) {
4687   - clearOptObject();
4688   - }
4689   - }}
4690   - subOrders={buildSubOrders()}
4691   - mainOrder={buildMainOrder()}
4692   - onClose={() => {
4693   - setModifiedDiffModalVisible(false);
4694   - clearOptObject();
4695   - }}
4696   - />
4697   - )}
4698   -
4699   - {uploadPayBillModalVisible && (
4700   - <UploadPayBillModal
4701   - setVisible={(val: boolean) => {
4702   - setUploadPayBillModalVisible(val);
4703   - if (!val) {
4704   - clearOptObject();
4705   - }
4706   - }}
4707   - subOrders={buildSubOrders()}
4708   - mainOrder={buildMainOrder()}
4709   - onClose={() => {
4710   - setUploadPayBillModalVisible(false);
4711   - clearOptObject();
4712   - refreshTable();
4713   - }}
4714   - />
4715   - )}
4716   - {invoicingDrawerFormVisible && (
4717   - <InvoicingDrawerForm
4718   - dataList={
4719   - isMainOrder
4720   - ? [...subOrderSelectedMap.values()].flat()
4721   - : buildSubOrders()
4722   - }
4723   - setVisible={(val: boolean) => {
4724   - setInvoicingDrawerFormVisible(val);
4725   - if (!val) {
4726   - clearOptObject();
4727   - }
4728   - }}
4729   - mainOrder={isMainOrder ? getFirstMainOrder() : buildMainOrder()}
4730   - onClose={() => {
4731   - setInvoicingDrawerFormVisible(false);
4732   - setIsMainOrder(true);
4733   - clearOptObject();
4734   - refreshTable();
4735   - }}
4736   - />
4737   - )}
4738   - {contextHolder}
4739   - <FloatButton.BackTop visibilityHeight={0} />
4740   - </div>
4741   - ),
4742   - },
4743   - {
4744   - key: 2,
4745   - label: (
4746   - <span>
4747   - 订单回款预警
4748   - <Badge count={invoiceRefundWarningNum} style={{ marginLeft: 8 }} />
4749   - </span>
4750   - ),
4751   - children: (
4752   - <div>
4753   - <Radio.Group
4754   - options={options2}
4755   - onChange={radioOnChange2}
4756   - value={value2}
4757   - />
4758   - <div style={{ height: '25px' }}></div>
4759   - <ProTable
4760   - id="main-table"
4761   - // tableStyle={{backgroundColor:'red'}}
4762   -
4763   - actionRef={mainTableRef}
4764   - formRef={mainTableFormRef}
4765   - expandIconColumnIndex={-1}
4766   - columns={mainOrdersColumns}
4767   - rowKey="id"
4768   - pagination={{
4769   - showQuickJumper: true,
4770   - pageSize: pageSize,
4771   - current: currentPage,
4772   - showSizeChanger: true,
4773   - onChange: (page, size) => {
4774   - setPageSize(size);
4775   - setCurrentPage(page);
4776   - },
4777   - showTotal: (total, range) => {
4778   - return (
4779   - <>
4780   - <span>
4781   - {'第 ' +
4782   - range[0] +
4783   - '-' +
4784   - range[1] +
4785   - ' 条/总共 ' +
4786   - total +
4787   - ' 条主订单 '}
4788   - </span>
4789   - <span className="text-[#8C8C8C]">
4790   - {' (' + subOrderCount + ' 条子订单)'}
4791   - </span>
4792   - </>
4793   - );
4794   - },
4795   - }}
4796   - // showHeader={false}
4797   - expandedRowKeys={expandedRowKeys}
4798   - // expandable={{ expandedRowRender }}
4799   - dateFormatter="string"
4800   - options={false}
4801   - headerTitle=""
4802   - search={false}
4803   - // labelWidth: 'auto',
4804   - // onCollapse: resize,
4805   - request={async (
4806   - // 第一个参数 params 查询表单和 params 参数的结合
4807   - // 第一个参数中一定会有 pageSize 和 current ,这两个参数是 antd 的规范
4808   - params,
4809   - sorter,
4810   - filter,
4811   - ) => {
4812   - params.orderStatus = 'CONFIRM_INVOICE';
4813   - console.log(params, '5656params');
4814   - //订单id处理
4815   - /**
4816   - * 以params中的id为主,如果params没id,则取url中的id
4817   - * 第一次进来这个页面,url带有id的话,会自动填充到查询表单中,但是第一次查询params不会带这个id进来
4818   - */
4819   - let orderIds = mainTableFormRef.current?.getFieldValue('id');
4820   - let subOrderId =
4821   - mainTableFormRef.current?.getFieldValue('subOrderId');
4822   - params.id = params.id || orderIds;
4823   - params.subOrderId = params.subOrderId || subOrderId;
4824   - if (params.id !== '') {
4825   - params.id = params.id?.replace(/ /g, '');
4826   - if (params.id?.indexOf(',')) {
4827   - params.id = params.id.split(',');
4828   - params.id = params.id.filter((id) => {
4829   - return id !== '';
4830   - });
4831   - }
4832   - }
4833   -
4834   - params.condition = filterCondifion;
4835   -
4836   - //排序
4837   - params.sorted = sorted;
4838   - //是否只查看已作废
4839   - params.isDeleteQueryOrder = filterCondifion === 70;
4840   - //保存这个搜索条件
4841   - setSearchParam(params);
4842   -
4843   - //订单标记2
4844   - const { data } = await postServiceOrderQueryServiceOrder({
4845   - // ...params,
4846   - // FIXME: remove @ts-ignore
4847   - // @ts-ignore
4848   - sorter,
4849   - filter,
4850   - data: { ...params },
4851   - });
4852   -
4853   - setRolePath(data.specialPath);
4854   - setSubOrderCount(data.count);
4855   - setAllMainChecked(false);
4856   - setSelectedMainOrderKeys([]);
4857   - subOrderSelectedMap.clear();
4858   - mainOrderSelectedMap.clear();
4859   - setData(data?.data);
4860   -
4861   - //主订单id与子订单id的对照关系保存
4862   - mainOrderIdSubOrderIdRelationsMap.clear();
4863   - for (let row of data?.data) {
4864   - let mianOrderId = row.id;
4865   - let subOrderIds = row.subOrderInformationLists?.map((item) => {
4866   - //目前子订单存储的totalPayment不准确,这里重新处理取主订单的totalPayment
4867   - //totalPayment在财务开票计算金额时使用到
4868   - item.totalPayment = row.totalPayment;
4869   - return item.id;
4870   - });
4871   - mainOrderIdSubOrderIdRelationsMap.set(mianOrderId, subOrderIds);
4872   - }
4873   -
4874   - return {
4875   - data: data?.data || [],
4876   - total: data?.total || 0,
4877   - };
4878   - }}
4879   - toolbar={{
4880   - multipleLine: true,
4881   - }}
4882   - // toolBarRender={() => {
4883   - // return toolBarRender();
4884   - // }}
4885   - />
4886   -
4887   - {orderDrawerVisible && (
4888   - <OrderDrawer
4889   - data={orderOptType === 'add' ? {} : buildMainOrder()}
4890   - subOrders={orderOptType === 'add' ? [] : buildSubOrders()}
4891   - onClose={(isSuccess: boolean) => {
4892   - setOrderDrawerVisible(false);
4893   - clearOptObject();
4894   - if (isSuccess) {
4895   - refreshTable();
4896   - }
4897   - }}
4898   - orderOptType={orderOptType}
4899   - />
4900   - )}
4901   -
4902   - {checkVisible && (
4903   - <CheckModal
4904   - setCheckVisible={(val: boolean) => {
4905   - setCheckVisible(val);
4906   - if (!val) {
4907   - clearOptObject();
4908   - }
4909   - }}
4910   - data={isMainOrder ? getFirstMainOrder() : buildMainOrder()}
4911   - subOrders={
4912   - isMainOrder
4913   - ? [...subOrderSelectedMap.values()].flat()
4914   - : buildSubOrders()
4915   - }
4916   - orderCheckType={orderCheckType}
4917   - openOrderDrawer={(type: any, id: any) => {
4918   - setCurrentMainId(id);
4919   - setOrderOptType(type);
4920   - setOrderDrawerVisible(true);
4921   - }}
4922   - onClose={() => {
4923   - clearOptObject();
4924   - setCheckVisible(false);
4925   - refreshTable();
4926   - }}
4927   - />
4928   - )}
4929   -
4930   - {applyForInvoicingVisible && (
4931   - <ApplyForInvoicingModal
4932   - setCheckVisible={(val: boolean) => {
4933   - setApplyForInvoicingVisible(val);
4934   - if (!val) {
4935   - clearOptObject();
4936   - }
4937   - }}
4938   - subOrders={
4939   - isMainOrder
4940   - ? [...subOrderSelectedMap.values()].flat()
4941   - : buildSubOrders()
4942   - }
4943   - totalPayment={getApplyInvoicingTotalPayment()}
4944   - isMainOrder={isMainOrder}
4945   - isEdit={isEdit}
4946   - onClose={() => {
4947   - setApplyForInvoicingVisible(false);
4948   - setIsMainOrder(false);
4949   - clearOptObject();
4950   - refreshTable();
4951   - }}
4952   - />
4953   - )}
4954   -
4955   - {notesEditVisible && (
4956   - <OrderNotesEditModal
4957   - setNotesEditVisible={(val: boolean) => {
4958   - setNotesEditVisible(val);
4959   - if (!val) {
4960   - clearOptObject();
4961   - }
4962   - }}
4963   - ids={selectedRows}
4964   - notesType={notesType}
4965   - notes={notes}
4966   - onClose={() => {
4967   - setNotesEditVisible(false);
4968   - setSelectedRows([]);
4969   - setNotes(notes);
4970   - setNotesType(1);
4971   - refreshTable();
4972   - }}
4973   - />
4974   - )}
4975   -
4976   - {deliverVisible && (
4977   - <DeliverModal
4978   - data={buildSubOrders()}
4979   - isSendProduct={isSendProduct}
4980   - setVisible={(val: boolean) => {
4981   - setDeliverVisible(val);
4982   - if (!val) {
4983   - clearOptObject();
4984   - }
4985   - }}
4986   - sendType={orderCheckType}
4987   - onClose={() => {
4988   - clearOptObject();
4989   - setDeliverVisible(false);
4990   - setIsSendProduct(false);
4991   - refreshTable();
4992   - }}
4993   - />
4994   - )}
4995   -
4996   - {financialVisible && (
4997   - <FinancialDrawer
4998   - isEdit={isEdit}
4999   - mainOrder={isMainOrder ? getFirstMainOrder() : buildMainOrder()}
5000   - subOrders={
5001   - isMainOrder
5002   - ? [...subOrderSelectedMap.values()].flat()
5003   - : buildSubOrders()
5004   - }
5005   - isMainOrder={isMainOrder}
5006   - cancel={() => {
5007   - setFinancialVisible(false);
5008   - clearOptObject();
5009   - setIsMainOrder(false);
5010   - setIsEdit(false);
5011   - }}
5012   - onClose={() => {
5013   - setFinancialVisible(false);
5014   - clearOptObject();
5015   - refreshTable();
5016   - setIsMainOrder(false);
5017   - setIsEdit(false);
5018   - }}
5019   - />
5020   - )}
5021   -
5022   - {financialEditVisible && (
5023   - <FinancialEditDrawer
5024   - mainOrder={buildMainOrder()}
5025   - subOrders={buildSubOrders()}
5026   - isMainOrder={isMainOrder}
5027   - setVisible={() => {
5028   - setFinancialEditVisible(false);
5029   - clearOptObject();
5030   - }}
5031   - onClose={() => {
5032   - setFinancialEditVisible(false);
5033   - refreshTable();
5034   - setIsMainOrder(false);
5035   - clearOptObject();
5036   - }}
5037   - />
5038   - )}
5039   -
5040   - {orderPrintVisible && (
5041   - <OrderPrintModal
5042   - mainOrder={buildMainOrder()}
5043   - subOrders={buildSubOrders()}
5044   - isRePrint={isRePrintOrder}
5045   - setVisible={(val: boolean) => {
5046   - setOrderPrintVisible(val);
5047   - if (!val) {
5048   - clearOptObject();
5049   - }
5050   - }}
5051   - printOptType={orderCheckType}
5052   - onClose={() => {
5053   - setOrderPrintVisible(false);
5054   - clearOptObject();
5055   - setIsRePrintOrder(false);
5056   - refreshTable();
5057   - }}
5058   - />
5059   - )}
5060   -
5061   - {confirmReceiptVisible && (
5062   - <ConfirmReceiptModal
5063   - data={buildSubOrders()}
5064   - onClose={() => {
5065   - setConfirmReceiptVisible(false);
5066   - clearOptObject();
5067   - refreshTable();
5068   - }}
5069   - />
5070   - )}
5071   -
5072   - {imagesViewerModalVisible && (
5073   - <ImagesViewerModal
5074   - optType={imagesViewerOptType}
5075   - setVisible={(val: boolean) => {
5076   - setImagesViewerModalVisible(val);
5077   - if (!val) {
5078   - clearOptObject();
5079   - }
5080   - }}
5081   - onClose={() => {
5082   - setImagesViewerModalVisible(false);
5083   - }}
5084   - orderRow={buildSubOrders()[0]}
5085   - />
5086   - )}
5087   -
5088   - {importModalVisible && (
5089   - <ImportModal
5090   - onClose={() => {
5091   - setImportModalVisible(false);
5092   - refreshTable();
5093   - }}
5094   - />
5095   - )}
5096   -
5097   - {attachmentModalVisible && (
5098   - <AttachmentModal
5099   - data={buildSubOrders()[0]}
5100   - onClose={() => {
5101   - setAttachmentModalVisible(false);
5102   - clearOptObject();
5103   - }}
5104   - />
5105   - )}
5106   -
5107   - {historyModalVisible && (
5108   - <HistoryModal
5109   - subOrders={selectedRows}
5110   - isCancelledOrder={filterCondifion === 70}
5111   - onClose={() => {
5112   - setHistoryModalVisible(false);
5113   - setSelectedRows({});
5114   - clearOptObject();
5115   - }}
5116   - />
5117   - )}
5118   -
5119   - {deliverInfoDrawerVisible && (
5120   - <DeliverInfoDrawer
5121   - data={buildMainOrder()}
5122   - onClose={() => {
5123   - setDeliverInfoDrawerVisible(false);
5124   - clearOptObject();
5125   - }}
5126   - />
5127   - )}
5128   -
5129   - {deliverInfoDrawerVisible && (
5130   - <DeliverInfoDrawer
5131   - data={buildMainOrder()}
5132   - onClose={() => {
5133   - setDeliverInfoDrawerVisible(false);
5134   - clearOptObject();
5135   - }}
5136   - />
5137   - )}
5138   -
5139   - {procureCheckModalVisible && (
5140   - <ProcureCheckModal
5141   - setCheckVisible={(val: boolean) => {
5142   - setProcureCheckModalVisible(val);
5143   - if (!val) {
5144   - clearOptObject();
5145   - }
5146   - }}
5147   - isMainOrder={isMainOrder}
5148   - orders={
5149   - isMainOrder
5150   - ? [...subOrderSelectedMap.values()].flat()
5151   - : buildSubOrders()
5152   - }
5153   - onClose={() => {
5154   - setProcureCheckModalVisible(false);
5155   - clearOptObject();
5156   - setIsMainOrder(false);
5157   - refreshTable();
5158   - }}
5159   - />
5160   - )}
5161   -
5162   - {afterSalesDrawerVisible && (
5163   - <AfterSalesDrawer
5164   - setVisible={(val: boolean) => {
5165   - setAfterSalesDrawerVisible(val);
5166   - if (!val) {
5167   - clearOptObject();
5168   - }
5169   - }}
5170   - mainOrder={buildMainOrder()}
5171   - subOrders={buildSubOrders()}
5172   - onClose={() => {
5173   - setAfterSalesDrawerVisible(false);
5174   - clearOptObject();
5175   - refreshTable();
5176   - }}
5177   - />
5178   - )}
5179   -
5180   - {procureConvertModalVisible && (
5181   - <ProcureConvertModal
5182   - setVisible={(val: boolean) => {
5183   - setProcureConvertModalVisible(val);
5184   - if (!val) {
5185   - clearOptObject();
5186   - }
5187   - }}
5188   - subOrders={buildSubOrders()}
5189   - onClose={() => {
5190   - setProcureConvertModalVisible(false);
5191   - clearOptObject();
5192   - refreshTable();
5193   - }}
5194   - />
5195   - )}
5196   -
5197   - {financialMergeDrawerVisible && (
5198   - <FinancialMergeDrawer
5199   - setVisible={(val: boolean) => {
5200   - setFinancialMergeDrawerVisible(val);
5201   - if (!val) {
5202   - clearOptObject();
5203   - }
5204   - }}
5205   - dataList={
5206   - isMainOrder
5207   - ? [...subOrderSelectedMap.values()].flat()
5208   - : buildSubOrders()
5209   - }
5210   - onClose={() => {
5211   - setFinancialMergeDrawerVisible(false);
5212   - setIsMainOrder(false);
5213   - clearOptObject();
5214   - refreshTable();
5215   - }}
5216   - />
5217   - )}
5218   -
5219   - {financialReceiptsModalVisible && (
5220   - <FinancialReceiptsModal
5221   - setVisible={(val: boolean) => {
5222   - setFinancialReceiptsModalVisible(val);
5223   - if (!val) {
5224   - clearOptObject();
5225   - }
5226   - }}
5227   - datas={selectedRows}
5228   - onClose={() => {
5229   - setFinancialReceiptsModalVisible(false);
5230   - setSelectedRows({});
5231   - refreshTable();
5232   - }}
5233   - />
5234   - )}
5235   -
5236   - {shippingWarehouseChangeModalVisible && (
5237   - <ShippingWarehouseChangeModal
5238   - setVisible={(val: boolean) => {
5239   - setShippingWarehouseChangeModalVisible(val);
5240   - if (!val) {
5241   - clearOptObject();
5242   - }
5243   - }}
5244   - subOrderIds={ids}
5245   - originShippingWarehouse={buildSubOrders()[0].shippingWarehouse}
5246   - onClose={() => {
5247   - setShippingWarehouseChangeModalVisible(false);
5248   - clearOptObject();
5249   - setIds([]);
5250   - refreshTable();
5251   - }}
5252   - />
5253   - )}
5254   - {reissueVisible && (
5255   - <ReissueModal
5256   - setVisible={(val: boolean) => {
5257   - setReissueVisible(val);
5258   - if (!val) {
5259   - clearOptObject();
5260   - }
5261   - }}
5262   - subOrders={
5263   - isMainOrder
5264   - ? [...subOrderSelectedMap.values()].flat()
5265   - : buildSubOrders()
5266   - }
5267   - onClose={() => {
5268   - setReissueVisible(false);
5269   - clearOptObject();
5270   - refreshTable();
5271   - }}
5272   - />
5273   - )}
5274   - {reissueVisibleOld && (
5275   - <ReissueModal_old
5276   - setVisible={(val: boolean) => {
5277   - setReissueVisibleOld(val);
5278   - console.log(reissueVisible);
5279   - if (!val) {
5280   - clearOptObject();
5281   - }
5282   - }}
5283   - mainOrder={buildMainOrder()}
5284   - subOrders={buildSubOrders()}
5285   - onClose={() => {
5286   - setReissueVisibleOld(false);
5287   - clearOptObject();
5288   - refreshTable();
5289   - }}
5290   - />
5291   - )}
5292   - {productionTimeModalVisible && (
5293   - <ProductionTimeModal
5294   - setVisible={(val: boolean) => {
5295   - setProductionTimeModalVisible(val);
5296   - if (!val) {
5297   - clearOptObject();
5298   - }
5299   - }}
5300   - subOrders={buildSubOrders()}
5301   - onClose={() => {
5302   - setProductionTimeModalVisible(false);
5303   - clearOptObject();
5304   - refreshTable();
5305   - }}
5306   - />
5307   - )}
5308   -
5309   - {modifiedDiffModalVisible && (
5310   - <ModifiedDiffModal
5311   - setVisible={(val: boolean) => {
5312   - setModifiedDiffModalVisible(val);
5313   - if (!val) {
5314   - clearOptObject();
5315   - }
5316   - }}
5317   - subOrders={buildSubOrders()}
5318   - mainOrder={buildMainOrder()}
5319   - onClose={() => {
5320   - setModifiedDiffModalVisible(false);
5321   - clearOptObject();
5322   - }}
5323   - />
5324   - )}
5325   -
5326   - {uploadPayBillModalVisible && (
5327   - <UploadPayBillModal
5328   - setVisible={(val: boolean) => {
5329   - setUploadPayBillModalVisible(val);
5330   - if (!val) {
5331   - clearOptObject();
5332   - }
5333   - }}
5334   - subOrders={buildSubOrders()}
5335   - mainOrder={buildMainOrder()}
5336   - onClose={() => {
5337   - setUploadPayBillModalVisible(false);
5338   - clearOptObject();
5339   - refreshTable();
5340   - }}
5341   - />
5342   - )}
5343   - {invoicingDrawerFormVisible && (
5344   - <InvoicingDrawerForm
5345   - dataList={
5346   - isMainOrder
5347   - ? [...subOrderSelectedMap.values()].flat()
5348   - : buildSubOrders()
5349   - }
5350   - setVisible={(val: boolean) => {
5351   - setInvoicingDrawerFormVisible(val);
5352   - if (!val) {
5353   - clearOptObject();
5354   - }
5355   - }}
5356   - mainOrder={isMainOrder ? getFirstMainOrder() : buildMainOrder()}
5357   - onClose={() => {
5358   - setInvoicingDrawerFormVisible(false);
5359   - setIsMainOrder(true);
5360   - clearOptObject();
5361   - refreshTable();
5362   - }}
5363   - />
5364   - )}
5365   - {contextHolder}
5366   - <FloatButton.BackTop visibilityHeight={0} />
5367   - </div>
5368   - ),
5369   - },
5370   - ];
5371   - const [open, setOpen] = useState(true);
5372   - //隐藏弹窗
5373   - const hideModal = () => {
5374   - setOpen(false);
5375   - };
5376   - return (
5377   - <div className="order-page-container">
5378   - <div id="resizeDiv"></div>
5379   - <Modal
5380   - title="订单预警提醒"
5381   - open={open}
5382   - width={800}
5383   - closable={false}
5384   - footer={[
5385   - <Button key="confirm" size="large" type="primary" onClick={hideModal}>
5386   - 去处理
5387   - </Button>,
5388   - ]}
5389   - >
5390   - <Row
5391   - gutter={16}
5392   - justify="space-between" // Aligns Cols to the start and end
5393   - align="middle" // Vertically center contents
5394   - >
5395   - <Col span={12}>
5396   - <div
5397   - style={{
5398   - display: 'flex',
5399   - justifyContent: 'center',
5400   - marginTop: '20px',
5401   - }}
5402   - >
5403   - <Card
5404   - bordered={true}
5405   - style={{
5406   - backgroundColor: '#f0f0f0', // 背景颜色
5407   - width: '200px', // 卡片宽度
5408   - height: '200px', // 卡片高度
5409   - display: 'flex',
5410   - alignItems: 'center',
5411   - justifyContent: 'center',
5412   - }}
5413   - >
5414   - <div
5415   - style={{
5416   - fontWeight: 'bold', // 字体加粗
5417   - color: 'black', // 字体颜色
5418   - fontSize: '20px', // 字体大小
5419   - }}
5420   - >
5421   - <div
5422   - style={{
5423   - fontWeight: 'bold', // 字体加粗
5424   - color: 'black', // 字体颜色
5425   - fontSize: '40px', // 字体大小
5426   - justifyContent: 'center',
5427   - display: 'flex',
5428   - alignItems: 'center',
5429   - marginBottom: '20px',
5430   - }}
5431   - >
5432   - {invoiceWarningNum}
5433   - </div>
5434   - 发票待确认订单
5435   - </div>
5436   - </Card>
5437   - </div>
5438   - </Col>
5439   - <Col span={12}>
5440   - <div
5441   - style={{
5442   - display: 'flex',
5443   - justifyContent: 'center',
5444   - marginTop: '20px',
5445   - }}
5446   - >
5447   - <Card
5448   - bordered={true}
5449   - style={{
5450   - backgroundColor: '#f0f0f0', // 背景颜色
5451   - width: '200px', // 卡片宽度
5452   - height: '200px', // 卡片高度
5453   - display: 'flex',
5454   - alignItems: 'center',
5455   - justifyContent: 'center',
5456   - }}
5457   - >
5458   - <div
5459   - style={{
5460   - fontWeight: 'bold', // 字体加粗
5461   - color: 'black', // 字体颜色
5462   - fontSize: '20px', // 字体大小
5463   - }}
5464   - >
5465   - <div
5466   - style={{
5467   - fontWeight: 'bold', // 字体加粗
5468   - color: 'black', // 字体颜色
5469   - fontSize: '40px', // 字体大小
5470   - justifyContent: 'center',
5471   - display: 'flex',
5472   - alignItems: 'center',
5473   - marginBottom: '20px',
5474   - }}
5475   - >
5476   - {invoiceRefundWarningNum}
5477   - </div>
5478   - 回款待确认订单
5479   - </div>
5480   - </Card>
5481   - </div>
5482   - </Col>
5483   - </Row>
5484   - <div style={{ color: 'red', padding: '40px' }}>
5485   - <p>预警说明:</p>
5486   - <p>
5487   - 1、从订单确认收货之日起,超过5天未和客户确认发票(不开票的订单除外)的订单将会进行第一次提醒;超过15天未和客户确认发票(不开票的订单除外)的订单将会每天进行一次提醒,并限制下单功能
5488   - </p>
5489   - <p>
5490   - 2、从发票确认之日起,超过15天未确认回款的订单将会进行第一次提醒,超过25天未确认回款的订单将会每天进行一次提醒,并限制下单功能
5491   - </p>
5492   - </div>
5493   - </Modal>
5494   - <Tabs
5495   - defaultActiveKey="1"
5496   - items={tabsItems}
5497   - onChange={(value) => {
5498   - console.log(value, '5656');
5499   - }}
5500   - />
5501   - </div>
5502   - );
5503   -};
5504   -// //选择天数1
5505   -// const options1 = [
5506   -// {
5507   -// label: '超过5天',
5508   -// value: '1',
5509   -// },
5510   -// {
5511   -// label: '超过15天',
5512   -// value: '2',
5513   -// },
5514   -// ];
5515   -// const [value1, setValue1] = useState('Apple');
5516   -// const radioOnChange1 = ({ target: { value } }) => {
5517   -// console.log('radio1 checked', value);
5518   -// setValue1(value);
5519   -// };
5520   -//选择天数2
5521   -
5522   -export default OrderPage;
src/pages/Order/WarningWhitelist/index.css deleted 100644 → 0
src/pages/Order/WarningWhitelist/index.less deleted 100644 → 0
src/pages/Order/WarningWhitelist/index.tsx
1   -import {
2   - ActionType,
3   - ModalForm,
4   - ProColumns,
5   - ProFormText,
6   - ProTable,
7   -} from '@ant-design/pro-components';
8   -import {
9   - Button,
10   - Checkbox,
11   - Divider,
12   - Dropdown,
13   - Flex,
14   - FloatButton,
15   - Image,
16   - MenuProps,
17   - Modal,
18   - Popconfirm,
19   - Radio,
20   - Space,
21   - Spin,
22   - Tag,
23   - Tooltip,
24   - message,
25   - Tabs,
26   -} from 'antd';
27 1 import ButtonConfirm from '@/components/ButtomConfirm';
28 2 import { RESPONSE_CODE } from '@/constants/enum';
29 3 import {
30   - postOldInvoicingWhiteListBatchAdd,
31   - postOldInvoicingWhiteListPage,
32   - postOldInvoicingWhiteListRemove,
33   - postServiceOrderWarningUserWhiteLists,
  4 + postServiceOrderAddWarningOrderWhiteList,
34 5 postServiceOrderAddWarningUserWhiteList,
  6 + postServiceOrderDeleteWarningOrderWhiteList,
35 7 postServiceOrderDeleteWarningUserWhiteList,
36 8 postServiceOrderWarningOrderWhiteLists,
37   - postServiceOrderAddWarningOrderWhiteList,
38   - postServiceOrderDeleteWarningOrderWhiteList,
  9 + postServiceOrderWarningUserWhiteLists,
39 10 } from '@/services';
40 11 import { PlusOutlined } from '@ant-design/icons';
  12 +import {
  13 + ActionType,
  14 + ModalForm,
  15 + ProColumns,
  16 + ProFormText,
  17 + ProTable,
  18 +} from '@ant-design/pro-components';
  19 +import { Button, Tabs, message } from 'antd';
41 20 import { useRef } from 'react';
42 21 export const waitTimePromise = async (time: number = 100) => {
43 22 return new Promise((resolve) => {
... ... @@ -134,9 +113,9 @@ const WarningWhitelist = () =&gt; {
134 113 search: {
135 114 transform: (value) => {
136 115 if (value) {
137   - console.log(value, '5656valueid')
  116 + console.log(value, '5656valueid');
138 117 return {
139   - orderId: Number(value)
  118 + orderId: Number(value),
140 119 };
141 120 }
142 121 },
... ... @@ -186,7 +165,7 @@ const WarningWhitelist = () =&gt; {
186 165 title={'确认删除此项吗?'}
187 166 text="删除"
188 167 onConfirm={async () => {
189   - console.log(record.orderId, '5656idoreder')
  168 + console.log(record.orderId, '5656idoreder');
190 169 await postServiceOrderDeleteWarningOrderWhiteList({
191 170 query: {
192 171 orderId: record.orderId,
... ... @@ -213,7 +192,7 @@ const WarningWhitelist = () =&gt; {
213 192 const res = await postServiceOrderWarningUserWhiteLists({
214 193 data: { ...params },
215 194 });
216   - console.log(res.data, '5656res.data')
  195 + console.log(res.data, '5656res.data');
217 196 return res.data;
218 197 }}
219 198 rowKey="id"
... ... @@ -281,7 +260,7 @@ const WarningWhitelist = () =&gt; {
281 260 ]}
282 261 />
283 262 </div>
284   - )
  263 + ),
285 264 },
286 265 {
287 266 key: 2,
... ... @@ -334,7 +313,7 @@ const WarningWhitelist = () =&gt; {
334 313 console.log(values, '5656values');
335 314 const res = await postServiceOrderAddWarningOrderWhiteList({
336 315 data: {
337   - orderId: values.orderIdsText
  316 + orderId: values.orderIdsText,
338 317 },
339 318 });
340 319 if (res.result === RESPONSE_CODE.SUCCESS) {
... ... @@ -361,9 +340,9 @@ const WarningWhitelist = () =&gt; {
361 340 ]}
362 341 />
363 342 </div>
364   - )
365   - }
366   - ]
  343 + ),
  344 + },
  345 + ];
367 346 return (
368 347 <div>
369 348 <Tabs
... ... @@ -374,6 +353,6 @@ const WarningWhitelist = () =&gt; {
374 353 }}
375 354 />
376 355 </div>
377   - )
378   -}
379   -export default WarningWhitelist
  356 + );
  357 +};
  358 +export default WarningWhitelist;
... ...
src/pages/OrderReport/components/OrderStatisticCard.tsx
... ... @@ -310,59 +310,44 @@ export default ({ data, statisticsMethod, reFreshData }) =&gt; {
310 310 <ProCard
311 311 className="order-statictis-card"
312 312 bordered
313   - title={<CardTitle title='待开票订单' />}
  313 + title={<CardTitle title="待开票订单" />}
314 314 >
315   - <CardContent
316   - content={data?.waitInvoicingCount}
317   - />
  315 + <CardContent content={data?.waitInvoicingCount} />
318 316 </ProCard>
319 317 <ProCard
320 318 className="order-statictis-card"
321 319 bordered
322   - title={<CardTitle title='待开票订单总金额' />}
  320 + title={<CardTitle title="待开票订单总金额" />}
323 321 >
324   - <CardContent
325   - unit="¥"
326   - content={data?.waitInvoicingPriceSum}
327   - />
  322 + <CardContent unit="¥" content={data?.waitInvoicingPriceSum} />
328 323 </ProCard>
329 324 <ProCard
330 325 className="order-statictis-card"
331 326 bordered
332   - title={<CardTitle title='已开票未回款订单' />}
  327 + title={<CardTitle title="已开票未回款订单" />}
333 328 >
334   - <CardContent
335   - content={data?.invoicedNotReiceptCount}
336   - />
  329 + <CardContent content={data?.invoicedNotReiceptCount} />
337 330 </ProCard>
338 331 <ProCard
339 332 className="order-statictis-card"
340 333 bordered
341   - title={<CardTitle title='已开票未回款订单总金额' />}
  334 + title={<CardTitle title="已开票未回款订单总金额" />}
342 335 >
343   - <CardContent
344   - unit="¥"
345   - content={data?.invoicedNotReiceptPriceSum}
346   - />
  336 + <CardContent unit="¥" content={data?.invoicedNotReiceptPriceSum} />
347 337 </ProCard>
348 338 <ProCard
349 339 className="order-statictis-card"
350 340 bordered
351   - title={<CardTitle title='已开票已回款订单' />}
  341 + title={<CardTitle title="已开票已回款订单" />}
352 342 >
353   - <CardContent
354   - content={data?.invoicedAndReiceptedCount}
355   - />
  343 + <CardContent content={data?.invoicedAndReiceptedCount} />
356 344 </ProCard>
357 345 <ProCard
358 346 className="order-statictis-card"
359 347 bordered
360   - title={<CardTitle title='已开票已回款订单总金额' />}
  348 + title={<CardTitle title="已开票已回款订单总金额" />}
361 349 >
362   - <CardContent
363   - unit="¥"
364   - content={data?.invoicedAndReiceptedPriceSum}
365   - />
  350 + <CardContent unit="¥" content={data?.invoicedAndReiceptedPriceSum} />
366 351 </ProCard>
367 352 </ProCard>
368 353  
... ...
src/pages/Prepaid/index.tsx
1 1 import ButtonConfirm from '@/components/ButtomConfirm';
2 2 import EllipsisDiv from '@/components/Div/EllipsisDiv';
3 3 import { RESPONSE_CODE } from '@/constants/enum';
4   -import { } from '@/pages/Invoice/constant';
  4 +import {} from '@/pages/Invoice/constant';
5 5 import {
6 6 postCanrdApiUserList,
7 7 postPrepaidDelete,
... ...
src/services/definition.ts
... ... @@ -94,36 +94,33 @@ export interface AdminAuthUserVO {
94 94 export interface AdminClientDto {
95 95 /**
96 96 * @description
97   - * 市
98   - */
99   - city?: string;
100   - /**
101   - * @description
102   - * 单位地址
  97 + * 客户地址
103 98 */
104   - companyAddress?: string;
  99 + address?: string;
105 100 /**
106 101 * @description
107   - * 单位地址
  102 + *
108 103 */
109   - companyAddressText?: string;
  104 + city?: string;
110 105 companyId?: string;
111 106 /**
112 107 * @description
113   - * 单位名称
  108 + * 联系人
114 109 */
115   - companyName?: string;
116 110 contacts?: string;
117   - createBy?: string;
  111 + createByName?: string;
118 112 /** @format date-time */
119 113 createTime?: string;
120 114 /**
121 115 * @description
  116 + * 详细地址
  117 + */
  118 + detailAddress?: string;
  119 + /**
  120 + * @description
122 121 * 区
123 122 */
124 123 district?: string;
125   - /** @format int32 */
126   - enableFlag?: number;
127 124 /**
128 125 * @description
129 126 * 是否已报方案
... ... @@ -144,9 +141,7 @@ export interface AdminClientDto {
144 141 * 客户等级
145 142 */
146 143 levelText?: string;
147   - modifyBy?: string;
148   - /** @format date-time */
149   - modifyTime?: string;
  144 + logicDelete?: boolean;
150 145 /**
151 146 * @description
152 147 * 名称
... ... @@ -157,6 +152,7 @@ export interface AdminClientDto {
157 152 * 备注
158 153 */
159 154 notes?: string;
  155 + paths?: Array<string>;
160 156 /**
161 157 * @description
162 158 * 电话号码
... ... @@ -180,16 +176,26 @@ export interface AdminClientDto {
180 176 referrers?: string;
181 177 /**
182 178 * @description
183   - * 需求
  179 + * 客户需求
184 180 */
185 181 requirements?: string;
186 182 /**
187 183 * @description
  184 + * 客户需求
  185 + */
  186 + requirementsText?: string;
  187 + /**
  188 + * @description
188 189 * 来源
189 190 */
190 191 source?: string;
191 192 /**
192 193 * @description
  194 + * 来源
  195 + */
  196 + sourceText?: string;
  197 + /**
  198 + * @description
193 199 * 跟进状态
194 200 */
195 201 tradeStatus?: string;
... ... @@ -198,8 +204,9 @@ export interface AdminClientDto {
198 204 * 跟进状态
199 205 */
200 206 tradeStatusText?: string;
201   - /** @format int32 */
202   - version?: number;
  207 + updateByName?: string;
  208 + /** @format date-time */
  209 + updateTime?: string;
203 210 }
204 211  
205 212 export interface AdminDeptQueryVO {
... ... @@ -2839,6 +2846,7 @@ export interface QueryBankStatementDto {
2839 2846 }
2840 2847  
2841 2848 export interface QueryClientDto {
  2849 + address?: string;
2842 2850 companyAddressLike?: string;
2843 2851 companyIds?: Array<number>;
2844 2852 companyNameLike?: string;
... ... @@ -2850,6 +2858,7 @@ export interface QueryClientDto {
2850 2858 createTimeLe?: string;
2851 2859 /** @format int32 */
2852 2860 current?: number;
  2861 + detailAddress?: string;
2853 2862 /** @format int32 */
2854 2863 end?: number;
2855 2864 groupFilter?: string;
... ... @@ -2859,6 +2868,8 @@ export interface QueryClientDto {
2859 2868 /** @format int32 */
2860 2869 pageSize?: number;
2861 2870 phoneNumber?: string;
  2871 + requirements?: string;
  2872 + source?: string;
2862 2873 /** @format int32 */
2863 2874 start?: number;
2864 2875 /** @format int32 */
... ... @@ -2867,10 +2878,18 @@ export interface QueryClientDto {
2867 2878 }
2868 2879  
2869 2880 export interface QueryCommunicationInfoDto {
  2881 + clientAddressLike?: string;
2870 2882 /** @format int64 */
2871 2883 clientId?: number;
  2884 + clientIdIn?: Array<number>;
  2885 + clientNameLike?: string;
2872 2886 content?: string;
2873 2887 createByName?: string;
  2888 + createByNameIn?: Array<string>;
  2889 + /** @format date-time */
  2890 + createTimeGe?: string;
  2891 + /** @format date-time */
  2892 + createTimeLe?: string;
2874 2893 /** @format int32 */
2875 2894 current?: number;
2876 2895 /** @format date-time */
... ... @@ -2885,6 +2904,7 @@ export interface QueryCommunicationInfoDto {
2885 2904 start?: number;
2886 2905 /** @format int32 */
2887 2906 total?: number;
  2907 + tradeStatusLike?: string;
2888 2908 way?: string;
2889 2909 }
2890 2910  
... ... @@ -3222,10 +3242,16 @@ export interface QueryUseOldInvoicingDto {
3222 3242  
3223 3243 export interface QueryWarningOrderWhiteListDto {
3224 3244 createByName?: string;
  3245 + /** @format date-time */
  3246 + createTimeGe?: string;
  3247 + /** @format date-time */
  3248 + createTimeLe?: string;
3225 3249 /** @format int32 */
3226 3250 current?: number;
3227 3251 /** @format int32 */
3228 3252 end?: number;
  3253 + /** @format int64 */
  3254 + orderId?: number;
3229 3255 /** @format int32 */
3230 3256 pageSize?: number;
3231 3257 /** @format int32 */
... ... @@ -3704,6 +3730,7 @@ export interface SubOrder {
3704 3730 deadline?: string;
3705 3731 ext?: string;
3706 3732 extendField?: string;
  3733 + feedbackRegistrationContent?: string;
3707 3734 /** @format date-time */
3708 3735 financialReceiptIssuanceTime?: string;
3709 3736 fullPaymentStatus?: string;
... ... @@ -4124,14 +4151,30 @@ export interface View {
4124 4151 }
4125 4152  
4126 4153 export interface WarningOrderWhiteListDto {
  4154 + createByName?: string;
  4155 + /** @format date-time */
  4156 + createTime?: string;
  4157 + logicDelete?: boolean;
4127 4158 /** @format int64 */
4128 4159 orderId?: number;
  4160 + paths?: Array<string>;
4129 4161 salesCode?: string;
  4162 + updateByName?: string;
  4163 + /** @format date-time */
  4164 + updateTime?: string;
4130 4165 }
4131 4166  
4132 4167 export interface WarningUserWhiteListDto {
  4168 + createByName?: string;
  4169 + /** @format date-time */
  4170 + createTime?: string;
4133 4171 /** @format int64 */
4134 4172 id?: number;
  4173 + logicDelete?: boolean;
  4174 + paths?: Array<string>;
  4175 + updateByName?: string;
  4176 + /** @format date-time */
  4177 + updateTime?: string;
4135 4178 userName?: string;
4136 4179 }
4137 4180  
... ... @@ -4154,16 +4197,29 @@ export interface ApiOrderConfirmReceiveRequest {
4154 4197 }
4155 4198  
4156 4199 export interface ClientCommunicationInfo {
  4200 + attachments?: string;
  4201 + /**
  4202 + * @description
  4203 + * 客户地址
  4204 + */
  4205 + clientAddress?: string;
4157 4206 /** @format int64 */
4158 4207 clientId?: number;
4159 4208 /**
4160 4209 * @description
  4210 + * 客户名称
  4211 + */
  4212 + clientName?: string;
  4213 + /**
  4214 + * @description
4161 4215 * 内容
4162 4216 */
4163 4217 content?: string;
4164 4218 createByName?: string;
4165 4219 /** @format date-time */
4166 4220 createTime?: string;
  4221 + /** @format int64 */
  4222 + dateRange?: number;
4167 4223 /**
4168 4224 * @description
4169 4225 * 跟进时间
... ... @@ -4173,6 +4229,11 @@ export interface ClientCommunicationInfo {
4173 4229 /** @format int64 */
4174 4230 id?: number;
4175 4231 logicDelete?: boolean;
  4232 + /**
  4233 + * @description
  4234 + * 客户状态
  4235 + */
  4236 + tradeStatus?: string;
4176 4237 updateByName?: string;
4177 4238 /** @format date-time */
4178 4239 updateTime?: string;
... ... @@ -4181,6 +4242,11 @@ export interface ClientCommunicationInfo {
4181 4242 * 方式
4182 4243 */
4183 4244 way?: string;
  4245 + /**
  4246 + * @description
  4247 + * 方式
  4248 + */
  4249 + wayText?: string;
4184 4250 }
4185 4251  
4186 4252 export interface CompanyInfo {
... ... @@ -4739,6 +4805,20 @@ export interface UserAddressSaveRequest {
4739 4805 institutionContactName?: string;
4740 4806 }
4741 4807  
  4808 +export interface FeedbackRegistrationDTO {
  4809 + /**
  4810 + * @description
  4811 + * 回访登记内容
  4812 + */
  4813 + feedbackRegistrationContent?: string;
  4814 + /**
  4815 + * @description
  4816 + * 子订单id
  4817 + * @format int64
  4818 + */
  4819 + id?: number;
  4820 +}
  4821 +
4742 4822 export interface UploadPaymentReceiptDTO {
4743 4823 /**
4744 4824 * @description
... ...
src/services/request.ts
... ... @@ -54,6 +54,7 @@ import type {
54 54 DistrictDo,
55 55 DistrictSearchDo,
56 56 Dto,
  57 + FeedbackRegistrationDTO,
57 58 InventoryMaterialStockReq,
58 59 InvoiceBatchDownloadDto,
59 60 InvoiceDto,
... ... @@ -66,6 +67,7 @@ import type {
66 67 MaterialUnitListRes,
67 68 MeasureUnitListRes,
68 69 MessageQueryDTO,
  70 + ModelAndView,
69 71 OrderAddVO,
70 72 OrderAuditLogQueryVO,
71 73 OrderBaseInfoQueryVO,
... ... @@ -362,6 +364,79 @@ export const postAdminClientAddOrModifyClientComunicationInfo =
362 364 return request;
363 365 })();
364 366  
  367 +/** @description request parameter type for postAdminClientDeleteAdminClient */
  368 +export interface PostAdminClientDeleteAdminClientOption {
  369 + /**
  370 + * @description
  371 + * id
  372 + * @format int64
  373 + */
  374 + query?: {
  375 + /**
  376 + @description
  377 + id
  378 + @format int64 */
  379 + id?: number;
  380 + };
  381 +}
  382 +
  383 +/** @description response type for postAdminClientDeleteAdminClient */
  384 +export interface PostAdminClientDeleteAdminClientResponse {
  385 + /**
  386 + * @description
  387 + * OK
  388 + */
  389 + 200: ServerResult;
  390 + /**
  391 + * @description
  392 + * Created
  393 + */
  394 + 201: any;
  395 + /**
  396 + * @description
  397 + * Unauthorized
  398 + */
  399 + 401: any;
  400 + /**
  401 + * @description
  402 + * Forbidden
  403 + */
  404 + 403: any;
  405 + /**
  406 + * @description
  407 + * Not Found
  408 + */
  409 + 404: any;
  410 +}
  411 +
  412 +export type PostAdminClientDeleteAdminClientResponseSuccess =
  413 + PostAdminClientDeleteAdminClientResponse[200];
  414 +/**
  415 + * @description
  416 + * 删除客户
  417 + * @tags 客户管理
  418 + * @produces *
  419 + * @consumes application/json
  420 + */
  421 +export const postAdminClientDeleteAdminClient = /* #__PURE__ */ (() => {
  422 + const method = 'post';
  423 + const url = '/admin/client/deleteAdminClient';
  424 + function request(
  425 + option?: PostAdminClientDeleteAdminClientOption,
  426 + ): Promise<PostAdminClientDeleteAdminClientResponseSuccess> {
  427 + return requester(request.url, {
  428 + method: request.method,
  429 + ...option,
  430 + }) as unknown as Promise<PostAdminClientDeleteAdminClientResponseSuccess>;
  431 + }
  432 +
  433 + /** http method */
  434 + request.method = method;
  435 + /** request url */
  436 + request.url = url;
  437 + return request;
  438 +})();
  439 +
365 440 /** @description response type for postAdminClientDownloadImportTemplate */
366 441 export interface PostAdminClientDownloadImportTemplateResponse {
367 442 /**
... ... @@ -520,7 +595,7 @@ export type PostAdminClientGetStatisticalDataResponseSuccess =
520 595 PostAdminClientGetStatisticalDataResponse[200];
521 596 /**
522 597 * @description
523   - * 修改跟进信息
  598 + * 全部与预警客户个数
524 599 * @tags 客户管理
525 600 * @produces *
526 601 * @consumes application/json
... ... @@ -3239,9 +3314,7 @@ export interface GetErrorResponse {
3239 3314 * @description
3240 3315 * OK
3241 3316 */
3242   - 200: {
3243   - [propertyName: string]: any;
3244   - };
  3317 + 200: ModelAndView;
3245 3318 /**
3246 3319 * @description
3247 3320 * Unauthorized
... ... @@ -3262,9 +3335,9 @@ export interface GetErrorResponse {
3262 3335 export type GetErrorResponseSuccess = GetErrorResponse[200];
3263 3336 /**
3264 3337 * @description
3265   - * error
  3338 + * errorHtml
3266 3339 * @tags basic-error-controller
3267   - * @produces *
  3340 + * @produces text/html
3268 3341 */
3269 3342 export const getError = /* #__PURE__ */ (() => {
3270 3343 const method = 'get';
... ... @@ -3288,9 +3361,7 @@ export interface PutErrorResponse {
3288 3361 * @description
3289 3362 * OK
3290 3363 */
3291   - 200: {
3292   - [propertyName: string]: any;
3293   - };
  3364 + 200: ModelAndView;
3294 3365 /**
3295 3366 * @description
3296 3367 * Created
... ... @@ -3316,9 +3387,9 @@ export interface PutErrorResponse {
3316 3387 export type PutErrorResponseSuccess = PutErrorResponse[200];
3317 3388 /**
3318 3389 * @description
3319   - * error
  3390 + * errorHtml
3320 3391 * @tags basic-error-controller
3321   - * @produces *
  3392 + * @produces text/html
3322 3393 * @consumes application/json
3323 3394 */
3324 3395 export const putError = /* #__PURE__ */ (() => {
... ... @@ -3343,9 +3414,7 @@ export interface PostErrorResponse {
3343 3414 * @description
3344 3415 * OK
3345 3416 */
3346   - 200: {
3347   - [propertyName: string]: any;
3348   - };
  3417 + 200: ModelAndView;
3349 3418 /**
3350 3419 * @description
3351 3420 * Created
... ... @@ -3371,9 +3440,9 @@ export interface PostErrorResponse {
3371 3440 export type PostErrorResponseSuccess = PostErrorResponse[200];
3372 3441 /**
3373 3442 * @description
3374   - * error
  3443 + * errorHtml
3375 3444 * @tags basic-error-controller
3376   - * @produces *
  3445 + * @produces text/html
3377 3446 * @consumes application/json
3378 3447 */
3379 3448 export const postError = /* #__PURE__ */ (() => {
... ... @@ -3398,9 +3467,7 @@ export interface DeleteErrorResponse {
3398 3467 * @description
3399 3468 * OK
3400 3469 */
3401   - 200: {
3402   - [propertyName: string]: any;
3403   - };
  3470 + 200: ModelAndView;
3404 3471 /**
3405 3472 * @description
3406 3473 * No Content
... ... @@ -3421,9 +3488,9 @@ export interface DeleteErrorResponse {
3421 3488 export type DeleteErrorResponseSuccess = DeleteErrorResponse[200];
3422 3489 /**
3423 3490 * @description
3424   - * error
  3491 + * errorHtml
3425 3492 * @tags basic-error-controller
3426   - * @produces *
  3493 + * @produces text/html
3427 3494 */
3428 3495 export const deleteError = /* #__PURE__ */ (() => {
3429 3496 const method = 'delete';
... ... @@ -3447,9 +3514,7 @@ export interface OptionsErrorResponse {
3447 3514 * @description
3448 3515 * OK
3449 3516 */
3450   - 200: {
3451   - [propertyName: string]: any;
3452   - };
  3517 + 200: ModelAndView;
3453 3518 /**
3454 3519 * @description
3455 3520 * No Content
... ... @@ -3470,9 +3535,9 @@ export interface OptionsErrorResponse {
3470 3535 export type OptionsErrorResponseSuccess = OptionsErrorResponse[200];
3471 3536 /**
3472 3537 * @description
3473   - * error
  3538 + * errorHtml
3474 3539 * @tags basic-error-controller
3475   - * @produces *
  3540 + * @produces text/html
3476 3541 * @consumes application/json
3477 3542 */
3478 3543 export const optionsError = /* #__PURE__ */ (() => {
... ... @@ -3497,9 +3562,7 @@ export interface HeadErrorResponse {
3497 3562 * @description
3498 3563 * OK
3499 3564 */
3500   - 200: {
3501   - [propertyName: string]: any;
3502   - };
  3565 + 200: ModelAndView;
3503 3566 /**
3504 3567 * @description
3505 3568 * No Content
... ... @@ -3520,9 +3583,9 @@ export interface HeadErrorResponse {
3520 3583 export type HeadErrorResponseSuccess = HeadErrorResponse[200];
3521 3584 /**
3522 3585 * @description
3523   - * error
  3586 + * errorHtml
3524 3587 * @tags basic-error-controller
3525   - * @produces *
  3588 + * @produces text/html
3526 3589 * @consumes application/json
3527 3590 */
3528 3591 export const headError = /* #__PURE__ */ (() => {
... ... @@ -3547,9 +3610,7 @@ export interface PatchErrorResponse {
3547 3610 * @description
3548 3611 * OK
3549 3612 */
3550   - 200: {
3551   - [propertyName: string]: any;
3552   - };
  3613 + 200: ModelAndView;
3553 3614 /**
3554 3615 * @description
3555 3616 * No Content
... ... @@ -3570,9 +3631,9 @@ export interface PatchErrorResponse {
3570 3631 export type PatchErrorResponseSuccess = PatchErrorResponse[200];
3571 3632 /**
3572 3633 * @description
3573   - * error
  3634 + * errorHtml
3574 3635 * @tags basic-error-controller
3575   - * @produces *
  3636 + * @produces text/html
3576 3637 * @consumes application/json
3577 3638 */
3578 3639 export const patchError = /* #__PURE__ */ (() => {
... ... @@ -13051,6 +13112,168 @@ export const postServiceConstClientLevels = /* #__PURE__ */ (() =&gt; {
13051 13112 return request;
13052 13113 })();
13053 13114  
  13115 +/** @description response type for postServiceConstClientRequirements */
  13116 +export interface PostServiceConstClientRequirementsResponse {
  13117 + /**
  13118 + * @description
  13119 + * OK
  13120 + */
  13121 + 200: ServerResult;
  13122 + /**
  13123 + * @description
  13124 + * Created
  13125 + */
  13126 + 201: any;
  13127 + /**
  13128 + * @description
  13129 + * Unauthorized
  13130 + */
  13131 + 401: any;
  13132 + /**
  13133 + * @description
  13134 + * Forbidden
  13135 + */
  13136 + 403: any;
  13137 + /**
  13138 + * @description
  13139 + * Not Found
  13140 + */
  13141 + 404: any;
  13142 +}
  13143 +
  13144 +export type PostServiceConstClientRequirementsResponseSuccess =
  13145 + PostServiceConstClientRequirementsResponse[200];
  13146 +/**
  13147 + * @description
  13148 + * 客户需求
  13149 + * @tags front-const-controller
  13150 + * @produces *
  13151 + * @consumes application/json
  13152 + */
  13153 +export const postServiceConstClientRequirements = /* #__PURE__ */ (() => {
  13154 + const method = 'post';
  13155 + const url = '/service/const/clientRequirements';
  13156 + function request(): Promise<PostServiceConstClientRequirementsResponseSuccess> {
  13157 + return requester(request.url, {
  13158 + method: request.method,
  13159 + }) as unknown as Promise<PostServiceConstClientRequirementsResponseSuccess>;
  13160 + }
  13161 +
  13162 + /** http method */
  13163 + request.method = method;
  13164 + /** request url */
  13165 + request.url = url;
  13166 + return request;
  13167 +})();
  13168 +
  13169 +/** @description response type for postServiceConstClientSource */
  13170 +export interface PostServiceConstClientSourceResponse {
  13171 + /**
  13172 + * @description
  13173 + * OK
  13174 + */
  13175 + 200: ServerResult;
  13176 + /**
  13177 + * @description
  13178 + * Created
  13179 + */
  13180 + 201: any;
  13181 + /**
  13182 + * @description
  13183 + * Unauthorized
  13184 + */
  13185 + 401: any;
  13186 + /**
  13187 + * @description
  13188 + * Forbidden
  13189 + */
  13190 + 403: any;
  13191 + /**
  13192 + * @description
  13193 + * Not Found
  13194 + */
  13195 + 404: any;
  13196 +}
  13197 +
  13198 +export type PostServiceConstClientSourceResponseSuccess =
  13199 + PostServiceConstClientSourceResponse[200];
  13200 +/**
  13201 + * @description
  13202 + * 客户来源
  13203 + * @tags front-const-controller
  13204 + * @produces *
  13205 + * @consumes application/json
  13206 + */
  13207 +export const postServiceConstClientSource = /* #__PURE__ */ (() => {
  13208 + const method = 'post';
  13209 + const url = '/service/const/clientSource';
  13210 + function request(): Promise<PostServiceConstClientSourceResponseSuccess> {
  13211 + return requester(request.url, {
  13212 + method: request.method,
  13213 + }) as unknown as Promise<PostServiceConstClientSourceResponseSuccess>;
  13214 + }
  13215 +
  13216 + /** http method */
  13217 + request.method = method;
  13218 + /** request url */
  13219 + request.url = url;
  13220 + return request;
  13221 +})();
  13222 +
  13223 +/** @description response type for postServiceConstClientWay */
  13224 +export interface PostServiceConstClientWayResponse {
  13225 + /**
  13226 + * @description
  13227 + * OK
  13228 + */
  13229 + 200: ServerResult;
  13230 + /**
  13231 + * @description
  13232 + * Created
  13233 + */
  13234 + 201: any;
  13235 + /**
  13236 + * @description
  13237 + * Unauthorized
  13238 + */
  13239 + 401: any;
  13240 + /**
  13241 + * @description
  13242 + * Forbidden
  13243 + */
  13244 + 403: any;
  13245 + /**
  13246 + * @description
  13247 + * Not Found
  13248 + */
  13249 + 404: any;
  13250 +}
  13251 +
  13252 +export type PostServiceConstClientWayResponseSuccess =
  13253 + PostServiceConstClientWayResponse[200];
  13254 +/**
  13255 + * @description
  13256 + * 类型
  13257 + * @tags front-const-controller
  13258 + * @produces *
  13259 + * @consumes application/json
  13260 + */
  13261 +export const postServiceConstClientWay = /* #__PURE__ */ (() => {
  13262 + const method = 'post';
  13263 + const url = '/service/const/clientWay';
  13264 + function request(): Promise<PostServiceConstClientWayResponseSuccess> {
  13265 + return requester(request.url, {
  13266 + method: request.method,
  13267 + }) as unknown as Promise<PostServiceConstClientWayResponseSuccess>;
  13268 + }
  13269 +
  13270 + /** http method */
  13271 + request.method = method;
  13272 + /** request url */
  13273 + request.url = url;
  13274 + return request;
  13275 +})();
  13276 +
13054 13277 /** @description response type for postServiceConstGetPayeeEnum */
13055 13278 export interface PostServiceConstGetPayeeEnumResponse {
13056 13279 /**
... ... @@ -17204,13 +17427,13 @@ export const postServiceOrderConfirmReceipt = /* #__PURE__ */ (() =&gt; {
17204 17427 export interface PostServiceOrderDeleteWarningOrderWhiteListOption {
17205 17428 /**
17206 17429 * @description
17207   - * id
  17430 + * orderId
17208 17431 */
17209 17432 body?: {
17210 17433 /**
17211 17434 @description
17212   - id */
17213   - id?: number;
  17435 + orderId */
  17436 + orderId?: number;
17214 17437 };
17215 17438 }
17216 17439  
... ... @@ -17682,6 +17905,77 @@ export const postServiceOrderExportTemplate = /* #__PURE__ */ (() =&gt; {
17682 17905 return request;
17683 17906 })();
17684 17907  
  17908 +/** @description request parameter type for postServiceOrderFeedbackRegistration */
  17909 +export interface PostServiceOrderFeedbackRegistrationOption {
  17910 + /**
  17911 + * @description
  17912 + * dto
  17913 + */
  17914 + body: {
  17915 + /**
  17916 + @description
  17917 + dto */
  17918 + dto: FeedbackRegistrationDTO;
  17919 + };
  17920 +}
  17921 +
  17922 +/** @description response type for postServiceOrderFeedbackRegistration */
  17923 +export interface PostServiceOrderFeedbackRegistrationResponse {
  17924 + /**
  17925 + * @description
  17926 + * OK
  17927 + */
  17928 + 200: ServerResult;
  17929 + /**
  17930 + * @description
  17931 + * Created
  17932 + */
  17933 + 201: any;
  17934 + /**
  17935 + * @description
  17936 + * Unauthorized
  17937 + */
  17938 + 401: any;
  17939 + /**
  17940 + * @description
  17941 + * Forbidden
  17942 + */
  17943 + 403: any;
  17944 + /**
  17945 + * @description
  17946 + * Not Found
  17947 + */
  17948 + 404: any;
  17949 +}
  17950 +
  17951 +export type PostServiceOrderFeedbackRegistrationResponseSuccess =
  17952 + PostServiceOrderFeedbackRegistrationResponse[200];
  17953 +/**
  17954 + * @description
  17955 + * 回访登记
  17956 + * @tags 内部订单
  17957 + * @produces *
  17958 + * @consumes application/json
  17959 + */
  17960 +export const postServiceOrderFeedbackRegistration = /* #__PURE__ */ (() => {
  17961 + const method = 'post';
  17962 + const url = '/service/order/feedbackRegistration';
  17963 + function request(
  17964 + option: PostServiceOrderFeedbackRegistrationOption,
  17965 + ): Promise<PostServiceOrderFeedbackRegistrationResponseSuccess> {
  17966 + return requester(request.url, {
  17967 + method: request.method,
  17968 + ...option,
  17969 + }) as unknown as Promise<PostServiceOrderFeedbackRegistrationResponseSuccess>;
  17970 + }
  17971 +
  17972 + /** http method */
  17973 + request.method = method;
  17974 + /** request url */
  17975 + request.url = url;
  17976 + return request;
  17977 +})();
  17978 +
17685 17979 /** @description request parameter type for postServiceOrderFileProcess */
17686 17980 export interface PostServiceOrderFileProcessOption {
17687 17981 /**
... ...