|
@@ -5,7 +5,7 @@ import apiObj from '@api/index';
|
|
|
import moment from "moment";
|
|
|
import "moment/locale/zh-cn"
|
|
|
import { message } from "antd/lib/index";
|
|
|
-import { disabledDate } from '@utils/index'
|
|
|
+import { disabledDate,getDaysBetween } from '@utils/index'
|
|
|
const { post, api, xPost } = apiObj;
|
|
|
const { RangePicker } = DatePicker;
|
|
|
const { Option } = Select;
|
|
@@ -108,12 +108,11 @@ function DutyRecord() {
|
|
|
setSelectedRowKeys(selectedRowKeys);
|
|
|
};
|
|
|
const onFinish = (value) => {
|
|
|
- if (value.changeTime) {
|
|
|
- value.changeTimeStart = moment(value.changeTime[0]).format('YYYY-MM-DD 00:00:00')
|
|
|
- value.changeTimeEnd = moment(value.changeTime[1]).format('YYYY-MM-DD 23:23:59')
|
|
|
- }else{
|
|
|
- value.changeTimeStart =lastmonthday+" 00:00:00"
|
|
|
- value.changeTimeEnd =today+" 23:23:59"
|
|
|
+ value.changeTimeStart = moment(value.changeTimeStart).format('YYYY-MM-DD 00:00:00');
|
|
|
+ value.changeTimeEnd = moment(value.changeTimeEnd).format('YYYY-MM-DD 23:23:59');
|
|
|
+ if (value.changeTimeStart > value.changeTimeEnd) {
|
|
|
+ message.warning('开始时间不能大于结束时间');
|
|
|
+ return
|
|
|
}
|
|
|
const param = {
|
|
|
...data,
|
|
@@ -154,7 +153,7 @@ function DutyRecord() {
|
|
|
form={form}
|
|
|
name="normal_login"
|
|
|
onFinish={onFinish}
|
|
|
- initialValues={{ type: '' }}
|
|
|
+ initialValues={{ type: '', changeTimeStart: moment(lastmonthday), changeTimeEnd: moment(today) }}
|
|
|
>
|
|
|
<Row gutter={24}>
|
|
|
<Col span={5} key={0}>
|
|
@@ -188,15 +187,23 @@ function DutyRecord() {
|
|
|
</Select>
|
|
|
</Form.Item>
|
|
|
</Col>
|
|
|
- <Col span={7} key={5}>
|
|
|
- <Form.Item label="变更时间" name="changeTime">
|
|
|
- <RangePicker
|
|
|
- defaultValue={[moment(lastmonthday), moment(today)]}
|
|
|
- disabledDate={disabledDate}
|
|
|
- placeholder={['开始时间', '结束时间']}
|
|
|
- allowClear={false}
|
|
|
- inputReadOnly={true}
|
|
|
- />
|
|
|
+ <Col span={8} key={5}>
|
|
|
+ <Form.Item label="变更时间">
|
|
|
+ <Form.Item name="changeTimeStart" className='times'>
|
|
|
+ <DatePicker
|
|
|
+ allowClear={false}
|
|
|
+ disabledDate={disabledDate}
|
|
|
+ placeholder="请选择开始日期"
|
|
|
+ />
|
|
|
+ </Form.Item>
|
|
|
+ <span style={{ margin: '0 5px', position: 'relative', top: '2px' }}>-</span>
|
|
|
+ <Form.Item name="changeTimeEnd" className='times'>
|
|
|
+ <DatePicker
|
|
|
+ allowClear={false}
|
|
|
+ disabledDate={disabledDate}
|
|
|
+ placeholder="请选择结束日期"
|
|
|
+ />
|
|
|
+ </Form.Item>
|
|
|
</Form.Item>
|
|
|
</Col>
|
|
|
<Col span={6} key={6}>
|