From 72b4dae442d5c54bc5e46b8e1efe8605b6959d63 Mon Sep 17 00:00:00 2001 From: Wind-58 Date: Thu, 1 Sep 2022 10:42:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9A=82=E5=AD=98=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exchangecode/exchangecodeAdd/index.jsx | 45 ++++++++++++++----- src/pages/exchangecode/list/list.js | 2 + 2 files changed, 37 insertions(+), 10 deletions(-) diff --git a/src/pages/exchangecode/exchangecodeAdd/index.jsx b/src/pages/exchangecode/exchangecodeAdd/index.jsx index 5030e262..ed999300 100644 --- a/src/pages/exchangecode/exchangecodeAdd/index.jsx +++ b/src/pages/exchangecode/exchangecodeAdd/index.jsx @@ -937,13 +937,29 @@ export default class exchangeAdd extends React.Component { onDisabledRange = (date, type) => { let isdisabled = false let str = moment(date).format("YYYY-MM-DD HH:mm:ss") + const isDay = moment(this.state.plan_time[1]).format("HH:mm:ss") - if (type === "start") { - isdisabled = moment(str).isBefore(this.state.plan_time[0]) + /* 新增和复制时才生效 */ + if (type === "start" && this.state.isState !== 2) { + if (isDay < "23:59:59") { + isdisabled = + moment(str).isBefore(this.state.plan_time[0]) || + moment(str).subtract(1, "days").isAfter(this.state.plan_time[1]) + } else { + isdisabled = + moment(str).isBefore(this.state.plan_time[0]) || + moment(str).isAfter(this.state.plan_time[1]) + } } if (type === "end") { - isdisabled = moment(str).isAfter(this.state.plan_time[1]) + if (this.state.isState !== 2) { + isdisabled = + moment(str).add(1, "days").isBefore(this.state.plan_time[0]) || + moment(str).isAfter(this.state.plan_time[1]) + } else { + isdisabled = moment(str).isAfter(this.state.plan_time) + } } return isdisabled @@ -1036,6 +1052,21 @@ export default class exchangeAdd extends React.Component { this.setState({ codeInfo: model }) } + /* 新增处理处理归属计划关联数据 */ + vestingPlanFunction(e) { + if (!e?.key) return + this.getKeyBatchSelect(e.key) + this.getResellerFunction(e.reseller_id) + this.setState({ + plan_time: [e.start_time, e.end_time] + }) + const time = { + start_time: e.start_time, + end_time: e.end_time + } + sessionStorage.setItem("knockGold_effectDate", JSON.stringify(time)) + } + render() { return (
@@ -1057,13 +1088,7 @@ export default class exchangeAdd extends React.Component {