|
@@ -3,8 +3,14 @@ import { Button, Tabs, Space, Drawer, Timeline, message } from 'antd';
|
|
|
import styles from './index.less';
|
|
|
import { useEffect, useRef, useState } from 'react';
|
|
|
import axios from 'axios';
|
|
|
-import { useRequest } from '@umijs/max';
|
|
|
import {
|
|
|
+ useLocation,
|
|
|
+ useParams,
|
|
|
+ useRequest,
|
|
|
+ useSearchParams,
|
|
|
+} from '@umijs/max';
|
|
|
+import {
|
|
|
+ queryPsrExcel,
|
|
|
queryPsrMonthDetail,
|
|
|
queryPsrMonthList,
|
|
|
queryPsrWorkLoad,
|
|
@@ -12,13 +18,15 @@ import {
|
|
|
} from '../../services/psr';
|
|
|
import SaveModal from './components/saveOtherModal';
|
|
|
import dayjs from 'dayjs';
|
|
|
-const PSRDetail = (props) => {
|
|
|
+const PSRDetail = () => {
|
|
|
+ const params = useParams();
|
|
|
+ const location = useLocation();
|
|
|
+ const { id: projectId } = params;
|
|
|
const {
|
|
|
- projectId = 643,
|
|
|
- project_name = '测试2',
|
|
|
- flow_id = '1',
|
|
|
- node_id = '2',
|
|
|
- } = props;
|
|
|
+ state: { project_name, flow_id, node_id },
|
|
|
+ } = location;
|
|
|
+ console.log('========================', location, luckysheet);
|
|
|
+
|
|
|
const [excelData, setExcelData] = useState();
|
|
|
const [historyOpen, setHistoryOpen] = useState();
|
|
|
const [open, setOpen] = useState();
|
|
@@ -61,6 +69,17 @@ const PSRDetail = (props) => {
|
|
|
};
|
|
|
};
|
|
|
|
|
|
+ //请求投标版、签字版psr excel
|
|
|
+ const { run: runExcel } = useRequest(queryPsrExcel, {
|
|
|
+ manual: true,
|
|
|
+ formatResult: (res) => {
|
|
|
+ if (res) {
|
|
|
+ const jsonData = JSON.parse(res);
|
|
|
+ renderSheet(jsonData);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ });
|
|
|
+
|
|
|
//请求月度psr和现金流列表 data_type 1 psr 2 现金流
|
|
|
const {
|
|
|
data,
|
|
@@ -121,16 +140,29 @@ const PSRDetail = (props) => {
|
|
|
const data_type = key == '3' ? 1 : 2;
|
|
|
setDataType(data_type);
|
|
|
runList({ data_type });
|
|
|
+ axios.get('/excelData.json').then((res) => {
|
|
|
+ if (res.status == 200) {
|
|
|
+ renderSheet(res.data);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else if (key == '1') {
|
|
|
+ runExcel({ gridKey: node_id });
|
|
|
+ } else {
|
|
|
+ runExcel({ gridKey: flow_id });
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- // useEffect(() => {
|
|
|
- // axios.get('/excelData.json').then((res) => {
|
|
|
- // if (res.status == 200) {
|
|
|
- // renderSheet(res.data);
|
|
|
- // }
|
|
|
- // });
|
|
|
- // }, []);
|
|
|
+ useEffect(() => {
|
|
|
+ runExcel({ gridKey: node_id });
|
|
|
+ // axios.get('/excelData.json').then((res) => {
|
|
|
+ // if (res.status == 200) {
|
|
|
+ // renderSheet(res.data);
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // setTimeout(() => {
|
|
|
+ // luckysheetRef.current.setCellValue(1, 1, 33333);
|
|
|
+ // }, 5000);
|
|
|
+ }, []);
|
|
|
|
|
|
const handlerSaveOther = (date) => {
|
|
|
const luckyData = luckysheetRef.current?.toJson();
|
|
@@ -180,6 +212,7 @@ const PSRDetail = (props) => {
|
|
|
cellUpdated: () => {
|
|
|
luckysheetRef.current.refreshFormula();
|
|
|
},
|
|
|
+ workbookCreateAfter: () => {},
|
|
|
},
|
|
|
};
|
|
|
//设置不可编辑
|
|
@@ -229,6 +262,7 @@ const PSRDetail = (props) => {
|
|
|
const contentWindow = iframeRef.current.contentWindow;
|
|
|
luckysheetRef.current = contentWindow.luckysheet;
|
|
|
};
|
|
|
+
|
|
|
const items = [
|
|
|
{
|
|
|
key: '1',
|