Commit 5c49c238cd570d32c9c7f41c1f71578d8bf0764f

Authored by boyang
1 parent 8534395e

feat: 开发客户列表编辑多个工单

src/pages/Client/Client/Components/ClientInformationModal.tsx
1 1 import { RESPONSE_CODE } from '@/constants/enum';
2   -import UploadC from '@/pages/Invoice/waitProcessRecord/components/UploadSingleImg';
3 2 import {
4 3 postAdminClientAddOrModifyClientComunicationInfo,
5 4 postAdminClientQueryClientPage,
... ... @@ -10,19 +9,51 @@ import {
10 9 } from '@/services';
11 10 import { enumToSelect } from '@/utils';
12 11 import {
  12 + FormListActionType,
13 13 ModalForm,
  14 + ProCard,
14 15 ProFormDateTimePicker,
  16 + ProFormList,
15 17 ProFormSelect,
16 18 ProFormText,
17 19 ProFormTextArea,
18 20 ProFormUploadDragger,
19 21 } from '@ant-design/pro-components';
20   -import { Button, Col, Form, Row, message } from 'antd';
  22 +import { Button, Form, message } from 'antd';
21 23 import { RcFile } from 'antd/es/upload';
  24 +import { useRef } from 'react';
22 25 import './style.css';
23 26 export default ({ data, type, reloadTable }) => {
24 27 const [form] = Form.useForm();
  28 + const actionRef = useRef<
  29 + FormListActionType<{
  30 + name: string;
  31 + }>
  32 + >();
  33 + const fileList: any = [];
25 34 const onfinish = async (values) => {
  35 + console.log(values, '5656values');
  36 +
  37 + let list = values.ticketsList;
  38 + console.log(list, '5656list');
  39 + list = list.map((item, index) => {
  40 + // 尝试从 item.filePaths 中获取 annexUrl
  41 + const itemAnnexUrl = item?.filePaths?.[0]?.response?.data?.[0] || null;
  42 +
  43 + // 如果 itemAnnexUrl 为 null,则使用 data.ticketsList 对应的 annexUrl
  44 + if (
  45 + itemAnnexUrl === null &&
  46 + data.ticketsList[index]?.annexUrl &&
  47 + index < data.ticketsList.length
  48 + ) {
  49 + item.annexUrl = data.ticketsList[index].annexUrl; // 确保对比中的 annesUrl 也是 null
  50 + } else {
  51 + item.annexUrl = itemAnnexUrl; // 否则,使用从 item.filePaths 中获取的值
  52 + }
  53 + return item;
  54 + });
  55 +
  56 + values.list = list;
26 57 const resSearchId = await postAdminClientQueryClientPage({
27 58 data: {
28 59 groupFilter: 'all',
... ... @@ -54,25 +85,32 @@ export default ({ data, type, reloadTable }) =&gt; {
54 85 const editOnfinish = async (values) => {
55 86 // setEditClientId(data.clientId);
56 87 values.clientId = data.clientId;
57   - console.log(values, '5656editClientId');
58   -
59   - // const resSearchId = await postAdminClientQueryClientPage({
60   - // data: {
61   - // groupFilter: 'all',
62   - // },
63   - // });
64   - // const matchingItem = resSearchId.data.data.find(
65   - // (item) => item.id === values.name,
66   - // );
  88 + let list = values.ticketsList;
  89 + list = list.map((item, index) => {
  90 + // 尝试从 item.filePaths 中获取 annexUrl
  91 + const itemAnnexUrl = item?.filePaths?.[0]?.response?.data?.[0] || null;
67 92  
  93 + // 如果 itemAnnexUrl 为 null,则使用 data.ticketsList 对应的 annexUrl
  94 + if (
  95 + itemAnnexUrl === null &&
  96 + data.ticketsList[index]?.annexUrl &&
  97 + index < data.ticketsList.length
  98 + ) {
  99 + item.annexUrl = data.ticketsList[index].annexUrl; // 确保对比中的 annesUrl 也是 null
  100 + } else {
  101 + item.annexUrl = itemAnnexUrl; // 否则,使用从 item.filePaths 中获取的值
  102 + }
  103 + return item;
  104 + });
  105 + values.list = list;
68 106 const res = await postAdminClientAddOrModifyClientComunicationInfo({
69 107 data: {
70 108 ...values,
71 109 // ticketsAttachments: form.getFieldValue("ticketsAttachments"),
72   - ticketsAttachments:
73   - form.getFieldValue('ticketsAttachments') !== undefined
74   - ? form.getFieldValue('ticketsAttachments')
75   - : data?.ticketsAttachments,
  110 + // ticketsAttachments:
  111 + // form.getFieldValue('ticketsAttachments') !== undefined
  112 + // ? form.getFieldValue('ticketsAttachments')
  113 + // : data?.ticketsAttachments,
76 114 // ticketsAttachments: data?.annexUrl,
77 115 },
78 116 });
... ... @@ -150,7 +188,6 @@ export default ({ data, type, reloadTable }) =&gt; {
150 188 groupFilter: 'all',
151 189 },
152 190 });
153   - console.log(data, '5656data?.nameedit');
154 191 // const namesArray = res.data.data.map((item) => item.name);
155 192 // const formattedObject = res.data.data.reduce((acc, name) => {
156 193 // acc[name] = name; // 将名称作为键和值
... ... @@ -180,7 +217,7 @@ export default ({ data, type, reloadTable }) =&gt; {
180 217 label="联系人"
181 218 width="sm"
182 219 placeholder="请输入联系人"
183   - initialValue={data?.content}
  220 + initialValue={data?.contact}
184 221 readonly={optType[type].readOnly}
185 222 rules={[
186 223 {
... ... @@ -194,7 +231,7 @@ export default ({ data, type, reloadTable }) =&gt; {
194 231 label="联系电话"
195 232 width="sm"
196 233 placeholder="请输入联系电话"
197   - initialValue={data?.content}
  234 + initialValue={data?.contactPhone}
198 235 readonly={optType[type].readOnly}
199 236 rules={[
200 237 {
... ... @@ -314,7 +351,168 @@ export default ({ data, type, reloadTable }) =&gt; {
314 351 hidden
315 352 ></ProFormText>
316 353 <ProFormText initialValue={data?.id} name="id" hidden></ProFormText>
317   - <div className="styled-text">
  354 + <h2>工单指派</h2>
  355 + <ProFormList
  356 + // creatorButtonProps={{ disabled: optType('after-sales-check') }}
  357 + // deleteIconProps={!optType('after-sales-check')}
  358 + deleteIconProps={true}
  359 + name="ticketsList"
  360 + label=""
  361 + copyIconProps={false} //复制按钮不显示
  362 + // initialValue={[
  363 + // {
  364 + // ticketsType: '',
  365 + // ticketsDetail: '',
  366 + // assignPeople: '',
  367 + // ticketsAttachment: '',
  368 + // ticketsAttachments: '',
  369 + // },
  370 + // ]}
  371 + initialValue={
  372 + optType[type].title === '修改跟进记录'
  373 + ? data.ticketsList || []
  374 + : [
  375 + {
  376 + type: '',
  377 + detailText: '',
  378 + assignPeople: '',
  379 + annexUrl: '',
  380 + },
  381 + ]
  382 + }
  383 + actionGuard={{
  384 + beforeRemoveRow: async () => {
  385 + return new Promise((resolve) => {
  386 + let list = form.getFieldValue('ticketsList');
  387 + if (list && list.length === 1) {
  388 + message.error('至少需要保留一个工单');
  389 + resolve(false);
  390 + return;
  391 + }
  392 + resolve(true);
  393 + });
  394 + },
  395 + }}
  396 + itemRender={(doms, listMeta) => {
  397 + if (optType[type].title === '修改跟进记录') {
  398 + // let i = 0;
  399 + // // let defaultFileList = data.ticketsList?.annexUrl?.map((annex) => {
  400 + // // return {
  401 + // // uid: i++,
  402 + // // name: annex,
  403 + // // status: 'uploaded',
  404 + // // url: annex,
  405 + // // response: { data: [annex] },
  406 + // // };
  407 + // // });
  408 + let defaultFileList = [
  409 + {
  410 + uid: listMeta.index,
  411 + name: data.ticketsList[listMeta.index]?.annexUrl,
  412 + status: 'uploaded',
  413 + url: data.ticketsList[listMeta.index]?.annexUrl,
  414 + response: {
  415 + data: [data.ticketsList[listMeta.index]?.annexUrl],
  416 + },
  417 + },
  418 + ];
  419 + fileList[listMeta.index] = defaultFileList;
  420 + }
  421 + let itemFileList = fileList[listMeta.index];
  422 + return (
  423 + <ProCard
  424 + bordered
  425 + extra={doms.action}
  426 + title={'工单指派' + (listMeta.index + 1)}
  427 + style={{
  428 + marginBlockEnd: 8,
  429 + }}
  430 + >
  431 + {[
  432 + <ProFormSelect
  433 + key={'type' + listMeta.index}
  434 + name="type"
  435 + label="工单类型"
  436 + width="sm"
  437 + placeholder="请输入工单类型"
  438 + readonly={optType[type].readOnly}
  439 + fieldProps={{
  440 + labelInValue: false,
  441 + }}
  442 + // initialValue={data?.ticketsList?.type ? data?.ticketsList?.type + '' : null}
  443 + initialValue={
  444 + data?.ticketsList ? data?.ticketsList?.type + '' : null
  445 + }
  446 + request={async () => {
  447 + return [
  448 + { label: '问题', value: 'QUESTION' },
  449 + { label: '需求', value: 'DEMAND' },
  450 + { label: '建议', value: 'ADVICE' },
  451 + ];
  452 + }}
  453 + />,
  454 + <ProFormTextArea
  455 + key={'detailText' + listMeta.index}
  456 + name="detailText"
  457 + label="工单详情"
  458 + placeholder="请输入工单详情"
  459 + initialValue={data?.detailText ? data?.detailText + '' : null}
  460 + readonly={optType[type].readOnly}
  461 + ></ProFormTextArea>,
  462 + <ProFormSelect
  463 + key={'assignPeople' + listMeta.index}
  464 + name="assignPeople"
  465 + width="sm"
  466 + readonly={optType[type].readOnly}
  467 + fieldProps={{
  468 + labelInValue: false,
  469 + }}
  470 + initialValue={
  471 + data?.assignPeople ? data?.assignPeople + '' : null
  472 + }
  473 + label="指派人员"
  474 + request={async () => {
  475 + const res = await postOrderErpUsersListByPage({
  476 + data: {
  477 + pageSize: 10000,
  478 + },
  479 + });
  480 +
  481 + const userOptions = res.data.records
  482 + ? res.data.records.map((user) => ({
  483 + label: user.userName, // 或者使用其他需要的属性
  484 + value: user.userName, // 作为value的字段
  485 + }))
  486 + : [];
  487 + return userOptions;
  488 + }}
  489 + ></ProFormSelect>,
  490 + <>
  491 + <ProFormUploadDragger
  492 + key={'filePaths' + listMeta.index}
  493 + label="附件"
  494 + name="filePaths"
  495 + action="/api/service/order/fileProcess"
  496 + fieldProps={{
  497 + headers: {
  498 + Authorization: localStorage.getItem('token'),
  499 + },
  500 + // headers: {
  501 + // 'Content-Type':
  502 + // 'multipart/form-data; boundary=----WebKitFormBoundarynl6gT1BKdPWIejNq',
  503 + // },
  504 + itemFileList,
  505 + }}
  506 + max={1}
  507 + />
  508 + </>,
  509 + ]}
  510 + </ProCard>
  511 + );
  512 + }}
  513 + actionRef={actionRef}
  514 + ></ProFormList>
  515 + {/* <div className="styled-text">
318 516 <div className="vertical-line"></div>
319 517 <span className="text">工单指派</span>
320 518 </div>
... ... @@ -342,7 +540,7 @@ export default ({ data, type, reloadTable }) =&gt; {
342 540 placeholder="请输入工单详情"
343 541 initialValue={data?.ticketsDetail ? data?.ticketsDetail + '' : null}
344 542 readonly={optType[type].readOnly}
345   - ></ProFormTextArea>
  543 + ></ProFormTextArea> */}
346 544 {/* <ProFormUploadDragger
347 545 label="工单附件"
348 546 name="ticketsAttachment"
... ... @@ -371,7 +569,7 @@ export default ({ data, type, reloadTable }) =&gt; {
371 569 }}
372 570 max={1}
373 571 /> */}
374   - <Row>
  572 + {/* <Row>
375 573 <Col span={4}>附件:</Col>
376 574 <Col span={20}>
377 575 <UploadC
... ... @@ -426,13 +624,13 @@ export default ({ data, type, reloadTable }) =&gt; {
426 624  
427 625 const userOptions = res.data.records
428 626 ? res.data.records.map((user) => ({
429   - label: user.userName, // 或者使用其他需要的属性
430   - value: user.userName, // 作为value的字段
431   - }))
  627 + label: user.userName, // 或者使用其他需要的属性
  628 + value: user.userName, // 作为value的字段
  629 + }))
432 630 : [];
433 631 return userOptions;
434 632 }}
435   - ></ProFormSelect>
  633 + ></ProFormSelect> */}
436 634 </ModalForm>
437 635 );
438 636 };
... ...
src/pages/Client/Client/Components/ClientModal.tsx
1 1 import { RESPONSE_CODE } from '@/constants/enum';
2   -import UploadC from '@/pages/Invoice/waitProcessRecord/components/UploadSingleImg';
3 2 import {
4 3 postAdminClientAddOrModifyClientComunicationInfo,
5 4 postAdminClientQueryClientPage,
... ... @@ -10,74 +9,47 @@ import {
10 9 } from '@/services';
11 10 import { enumToSelect } from '@/utils';
12 11 import {
  12 + FormListActionType,
13 13 ModalForm,
  14 + ProCard,
14 15 ProFormDateTimePicker,
  16 + ProFormList,
15 17 ProFormSelect,
16 18 ProFormText,
17 19 ProFormTextArea,
18 20 ProFormUploadDragger,
19 21 } from '@ant-design/pro-components';
20   -import { Button, Col, Form, Row, message } from 'antd';
  22 +import { Button, Form, message } from 'antd';
21 23 import { RcFile } from 'antd/es/upload';
  24 +import { useRef } from 'react';
22 25 import './style.css';
23   -// import { useRef, useState } from 'react';
24 26 export default ({ data, type, reloadTable }) => {
25   - // const initialItems = [
26   - // { label: 'Tab 1', children: 'Content of Tab 1', key: '1' },
27   - // ];
28   - // const [activeKey, setActiveKey] = useState(initialItems[0].key);
29   - // const [items, setItems] = useState(initialItems);
30   - // const newTabIndex = useRef(1);
31   -
32   - // const onChange = (newActiveKey: string) => {
33   - // setActiveKey(newActiveKey);
34   - // };
35   -
36   - // const add = () => {
37   - // // 生成新的标签名,格式为 'Tab {num}'
38   - // const newTabLabel = `Tab ${newTabIndex.current + 1}`;
39   - // // 增加索引,保证下次生成新的Tab名称时,num会递增
40   - // newTabIndex.current++;
41   - // // 创建新的panes,追加新Tab
42   - // const newActiveKey = `newTab${newTabIndex.current}`;
43   - // const newPanes = [...items];
44   - // newPanes.push({ label: newTabLabel, children: 'Content of new Tab', key: newActiveKey });
45   - // setItems(newPanes);
46   - // setActiveKey(newActiveKey);
47   - // };
48   -
49   - // const remove = (targetKey: TargetKey) => {
50   - // let newActiveKey = activeKey;
51   - // let lastIndex = -1;
52   - // items.forEach((item, i) => {
53   - // if (item.key === targetKey) {
54   - // lastIndex = i - 1;
55   - // }
56   - // });
57   - // const newPanes = items.filter((item) => item.key !== targetKey);
58   - // if (newPanes.length && newActiveKey === targetKey) {
59   - // if (lastIndex >= 0) {
60   - // newActiveKey = newPanes[lastIndex].key;
61   - // } else {
62   - // newActiveKey = newPanes[0].key;
63   - // }
64   - // }
65   - // setItems(newPanes);
66   - // setActiveKey(newActiveKey);
67   - // };
68   -
69   - // const onEdit = (
70   - // targetKey: React.MouseEvent | React.KeyboardEvent | string,
71   - // action: 'add' | 'remove',
72   - // ) => {
73   - // if (action === 'add') {
74   - // add();
75   - // } else {
76   - // remove(targetKey);
77   - // }
78   - // };
79 27 const [form] = Form.useForm();
  28 + const actionRef = useRef<
  29 + FormListActionType<{
  30 + name: string;
  31 + }>
  32 + >();
  33 + const fileList: any = [];
80 34 const onfinish = async (values) => {
  35 + let list = values.list;
  36 + list = list.map((item, index) => {
  37 + // 尝试从 item.filePaths 中获取 annexUrl
  38 + const itemAnnexUrl = item?.filePaths?.[0]?.response?.data?.[0] || null;
  39 +
  40 + // 如果 itemAnnexUrl 为 null,则使用 data.ticketsList 对应的 annexUrl
  41 + if (
  42 + itemAnnexUrl === null &&
  43 + data.ticketsList[index]?.annexUrl &&
  44 + index < data.ticketsList.length
  45 + ) {
  46 + item.annexUrl = data.ticketsList[index].annexUrl; // 确保对比中的 annesUrl 也是 null
  47 + } else {
  48 + item.annexUrl = itemAnnexUrl; // 否则,使用从 item.filePaths 中获取的值
  49 + }
  50 + return item;
  51 + });
  52 + values.list = list;
81 53 const res = await postAdminClientAddOrModifyClientComunicationInfo({
82 54 data: {
83 55 ...values,
... ... @@ -184,7 +156,7 @@ export default ({ data, type, reloadTable }) =&gt; {
184 156 label="联系人"
185 157 width="sm"
186 158 placeholder="请输入联系人"
187   - initialValue={data?.content}
  159 + initialValue={data?.contact}
188 160 readonly={optType[type].readOnly}
189 161 rules={[
190 162 {
... ... @@ -198,7 +170,7 @@ export default ({ data, type, reloadTable }) =&gt; {
198 170 label="联系电话"
199 171 width="sm"
200 172 placeholder="请输入联系电话"
201   - initialValue={data?.content}
  173 + initialValue={data?.contactPhone}
202 174 readonly={optType[type].readOnly}
203 175 rules={[
204 176 {
... ... @@ -318,132 +290,140 @@ export default ({ data, type, reloadTable }) =&gt; {
318 290 hidden
319 291 ></ProFormText>
320 292 <ProFormText initialValue={data?.id} name="id" hidden></ProFormText>
321   - {/* <Tabs
322   - type="editable-card"
323   - onChange={onChange}
324   - activeKey={activeKey}
325   - onEdit={onEdit}
326   - items={items}
327   - /> */}
328   - <div className="styled-text">
329   - <div className="vertical-line"></div>
330   - <span className="text">工单指派</span>
331   - </div>
332   - <ProFormSelect
333   - name="ticketsType"
334   - label="工单类型"
335   - width="sm"
336   - placeholder="请输入工单类型"
337   - readonly={optType[type].readOnly}
338   - fieldProps={{
339   - labelInValue: false,
340   - }}
341   - initialValue={data?.type ? data?.type + '' : null}
342   - request={async () => {
343   - return [
344   - { label: '问题', value: 'QUESTION' },
345   - { label: '需求', value: 'DEMAND' },
346   - { label: '建议', value: 'ADVICE' },
347   - ];
348   - }}
349   - />
350   - <ProFormTextArea
351   - name="ticketsDetail"
352   - label="工单详情"
353   - placeholder="请输入工单详情"
354   - initialValue={data?.detailText ? data?.detailText + '' : null}
355   - readonly={optType[type].readOnly}
356   - ></ProFormTextArea>
357   - <Row>
358   - <Col span={4}>附件:</Col>
359   - <Col span={20}>
360   - <UploadC
361   - onFilesChange={async (newFileList) => {
362   - if (newFileList.length > 0) {
363   - const urls = []; // 创建一个数组来存储所有的 URL
364   -
365   - for (const file of newFileList) {
366   - const formData = new FormData();
367   - formData.append('file', file.originFileObj as RcFile);
368   -
369   - const res = await postOrderErpOrderStagesUpload({
370   - data: formData,
371   - headers: {
372   - 'Content-Type':
373   - 'multipart/form-data; boundary=----WebKitFormBoundarynl6gT1BKdPWIejNq',
374   - },
375   - });
376   -
377   - const url = res.data; // 获取响应中的 URL
378   - urls.push(url); // 将每个 URL 追加到数组中
379   - }
380   -
381   - // 将所有 URL 使用 ',' 进行拼接
382   - const combinedUrl = urls.join(',');
383   - form.setFieldValue('ticketsAttachments', combinedUrl); // 设置表单字段值为拼接后的 URL
384   - } else {
385   - form.setFieldValue('ticketsAttachments', null); // 如果没有文件,则清空 URL
  293 + <h2>工单指派</h2>
  294 + <ProFormList
  295 + // creatorButtonProps={{ disabled: optType('after-sales-check') }}
  296 + // deleteIconProps={!optType('after-sales-check')}
  297 + deleteIconProps={true}
  298 + name="list"
  299 + label=""
  300 + copyIconProps={false} //复制按钮不显示
  301 + initialValue={[
  302 + {
  303 + type: '',
  304 + detailText: '',
  305 + assignPeople: '',
  306 + annexUrl: '',
  307 + },
  308 + ]}
  309 + actionGuard={{
  310 + beforeRemoveRow: async () => {
  311 + return new Promise((resolve) => {
  312 + let list = form.getFieldValue('list');
  313 + if (list && list.length === 1) {
  314 + message.error('至少需要保留一个工单');
  315 + resolve(false);
  316 + return;
386 317 }
387   - }}
388   - ></UploadC>
389   - </Col>
390   - </Row>
391   - {/* <ProFormUploadDragger
392   - label="工单附件"
393   - name="ticketsAttachment"
394   - action="upload.do"
395   - hidden={optType[type].readOnly}
396   - onChange={(info) => {
397   - const uploadFile = async ({ fileList: newFileList }) => {
398   - if (newFileList.length > 0) {
399   - const formData = new FormData();
400   - formData.append('file', newFileList[0].originFileObj as RcFile);
401   - const res = await postOrderErpOrderStagesUpload({
402   - data: formData,
403   - headers: {
404   - 'Content-Type':
405   - 'multipart/form-data; boundary=----WebKitFormBoundarynl6gT1BKdPWIejNq',
406   - },
407   - });
408   - const url = res.data;
409   - console.log('ticketsAttachments' + JSON.stringify(url));
410   - form.setFieldValue('ticketsAttachments', url);
411   - } else {
412   - form.setFieldValue('ticketsAttachments', null);
413   - }
414   - };
415   - uploadFile(info);
416   - }}
417   - max={1}
418   - /> */}
419   - <a hidden={!optType[type].readOnly} href={data?.orderAttachment} download>
420   - 下载附件
421   - </a>
422   - <ProFormSelect
423   - name="assignPeople"
424   - width="sm"
425   - readonly={optType[type].readOnly}
426   - fieldProps={{
427   - labelInValue: false,
  318 + resolve(true);
  319 + });
  320 + },
428 321 }}
429   - initialValue={data?.assignPeople ? data?.assignPeople + '' : null}
430   - label="指派人员"
431   - request={async () => {
432   - const res = await postOrderErpUsersListByPage({
433   - data: {
434   - pageSize: 10000,
435   - },
436   - });
  322 + itemRender={(doms, listMeta) => {
  323 + if (optType[type].modify || optType[type].add || optType[type].add2) {
  324 + let i = 0;
  325 + let defaultFileList = listMeta.record?.listAnnex?.map((annex) => {
  326 + return {
  327 + uid: i++,
  328 + name: annex,
  329 + status: 'uploaded',
  330 + url: annex,
  331 + response: { data: [annex] },
  332 + };
  333 + });
  334 + fileList[listMeta.index] = defaultFileList;
  335 + }
  336 + let itemFileList = fileList[listMeta.index];
  337 + return (
  338 + <ProCard
  339 + bordered
  340 + extra={doms.action}
  341 + title={'工单指派' + (listMeta.index + 1)}
  342 + style={{
  343 + marginBlockEnd: 8,
  344 + }}
  345 + >
  346 + {[
  347 + <ProFormSelect
  348 + key={'type' + listMeta.index}
  349 + name="type"
  350 + label="工单类型"
  351 + width="sm"
  352 + placeholder="请输入工单类型"
  353 + readonly={optType[type].readOnly}
  354 + fieldProps={{
  355 + labelInValue: false,
  356 + }}
  357 + initialValue={data?.type ? data?.type + '' : null}
  358 + request={async () => {
  359 + return [
  360 + { label: '问题', value: 'QUESTION' },
  361 + { label: '需求', value: 'DEMAND' },
  362 + { label: '建议', value: 'ADVICE' },
  363 + ];
  364 + }}
  365 + />,
  366 + <ProFormTextArea
  367 + key={'detailText' + listMeta.index}
  368 + name="detailText"
  369 + label="工单详情"
  370 + placeholder="请输入工单详情"
  371 + initialValue={data?.detailText ? data?.detailText + '' : null}
  372 + readonly={optType[type].readOnly}
  373 + ></ProFormTextArea>,
  374 + <ProFormSelect
  375 + key={'assignPeople' + listMeta.index}
  376 + name="assignPeople"
  377 + width="sm"
  378 + readonly={optType[type].readOnly}
  379 + fieldProps={{
  380 + labelInValue: false,
  381 + }}
  382 + initialValue={
  383 + data?.assignPeople ? data?.assignPeople + '' : null
  384 + }
  385 + label="指派人员"
  386 + request={async () => {
  387 + const res = await postOrderErpUsersListByPage({
  388 + data: {
  389 + pageSize: 10000,
  390 + },
  391 + });
437 392  
438   - const userOptions = res.data.records
439   - ? res.data.records.map((user) => ({
440   - label: user.userName, // 或者使用其他需要的属性
441   - value: user.userName, // 作为value的字段
442   - }))
443   - : [];
444   - return userOptions;
  393 + const userOptions = res.data.records
  394 + ? res.data.records.map((user) => ({
  395 + label: user.userName, // 或者使用其他需要的属性
  396 + value: user.userName, // 作为value的字段
  397 + }))
  398 + : [];
  399 + return userOptions;
  400 + }}
  401 + ></ProFormSelect>,
  402 + <>
  403 + <ProFormUploadDragger
  404 + key={'filePaths' + listMeta.index}
  405 + label="附件"
  406 + name="filePaths"
  407 + action="/api/service/order/fileProcess"
  408 + fieldProps={{
  409 + headers: {
  410 + Authorization: localStorage.getItem('token'),
  411 + },
  412 + // headers: {
  413 + // 'Content-Type':
  414 + // 'multipart/form-data; boundary=----WebKitFormBoundarynl6gT1BKdPWIejNq',
  415 + // },
  416 + itemFileList,
  417 + }}
  418 + max={1}
  419 + />
  420 + </>,
  421 + ]}
  422 + </ProCard>
  423 + );
445 424 }}
446   - ></ProFormSelect>
  425 + actionRef={actionRef}
  426 + ></ProFormList>
447 427 </ModalForm>
448 428 );
449 429 };
... ...
src/pages/Client/Client/Components/InformationHistoryModal.tsx
... ... @@ -27,10 +27,6 @@ export default ({ data, reloadTable }) =&gt; {
27 27 const [createTime, setCreateTime] = useState(null); // 创建时间
28 28 const [attachments, setAttachments] = useState(); //附件
29 29 const [attachmentsName, setAttachmentsName] = useState(''); // 附件名称
30   - const [ticketsType, setTicketsType] = useState(''); // 附件名称
31   - const [ticketsDetail, setTicketsDetail] = useState(''); // 附件名称
32   - const [ticketsAttachment, setTicketsAttachment] = useState(''); // 附件名称
33   - const [assignPeople, setAssignPeople] = useState(''); // 附件名称
34 30 const [comment, setComment] = useState(''); // 客户评价
35 31  
36 32 useEffect(() => {
... ... @@ -56,10 +52,6 @@ export default ({ data, reloadTable }) =&gt; {
56 52 }
57 53 }
58 54 setComment(dataSearch.comment);
59   - setTicketsType(dataSearch.ticketsTypeText);
60   - setTicketsDetail(dataSearch.ticketsDetail);
61   - setTicketsAttachment(dataSearch.ticketsAttachments);
62   - setAssignPeople(dataSearch.assignPeople);
63 55 setDatetime(dataSearch.datetime); // 设置跟进日期
64 56 // setDateRange(data.dateRange || []); // 设置跟进时间范围
65 57 setCreateByName(dataSearch.createByName); // 设置跟进人员
... ... @@ -115,26 +107,6 @@ export default ({ data, reloadTable }) =&gt; {
115 107 },
116 108 {
117 109 key: '8',
118   - label: '工单类型',
119   - children: ticketsType, // 跟进状态
120   - },
121   - {
122   - key: '9',
123   - label: '工单详情',
124   - children: ticketsDetail, // 跟进状态
125   - },
126   - // {
127   - // key: '10',
128   - // label: '工单附件',
129   - // children: ticketsAttachment, // 跟进状态
130   - // },
131   - {
132   - key: '10',
133   - label: '指派人员',
134   - children: assignPeople, // 跟进状态
135   - },
136   - {
137   - key: '11',
138 110 label: '客户评价',
139 111 children: comment, // 跟进状态
140 112 },
... ... @@ -151,6 +123,40 @@ export default ({ data, reloadTable }) =&gt; {
151 123 actionRef?.current?.reload(); // 重新加载表格数据
152 124 }
153 125 };
  126 + const TicketDescriptions = ({ data }) => {
  127 + return (
  128 + <div>
  129 + {data.ticketsList && data.ticketsList.length > 0 ? (
  130 + data.ticketsList.map((ticket, index) => (
  131 + <div key={index} style={{ marginBottom: '20px' }}>
  132 + <Descriptions title={`工单 ${index + 1}`} column={1}>
  133 + <Descriptions.Item label="工单类型">
  134 + {ticket.typeText}
  135 + </Descriptions.Item>
  136 + <Descriptions.Item label="工单详情">
  137 + {ticket.detailText}
  138 + </Descriptions.Item>
  139 + <Descriptions.Item label="指派人员">
  140 + {ticket.assignPeople}
  141 + </Descriptions.Item>
  142 + </Descriptions>
  143 + {ticket.annexUrl && (
  144 + <a
  145 + href={ticket.annexUrl}
  146 + target="_blank"
  147 + rel="noopener noreferrer"
  148 + >
  149 + 下载工单附件
  150 + </a>
  151 + )}
  152 + </div>
  153 + ))
  154 + ) : (
  155 + <p></p>
  156 + )}
  157 + </div>
  158 + );
  159 + };
154 160 return (
155 161 <Space>
156 162 <ModalForm
... ... @@ -215,11 +221,6 @@ export default ({ data, reloadTable }) =&gt; {
215 221 }}
216 222 >
217 223 <Descriptions items={items} column={1} />
218   - {/* {attachmentsName && (
219   - <a href={attachments} download>
220   - 附件:{attachmentsName}
221   - </a>
222   - )} */}
223 224 {attachmentsName && (
224 225 <div>
225 226 {attachmentsName.endsWith('.png') ||
... ... @@ -242,6 +243,12 @@ export default ({ data, reloadTable }) =&gt; {
242 243 )}
243 244 </div>
244 245 )}
  246 + <TicketDescriptions data={data} />
  247 + {/* {attachmentsName && (
  248 + <a href={attachments} download>
  249 + 附件:{attachmentsName}
  250 + </a>
  251 + )} */}
245 252  
246 253 <div></div>
247 254 {/* {ticketsAttachment && (
... ... @@ -271,12 +278,12 @@ export default ({ data, reloadTable }) =&gt; {
271 278 )}
272 279 </div>
273 280 )} */}
274   - {ticketsAttachment && (
  281 + {/* {ticketsAttachment && (
275 282 <div>
276 283 {ticketsAttachment.split(',').map((ticketsAttachment, index) => (
277 284 <div key={index}>
278 285 {ticketsAttachment.includes('jpg') ||
279   - ticketsAttachment.includes('png') ? (
  286 + ticketsAttachment.includes('png') ? (
280 287 <>
281 288 <img
282 289 src={ticketsAttachment}
... ... @@ -292,7 +299,7 @@ export default ({ data, reloadTable }) =&gt; {
292 299 </div>
293 300 ))}
294 301 </div>
295   - )}
  302 + )} */}
296 303 </ModalForm>
297 304 </Space>
298 305 );
... ...
src/pages/Client/FollowRecord/Components/ClientModal.tsx
1 1 import { RESPONSE_CODE } from '@/constants/enum';
2   -import UploadC from '@/pages/Invoice/waitProcessRecord/components/UploadSingleImg';
3 2 import {
4 3 postAdminClientAddOrModifyClientComunicationInfo,
5 4 postAdminClientQueryClientPage,
... ... @@ -10,21 +9,48 @@ import {
10 9 } from '@/services';
11 10 import { enumToSelect } from '@/utils';
12 11 import {
  12 + FormListActionType,
13 13 ModalForm,
  14 + ProCard,
14 15 ProFormDateTimePicker,
  16 + ProFormList,
15 17 ProFormSelect,
16 18 ProFormText,
17 19 ProFormTextArea,
18 20 ProFormUploadDragger,
19 21 } from '@ant-design/pro-components';
20   -import { Button, Col, Form, Row, message } from 'antd';
  22 +import { Button, Form, message } from 'antd';
21 23 import { RcFile } from 'antd/es/upload';
22   -import { useEffect } from 'react';
  24 +import { useEffect, useRef } from 'react';
23 25 import './style.css';
24 26 export default ({ data, type, reloadTable }) => {
25 27 useEffect(() => {});
26 28 const [form] = Form.useForm();
  29 + const actionRef = useRef<
  30 + FormListActionType<{
  31 + name: string;
  32 + }>
  33 + >();
  34 + const fileList: any = [];
27 35 const onfinish = async (values) => {
  36 + let list = values.ticketsList;
  37 + list = list.map((item, index) => {
  38 + // 尝试从 item.filePaths 中获取 annexUrl
  39 + const itemAnnexUrl = item?.filePaths?.[0]?.response?.data?.[0] || null;
  40 +
  41 + // 如果 itemAnnexUrl 为 null,则使用 data.ticketsList 对应的 annexUrl
  42 + if (
  43 + itemAnnexUrl === null &&
  44 + data.ticketsList[index]?.annexUrl &&
  45 + index < data.ticketsList.length
  46 + ) {
  47 + item.annexUrl = data.ticketsList[index].annexUrl; // 确保对比中的 annesUrl 也是 null
  48 + } else {
  49 + item.annexUrl = itemAnnexUrl; // 否则,使用从 item.filePaths 中获取的值
  50 + }
  51 + return item;
  52 + });
  53 + values.list = list;
28 54 const resSearchId = await postAdminClientQueryClientPage({
29 55 data: {
30 56 groupFilter: 'all',
... ... @@ -43,7 +69,7 @@ export default ({ data, type, reloadTable }) =&gt; {
43 69 const res = await postAdminClientAddOrModifyClientComunicationInfo({
44 70 data: {
45 71 ...values,
46   - ticketsAttachments: form.getFieldValue('ticketsAttachments'),
  72 + // ticketsAttachments: form.getFieldValue('ticketsAttachments'),
47 73 clientId: matchedId,
48 74 },
49 75 });
... ... @@ -58,24 +84,35 @@ export default ({ data, type, reloadTable }) =&gt; {
58 84 const editOnfinish = async (values) => {
59 85 // setEditClientId(data.clientId);
60 86 values.clientId = data.clientId;
61   -
62   - // const resSearchId = await postAdminClientQueryClientPage({
63   - // data: {
64   - // groupFilter: 'all',
65   - // },
  87 + let list = values.ticketsList;
  88 + // list = list.map((item) => {
  89 + // // item.annexUrl = item.filePaths?.map((file) => {
  90 + // // return { url: file.response.data[0] };
  91 + // // });
  92 + // // item.annexUrl = item?.filePaths[0].response?.data[0];
  93 + // item.annexUrl = item?.filePaths?.[0]?.response?.data?.[0] || null; // 使用 null 或默认值
  94 + // return item;
66 95 // });
67   - // const matchingItem = resSearchId.data.data.find(
68   - // (item) => item.id === values.name,
69   - // );
  96 + list = list.map((item, index) => {
  97 + // 尝试从 item.filePaths 中获取 annexUrl
  98 + const itemAnnexUrl = item?.filePaths?.[0]?.response?.data?.[0] || null;
  99 +
  100 + // 如果 itemAnnexUrl 为 null,则使用 data.ticketsList 对应的 annexUrl
  101 + if (
  102 + itemAnnexUrl === null &&
  103 + data.ticketsList[index]?.annexUrl &&
  104 + index < data.ticketsList.length
  105 + ) {
  106 + item.annexUrl = data.ticketsList[index].annexUrl; // 确保对比中的 annesUrl 也是 null
  107 + } else {
  108 + item.annexUrl = itemAnnexUrl; // 否则,使用从 item.filePaths 中获取的值
  109 + }
  110 + return item;
  111 + });
  112 + values.list = list;
70 113 const res = await postAdminClientAddOrModifyClientComunicationInfo({
71 114 data: {
72 115 ...values,
73   - // ticketsAttachments: form.getFieldValue("ticketsAttachments"),
74   - ticketsAttachments:
75   - form.getFieldValue('ticketsAttachments') !== undefined
76   - ? form.getFieldValue('ticketsAttachments')
77   - : data?.ticketsAttachments,
78   - // ticketsAttachments: data?.annexUrl,
79 116 },
80 117 });
81 118 if (res.result === RESPONSE_CODE.SUCCESS) {
... ... @@ -315,7 +352,168 @@ export default ({ data, type, reloadTable }) =&gt; {
315 352 hidden
316 353 ></ProFormText>
317 354 <ProFormText initialValue={data?.id} name="id" hidden></ProFormText>
318   - <div className="styled-text">
  355 + <h2>工单指派</h2>
  356 + <ProFormList
  357 + // creatorButtonProps={{ disabled: optType('after-sales-check') }}
  358 + // deleteIconProps={!optType('after-sales-check')}
  359 + deleteIconProps={true}
  360 + name="ticketsList"
  361 + label=""
  362 + copyIconProps={false} //复制按钮不显示
  363 + // initialValue={[
  364 + // {
  365 + // ticketsType: '',
  366 + // ticketsDetail: '',
  367 + // assignPeople: '',
  368 + // ticketsAttachment: '',
  369 + // ticketsAttachments: '',
  370 + // },
  371 + // ]}
  372 + initialValue={
  373 + optType[type].title === '修改跟进记录'
  374 + ? data.ticketsList || []
  375 + : [
  376 + {
  377 + type: '',
  378 + detailText: '',
  379 + assignPeople: '',
  380 + annexUrl: '',
  381 + },
  382 + ]
  383 + }
  384 + actionGuard={{
  385 + beforeRemoveRow: async () => {
  386 + return new Promise((resolve) => {
  387 + let list = form.getFieldValue('ticketsList');
  388 + if (list && list.length === 1) {
  389 + message.error('至少需要保留一个工单');
  390 + resolve(false);
  391 + return;
  392 + }
  393 + resolve(true);
  394 + });
  395 + },
  396 + }}
  397 + itemRender={(doms, listMeta) => {
  398 + if (optType[type].title === '修改跟进记录') {
  399 + // let i = 0;
  400 + // // let defaultFileList = data.ticketsList?.annexUrl?.map((annex) => {
  401 + // // return {
  402 + // // uid: i++,
  403 + // // name: annex,
  404 + // // status: 'uploaded',
  405 + // // url: annex,
  406 + // // response: { data: [annex] },
  407 + // // };
  408 + // // });
  409 + let defaultFileList = [
  410 + {
  411 + uid: listMeta.index,
  412 + name: data.ticketsList[listMeta.index]?.annexUrl,
  413 + status: 'uploaded',
  414 + url: data.ticketsList[listMeta.index]?.annexUrl,
  415 + response: {
  416 + data: [data.ticketsList[listMeta.index]?.annexUrl],
  417 + },
  418 + },
  419 + ];
  420 + fileList[listMeta.index] = defaultFileList;
  421 + }
  422 + let itemFileList = fileList[listMeta.index];
  423 + return (
  424 + <ProCard
  425 + bordered
  426 + extra={doms.action}
  427 + title={'工单指派' + (listMeta.index + 1)}
  428 + style={{
  429 + marginBlockEnd: 8,
  430 + }}
  431 + >
  432 + {[
  433 + <ProFormSelect
  434 + key={'type' + listMeta.index}
  435 + name="type"
  436 + label="工单类型"
  437 + width="sm"
  438 + placeholder="请输入工单类型"
  439 + readonly={optType[type].readOnly}
  440 + fieldProps={{
  441 + labelInValue: false,
  442 + }}
  443 + // initialValue={data?.ticketsList?.type ? data?.ticketsList?.type + '' : null}
  444 + initialValue={
  445 + data?.ticketsList ? data?.ticketsList?.type + '' : null
  446 + }
  447 + request={async () => {
  448 + return [
  449 + { label: '问题', value: 'QUESTION' },
  450 + { label: '需求', value: 'DEMAND' },
  451 + { label: '建议', value: 'ADVICE' },
  452 + ];
  453 + }}
  454 + />,
  455 + <ProFormTextArea
  456 + key={'detailText' + listMeta.index}
  457 + name="detailText"
  458 + label="工单详情"
  459 + placeholder="请输入工单详情"
  460 + initialValue={data?.detailText ? data?.detailText + '' : null}
  461 + readonly={optType[type].readOnly}
  462 + ></ProFormTextArea>,
  463 + <ProFormSelect
  464 + key={'assignPeople' + listMeta.index}
  465 + name="assignPeople"
  466 + width="sm"
  467 + readonly={optType[type].readOnly}
  468 + fieldProps={{
  469 + labelInValue: false,
  470 + }}
  471 + initialValue={
  472 + data?.assignPeople ? data?.assignPeople + '' : null
  473 + }
  474 + label="指派人员"
  475 + request={async () => {
  476 + const res = await postOrderErpUsersListByPage({
  477 + data: {
  478 + pageSize: 10000,
  479 + },
  480 + });
  481 +
  482 + const userOptions = res.data.records
  483 + ? res.data.records.map((user) => ({
  484 + label: user.userName, // 或者使用其他需要的属性
  485 + value: user.userName, // 作为value的字段
  486 + }))
  487 + : [];
  488 + return userOptions;
  489 + }}
  490 + ></ProFormSelect>,
  491 + <>
  492 + <ProFormUploadDragger
  493 + key={'filePaths' + listMeta.index}
  494 + label="附件"
  495 + name="filePaths"
  496 + action="/api/service/order/fileProcess"
  497 + fieldProps={{
  498 + headers: {
  499 + Authorization: localStorage.getItem('token'),
  500 + },
  501 + // headers: {
  502 + // 'Content-Type':
  503 + // 'multipart/form-data; boundary=----WebKitFormBoundarynl6gT1BKdPWIejNq',
  504 + // },
  505 + itemFileList,
  506 + }}
  507 + max={1}
  508 + />
  509 + </>,
  510 + ]}
  511 + </ProCard>
  512 + );
  513 + }}
  514 + actionRef={actionRef}
  515 + ></ProFormList>
  516 + {/* <div className="styled-text">
319 517 <div className="vertical-line"></div>
320 518 <span className="text">工单指派</span>
321 519 </div>
... ... @@ -348,7 +546,7 @@ export default ({ data, type, reloadTable }) =&gt; {
348 546 }}
349 547 initialValue={data?.ticketsDetail ? data?.ticketsDetail + '' : null}
350 548 readonly={optType[type].readOnly}
351   - ></ProFormTextArea>
  549 + ></ProFormTextArea> */}
352 550 {/* <ProFormUploadDragger
353 551 label="工单附件"
354 552 name="ticketsAttachment"
... ... @@ -377,7 +575,7 @@ export default ({ data, type, reloadTable }) =&gt; {
377 575 }}
378 576 max={1}
379 577 /> */}
380   - <Row>
  578 + {/* <Row>
381 579 <Col span={4}>附件:</Col>
382 580 <Col span={20}>
383 581 <UploadC
... ... @@ -416,7 +614,6 @@ export default ({ data, type, reloadTable }) =&gt; {
416 614 </Col>
417 615 </Row>
418 616 <a hidden={!optType[type].readOnly} href={data?.orderAttachment} download>
419   - {/* <a href={data?.annexUrl} download> */}
420 617 下载附件
421 618 </a>
422 619 <ProFormSelect
... ... @@ -443,7 +640,7 @@ export default ({ data, type, reloadTable }) =&gt; {
443 640 : [];
444 641 return userOptions;
445 642 }}
446   - ></ProFormSelect>
  643 + ></ProFormSelect> */}
447 644 </ModalForm>
448 645 );
449 646 };
... ...
src/pages/Client/FollowRecord/Components/CommunicationHistoryModal.tsx
... ... @@ -15,26 +15,15 @@ export default ({ data, reloadTable }) =&gt; {
15 15 const [datetime, setDatetime] = useState(); // 跟进日期
16 16 const [createByName, setCreateByName] = useState(''); // 跟进人员
17 17 const [clientName, setClientName] = useState(''); // 客户名称
18   - // const [clientAddress, setClientAddress] = useState(''); // 客户地址
19 18 const [way, setWay] = useState(); // 跟进方式
20 19 const [tradeStatusText, setTradeStatusText] = useState(); // 状态
21   - // const [clientNameLike, setClientNameLike] = useState(''); // 客户名称模糊查询
22   - // const [clientAddressLike, setClientAddressLike] = useState(''); // 客户地址模糊查询
23   - // const [tradeStatus, setTradeStatus] = useState(''); // 客户状态
24   - // const [tradeStatusLike, setTradeStatusLike] = useState(''); // 客户状态模糊查询
25 20 const [content, setContent] = useState(''); // 跟进详情
26 21 const [createTime, setCreateTime] = useState(null); // 创建时间
27 22 const [attachments, setAttachments] = useState(); //附件
28 23 const [attachmentsName, setAttachmentsName] = useState(''); // 附件名称
29   - const [ticketsType, setTicketsType] = useState(''); // 附件名称
30   - const [ticketsDetail, setTicketsDetail] = useState(''); // 附件名称
31   - const [ticketsAttachment, setTicketsAttachment] = useState(); // 附件名称
32   - // const [ticketsAttachmentName, setTicketsAttachmentName] = useState(''); // 附件名称
33 24 const [comment, setComment] = useState(''); // 客户评价
34   - const [assignPeople, setAssignPeople] = useState(''); // 附件名称
35 25 useEffect(() => {
36 26 const request = async () => {
37   - console.log(data, '5656datatatatata');
38 27 const res = await postAdminClientQueryClientComunicationInfo({
39 28 data: {
40 29 id: data.id,
... ... @@ -82,10 +71,6 @@ export default ({ data, reloadTable }) =&gt; {
82 71 // }
83 72 // }
84 73 setComment(dataSearch.comment);
85   - setTicketsType(dataSearch.ticketsTypeText);
86   - setTicketsDetail(dataSearch.ticketsDetail);
87   - setTicketsAttachment(dataSearch.ticketsAttachments);
88   - setAssignPeople(dataSearch.assignPeople);
89 74 setComment(dataSearch.comment);
90 75 setDatetime(dataSearch.datetime); // 设置跟进日期
91 76 // setDateRange(data.dateRange || []); // 设置跟进时间范围
... ... @@ -142,29 +127,24 @@ export default ({ data, reloadTable }) =&gt; {
142 127 },
143 128 {
144 129 key: '8',
145   - label: '工单类型',
146   - children: ticketsType, // 跟进状态
147   - },
148   - {
149   - key: '9',
150   - label: '工单详情',
151   - children: ticketsDetail, // 跟进状态
152   - },
153   - // {
154   - // key: '12',
155   - // label: '工单附件',
156   - // children: ticketsAttachment, // 跟进状态
157   - // },
158   - {
159   - key: '10',
160   - label: '指派人员',
161   - children: assignPeople, // 跟进状态
162   - },
163   - {
164   - key: '11',
165 130 label: '客户评价',
166 131 children: comment, // 跟进状态
167 132 },
  133 + // {
  134 + // key: '9',
  135 + // label: '工单类型',
  136 + // children: ticketsType, // 跟进状态
  137 + // },
  138 + // {
  139 + // key: '10',
  140 + // label: '工单详情',
  141 + // children: ticketsDetail, // 跟进状态
  142 + // },
  143 + // {
  144 + // key: '11',
  145 + // label: '指派人员',
  146 + // children: assignPeople, // 跟进状态
  147 + // },
168 148 ];
169 149 const handleDelete = async () => {
170 150 // 调用删除接口
... ... @@ -178,6 +158,40 @@ export default ({ data, reloadTable }) =&gt; {
178 158 actionRef?.current?.reload(); // 重新加载表格数据
179 159 }
180 160 };
  161 + const TicketDescriptions = ({ data }) => {
  162 + return (
  163 + <div>
  164 + {data.ticketsList && data.ticketsList.length > 0 ? (
  165 + data.ticketsList.map((ticket, index) => (
  166 + <div key={index} style={{ marginBottom: '20px' }}>
  167 + <Descriptions title={`工单 ${index + 1}`} column={1}>
  168 + <Descriptions.Item label="工单类型">
  169 + {ticket.typeText}
  170 + </Descriptions.Item>
  171 + <Descriptions.Item label="工单详情">
  172 + {ticket.detailText}
  173 + </Descriptions.Item>
  174 + <Descriptions.Item label="指派人员">
  175 + {ticket.assignPeople}
  176 + </Descriptions.Item>
  177 + </Descriptions>
  178 + {ticket.annexUrl && (
  179 + <a
  180 + href={ticket.annexUrl}
  181 + target="_blank"
  182 + rel="noopener noreferrer"
  183 + >
  184 + 下载工单附件
  185 + </a>
  186 + )}
  187 + </div>
  188 + ))
  189 + ) : (
  190 + <p></p>
  191 + )}
  192 + </div>
  193 + );
  194 + };
181 195 return (
182 196 <Space>
183 197 <ModalForm
... ... @@ -242,17 +256,6 @@ export default ({ data, reloadTable }) =&gt; {
242 256 }}
243 257 >
244 258 <Descriptions items={items} column={1} />
245   - {/* {attachmentsName && (
246   - <a href={attachments} download>
247   - 附件:{attachmentsName}
248   - </a>
249   - )}
250   - <div></div>
251   - {ticketsAttachment && (
252   - <a href={ticketsAttachment} download>
253   - 工单附件:{ticketsAttachment}
254   - </a>
255   - )} */}
256 259 {attachmentsName && (
257 260 <div>
258 261 {attachmentsName.endsWith('.png') ||
... ... @@ -275,6 +278,18 @@ export default ({ data, reloadTable }) =&gt; {
275 278 )}
276 279 </div>
277 280 )}
  281 + <TicketDescriptions data={data} />
  282 + {/* {attachmentsName && (
  283 + <a href={attachments} download>
  284 + 附件:{attachmentsName}
  285 + </a>
  286 + )}
  287 + <div></div>
  288 + {ticketsAttachment && (
  289 + <a href={ticketsAttachment} download>
  290 + 工单附件:{ticketsAttachment}
  291 + </a>
  292 + )} */}
278 293  
279 294 <div></div>
280 295 {/* {ticketsAttachment && (
... ... @@ -304,28 +319,6 @@ export default ({ data, reloadTable }) =&gt; {
304 319 )}
305 320 </div>
306 321 )} */}
307   - {ticketsAttachment && (
308   - <div>
309   - {ticketsAttachment.split(',').map((ticketsAttachment, index) => (
310   - <div key={index}>
311   - {ticketsAttachment.includes('jpg') ||
312   - ticketsAttachment.includes('png') ? (
313   - <>
314   - <img
315   - src={ticketsAttachment}
316   - alt={`附件 ${index + 1}`}
317   - style={{ maxWidth: '300px', height: 'auto' }}
318   - />
319   - <div></div>
320   - </>
321   - ) : null}
322   - <a href={ticketsAttachment} download>
323   - 工单附件:{ticketsAttachment}
324   - </a>
325   - </div>
326   - ))}
327   - </div>
328   - )}
329 322 </ModalForm>
330 323 </Space>
331 324 );
... ...
src/pages/Order/Order/components/FeedbackRegistrationModal.tsx
... ... @@ -7,9 +7,9 @@ export default ({ setVisible, subOrders, mainOrder, onClose }) =&gt; {
7 7 const [isModalOpen] = useState(true);
8 8 const { TextArea } = Input;
9 9 const [textValue, setTextValue] = useState('');
  10 + console.log(mainOrder);
10 11  
11 12 const handleOk = async () => {
12   - console.log(subOrders, '5656subOrders', mainOrder);
13 13 await postServiceOrderFeedbackRegistration({
14 14 data: {
15 15 id: subOrders[0].id,
... ...
src/pages/Order/Order/index.tsx
... ... @@ -56,12 +56,9 @@ const OrderPage = () =&gt; {
56 56 res.data.waitInvoicing !== 0) &&
57 57 openCount !== 'true'
58 58 ) {
59   - console.log(open, '5656re222s', res);
60   -
61 59 setOpenCount('true');
62 60 setOpen(true);
63 61 }
64   - console.log(open, '5656res', res);
65 62 setInvoiceWarningNum(res.data.waitConfirmInvoice);
66 63 setInvoiceRefundWarningNum(res.data.waitConfirmReceipt);
67 64 setWaitConfirmPayment(res.data.waitConfirmPayment);
... ...
src/pages/Order/OrderList/FeedbackRegistrationModal.tsx
... ... @@ -7,9 +7,9 @@ export default ({ setVisible, subOrders, mainOrder, onClose }) =&gt; {
7 7 const [isModalOpen] = useState(true);
8 8 const { TextArea } = Input;
9 9 const [textValue, setTextValue] = useState('');
  10 + console.log(mainOrder);
10 11  
11 12 const handleOk = async () => {
12   - console.log(subOrders, '5656subOrders', mainOrder);
13 13 await postServiceOrderFeedbackRegistration({
14 14 data: {
15 15 id: subOrders[0].id,
... ...
src/pages/Order/OrderList/OrderList.tsx
... ... @@ -215,7 +215,7 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) =&gt; {
215 215 const [recordOptNode, setRecordOptNode] = useState(null);
216 216 const roleCode = userInfo?.roleSmallVO?.code;
217 217 const roles = userInfo?.roles;
218   - const [newParams, setNewParams] = useState<any>();
  218 + const [setNewParams] = useState<any>();
219 219 const canMergeInvoicing = useMemo(() => {
220 220 if (subOrderSelectedMap.size === 0) {
221 221 return false;
... ... @@ -4589,7 +4589,6 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) =&gt; {
4589 4589 setNewParams(paramsNew);
4590 4590 }
4591 4591 refreshTable();
4592   - console.log(paramsNew, '5656paramsNewc', newParams);
4593 4592 }, [paramsNew]);
4594 4593 return (
4595 4594 <div className="order-page-container">
... ... @@ -4684,7 +4683,6 @@ const OrderList = ({ paramsNew, searchShow, toolbarShow }) =&gt; {
4684 4683 }
4685 4684 //保存这个搜索条件
4686 4685 setSearchParam(params);
4687   - console.log(paramsNew, '5656paramsNew');
4688 4686 const { data } = await postServiceOrderQueryServiceOrder({
4689 4687 // ...params,
4690 4688 // FIXME: remove @ts-ignore
... ...
src/pages/Order/OrderWarning/components/FeedbackRegistrationModal.tsx
... ... @@ -7,9 +7,9 @@ export default ({ setVisible, subOrders, mainOrder, onClose }) =&gt; {
7 7 const [isModalOpen] = useState(true);
8 8 const { TextArea } = Input;
9 9 const [textValue, setTextValue] = useState('');
  10 + console.log(mainOrder);
10 11  
11 12 const handleOk = async () => {
12   - console.log(subOrders, '5656subOrders', mainOrder);
13 13 await postServiceOrderFeedbackRegistration({
14 14 data: {
15 15 id: subOrders[0].id,
... ...
src/pages/Order/OrderWarning/index.tsx
... ... @@ -147,7 +147,6 @@ const OrderPage = () =&gt; {
147 147 waitConfirmPaymentStatusDateTimeLe: setOriginTime(options5[0].value),
148 148 },
149 149 });
150   - console.log(res, '5656565656');
151 150 setInvoiceWarningNum(res.data.waitConfirmInvoice);
152 151 setInvoiceCreateWarningNum(res.data.waitInvoicing);
153 152 setInvoiceRefundWarningNum(res.data.waitConfirmReceipt);
... ... @@ -502,7 +501,6 @@ const OrderPage = () =&gt; {
502 501 applyTimeLe: calDate,
503 502 };
504 503 }
505   - console.log(initialParams, '5656initialParams');
506 504 // 返回完整的参数对象
507 505 return initialParams;
508 506 })()}
... ...
src/pages/Order/WarningWhitelist/index.tsx
... ... @@ -87,7 +87,6 @@ const WarningWhitelist = () =&gt; {
87 87 title={'确认删除此项吗?'}
88 88 text="删除"
89 89 onConfirm={async () => {
90   - console.log(record, '5656record');
91 90 await postServiceOrderDeleteWarningUserWhiteList({
92 91 query: {
93 92 orderId: record.orderId,
... ... @@ -113,7 +112,6 @@ const WarningWhitelist = () =&gt; {
113 112 search: {
114 113 transform: (value) => {
115 114 if (value) {
116   - console.log(value, '5656valueid');
117 115 return {
118 116 orderId: Number(value),
119 117 };
... ... @@ -165,7 +163,6 @@ const WarningWhitelist = () =&gt; {
165 163 title={'确认删除此项吗?'}
166 164 text="删除"
167 165 onConfirm={async () => {
168   - console.log(record.orderId, '5656idoreder');
169 166 await postServiceOrderDeleteWarningOrderWhiteList({
170 167 query: {
171 168 orderId: record.orderId,
... ... @@ -192,7 +189,6 @@ const WarningWhitelist = () =&gt; {
192 189 const res = await postServiceOrderWarningUserWhiteLists({
193 190 data: { ...params },
194 191 });
195   - console.log(res.data, '5656res.data');
196 192 return res.data;
197 193 }}
198 194 rowKey="id"
... ... @@ -228,7 +224,6 @@ const WarningWhitelist = () =&gt; {
228 224 }}
229 225 submitTimeout={2000}
230 226 onFinish={async (values) => {
231   - console.log(values, '5656values');
232 227 const res = await postServiceOrderAddWarningUserWhiteList({
233 228 data: {
234 229 userName: values.orderIdsText,
... ... @@ -239,7 +234,6 @@ const WarningWhitelist = () =&gt; {
239 234 setTimeout(() => {
240 235 actionRef.current?.reload();
241 236 }, 50);
242   - console.log('res5656 :>> ', res);
243 237 message.success('添加成功');
244 238 return true;
245 239 }
... ... @@ -310,7 +304,6 @@ const WarningWhitelist = () =&gt; {
310 304 }}
311 305 submitTimeout={2000}
312 306 onFinish={async (values) => {
313   - console.log(values, '5656values');
314 307 const res = await postServiceOrderAddWarningOrderWhiteList({
315 308 data: {
316 309 orderId: values.orderIdsText,
... ... @@ -345,13 +338,7 @@ const WarningWhitelist = () =&gt; {
345 338 ];
346 339 return (
347 340 <div>
348   - <Tabs
349   - defaultActiveKey="1"
350   - items={tabsItems}
351   - onChange={(value) => {
352   - console.log(value, '5656tabsvalue');
353   - }}
354   - />
  341 + <Tabs defaultActiveKey="1" items={tabsItems} onChange={() => {}} />
355 342 </div>
356 343 );
357 344 };
... ...