This commit is contained in:
姜棚 2021-11-24 19:05:15 +08:00
parent 931fa8de57
commit d1914b0092
3 changed files with 26 additions and 7 deletions

View File

@ -128,11 +128,7 @@ export default class acclist extends React.Component{
} }
onDisabledCombinedDate = (val)=>{ onDisabledCombinedDate = (val)=>{
console.log(val.getTime()) return val.getTime() < new Date().getTime();
console.log(new Date().getTime())
return val.getDate() < new Date();
} }
render(){ render(){
//校验规则 //校验规则

View File

@ -12,6 +12,7 @@ import Addruleform from "./addruleform/addruleform"
import Productform from "../product/add" import Productform from "../product/add"
import Bus from "../../../assets/eventBus.js" import Bus from "../../../assets/eventBus.js"
import _ from "lodash"; import _ from "lodash";
import moment from "moment"
const TabPanel = Tabs.TabPanel; const TabPanel = Tabs.TabPanel;
export default class acclist extends React.Component{ export default class acclist extends React.Component{
@ -258,6 +259,22 @@ export default class acclist extends React.Component{
this.setState({distdata:this.state.distdata}) this.setState({distdata:this.state.distdata})
console.log(this.state.distdata) console.log(this.state.distdata)
} }
onDisabledCombinedDate = (val)=>{
let step1 = JSON.parse (sessionStorage.getItem("step1"));
let str = moment(val).format("YYYY-MM-DD HH:mm:ss")
let isBetween = moment(str).isBetween(step1.begin_time,step1.end_time);
console.log(isBetween)
return isBetween
}
render(){ render(){
const Column = [ const Column = [
{ {
@ -591,6 +608,7 @@ export default class acclist extends React.Component{
format: 'HH:mm:ss', format: 'HH:mm:ss',
defaultTime: ['12:00:00', '23:59:59'], defaultTime: ['12:00:00', '23:59:59'],
}} }}
disabledDate={this.onDisabledCombinedDate}
format="YYYY-MM-DD HH:mm:ss" format="YYYY-MM-DD HH:mm:ss"
onChange={(e)=>{ onChange={(e)=>{

View File

@ -54,6 +54,11 @@ export default class acclist extends React.Component{
// model2.style = e; // model2.style = e;
// this.setState({model:model2}) // this.setState({model:model2})
} }
onDisabledCombinedDate = (val)=>{
return val.getTime() < new Date().getTime();
}
render(){ render(){
const Column = [ const Column = [
{ {