|
@@ -1,33 +1,42 @@
|
|
|
// 审批详情
|
|
|
-import React, { useState, useMemo, useEffect } from 'react';
|
|
|
-import { Steps, Button, Tooltip, message, Spin } from 'antd';
|
|
|
-import { useParams, useRequest, useModel, useLocation } from 'umi';
|
|
|
+import React, {useState, useMemo, useEffect} from 'react';
|
|
|
+import {Steps, Button, Tooltip, message, Spin} from 'antd';
|
|
|
+import {useRequest, useModel, useLocation} from 'umi';
|
|
|
import AuditModal from './components/AuditModal';
|
|
|
import FormAndFilesNode from './components/FormAndFilesNode';
|
|
|
-import { queryAuditDetail, updateAuditList } from '@/services/boom';
|
|
|
-import { queryGetContractList } from '@/services/contract';
|
|
|
+import {queryAuditDetail, updateAuditList} from '@/services/boom';
|
|
|
+import {queryGetContractList} from '@/services/contract';
|
|
|
import PageContent from '@/components/PageContent';
|
|
|
import SignModal from './components/SignModal';
|
|
|
import ContractDetail from '../ContractManager/detail';
|
|
|
-import { Type } from '../Profile';
|
|
|
-import { queryContractDetail } from '../../services/contract';
|
|
|
+import {Type} from '../Profile';
|
|
|
+import {queryContractDetail} from '../../services/contract';
|
|
|
|
|
|
function OaAuditDetail() {
|
|
|
- const { initialState } = useModel('@@initialState');
|
|
|
+ const {initialState} = useModel('@@initialState');
|
|
|
const user = initialState?.user || {};
|
|
|
const [auditVisible, setAuditVisible] = useState(false);
|
|
|
- const location = useLocation();
|
|
|
- const {
|
|
|
- state: { id, type, code },
|
|
|
- } = location;
|
|
|
const [visible, setVisible] = useState(false);
|
|
|
|
|
|
+ const location = useLocation();
|
|
|
+ const queryParams = new URLSearchParams(location.search);
|
|
|
+ // 使用queryParams来获取特定查询参数
|
|
|
+ const id = queryParams.get('id');
|
|
|
+ const code = queryParams.get('code');
|
|
|
+ const token = queryParams.get('JWT-TOKEN')
|
|
|
+ if (!localStorage['JWT-TOKEN']) {
|
|
|
+ localStorage['JWT-TOKEN'] = token
|
|
|
+ }
|
|
|
+
|
|
|
+ const type = code ? Type.CON : Type.OA
|
|
|
+
|
|
|
+
|
|
|
useEffect(() => {
|
|
|
- if (type == Type.CON) runCon({ code });
|
|
|
+ if (type == Type.CON) runCon({code});
|
|
|
}, [type]);
|
|
|
|
|
|
- const { data, loading, refresh } = useRequest(queryAuditDetail, {
|
|
|
- defaultParams: [{ id }],
|
|
|
+ const {data, loading, refresh} = useRequest(queryAuditDetail, {
|
|
|
+ defaultParams: [{id}],
|
|
|
});
|
|
|
const {
|
|
|
current_seq,
|
|
@@ -49,7 +58,8 @@ function OaAuditDetail() {
|
|
|
formatResult: (res) => {
|
|
|
return res?.data?.detail;
|
|
|
},
|
|
|
- onSuccess: (res) => {},
|
|
|
+ onSuccess: (res) => {
|
|
|
+ },
|
|
|
});
|
|
|
// console.log(conData);
|
|
|
|
|
@@ -63,7 +73,7 @@ function OaAuditDetail() {
|
|
|
{str}
|
|
|
<div>
|
|
|
<Tooltip title={node.desc}>
|
|
|
- <span style={{ color: '#1A73E8', textDecoration: 'undeline' }}>
|
|
|
+ <span style={{color: '#1A73E8', textDecoration: 'undeline'}}>
|
|
|
审批意见
|
|
|
</span>
|
|
|
</Tooltip>
|
|
@@ -109,7 +119,7 @@ function OaAuditDetail() {
|
|
|
return [
|
|
|
<Button
|
|
|
key={1}
|
|
|
- style={{ marginRight: 10 }}
|
|
|
+ style={{marginRight: 10}}
|
|
|
type="primary"
|
|
|
onClick={() => setAuditVisible(1)}
|
|
|
>
|
|
@@ -129,7 +139,7 @@ function OaAuditDetail() {
|
|
|
return (
|
|
|
<PageContent extra={btns} loading={loading && conLoading}>
|
|
|
<Steps
|
|
|
- style={{ marginBottom: 20 }}
|
|
|
+ style={{marginBottom: 20}}
|
|
|
current={audit_status == 3 ? OaAuditList?.length : current_seq - 1}
|
|
|
status={audit_status == 2 ? 'error' : 'process'}
|
|
|
items={OaAuditList?.map((item) => ({
|
|
@@ -138,9 +148,9 @@ function OaAuditDetail() {
|
|
|
}))}
|
|
|
></Steps>
|
|
|
{type == Type.OA ? (
|
|
|
- <FormAndFilesNode formData={form} fileList={Files} />
|
|
|
+ <FormAndFilesNode formData={form} fileList={Files}/>
|
|
|
) : (
|
|
|
- <ContractDetail data={conData} />
|
|
|
+ <ContractDetail data={conData}/>
|
|
|
)}
|
|
|
|
|
|
<AuditModal
|