import React from "react" import { connect } from "react-redux" import DealsList from "./DealsList"; import SingleDeal from "./SingleDeal"; import { getDeals, getDealOffers, getDealDocuments, getDealContracts } from "../../actions"; class AllContractsModal extends React.Component { constructor(props) { super(props); } render() { const { open, close, activeContract, handleContractSelected } = this.props return (

Статусы сделок

Сделка 1

Выбор КП

Сделка 1

Программа финансирования

Сделка 1

Сборка пакета документов

Сделка 1

Проверка документов

Сделка 1

Принятие решения по заявке

Сделка 1

Оформление лизинга

Сделка 1

Выбор типа подписания

) } } class DealsStatus extends React.Component { constructor(props) { super(props) this.state = { status: 2, currentContractModalOpened: false, allContractModalOpened: false, currentSelected: null, dealSelected: undefined, deals: undefined, } } static getDerivedStateFromProps(nextProps, prevState) { console.log("DealsStatus", "getDerivedStateFromProps", { nextProps }); return { deals: nextProps.deals, } } componentDidMount() { const { dispatch } = this.props; getDeals({ dispatch }); } componentDidUpdate(prevProps, prevState) { } _onDealsUpdate = () => { console.log("_onDealsUpdate"); return new Promise((resolve) => { const { dispatch } = this.props; getDeals({ dispatch, update: true }) .then(() => { resolve(); }) .catch(() => { resolve(); }); }); } _onDealContractsUpdate = (deal_id) => { console.log("_onDealContractsUpdate"); const { dispatch } = this.props; getDealContracts({ dispatch, deal_id, }); } _handleModalToggle = (modal) => { if (modal === "current") { this.setState({ currentContractModalOpened: !this.state.currentContractModalOpened }) } else { this.setState({ allContractModalOpened: !this.state.allContractModalOpened }) } } _handleContractSelected = (index) => { this.setState({ currentSelected: index }) } _handle_onSelectDeal = (deal_id) => { const { dispatch } = this.props; console.log("_handle_onSelectDeal", { deal_id }); this.setState({ dealSelected: deal_id }); getDealOffers({ dispatch, deal_id, }); getDealDocuments({ dispatch, deal_id, }); getDealContracts({ dispatch, deal_id, }); } _handle_onCloseDeal = () => { this.setState({ dealSelected: undefined }); } render() { const { currentContractModalOpened, allContractModalOpened, currentSelected, dealSelected, deals, status, } = this.state const { questionnaire_status, onQuestionnaire, } = this.props; return ( <> { deals.list !== undefined && deals.list !== null && deals.list.length > 0 && ( <>

Статусы сделок

{/*} { this._handleModalToggle("all") }} activeContract={currentSelected} handleContractSelected={this._handleContractSelected} /> {*/} ) } ) } } function mapStateToProps(state, ownProps) { console.log({ "DealsStatus.state": state }); return { deals: state.deals, } } export default connect(mapStateToProps)(DealsStatus)