|  | @@ -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 AuditModal from './components/AuditModal';
 | 
											
												
													
														|  |  import FormAndFilesNode from './components/FormAndFilesNode';
 |  |  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 PageContent from '@/components/PageContent';
 | 
											
												
													
														|  |  import SignModal from './components/SignModal';
 |  |  import SignModal from './components/SignModal';
 | 
											
												
													
														|  |  import ContractDetail from '../ContractManager/detail';
 |  |  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() {
 |  |  function OaAuditDetail() {
 | 
											
												
													
														|  | -  const { initialState } = useModel('@@initialState');
 |  | 
 | 
											
												
													
														|  | 
 |  | +  const {initialState} = useModel('@@initialState');
 | 
											
												
													
														|  |    const user = initialState?.user || {};
 |  |    const user = initialState?.user || {};
 | 
											
												
													
														|  |    const [auditVisible, setAuditVisible] = useState(false);
 |  |    const [auditVisible, setAuditVisible] = useState(false);
 | 
											
												
													
														|  | -  const location = useLocation();
 |  | 
 | 
											
												
													
														|  | -  const {
 |  | 
 | 
											
												
													
														|  | -    state: { id, type, code },
 |  | 
 | 
											
												
													
														|  | -  } = location;
 |  | 
 | 
											
												
													
														|  |    const [visible, setVisible] = useState(false);
 |  |    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(() => {
 |  |    useEffect(() => {
 | 
											
												
													
														|  | -    if (type == Type.CON) runCon({ code });
 |  | 
 | 
											
												
													
														|  | 
 |  | +    if (type == Type.CON) runCon({code});
 | 
											
												
													
														|  |    }, [type]);
 |  |    }, [type]);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -  const { data, loading, refresh } = useRequest(queryAuditDetail, {
 |  | 
 | 
											
												
													
														|  | -    defaultParams: [{ id }],
 |  | 
 | 
											
												
													
														|  | 
 |  | +  const {data, loading, refresh} = useRequest(queryAuditDetail, {
 | 
											
												
													
														|  | 
 |  | +    defaultParams: [{id}],
 | 
											
												
													
														|  |    });
 |  |    });
 | 
											
												
													
														|  |    const {
 |  |    const {
 | 
											
												
													
														|  |      current_seq,
 |  |      current_seq,
 | 
											
										
											
												
													
														|  | @@ -49,7 +58,8 @@ function OaAuditDetail() {
 | 
											
												
													
														|  |      formatResult: (res) => {
 |  |      formatResult: (res) => {
 | 
											
												
													
														|  |        return res?.data?.detail;
 |  |        return res?.data?.detail;
 | 
											
												
													
														|  |      },
 |  |      },
 | 
											
												
													
														|  | -    onSuccess: (res) => {},
 |  | 
 | 
											
												
													
														|  | 
 |  | +    onSuccess: (res) => {
 | 
											
												
													
														|  | 
 |  | +    },
 | 
											
												
													
														|  |    });
 |  |    });
 | 
											
												
													
														|  |    // console.log(conData);
 |  |    // console.log(conData);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -63,7 +73,7 @@ function OaAuditDetail() {
 | 
											
												
													
														|  |            {str}
 |  |            {str}
 | 
											
												
													
														|  |            <div>
 |  |            <div>
 | 
											
												
													
														|  |              <Tooltip title={node.desc}>
 |  |              <Tooltip title={node.desc}>
 | 
											
												
													
														|  | -              <span style={{ color: '#1A73E8', textDecoration: 'undeline' }}>
 |  | 
 | 
											
												
													
														|  | 
 |  | +              <span style={{color: '#1A73E8', textDecoration: 'undeline'}}>
 | 
											
												
													
														|  |                  审批意见
 |  |                  审批意见
 | 
											
												
													
														|  |                </span>
 |  |                </span>
 | 
											
												
													
														|  |              </Tooltip>
 |  |              </Tooltip>
 | 
											
										
											
												
													
														|  | @@ -109,7 +119,7 @@ function OaAuditDetail() {
 | 
											
												
													
														|  |        return [
 |  |        return [
 | 
											
												
													
														|  |          <Button
 |  |          <Button
 | 
											
												
													
														|  |            key={1}
 |  |            key={1}
 | 
											
												
													
														|  | -          style={{ marginRight: 10 }}
 |  | 
 | 
											
												
													
														|  | 
 |  | +          style={{marginRight: 10}}
 | 
											
												
													
														|  |            type="primary"
 |  |            type="primary"
 | 
											
												
													
														|  |            onClick={() => setAuditVisible(1)}
 |  |            onClick={() => setAuditVisible(1)}
 | 
											
												
													
														|  |          >
 |  |          >
 | 
											
										
											
												
													
														|  | @@ -129,7 +139,7 @@ function OaAuditDetail() {
 | 
											
												
													
														|  |    return (
 |  |    return (
 | 
											
												
													
														|  |      <PageContent extra={btns} loading={loading && conLoading}>
 |  |      <PageContent extra={btns} loading={loading && conLoading}>
 | 
											
												
													
														|  |        <Steps
 |  |        <Steps
 | 
											
												
													
														|  | -        style={{ marginBottom: 20 }}
 |  | 
 | 
											
												
													
														|  | 
 |  | +        style={{marginBottom: 20}}
 | 
											
												
													
														|  |          current={audit_status == 3 ? OaAuditList?.length : current_seq - 1}
 |  |          current={audit_status == 3 ? OaAuditList?.length : current_seq - 1}
 | 
											
												
													
														|  |          status={audit_status == 2 ? 'error' : 'process'}
 |  |          status={audit_status == 2 ? 'error' : 'process'}
 | 
											
												
													
														|  |          items={OaAuditList?.map((item) => ({
 |  |          items={OaAuditList?.map((item) => ({
 | 
											
										
											
												
													
														|  | @@ -138,9 +148,9 @@ function OaAuditDetail() {
 | 
											
												
													
														|  |          }))}
 |  |          }))}
 | 
											
												
													
														|  |        ></Steps>
 |  |        ></Steps>
 | 
											
												
													
														|  |        {type == Type.OA ? (
 |  |        {type == Type.OA ? (
 | 
											
												
													
														|  | -        <FormAndFilesNode formData={form} fileList={Files} />
 |  | 
 | 
											
												
													
														|  | 
 |  | +        <FormAndFilesNode formData={form} fileList={Files}/>
 | 
											
												
													
														|  |        ) : (
 |  |        ) : (
 | 
											
												
													
														|  | -        <ContractDetail data={conData} />
 |  | 
 | 
											
												
													
														|  | 
 |  | +        <ContractDetail data={conData}/>
 | 
											
												
													
														|  |        )}
 |  |        )}
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |        <AuditModal
 |  |        <AuditModal
 |