Преглед изворни кода

修改获取绑定审批列表接口

Renxy пре 2 година
родитељ
комит
4faf57ac0e

+ 13 - 12
config/config.js

@@ -29,20 +29,20 @@ const plugins = [
       },
       pwa: pwa
         ? {
-          workboxPluginMode: 'InjectManifest',
-          workboxOptions: {
-            importWorkboxFrom: 'local',
-          },
-        }
+            workboxPluginMode: 'InjectManifest',
+            workboxOptions: {
+              importWorkboxFrom: 'local',
+            },
+          }
         : {},
       ...(!TEST && os.platform() === 'darwin'
         ? {
-          dll: {
-            include: ['dva', 'dva/router', 'dva/saga', 'dva/fetch'],
-            exclude: ['@babel/runtime'],
-          },
-          hardSource: false,
-        }
+            dll: {
+              include: ['dva', 'dva/router', 'dva/saga', 'dva/fetch'],
+              exclude: ['@babel/runtime'],
+            },
+            hardSource: false,
+          }
         : {}),
     },
   ],
@@ -140,7 +140,8 @@ export default {
   chainWebpack: webpackPlugin,
   proxy: {
     '/api': {
-      target: 'http://47.96.12.136:8896/',
+      target: 'http://192.168.20.152:8888/',
+      // target: 'http://47.96.12.136:8896/',
       // target: 'http://oraysmart.com:8889/',
       // target: 'http://oraysmart.com:8888/api',
       // changeOrigin: true,

+ 39 - 11
src/components/Flow/node/circle/mapServe.tsx

@@ -19,10 +19,41 @@ export interface IConfig {
   stroke?: string;
   flow_id?: string;
   flow_node_id?: string;
+  process_code?: string;
 }
 
 const Component = (props: any) => {
-  const { config, plugin = {}, auditList } = props;
+  // const templateList = [
+  //   {
+  //     icon_url: 'https://gw.alicdn.com/tfs/TB13f_aCQzoK1RjSZFlXXai4VXa-102-102.png',
+  //     is_new_process: false,
+  //     process_code: 'PROC-EF6YLU2SO2-TFNDPQR6RMN2002KUULI2-B7P8DLSI-V4',
+  //     gmt_modified: '2021-01-27 21:39:23',
+  //     flow_title: '财务证照及合同借用',
+  //     icon_name: 'tag',
+  //     attendance_type: 0,
+  //   },
+  //   {
+  //     icon_url: 'https://gw.alicdn.com/tfs/TB1KMniCNYaK1RjSZFnXXa80pXa-102-102.png',
+  //     is_new_process: false,
+  //     process_code: 'PROC-MOEKBM6V-GSAR5LHCTQYYP1BCEWCL1-GK9VAQBJ-5',
+  //     gmt_modified: '2021-03-05 10:28:06',
+  //     flow_title: '外部打印申请单',
+  //     icon_name: 'general_log',
+  //     attendance_type: 0,
+  //   },
+  //   {
+  //     icon_url: 'https://gw.alicdn.com/tfs/TB1KMniCNYaK1RjSZFnXXa80pXa-102-102.png',
+  //     is_new_process: false,
+  //     process_code: 'PROC-6B508B53-83F5-484C-8052-2FCA4FB57110',
+  //     gmt_modified: '2021-03-05 10:28:06',
+  //     flow_title: '组织架构调整',
+  //     icon_name: 'general_log',
+  //     attendance_type: 0,
+  //   },
+  // ];
+  const { config, plugin = {}, templateList } = props; //, auditList
+  console.log(templateList);
   const { updateNode } = plugin;
   const [nodeConfig, setNodeConfig] = useState<IConfig>({
     ...config,
@@ -72,20 +103,17 @@ const Component = (props: any) => {
         <h5>数据</h5>
         <SelectField
           label="审批流程"
-          value={nodeConfig.flow_id}
+          value={nodeConfig.process_code}
           onChange={value => {
-            let audit = auditList.find(item => item.list.id == value);
-
             onNodeConfigChange(null, {
-              flow_node_id: audit.list.FlowNodes[0]?.id,
-              flow_id: value,
+              flow_node_id: 0,
+              process_code: value,
             });
           }}
-          options={auditList.map(item => {
-            const list = item.list;
+          options={templateList.map(item => {
             return {
-              label: list.name || list.id,
-              value: list.id,
+              label: item.flow_title,
+              value: item.process_code,
             };
           })}
         />
@@ -160,4 +188,4 @@ function RecthServe(props: any) {
   );
 }
 
-export default connect(({ xflow }) => ({ auditList: xflow.auditList }))(RecthServe);
+export default connect(({ flow }) => ({ templateList: flow.templateList }))(RecthServe);

+ 3 - 0
src/pages/PurchaseAdmin/PurchaseList/Flow/List.js

@@ -50,6 +50,9 @@ function List(props) {
     dispatch({
       type: 'flow/getRoleList',
     });
+    dispatch({
+      type: 'flow/queryDingTemplateList',
+    });
   }, []);
 
   return (

+ 12 - 0
src/pages/PurchaseAdmin/PurchaseList/Flow/models/flow.js

@@ -6,6 +6,7 @@ import {
   queryBoomFlowDetail,
   updateNode,
   queryFlowList,
+  queryDingTemplateList,
 } from '@/services/boom';
 import { queryRole } from '@/services/SysAdmin';
 import { queryProject } from '@/services/PurchaseList';
@@ -20,6 +21,7 @@ export default {
     projectList: [],
     current: {},
     roleList: [],
+    templateList: [],
   },
 
   effects: {
@@ -100,6 +102,16 @@ export default {
         callback && callback();
       }
     },
+    *queryDingTemplateList({ payload }, { call, put }) {
+      const response = yield call(queryDingTemplateList, payload);
+      if (response) {
+        console.log('-[-----------------------------------', response.data.result);
+        yield put({
+          type: 'save',
+          payload: { templateList: response.data.result },
+        });
+      }
+    },
   },
 
   reducers: {

+ 3 - 0
src/services/boom.js

@@ -284,3 +284,6 @@ export async function queryRecordSheet(data) {
     body: data,
   });
 }
+export async function queryDingTemplateList() {
+  return request(`/purchase/bom/ding/template/list`);
+}