Commit 5213ab602dd34ad95754dc85b5782431a1f46ee7
1 parent
0a62353d
fix: 修改附件组件
Showing
8 changed files
with
311 additions
and
56 deletions
src/pages/Client/Client/Components/ClientInformationModal.tsx
1 | 1 | import { RESPONSE_CODE } from '@/constants/enum'; |
2 | +import UploadC from '@/pages/Invoice/waitProcessRecord/components/UploadSingleImg'; | |
2 | 3 | import { |
3 | 4 | postAdminClientAddOrModifyClientComunicationInfo, |
4 | 5 | postAdminClientQueryClientPage, |
... | ... | @@ -16,7 +17,7 @@ import { |
16 | 17 | ProFormTextArea, |
17 | 18 | ProFormUploadDragger, |
18 | 19 | } from '@ant-design/pro-components'; |
19 | -import { Button, Form, message } from 'antd'; | |
20 | +import { Button, Col, Form, Row, message } from 'antd'; | |
20 | 21 | import { RcFile } from 'antd/es/upload'; |
21 | 22 | import './style.css'; |
22 | 23 | export default ({ data, type, reloadTable }) => { |
... | ... | @@ -342,7 +343,7 @@ export default ({ data, type, reloadTable }) => { |
342 | 343 | initialValue={data?.ticketsDetail ? data?.ticketsDetail + '' : null} |
343 | 344 | readonly={optType[type].readOnly} |
344 | 345 | ></ProFormTextArea> |
345 | - <ProFormUploadDragger | |
346 | + {/* <ProFormUploadDragger | |
346 | 347 | label="工单附件" |
347 | 348 | name="ticketsAttachment" |
348 | 349 | action="upload.do" |
... | ... | @@ -369,7 +370,41 @@ export default ({ data, type, reloadTable }) => { |
369 | 370 | uploadFile(info); |
370 | 371 | }} |
371 | 372 | max={1} |
372 | - /> | |
373 | + /> */} | |
374 | + <Row> | |
375 | + <Col span={4}>上传发票:</Col> | |
376 | + <Col span={20}> | |
377 | + <UploadC | |
378 | + onFilesChange={async (newFileList) => { | |
379 | + if (newFileList.length > 0) { | |
380 | + const urls = []; // 创建一个数组来存储所有的 URL | |
381 | + | |
382 | + for (const file of newFileList) { | |
383 | + const formData = new FormData(); | |
384 | + formData.append('file', file.originFileObj as RcFile); | |
385 | + | |
386 | + const res = await postOrderErpOrderStagesUpload({ | |
387 | + data: formData, | |
388 | + headers: { | |
389 | + 'Content-Type': | |
390 | + 'multipart/form-data; boundary=----WebKitFormBoundarynl6gT1BKdPWIejNq', | |
391 | + }, | |
392 | + }); | |
393 | + | |
394 | + const url = res.data; // 获取响应中的 URL | |
395 | + urls.push(url); // 将每个 URL 追加到数组中 | |
396 | + } | |
397 | + | |
398 | + // 将所有 URL 使用 ',' 进行拼接 | |
399 | + const combinedUrl = urls.join(','); | |
400 | + form.setFieldValue('ticketsAttachments', combinedUrl); // 设置表单字段值为拼接后的 URL | |
401 | + } else { | |
402 | + form.setFieldValue('ticketsAttachments', null); // 如果没有文件,则清空 URL | |
403 | + } | |
404 | + }} | |
405 | + ></UploadC> | |
406 | + </Col> | |
407 | + </Row> | |
373 | 408 | <a hidden={!optType[type].readOnly} href={data?.orderAttachment} download> |
374 | 409 | 下载附件 |
375 | 410 | </a> | ... | ... |
src/pages/Client/Client/Components/ClientModal.tsx
1 | 1 | import { RESPONSE_CODE } from '@/constants/enum'; |
2 | +import UploadC from '@/pages/Invoice/waitProcessRecord/components/UploadSingleImg'; | |
2 | 3 | import { |
3 | 4 | postAdminClientAddOrModifyClientComunicationInfo, |
4 | 5 | postAdminClientQueryClientPage, |
... | ... | @@ -16,7 +17,7 @@ import { |
16 | 17 | ProFormTextArea, |
17 | 18 | ProFormUploadDragger, |
18 | 19 | } from '@ant-design/pro-components'; |
19 | -import { Button, Form, message } from 'antd'; | |
20 | +import { Button, Col, Form, Row, message } from 'antd'; | |
20 | 21 | import { RcFile } from 'antd/es/upload'; |
21 | 22 | import './style.css'; |
22 | 23 | export default ({ data, type, reloadTable }) => { |
... | ... | @@ -291,7 +292,41 @@ export default ({ data, type, reloadTable }) => { |
291 | 292 | initialValue={data?.detailText ? data?.detailText + '' : null} |
292 | 293 | readonly={optType[type].readOnly} |
293 | 294 | ></ProFormTextArea> |
294 | - <ProFormUploadDragger | |
295 | + <Row> | |
296 | + <Col span={4}>上传发票:</Col> | |
297 | + <Col span={20}> | |
298 | + <UploadC | |
299 | + onFilesChange={async (newFileList) => { | |
300 | + if (newFileList.length > 0) { | |
301 | + const urls = []; // 创建一个数组来存储所有的 URL | |
302 | + | |
303 | + for (const file of newFileList) { | |
304 | + const formData = new FormData(); | |
305 | + formData.append('file', file.originFileObj as RcFile); | |
306 | + | |
307 | + const res = await postOrderErpOrderStagesUpload({ | |
308 | + data: formData, | |
309 | + headers: { | |
310 | + 'Content-Type': | |
311 | + 'multipart/form-data; boundary=----WebKitFormBoundarynl6gT1BKdPWIejNq', | |
312 | + }, | |
313 | + }); | |
314 | + | |
315 | + const url = res.data; // 获取响应中的 URL | |
316 | + urls.push(url); // 将每个 URL 追加到数组中 | |
317 | + } | |
318 | + | |
319 | + // 将所有 URL 使用 ',' 进行拼接 | |
320 | + const combinedUrl = urls.join(','); | |
321 | + form.setFieldValue('ticketsAttachments', combinedUrl); // 设置表单字段值为拼接后的 URL | |
322 | + } else { | |
323 | + form.setFieldValue('ticketsAttachments', null); // 如果没有文件,则清空 URL | |
324 | + } | |
325 | + }} | |
326 | + ></UploadC> | |
327 | + </Col> | |
328 | + </Row> | |
329 | + {/* <ProFormUploadDragger | |
295 | 330 | label="工单附件" |
296 | 331 | name="ticketsAttachment" |
297 | 332 | action="upload.do" |
... | ... | @@ -318,7 +353,7 @@ export default ({ data, type, reloadTable }) => { |
318 | 353 | uploadFile(info); |
319 | 354 | }} |
320 | 355 | max={1} |
321 | - /> | |
356 | + /> */} | |
322 | 357 | <a hidden={!optType[type].readOnly} href={data?.orderAttachment} download> |
323 | 358 | 下载附件 |
324 | 359 | </a> | ... | ... |
src/pages/Client/Client/Components/InformationHistoryModal.tsx
... | ... | @@ -2,7 +2,6 @@ |
2 | 2 | import ClientInformationModal from '@/pages/Client/Client/Components/ClientInformationModal'; |
3 | 3 | |
4 | 4 | import { |
5 | - getOrderErpTicketsGetTicketsByClientId, | |
6 | 5 | postAdminClientQueryClientComunicationInfo, |
7 | 6 | postAdminClientRemoveClientComunicationInfo, |
8 | 7 | } from '@/services/request'; |
... | ... | @@ -31,6 +30,7 @@ export default ({ data, reloadTable }) => { |
31 | 30 | const [ticketsDetail, setTicketsDetail] = useState(''); // 附件名称 |
32 | 31 | const [ticketsAttachment, setTicketsAttachment] = useState(''); // 附件名称 |
33 | 32 | const [assignPeople, setAssignPeople] = useState(''); // 附件名称 |
33 | + const [comment, setComment] = useState(''); // 客户评价 | |
34 | 34 | |
35 | 35 | useEffect(() => { |
36 | 36 | const request = async () => { |
... | ... | @@ -39,18 +39,9 @@ export default ({ data, reloadTable }) => { |
39 | 39 | id: data.id, |
40 | 40 | }, |
41 | 41 | }); |
42 | - const resTicket = await getOrderErpTicketsGetTicketsByClientId({ | |
43 | - query: { | |
44 | - id: data.id, | |
45 | - }, | |
46 | - }); | |
47 | 42 | const dataSearch = res.data.data[0]; |
48 | 43 | |
49 | 44 | if (dataSearch) { |
50 | - data.type = resTicket.data.type; | |
51 | - data.detailText = resTicket.data.detailText; | |
52 | - data.annexUrl = resTicket.data.annexUrl; | |
53 | - data.assignPeople = resTicket.data.assignPeople; | |
54 | 45 | if (dataSearch.attachments) { |
55 | 46 | const url = dataSearch.attachments; |
56 | 47 | const match = url.match(/aliyuncs\.com\/(.*?)\?/); |
... | ... | @@ -63,11 +54,11 @@ export default ({ data, reloadTable }) => { |
63 | 54 | setAttachmentsName(decodedStr); // 设置跟进日期 |
64 | 55 | } |
65 | 56 | } |
66 | - | |
57 | + setComment(dataSearch.comment); | |
67 | 58 | setTicketsType(dataSearch.ticketsTypeText); |
68 | - setTicketsDetail(resTicket.data.detailText); | |
69 | - setTicketsAttachment(resTicket.data.annexUrl); | |
70 | - setAssignPeople(resTicket.data.assignPeople); | |
59 | + setTicketsDetail(dataSearch.ticketsDetail); | |
60 | + setTicketsAttachment(dataSearch.ticketsAttachments); | |
61 | + setAssignPeople(dataSearch.assignPeople); | |
71 | 62 | setDatetime(dataSearch.datetime); // 设置跟进日期 |
72 | 63 | // setDateRange(data.dateRange || []); // 设置跟进时间范围 |
73 | 64 | setCreateByName(dataSearch.createByName); // 设置跟进人员 |
... | ... | @@ -141,6 +132,11 @@ export default ({ data, reloadTable }) => { |
141 | 132 | label: '指派人员', |
142 | 133 | children: assignPeople, // 跟进状态 |
143 | 134 | }, |
135 | + { | |
136 | + key: '11', | |
137 | + label: '客户评价', | |
138 | + children: comment, // 跟进状态 | |
139 | + }, | |
144 | 140 | ]; |
145 | 141 | const handleDelete = async () => { |
146 | 142 | // 调用删除接口 |
... | ... | @@ -250,10 +246,10 @@ export default ({ data, reloadTable }) => { |
250 | 246 | 工单附件:{ticketsAttachment} |
251 | 247 | </a> |
252 | 248 | )} */} |
253 | - {ticketsAttachment && ( | |
249 | + {/* {ticketsAttachment && ( | |
254 | 250 | <div> |
255 | 251 | {ticketsAttachment.includes('jpg') || |
256 | - ticketsAttachment.includes('png') ? ( | |
252 | + ticketsAttachment.includes('png') ? ( | |
257 | 253 | <> |
258 | 254 | <img |
259 | 255 | src={ticketsAttachment} |
... | ... | @@ -271,6 +267,28 @@ export default ({ data, reloadTable }) => { |
271 | 267 | </a> |
272 | 268 | )} |
273 | 269 | </div> |
270 | + )} */} | |
271 | + {ticketsAttachment && ( | |
272 | + <div> | |
273 | + {ticketsAttachment.split(',').map((ticketsAttachment, index) => ( | |
274 | + <div key={index}> | |
275 | + {ticketsAttachment.includes('jpg') || | |
276 | + ticketsAttachment.includes('png') ? ( | |
277 | + <> | |
278 | + <img | |
279 | + src={ticketsAttachment} | |
280 | + alt={`附件 ${index + 1}`} | |
281 | + style={{ maxWidth: '300px', height: 'auto' }} | |
282 | + /> | |
283 | + <div></div> | |
284 | + </> | |
285 | + ) : null} | |
286 | + <a href={ticketsAttachment} download> | |
287 | + 工单附件:{ticketsAttachment} | |
288 | + </a> | |
289 | + </div> | |
290 | + ))} | |
291 | + </div> | |
274 | 292 | )} |
275 | 293 | </ModalForm> |
276 | 294 | </Space> | ... | ... |
src/pages/Client/Client/index.tsx
... | ... | @@ -166,6 +166,13 @@ const columns = [ |
166 | 166 | // return enumToSelect(res.data); |
167 | 167 | // }, |
168 | 168 | // }, |
169 | + // { | |
170 | + // title: '创建人', | |
171 | + // width: 150, | |
172 | + // ellipsis: true, | |
173 | + // dataIndex: 'createByName', | |
174 | + // hideInSearch: true, | |
175 | + // }, | |
169 | 176 | { |
170 | 177 | title: '客户等级', |
171 | 178 | width: 150, | ... | ... |
src/pages/Client/FollowRecord/Components/ClientModal.tsx
1 | 1 | import { RESPONSE_CODE } from '@/constants/enum'; |
2 | +import UploadC from '@/pages/Invoice/waitProcessRecord/components/UploadSingleImg'; | |
2 | 3 | import { |
3 | 4 | postAdminClientAddOrModifyClientComunicationInfo, |
4 | 5 | postAdminClientQueryClientPage, |
... | ... | @@ -16,7 +17,7 @@ import { |
16 | 17 | ProFormTextArea, |
17 | 18 | ProFormUploadDragger, |
18 | 19 | } from '@ant-design/pro-components'; |
19 | -import { Button, Form, message } from 'antd'; | |
20 | +import { Button, Col, Form, Row, message } from 'antd'; | |
20 | 21 | import { RcFile } from 'antd/es/upload'; |
21 | 22 | import './style.css'; |
22 | 23 | export default ({ data, type, reloadTable }) => { |
... | ... | @@ -341,7 +342,7 @@ export default ({ data, type, reloadTable }) => { |
341 | 342 | initialValue={data?.ticketsDetail ? data?.ticketsDetail + '' : null} |
342 | 343 | readonly={optType[type].readOnly} |
343 | 344 | ></ProFormTextArea> |
344 | - <ProFormUploadDragger | |
345 | + {/* <ProFormUploadDragger | |
345 | 346 | label="工单附件" |
346 | 347 | name="ticketsAttachment" |
347 | 348 | action="upload.do" |
... | ... | @@ -368,7 +369,41 @@ export default ({ data, type, reloadTable }) => { |
368 | 369 | uploadFile(info); |
369 | 370 | }} |
370 | 371 | max={1} |
371 | - /> | |
372 | + /> */} | |
373 | + <Row> | |
374 | + <Col span={4}>上传发票:</Col> | |
375 | + <Col span={20}> | |
376 | + <UploadC | |
377 | + onFilesChange={async (newFileList) => { | |
378 | + if (newFileList.length > 0) { | |
379 | + const urls = []; // 创建一个数组来存储所有的 URL | |
380 | + | |
381 | + for (const file of newFileList) { | |
382 | + const formData = new FormData(); | |
383 | + formData.append('file', file.originFileObj as RcFile); | |
384 | + | |
385 | + const res = await postOrderErpOrderStagesUpload({ | |
386 | + data: formData, | |
387 | + headers: { | |
388 | + 'Content-Type': | |
389 | + 'multipart/form-data; boundary=----WebKitFormBoundarynl6gT1BKdPWIejNq', | |
390 | + }, | |
391 | + }); | |
392 | + | |
393 | + const url = res.data; // 获取响应中的 URL | |
394 | + urls.push(url); // 将每个 URL 追加到数组中 | |
395 | + } | |
396 | + | |
397 | + // 将所有 URL 使用 ',' 进行拼接 | |
398 | + const combinedUrl = urls.join(','); | |
399 | + form.setFieldValue('ticketsAttachments', combinedUrl); // 设置表单字段值为拼接后的 URL | |
400 | + } else { | |
401 | + form.setFieldValue('ticketsAttachments', null); // 如果没有文件,则清空 URL | |
402 | + } | |
403 | + }} | |
404 | + ></UploadC> | |
405 | + </Col> | |
406 | + </Row> | |
372 | 407 | <a hidden={!optType[type].readOnly} href={data?.orderAttachment} download> |
373 | 408 | {/* <a href={data?.annexUrl} download> */} |
374 | 409 | 下载附件 | ... | ... |
src/pages/Client/FollowRecord/Components/ClientModal2.tsx
1 | 1 | import { RESPONSE_CODE } from '@/constants/enum'; |
2 | +import UploadC from '@/pages/Invoice/waitProcessRecord/components/UploadSingleImg'; | |
2 | 3 | import { |
3 | 4 | postAdminClientAddOrModifyClientComunicationInfo, |
4 | 5 | postAdminClientQueryClientPage, |
... | ... | @@ -16,7 +17,7 @@ import { |
16 | 17 | ProFormTextArea, |
17 | 18 | ProFormUploadDragger, |
18 | 19 | } from '@ant-design/pro-components'; |
19 | -import { Button, Form, message } from 'antd'; | |
20 | +import { Button, Col, Form, Row, message } from 'antd'; | |
20 | 21 | import { RcFile } from 'antd/es/upload'; |
21 | 22 | import './style.css'; |
22 | 23 | export default ({ data, type, reloadTable }) => { |
... | ... | @@ -72,6 +73,10 @@ export default ({ data, type, reloadTable }) => { |
72 | 73 | form.getFieldValue('ticketsAttachments') !== undefined |
73 | 74 | ? form.getFieldValue('ticketsAttachments') |
74 | 75 | : data?.ticketsAttachments, |
76 | + url: | |
77 | + form.getFieldValue('url') !== undefined | |
78 | + ? form.getFieldValue('url') | |
79 | + : data?.url, | |
75 | 80 | // ticketsAttachments: data?.annexUrl, |
76 | 81 | }, |
77 | 82 | }); |
... | ... | @@ -341,7 +346,7 @@ export default ({ data, type, reloadTable }) => { |
341 | 346 | initialValue={data?.ticketsDetail ? data?.ticketsDetail + '' : null} |
342 | 347 | readonly={optType[type].readOnly} |
343 | 348 | ></ProFormTextArea> |
344 | - <ProFormUploadDragger | |
349 | + {/* <ProFormUploadDragger | |
345 | 350 | label="工单附件" |
346 | 351 | name="ticketsAttachment" |
347 | 352 | action="upload.do" |
... | ... | @@ -368,7 +373,41 @@ export default ({ data, type, reloadTable }) => { |
368 | 373 | uploadFile(info); |
369 | 374 | }} |
370 | 375 | max={1} |
371 | - /> | |
376 | + /> */} | |
377 | + <Row> | |
378 | + <Col span={4}>上传发票:</Col> | |
379 | + <Col span={20}> | |
380 | + <UploadC | |
381 | + onFilesChange={async (newFileList) => { | |
382 | + if (newFileList.length > 0) { | |
383 | + const urls = []; // 创建一个数组来存储所有的 URL | |
384 | + | |
385 | + for (const file of newFileList) { | |
386 | + const formData = new FormData(); | |
387 | + formData.append('file', file.originFileObj as RcFile); | |
388 | + | |
389 | + const res = await postOrderErpOrderStagesUpload({ | |
390 | + data: formData, | |
391 | + headers: { | |
392 | + 'Content-Type': | |
393 | + 'multipart/form-data; boundary=----WebKitFormBoundarynl6gT1BKdPWIejNq', | |
394 | + }, | |
395 | + }); | |
396 | + | |
397 | + const url = res.data; // 获取响应中的 URL | |
398 | + urls.push(url); // 将每个 URL 追加到数组中 | |
399 | + } | |
400 | + | |
401 | + // 将所有 URL 使用 ',' 进行拼接 | |
402 | + const combinedUrl = urls.join(','); | |
403 | + form.setFieldValue('ticketsAttachments', combinedUrl); // 设置表单字段值为拼接后的 URL | |
404 | + } else { | |
405 | + form.setFieldValue('ticketsAttachments', null); // 如果没有文件,则清空 URL | |
406 | + } | |
407 | + }} | |
408 | + ></UploadC> | |
409 | + </Col> | |
410 | + </Row> | |
372 | 411 | <a hidden={!optType[type].readOnly} href={data?.orderAttachment} download> |
373 | 412 | {/* <a href={data?.annexUrl} download> */} |
374 | 413 | 下载附件 |
... | ... | @@ -397,6 +436,40 @@ export default ({ data, type, reloadTable }) => { |
397 | 436 | return userOptions; |
398 | 437 | }} |
399 | 438 | ></ProFormSelect> |
439 | + {/* <Row> | |
440 | + <Col span={4}>上传发票:</Col> | |
441 | + <Col span={20}> | |
442 | + <UploadC | |
443 | + onFilesChange={async (newFileList) => { | |
444 | + if (newFileList.length > 0) { | |
445 | + const urls = []; // 创建一个数组来存储所有的 URL | |
446 | + | |
447 | + for (const file of newFileList) { | |
448 | + const formData = new FormData(); | |
449 | + formData.append('file', file.originFileObj as RcFile); | |
450 | + | |
451 | + const res = await postOrderErpOrderStagesUpload({ | |
452 | + data: formData, | |
453 | + headers: { | |
454 | + 'Content-Type': | |
455 | + 'multipart/form-data; boundary=----WebKitFormBoundarynl6gT1BKdPWIejNq', | |
456 | + }, | |
457 | + }); | |
458 | + | |
459 | + const url = res.data; // 获取响应中的 URL | |
460 | + urls.push(url); // 将每个 URL 追加到数组中 | |
461 | + } | |
462 | + | |
463 | + // 将所有 URL 使用 ',' 进行拼接 | |
464 | + const combinedUrl = urls.join(','); | |
465 | + form.setFieldValue('url', combinedUrl); // 设置表单字段值为拼接后的 URL | |
466 | + } else { | |
467 | + form.setFieldValue('url', null); // 如果没有文件,则清空 URL | |
468 | + } | |
469 | + }} | |
470 | + ></UploadC> | |
471 | + </Col> | |
472 | + </Row> */} | |
400 | 473 | </ModalForm> |
401 | 474 | ); |
402 | 475 | }; | ... | ... |
src/pages/Client/FollowRecord/Components/CommunicationHistoryModal.tsx
1 | 1 | import ClientModal from '@/pages/Client/FollowRecord/Components/ClientModal'; |
2 | 2 | import { |
3 | - getOrderErpTicketsGetTicketsByClientId, | |
4 | 3 | postAdminClientQueryClientComunicationInfo, |
5 | 4 | postAdminClientRemoveClientComunicationInfo, |
6 | 5 | } from '@/services/request'; |
... | ... | @@ -28,8 +27,9 @@ export default ({ data, reloadTable }) => { |
28 | 27 | const [attachmentsName, setAttachmentsName] = useState(''); // 附件名称 |
29 | 28 | const [ticketsType, setTicketsType] = useState(''); // 附件名称 |
30 | 29 | const [ticketsDetail, setTicketsDetail] = useState(''); // 附件名称 |
31 | - const [ticketsAttachment, setTicketsAttachment] = useState(''); // 附件名称 | |
30 | + const [ticketsAttachment, setTicketsAttachment] = useState(); // 附件名称 | |
32 | 31 | // const [ticketsAttachmentName, setTicketsAttachmentName] = useState(''); // 附件名称 |
32 | + const [comment, setComment] = useState(''); // 客户评价 | |
33 | 33 | const [assignPeople, setAssignPeople] = useState(''); // 附件名称 |
34 | 34 | useEffect(() => { |
35 | 35 | const request = async () => { |
... | ... | @@ -38,22 +38,23 @@ export default ({ data, reloadTable }) => { |
38 | 38 | id: data.id, |
39 | 39 | }, |
40 | 40 | }); |
41 | - const resTicket = await getOrderErpTicketsGetTicketsByClientId({ | |
42 | - query: { | |
43 | - id: data.id, | |
44 | - }, | |
45 | - }); | |
41 | + // const resTicket = await getOrderErpTicketsGetTicketsByClientId({ | |
42 | + // query: { | |
43 | + // id: data.id, | |
44 | + // }, | |
45 | + // }); | |
46 | 46 | // data.type = resTicket.data.type; |
47 | 47 | // data.detailText = resTicket.data.detailText; |
48 | 48 | // data.annexUrl = resTicket.data.annexUrl; |
49 | 49 | // data.assignPeople = resTicket.data.assignPeople; |
50 | 50 | // console.log(resTicket, '5656resTicket'); |
51 | 51 | const dataSearch = res.data.data[0]; |
52 | + console.log(dataSearch, '5656dataSearch'); | |
52 | 53 | if (dataSearch) { |
53 | - data.type = resTicket.data.type; | |
54 | - data.detailText = resTicket.data.detailText; | |
55 | - data.annexUrl = resTicket.data.annexUrl; | |
56 | - data.assignPeople = resTicket.data.assignPeople; | |
54 | + // data.type = resTicket.data.type; | |
55 | + // data.detailText = resTicket.data.detailText; | |
56 | + // data.annexUrl = resTicket.data.annexUrl; | |
57 | + // data.assignPeople = resTicket.data.assignPeople; | |
57 | 58 | if (dataSearch.attachments) { |
58 | 59 | const url = dataSearch.attachments; |
59 | 60 | const match = url.match(/aliyuncs\.com\/(.*?)\?/); |
... | ... | @@ -78,10 +79,12 @@ export default ({ data, reloadTable }) => { |
78 | 79 | // setTicketsAttachmentName(decodedStr); // 设置跟进日期 |
79 | 80 | // } |
80 | 81 | // } |
82 | + setComment(dataSearch.comment); | |
81 | 83 | setTicketsType(dataSearch.ticketsTypeText); |
82 | - setTicketsDetail(resTicket.data.detailText); | |
83 | - setTicketsAttachment(resTicket.data.annexUrl); | |
84 | - setAssignPeople(resTicket.data.assignPeople); | |
84 | + setTicketsDetail(dataSearch.ticketsDetail); | |
85 | + setTicketsAttachment(dataSearch.ticketsAttachments); | |
86 | + setAssignPeople(dataSearch.assignPeople); | |
87 | + setComment(dataSearch.comment); | |
85 | 88 | setDatetime(dataSearch.datetime); // 设置跟进日期 |
86 | 89 | // setDateRange(data.dateRange || []); // 设置跟进时间范围 |
87 | 90 | setCreateByName(dataSearch.createByName); // 设置跟进人员 |
... | ... | @@ -146,7 +149,7 @@ export default ({ data, reloadTable }) => { |
146 | 149 | children: ticketsDetail, // 跟进状态 |
147 | 150 | }, |
148 | 151 | // { |
149 | - // key: '10', | |
152 | + // key: '12', | |
150 | 153 | // label: '工单附件', |
151 | 154 | // children: ticketsAttachment, // 跟进状态 |
152 | 155 | // }, |
... | ... | @@ -155,6 +158,11 @@ export default ({ data, reloadTable }) => { |
155 | 158 | label: '指派人员', |
156 | 159 | children: assignPeople, // 跟进状态 |
157 | 160 | }, |
161 | + { | |
162 | + key: '11', | |
163 | + label: '客户评价', | |
164 | + children: comment, // 跟进状态 | |
165 | + }, | |
158 | 166 | ]; |
159 | 167 | const handleDelete = async () => { |
160 | 168 | // 调用删除接口 |
... | ... | @@ -192,11 +200,7 @@ export default ({ data, reloadTable }) => { |
192 | 200 | key={'modify'} |
193 | 201 | // data={data} // 将表单数据传递给 ClientModal |
194 | 202 | data={{ |
195 | - ...data, | |
196 | - type: data.type, | |
197 | - detailText: data.detailText, | |
198 | - annexUrl: data.annexUrl, | |
199 | - assignPeople: data.assignPeople, | |
203 | + data, | |
200 | 204 | }} // 传递修改后的 data |
201 | 205 | reloadTable={() => { |
202 | 206 | actionRef?.current?.reload(); // 重新加载表格数据 |
... | ... | @@ -277,10 +281,10 @@ export default ({ data, reloadTable }) => { |
277 | 281 | 工单附件:{ticketsAttachment} |
278 | 282 | </a> |
279 | 283 | )} */} |
280 | - {ticketsAttachment && ( | |
284 | + {/* {ticketsAttachment && ( | |
281 | 285 | <div> |
282 | 286 | {ticketsAttachment.includes('jpg') || |
283 | - ticketsAttachment.includes('png') ? ( | |
287 | + ticketsAttachment.includes('png') ? ( | |
284 | 288 | <> |
285 | 289 | <img |
286 | 290 | src={ticketsAttachment} |
... | ... | @@ -298,6 +302,28 @@ export default ({ data, reloadTable }) => { |
298 | 302 | </a> |
299 | 303 | )} |
300 | 304 | </div> |
305 | + )} */} | |
306 | + {ticketsAttachment && ( | |
307 | + <div> | |
308 | + {ticketsAttachment.split(',').map((ticketsAttachment, index) => ( | |
309 | + <div key={index}> | |
310 | + {ticketsAttachment.includes('jpg') || | |
311 | + ticketsAttachment.includes('png') ? ( | |
312 | + <> | |
313 | + <img | |
314 | + src={ticketsAttachment} | |
315 | + alt={`附件 ${index + 1}`} | |
316 | + style={{ maxWidth: '300px', height: 'auto' }} | |
317 | + /> | |
318 | + <div></div> | |
319 | + </> | |
320 | + ) : null} | |
321 | + <a href={ticketsAttachment} download> | |
322 | + 工单附件:{ticketsAttachment} | |
323 | + </a> | |
324 | + </div> | |
325 | + ))} | |
326 | + </div> | |
301 | 327 | )} |
302 | 328 | </ModalForm> |
303 | 329 | </Space> | ... | ... |
src/pages/Client/FollowRecord/index.tsx
... | ... | @@ -10,7 +10,7 @@ import { |
10 | 10 | import { enumToSelect } from '@/utils'; |
11 | 11 | import type { ActionType } from '@ant-design/pro-components'; |
12 | 12 | import { ProTable } from '@ant-design/pro-components'; |
13 | -import { Button, Space, message } from 'antd'; | |
13 | +import { Button, Popconfirm, Space, message } from 'antd'; | |
14 | 14 | import { useRef, useState } from 'react'; |
15 | 15 | import ClientModal2 from './Components/ClientModal2'; |
16 | 16 | |
... | ... | @@ -264,7 +264,7 @@ export default () => { |
264 | 264 | style={{ marginRight: '10px' }} |
265 | 265 | />, |
266 | 266 | <> |
267 | - <Button | |
267 | + {/* <Button | |
268 | 268 | key={'delete'} |
269 | 269 | onClick={() => { |
270 | 270 | handleDelete(); |
... | ... | @@ -276,13 +276,39 @@ export default () => { |
276 | 276 | type="primary" |
277 | 277 | size="middle" |
278 | 278 | danger |
279 | - // 使用 danger 属性来将按钮颜色设置为红色 | |
280 | - // onFinish={() => { | |
281 | - // actionRef.current.reload(); | |
282 | - // }} | |
279 | + // 使用 danger 属性来将按钮颜色设置为红色 | |
280 | + // onFinish={() => { | |
281 | + // actionRef.current.reload(); | |
282 | + // }} | |
283 | 283 | > |
284 | 284 | 删除 |
285 | 285 | </Button> |
286 | + <ButtonConfirm | |
287 | + key={'delete'} | |
288 | + className="p-0" | |
289 | + title={'是否确认删除'} | |
290 | + text="删除" | |
291 | + type="primary" | |
292 | + size="middle" | |
293 | + danger | |
294 | + onConfirm={async () => { | |
295 | + handleDelete(); | |
296 | + actionRef.current.reload(); | |
297 | + }} | |
298 | + /> */} | |
299 | + <Popconfirm | |
300 | + title={'是否确认删除'} | |
301 | + onConfirm={async () => { | |
302 | + handleDelete(); | |
303 | + actionRef.current.reload(); | |
304 | + }} | |
305 | + okText="确认" | |
306 | + cancelText="取消" | |
307 | + > | |
308 | + <Button key={'delete'} type="primary" size="middle" danger> | |
309 | + 删除 | |
310 | + </Button> | |
311 | + </Popconfirm> | |
286 | 312 | </>, |
287 | 313 | ]; |
288 | 314 | }, | ... | ... |