|
@@ -52,8 +52,8 @@ function ProjectTree(props) {
|
|
};
|
|
};
|
|
const handleSearch = () => {
|
|
const handleSearch = () => {
|
|
const { time } = form.getFieldsValue();
|
|
const { time } = form.getFieldsValue();
|
|
- filterRef.current.s_time = time[0] ? moment(time[0]).format('YYYY-MM-DD') : null;
|
|
|
|
- filterRef.current.e_time = time[1] ? moment(time[1]).format('YYYY-MM-DD') : null;
|
|
|
|
|
|
+ filterRef.current.s_time = time[0] ? moment(time[0]).format('YYYY-MM') : null;
|
|
|
|
+ filterRef.current.e_time = time[1] ? moment(time[1]).format('YYYY-MM') : null;
|
|
|
|
|
|
dispatch({
|
|
dispatch({
|
|
type: 'report/queryProjectReportNew',
|
|
type: 'report/queryProjectReportNew',
|
|
@@ -83,7 +83,7 @@ function ProjectTree(props) {
|
|
const fn = data => {
|
|
const fn = data => {
|
|
data.forEach(record => {
|
|
data.forEach(record => {
|
|
// 判断是否展开
|
|
// 判断是否展开
|
|
- if(expandedRows.includes(record.key)) {
|
|
|
|
|
|
+ if (expandedRows.includes(record.key)) {
|
|
// 执行项目被展开则显示预算
|
|
// 执行项目被展开则显示预算
|
|
if (record.cond.status == 0) {
|
|
if (record.cond.status == 0) {
|
|
budget = true;
|
|
budget = true;
|
|
@@ -92,21 +92,24 @@ function ProjectTree(props) {
|
|
if (record.child[0]?.dep_name) {
|
|
if (record.child[0]?.dep_name) {
|
|
dep = true;
|
|
dep = true;
|
|
}
|
|
}
|
|
- if(record.child) fn(record.child)
|
|
|
|
|
|
+ if (record.child) fn(record.child);
|
|
}
|
|
}
|
|
- })
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- fn(projectNew)
|
|
|
|
-
|
|
|
|
|
|
+ });
|
|
|
|
+ };
|
|
|
|
+ fn(projectNew);
|
|
|
|
+
|
|
setColumnsFilter({ budget, dep });
|
|
setColumnsFilter({ budget, dep });
|
|
};
|
|
};
|
|
|
|
|
|
const renderSearch = () => {
|
|
const renderSearch = () => {
|
|
return (
|
|
return (
|
|
<Form layout="inline" form={form}>
|
|
<Form layout="inline" form={form}>
|
|
- <Form.Item label="时间" name="time" initialValue={[moment().startOf('years'), moment()]}>
|
|
|
|
- <RangePicker placeholder="选择时间" allowClear={false} />
|
|
|
|
|
|
+ <Form.Item
|
|
|
|
+ label="时间"
|
|
|
|
+ name="time"
|
|
|
|
+ initialValue={[moment().subtract(1, 'month'), moment().subtract(1, 'month')]}
|
|
|
|
+ >
|
|
|
|
+ <RangePicker placeholder="选择时间" allowClear={false} picker="month" />
|
|
</Form.Item>
|
|
</Form.Item>
|
|
<Form.Item>
|
|
<Form.Item>
|
|
<Button type="primary" loading={loading} onClick={handleSearch}>
|
|
<Button type="primary" loading={loading} onClick={handleSearch}>
|