Browse Source

Squashed commit of the following:
我的审批添加发起人筛选
commit c2d296e34621c1443ad90680a60cf664c3b1ee59
Author: Renxy <18510891294@163.com>
Date: Tue Aug 1 16:35:47 2023 +0800

个人中心我的审批添加发起人筛选

Renxy 1 year ago
parent
commit
239831334c
2 changed files with 46 additions and 7 deletions
  1. 2 5
      src/pages/Profile/approve.js
  2. 44 2
      src/pages/Profile/index.js

+ 2 - 5
src/pages/Profile/approve.js

@@ -34,10 +34,8 @@ const TYPE = {
   OA: 2,
 };
 function Approve(props) {
-  const {
-    initialState,
-  } = useModel('@@initialState');
-  const user = initialState?.user || {}
+  const { initialState } = useModel('@@initialState');
+  const user = initialState?.user || {};
   const [tabActive, setTabActive] = useState('1');
   const [detail, setDetail] = useState({});
   const [conVisible, setConVisible] = useState(false);
@@ -285,7 +283,6 @@ function Approve(props) {
     if (activeKey == '1')
       return (
         <>
-          {' '}
           <Form
             name="basic"
             // labelCol={{ span: 0 }}

+ 44 - 2
src/pages/Profile/index.js

@@ -1,7 +1,16 @@
 import React, { Fragment, useState, useEffect, useMemo, useRef } from 'react';
 import { useNavigate } from 'umi';
-import { Table, Modal, DatePicker, Divider } from 'antd';
-import { useRequest } from '@umijs/max';
+import {
+  Table,
+  Modal,
+  DatePicker,
+  Divider,
+  Input,
+  Space,
+  Button,
+  Select,
+} from 'antd';
+import { useModel, useRequest } from '@umijs/max';
 import { queryProfileList, queryApplyList, applyRepeal } from '@/services/boom';
 import dayjs from 'dayjs';
 import PageContent from '@/components/PageContent';
@@ -14,9 +23,11 @@ export const Type = {
 };
 
 function profile(props) {
+  const { userList, run } = useModel('userList');
   const [tabActive, setTabActive] = useState('1');
   const [loading, setLoading] = useState(false);
   const [columns, setColumes] = useState([]);
+  const [name, setName] = useState('');
   const [data, setData] = useState({
     list: [],
     pagination: {},
@@ -183,6 +194,7 @@ function profile(props) {
 
   const handlerTabChange = (tab) => {
     setLoading(true);
+    if (name) setName('');
     switch (tab) {
       case '1':
         setColumes(columnsApplay);
@@ -200,6 +212,7 @@ function profile(props) {
   };
 
   useEffect(() => {
+    run();
     handlerTabChange('1');
   }, []);
 
@@ -251,6 +264,35 @@ function profile(props) {
       ]}
       onTabChange={setTabActive}
     >
+      {tabActive == '2' && (
+        <Space style={{ marginBottom: '10px' }}>
+          <Select
+            value={name}
+            style={{ width: 300 }}
+            allowClear
+            showSearch
+            placeholder="发起人"
+            options={userList?.map((item) => {
+              return { value: item.ID, label: item.CName };
+            })}
+            onChange={(value) => setName(value)}
+            filterOption={(input, option) =>
+              (option?.label ?? '').toLowerCase().includes(input.toLowerCase())
+            }
+          />
+          <Button
+            type="primary"
+            onClick={() =>
+              queryApprove({
+                pageSize: 10,
+                initiator: name,
+              })
+            }
+          >
+            查询
+          </Button>
+        </Space>
+      )}
       <Table
         columns={columns}
         dataSource={data?.list}