diff --git a/src/pages/reimbursement/mine/ReimbursementCreate.tsx b/src/pages/reimbursement/mine/ReimbursementCreate.tsx index 16eb4c0..aabf78f 100644 --- a/src/pages/reimbursement/mine/ReimbursementCreate.tsx +++ b/src/pages/reimbursement/mine/ReimbursementCreate.tsx @@ -59,10 +59,9 @@ class InvoiceRadioCard extends React.Component { constructor(props: { invoice: any; hidden: boolean; - selected: boolean; + selected: number; index: number; click: any; - afterDay: number | null; }) { super(props); this.state = { @@ -71,43 +70,49 @@ class InvoiceRadioCard extends React.Component { selected: props.selected, index: props.index, click: props.click, - afterDay: props.afterDay, } } static getDerivedStateFromProps(props: { invoice: any; hidden: boolean; - selected: boolean; + selected: number; index: number; - afterDay: number | null; }) { - console.log(props); return { invoice: props.invoice, hidden: props.hidden, selected: props.selected, index: props.index, - afterDay: props.afterDay, } } select(e: any) { - console.log(this.state.afterDay, Number(new Date(this.state.invoice.invoiceDate))) - if (this.state.afterDay !== null && this.state.afterDay > Number(new Date(this.state.invoice.invoiceDate))) + if (this.state.selected !== 0) return - if (this.state.selected) - return - this.setState({selected: true}) + this.setState({selected: 1}) this.props.click(this.props.invoice, true) } + getTag = () => { + if (this.state.selected === 1) + return 已选择 + else if (this.state.selected === 0) + return 待选择 + else if (this.state.selected === -1) + return 不可选 + else if (this.state.selected === -2) + return 不可选 + else if (this.state.selected === -3) + return 不可选 + } render() { return (