xujunjie 1 жил өмнө
parent
commit
8a12a9fd9e

+ 14 - 0
src/components/Flow/node/circle/mapServe.tsx

@@ -22,6 +22,7 @@ export interface IConfig {
   flow_node_id?: string;
   process_code?: string;
   node_type_psr?: number | string;
+  node_psr_classify?: number | string;
 }
 const defaultConfig: IConfig = {
   node_type_psr: 0,
@@ -123,6 +124,19 @@ const Component = (props: any) => {
             { label: '清单权限', value: 7 }, //发起人和审批人可见
           ]}
         />
+        <SelectField
+          label="审批类型"
+          value={nodeConfig.node_psr_classify}
+          onChange={value => {
+            onNodeConfigChange('node_psr_classify', value);
+          }}
+          options={[
+            { label: '其他', value: 0 },
+            { label: '清单审核', value: 1 },
+            { label: '合同审核', value: 2 },
+            { label: 'PSR审核', value: 3 },
+          ]}
+        />
       </div>
 
       {meta?.editMode != 2 && (

+ 7 - 4
src/models/authList.js

@@ -10,9 +10,12 @@ export default {
       const responce = yield call(queryAuthList, payload);
       if (responce) {
         let data = responce.data;
-        let ret = [];
+        // let ret = [];
+        let map = {}
         data.forEach(e => {
-          let item = ret.find(item => item.key == `${e.template_id}_${e.project_id}`);
+          let key = e.TemplateNodeInfo.node_psr_classify
+          if(!map[key]) map[key] = []
+          let item = map[key].find(item => item.key == `${e.template_id}_${e.project_id}`);
           if (!item) {
             item = {
               key: `${e.template_id}_${e.project_id}`,
@@ -20,7 +23,7 @@ export default {
               project_name: e.ding_schema,
               nodes: [],
             };
-            ret.push(item);
+            map[key].push(item);
           }
           item.nodes.push({
             template_id: e.template_id,
@@ -37,7 +40,7 @@ export default {
         });
         yield put({
           type: 'save',
-          payload: { authList: ret, authVersionList: data },
+          payload: { authList: map, authVersionList: data },
         });
       }
     },

+ 34 - 9
src/pages/Auth/Auth.js

@@ -1,9 +1,28 @@
-import React, { useEffect } from 'react';
+import React, { useEffect, useMemo } from 'react';
 import { Table, Collapse } from 'antd';
 import { connect } from 'dva';
 import router from 'umi/router';
+import { Tabs } from 'antd';
 
 const { Panel } = Collapse;
+const tabs = [
+  {
+    label: '清单审核',
+    value: 1,
+  },
+  {
+    label: '合同审核',
+    value: 2,
+  },
+  {
+    label: 'PSR审核',
+    value: 3,
+  },
+  {
+    label: '其他',
+    value: 0,
+  },
+];
 
 function Auth(props) {
   const {
@@ -84,14 +103,20 @@ function Auth(props) {
   return (
     <Collapse defaultActiveKey={['0']}>
       <Panel header="未审批" key="0">
-        <Table
-          columns={columns}
-          dataSource={authList}
-          expandable={{ expandedRowRender: record => renderUnauth(record.nodes) }}
-          pagination={false}
-          rowKey="key"
-          loading={loading.effects['auth/queryVersionByNode'] || loading.models.authList}
-        />
+        <Tabs>
+          {tabs.map(tab => (
+            <Tabs.TabPane tab={tab.label} key={tab.value + ''}>
+              <Table
+                columns={columns}
+                dataSource={authList[tab.value]}
+                expandable={{ expandedRowRender: record => renderUnauth(record.nodes) }}
+                pagination={false}
+                rowKey="key"
+                loading={loading.effects['auth/queryVersionByNode'] || loading.models.authList}
+              />
+            </Tabs.TabPane>
+          ))}
+        </Tabs>
       </Panel>
       <Panel header="已审批" key="1">
         <Table

+ 11 - 0
src/pages/Flow/FlowDetail.json

@@ -70,6 +70,7 @@
       "y": 6,
       "flow_id": 9,
       "node_type_psr": 0,
+      "node_psr_classify": 2,
       "count": 0,
       "role_list": ""
     },
@@ -264,6 +265,7 @@
       "y": -170,
       "flow_id": 5,
       "node_type_psr": 0,
+      "node_psr_classify": 1,
       "count": 0,
       "role_list": ""
     },
@@ -288,6 +290,7 @@
       "y": 6,
       "flow_id": 8,
       "node_type_psr": 0,
+      "node_psr_classify": 2,
       "count": 0,
       "role_list": ""
     },
@@ -312,6 +315,7 @@
       "y": -435,
       "flow_id": 51,
       "node_type_psr": 0,
+      "node_psr_classify": 3,
       "count": 0,
       "role_list": ""
     },
@@ -361,6 +365,7 @@
       "zIndex": 10,
       "flow_id": 3,
       "node_type_psr": 0,
+      "node_psr_classify": 1,
       "count": 0
     },
     {
@@ -385,6 +390,7 @@
       "zIndex": 10,
       "flow_id": 4,
       "node_type_psr": 0,
+      "node_psr_classify": 1,
       "count": 0
     },
     {
@@ -408,6 +414,7 @@
       "y": -117,
       "flow_id": 4,
       "node_type_psr": 0,
+      "node_psr_classify": 1,
       "count": 0,
       "role_list": ""
     },
@@ -432,6 +439,7 @@
       "y": -240,
       "flow_id": 3,
       "node_type_psr": 0,
+      "node_psr_classify": 1,
       "count": 0,
       "role_list": ""
     },
@@ -457,6 +465,7 @@
       "zIndex": 10,
       "flow_id": 5,
       "node_type_psr": 0,
+      "node_psr_classify": 1,
       "count": 0
     },
     {
@@ -481,6 +490,7 @@
       "zIndex": 10,
       "flow_id": 7,
       "node_type_psr": 0,
+      "node_psr_classify": 1,
       "count": 0
     },
     {
@@ -529,6 +539,7 @@
       "zIndex": 10,
       "flow_id": 48,
       "node_type_psr": 0,
+      "node_psr_classify": 3,
       "count": 0
     }
   ],

+ 8 - 2
src/pages/Index.js

@@ -1,4 +1,4 @@
-import React, { useEffect } from 'react';
+import React, { useEffect, useMemo } from 'react';
 import { Badge, Layout, Menu } from 'antd';
 import { connect } from 'dva';
 import RightContent from './RightContent';
@@ -22,6 +22,12 @@ function LayoutDetail(props) {
     width: 120,
   };
 
+  const authCount = useMemo(() => {
+    let count = 0;
+    Object.values(authList).forEach(list => (count += list.length));
+    return count;
+  }, [authList]);
+
   useEffect(() => {
     if (isMobile) return;
     // 查询用户信息
@@ -93,7 +99,7 @@ function LayoutDetail(props) {
               </Menu.Item>
               <Menu.Item key="/home/auth">
                 <Link to="/home/auth">
-                  <Badge count={authList.length} className={styles.badge}>
+                  <Badge count={authCount} className={styles.badge}>
                     审核列表
                   </Badge>
                 </Link>