Blame view

src/pages/Order/OrderList/FeedbackRegistrationModal.tsx 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import { postServiceOrderFeedbackRegistration } from '@/services/request';
import { Input, Modal } from 'antd';
import { useState } from 'react';

// import { cloneDeep } from 'lodash';
export default ({ setVisible, subOrders, mainOrder, onClose }) => {
  const [isModalOpen] = useState(true);
  const { TextArea } = Input;
  const [textValue, setTextValue] = useState('');

  const handleOk = async () => {
    console.log(subOrders, '5656subOrders', mainOrder);
    await postServiceOrderFeedbackRegistration({
      data: {
        id: subOrders[0].id,
        feedbackRegistrationContent: textValue,
      },
    });
    onClose();
    // setIsModalOpen(false);
    // onClose();
  };
  const handleCancel = () => {
    setVisible(false);
    onClose();
    // setIsModalOpen(false);
    // onClose();
  };
  const handleChange = (e) => {
    setTextValue(e.target.value);
  };
  return (
    <>
      {/* <ModalForm<{
        filePaths: any;
      }>
        width={500}
        open
        title="回访登记"
        form={form}
        autoFocusFirstInput
        modalProps={{
          okText: '提交',
          cancelText: '取消',
          destroyOnClose: true,
          onCancel: () => {
            setVisible(false);
          },
        }}
        onFinish={async () => {
          onClose();
        }}
        onOpenChange={setVisible}
      >
        <TextArea rows={6} placeholder="请输入" />
      </ModalForm> */}
      <Modal
        title="回访登记"
        open={isModalOpen}
        onOk={handleOk}
        onCancel={handleCancel}
      >
        <TextArea
          rows={6}
          placeholder="请输入"
          onChange={handleChange}
          value={textValue}
        />
      </Modal>
    </>
  );
};