暂存提交

This commit is contained in:
Wind-58 2022-09-01 10:42:40 +08:00
parent 502979a41d
commit 72b4dae442
2 changed files with 37 additions and 10 deletions

View File

@ -937,13 +937,29 @@ export default class exchangeAdd extends React.Component {
onDisabledRange = (date, type) => { onDisabledRange = (date, type) => {
let isdisabled = false let isdisabled = false
let str = moment(date).format("YYYY-MM-DD HH:mm:ss") 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") { 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 return isdisabled
@ -1036,6 +1052,21 @@ export default class exchangeAdd extends React.Component {
this.setState({ codeInfo: model }) 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() { render() {
return ( return (
<div id='editcode'> <div id='editcode'>
@ -1057,13 +1088,7 @@ export default class exchangeAdd extends React.Component {
<Select <Select
onChange={(e) => { onChange={(e) => {
this.handleChange(e, "planSelect") this.handleChange(e, "planSelect")
if (e?.key) { this.vestingPlanFunction(e)
this.getKeyBatchSelect(e.key)
this.getResellerFunction(e.reseller_id)
this.setState({
plan_time: [e.start_time, e.end_time]
})
}
}} }}
clearable clearable
value={this.state.codeInfo.planSelect} value={this.state.codeInfo.planSelect}

View File

@ -178,12 +178,14 @@ export default class acclist extends React.Component {
} else if (type === 2) { } else if (type === 2) {
activerou[0].pagetitle = "编辑" activerou[0].pagetitle = "编辑"
activerou[0].items[1].name = `编辑:${param.title}兑换码的商品范围列表` activerou[0].items[1].name = `编辑:${param.title}兑换码的商品范围列表`
sessionStorage.setItem("approval_status", param.status)
} }
sessionStorage.setItem("code_id", param?.id) sessionStorage.setItem("code_id", param?.id)
sessionStorage.setItem("isState", type) sessionStorage.setItem("isState", type)
sessionStorage.setItem("breaknav", JSON.stringify(activerou)) sessionStorage.setItem("breaknav", JSON.stringify(activerou))
sessionStorage.setItem("pathname2", "/home/exchangecode-exchangecodeAdd") sessionStorage.setItem("pathname2", "/home/exchangecode-exchangecodeAdd")
this.props.history.push("/home/exchangecode-exchangecodeAdd") this.props.history.push("/home/exchangecode-exchangecodeAdd")
} }