|
@@ -25,6 +25,25 @@ function FinanceResource(props) {
|
|
|
{ title: '招采中心执行人日数', dataIndex: 'purchase_exe_workload' },
|
|
|
];
|
|
|
|
|
|
+ var initDate;
|
|
|
+ if (moment().date() > 25) {
|
|
|
+ initDate = [
|
|
|
+ moment()
|
|
|
+ .subtract(1, 'month')
|
|
|
+ .set('date', 26),
|
|
|
+ moment().set('date', 25),
|
|
|
+ ];
|
|
|
+ } else {
|
|
|
+ initDate = [
|
|
|
+ moment()
|
|
|
+ .subtract(2, 'month')
|
|
|
+ .set('date', 26),
|
|
|
+ moment()
|
|
|
+ .subtract(1, 'month')
|
|
|
+ .set('date', 25),
|
|
|
+ ];
|
|
|
+ }
|
|
|
+
|
|
|
const handleSearch = () => {
|
|
|
const { time } = form.getFieldsValue();
|
|
|
let s_time = time[0] ? moment(time[0]).format('YYYY-MM') : null;
|
|
@@ -42,12 +61,8 @@ function FinanceResource(props) {
|
|
|
const renderSearch = () => {
|
|
|
return (
|
|
|
<Form layout="inline" form={form}>
|
|
|
- <Form.Item
|
|
|
- label="时间"
|
|
|
- name="time"
|
|
|
- initialValue={[moment().subtract(1, 'month'), moment().subtract(1, 'month')]}
|
|
|
- >
|
|
|
- <RangePicker placeholder="选择时间" allowClear={false} picker="month" />
|
|
|
+ <Form.Item label="时间" name="time" initialValue={initDate}>
|
|
|
+ <RangePicker placeholder="选择时间" allowClear={false} />
|
|
|
</Form.Item>
|
|
|
<Form.Item>
|
|
|
<Button type="primary" loading={loading} onClick={handleSearch}>
|