Browse Source

Merge branch 'develop'

xjj 2 years ago
parent
commit
4b03805061
31 changed files with 733 additions and 792 deletions
  1. 2 1
      config/config.js
  2. 35 24
      config/router.config.js
  3. 2 2
      public/luckysheet.html
  4. 8 3
      src/components/Flow/components/judgeComponent/index.tsx
  5. 9 5
      src/components/Flow/config-toolbar.ts
  6. 34 7
      src/components/Flow/index.tsx
  7. 2 2
      src/components/Flow/node/auditNode/index.tsx
  8. 74 58
      src/components/Flow/node/circle/mapServe.tsx
  9. 4 2
      src/components/Flow/node/fields/input.tsx
  10. 6 2
      src/components/Flow/node/fields/radio.tsx
  11. 5 3
      src/components/Flow/node/fields/select.tsx
  12. 11 2
      src/components/Flow/node/judgeNode/index.tsx
  13. 66 49
      src/components/Flow/node/rect/mapServe.tsx
  14. 5 3
      src/pages/PurchaseAdmin/PurchaseList/Detail/ApprovalProcess.tsx
  15. 5 31
      src/pages/PurchaseAdmin/PurchaseList/Detail/CommitAuditModal.js
  16. 18 24
      src/pages/PurchaseAdmin/PurchaseList/Detail/CompareModal.js
  17. 6 2
      src/pages/PurchaseAdmin/PurchaseList/Detail/ExportModal.js
  18. 16 8
      src/pages/PurchaseAdmin/PurchaseList/Detail/FlowModal.js
  19. 9 7
      src/pages/PurchaseAdmin/PurchaseList/Detail/Index.js
  20. 8 2
      src/pages/PurchaseAdmin/PurchaseList/Detail/LuckySheet.js
  21. 17 25
      src/pages/PurchaseAdmin/PurchaseList/Detail/MergeModal.js
  22. 19 2
      src/pages/PurchaseAdmin/PurchaseList/Flow/Audit.js
  23. 6 3
      src/pages/PurchaseAdmin/PurchaseList/Flow/Flow.js
  24. 215 472
      src/pages/PurchaseAdmin/PurchaseList/Flow/FlowDetail.json
  25. 5 2
      src/pages/PurchaseAdmin/PurchaseList/Flow/FlowModal.js
  26. 12 5
      src/pages/PurchaseAdmin/PurchaseList/Flow/List.js
  27. 4 1
      src/pages/PurchaseAdmin/PurchaseList/Flow/models/flow.js
  28. 3 42
      src/pages/PurchaseAdmin/PurchaseList/Index.js
  29. 12 2
      src/pages/PurchaseAdmin/PurchaseList/List/NewList.js
  30. 4 1
      src/pages/PurchaseAdmin/PurchaseList/List/models/newList.js
  31. 111 0
      src/pages/PurchaseAdmin/PurchaseList/WorkloadIndex.js

+ 2 - 1
config/config.js

@@ -141,7 +141,8 @@ export default {
   proxy: {
     '/api': {
       // target: 'http://192.168.20.152:8888/',
-      target: 'http://47.96.12.136:8896/',
+      target: 'http://120.55.44.4:8896/',
+      // target: 'http://47.96.12.136:8896/',
       // target: 'http://oraysmart.com:8889/',
       // target: 'http://oraysmart.com:8888/api',
       // changeOrigin: true,

+ 35 - 24
config/router.config.js

@@ -25,52 +25,63 @@ export default [
             component: './PurchaseAdmin/PurchaseList/Detail/Index',
           },
           {
-            path: '/home/work-hours',
-            component: './PurchaseAdmin/PurchaseList/WorkingHours/index',
+            path: '/home/flow/:flowId',
+            component: './PurchaseAdmin/PurchaseList/Flow/Flow',
           },
           {
-            path: '/home/work-hours-auth',
-            component: './PurchaseAdmin/PurchaseList/WorkingHours/Auth',
+            path: '/home/audit',
+            component: './PurchaseAdmin/PurchaseList/Flow/Audit',
           },
           {
-            path: '/home/report/resource',
-            component: './PurchaseAdmin/PurchaseList/Report/Resource',
+            path: '/home/audit-list',
+            component: './PurchaseAdmin/PurchaseList/Flow/AuditList',
           },
           {
-            path: '/home/report/project',
-            component: './PurchaseAdmin/PurchaseList/Report/Project',
+            path: '/home/flow-list',
+            component: './PurchaseAdmin/PurchaseList/Flow/List',
           },
+        ],
+      },
+      {
+        path: '/workload',
+        component: './PurchaseAdmin/PurchaseList/WorkloadIndex',
+        routes: [
           {
-            path: '/home/report/department',
-            component: './PurchaseAdmin/PurchaseList/Report/Department',
+            path: '/workload',
+            component: './PurchaseAdmin/PurchaseList/WorkingHours/index',
+            // component: './PurchaseAdmin/PurchaseList/List/List',
           },
           {
-            path: '/home/report/finance',
-            component: './PurchaseAdmin/PurchaseList/Report/Finance',
+            path: '/workload/work-hours',
+            component: './PurchaseAdmin/PurchaseList/WorkingHours/index',
           },
           {
-            path: '/home/approval/list',
-            component: './PurchaseAdmin/PurchaseList/Approval/List',
+            path: '/workload/work-hours-auth',
+            component: './PurchaseAdmin/PurchaseList/WorkingHours/Auth',
           },
           {
-            path: '/home/approval/auth',
-            component: './PurchaseAdmin/PurchaseList/Approval/Auth',
+            path: '/workload/report/resource',
+            component: './PurchaseAdmin/PurchaseList/Report/Resource',
           },
           {
-            path: '/home/flow/:flowId',
-            component: './PurchaseAdmin/PurchaseList/Flow/Flow',
+            path: '/workload/report/project',
+            component: './PurchaseAdmin/PurchaseList/Report/Project',
           },
           {
-            path: '/home/audit',
-            component: './PurchaseAdmin/PurchaseList/Flow/Audit',
+            path: '/workload/report/department',
+            component: './PurchaseAdmin/PurchaseList/Report/Department',
           },
           {
-            path: '/home/audit-list',
-            component: './PurchaseAdmin/PurchaseList/Flow/AuditList',
+            path: '/workload/report/finance',
+            component: './PurchaseAdmin/PurchaseList/Report/Finance',
           },
           {
-            path: '/home/flow-list',
-            component: './PurchaseAdmin/PurchaseList/Flow/List',
+            path: '/workload/approval/list',
+            component: './PurchaseAdmin/PurchaseList/Approval/List',
+          },
+          {
+            path: '/workload/approval/auth',
+            component: './PurchaseAdmin/PurchaseList/Approval/Auth',
           },
         ],
       },

+ 2 - 2
public/luckysheet.html

@@ -8,12 +8,12 @@
   <title>Document</title>
 
   <!-- 线上发布使用路径 -->
-  <link rel="stylesheet" href="/bom/Luckysheet/plugins/css/pluginsCss.css" />
+  <!-- <link rel="stylesheet" href="/bom/Luckysheet/plugins/css/pluginsCss.css" />
   <link rel="stylesheet" href="/bom/Luckysheet/plugins/plugins.css" />
   <link rel="stylesheet" href="/bom/Luckysheet/css/luckysheet.css" />
   <link rel="stylesheet" href="/bom/Luckysheet/assets/iconfont/iconfont.css" />
   <script src="/bom/Luckysheet/plugins/js/plugin.js"></script>
-  <script src="/bom/Luckysheet/luckysheet.umd.js"></script>
+  <script src="/bom/Luckysheet/luckysheet.umd.js"></script> -->
 
   <!-- 本地开发使用路径 -->
 

+ 8 - 3
src/components/Flow/components/judgeComponent/index.tsx

@@ -33,6 +33,10 @@ export const SiginOptions = [
   { label: '<', value: 1 },
   { label: '≤', value: 3 },
 ];
+export const SiginSmallOptions = [
+  { label: '<', value: 2 },
+  { label: '≤', value: 5 },
+];
 
 const RenderJudge = (props: any) => {
   const { formItems = '', onChange, depUserTree } = props;
@@ -160,9 +164,10 @@ const RenderJudge = (props: any) => {
                   }}
                 />
                 <Select
-                  defaultValue={judge?.condition?.smallSign}
+                  value={judge?.condition?.smallSign == 2 ? 1 : 3}
                   onChange={(value: number) => {
-                    handleChange([], item, { ...judge?.condition, smallSign: Number(value) });
+                    const newValue = Number(value) == 1 ? 2 : 5;
+                    handleChange([], item, { ...judge?.condition, smallSign: newValue });
                   }}
                 >
                   {SiginOptions.map(item => (
@@ -171,7 +176,7 @@ const RenderJudge = (props: any) => {
                 </Select>
                 <span>N</span>
                 <Select
-                  defaultValue={judge?.condition?.bigSign}
+                  value={judge?.condition?.bigSign}
                   onChange={(value: number) => {
                     handleChange([], item, { ...judge?.condition, bigSign: Number(value) });
                   }}

+ 9 - 5
src/components/Flow/config-toolbar.ts

@@ -194,14 +194,14 @@ namespace NSToolbarConfig {
           TOOLBAR_ITEMS.SAVE_GRAPH_DATA,
           {
             saveGraphDataService: (meta, graphData) => {
-              let data = JSON.parse(JSON.stringify(graphData))
+              let data = JSON.parse(JSON.stringify(graphData));
               data.nodes = data.nodes.map(item => {
                 // delete item.incomingEdges;
                 // delete item.originData;
                 // delete item.outgoingEdges;
                 // delete item.ports.groups
-                let ports = {...item.ports}
-                delete ports.groups
+                let ports = { ...item.ports };
+                delete ports.groups;
                 return {
                   id: item.id,
                   renderKey: item.renderKey,
@@ -215,7 +215,11 @@ namespace NSToolbarConfig {
                   x: item.x,
                   y: item.y,
                   zIndex: item.zIndex,
-                  count: item.count,
+                  flow_id: item.flow_id || 0,
+                  node_type: item.name == 'custom-circle' ? 1 : 0,
+                  count: 0,
+                  role_list: item.role_list,
+                  // count: item.count,
                 };
               });
               // graphData.edges = []
@@ -231,7 +235,7 @@ namespace NSToolbarConfig {
                   id: item.id,
                   source: item.source,
                   target: item.target,
-                  attr: JSON.stringify(item.attrs)
+                  attr: JSON.stringify(item.attrs),
                 };
               });
               console.log(data);

+ 34 - 7
src/components/Flow/index.tsx

@@ -47,7 +47,11 @@ import './index.less';
 import { TYPE } from './node/auditNode/mapServe';
 
 export interface IProps {
-  meta: { flowId: string; type: 'edit' };
+  meta: {
+    flowId: string;
+    type: 'edit';
+    editMode?: number; // 1. 管理员编辑   2. 普通编辑
+  };
   flowDetail: any;
   onSelectNode?: Function;
   parentRef?: any;
@@ -190,13 +194,12 @@ export const Demo: React.FC<IProps> = props => {
       },
       snapline: false,
     };
-    return isEdit
-      ? defaultOption
-      : {
+    if (isEdit) {
+      // 非管理员编辑
+      if (meta.editMode == 2) {
+        return {
           ...defaultOption,
           grid: false,
-          resizing: false,
-          panning: false,
           selecting: {
             enabled: true,
             showNodeSelectionBox: true,
@@ -210,6 +213,30 @@ export const Demo: React.FC<IProps> = props => {
             dangling: false,
           },
         };
+      } else {
+        // 管理员编辑
+        return defaultOption;
+      }
+    } else {
+      return {
+        ...defaultOption,
+        grid: false,
+        resizing: false,
+        panning: false,
+        selecting: {
+          enabled: true,
+          showNodeSelectionBox: true,
+        },
+        interacting: false,
+        mousewheel: false,
+        connecting: {
+          highlight: false,
+          allowBlank: false,
+          allowPort: false,
+          dangling: false,
+        },
+      };
+    }
   };
   useEffect(() => {
     if (graphRef.current) {
@@ -238,7 +265,7 @@ export const Demo: React.FC<IProps> = props => {
         }}
         showOfficial={false}
         defaultActiveKey={['custom']}
-        position={{ width: 162, top: 40, bottom: 0, left: isEdit ? 0 : -999 }}
+        position={{ width: 162, top: 40, bottom: 0, left: isEdit && meta.editMode == 1 ? 0 : -999 }}
       />
       {isEdit && (
         <CanvasToolbar

+ 2 - 2
src/components/Flow/node/auditNode/index.tsx

@@ -26,7 +26,7 @@ const CustomRect = props => {
       let name = '';
       for (let i = 0; i < data.length; i++) {
         let item = data[i];
-        if (item.ID == id) {
+        if (item.id == id) {
           return item.title;
         } else if (item.children?.length > 0) {
           let title = getName(id, item.children);
@@ -39,7 +39,7 @@ const CustomRect = props => {
       if (initiator?.length > 0) {
         const list = initiator
           .map(item => {
-            return getName(item.value, depUserTree);
+            return getName(item.origin, depUserTree);
           })
           .filter(item => item);
         return list.join(',');

+ 74 - 58
src/components/Flow/node/circle/mapServe.tsx

@@ -1,10 +1,11 @@
 import React, { useState, useEffect } from 'react';
-import { FlowchartFormWrapper } from '@antv/xflow';
+import { FlowchartFormWrapper, MODELS, useXFlowApp } from '@antv/xflow';
 import { Position, Size, ColorPicker, InputNumberFiled, InputFiled, SelectField } from '../fields';
 import { PREFIX } from '../constants';
 import { connect } from 'dva';
 import { UnityAction } from '@/utils/utils';
 import { Button } from 'antd';
+import { IProps } from '@/components/Flow/index';
 
 export interface IConfig {
   label?: string;
@@ -28,6 +29,8 @@ const Component = (props: any) => {
   const [nodeConfig, setNodeConfig] = useState<IConfig>({
     ...config,
   });
+  const app = useXFlowApp();
+  const [meta, setMeta] = useState<IProps['meta']>(null);
   const onNodeConfigChange = (key: string, value: number | string | object) => {
     if (key) {
       setNodeConfig({
@@ -57,6 +60,12 @@ const Component = (props: any) => {
     });
   }, [config]);
 
+  useEffect(() => {
+    MODELS.GRAPH_META.useValue(app.modelService).then((meta: IProps['meta']) => {
+      setMeta(meta);
+    });
+  }, []);
+
   return (
     <div className={`${PREFIX}-panel-body`}>
       <div className={`${PREFIX}-panel-group`}>
@@ -64,6 +73,7 @@ const Component = (props: any) => {
         <InputFiled
           label="标题"
           value={nodeConfig.label}
+          disabled={meta?.editMode == 2}
           onChange={value => {
             onNodeConfigChange('label', value);
           }}
@@ -74,6 +84,7 @@ const Component = (props: any) => {
         <SelectField
           label="审批流程"
           value={nodeConfig.flow_id}
+          disabled={meta?.editMode == 2}
           onChange={value => {
             let audit = auditList.find(item => item.list.id == value);
 
@@ -92,64 +103,69 @@ const Component = (props: any) => {
           })}
         />
       </div>
-      <div className={`${PREFIX}-panel-group`}>
-        <h5>样式</h5>
-        <Position
-          x={nodeConfig.x}
-          y={nodeConfig.y}
-          onChange={(key, value) => {
-            onNodeConfigChange(key, value);
-          }}
-        />
-        <Size
-          width={nodeConfig.width}
-          height={nodeConfig.height}
-          onChange={(key, value) => {
-            onNodeConfigChange(key, value);
-          }}
-        />
-        <ColorPicker
-          label="填充"
-          value={nodeConfig.fill}
-          onChange={(value: string) => {
-            onNodeConfigChange('fill', value);
-          }}
-        />
-        <ColorPicker
-          label="边框"
-          value={nodeConfig.stroke}
-          onChange={(value: string) => {
-            onNodeConfigChange('stroke', value);
-          }}
-        />
-        <InputNumberFiled
-          label="消息数量"
-          value={nodeConfig.count}
-          onChange={value => {
-            onNodeConfigChange('count', value);
-          }}
-        />
-      </div>
 
-      <div className={`${PREFIX}-node-text-style`}>
-        <InputNumberFiled
-          label="字号"
-          value={nodeConfig.fontSize}
-          width={68}
-          onChange={value => {
-            onNodeConfigChange('fontSize', value);
-          }}
-        />
-        <ColorPicker
-          value={nodeConfig.fontFill}
-          onChange={(value: string) => {
-            onNodeConfigChange('fontFill', value);
-          }}
-        />
-      </div>
-      <Button style={{ marginTop: 20 }} type="primary" onClick={onSave}>
-        保存
-      </Button>
+      {meta?.editMode != 2 && (
+        <>
+          <div className={`${PREFIX}-panel-group`}>
+            <h5>样式</h5>
+            <Position
+              x={nodeConfig.x}
+              y={nodeConfig.y}
+              onChange={(key, value) => {
+                onNodeConfigChange(key, value);
+              }}
+            />
+            <Size
+              width={nodeConfig.width}
+              height={nodeConfig.height}
+              onChange={(key, value) => {
+                onNodeConfigChange(key, value);
+              }}
+            />
+            <ColorPicker
+              label="填充"
+              value={nodeConfig.fill}
+              onChange={(value: string) => {
+                onNodeConfigChange('fill', value);
+              }}
+            />
+            <ColorPicker
+              label="边框"
+              value={nodeConfig.stroke}
+              onChange={(value: string) => {
+                onNodeConfigChange('stroke', value);
+              }}
+            />
+            <InputNumberFiled
+              label="消息数量"
+              value={nodeConfig.count}
+              onChange={value => {
+                onNodeConfigChange('count', value);
+              }}
+            />
+          </div>
+
+          <div className={`${PREFIX}-node-text-style`}>
+            <InputNumberFiled
+              label="字号"
+              value={nodeConfig.fontSize}
+              width={68}
+              onChange={value => {
+                onNodeConfigChange('fontSize', value);
+              }}
+            />
+            <ColorPicker
+              value={nodeConfig.fontFill}
+              onChange={(value: string) => {
+                onNodeConfigChange('fontFill', value);
+              }}
+            />
+          </div>
+          <Button style={{ marginTop: 20 }} type="primary" onClick={onSave}>
+            保存
+          </Button>
+        </>
+      )}
     </div>
   );
 };

+ 4 - 2
src/components/Flow/node/fields/input.tsx

@@ -5,11 +5,12 @@ import { FormItemHeight } from '../constants';
 interface IProps {
   label?: string;
   value?: string;
+  disabled?: boolean;
   onChange?: (value: string) => void;
 }
 
-const InputFiled: React.FC<IProps> = (props) => {
-  const { label = '标签', value, onChange } = props;
+const InputFiled: React.FC<IProps> = props => {
+  const { label = '标签', value, onChange, disabled } = props;
   return (
     <div className="group">
       <label>{label}</label>
@@ -18,6 +19,7 @@ const InputFiled: React.FC<IProps> = (props) => {
         style={{
           height: FormItemHeight,
         }}
+        disabled={disabled}
         onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
           onChange?.(e.target.value);
         }}

+ 6 - 2
src/components/Flow/node/fields/radio.tsx

@@ -10,11 +10,12 @@ interface IProps {
     value: string | number;
   }[];
   width?: number | string;
+  disabled?: boolean;
   onChange?: (value: string | number) => void;
 }
 
 const SelectField: React.FC<IProps> = props => {
-  const { label = '', value, onChange, options = [], width } = props;
+  const { label = '', value, onChange, options = [], width, disabled } = props;
   return (
     <div className="group">
       <label>{label}</label>
@@ -24,12 +25,15 @@ const SelectField: React.FC<IProps> = props => {
           width,
           height: FormItemHeight,
         }}
+        disabled={disabled}
         onChange={e => {
           onChange?.(e.target.value);
         }}
       >
         {options.map(item => (
-          <Radio key={`${item.value}-${item.label}`} value={item.value}>{item.label}</Radio>
+          <Radio key={`${item.value}-${item.label}`} value={item.value}>
+            {item.label}
+          </Radio>
         ))}
       </Radio.Group>
     </div>

+ 5 - 3
src/components/Flow/node/fields/select.tsx

@@ -10,11 +10,12 @@ interface IProps {
     value: string | number;
   }[];
   width?: number | string;
+  disabled?: boolean;
   onChange?: (value: string | number) => void;
 }
 
-const SelectField: React.FC<IProps> = (props) => {
-  const { label = '箭头', value, onChange, options = [], width } = props;
+const SelectField: React.FC<IProps> = props => {
+  const { label = '箭头', value, onChange, options = [], width, disabled } = props;
   return (
     <div className="group">
       <label>{label}</label>
@@ -25,7 +26,8 @@ const SelectField: React.FC<IProps> = (props) => {
           width,
           height: FormItemHeight,
         }}
-        getPopupContainer={(trigger) => trigger.parentNode}
+        disabled={disabled}
+        getPopupContainer={trigger => trigger.parentNode}
         optionFilterProp="children"
         onChange={(v: string) => {
           onChange?.(v);

+ 11 - 2
src/components/Flow/node/judgeNode/index.tsx

@@ -1,7 +1,12 @@
 import React, { useEffect, useMemo } from 'react';
 judgeServe;
 import judgeServe, { ComponentName, FormItem } from './mapServe';
-import { JudgeType, JudgeOptions, SiginOptions } from '../../components/judgeComponent';
+import {
+  JudgeType,
+  JudgeOptions,
+  SiginOptions,
+  SiginSmallOptions,
+} from '../../components/judgeComponent';
 import { connect } from 'dva';
 export { judgeServe };
 
@@ -53,9 +58,13 @@ const JudgeRect = props => {
               if (!smallSign || !smallValue || !bigSign || !bigValue) break;
               const getSigin = (sigin: Number) =>
                 SiginOptions.find(item => item.value == sigin)?.label;
+              const getSmallSigin = (sigin: Number) =>
+                SiginSmallOptions.find(item => item.value == sigin)?.label;
 
               text.push(
-                `${smallValue} ${getSigin(smallSign)} ${label} ${getSigin(bigSign)} ${bigValue} `
+                `${smallValue} ${getSmallSigin(smallSign)} ${label} ${getSigin(
+                  bigSign
+                )} ${bigValue} `
               );
             }
             break;

+ 66 - 49
src/components/Flow/node/rect/mapServe.tsx

@@ -1,5 +1,5 @@
 import React, { useState, useEffect } from 'react';
-import { FlowchartFormWrapper } from '@antv/xflow';
+import { FlowchartFormWrapper, MODELS, useXFlowApp } from '@antv/xflow';
 import { Button, message, Select } from 'antd';
 import LuckyExcel from 'luckyexcel';
 import {
@@ -14,6 +14,7 @@ import {
 import { PREFIX } from '../constants';
 import { UnityAction } from '@/utils/utils';
 import { connect } from 'dva';
+import { IProps } from '@/components/Flow/index';
 
 interface ExcelInfo {
   file_name?: string;
@@ -55,6 +56,9 @@ const Component = (props: any) => {
     ...defaultConfig,
     ...config,
   });
+
+  const app = useXFlowApp();
+  const [meta, setMeta] = useState<IProps['meta']>(null);
   const onNodeConfigChange = (key: string, value: number | string | object) => {
     if (key) {
       setNodeConfig({
@@ -122,6 +126,12 @@ const Component = (props: any) => {
     });
   }, [config]);
 
+  useEffect(() => {
+    MODELS.GRAPH_META.useValue(app.modelService).then((meta: IProps['meta']) => {
+      setMeta(meta);
+    });
+  }, []);
+
   const updataFileName = (name: string) => {
     var idx = name?.lastIndexOf('/');
     let str = name.substring(idx + 1, name.length);
@@ -158,6 +168,7 @@ const Component = (props: any) => {
         <InputFiled
           label="标题"
           value={nodeConfig.label}
+          disabled={meta?.editMode == 2}
           onChange={value => {
             onNodeConfigChange('label', value);
           }}
@@ -171,6 +182,7 @@ const Component = (props: any) => {
           onChange={value => {
             onNodeConfigChange('muti_version', value);
           }}
+          disabled={meta?.editMode == 2}
           options={[
             { label: '是', value: 1 },
             { label: '否', value: 0 },
@@ -182,6 +194,7 @@ const Component = (props: any) => {
           onChange={value => {
             onNodeConfigChange('is_start_node', value);
           }}
+          disabled={meta?.editMode == 2}
           options={[
             { label: '是', value: 1 },
             { label: '否', value: 0 },
@@ -218,65 +231,69 @@ const Component = (props: any) => {
             onChange={(v: number[]) => {
               onNodeConfigChange('role_list', v.join(','));
             }}
+            disabled={meta?.editMode == 2}
             options={options}
           />
         </div>
       </div>
-      <div className={`${PREFIX}-panel-group`}>
-        <h5>样式</h5>
-        <Position
-          x={nodeConfig.x}
-          y={nodeConfig.y}
-          onChange={(key, value) => {
-            onNodeConfigChange(key, value);
-          }}
-        />
-        <Size
-          width={nodeConfig.width}
-          height={nodeConfig.height}
-          onChange={(key, value) => {
-            onNodeConfigChange(key, value);
-          }}
-        />
-        <ColorPicker
-          label="填充"
-          value={nodeConfig.fill}
-          onChange={(value: string) => {
-            onNodeConfigChange('fill', value);
-          }}
-        />
-        <ColorPicker
-          label="边框"
-          value={nodeConfig.stroke}
-          onChange={(value: string) => {
-            onNodeConfigChange('stroke', value);
-          }}
-        />
-        <InputNumberFiled
-          label="消息数量"
-          value={nodeConfig.count}
-          onChange={value => {
-            onNodeConfigChange('count', value);
-          }}
-        />
-        <div style={{ display: 'flex' }}>
-          <InputNumberFiled
-            label="字号"
-            value={nodeConfig.fontSize}
-            width={68}
-            onChange={value => {
-              onNodeConfigChange('fontSize', value);
+      {meta?.editMode != 2 && (
+        <div className={`${PREFIX}-panel-group`}>
+          <h5>样式</h5>
+          <Position
+            x={nodeConfig.x}
+            y={nodeConfig.y}
+            onChange={(key, value) => {
+              onNodeConfigChange(key, value);
+            }}
+          />
+          <Size
+            width={nodeConfig.width}
+            height={nodeConfig.height}
+            onChange={(key, value) => {
+              onNodeConfigChange(key, value);
             }}
-            style={{ marginRight: 10 }}
           />
           <ColorPicker
-            value={nodeConfig.fontFill}
+            label="填充"
+            value={nodeConfig.fill}
             onChange={(value: string) => {
-              onNodeConfigChange('fontFill', value);
+              onNodeConfigChange('fill', value);
             }}
           />
+          <ColorPicker
+            label="边框"
+            value={nodeConfig.stroke}
+            onChange={(value: string) => {
+              onNodeConfigChange('stroke', value);
+            }}
+          />
+          <InputNumberFiled
+            label="消息数量"
+            value={nodeConfig.count}
+            onChange={value => {
+              onNodeConfigChange('count', value);
+            }}
+          />
+          <div style={{ display: 'flex' }}>
+            <InputNumberFiled
+              label="字号"
+              value={nodeConfig.fontSize}
+              width={68}
+              onChange={value => {
+                onNodeConfigChange('fontSize', value);
+              }}
+              style={{ marginRight: 10 }}
+            />
+            <ColorPicker
+              value={nodeConfig.fontFill}
+              onChange={(value: string) => {
+                onNodeConfigChange('fontFill', value);
+              }}
+            />
+          </div>
         </div>
-      </div>
+      )}
+
       <Button type="primary" onClick={onSave}>
         保存
       </Button>

+ 5 - 3
src/pages/PurchaseAdmin/PurchaseList/Detail/ApprovalProcess.tsx

@@ -13,11 +13,10 @@ enum TYPR {
 }
 
 const ApprovalProcess = props => {
-  const { id, approvalProcess, userList, onChange } = props;
+  const { id, approvalProcess, userList, onChange, roleList = [] } = props;
   const [selectUserList, setSelectUserList] = useState([]);
   const [curNodeIdx, setCurNodeIdx] = useState(-1);
   const [loading, setLoading] = useState(false);
-  // console.log(approvalProcess);
 
   const list = approvalProcess[id];
   list?.forEach(item => {
@@ -85,7 +84,9 @@ const ApprovalProcess = props => {
               ) : null
               // <PlusOutlined />
             }
-            title={item[0]?.name}
+            title={
+              item[0]?.name || `从${roleList?.find(cur => cur.ID == item[0]?.value)?.Name}选择`
+            }
           />
         ))}
       </Steps>
@@ -97,4 +98,5 @@ const ApprovalProcess = props => {
 };
 export default connect(({ xflow, detail, user }) => ({
   userList: user.list,
+  roleList: user.roleList,
 }))(ApprovalProcess);

+ 5 - 31
src/pages/PurchaseAdmin/PurchaseList/Detail/CommitAuditModal.js

@@ -198,25 +198,6 @@ function CommitAuditModal(props) {
       next_template_id: version.template_id,
       form_list: formList,
     };
-
-    const ddd = {
-      '778': [
-        { type: 'user', value: 448, origin: 0 },
-        { type: 'role', value: 82, origin: 0 },
-        { type: 'role', value: 61, origin: 0 },
-      ],
-      '791': [
-        { type: 'user', value: 448, origin: 0 },
-        { type: 'role', value: 82, origin: 0 },
-        { type: 'role', value: 61, origin: 0 },
-      ],
-      '792': [
-        { type: 'user', value: 448, origin: 0 },
-        { type: 'role', value: 82, origin: 0 },
-        { type: 'role', value: 29, origin: 0 },
-      ],
-    };
-
     dispatch({
       type: 'detail/advanceSubmitNextNode',
       payload: params, //values,
@@ -283,13 +264,14 @@ function CommitAuditModal(props) {
             })
             .filter(item => item);
           if (getReComputeAudit(items, changedValues)) advanceSubmit();
-          console.log('==================================', { ...formComponentValues });
+          // console.log('==================================', { ...formComponentValues });
           setFormComponentValues({ ...formComponentValues });
         },
       })(AuditDetailed);
       item.FormComponents = <Components items={item.items} />;
     });
     setAuditList(addAuditList);
+    advanceSubmit();
   };
 
   const getFromData = async idList => {
@@ -527,8 +509,8 @@ function CommitAuditModal(props) {
           <TabPane tab={item.name} key={`${idx}_${item.title}`}>
             <Row>
               <Col span={17}>{item.FormComponents}</Col>
-              <Col offset={1} span={4}>
-                {!formComponentValues[item.nodeId] || !approvalProcess[item.nodeId] ? (
+              <Col offset={1} span={6}>
+                {!approvalProcess[item.nodeId] ? ( //!formComponentValues[item.nodeId] ||
                   <Empty description="请先填写表单" />
                 ) : (
                   <ApprovalProcess
@@ -536,15 +518,7 @@ function CommitAuditModal(props) {
                     approvalProcess={approvalProcess}
                     onChange={setApprovalProcess}
                   />
-                )
-                // <AuditFlow
-                //   processCode={item.formCode}
-                //   formComponentValues={formComponentValues[item.nodeId]}
-                //   direction={'vertical'}
-                //   deptId={'14237557'}
-                //   userId={currentUser.DingUserId || getCurrentUser()?.DingUserId}
-                // />
-                }
+                )}
               </Col>
             </Row>
           </TabPane>

+ 18 - 24
src/pages/PurchaseAdmin/PurchaseList/Detail/CompareModal.js

@@ -37,21 +37,30 @@ function CompareModal(props) {
     }
   };
 
-  const tabList = useMemo(() => {
+  const items = useMemo(() => {
     let list = {};
     versionList.forEach(version => {
       let nodeId = version.template_node_id;
-      if (!nodeId || nodeId === '0') return;
+      if (!nodeId || nodeId === '0' || !version.version_no) return;
       if (!list[nodeId]) {
         list[nodeId] = [];
       }
       list[nodeId].push(version);
     });
-    return Object.keys(list).map(nodeId => ({
-      name: flowDetail.nodes.find(node => node.Id == nodeId)?.label,
-      id: nodeId,
-      list: list[nodeId],
-    }));
+    let nodeIds = Object.keys(list)
+    return nodeIds.filter(nodeId => {
+      let name = flowDetail.nodes.find(node => node.Id == nodeId)?.label
+      return name
+    }).map(nodeId => ({
+      label: flowDetail.nodes.find(node => node.Id == nodeId)?.label,
+      key: nodeId + "",
+      // list: list[nodeId],
+      children: list[nodeId].map(version => (
+        <div style={{ marginBottom: 16 }} key={version.id}>
+          <Checkbox value={version.id}>{version.version_name}_{version.version_no}</Checkbox>
+        </div>
+      ))
+    }))
   }, [versionList, flowDetail]);
 
   return (
@@ -71,23 +80,8 @@ function CompareModal(props) {
             </Col>
           ))}
         </Row> */}
-        <Tabs>
-          {tabList.map(tab => (
-            <TabPane tab={tab.name} key={tab.id}>
-              {/* <Row gutter={24}>
-                {tab.list.map(version => (
-                  <Col span={24} key={version.id}>
-                  </Col>
-                ))}
-              </Row> */}
-              {tab.list.map(version => (
-                <div style={{ marginBottom: 16 }} key={version.id}>
-                  <Checkbox value={version.id}>{version.version_name}</Checkbox>
-                </div>
-              ))}
-            </TabPane>
-          ))}
-        </Tabs>
+        <Tabs defaultActiveKey={items[0]?.key} items={items} />
+
       </Checkbox.Group>
     </Modal>
   );

+ 6 - 2
src/pages/PurchaseAdmin/PurchaseList/Detail/ExportModal.js

@@ -44,11 +44,15 @@ function CompareModal(props) {
         obj.name = item.name;
         if (item.data && item.data[0]) {
           obj.list = item.data[0]?.filter(cur => cur);
+          obj.list.forEach(item => {
+            if(item.ct.t == "inlineStr") {
+              item.v = item.ct.s.map(s => s.v).join("")
+            }
+          })
         }
         obj.id = item.index;
         list.push(obj);
       });
-
       setCheckValue([]);
       setTabList(list);
       setActive(list[0]?.id);
@@ -79,7 +83,7 @@ function CompareModal(props) {
               <Row>
                 {tab.list.map(item => (
                   <Col span={8} key={item.m}>
-                    <Checkbox value={item.v}>{item.v}</Checkbox>
+                    <Checkbox value={item.cid}>{item.v}</Checkbox>
                   </Col>
                 ))}
               </Row>

+ 16 - 8
src/pages/PurchaseAdmin/PurchaseList/Detail/FlowModal.js

@@ -1,5 +1,5 @@
 import React, { useEffect, useState, useRef, useMemo, memo } from 'react';
-import { Modal, Input, Select, List, Row, Col, Table, message, Steps, Space, Button } from 'antd';
+import { Modal, Input, Select, List, Row, Col, Table, message, Steps, Space, Button, Popover } from 'antd';
 import Flow from '@/components/Flow/index';
 import { connect } from 'dva';
 import { GetTokenFromUrl, getToken } from '@/utils/utils';
@@ -121,10 +121,10 @@ function FlowModal(props) {
         list: seqList,
         name: curNode?.label || itemDataList[0].FlowInfo.name,
       };
-      itemDataList.forEach((itemData, idx) => {
-        if (idx >= obj.list.length) return;
-        obj.list[idx].auditor = itemData.AuthorInfo.CName;
-      });
+      // itemDataList.forEach((itemData, idx) => {
+      //   if (idx >= obj.list.length) return;
+      //   obj.list[idx].auditor = itemData.AuthorInfo.CName;
+      // });
       return obj;
     });
     console.log(dataList);
@@ -210,6 +210,7 @@ function FlowModal(props) {
           if (!item.flow_id && item.isParent) return;
           let style = { color: getColor(item) };
           let txt = '';
+          let dom = '';
           switch (item.audit_status) {
             case 0:
               txt = '未提交';
@@ -228,10 +229,17 @@ function FlowModal(props) {
               break;
           }
           if (item.status == 1) txt = '已失效';
+
+          // 显示拒绝原因
+          if (item.audit_comment) {
+            dom = <Popover content={item.audit_comment} title="原因">{txt}</Popover>
+          } else {
+            dom = txt
+          }
           return item.audit_status != 0 ? (
-            <Button onClick={() => handleChangeClick(item)}>{txt}</Button>
+            <Button onClick={() => handleChangeClick(item)}>{dom}</Button>
           ) : (
-            <span style={style}>{txt}</span>
+            <span style={style}>{dom}</span>
           );
         },
       },
@@ -307,7 +315,7 @@ function FlowModal(props) {
                     <Step
                       key={`${node.id}_${node.node}`}
                       title={node.node}
-                      description={`审批人:${node.auditor || '-'}`}
+                      description={`审批人:${node.AuditorUser?.CName || '-'}`}
                     />
                   ))}
                 </Steps>

+ 9 - 7
src/pages/PurchaseAdmin/PurchaseList/Detail/Index.js

@@ -950,7 +950,6 @@ function Detail(props) {
       callback,
     });
   };
-
   useEffect(() => {
     dispatch({
       type: 'detail/queryProjectRecord',
@@ -965,17 +964,20 @@ function Detail(props) {
       },
     });
     dispatch({
-      type: 'user/fetch',
+      type: 'user/getRoleList',
     });
     dispatch({
-      type: 'user/fetchDepV2',
+      type: 'user/fetch',
     });
     dispatch({
-      type: 'detail/queryListParentByUser',
-      payload: {
-        userid: currentUser.DingUserId || getCurrentUser()?.DingUserId,
-      },
+      type: 'user/fetchDepV2',
     });
+    // dispatch({
+    //   type: 'detail/queryListParentByUser',
+    //   payload: {
+    //     userid: currentUser.DingUserId || getCurrentUser()?.DingUserId,
+    //   },
+    // });
   }, []);
 
   useEffect(() => {

+ 8 - 2
src/pages/PurchaseAdmin/PurchaseList/Detail/LuckySheet.js

@@ -76,6 +76,7 @@ class LuckySheet extends React.Component {
       lang: 'zh',
       showinfobar: false,
       showstatisticBar: false,
+      // forceCalculation: true,
       hook: {
         cellMousedown: (cell, position, sheet) => {
           onClickCell && onClickCell(cell, position, sheet);
@@ -152,8 +153,12 @@ class LuckySheet extends React.Component {
         },
       ];
     }
+    
     this.luckysheet.destroy();
     this.luckysheet.create(option);
+    setTimeout(() => {
+      this.luckysheet.setCellFormat(0, 0, 'bg', "#fff");
+    }, 1000)
   }
 
   // componentDidUpdate(prevProps) {
@@ -278,7 +283,7 @@ class LuckySheet extends React.Component {
           }
         });
       });
-      // console.log(currentData);
+      console.log(currentData);
       this.renderSheet(currentData);
       // luckysheet.refresh()
     } else {
@@ -448,9 +453,10 @@ class LuckySheet extends React.Component {
       let data = sheet.data;
       let celldata = sheet.celldata;
       let colList = [];
+      debugger
       data[0]?.forEach((rowOneItem, colIdx) => {
         if (rowOneItem) {
-          if (!checkValue || checkValue.indexOf(rowOneItem.v) !== -1) {
+          if (!checkValue || checkValue.indexOf(rowOneItem.cid) !== -1) {
             colList.indexOf(colIdx) == -1 ? colList.push(colIdx) : true;
           }
         }

+ 17 - 25
src/pages/PurchaseAdmin/PurchaseList/Detail/MergeModal.js

@@ -26,21 +26,30 @@ function MergeModal(props) {
       setCheckValue();
     }
   };
-  const tabList = useMemo(() => {
+  const items = useMemo(() => {
     let list = {};
     versionList.forEach(version => {
       let nodeId = version.template_node_id;
-      if (!nodeId || nodeId === '0') return;
+      if (!nodeId || nodeId === '0' || !version.version_no) return;
       if (!list[nodeId]) {
         list[nodeId] = [];
       }
       list[nodeId].push(version);
     });
-    return Object.keys(list).map(nodeId => ({
-      name: flowDetail.nodes.find(node => node.Id == nodeId)?.label,
-      id: nodeId,
-      list: list[nodeId],
-    }));
+    let nodeIds = Object.keys(list)
+    return nodeIds.filter(nodeId => {
+      let name = flowDetail.nodes.find(node => node.Id == nodeId)?.label
+      return name
+    }).map(nodeId => ({
+      label: flowDetail.nodes.find(node => node.Id == nodeId)?.label,
+      key: nodeId + "",
+      // list: list[nodeId],
+      children: list[nodeId].map(version => (
+        <div style={{ marginBottom: 16 }} key={version.id}>
+          <Radio value={version.id}>{version.version_name}_{version.version_no}</Radio>
+        </div>
+      ))
+    }))
   }, [versionList, flowDetail]);
 
   return (
@@ -63,24 +72,7 @@ function MergeModal(props) {
             );
           })}
         </Row> */}
-        <Tabs>
-          {tabList.map(tab => (
-            <TabPane tab={tab.name} key={tab.id}>
-              {/* <Row>
-                {tab.list.map(version => (
-                  <Col span={8} key={version.id}>
-                    <Radio value={version.id}>{version.version_name}</Radio>
-                  </Col>
-                ))}
-              </Row> */}
-              {tab.list.map(version => (
-                <div style={{ marginBottom: 16 }} key={version.id}>
-                  <Radio value={version.id}>{version.version_name}</Radio>
-                </div>
-              ))}
-            </TabPane>
-          ))}
-        </Tabs>
+        <Tabs defaultActiveKey={items[0]?.key} items={items} />
       </Radio.Group>
     </Modal>
   );

+ 19 - 2
src/pages/PurchaseAdmin/PurchaseList/Flow/Audit.js

@@ -22,14 +22,29 @@ function Audit(props) {
     formData,
     flowDetail,
     simpleFlowDteail,
+    currentUser
   } = props;
   const ref = useRef();
+  const permission = currentUser.Permission
 
   const curItem = useMemo(() => {
     let item = localStorage.getItem('currentAudit');
     return JSON.stringify(currentItem) == '{}' ? JSON.parse(item) : currentItem;
   }, [currentItem, localStorage.getItem('currentAudit')]);
 
+  const editMode = useMemo(() => {
+    // 判断是否有权限
+    if(permission['func-01-point-bom-flow']) {
+      return 1
+    }
+    // 判断是否为创建者
+    if(flowDetail.Creator == currentUser.ID) {
+      return 1
+    }
+
+    return 2
+  },[permission,flowDetail])
+
   useEffect(() => {
     dispatch({
       type: 'flow/queryProcessFlows',
@@ -46,6 +61,7 @@ function Audit(props) {
       type: 'user/fetchDepV2',
     });
   }, []);
+  
   const onChange = values => {
     dispatch({
       type: 'xflow/save',
@@ -87,7 +103,7 @@ function Audit(props) {
           <AuditForm value={formData} onChange={values => onChange(values)} />
         </TabPane>
         <TabPane tab="流程控制" key="2">
-          <Flow meta={{ type: 'edit', flowId: curItem.id }} flowDetail={flowDetail} ref={ref} />
+          <Flow meta={{ type: 'edit', editMode, flowId: curItem.id }} flowDetail={flowDetail} ref={ref} />
         </TabPane>
       </Tabs>
       <Button
@@ -100,12 +116,13 @@ function Audit(props) {
     </div>
   );
 }
-export default connect(({ flow, loading, xflow }) => ({
+export default connect(({ flow, loading, user, xflow }) => ({
   roleList: flow.roleList,
   currentItem: flow.current,
   loading: loading.models.purchaseList2,
   formItems: xflow.formData,
   flowDetail: flow.flowDetail,
   formData: flow.formData,
+  currentUser: user.currentUser,
   simpleFlowDteail: flow.simpleFlowDteail,
 }))(Audit);

+ 6 - 3
src/pages/PurchaseAdmin/PurchaseList/Flow/Flow.js

@@ -5,7 +5,10 @@ import { UnityAction } from '@/utils/utils';
 import { Button } from 'antd';
 import router from 'umi/router';
 
-@connect(({ xflow }) => ({ flowDetail: xflow.flowDetail }))
+@connect(({ xflow, user }) => ({
+  flowDetail: xflow.flowDetail,
+  permission: user.currentUser.Permission,
+}))
 class FlowPage extends React.PureComponent {
   onUpdate(node) {
     const { dispatch, flowDetail } = this.props;
@@ -61,7 +64,7 @@ class FlowPage extends React.PureComponent {
     UnityAction.off('NODE_SAVE');
   }
   render() {
-    const { flowDetail } = this.props;
+    const { flowDetail, permission } = this.props;
     return (
       <div>
         {/* <Form></Form> */}
@@ -69,7 +72,7 @@ class FlowPage extends React.PureComponent {
           返回
         </Button>
         <Flow
-          meta={{ type: 'edit', flowId: 1 }}
+          meta={{ type: 'edit', editMode: permission['func-01-point-bom-flow'] ? 1 : 2, flowId: 1 }}
           flowDetail={flowDetail}
           // onUpdate={node => this.onUpdate(node)}
         />

File diff suppressed because it is too large
+ 215 - 472
src/pages/PurchaseAdmin/PurchaseList/Flow/FlowDetail.json


+ 5 - 2
src/pages/PurchaseAdmin/PurchaseList/Flow/FlowModal.js

@@ -36,9 +36,12 @@ function FlowModal(props) {
           <Input />
         </Form.Item>
         <Form.Item label="所属项目" name="project_id">
-          <Select>
+          <Select
+            showSearch
+            filterOption={(input, option) => option.children.join("").toLowerCase().includes(input.toLowerCase())}
+          >
             {projectList.map(item => (
-              <Option key={item.ID}>{item.Name}</Option>
+              <Option key={item.id}>{item.project_full_code}({item.project_name})</Option>
             ))}
           </Select>
         </Form.Item>

+ 12 - 5
src/pages/PurchaseAdmin/PurchaseList/Flow/List.js

@@ -8,7 +8,7 @@ import Link from 'umi/link';
 const { Option } = Select;
 
 function List(props) {
-  const { userList, list, dispatch, projectList } = props;
+  const { userList, list, dispatch, projectList, permission } = props;
   const [visible, setVisible] = useState(false);
   const columns = [
     {
@@ -17,7 +17,11 @@ function List(props) {
     },
     {
       title: '所属项目',
-      dataIndex: ['Project', 'Name'],
+      dataIndex: 'ProjectId',
+      render: projectId => {
+        let project = projectList.find(item => item.id == projectId)
+        if(project) return `${project.project_name}(${project.project_full_code})`
+      }
     },
     {
       title: '操作',
@@ -62,9 +66,11 @@ function List(props) {
         <Button type="primary" style={{ marginRight: 20 }} onClick={() => setVisible(true)}>
           新增工作流
         </Button>
-        <Link to="/home/audit-list">
-          <Button type="primary">审批流管理</Button>
-        </Link>
+        {permission['func-01-point-bom-flow'] && (
+          <Link to="/home/audit-list">
+            <Button type="primary">审批流管理</Button>
+          </Link>
+        )}
       </div>
 
       <Table rowKey="Id" dataSource={list} columns={columns} />
@@ -80,6 +86,7 @@ function List(props) {
 }
 export default connect(({ user, flow, loading }) => ({
   userList: user.list,
+  permission: user.currentUser.Permission,
   list: flow.flowList,
   projectList: flow.projectList,
   loading: loading.models.purchaseList2,

+ 4 - 1
src/pages/PurchaseAdmin/PurchaseList/Flow/models/flow.js

@@ -11,6 +11,9 @@ import {
   queryDepV2,
   queryProcessFlows,
 } from '@/services/boom';
+import {
+  queryApproval,
+} from '@/services/approval';
 import { queryRole } from '@/services/SysAdmin';
 import { queryProject } from '@/services/PurchaseList';
 import { message } from 'antd';
@@ -175,7 +178,7 @@ export default {
       });
     },
     *queryProject({ callback }, { call, put }) {
-      const response = yield call(queryProject);
+      const response = yield call(queryApproval,{pageSize: 99999});
       if (response) {
         yield put({
           type: 'save',

+ 3 - 42
src/pages/PurchaseAdmin/PurchaseList/Index.js

@@ -37,6 +37,8 @@ function LayoutDetail(props) {
         return permission['func-01-point-works-report-d'];
       case 3:
         return currentUser.is_accountant || permission['func-01-point-works-report-p-s'];
+      case 4:
+        return permission['func-01-point-bom-flow'];
     }
   };
   return (
@@ -51,52 +53,11 @@ function LayoutDetail(props) {
               defaultSelectedKeys={[props.location.pathname]}
               style={{ lineHeight: '64px', width: '100%' }}
             >
-              <SubMenu key="/home/work-hours" title="工时管理">
-                <Menu.Item key="/home/work-hours">
-                  <Link to="/home/work-hours">上报工时</Link>
-                </Menu.Item>
-                <Menu.Item key="/home/work-hours-auth">
-                  <Link to="/home/work-hours-auth">审批工时</Link>
-                </Menu.Item>
-              </SubMenu>
-
-              <SubMenu key="/home/approval" title="项目立项">
-                <Menu.Item key="/home/approval/list">
-                  <Link to="/home/approval/list">项目列表</Link>
-                </Menu.Item>
-                <Menu.Item key="/home/approval/auth">
-                  <Link to="/home/approval/auth">审核列表</Link>
-                </Menu.Item>
-              </SubMenu>
-
-              {checkReport(0) && (
-                <SubMenu key="/home/report" title="工时报表">
-                  {/* <Menu.Item key="/home/report/resource">
-                  <Link to="/home/report/resource">资源报表</Link>
-                </Menu.Item> */}
-                  {checkReport(1) && (
-                    <Menu.Item key="/home/report/project">
-                      <Link to="/home/report/project">项目报表</Link>
-                    </Menu.Item>
-                  )}
-                  {checkReport(2) && (
-                    <Menu.Item key="/home/report/department">
-                      <Link to="/home/report/department">部门报表</Link>
-                    </Menu.Item>
-                  )}
-                  {checkReport(3) && (
-                    <Menu.Item key="/home/report/finance">
-                      <Link to="/home/report/finance">财务报表</Link>
-                    </Menu.Item>
-                  )}
-                </SubMenu>
-              )}
-
               <Menu.Item key="/home">
                 <Link to="/home">采购清单</Link>
               </Menu.Item>
               <Menu.Item key="/home/flow-list">
-                <Link to="/home/flow-list">流程</Link>
+                <Link to="/home/flow-list">流程管理</Link>
               </Menu.Item>
             </Menu>
           </div>

+ 12 - 2
src/pages/PurchaseAdmin/PurchaseList/List/NewList.js

@@ -24,13 +24,22 @@ function List(props) {
       width: '35%',
       render: item => item.version_name || item.name,
     },
+    // {
+    //   title: '所属项目',
+    //   width: '35%',
+    //   render: item => {
+    //     if (!item.is_parent) return '';
+    //     return project.list.find(p => p.ID == item.project_id)?.Name;
+    //   },
+    // },
     {
       title: '所属项目',
       width: '35%',
       render: item => {
         if (!item.is_parent) return '';
-        return project.list.find(p => p.ID == item.project_id)?.Name;
-      },
+        let p = project.list.find(p => p.id == item.project_id)
+        if(p) return `${p.project_name}(${p.project_full_code})`
+      }
     },
     {
       title: '操作',
@@ -58,6 +67,7 @@ function List(props) {
       },
     },
   ];
+  console.log(project)
   const queryList = page => {
     console.log(page);
     dispatch({

+ 4 - 1
src/pages/PurchaseAdmin/PurchaseList/List/models/newList.js

@@ -1,5 +1,8 @@
 import { queryProjectRecord } from '@/services/boom';
 import { queryProject } from '@/services/PurchaseList';
+import {
+  queryApproval,
+} from '@/services/approval';
 import { message } from 'antd';
 import { commitSheet, queryVersionsList, queryAuditExcel, queryAuditRecord } from '@/services/boom';
 
@@ -40,7 +43,7 @@ export default {
       });
     },
     *queryProject({ callback }, { call, put }) {
-      const response = yield call(queryProject);
+      const response = yield call(queryApproval,{pageSize: 99999});
       if (response) {
         yield put({
           type: 'save',

+ 111 - 0
src/pages/PurchaseAdmin/PurchaseList/WorkloadIndex.js

@@ -0,0 +1,111 @@
+import React, { useEffect } from 'react';
+import { Layout, Menu } from 'antd';
+import { connect } from 'dva';
+import RightContent from './RightContent';
+import Link from 'umi/link';
+
+const { Header, Content, Footer } = Layout;
+const { SubMenu } = Menu;
+
+// 布局
+function LayoutDetail(props) {
+  const { currentUser, permission } = props;
+  const isAdmin = currentUser.UserName == 'admin';
+  var logoStyle = {
+    color: 'white',
+    fontWeight: 600,
+    fontSize: 20,
+    verticalAlign: 'middle',
+    marginRight: 60,
+    width: 120,
+  };
+  useEffect(() => {
+    // 查询用户信息
+    props.dispatch({
+      type: 'user/fetchCurrent',
+    });
+  }, []);
+  const checkReport = state => {
+    if (isAdmin) return true;
+    const manager = currentUser.is_leader || currentUser.is_opt_mgr || currentUser.is_wty_mgr;
+    switch (state) {
+      case 0:
+        return currentUser.is_accountant || manager || permission['func-01-point-works-report'];
+      case 1:
+        return manager || permission['func-01-point-works-report-p'];
+      case 2:
+        return permission['func-01-point-works-report-d'];
+      case 3:
+        return currentUser.is_accountant || permission['func-01-point-works-report-p-s'];
+      case 4:
+        return permission['func-01-point-bom-flow'];
+    }
+  };
+  return (
+    <Layout>
+      <Header>
+        <div style={{ display: 'flex', height: '100%', justifyContent: 'space-between' }}>
+          <div style={{ display: 'flex', width: '70%' }}>
+            <div style={logoStyle}>金科环境</div>
+            <Menu
+              theme="dark"
+              mode="horizontal"
+              defaultSelectedKeys={[props.location.pathname]}
+              style={{ lineHeight: '64px', width: '100%' }}
+            >
+              <SubMenu key="/workload/work-hours" title="工时管理">
+                <Menu.Item key="/workload/work-hours">
+                  <Link to="/workload/work-hours">上报工时</Link>
+                </Menu.Item>
+                <Menu.Item key="/workload/work-hours-auth">
+                  <Link to="/workload/work-hours-auth">审批工时</Link>
+                </Menu.Item>
+              </SubMenu>
+
+              <SubMenu key="/workload/approval" title="项目立项">
+                <Menu.Item key="/workload/approval/list">
+                  <Link to="/workload/approval/list">项目列表</Link>
+                </Menu.Item>
+                <Menu.Item key="/workload/approval/auth">
+                  <Link to="/workload/approval/auth">审核列表</Link>
+                </Menu.Item>
+              </SubMenu>
+
+              {checkReport(0) && (
+                <SubMenu key="/workload/report" title="工时报表">
+                  {/* <Menu.Item key="/home/report/resource">
+                  <Link to="/home/report/resource">资源报表</Link>
+                </Menu.Item> */}
+                  {checkReport(1) && (
+                    <Menu.Item key="/workload/report/project">
+                      <Link to="/workload/report/project">项目报表</Link>
+                    </Menu.Item>
+                  )}
+                  {checkReport(2) && (
+                    <Menu.Item key="/workload/report/department">
+                      <Link to="/workload/report/department">部门报表</Link>
+                    </Menu.Item>
+                  )}
+                  {checkReport(3) && (
+                    <Menu.Item key="/workload/report/finance">
+                      <Link to="/workload/report/finance">财务报表</Link>
+                    </Menu.Item>
+                  )}
+                </SubMenu>
+              )}
+            </Menu>
+          </div>
+          <RightContent />
+        </div>
+      </Header>
+      <Content style={{ padding: '0 50px', minHeight: 'calc(100vh - 64px)' }}>
+        <div style={{ background: '#fff', padding: 24, minHeight: 280 }}>{props.children}</div>
+      </Content>
+      {/* <Footer style={{ textAlign: 'center' }}>Ant Design ©2018 Created by Ant UED</Footer> */}
+    </Layout>
+  );
+}
+export default connect(({ user }) => ({
+  currentUser: user.currentUser,
+  permission: user.currentUser.Permission,
+}))(LayoutDetail);

Some files were not shown because too many files changed in this diff