import React, { Component } from 'react';
import { connect } from 'dva';
import {
Form, Input, Row, Col, Button, Radio, Steps, Checkbox, Table, TimePicker, Icon
} from 'antd';
import Drawer from "react-motion-drawer";
import { enterpriseCompanyComBaseInfoGetComBaseInfoById } from "../../../services/api";
import '../Task.less';
const FormItem = Form.Item;
const { Step } = Steps;
/*
固定班制---设置出勤班次 */
const columns1 = [{
title: '工作日',
dataIndex: 'workday',
key: '2',
}, {
title: '班次详情',
dataIndex: 'detail',
key: '3',
}, {
title: '操作',
dataIndex: 'option',
key: '4',
render: (text) => {
return
{text}
;
}
}];
const dataSource1 = [{
key: '1',
workday: '周一',
detail: "休息",
option: '选择班次'
}, {
key: '2',
workday: '周二',
detail: "休息",
option: '选择班次'
}, {
key: '3',
workday: '周三',
detail: "休息",
option: '选择班次'
}, {
key: '4',
workday: '周四',
detail: "休息",
option: '选择班次'
}, {
key: '5',
workday: '周五',
detail: "休息",
option: '选择班次'
}, {
key: '6',
workday: '周六',
detail: "休息",
option: '选择班次'
}, {
key: '7',
workday: '周日',
detail: "休息",
option: '选择班次'
}];
/* 排班制----设置出勤班次 */
const columns2 = [{
title: '列号',
dataIndex: 'list',
key: '1',
}, {
title: '班次名称',
dataIndex: 'banci',
key: '2',
}, {
title: '时间安排',
dataIndex: 'time',
key: '3',
render: (text) => {
return {text}
;
}
}];
const dataSource2 = [{
key: '1',
banci: "班次A",
time: '09:00-12:00'
}, {
key: '2',
banci: "一天3班3个次日班",
time: '09:00-11:00 | 12:00 -14:00 | 15:00-18:00'
}];
/* 排班制----周期性排班设置 */
const columns3 = [{
title: '周期名称',
dataIndex: 'list',
key: '1',
}, {
title: '周期天数',
dataIndex: 'banci',
key: '2',
}, {
title: '启用班次',
dataIndex: 'time',
key: '3',
render: (text) => {
return {text}
;
}
}, {
title: '操作',
dataIndex: 'time',
key: '4',
render: (text) => {
return {text}
;
}
}];
const dataSource3 = [{
key: '1',
list: '1',
banci: "班次A",
time: '09:00-12:00'
}, {
key: '2',
list: '2',
banci: "一天3班3个次日班",
time: '09:00-11:00 | 12:00 -14:00 | 15:00-18:00'
}];
@connect(state => ({
profile: state.profile,
}))
@Form.create()
export default class Information extends Component {
state = {
selectedTags: [],
pagenav: {
current: 1,
pageSize: 10,
showQuickJumper: true,
showSizeChanger: true,
showTotal: total => `总共 ${total} 条`,
onShowSizeChange: (current, pageSize) => {
const pagenav = Object.assign({}, this.state.pagenav);
pagenav.current = current;
pagenav.pageSize = pageSize;
this.setState({ pagenav });
setTimeout(() => {
this.bbdExampersonPage();
});
},
onChange: (page, pageSize) => {
const pagenav = Object.assign({}, this.state.pagenav);
pagenav.current = page;
pagenav.pageSize = pageSize;
this.setState({ pagenav });
setTimeout(() => {
this.bbdExampersonPage();
});
},
total: 0,
}
}
componentDidMount() {
//this.setState({ open: true });
enterpriseCompanyComBaseInfoGetComBaseInfoById({}).then((data) => {
console.log(data, 'componentDidMount');
});
}
handleSubmit = (e) => {
e.preventDefault();
this.props.form.validateFieldsAndScroll((err, values) => {
if (!err) {
this.props.dispatch({
type: 'form/submitRegularForm',
payload: values,
});
}
});
};
callback = (key) => {
console.log(key);
};
handleChange(tag, checked) {
const { selectedTags } = this.state;
const nextSelectedTags = checked ?
[...selectedTags, tag] :
selectedTags.filter(t => t !== tag);
console.log('You are interested in: ', nextSelectedTags);
this.setState({ selectedTags: nextSelectedTags });
}
/* 验证手机号码 */
checkPhone = (rule, value, callback) => {
if (value && !(/^1[0-9]{10}$/).test(value)) {
callback('请输入正确的手机号码!');
} else {
callback();
}
};
render() {
const { submitting } = this.props;
const { getFieldDecorator } = this.props.form;
const formItemLayout = {
labelCol: {
xs: { span: 24 },
sm: { span: 7 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 12 },
md: { span: 10 },
},
};
const submitFormLayout = {
wrapperCol: {
xs: { span: 24, offset: 0 },
sm: { span: 10, offset: 7 },
},
};
return (
{/* 出勤设置-固定班次--添加班次
*/}
{
this.setState({ open });
}}
>
);
}
}