Browse Source

修改个人中心

Renxy 1 năm trước cách đây
mục cha
commit
933e34f3ae

+ 26 - 26
.umirc.ts

@@ -152,39 +152,39 @@ export default defineConfig({
     //     },
     //   ],
     // },
+    // {
+    //   name: '个人中心',
+    //   path: '/profile',
+    //   icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/profileIcon.png',
+    //   routes: [
+    //     {
+    //       name: '我的申请',
+    //       path: '/profile/apply',
+    //       component: './Profile/apply',
+    //     },
+    //     {
+    //       name: '我的审批',
+    //       path: '/profile/approve',
+    //       component: './Profile/approve',
+    //     },
+    //     {
+    //       name: '已审核',
+    //       path: '/profile/approved',
+    //       component: './Profile/approved',
+    //     },
+    //   ],
+    //   // component: './Profile/index',
+    //   // hideInMenu: true,
+    // },
     {
       name: '个人中心',
       path: '/profile',
+      component: './Profile/index',
       icon: 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/doc/department/2023-04/profileIcon.png',
-      routes: [
-        {
-          name: '我的申请',
-          path: '/profile/apply',
-          component: './Profile/apply',
-        },
-        {
-          name: '我的审批',
-          path: '/profile/approve',
-          component: './Profile/approve',
-        },
-        {
-          name: '已审核',
-          path: '/profile/approved',
-          component: './Profile/approved',
-        },
-      ],
-      // component: './Profile/index',
-      // hideInMenu: true,
     },
-    // {
-    //   name: '个人中心',
-    //   path: '/profile',
-    //   component: './Profile/index',
-    //   hideInMenu: true,
-    // },
     {
       name: '审批详情',
-      path: '/profile/:id',
+      path: '/profile/detail',
       component: './Flow/OaAuditDetail',
       hideInMenu: true,
     },

+ 39 - 5
src/pages/ContractManager/component/Modal.jsx

@@ -659,7 +659,7 @@ const ContractModal = (props) => {
               <Form.Item
                 name="dep_id"
                 label="所属部门:"
-                initialValue={getDepItemById(data?.dep_id)?.Name}
+                initialValue={data?.dep_id}
                 rules={[
                   {
                     required: true,
@@ -667,7 +667,24 @@ const ContractModal = (props) => {
                   },
                 ]}
               >
-                <TreeSelect
+                <Select
+                  showSearch
+                  style={{ width: '100%' }}
+                  placeholder="请选择"
+                  disabled={disableds.contract || disableds.recall}
+                  filterOption={(input, option) =>
+                    (option?.label ?? '')
+                      .toLowerCase()
+                      .includes(input.toLowerCase())
+                  }
+                  options={companyDepList?.map((item) => {
+                    return {
+                      value: item.ID,
+                      label: item.Name,
+                    };
+                  })}
+                />
+                {/* <TreeSelect
                   style={{ width: '100%' }}
                   placeholder="请选择"
                   showSearch
@@ -680,7 +697,7 @@ const ContractModal = (props) => {
                   disabled={disableds.contract || disableds.recall}
                   dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
                   treeData={companyDepList}
-                />
+                /> */}
               </Form.Item>
             </Col>
           </Row>
@@ -715,7 +732,24 @@ const ContractModal = (props) => {
                   },
                 ]}
               >
-                <TreeSelect
+                <Select
+                  showSearch
+                  style={{ width: '100%' }}
+                  placeholder="请选择"
+                  disabled={disableds.contract}
+                  filterOption={(input, option) =>
+                    (option?.label ?? '')
+                      .toLowerCase()
+                      .includes(input.toLowerCase())
+                  }
+                  options={companyDepList?.map((item) => {
+                    return {
+                      value: item.ID,
+                      label: item.Name,
+                    };
+                  })}
+                />
+                {/* <TreeSelect
                   style={{ width: '100%' }}
                   placeholder="请选择"
                   showSearch
@@ -728,7 +762,7 @@ const ContractModal = (props) => {
                   }}
                   dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
                   treeData={companyDepList}
-                />
+                /> */}
               </Form.Item>
             </Col>
           </Row>

+ 40 - 10
src/pages/Flow/OaAuditDetail.js

@@ -1,18 +1,33 @@
 // 审批详情
-import React, { useState, useMemo } from 'react';
-import { Steps, Button, Tooltip, message } from 'antd';
-import { useParams, useRequest, useModel } from 'umi';
+import React, { useState, useMemo, useEffect } from 'react';
+import { Steps, Button, Tooltip, message, Spin } from 'antd';
+import { useParams, 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 PageContent from '@/components/PageContent';
 import SignModal from './components/SignModal';
+import ContractDetail from '../ContractManager/detail';
+import { Type } from '../Profile';
+import { queryContractDetail } from '../../services/contract';
+
+function OaAuditDetail() {
+  const {
+    initialState: { user },
+  } = useModel('@@initialState');
 
-function OaAuditDetail(props) {
   const [auditVisible, setAuditVisible] = useState(false);
-  const { oaId, id } = useParams();
+  const location = useLocation();
+  const {
+    state: { id, type, code },
+  } = location;
   const [visible, setVisible] = useState(false);
 
+  useEffect(() => {
+    if (type == Type.CON) runCon({ code });
+  }, [type]);
+
   const { data, loading, refresh } = useRequest(queryAuditDetail, {
     defaultParams: [{ id }],
   });
@@ -24,10 +39,21 @@ function OaAuditDetail(props) {
     audit_status,
     AuditorInfo,
   } = data || {};
-  if (OaAuditList) console.log(JSON.stringify(OaAuditList));
+  // if (OaAuditList) console.log(JSON.stringify(OaAuditList));
+
+  //请求列表
   const {
-    initialState: { user },
-  } = useModel('@@initialState');
+    data: conData,
+    run: runCon,
+    loading: conLoading,
+  } = useRequest((data) => queryContractDetail(data), {
+    manual: true,
+    formatResult: (res) => {
+      return res?.data?.detail;
+    },
+    onSuccess: (res) => {},
+  });
+  // console.log(conData);
 
   const getDescription = (node) => {
     let str = node?.AuditRoleInfo
@@ -103,7 +129,7 @@ function OaAuditDetail(props) {
   }, [user, data]);
 
   return (
-    <PageContent extra={btns} loading={loading}>
+    <PageContent extra={btns} loading={loading && conLoading}>
       <Steps
         style={{ marginBottom: 20 }}
         current={audit_status == 3 ? OaAuditList?.length : current_seq - 1}
@@ -113,7 +139,11 @@ function OaAuditDetail(props) {
           description: getDescription(item),
         }))}
       ></Steps>
-      <FormAndFilesNode formData={form} fileList={Files} />
+      {type == Type.OA ? (
+        <FormAndFilesNode formData={form} fileList={Files} />
+      ) : (
+        <ContractDetail data={conData} />
+      )}
 
       <AuditModal
         id={id}

+ 190 - 400
src/pages/Profile/index.js

@@ -1,233 +1,35 @@
 import React, { Fragment, useState, useEffect, useMemo, useRef } from 'react';
 import { useNavigate } from 'umi';
-import {
-  Card,
-  Table,
-  Empty,
-  Button,
-  Modal,
-  message,
-  Form,
-  DatePicker,
-  Row,
-  Col,
-  Select,
-} from 'antd';
-const { RangePicker } = DatePicker;
-import { useRequest, useModel } from '@umijs/max';
-import { queryProfileList, queryApplyList } from '@/services/boom';
+import { Table, Modal, DatePicker, Divider } from 'antd';
+import { useRequest } from '@umijs/max';
+import { queryProfileList, queryApplyList, applyRepeal } from '@/services/boom';
 import dayjs from 'dayjs';
-import { queryContractCheck, queryGetContractList } from '@/services/contract';
-import ContractModal, {
-  Status,
-  StatusText,
-  Type,
-} from '../ContractManager/component/Modal';
 import PageContent from '@/components/PageContent';
+import { queryApprovedList } from '@/services/contract';
+import { ExclamationCircleOutlined } from '@ant-design/icons';
+
+export const Type = {
+  OA: 1,
+  CON: 2,
+};
 
 function profile(props) {
-  const {
-    initialState: { user },
-  } = useModel('@@initialState');
   const [tabActive, setTabActive] = useState('1');
-  const approveFormRef = useRef();
-  const applyFormRef = useRef();
-  let navigate = useNavigate();
-  const [detail, setDetail] = useState({});
-  const [conVisible, setConVisible] = useState(false);
-
-  const TYPE = {
-    Contract: 1,
-    OA: 2,
-  };
-
-  //OA我的申请列表
-  const {
-    data: OAApplyData,
-    run: OAApplyRun,
-    loading: OAApplyLoading,
-  } = useRequest(queryProfileList, {
-    // manual: true,
-    formatResult: (res) => {
-      return res.data?.list?.map((item) => {
-        return {
-          ...item,
-          CName: item.AuthorInfo.CName,
-          table_desc: [item.table_desc],
-          statusText: (() => {
-            switch (item.audit_status) {
-              case 0:
-                return '审核中';
-              case 1:
-                return '通过';
-              case 2:
-                return '拒绝';
-              case 3:
-                return '终审通过';
-            }
-          })(),
-          key: `${TYPE.Contract}_${item.id}`,
-          type: TYPE.OA,
-        };
-      });
-    },
+  const [loading, setLoading] = useState(false);
+  const [columns, setColumes] = useState([]);
+  const [data, setData] = useState({
+    list: [],
+    pagination: {},
   });
-  //OA我的审批和待审批列表
-  const {
-    data: OAAuditData,
-    run: OAAuditRun,
-    loading: OAAuditLoading,
-  } = useRequest(queryProfileList, {
-    manual: true,
-    formatResult: (res) => {
-      return res.data?.list?.map((item) => {
-        return {
-          ...item,
-          CName: item.AuthorInfo.CName,
-          table_desc: [item.table_desc],
-          statusText: item.status,
-          // key: `${TYPE.Contract}_${item.id}`,
-          showBtn: true,
-          type: TYPE.OA,
-        };
-      });
-    },
-  });
-
-  //合同管理返回处理函数
-  const contractResult = (res) => {
-    let data = res.data?.list;
-    return data?.map((item) => {
-      return {
-        ...item,
-        table_name: `${user.CName}提交的合同审批`,
-        table_desc: [
-          `合同名称:${item.name}`,
-          `合同编号:${item.code}`,
-          `合同金额:${item.amount}万元`,
-        ],
-        CName: user.CName,
-        create_time: item.cancel_on || item.created_on,
-        type: TYPE.Contract,
-        statusText: StatusText[item.status],
-        showBtn:
-          item.status == Status.Checking || item.status == Status.CalChecking,
-        // key: `${TYPE.Contract}_${item.id}`,
-      };
-    });
-  };
-
-  //合同管理相关数据
-  //请求我的申请列表
-  const {
-    data: conApplyData,
-    run: conApplyRun,
-    loading: conApplyLoading,
-  } = useRequest(queryGetContractList, {
-    defaultParams: [{ created_by: user?.ID }],
-    formatResult: contractResult,
-  });
-  //我的待审批列表
-  const {
-    data: conAuditData,
-    run: conAuditRun,
-    loading: conAduitLoading,
-  } = useRequest((data) => queryGetContractList(data), {
-    manual: true,
-    formatResult: contractResult,
-  });
-  //我审批过的列表
-  const {
-    data: conAuditedData,
-    run: conAuditedRun,
-    loading: conAduitedLoading,
-  } = useRequest((data) => queryGetContractList(data), {
-    manual: true,
-    formatResult: contractResult,
-  });
-
-  //审核合同
-  const { run: runCheck, loading: checkLoading } = useRequest(
-    (data) => queryContractCheck(data),
-    {
-      manual: true,
-      onSuccess: () => {
-        conAuditRun({ status: 1 });
-        conAuditedRun({ check_by: user.CName });
-        setConVisible(false);
-        message.success('审核成功');
-      },
-      onErroe: () => {
-        message.error('审核失败');
-      },
-    },
-  );
-
-  //拼接审核数据和申请数据  审核loading和申请loading
-  const auditData = useMemo(() => {
-    let result = [];
-    if (OAAuditData && OAAuditData.length > 0) result = [...OAAuditData];
-    if (conAuditData && conAuditData.length > 0)
-      result = [...result, ...conAuditData];
-    if (conAuditedData && conAuditedData.length > 0)
-      result = [...result, ...conAuditedData];
-    return result;
-  }, [OAAuditData, conAuditData, conAuditedData]);
-
-  const auditLoading = useMemo(() => {
-    let loading = false;
-    if (OAAuditLoading || conAduitLoading || conAduitedLoading) loading = true;
-    return loading;
-  }, [OAAuditLoading, conAduitLoading, conAduitedLoading]);
-
-  const applyData = useMemo(() => {
-    let result = [];
-    if (OAApplyData && OAApplyData.length > 0) result = [...OAApplyData];
-    if (conApplyData && conApplyData.length > 0)
-      result = [...result, ...conApplyData];
-    return result;
-  }, [OAApplyData, conApplyData]);
-
-  const applyLoading = useMemo(() => {
-    let loading = false;
-    if (OAApplyLoading || conApplyLoading) loading = true;
-    return loading;
-  }, [OAApplyLoading, conApplyLoading]);
-
-  // useEffect(() => {
-  //   if (user?.Permission['menu-001-audit']) run({ status: 1 });
-  // }, [user]);
+  let navigate = useNavigate();
 
-  const onTabChange = (activeKey) => {
-    if (activeKey == '1') {
-      OAApplyRun();
-      conApplyRun();
-    } else {
-      OAAuditRun();
-      if (user?.Permission['menu-001-audit']) conAuditRun({ status: 1 });
-      conAuditedRun({ check_by: user.CName });
-    }
-    setTabActive(activeKey);
-  };
-  const columns = [
+  const columnsApplay = [
     {
       title: '标题',
       dataIndex: 'table_name',
       width: '30%',
     },
-    {
-      title: '摘要',
-      dataIndex: 'table_desc',
-      render: (descList) => {
-        return (
-          <ul>
-            {descList?.map((item) => (
-              <li>{item}</li>
-            ))}
-          </ul>
-        );
-      },
-    },
+
     {
       title: '发起人',
       dataIndex: 'CName',
@@ -242,203 +44,197 @@ function profile(props) {
     },
     {
       title: '流程状态',
-      dataIndex: 'statusText',
-      // render: (record) => {
-      //   switch (record.audit_status) {
-      //     case 0: return '审核中'
-      //     case 1: return '通过'
-      //     case 2: return '拒绝'
-      //     case 3: return '终审通过'
-      //   }
-      // },
-      // width: '20%'
+      // dataIndex: 'status',
+      render: (record) => {
+        if (record.is_repeal) return '已撤回';
+        switch (record.audit_status) {
+          case 0:
+            return '审核中';
+          case 1:
+            return '通过';
+          case 2:
+            return '拒绝';
+          case 3:
+            return '终审通过';
+        }
+      },
+      width: '20%',
     },
     {
       title: '操作',
-      render: (text, record) => (
-        <Fragment>
-          <>
-            <a
-              style={{ color: '#4096ff' }}
-              onClick={() => {
-                navigate(`/profile/${record.id}`);
-              }}
-            >
-              详情
-            </a>
-          </>
-        </Fragment>
-      ),
-      width: '10%',
-    },
-  ];
-  const approveColumns = [
-    {
-      title: '标题',
-      dataIndex: 'table_name',
-    },
-    {
-      title: '摘要',
-      dataIndex: 'table_desc',
-      render: (descList) => {
+      render: (record) => {
         return (
-          <ul>
-            {descList?.map((item) => (
-              <li>{item}</li>
-            ))}
-          </ul>
+          !record.is_repeal && (
+            <Fragment>
+              <>
+                <a
+                  style={{ color: '#4096ff' }}
+                  onClick={() => {
+                    if (record.extend_code) {
+                      navigate('/profile/detail', {
+                        state: {
+                          id: record.id,
+                          code: record.extend_code,
+                          type: Type.CON,
+                        },
+                      });
+                    } else {
+                      navigate('/profile/detail', {
+                        state: { id: record.id, type: Type.OA },
+                      });
+                    }
+                  }}
+                >
+                  详情
+                </a>
+                {tabActive == '1' && record?.audit_status == 0 && (
+                  <>
+                    <Divider type="vertical" />
+                    <a
+                      style={{ color: '#4096ff' }}
+                      onClick={() => onRepeal(record)}
+                    >
+                      撤回
+                    </a>
+                  </>
+                )}
+              </>
+            </Fragment>
+          )
         );
       },
+      width: '10%',
     },
+  ];
+  const columnsApproved = [
     {
-      title: '发起人',
-      dataIndex: 'CName',
+      title: '标题',
+      dataIndex: 'name',
+      width: '30%',
     },
+    // {
+    //   title: '摘要',
+    //   dataIndex: 'table_desc',
+    //   render: (descList) => {
+    //     return (
+    //       <ul>
+    //         {descList?.map((item) => (
+    //           <li>{item}</li>
+    //         ))}
+    //       </ul>
+    //     );
+    //   },
+    // },
+    // {
+    //   title: '发起人',
+    //   dataIndex: 'CName',
+    //   width: '20%',
+    // },
     {
       title: '发起时间',
       render: (record) => {
         return dayjs(record.create_time).format('YYYY-MM-DD HH:mm:ss');
       },
+      width: '20%',
     },
     {
-      title: '流程状态',
-      dataIndex: 'statusText',
+      title: '我审批的时间',
+      render: (record) => {
+        return dayjs(record.audit_time).format('YYYY-MM-DD HH:mm:ss');
+      },
+      width: '20%',
     },
     {
-      title: '操作',
-      dataIndex: 'showBtn',
-      render: (text, record) => (
-        <>
-          {text ? (
-            <a
-              style={{ color: '#4096ff' }}
-              onClick={() => {
-                if (record.type == TYPE.Contract) {
-                  setDetail(record);
-                  setConVisible(true);
-                } else {
-                  navigate(`/oa/detail/${record.flow_id}/${record.id}`);
-                }
-              }}
-            >
-              审批
-            </a>
-          ) : (
-            <div>已审批</div>
-          )}
-        </>
-      ),
+      title: '状态',
+      // dataIndex: 'status',
+      render: (record) => {
+        switch (record.audit_status) {
+          case 0:
+            return '审核中';
+          case 1:
+            return '通过';
+          case 2:
+            return '拒绝';
+          case 3:
+            return '终审通过';
+        }
+      },
+      width: '20%',
     },
   ];
-  const handleApplySubmit = (values) => {
-    console.log(values);
-    queryApplyListRequest.run(values);
+
+  //我的申请
+  const queryApplay = async () => {
+    const data = await queryApplyList();
+    console.log(data);
+    setData(data);
+    setLoading(false);
   };
-  const handleApproveSubmit = (values) => {
-    console.log(values);
+  //我的待审批
+  const queryApprove = async () => {
+    const data = await queryProfileList();
+    console.log(data);
+    setData(data);
+    setLoading(false);
   };
-  const handleApplyPaginationChange = (pagination) => {
-    queryApplyListRequest.run({
-      currentPage: pagination.current,
-      pageSize: pagination.pageSize,
-    });
+  //我的已审批
+  const queryApproved = async () => {
+    const data = await queryApprovedList();
+    console.log(data);
+    setData(data);
+    setLoading(false);
   };
-  const handleProfilePaginationChange = (pagination) => {
-    queryProfileListRequest.run({
-      currentPage: pagination.current,
-      pageSize: pagination.pageSize,
-    });
+
+  //撤回申请
+  const { run: runRepeal, loading: repealLoading } = useRequest(
+    (id) => applyRepeal({ id }),
+    {
+      manual: true,
+      onSuccess: () => {
+        handlerTabChange(tabActive);
+      },
+    },
+  );
+
+  const handlerTabChange = (tab) => {
+    setLoading(true);
+    switch (tab) {
+      case '1':
+        setColumes(columnsApplay);
+        queryApplay();
+        break;
+      case '2':
+        setColumes(columnsApplay);
+        queryApprove();
+        break;
+      case '3':
+        setColumes(columnsApproved);
+        queryApproved();
+        break;
+    }
   };
-  const renderPage = (activeKey) => {
-    if (activeKey == '1')
-      return (
-        <>
-          {' '}
-          <Form
-            name="basic"
-            // labelCol={{ span: 0 }}
-            // wrapperCol={{ span: 24 }}
-            onFinish={handleApplySubmit}
-            ref={applyFormRef}
-          >
-            <div style={{ display: 'flex' }}>
-              <Form.Item name="range-picker" label="申请时间:">
-                <RangePicker />
-              </Form.Item>
-              <Form.Item>
-                <Button
-                  type="primary"
-                  htmlType="submit"
-                  style={{ marginLeft: 10 }}
-                >
-                  查询
-                </Button>
-              </Form.Item>
-            </div>
-          </Form>
-          <Table
-            columns={columns}
-            dataSource={applyData}
-            loading={applyLoading}
-            // columns={columns}
-            // loading={queryApplyListRequest.loading}
-            // dataSource={queryApplyListRequest?.data?.list}
-            // pagination={queryApplyListRequest?.data?.pagination}
-            // onChange={handleApplyPaginationChange}
-          />
-        </>
-      );
-    else if (activeKey == '2')
-      return (
-        <>
-          {' '}
-          <Form
-            name="basic"
-            // labelCol={{ span: 0 }}
-            // wrapperCol={{ span: 24 }}
-            onFinish={handleApproveSubmit}
-            ref={approveFormRef}
-          >
-            <div style={{ display: 'flex' }}>
-              <Form.Item name="range-picker" label="审批时间:">
-                <RangePicker />
-              </Form.Item>
-              <Form.Item name="audit_status" label="状态:" initialValue="">
-                <Select
-                  style={{ width: 120 }}
-                  options={[
-                    { value: '', label: '全部' },
-                    { value: '0', label: '审核中' },
-                    { value: '1', label: '通过' },
-                    { value: '2', label: '拒绝' },
-                    { value: '3', label: '终审通过' },
-                  ]}
-                />
-              </Form.Item>
-              <Form.Item>
-                <Button
-                  type="primary"
-                  htmlType="submit"
-                  style={{ marginLeft: 10 }}
-                >
-                  查询
-                </Button>
-              </Form.Item>
-            </div>
-          </Form>
-          <Table
-            columns={approveColumns}
-            dataSource={auditData}
-            loading={auditLoading}
-            // loading={queryProfileListRequest.loading}
-            // columns={approveColumns}
-            // dataSource={queryProfileListRequest?.data?.list}
-            // pagination={queryProfileListRequest?.data?.pagination}
-            // onChange={handleProfilePaginationChange}
-          />
-        </>
-      );
+
+  useEffect(() => {
+    handlerTabChange('1');
+  }, []);
+
+  useEffect(() => {
+    handlerTabChange(tabActive);
+  }, [tabActive]);
+
+  const onRepeal = (record) => {
+    Modal.confirm({
+      title: '撤回',
+      icon: <ExclamationCircleOutlined />,
+      content: `确定撤回申请`,
+      okText: '确认',
+      cancelText: '取消',
+      onOk: () => {
+        runRepeal(record.id);
+      },
+    });
   };
+
   return (
     <PageContent
       tabList={[
@@ -450,20 +246,14 @@ function profile(props) {
           tab: '我的审批',
           key: '2',
         },
+        {
+          tab: '已审批',
+          key: '3',
+        },
       ]}
-      onTabChange={onTabChange}
+      onTabChange={setTabActive}
     >
-      <div>{renderPage(tabActive)}</div>
-      <ContractModal
-        detail={detail}
-        type={Type.check}
-        // projectList={projectData?.list}
-        visible={conVisible}
-        handleOk={(data) =>
-          detail.status == Status.Checking ? runCheck(data) : null
-        }
-        handleCancel={() => setConVisible(false)}
-      />
+      <Table columns={columns} dataSource={data?.list} loading={loading} />
     </PageContent>
   );
 }

+ 17 - 3
src/services/boom.js

@@ -223,16 +223,30 @@ export async function queryProfileList(params) {
       (child) => item.flow_id === child?.list.id,
     );
     if (audit) {
-      item.table_name = item.AuthorInfo?.CName + audit.list.name;
+      item.CName = item.AuthorInfo.CName;
+      item.table_name = item.name;
       item.table_desc = audit.list.desc;
       item.status = '待审批';
     }
   });
   console.log(profileList);
-  return profileList;
+  return profileList?.data;
 }
 export async function queryApplyList(params) {
-  return request(`/api/v1/oa/audit/my/list`, { params });
+  const res = await request(`/api/v1/oa/audit/my/list`, { params });
+  if (res?.data) {
+    const list = res.data?.list?.map((item) => {
+      return {
+        ...item,
+        CName: item.AuthorInfo.CName,
+        table_desc: item.table_desc,
+        table_name: item.name,
+      };
+    });
+    return { list, pagination: res.data?.pagination };
+  } else {
+    return { list: [], pagination: {} };
+  }
 }
 
 //获取多级主管

+ 9 - 1
src/services/contract.js

@@ -63,9 +63,10 @@ export const queryContractCancelCheck = async (data) => {
 
 //OA已审核过的
 export const queryApprovedList = async (data) => {
-  return await request('/api/v1/oa/audited/my/list', {
+  const res = await request('/api/v1/oa/audited/my/list', {
     params: data,
   });
+  if (res?.data) return res.data;
 };
 
 //公司列表
@@ -98,3 +99,10 @@ export const queryDelById = async (data) => {
     params: data,
   });
 };
+
+//合同详情接口
+export const queryContractDetail = async (data) => {
+  return await request(`/api/contract/v1/detail`, {
+    params: data,
+  });
+};