fix: 修复时间

This commit is contained in:
zhangds 2023-01-06 18:15:15 +08:00
parent 77ba3d3501
commit 6bf8e740ef
1 changed files with 3 additions and 7 deletions

View File

@ -202,7 +202,7 @@ export default class exchangeAdd extends React.Component {
codeInfo: codeInfo, codeInfo: codeInfo,
isload: true, isload: true,
tempdata: reqCopy.goods || [], tempdata: reqCopy.goods || [],
plan_time: [reqCopy.plan.start_time, reqCopy.plan.end_time], plan_time: [reqCopy.plan.begin_time, reqCopy.plan.end_time],
rank: checkedArray, rank: checkedArray,
rankoptions: arr rankoptions: arr
}) })
@ -862,7 +862,7 @@ export default class exchangeAdd extends React.Component {
const isDay = moment(this.state.plan_time[1]).format("HH:mm:ss") const isDay = moment(this.state.plan_time[1]).format("HH:mm:ss")
/* 新增和复制时才生效 */ /* 新增和复制时才生效 */
if (type === "start" && this.state.isState !== 2) { if (type === "start") {
if (isDay < "23:59:59") { if (isDay < "23:59:59") {
isdisabled = isdisabled =
moment(str).isBefore(this.state.plan_time[0]) || moment(str).isBefore(this.state.plan_time[0]) ||
@ -875,13 +875,9 @@ export default class exchangeAdd extends React.Component {
} }
if (type === "end") { if (type === "end") {
if (this.state.isState !== 2) {
isdisabled = isdisabled =
moment(str).add(1, "days").isBefore(this.state.plan_time[0]) || moment(str).add(1, "days").isBefore(this.state.plan_time[0]) ||
moment(str).isAfter(this.state.plan_time[1]) moment(str).isAfter(this.state.plan_time[1])
} else {
isdisabled = moment(str).isAfter(this.state.plan_time)
}
} }
return isdisabled return isdisabled