/*
 * Create:      柿子
 * CreateDate:  2022/09/06
 * Describe：   库房 - 辅助入库制单 - 依据配镜订单、 从订单选择
 * */
import React, { Component } from 'react';
import { Modal, Select, Button, message, Tooltip, Tag } from 'antd';
import { Util, dayFormat } from 'tools';
import moment from 'moment';
import RangeDatePicker from 'components/rangePicker/index';
import PubilcTablePagination from 'pages/common/PubilcTablePagination';
import ReturnOrder from '../../glassesManagement/component/ReturnOrder';
import GetPatientInformation from '../../component/GetPatientInformation';
import MatchingDetails from '../../glassesManagement/component/MatchingDetails';
import '../style/index.less';

class OrderOfGlassesModal extends Component {
  constructor(props) {
    super(props);
    let userData = React.$getSessionData();
    this.state = {
      visible: false,
      cardType: '',
      cardSelectData: [],
      selectData: {},
      defaultDate: 0,
      queryParams: { // 查询条件
        endDate: moment().format(dayFormat), // 结束日期
        startDate: moment().format(dayFormat), // 开始日期
        brandID: undefined, // 产品品牌
        orderStatus: '', // 单据状态
        vendorID: undefined, // 供应商
        hospID: userData?.hospID || undefined, // 医院 - 默认番禺普瑞
        billStatus: undefined, // 收费状态
      },
      selectedRowKeys: [],
      selectedRows: [],
      page: 1,
      pageSize: 50,
      total: 0,
      loading: false,
      tableData: [],
      columns: [],
      totalWidth: 1030,
      defaultOrderStatus: [], // 默认状态
      orderModalType: '', // 订单类型
      frLocID: '', // 科室
      vendorID: '',
      assistComponentName: '', // 表单数据
      baseDefault: {}, // 基本信息默认 - 辅助制单选择带出基本信息默认值
    };
    this.staticColumns = [{
      key: 1,
      title: '病人ID',
      dataIndex: 'patNo',
      align: 'center',
      width: 150
    }, {
      key: 2,
      title: '姓名',
      dataIndex: 'patName',
      align: 'center',
      width: 100
    }, {
      key: 3,
      title: '性别',
      dataIndex: 'patSexDesc',
      align: 'center',
      width: 80
    }, {
      key: 4,
      title: '配镜单号',
      dataIndex: 'glassesNo',
      align: 'center',
      width: 150
    }, {
      key: 5,
      title: '产品名称',
      dataIndex: 'glassesName',
      align: 'center',
      width: 200
    }, {
      key: 6,
      title: '品牌',
      dataIndex: 'brandDesc',
      align: 'center',
      width: 100
    }, {
      key: 7,
      title: '订单金额（元）',
      dataIndex: 'orderAmt',
      align: 'center',
      width: 150
    }, {
      key: 8,
      title: '预交金额',
      dataIndex: 'prePayAmt',
      align: 'center',
      width: 100
    }];
  }

  componentDidMount() {
    this.props.onRef && this.props.onRef(this);
  }

  static getDerivedStateFromProps(nextProps, prevState) {
    if (JSON.stringify(nextProps.selectData) !== JSON.stringify(prevState.selectData)) {
      return {
        selectData: nextProps.selectData
      }
    }
    if (nextProps.orderModalType !== prevState.orderModalType) { // 订单类型 - 不同界面类型不一样，用于处理订单状态
      return {
        orderModalType: nextProps.orderModalType
      }
    }
    if (nextProps.frLocID !== prevState.frLocID) { // 科室
      return {
        frLocID: nextProps.frLocID
      }
    }
    if (nextProps?.defaultDate !== prevState?.defaultDate) { // 默认日期
      return {
        defaultDate: nextProps?.defaultDate || 0,
        queryParams: {
          ...prevState.queryParams,
          startDate: moment().subtract(parseInt(nextProps?.defaultDate || 0), 'days').format(dayFormat),
        }
      }
    }
    if (nextProps?.vendorID !== prevState?.vendorID) { // 供应商
      return {
        vendorID: nextProps?.vendorID || ''
      }
    }
    return null
  }

  componentDidUpdate(prevState) {
    let { queryParams, selectData } = this.state;
    if (JSON.stringify(prevState.selectData) !== JSON.stringify(selectData)) {
      let orderStatusSelectData = selectData?.orderStatus || [];
      queryParams.orderStatus = Util.returnDataCccordingToAttributes(orderStatusSelectData, 'Y', 'default')?.id || '';
      let handleStatus = selectData && 'handleStatus' in selectData && selectData.handleStatus ? selectData.handleStatus : '';
      // 默认可以带入到界面的状态数据，可能包含多个的情况
      let defaultOrderStatus = handleStatus && handleStatus.indexOf('^') > -1 ? handleStatus.split('^') : (handleStatus ? [handleStatus] : [queryParams.orderStatus]);
      this.setState({ queryParams, defaultOrderStatus })
    }
  }

  // 修改弹窗状态
  modifyVisible = (visible, assistComponentName = '', doNotDefaultHosp = 'N') => {
    const { interfaceFlag } = this.props;
    const { columns } = this.state;
    if (visible && (interfaceFlag === 'IMGroupProcurementPlan' || interfaceFlag === 'IMGroupReturnOrderConfirmation' || doNotDefaultHosp === 'Y')) { // 集团采购 - 退货制单
      this.state.queryParams.hospID = undefined;
    }
    this.setState({ visible, assistComponentName }, () => {
      if (!(columns && columns.length > 0) && visible) {
        this.getTableColumns();
      }
      this.state.visible && this.getTableData();
    });
  }

  // 获取列表表头数据
  getTableColumns = async () => {
    try {
      const { interfaceFlag, hideViewDetails } = this.props;
      const { assistComponentName } = this.state;
      let data = {
        params: [{
          type: 'C',
          compontName: assistComponentName || 'OrderOfGlassesModal',
        }]
      }
      let res = await React.$asyncPost(this, '01040073', data);
      let columns = res.result && res.result.C && res.result.C.length > 0 ? res.result.C : [];
      if (columns && columns.length > 0) {
        columns = columns.map(item => {
          return {
            ...item,
            render: (text, record) => {
              if (item.dataIndex === 'reqNo') {
                return (
                  <Tooltip title={text}>
                    <span
                      className="span ellipsis"
                      onClick={(e) => this.handleViewDetails(record, e)}
                      style={{ width: '100%', display: 'block' }}
                    >
                      {text}
                    </span>
                  </Tooltip>
                );
              } else if (item.dataIndex === 'urgentSign' && (text === '一级加急' || text === '二级加急')) { // 加急标志
                return (
                  <Tag style={{ fontWeight: 'normal' }} color={text === '一级加急' ? '#FF3D00' : (text === '二级加急' ? '#FA8C17' : '')}>{text}</Tag>
                );
              } else {
                return (
                  <Tooltip title={text}>
                    <span
                      className="ellipsis"
                      style={{ width: '100%', display: 'block' }}
                    >
                      {text}
                    </span>
                  </Tooltip>
                );
              }
            }
          }
        });
        if (interfaceFlag !== 'IMTest' && hideViewDetails !== 'Y') { // 集团退货制单
          // 列表操作
          const operationObj = {
            width: 100,
            title: '操作',
            align: 'center',
            key: 'operation',
            fixed: 'right',
            render: (text, record) => (
              <span>
                <span
                  className="span"
                  onClick={() => this.handleViewDetails(record)}
                >
                  查看详情
                </span>
                {/* <>
          <Divider type="vertical" />
          <span
            className="span"
            onClick={() => this.handleReturnOrder('10')}
          >
            退回订单
          </span>
        </> */}
              </span>
            ),
          };
          columns.push(operationObj);
        }
        this.setState({
          columns,
          totalWidth: res.totalWidth
        }, () => {
          this.patientRef && this.patientRef.getCardSelectData();
        })
      }
    } catch (error) {
      console.log(error)
    }
  }

  handleQuery = () => {
    this.setState({ page: 1 }, () => {
      this.getTableData();
    })
  }

  // 提供修改page和pageSize的回调函数
  compilePage = (page, pageSize) => {
    this.setState({ page, pageSize }, () => {
      this.getTableData();
    })
  }

  // 请求列表数据 -> tableCode包含（17060034 - 采购计划）
  getTableData = async () => {
    try {
      let { tableCode, auxiliaryLocIDIndex } = this.props; // 辅助制单从订单选择取传过来的tableCode，依据配镜订单默认为17060013
      let { queryParams, pageSize, page, orderModalType, frLocID, vendorID } = this.state;
      let patID = this.patientRef && this.patientRef.getPatientID();
      this.setState({ loading: true });
      let data = {
        params: [{
          ...queryParams,
          vendorID: queryParams?.vendorID || vendorID, // 过滤条件中存在则取过滤条件的，没有则取传过来的
          frLocID,
          [auxiliaryLocIDIndex || 'locID']: frLocID, // 正常是取这个
          patInfo: patID,
          type: orderModalType, // 采购收货传入PurReceipt, 入库质检->质检类型对应(入库质检InQuality, 转移质检TranQuality, 退库质检OutQuality)
        }],
        pagination: [{
          pageSize,
          currentPage: page
        }]
      }
      let res = await React.$asyncPost(this, tableCode || '17060013', data);
      let tableData = res.result && 'rows' in res.result ? res.result.rows : (Array.isArray(res.result) ? res.result : []);
      for (let i = 0; i < tableData.length; i++) {
        tableData[i].orderIndexFlag = 'order' + i;
        tableData[i].key = i + 1;
      }
      this.setState({
        tableData,
        total: res.result?.total || tableData.length,
        loading: false,
        selectedRowKeys: [],
        selectedRows: [],
        baseDefault: res?.result?.default || {},
      });
    } catch (error) {
      console.log(error)
      this.setState({
        tableData: [],
        total: 0,
        loading: false,
        selectedRowKeys: [],
        selectedRows: [],
        baseDefault: {}
      });
    }
  }

  // 修改操作框数据
  handleModifyInputValue = (e, dataIndex) => {
    this.state.queryParams[dataIndex] = e;
    this.setState({}, () => {
      if (dataIndex === 'hospID' || dataIndex === 'startDate' || dataIndex === 'endDate' || dataIndex === 'brandID' || dataIndex === 'orderStatus') {
        this.handleQuery();
      }
    })
  }

  // 确定
  handleOk = () => {
    let { selectedRows, baseDefault } = this.state;
    if (selectedRows && selectedRows.length > 0) {
      let detailTableData = this.props && this.props.getTableData ? this.props.getTableData() : []; // 明细列表数据
      let addData = [];
      let oldAddData = [];
      let isAdd = true;
      for (var i = 0; i < detailTableData.length; i++) {
        let orderIndex = detailTableData[i]?.productNo || detailTableData[i].orderIndexFlag;
        oldAddData.push(orderIndex);
      }
      for (var i = 0; i < selectedRows.length; i++) {
        let orderIndex = selectedRows[i]?.productNo || selectedRows[i].orderIndexFlag;
        if (oldAddData.indexOf(orderIndex) > -1) {
          isAdd = false;
        } else {
          addData.push(selectedRows[i]);
        }
      }
      if (!isAdd) {
        if (addData && addData.length > 0) {
          Modal.confirm({
            title: '订单重复提醒',
            content: '当前界面已存在相同订单，是否追加订单?',
            okText: '是',
            cancelText: '否',
            onOk: () => {
              this.props.addDetailData && this.props.addDetailData(addData, baseDefault);
              this.setState({ selectedRowKeys: [], selectedRows: [] }, () => {
                this.modifyVisible(false);
              });
            },
            onCancel() { },
          })
        } else {
          message.error('当前选择的订单已添加，无需重复添加');
        }
        return;
      } else {
        this.props.addDetailData && this.props.addDetailData(selectedRows, baseDefault);
        this.setState({ selectedRowKeys: [], selectedRows: [] }, () => {
          this.modifyVisible(false);
        });
      }
    } else {
      message.error('请勾选需要操作的数据。');
    }
  }

  // 查看详情
  handleViewDetails = (record) => {
    const { interfaceFlag, hideViewDetails } = this.props;
    if (hideViewDetails !== 'Y') {
      this.matchingDetailsRef && this.matchingDetailsRef.modifyVisible(true, { ...record, suppFlag: interfaceFlag || '', statusCode: '0' });
    }
  }

  // 退回订单
  handleReturnOrder = () => {
    const { interfaceFlag, returnOrderCode } = this.props;
    const { selectedRowKeys } = this.state;
    if (!(selectedRowKeys && selectedRowKeys.length > 0)) {
      message.error('请勾选需要操作的数据。');
      return;
    }
    // 10为供应商退回，25为采购计划医院退回
    let statusCode = returnOrderCode || (interfaceFlag === 'IMProcurementPlan' ? '25' : '10')
    this.returnOrderRef && this.returnOrderRef.modifyVisible(true, {}, statusCode);
  }

  // 批量修改申请单状态
  modifyApplicationFormStatus = async (statusCode, requestIDArr, compnentSource, remark) => {
    try {
      const { modifyStatusCode, idIndex = 'glassesRequestID', modifyStatusIDIndex = 'requestIDArr' } = this.props;
      const { selectedRowKeys, tableData } = this.state;
      let checkoutRequestIDArr = [];
      if (selectedRowKeys && selectedRowKeys.length > 0) {
        for (let i = 0; i < selectedRowKeys.length; i++) {
          for (let j = 0; j < tableData.length; j++) {
            if (selectedRowKeys[i] === tableData[j]?.key) {
              checkoutRequestIDArr.push(tableData[j][idIndex])
            }
          }
        }
      }
      let data = {
        params: [{
          [modifyStatusIDIndex]: requestIDArr && Array.isArray(requestIDArr) && requestIDArr.length > 0 ? requestIDArr : checkoutRequestIDArr,
          statusCode,
          remark, // 退回时填写，退回原因
        }]
      }
      let res = await React.$asyncPost(this, modifyStatusCode || '17030026', data);
      message.success(res.errorMessage || '操作成功');
      this.setState({ selectedRowKeys: [], selectedRows: [] });
      compnentSource === 'returnOrder' && this.returnOrderRef && this.returnOrderRef.modifyVisible(false, '', '', 'Y'); // 关闭退回订单弹窗
      compnentSource === 'matchingDetails' && this.matchingDetailsRef && this.matchingDetailsRef.modifyVisible(false); // 关闭详情弹窗
      this.handleQuery('N');
    } catch (error) {
      console.log(error)
    }
  }

  // 详情界面退回订单
  handleDetailsReturnOrder = (record, statusCode) => {
    this.setState({ selectedRowKeys: [record?.key], selectedRows: [{ ...record }] }, () => {
      this.returnOrderRef && this.returnOrderRef.modifyVisible(true, {}, statusCode);
    })
  }

  // 操作行
  onClickRowPublic = (record) => {
    const { idIndex = 'glassesRequestID' } = this.props;
    const { tableData } = this.state;
    return {
      onDoubleClick: () => {
        // 双击查看详情
        // this.handleViewDetails(record);
        // 直接双击带入数据
        // let isDisabled = true;
        // for (var i = 0; i < defaultOrderStatus.length; i++) { // 存在多个的情况
        //   if (record.statusCode === defaultOrderStatus[i]) {
        //     isDisabled = false;
        //     break;
        //   }
        // }
        if (record?.banFlag === 'Y') {
          message.error('该订单状态为（' + record?.statusDesc + '），暂不支持制单哦');
          return;
        }
        if (record?.preparedFlag === 'Y') {
          message.error('当前订单已制单，不能重复制单哦');
          return;
        }
        let selectedRowKeys = [], selectedRows = [];
        // 同一个申请单全部带入
        if (record && idIndex in record && record[idIndex]) {
          for (let i = 0; i < tableData.length; i++) {
            if (tableData[i][idIndex] === record[idIndex]) {
              selectedRowKeys.push(tableData[i].key);
              selectedRows.push(tableData[i]);
            }
          }
        } else {
          selectedRowKeys.push(record.key);
          selectedRows.push(record);
        }
        this.setState({ selectedRowKeys, selectedRows }, () => {
          this.handleOk();
        })
      }
    }
  }

  setRowClassNamePublic = (record) => {
    return record?.preparedFlag === 'Y' ? 'optometry-complete-row-color' : (record?.presChange === '是' ? 'common-row-color-FDECF2' : '');
  }

  // 勾选或反选操作同组数据
  handleCheckChange = (record, selected) => {
    const { idIndex = 'glassesRequestID' } = this.props;
    let { tableData } = this.state;
    let selectedRowKeys = [];
    let selectedRows = [];
    let pSelectedRowKeys = [];
    let oSelectedRows = this.state.selectedRows;
    for (let i = 0; i < oSelectedRows.length; i++) {
      pSelectedRowKeys.push(oSelectedRows[i][idIndex]);
    }
    if (selected) {
      pSelectedRowKeys.push(record[idIndex]);
    } else {
      pSelectedRowKeys = pSelectedRowKeys.filter(item => item !== record[idIndex]);
    }
    for (let i = 0; i < tableData.length; i++) {
      if (pSelectedRowKeys.indexOf(tableData[i][idIndex]) > -1) {
        selectedRowKeys.push(tableData[i].key);
        selectedRows.push(tableData[i]);
      }
    }
    this.setState({
      selectedRowKeys,
      selectedRows
    })
  }

  // 全选
  handleCheckAllChange = (selected, selectedRows) => {
    let selectedRowKeys = [];
    if (selected) {
      for (let i = 0; i < selectedRows.length; i++) {
        selectedRowKeys.push(selectedRows[i].key);
      }
    }
    this.setState({ selectedRows, selectedRowKeys });
  }

  render() {
    let { modalTitle, interfaceFlag, orderDateTitle, hidePatInfo, hidePresExchangeFlag, hideBrandFlag, okText, cancelText, orderStatusText, returnOrderCode } = this.props;
    let { visible, selectData, selectedRowKeys, selectedRows, page, total, loading, tableData, columns, totalWidth, queryParams, assistComponentName, orderModalType } = this.state;

    let rowSelection = {
      selectedRowKeys,
      selectedRows,
      onSelect: this.handleCheckChange,
      onSelectAll: this.handleCheckAllChange,
      getCheckboxProps: record => { // preparedFlag - Y(已制单)/N(未制单)
        // let isDisabled = true; // isDisabled调整为banFlag
        // for (var i = 0; i < defaultOrderStatus.length; i++) { // 存在多个的情况
        //   if (record.statusCode === defaultOrderStatus[i]) {
        //     isDisabled = false;
        //     break;
        //   }
        // }
        return { // 已制单的不能重复制单
          disabled: interfaceFlag !== 'IMTest' ? (record?.banFlag === 'Y' || record?.preparedFlag === 'Y') : false,
        }
      },
    };

    let hospSelectFlag = ['IMGroupProcurementPlan', 'IMGroupReturnOrderConfirmation', 'IMGroupPurchaseReceipt', 'IMGroupWarehousingInspect', 'NVPReceiptGroupVP', 'NVPTransferGroupVP'];
    return (
      <div>
        <Modal
          width="1200px"
          className="order-of-glasses-modal"
          title={modalTitle || '辅助入库制单 - 依据配镜订单'}
          visible={visible}
          destroyOnClose={true}
          footer={(
            <div className="flex-center" style={{ position: 'relative' }}>
              <span style={{ position: 'absolute', left: 0, bottom: '4px', color: '#999', fontWeight: 'normal' }}>
                <span style={{ display: 'inline-block', width: '22px', height: '8px', background: '#fff5eb', marginRight: '6px' }}></span>
                已进行制单，未完成的订单
                {hidePresExchangeFlag !== 'Y' ? (
                  <>
                    <span style={{ display: 'inline-block', width: '22px', height: '8px', background: '#f5d3df', margin: '0 6px 0 20px' }}></span>
                    处方交换
                  </>
                ) : ''}
              </span>
              <Button key="1" onClick={interfaceFlag === 'IMProcurementPlan' || returnOrderCode ? this.handleReturnOrder : () => this.modifyVisible(false)}>
                {cancelText || (interfaceFlag === 'IMProcurementPlan' ? '退回订单' : '取消')}
              </Button>
              <Button key="2" type="primary" onClick={this.handleOk}>{interfaceFlag === 'IMProcurementPlan' ? '进入制单' : (okText || '确定')}</Button>
            </div>
          )}
          onCancel={() => this.modifyVisible(false)}
        >
          <div className="table-body-height">
            <div>
              <div className="flex-align-items" style={{ marginBottom: '12px' }}>
                {hospSelectFlag.indexOf(interfaceFlag) > -1 ? ( // 集团相关界面
                  <>
                    客户：
                    <Select
                      allowClear
                      showSearch
                      value={queryParams?.hospID}
                      placeholder="请选择"
                      optionFilterProp="search"
                      className="common-query-input"
                      onChange={(e) => this.handleModifyInputValue(e, 'hospID')}
                    >
                      {React.$SelectOptions(selectData?.hosp || [])}
                    </Select>
                  </>
                ) : ''}
                <div style={{ marginRight: 15 }}>
                  <RangeDatePicker
                    width="300px"
                    label={(orderDateTitle || '订单日期') + '：'}
                    isChange={true}
                    format={dayFormat}
                    endDate={queryParams?.endDate}
                    startDate={queryParams?.startDate}
                    endChange={(e) => this.handleModifyInputValue(e, 'endDate')}
                    startChange={(e) => this.handleModifyInputValue(e, 'startDate')}
                  />
                </div>
                {interfaceFlag === 'IMProcurementPlan' || interfaceFlag === 'IMPurchaseReceipt' ? ( // 采购计划(IMProcurementPlan)和采购收货(IMPurchaseReceipt)
                  <>
                    供应商：
                    <Select
                      allowClear
                      showSearch
                      value={queryParams?.vendorID}
                      placeholder="请选择"
                      optionFilterProp="search"
                      className="common-query-input"
                      style={{ marginRight: 15 }}
                      onChange={(e) => this.handleModifyInputValue(e, 'vendorID')}
                    >
                      {React.$SelectOptions(selectData?.authVendor || [])}
                    </Select>
                  </>
                ) : ''}
                {interfaceFlag === 'IMTest' ? '' : ( // 集团退货制单不展示品牌和订单状态
                  <>
                    {hideBrandFlag !== 'Y' ? ( // 是否隐藏品牌过滤
                      <>
                        品牌：<Select
                          allowClear
                          showSearch
                          value={queryParams?.brandID}
                          placeholder="请选择"
                          optionFilterProp="search"
                          className="common-query-input"
                          style={{ marginRight: 15 }}
                          onChange={(e) => this.handleModifyInputValue(e, 'brandID')}
                        >
                          {React.$SelectOptions(selectData?.brand || [])}
                        </Select>
                      </>
                    ) : ''}
                    {orderStatusText || '订单状态'}：
                    <Select
                      allowClear
                      showSearch
                      value={queryParams?.orderStatus}
                      placeholder="请选择"
                      optionFilterProp="search"
                      className="common-query-input"
                      style={{ marginRight: 15 }}
                      onChange={(e) => this.handleModifyInputValue(e, 'orderStatus')}
                    >
                      {React.$SelectOptions(selectData?.orderStatus || [])}
                    </Select>
                  </>
                )}

                {interfaceFlag === 'NVPTransferVP' || (interfaceFlag === 'IMWarehousingInspect' && orderModalType === 'TranQuality') ? ( // 转移质检/转移制单
                  <>
                    收费状态：
                    <Select
                      allowClear
                      showSearch
                      value={queryParams?.billStatus}
                      placeholder="请选择"
                      optionFilterProp="search"
                      className="common-query-input"
                      style={{ marginRight: 15 }}
                      onChange={(e) => this.handleModifyInputValue(e, 'billStatus')}
                    >
                      {React.$SelectOptions(selectData?.billStatus || [])}
                    </Select>
                  </>
                ) : ''}
                <Button type="primary" onClick={this.handleQuery}>查询</Button>
              </div>
              {interfaceFlag === 'IMTest' || hidePatInfo === 'Y' ? '' : ( // 集团退货制单不展示病人标识搜索
                <div style={{ marginBottom: '12px' }}>
                  <GetPatientInformation queryType="fuzzySearch" onRef={ref => this.patientRef = ref} handleQuery={this.handleQuery} />
                </div>
              )}
            </div>
            <PubilcTablePagination
              param={{
                page,
                total,
                loading,
                size: 'large',
                componentName: assistComponentName || 'OrderOfGlassesModal',
                data: tableData, // 表格数据
                x: totalWidth, // 表格的宽度
                y: 400,
                height: '450px',
                company: selectData?.company || '条',
                columns: columns && columns.length > 0 ? columns : this.staticColumns, // 表头配置
                TableClassName: 'common-table-fixed-operation'
              }}
              rowSelectionPublic={rowSelection}
              compilePage={this.compilePage}
              getColumns={this.getTableColumns}
              onClickRowPublic={this.onClickRowPublic}
              setRowClassNamePublic={this.setRowClassNamePublic}
            />
          </div>
        </Modal>

        {/* 查看详情 */}
        <MatchingDetails interfaceFlag="OrderOfGlassesModal" handleReturnOrder={this.handleDetailsReturnOrder} modifyApplicationFormStatus={this.modifyApplicationFormStatus} onRef={ref => this.matchingDetailsRef = ref} />

        {/* 退回订单 */}
        <ReturnOrder selectData={selectData} modifyApplicationFormStatus={this.modifyApplicationFormStatus} onRef={ref => this.returnOrderRef = ref} />
      </div>
    );
  }
};

export default OrderOfGlassesModal;
