暂存提交
This commit is contained in:
parent
502979a41d
commit
72b4dae442
|
@ -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 (
|
||||
<div id='editcode'>
|
||||
|
@ -1057,13 +1088,7 @@ export default class exchangeAdd extends React.Component {
|
|||
<Select
|
||||
onChange={(e) => {
|
||||
this.handleChange(e, "planSelect")
|
||||
if (e?.key) {
|
||||
this.getKeyBatchSelect(e.key)
|
||||
this.getResellerFunction(e.reseller_id)
|
||||
this.setState({
|
||||
plan_time: [e.start_time, e.end_time]
|
||||
})
|
||||
}
|
||||
this.vestingPlanFunction(e)
|
||||
}}
|
||||
clearable
|
||||
value={this.state.codeInfo.planSelect}
|
||||
|
|
|
@ -178,12 +178,14 @@ export default class acclist extends React.Component {
|
|||
} else if (type === 2) {
|
||||
activerou[0].pagetitle = "编辑"
|
||||
activerou[0].items[1].name = `编辑:${param.title}兑换码的商品范围列表`
|
||||
sessionStorage.setItem("approval_status", param.status)
|
||||
}
|
||||
|
||||
sessionStorage.setItem("code_id", param?.id)
|
||||
sessionStorage.setItem("isState", type)
|
||||
sessionStorage.setItem("breaknav", JSON.stringify(activerou))
|
||||
sessionStorage.setItem("pathname2", "/home/exchangecode-exchangecodeAdd")
|
||||
|
||||
this.props.history.push("/home/exchangecode-exchangecodeAdd")
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue