Explorar o código

complete two weeks code

code4eat %!s(int64=4) %!d(string=hai) anos
pai
achega
9ccc9f5b3a
Modificáronse 68 ficheiros con 6372 adicións e 273 borrados
  1. 0 1
      .eslintignore
  2. 11 9
      README.md
  3. 2 9
      config/config.js
  4. 1 1
      config/proxy.js
  5. 68 15
      config/routes.js
  6. 116 0
      mock/accountingSubject.js
  7. 154 0
      mock/afterCollectionSearch.js
  8. 8 0
      mock/beforeCollectionSearch.js
  9. 143 0
      mock/costProductMana.js
  10. 103 0
      mock/costShareParams.js
  11. 125 0
      mock/incomeCollection.js
  12. 145 0
      mock/incomeCostDataImport.js
  13. 146 0
      mock/reportProjectSetting.js
  14. 5 5
      mock/responsibilityCenter.js
  15. 41 1
      mock/role.js
  16. 22 9
      mock/user.js
  17. 150 0
      mock/visitsAndBedDayCostSetting.js
  18. 143 0
      mock/wholeHospCostSetting.js
  19. 172 108
      src/app.jsx
  20. 83 17
      src/components/CAUpload/index.jsx
  21. 0 0
      src/components/DrawerContent/index.jsx
  22. 4 2
      src/components/RightContent/AvatarDropdown.jsx
  23. 4 0
      src/global.less
  24. 40 0
      src/menuIcons.js
  25. 2 1
      src/pages/UserMana/index.js
  26. 14 11
      src/pages/accountingSubject/index.jsx
  27. 1 0
      src/pages/accountingSubject/updateForm.jsx
  28. 106 0
      src/pages/baseSetting/incomeCollectionSetting/component/drawer.jsx
  29. 436 0
      src/pages/baseSetting/incomeCollectionSetting/index.js
  30. 79 0
      src/pages/baseSetting/incomeCollectionSetting/service.js
  31. 171 0
      src/pages/baseSetting/incomeCollectionSetting/updateForm.jsx
  32. 98 0
      src/pages/baseSetting/reportProjectSetting/component/drawer.jsx
  33. 521 0
      src/pages/baseSetting/reportProjectSetting/index.js
  34. 71 0
      src/pages/baseSetting/reportProjectSetting/service.js
  35. 89 0
      src/pages/baseSetting/reportProjectSetting/updateForm.jsx
  36. 132 0
      src/pages/baseSetting/visitsAndBedDayCostSetting/components/DrawerContent.jsx
  37. 589 0
      src/pages/baseSetting/visitsAndBedDayCostSetting/index.jsx
  38. 62 0
      src/pages/baseSetting/visitsAndBedDayCostSetting/service.js
  39. 127 0
      src/pages/baseSetting/visitsAndBedDayCostSetting/updateForm.jsx
  40. 250 0
      src/pages/baseSetting/wholeHospCostAndIncomeSet/index.jsx
  41. 51 0
      src/pages/baseSetting/wholeHospCostAndIncomeSet/service.js
  42. 66 0
      src/pages/baseSetting/wholeHospCostAndIncomeSet/updateForm.jsx
  43. 107 0
      src/pages/costAccounting/afterCollectionSearch/components/DrawerContent.jsx
  44. 368 0
      src/pages/costAccounting/afterCollectionSearch/index.jsx
  45. 13 0
      src/pages/costAccounting/afterCollectionSearch/index.less
  46. 33 0
      src/pages/costAccounting/afterCollectionSearch/service.js
  47. 223 0
      src/pages/costAccounting/beforeCollectionSearch/index.jsx
  48. 33 0
      src/pages/costAccounting/beforeCollectionSearch/service.js
  49. 168 0
      src/pages/costAccounting/incomeCollection/index.jsx
  50. 44 0
      src/pages/costAccounting/incomeCollection/service.js
  51. 43 19
      src/pages/costAccounting/incomeCostDataImport/components/DrawerContent.jsx
  52. 409 0
      src/pages/costAccounting/incomeCostDataImport/index.jsx
  53. 54 0
      src/pages/costAccounting/incomeCostDataImport/service.js
  54. 121 0
      src/pages/costAccounting/incomeCostDataImport/updateForm.jsx
  55. 2 1
      src/pages/costAllocationParamsSetting/index.jsx
  56. 2 1
      src/pages/costProjectMana/index.jsx
  57. 25 18
      src/pages/platformMana/menuManage/index.js
  58. 2 2
      src/pages/platformMana/menuManage/service.js
  59. 7 6
      src/pages/platformMana/menuManage/updateForm.jsx
  60. 33 5
      src/pages/platformMana/roleManage/component/drawer.jsx
  61. 58 19
      src/pages/platformMana/roleManage/index.js
  62. 23 1
      src/pages/platformMana/roleManage/service.js
  63. 3 1
      src/pages/responsibilityCenter/index.jsx
  64. 5 5
      src/pages/responsibilityCenter/service.js
  65. 31 4
      src/pages/user/Login/index.jsx
  66. 9 1
      src/services/user.js
  67. 5 1
      src/utils.js
  68. BIN=BIN
      成本核算_build0802.zip

+ 0 - 1
.eslintignore

@@ -6,4 +6,3 @@ public
 dist
 .umi
 mock
-src

+ 11 - 9
README.md

@@ -1,6 +1,14 @@
-# Ant Design Pro
-
-This project is initialized with [Ant Design Pro](https://pro.ant.design). Follow is the quick guide for how to use.
+<!--
+ * @Author: your name
+ * @Date: 2021-08-02 17:30:55
+ * @LastEditTime: 2021-08-04 11:12:06
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /CostAccountManaSys/README.md
+-->
+# 全成本核算管理系统
+
+基于 [Ant Design Pro](https://pro.ant.design). 
 
 ## Environment Prepare
 
@@ -18,9 +26,6 @@ yarn
 
 ## Provided Scripts
 
-Ant Design Pro provides some useful script to help you quick start and build with web project, code style check and test.
-
-Scripts provided in `package.json`. It's safe to modify or add additional script:
 
 ### Start project
 
@@ -52,6 +57,3 @@ npm run lint:fix
 npm test
 ```
 
-## More
-
-You can view full document on our [official website](https://pro.ant.design). And welcome any feedback in our [github](https://github.com/ant-design/ant-design-pro).

+ 2 - 9
config/config.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-07-22 15:04:09
- * @LastEditTime: 2021-08-02 11:50:09
+ * @LastEditTime: 2021-08-05 16:04:37
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/config/config.js
@@ -25,14 +25,7 @@ export default defineConfig({
     siderWidth: 208,
     ...defaultSettings,
   },
-  // https://umijs.org/zh-CN/plugins/plugin-locale
-  locale: {
-    // default zh-CN
-    default: 'zh-CN',
-    antd: false,
-    // default true, when it is true, will use `navigator.language` overwrite default
-    baseNavigator: false,
-  },
+  
   dynamicImport: {
     loading: '@ant-design/pro-layout/es/PageLoading',
   },

+ 1 - 1
config/proxy.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-07-22 15:04:09
- * @LastEditTime: 2021-08-02 17:56:27
+ * @LastEditTime: 2021-08-12 10:15:56
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/config/proxy.js

+ 68 - 15
config/routes.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-07-22 15:04:09
- * @LastEditTime: 2021-08-03 15:14:45
+ * @LastEditTime: 2021-08-12 09:59:23
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/config/routes.js
@@ -40,18 +40,76 @@ export default [
       }
     ]
   },
+  {
+    path: '/baseSetting',
+    name: '基础设置',
+    icon: 'tool',
+    routes:[
+      {
+        path: '/baseSetting/incomeCollectionSetting',
+        name: '收入归集设置',
+        icon: 'tool',
+        component: './baseSetting/incomeCollectionSetting/index',
+      },
+      {
+        path: '/baseSetting/reportProjectSetting',
+        name: '报表项目设置',
+        icon: 'tool',
+        component: './baseSetting/reportProjectSetting/index',
+      },
+      {
+        path: '/baseSetting/visitsAndBedDayCostSetting',
+        name: '诊次/床日成本设置',
+        icon: 'tool',
+        component: './baseSetting/visitsAndBedDayCostSetting/index',
+      },
+      {
+        path: '/baseSetting/wholeHospCostAndIncomeSet',
+        name: '全院其他收支设置',
+        icon: 'tool',
+        component: './baseSetting/wholeHospCostAndIncomeSet/index',
+      },
+    ]
+  },
+  {
+    path: '/costAccounting',
+    name: '成本核算',
+    icon: 'tool',
+    routes:[
+      {
+        path: '/costAccounting/incomeCostDataImport',
+        name: '收入成本数据导入',
+        component: './costAccounting/incomeCostDataImport/index',
+      },
+      {
+        path: '/costAccounting/beforeCollectionSearch',
+        name: '归集前查询',
+        component: './costAccounting/beforeCollectionSearch/index',
+      },
+      {
+        path: '/costAccounting/incomeCollection',
+        name: '收入归集',
+        component: './costAccounting/incomeCollection/index',
+      },
+      {
+        path: '/costAccounting/afterCollectionSearch',
+        name: '归集后查询',
+        component: './costAccounting/afterCollectionSearch/index',
+      }
+    ]
+  },
   {
     path: '/UserMana',
     name: '用户管理',
     icon: 'tool',
     component: './UserMana/index',
   },
-  // {
-  //   path: '/districtMana',
-  //   name: '院区管理',
-  //   icon: 'InsertRowLeftOutlined',
-  //   component: './districtMana/index',
-  // },
+  {
+    path: '/districtMana',
+    name: '院区管理',
+    icon: 'InsertRowLeftOutlined',
+    component: './districtMana/index',
+  },
   {
     path: '/apportionmentLevel',
     name: '分摊层级设置',
@@ -102,10 +160,11 @@ export default [
   },
   {
     path: '/costAllocationParamsConnect',
-    name: '成本分摊参数对应',
-    icon: 'ClusterOutlined',
+    name: '成本分摊参数设置对应',
+    icon: 'ControlOutlined',
     component: './costAllocationParamsConnect/index',
   },
+
   {
     path: '/admin',
     name: 'admin',
@@ -121,12 +180,6 @@ export default [
       },
     ],
   },
-  // {
-  //   name: 'list.table-list',
-  //   icon: 'table',
-  //   path: '/list',
-  //   component: './TableList',
-  // },
   {
     path: '/',
     redirect: '/UserMana',

+ 116 - 0
mock/accountingSubject.js

@@ -0,0 +1,116 @@
+/*
+ * @Author: your name
+ * @Date: 2021-08-04 16:38:52
+ * @LastEditTime: 2021-08-04 18:28:37
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /CostAccountManaSys/mock/accountingSubject.js
+ */
+
+
+
+
+
+// eslint-disable-next-line import/no-extraneous-dependencies
+import moment from 'moment';
+import { parse } from 'url'; // mock tableListDataSource
+
+const genList = (current, pageSize) => {
+  const tableListDataSource = [];
+
+  for (let i = 0; i < pageSize; i += 1) {
+    const index = (current - 1) * 10 + i;
+    tableListDataSource.push({
+      key: index,
+      id: index,
+      isIncomeGroutSetSelect:true,
+      isShareParamSelect:false,
+      isBaseCost:0,
+      accountingCode:index,
+      accountingName:`会计科目名${i}`,
+      child:[
+          {
+            key: index+i,
+            id: index+i,
+            isIncomeGroutSetSelect:true,
+            isShareParamSelect:false,
+            isBaseCost:0,
+            accountingCode:`会计科目编码${i}`,
+            accountingName:`会计科目名${i}`,
+          }
+      ]
+    });
+  }
+  //   console.log({tableListDataSource});
+  tableListDataSource.reverse();
+  return tableListDataSource;
+};
+
+let tableListDataSource = genList(1, 100);
+
+function getList(req, res, u) {
+  let realUrl = u;
+
+  if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
+    realUrl = req.url;
+  }
+
+  const { current = 1, pageSize = 10 } = req.query;
+  let dataSource = [...tableListDataSource].slice((current - 1) * pageSize, current * pageSize);
+
+  const result = {
+    data: {
+      list: dataSource,
+      totalCount: tableListDataSource.length,
+      pageSize: pageSize,
+    },
+    status: 200,
+    success: true,
+  };
+  return res.json(result);
+}
+
+function postList(req, res, u, b) {
+  let realUrl = u;
+
+  if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
+    realUrl = req.url;
+  }
+
+  const { method, body } = req;
+
+  tableListDataSource.push({ ...body });
+
+  const result = {
+    status: 200,
+    msg: '',
+  };
+  res.json(result);
+}
+
+function delList(req, res, u, b) {
+  const { method, body } = req;
+  tableListDataSource = tableListDataSource.filter((item) => !body.includes(item.roleId));
+  const result = {
+    status: 200,
+    msg: '',
+  };
+  res.json(result);
+}
+
+function bindList(req, res, u, b) {
+  const { method, body } = req;
+  const { roleId, userIds } = body;
+  const result = {
+    status: 200,
+    msg: '',
+  };
+  res.json(result);
+}
+
+export default {
+  'GET /api/costAccount/accounting/list': getList,
+  'POST /api/costAccount/costincomegroupset/addCostIncomeGroupSet': postList,
+  'POST /api/costAccount/role/delete': delList,
+  'POST /api/costAccount/role/editUserRole': bindList,
+};

+ 154 - 0
mock/afterCollectionSearch.js

@@ -0,0 +1,154 @@
+/*
+ * @Author: your name
+ * @Date: 2021-08-12 09:59:49
+ * @LastEditTime: 2021-08-12 10:07:58
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /CostAccountManaSys/mock/afterCollectionSearch.js
+ */
+
+
+
+
+// eslint-disable-next-line import/no-extraneous-dependencies
+import moment from 'moment';
+import { parse } from 'url'; // mock tableListDataSource
+
+const genList = (current, pageSize) => {
+  const tableListDataSource = [];
+
+  for (let i = 0; i < pageSize; i += 1) {
+    const index = (current - 1) * 10 + i;
+    tableListDataSource.push({
+      key: index,
+      id: index,
+      year:'2021',
+      month:'08',
+      departmentCode:`departmentCode ${index}`,
+      departmentName:`departmentName ${index}`,
+      responsibilityCode:`responsibilityCode ${index}`,
+      responsibilityName:`responsibilityName ${index}`,
+      accountingCode:`responsibilityCode ${index}`,
+      accountingName:`responsibilityName ${index}`,
+      projectCode:`projectCode ${index}`,
+      projectName:`projectName ${index}`,
+      isDirectIncome:0,
+      amount:2000
+    });
+  }
+  //   console.log({tableListDataSource});
+  tableListDataSource.reverse();
+  return tableListDataSource;
+};
+
+let tableListDataSource = genList(1, 100);
+
+function getList(req, res, u) {
+  let realUrl = u;
+
+  if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
+    realUrl = req.url;
+  }
+
+  const { current = 1, pageSize = 10 } = req.query;
+  let dataSource = [...tableListDataSource].slice((current - 1) * pageSize, current * pageSize);
+
+  const result = {
+    data: {
+      list: dataSource,
+      totalCount: tableListDataSource.length,
+      pageSize: pageSize,
+    },
+    status: 200,
+    success: true,
+  };
+  return res.json(result);
+}
+
+function postList(req, res, u, b) {
+  let realUrl = u;
+
+  if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
+    realUrl = req.url;
+  }
+
+  const { method, body } = req;
+
+  tableListDataSource.push({ ...body });
+
+  const result = {
+    status: 200,
+    msg: '',
+  };
+  res.json(result);
+}
+
+function delList(req, res, u, b) {
+  const { method, body } = req;
+  tableListDataSource = tableListDataSource.filter((item) => !body.includes(item.roleId));
+  const result = {
+    status: 200,
+    msg: '',
+  };
+  res.json(result);
+}
+
+
+function getHasBindList(req, res, u, b){
+   const data = {
+    id:98,
+    allocation:1,
+    incomeType:2,
+    shareParamCode:98,
+    shareParamName:'shareParamName 98',
+    incomeFieldNum:98,
+    incomeFileName:'incomeFileName 98',
+    costCorresponding:98,
+    costCorrespondingName:'costCorrespondingName 98'
+   }
+       
+   const result = {
+    status: 200,
+    msg: '',
+    data:data
+   };
+   res.json(result);
+}
+
+
+function getHasBindMenuList(req, res, u, b){
+    const data = [
+        {
+            id:98,name:'菜单98'
+        },
+        {
+            id:92,name:'菜单92'
+        }
+    ]
+ 
+    const result = {
+     status: 200,
+     msg: '',
+     data:data
+    };
+    res.json(result);
+}
+
+function bindList(req, res, u, b) {
+  const { method, body } = req;
+  const { roleId, userIds } = body;
+  const result = {
+    status: 200,
+    msg: '',
+  };
+  res.json(result);
+}
+
+export default {
+  'GET /api/costAccount/incomeCollection/collectList': getList,
+  'GET /api/costAccount/costotherpayments': getHasBindList,
+  'GET /api/costAccount/role/roleMenus': getHasBindMenuList,
+  'POST /api/costAccount/costotherpayments/save': postList,
+  'POST /api/costAccount/role/delete': delList,
+  'POST /api/costAccount/role/editUserRole': bindList,
+};

+ 8 - 0
mock/beforeCollectionSearch.js

@@ -0,0 +1,8 @@
+/*
+ * @Author: your name
+ * @Date: 2021-08-11 15:54:08
+ * @LastEditTime: 2021-08-11 15:54:09
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /CostAccountManaSys/mock/beforeCollectionSearch.js
+ */

+ 143 - 0
mock/costProductMana.js

@@ -0,0 +1,143 @@
+/*
+ * @Author: your name
+ * @Date: 2021-08-11 16:04:58
+ * @LastEditTime: 2021-08-11 16:06:03
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /CostAccountManaSys/mock/costProductMana.js
+ */
+
+
+
+// eslint-disable-next-line import/no-extraneous-dependencies
+import moment from 'moment';
+import { parse } from 'url'; // mock tableListDataSource
+
+const genList = (current, pageSize) => {
+  const tableListDataSource = [];
+
+  for (let i = 0; i < pageSize; i += 1) {
+    const index = (current - 1) * 10 + i;
+    tableListDataSource.push({
+      key: index,
+      id: index,
+      productCode:index,
+      productName:`productName ${index}`
+    });
+  }
+  //   console.log({tableListDataSource});
+  tableListDataSource.reverse();
+  return tableListDataSource;
+};
+
+let tableListDataSource = genList(1, 100);
+
+function getList(req, res, u) {
+  let realUrl = u;
+
+  if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
+    realUrl = req.url;
+  }
+
+  const { current = 1, pageSize = 10 } = req.query;
+  let dataSource = [...tableListDataSource].slice((current - 1) * pageSize, current * pageSize);
+
+  const result = {
+    data: {
+      list: dataSource,
+      totalCount: tableListDataSource.length,
+      pageSize: pageSize,
+    },
+    status: 200,
+    success: true,
+  };
+  return res.json(result);
+}
+
+function postList(req, res, u, b) {
+  let realUrl = u;
+
+  if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
+    realUrl = req.url;
+  }
+
+  const { method, body } = req;
+
+  tableListDataSource.push({ ...body });
+
+  const result = {
+    status: 200,
+    msg: '',
+  };
+  res.json(result);
+}
+
+function delList(req, res, u, b) {
+  const { method, body } = req;
+  tableListDataSource = tableListDataSource.filter((item) => !body.includes(item.roleId));
+  const result = {
+    status: 200,
+    msg: '',
+  };
+  res.json(result);
+}
+
+
+function getHasBindList(req, res, u, b){
+   const data = {
+    id:98,
+    allocation:1,
+    incomeType:2,
+    shareParamCode:98,
+    shareParamName:'shareParamName 98',
+    incomeFieldNum:98,
+    incomeFileName:'incomeFileName 98',
+    costCorresponding:98,
+    costCorrespondingName:'costCorrespondingName 98'
+   }
+       
+   const result = {
+    status: 200,
+    msg: '',
+    data:data
+   };
+   res.json(result);
+}
+
+
+function getHasBindMenuList(req, res, u, b){
+    const data = [
+        {
+            id:98,name:'菜单98'
+        },
+        {
+            id:92,name:'菜单92'
+        }
+    ]
+ 
+    const result = {
+     status: 200,
+     msg: '',
+     data:data
+    };
+    res.json(result);
+}
+
+function bindList(req, res, u, b) {
+  const { method, body } = req;
+  const { roleId, userIds } = body;
+  const result = {
+    status: 200,
+    msg: '',
+  };
+  res.json(result);
+}
+
+export default {
+  'GET /api/costAccount/product/list': getList,
+  'GET /api/costAccount/costotherpayments': getHasBindList,
+  'GET /api/costAccount/role/roleMenus': getHasBindMenuList,
+  'POST /api/costAccount/costotherpayments/save': postList,
+  'POST /api/costAccount/role/delete': delList,
+  'POST /api/costAccount/role/editUserRole': bindList,
+};

+ 103 - 0
mock/costShareParams.js

@@ -0,0 +1,103 @@
+/*
+ * @Author: your name
+ * @Date: 2021-08-04 18:43:08
+ * @LastEditTime: 2021-08-04 18:44:57
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /CostAccountManaSys/mock/costShareParams.js
+ */
+
+
+
+
+
+// eslint-disable-next-line import/no-extraneous-dependencies
+import moment from 'moment';
+import { parse } from 'url'; // mock tableListDataSource
+
+const genList = (current, pageSize) => {
+  const tableListDataSource = [];
+
+  for (let i = 0; i < pageSize; i += 1) {
+    const index = (current - 1) * 10 + i;
+    tableListDataSource.push({
+      key: index,
+      id: index,
+      calcType:1,
+      shareParamCode:index,
+      shareParamName:`分摊参数名${i}`,
+    });
+  }
+  //   console.log({tableListDataSource});
+  tableListDataSource.reverse();
+  return tableListDataSource;
+};
+
+let tableListDataSource = genList(1, 100);
+
+function getList(req, res, u) {
+  let realUrl = u;
+
+  if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
+    realUrl = req.url;
+  }
+
+  const { current = 1, pageSize = 10 } = req.query;
+  let dataSource = [...tableListDataSource].slice((current - 1) * pageSize, current * pageSize);
+
+  const result = {
+    data: {
+      list: dataSource,
+      totalCount: tableListDataSource.length,
+      pageSize: pageSize,
+    },
+    status: 200,
+    success: true,
+  };
+  return res.json(result);
+}
+
+function postList(req, res, u, b) {
+  let realUrl = u;
+
+  if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
+    realUrl = req.url;
+  }
+
+  const { method, body } = req;
+
+  tableListDataSource.push({ ...body });
+
+  const result = {
+    status: 200,
+    msg: '',
+  };
+  res.json(result);
+}
+
+function delList(req, res, u, b) {
+  const { method, body } = req;
+  tableListDataSource = tableListDataSource.filter((item) => !body.includes(item.roleId));
+  const result = {
+    status: 200,
+    msg: '',
+  };
+  res.json(result);
+}
+
+function bindList(req, res, u, b) {
+  const { method, body } = req;
+  const { roleId, userIds } = body;
+  const result = {
+    status: 200,
+    msg: '',
+  };
+  res.json(result);
+}
+
+export default {
+  'GET /api/costAccount/costshareparam/list': getList,
+//   'POST /api/costAccount/costincomegroupset/addCostIncomeGroupSet': postList,
+//   'POST /api/costAccount/role/delete': delList,
+//   'POST /api/costAccount/role/editUserRole': bindList,
+};

+ 125 - 0
mock/incomeCollection.js

@@ -0,0 +1,125 @@
+/*
+ * @Author: your name
+ * @Date: 2021-08-04 09:08:39
+ * @LastEditTime: 2021-08-11 17:58:29
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /CostAccountManaSys/mock/incomeCollection.js
+ */
+
+
+
+
+// eslint-disable-next-line import/no-extraneous-dependencies
+import moment from 'moment';
+import { parse } from 'url'; // mock tableListDataSource
+
+const genList = (current, pageSize) => {
+  const tableListDataSource = [];
+
+  for (let i = 0; i < pageSize; i += 1) {
+    const index = (current - 1) * 10 + i;
+    tableListDataSource.push({
+      key: index,
+      fileId: index,
+      year:`year ${index}`,
+      month:`month ${index}`,
+      amount:1000,
+      isCollection:true
+    });
+  }
+  //   console.log({tableListDataSource});
+  tableListDataSource.reverse();
+  return tableListDataSource;
+};
+
+let tableListDataSource = genList(1, 100);
+
+function getList(req, res, u) {
+  let realUrl = u;
+
+  if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
+    realUrl = req.url;
+  }
+
+  const { current = 1, pageSize = 10 } = req.query;
+  let dataSource = [...tableListDataSource].slice((current - 1) * pageSize, current * pageSize);
+
+  const result = {
+    data: {
+      list: dataSource,
+      totalCount: tableListDataSource.length,
+      pageSize: pageSize,
+    },
+    status: 200,
+    success: true,
+  };
+  return res.json(result);
+}
+
+function postList(req, res, u, b) {
+  let realUrl = u;
+
+  if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
+    realUrl = req.url;
+  }
+
+  const { method, body } = req;
+
+  tableListDataSource.push({ ...body });
+
+  const result = {
+    status: 200,
+    msg: '',
+  };
+  res.json(result);
+}
+
+function delList(req, res, u, b) {
+  const { method, body } = req;
+  tableListDataSource = tableListDataSource.filter((item) => !body.includes(item.roleId));
+  const result = {
+    status: 200,
+    msg: '',
+  };
+  res.json(result);
+}
+
+function getHasBindList(req, res, u, b){
+
+    const data = [
+        {
+            id:98,
+            accountingName:'会计科目98',
+            accountingCode:98
+        },
+        {
+            id:97,
+            accountingName:'会计科目97',
+            accountingCode:97
+        }
+    ];
+    const result = {
+        status: 200,
+        msg: '',
+        data:data
+    };
+    res.json(result);
+}
+
+function bindList(req, res, u, b) {
+  const { method, body } = req;
+  const { roleId, userIds } = body;
+  const result = {
+    status: 200,
+    msg: '',
+  };
+  res.json(result);
+}
+
+export default {
+  'GET /api/costAccount/incomeCollection/getCollections': getList,
+  'POST /api/costAccount/costincomegroupset/addCostIncomeGroupSet': postList,
+  'GET /api/costAccount/costincomegroupset/getIncomeAccountStatus': getHasBindList,
+  'POST /api/costAccount/role/editUserRole': bindList,
+};

+ 145 - 0
mock/incomeCostDataImport.js

@@ -0,0 +1,145 @@
+/*
+ * @Author: your name
+ * @Date: 2021-08-12 09:44:05
+ * @LastEditTime: 2021-08-12 09:49:58
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /CostAccountManaSys/mock/incomeCostDataImport.js
+ */
+
+// eslint-disable-next-line import/no-extraneous-dependencies
+import moment from 'moment';
+import { parse } from 'url'; // mock tableListDataSource
+
+const genList = (current, pageSize) => {
+  const tableListDataSource = [];
+
+  for (let i = 0; i < pageSize; i += 1) {
+    const index = (current - 1) * 10 + i;
+    tableListDataSource.push({
+      key: index,
+      id: index,
+      allocation: 1,
+      incomeType: 1,
+      errStatus: 1,
+    });
+  }
+  //   console.log({tableListDataSource});
+  tableListDataSource.reverse();
+  return tableListDataSource;
+};
+
+let tableListDataSource = genList(1, 100);
+
+function getList(req, res, u) {
+  let realUrl = u;
+
+  if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
+    realUrl = req.url;
+  }
+
+  const { current = 1, pageSize = 10 } = req.query;
+  let dataSource = [...tableListDataSource].slice((current - 1) * pageSize, current * pageSize);
+
+  const result = {
+    data: {
+      list: dataSource,
+      totalCount: tableListDataSource.length,
+      pageSize: pageSize,
+    },
+    status: 200,
+    success: true,
+  };
+  return res.json(result);
+}
+
+function postList(req, res, u, b) {
+  let realUrl = u;
+
+  if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
+    realUrl = req.url;
+  }
+
+  const { method, body } = req;
+
+  tableListDataSource.push({ ...body });
+
+  const result = {
+    status: 200,
+    msg: '',
+  };
+  res.json(result);
+}
+
+function delList(req, res, u, b) {
+  const { method, body } = req;
+  tableListDataSource = tableListDataSource.filter((item) => !body.includes(item.roleId));
+  const result = {
+    status: 200,
+    msg: '',
+  };
+  res.json(result);
+}
+
+function getHasBindList(req, res, u, b) {
+  const data = [
+    {
+      total: 123,
+      errMessage: '错误信息',
+    },
+    {
+      total: 123,
+      errMessage: '错误信息',
+    },
+    {
+      total: 123,
+      errMessage: '错误信息',
+    },
+  ];
+
+  const result = {
+    status: 200,
+    msg: '',
+    data: data,
+  };
+  res.json(result);
+}
+
+function getHasBindMenuList(req, res, u, b) {
+  const data = [
+    {
+      id: 98,
+      name: '菜单98',
+    },
+    {
+      id: 92,
+      name: '菜单92',
+    },
+  ];
+
+  const result = {
+    status: 200,
+    msg: '',
+    data: data,
+  };
+  res.json(result);
+}
+
+function bindList(req, res, u, b) {
+  const { method, body } = req;
+  const { roleId, userIds } = body;
+  const result = {
+    status: 200,
+    msg: '',
+  };
+  res.json(result);
+}
+
+export default {
+  'GET /api/costAccount/costincomefile/list': getList,
+  'GET /api/costAccount/costincomefile/getErrorList': getHasBindList,
+  'GET /api/costAccount/role/roleMenus': getHasBindMenuList,
+  'POST /api/costAccount/role/save': postList,
+  'POST /api/costAccount/role/delete': delList,
+  'POST /api/costAccount/role/editUserRole': bindList,
+};

+ 146 - 0
mock/reportProjectSetting.js

@@ -0,0 +1,146 @@
+/*
+ * @Author: your name
+ * @Date: 2021-08-04 15:09:41
+ * @LastEditTime: 2021-08-04 18:23:17
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /CostAccountManaSys/mock/reportProjectSetting.js
+ */
+
+
+// eslint-disable-next-line import/no-extraneous-dependencies
+import moment from 'moment';
+import { parse } from 'url'; // mock tableListDataSource
+
+const genList = (current, pageSize) => {
+  const tableListDataSource = [];
+
+  for (let i = 0; i < pageSize; i += 1) {
+    const index = (current - 1) * 10 + i;
+    tableListDataSource.push({
+      key: index,
+      id: index,
+      num: `编号${i}`,
+      reportName: `报表名${i}`,
+      calcType:0,
+      parentId:0,
+      reportType:1,
+      calcFormula:'[0]+[1]',
+      sort:0,
+      ratioBase:'100%',
+      showAddRelation:1,
+      children:[
+          {
+            key: index+i,
+            id: index+i,
+            num: `编号${i}`,
+            reportName: `报表名${i}`,
+            calcType:0,
+            parentId:0,
+            reportType:1,
+            calcFormula:'[0]+[1]',
+            sort:0,
+            ratioBase:'100%',
+            showAddRelation:2
+          }
+      ]
+    });
+  }
+  //   console.log({tableListDataSource});
+  tableListDataSource.reverse();
+  return tableListDataSource;
+};
+
+let tableListDataSource = genList(1, 100);
+
+function getList(req, res, u) {
+  let realUrl = u;
+
+  if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
+    realUrl = req.url;
+  }
+
+  const { current = 1, pageSize = 10 } = req.query;
+  let dataSource = [...tableListDataSource].slice((current - 1) * pageSize, current * pageSize);
+
+  const result = {
+    data: {
+      list: dataSource,
+      totalCount: tableListDataSource.length,
+      pageSize: pageSize,
+    },
+    status: 200,
+    success: true,
+  };
+  return res.json(result);
+}
+
+function postList(req, res, u, b) {
+  let realUrl = u;
+
+  if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
+    realUrl = req.url;
+  }
+
+  const { method, body } = req;
+
+  tableListDataSource.push({ ...body });
+
+  const result = {
+    status: 200,
+    msg: '',
+  };
+  res.json(result);
+}
+
+function delList(req, res, u, b) {
+  const { method, body } = req;
+  tableListDataSource = tableListDataSource.filter((item) => !body.includes(item.roleId));
+  const result = {
+    status: 200,
+    msg: '',
+  };
+  res.json(result);
+}
+
+
+
+
+function editList(req, res, u, b) {
+  const { method, body } = req;
+  const { roleId, userIds } = body;
+  const result = {
+    status: 200,
+    msg: '',
+  };
+  res.json(result);
+}
+
+
+function getRelationList(req, res, u, b){
+
+    const data = [
+        {
+            code:97,
+            name:'97name'
+        },
+        {
+            code:92,
+            name:'92name'
+        }
+    ];
+    const result = {
+      data:data,
+      status: 200,
+      msg: '',
+    };
+    res.json(result);
+}
+
+export default {
+  'GET /api/costAccount/reportForm/list': getList,
+  'POST /api/costAccount/reportForm/save': postList,
+  'POST /api/costAccount/reportForm/delete': delList,
+  'POST /api/costAccount/reportForm/edit': editList,
+  'GET /api/costAccount/reportForm/getRelationList': getRelationList,
+};

+ 5 - 5
mock/responsibilityCenter.js

@@ -4,7 +4,7 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 08:51:42
- * @LastEditTime: 2021-07-27 16:42:44
+ * @LastEditTime: 2021-08-05 14:36:00
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/mock/department.js
@@ -25,7 +25,7 @@ const genList = (current, pageSize) => {
       id: index,
       responsibilityName: `责任中心名 ${index}`,
       responsibilityLevel:1,
-      responsibilityCode: `责任中心编码 ${index}`,
+      responsibilityCode:index,
       isGatherCenter:1,
       responsibilityType:1,
       shareLevel:1,
@@ -212,7 +212,7 @@ function updateList(req, res, u, b) {
 export default {
   // GET 科室列表
 
-  'GET /api/responsibility/list':getList,
-  'POST /api/responsibility/save': updateList,
-  'DELETE /api/responsibility/delete': updateList,
+  'GET /api/costAccount/responsibility/list':getList,
+  'POST /api/costAccount/responsibility/save': updateList,
+  'DELETE /api/costAccount/responsibility/delete': updateList,
 };

+ 41 - 1
mock/role.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-08-02 18:11:13
- * @LastEditTime: 2021-08-03 11:12:18
+ * @LastEditTime: 2021-08-04 14:17:02
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /CostAccountManaSys/mock/role.js
@@ -93,6 +93,44 @@ function delList(req, res, u, b) {
   res.json(result);
 }
 
+
+function getHasBindUserList(req, res, u, b){
+   const data = [
+       {
+           id:98,name:'用户98'
+       },
+       {
+           id:92,name:'用户92'
+       }
+   ]
+
+   const result = {
+    status: 200,
+    msg: '',
+    data:data
+   };
+   res.json(result);
+}
+
+
+function getHasBindMenuList(req, res, u, b){
+    const data = [
+        {
+            id:98,name:'菜单98'
+        },
+        {
+            id:92,name:'菜单92'
+        }
+    ]
+ 
+    const result = {
+     status: 200,
+     msg: '',
+     data:data
+    };
+    res.json(result);
+}
+
 function bindList(req, res, u, b) {
   const { method, body } = req;
   const { roleId, userIds } = body;
@@ -105,6 +143,8 @@ function bindList(req, res, u, b) {
 
 export default {
   'GET /api/costAccount/role/list': getList,
+  'GET /api/costAccount/role/roleUsers': getHasBindUserList,
+  'GET /api/costAccount/role/roleMenus': getHasBindMenuList,
   'POST /api/costAccount/role/save': postList,
   'POST /api/costAccount/role/delete': delList,
   'POST /api/costAccount/role/editUserRole': bindList,

+ 22 - 9
mock/user.js

@@ -115,6 +115,7 @@ export default {
       address: 'Sidney No. 1 Lake Park',
     },
   ],
+  
   'POST /api/costAccount/login': async (req, res) => {
     const { password, account, type } = req.body;
     await waitTime(2000);
@@ -185,16 +186,28 @@ export default {
     });
   },
   //获取分院列表
+  'GET /api/costAccount/menu/nav':(req, res)=>{
+       const data = [
+        
+       ]
+
+       res.send({
+        data:data,
+        status:200,
+        msg:''
+      });
+  },
+  //获取用户对应的菜单
   'GET /api/costAccount/getHospArea':[
-      {
-         id:1,
-         name:'分院名1'
-      },
-      {
-        id:2,
-        name:'分院名2'
-      }
-  ],
+    {
+       id:1,
+       name:'分院名1'
+    },
+    {
+      id:2,
+      name:'分院名2'
+    }
+   ],
   'GET /api/500': (req, res) => {
     res.status(500).send({
       timestamp: 1513932555104,

+ 150 - 0
mock/visitsAndBedDayCostSetting.js

@@ -0,0 +1,150 @@
+/*
+ * @Author: your name
+ * @Date: 2021-08-09 14:42:03
+ * @LastEditTime: 2021-08-10 09:13:14
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /CostAccountManaSys/mock/visitsAndBedDayCostSetting.js
+ */
+
+
+
+// eslint-disable-next-line import/no-extraneous-dependencies
+import moment from 'moment';
+import { parse } from 'url'; // mock tableListDataSource
+
+const genList = (current, pageSize) => {
+  const tableListDataSource = [];
+
+  for (let i = 0; i < pageSize; i += 1) {
+    const index = (current - 1) * 10 + i;
+    tableListDataSource.push({
+      key: index,
+      id: index,
+      allocation:1,
+      incomeType:1,
+      shareParamCode: `code ${index}`,
+      shareParamName:`shareParamName ${index}`,
+      incomeFieldNum:`incomeFieldNum ${index}`,
+      incomeFileName:`incomeFileName ${index}`,
+      costCorresponding:`costCorresponding ${index}`,
+      costCorrespondingName:`costCorrespondingName ${index}`,
+      modifyTime: moment().format('YYYY-MM-DD'),
+    });
+  }
+  //   console.log({tableListDataSource});
+  tableListDataSource.reverse();
+  return tableListDataSource;
+};
+
+let tableListDataSource = genList(1, 100);
+
+function getList(req, res, u) {
+  let realUrl = u;
+
+  if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
+    realUrl = req.url;
+  }
+
+  const { current = 1, pageSize = 10 } = req.query;
+  let dataSource = [...tableListDataSource].slice((current - 1) * pageSize, current * pageSize);
+
+  const result = {
+    data: {
+      list: dataSource,
+      totalCount: tableListDataSource.length,
+      pageSize: pageSize,
+    },
+    status: 200,
+    success: true,
+  };
+  return res.json(result);
+}
+
+function postList(req, res, u, b) {
+  let realUrl = u;
+
+  if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
+    realUrl = req.url;
+  }
+
+  const { method, body } = req;
+
+  tableListDataSource.push({ ...body });
+
+  const result = {
+    status: 200,
+    msg: '',
+  };
+  res.json(result);
+}
+
+function delList(req, res, u, b) {
+  const { method, body } = req;
+  tableListDataSource = tableListDataSource.filter((item) => !body.includes(item.roleId));
+  const result = {
+    status: 200,
+    msg: '',
+  };
+  res.json(result);
+}
+
+
+function getHasBindList(req, res, u, b){
+   const data = {
+    id:98,
+    allocation:1,
+    incomeType:2,
+    shareParamCode:98,
+    shareParamName:'shareParamName 98',
+    incomeFieldNum:98,
+    incomeFileName:'incomeFileName 98',
+    costCorresponding:98,
+    costCorrespondingName:'costCorrespondingName 98'
+   }
+       
+   const result = {
+    status: 200,
+    msg: '',
+    data:data
+   };
+   res.json(result);
+}
+
+
+function getHasBindMenuList(req, res, u, b){
+    const data = [
+        {
+            id:98,name:'菜单98'
+        },
+        {
+            id:92,name:'菜单92'
+        }
+    ]
+ 
+    const result = {
+     status: 200,
+     msg: '',
+     data:data
+    };
+    res.json(result);
+}
+
+function bindList(req, res, u, b) {
+  const { method, body } = req;
+  const { roleId, userIds } = body;
+  const result = {
+    status: 200,
+    msg: '',
+  };
+  res.json(result);
+}
+
+export default {
+  'GET /api/costAccount/costnumberbedset/list': getList,
+  'GET /api/costAccount/costnumberbedset/info': getHasBindList,
+  'GET /api/costAccount/role/roleMenus': getHasBindMenuList,
+  'POST /api/costAccount/role/save': postList,
+  'POST /api/costAccount/role/delete': delList,
+  'POST /api/costAccount/role/editUserRole': bindList,
+};

+ 143 - 0
mock/wholeHospCostSetting.js

@@ -0,0 +1,143 @@
+/*
+ * @Author: your name
+ * @Date: 2021-08-10 09:24:14
+ * @LastEditTime: 2021-08-10 09:36:12
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /CostAccountManaSys/mock/wholeHospCostSetting.js
+ */
+
+
+
+// eslint-disable-next-line import/no-extraneous-dependencies
+import moment from 'moment';
+import { parse } from 'url'; // mock tableListDataSource
+
+const genList = (current, pageSize) => {
+  const tableListDataSource = [];
+
+  for (let i = 0; i < pageSize; i += 1) {
+    const index = (current - 1) * 10 + i;
+    tableListDataSource.push({
+      key: index,
+      id: index,
+      paymentsType:1,
+      paymentsName:`paymentsName ${index}`
+    });
+  }
+  //   console.log({tableListDataSource});
+  tableListDataSource.reverse();
+  return tableListDataSource;
+};
+
+let tableListDataSource = genList(1, 100);
+
+function getList(req, res, u) {
+  let realUrl = u;
+
+  if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
+    realUrl = req.url;
+  }
+
+  const { current = 1, pageSize = 10 } = req.query;
+  let dataSource = [...tableListDataSource].slice((current - 1) * pageSize, current * pageSize);
+
+  const result = {
+    data: {
+      list: dataSource,
+      totalCount: tableListDataSource.length,
+      pageSize: pageSize,
+    },
+    status: 200,
+    success: true,
+  };
+  return res.json(result);
+}
+
+function postList(req, res, u, b) {
+  let realUrl = u;
+
+  if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
+    realUrl = req.url;
+  }
+
+  const { method, body } = req;
+
+  tableListDataSource.push({ ...body });
+
+  const result = {
+    status: 200,
+    msg: '',
+  };
+  res.json(result);
+}
+
+function delList(req, res, u, b) {
+  const { method, body } = req;
+  tableListDataSource = tableListDataSource.filter((item) => !body.includes(item.roleId));
+  const result = {
+    status: 200,
+    msg: '',
+  };
+  res.json(result);
+}
+
+
+function getHasBindList(req, res, u, b){
+   const data = {
+    id:98,
+    allocation:1,
+    incomeType:2,
+    shareParamCode:98,
+    shareParamName:'shareParamName 98',
+    incomeFieldNum:98,
+    incomeFileName:'incomeFileName 98',
+    costCorresponding:98,
+    costCorrespondingName:'costCorrespondingName 98'
+   }
+       
+   const result = {
+    status: 200,
+    msg: '',
+    data:data
+   };
+   res.json(result);
+}
+
+
+function getHasBindMenuList(req, res, u, b){
+    const data = [
+        {
+            id:98,name:'菜单98'
+        },
+        {
+            id:92,name:'菜单92'
+        }
+    ]
+ 
+    const result = {
+     status: 200,
+     msg: '',
+     data:data
+    };
+    res.json(result);
+}
+
+function bindList(req, res, u, b) {
+  const { method, body } = req;
+  const { roleId, userIds } = body;
+  const result = {
+    status: 200,
+    msg: '',
+  };
+  res.json(result);
+}
+
+export default {
+  'GET /api/costAccount/costotherpayments/list': getList,
+  'GET /api/costAccount/costotherpayments': getHasBindList,
+  'GET /api/costAccount/role/roleMenus': getHasBindMenuList,
+  'POST /api/costAccount/costotherpayments/save': postList,
+  'POST /api/costAccount/role/delete': delList,
+  'POST /api/costAccount/role/editUserRole': bindList,
+};

+ 172 - 108
src/app.jsx

@@ -1,14 +1,16 @@
 import { PageLoading } from '@ant-design/pro-layout';
-import { notification,Modal,message } from 'antd';
-import { history, Link ,useModel} from 'umi';
+import { notification, Modal, message } from 'antd';
+import { history, Link, useModel } from 'umi';
 import RightContent from '@/components/RightContent';
 import Footer from '@/components/Footer';
-import { currentUser as queryCurrentUser,outLogin } from './services/ant-design-pro/api';
 import { BookOutlined, LinkOutlined } from '@ant-design/icons';
-import {getQueryString} from './utils';
+import { getQueryString } from './utils';
 import { stringify } from 'querystring';
-import {getSubHosp} from './services/user';
+import { getSubHosp, getMenus } from './services/user';
+import iconEnum from './menuIcons';
+import { createRef } from 'react';
 
+const layoutActionRef = createRef();
 
 const defaultMenus = [
   {
@@ -39,8 +41,21 @@ const defaultMenus = [
 ];
 
 
+const { query = {}, pathname } = history.location;
+const { redirect, hospSign } = query;
 const isDev = process.env.NODE_ENV === 'development';
-const loginPath = '/user/login';
+const loginParams = localStorage.getItem('loginParams');
+
+
+
+//医院标识
+let sign = '', isExpired = false;
+
+if (loginParams) {
+  const { hospSign, hospId } = JSON.parse(loginParams);
+  sign = hospSign;
+}
+const loginPath = `/user/login?hospSign=${hospSign}`;
 
 let requestMethod = 'get';
 
@@ -56,21 +71,32 @@ export const initialStateConfig = {
 export async function getInitialState() {
   const fetchUserInfo = async () => {
     const userData = localStorage.getItem('userData');
-    if(userData){
+    if (userData) {
       return JSON.parse(userData);
     }
     return undefined;
   }; // 如果是登录页面,不执行
 
+  const getMenuDataFromServer = async () => {
+    const resp = await getMenus();
+    const { status, data } = resp;
+    if (status == 200) {
+      return data;
+    } else {
+      return [];
+    }
+  };
+
   //医院标识
   const sign = getQueryString('hospSign');
 
-  const fetchSubHosp = async ()=>{
+  const fetchSubHosp = async () => {
     // try {
     //   const msg = await getSubHosp(sign);
     // } catch (error) {
-      
+
     // }
+    return null
   }
 
   if (history.location.pathname !== loginPath) {
@@ -79,9 +105,10 @@ export async function getInitialState() {
       fetchUserInfo,
       currentUser,
       settings: {},
-      isExpired:false,
+      isExpired: false,
       fetchSubHosp,
-      sign
+      sign,
+      getMenuDataFromServer
     };
   }
 
@@ -89,7 +116,8 @@ export async function getInitialState() {
     fetchUserInfo,
     settings: {},
     fetchSubHosp,
-    sign
+    sign,
+    getMenuDataFromServer
   };
 }
 
@@ -97,25 +125,17 @@ export async function getInitialState() {
 /**
  * 退出登录,并且将当前的 url 保存
  */
- const loginOut = async () => {
+const loginOut = async () => {
   // await outLogin();
-  const { query = {}, pathname } = history.location;
-  const { redirect,hospSign } = query; // Note: There may be security issues, please note
-  const loginParams = localStorage.getItem('loginParams');
-
-  let sign;
-  if(loginParams){
-      const {hospSign,hospId} = JSON.parse(loginParams);
-      sign = hospSign;
-  }
-  // &hospSign=${sign}
-  // console.log({redirect,hospSign})
+  // Note: There may be security issues, please not
+  localStorage.removeItem('userData');
+  localStorage.removeItem('menus');
   if (window.location.pathname !== `/user/login` && !redirect) {
     history.replace({
       pathname: `/user/login`,
       search: stringify({
         redirect: pathname,
-        hospSign:sign
+        hospSign: sign
       }),
     });
   }
@@ -163,16 +183,16 @@ export async function getInitialState() {
 //请求拦截器
 const authHeaderInterceptor = (url, options) => {
 
-  const {method} = options;
-  if(method == 'post'){
-    requestMethod='post'
-  }else{
-    requestMethod='get'
+  const { method } = options;
+  if (method == 'post') {
+    requestMethod = 'post'
+  } else {
+    requestMethod = 'get'
   }
   const userData = localStorage.getItem('userData');
   let authHeader = {};
-  if(userData){
-    const {token} = JSON.parse(userData);
+  if (userData) {
+    const { token } = JSON.parse(userData);
     authHeader.token = token;
   }
 
@@ -189,67 +209,72 @@ const authHeaderInterceptor = (url, options) => {
 const demoResponseInterceptors = async (response, options) => {
   // response.headers.append('interceptors', 'yes yo');
   // console.log({response});
+  try {
+
+    const { status } = response;
+
+    if (status != 200) {
+      const { errorCode, } = response;
+      if (errorCode == 500) {
+        notification.error({
+          message: '抱歉,服务器出现错误!'
+        });
+      }
+      if (errorCode == 404) {
+        notification.error({
+          message: '抱歉,服务器未找到请求!'
+        });
+      } else {
+        notification.error({
+          message: errorMessage
+        });
+      }
 
-  const {status} = response;
-
-  if(status != 200){
-        if(status == 500){
-          notification.error({
-            message: '抱歉,服务器出现错误!'
-          });
-        }
-        if(status == 404){
-          notification.error({
-            message: '抱歉,服务器未找到请求!'
-          });
-        }
-
-        return {};
-  }
 
-  const _response = await response.clone().json();
-  const {status:dataStatus,msg,errorMessage,errorCode} = _response;
-  
-  //success返回
-  if(dataStatus == 200){
-    if(requestMethod=='post'&&history.location.pathname != loginPath){
-      message.success('操作成功!');
+      return;
     }
-    return response;
-  }else{
-
-    if(errorCode==499){
-      // setInitialState((s) => ({ ...s, isExpired:true}));
-      Modal.confirm({
-        title:'抱歉,登录已过期请重新登录!',
-        onOk:()=>{
-          loginOut();
-        }
-      });
-    }else{
-      notification.error({
-        message:errorMessage,
-        duration: 5,
-      });
+
+    const _response = await response.clone().json();
+    const { status: dataStatus, msg, errorMessage, errorCode } = _response;
+    const { url } = options;
+
+    //success返回
+    if (dataStatus == 200) {
+      if (requestMethod == 'post' && url != '/api/costAccount/login') {
+        message.success('操作成功!');
+      }
+      return response;
+    } else {
+      console.log({ isExpired });
+      if (errorCode == 499 && !isExpired) {
+        isExpired = true;
+        Modal.confirm({
+          title: '抱歉,登录已过期请重新登录!',
+          onOk: () => {
+            loginOut();
+          }
+        });
+      } else {
+        notification.error({
+          message: errorMessage,
+          duration: 5,
+        });
+      }
+      return {
+        success: false
+      }
     }
-    return {}
+
+  } catch (err) {
+    console.log('catch error:', err)
   }
+
 }
 
 
 export const request = {
   errorHandler: (error) => {
-    console.log({error});
-    const { response } = error;
-    if (!response) {
-      notification.error({
-        description: '您的网络发生异常,无法连接服务器',
-        message: '网络异常',
-      });
-    }
-
-    
-
+    console.log({ error });
     throw error;
   },
   // 新增自动添加AccessToken的请求前拦截器
@@ -257,45 +282,84 @@ export const request = {
   responseInterceptors: [demoResponseInterceptors],
 }; // ProLayout 支持的api https://procomponents.ant.design/components/layout
 
-export const layout = ({ initialState }) => {
+
+
+//将服务端获取的菜单 icon 字符串映射为对应的 icon Dom
+const mappingIcon = menuData => {
+  const mappingMenu = menuData.map(item => ({
+    ...item,
+    icon: iconEnum[item.icon],
+    children: item.children ? mappingIcon(item.children) : [],
+  }));
+  return mappingMenu;
+};
+
+
+
+export const layout = async ({ initialState }) => {
+
+  // const localMenus = localStorage.getItem('menus');
+  // console.log({pathname,localMenus});
+
+  // let menus = [];
+  // if(pathname != '/user/login'){
+  //   const {getMenuDataFromServer} = initialState;
+  //   const menu = await getMenuDataFromServer();
+  //   menus = mappingIcon(menu);
+  //   localStorage.setItem('menus',menus);
+  // }
+
+
   return {
     rightContentRender: () => <RightContent />,
     disableContentMargin: false,
     waterMarkProps: {
-      content:'',
+      content: '',
     },
+    actionRef: layoutActionRef,
     footerRender: () => <Footer />,
     onPageChange: () => {
       const { location } = history; // 如果没有登录,重定向到 login
-
-      if (!initialState?.currentUser && location.pathname !== loginPath) {
+      // console.log('location.pathname',location.pathname);
+      // console.log('layoutActionRef.current',layoutActionRef.current);
+      if (layoutActionRef.current) {
+        layoutActionRef.current.reload();
+      }
+      if (!initialState?.currentUser && location.pathname !== '/user/login') {
         history.push(loginPath);
       }
     },
-    // menu: {
-    //   // 每当 initialState?.currentUser?.userid 发生修改时重新执行 request
-    //   // params: {
-    //   //   userId: initialState?.currentUser?.userid,
-    //   // },
-    //   request: async (params, defaultMenuData) => {
-    //     // initialState.currentUser 中包含了所有用户信息
-    //     // const menuData = await fetchMenuData();
-    //     // return menuData;
-    //     return defaultMenus;
-    //   },
-    // },
+    menu: {
+      // request: async (params, defaultMenuData) => {
+      //   // initialState.currentUser 中包含了所有用户信息
+      //   const menuData = await getMenus();
+      //   return menuData;
+      // },
+      // params: {
+      //   userId: initialState?.currentUser?.userid,
+      // },
+      // request: async (params, defaultMenuData) => {
+      //   // initialState.currentUser 中包含了所有用户信息
+      //   const menuData = await getMenus();
+      //   // console.log({menuData});
+      //   return menuData.data;
+      // },
+    },
     links: isDev
       ? [
-          <Link to="/umi/plugin/openapi" target="_blank">
-            <LinkOutlined />
-            <span>OpenAPI 文档</span>
-          </Link>,
-          <Link to="/~docs">
-            <BookOutlined />
-            <span>业务组件文档</span>
-          </Link>,
-        ]
+        <Link to="/umi/plugin/openapi" target="_blank">
+          <LinkOutlined />
+          <span>OpenAPI 文档</span>
+        </Link>,
+        <Link to="/~docs">
+          <BookOutlined />
+          <span>业务组件文档</span>
+        </Link>,
+      ]
       : [],
+    // menuDataRender:(menuData)=> {
+    //   return menus;
+    // },
     menuHeaderRender: undefined,
     // 自定义 403 页面
     // unAccessible: <div>unAccessible</div>,

+ 83 - 17
src/components/CAUpload/index.jsx

@@ -1,14 +1,17 @@
 
 
-
-import { SearchOutlined,ImportOutlined} from '@ant-design/icons';
+import { request } from 'umi';
+import {ImportOutlined} from '@ant-design/icons';
 import React, { Component } from 'react';
 import PropTypes from 'prop-types';
-import {Button,Upload,message,} from 'antd';
+import {Button,Upload,message,Modal,Divider} from 'antd';
 import Cookies from 'js-cookie';
 // 服务器地址,此处为了做演示,没有全局引入,直接写了
 const Host = 'http://112.124.59.133:8082';
 
+
+
+
 class CAUpload extends Component {
     constructor(props) {
         super(props);
@@ -19,11 +22,17 @@ class CAUpload extends Component {
         // 表格上传事件
         this.uploadProps.onChange = this.uploadProps.onChange.bind(this);
 
-        this.customRequestCallback = props.customRequestCallback?props.customRequestCallback.bind(this):()=>{}
+        this.customRequestCallback = props.customRequestCallback?props.customRequestCallback.bind(this):()=>{};
+
+        this.timer=null;
+
+        this.file = null;
     }
     // 模板下载
     jumpTo() {
-        window.open(Host+this.props.templateHref);
+        const userData = localStorage.getItem('userData');
+        const {token} = JSON.parse(userData);
+        window.open(`${Host}${this.props.templateHref}?token=${token}`);
     }
     // 上传参数
     uploadProps = {
@@ -58,12 +67,13 @@ class CAUpload extends Component {
                console.log({file,data,action,onSuccess});
                const formData = new FormData();
                formData.set('file',file);
-               this.customRequestCallback(formData);
+               this.file = file;
+               if(this.props.type != 'dialog')this.customRequestCallback(formData);
 
         },
         // 上传文件改变时的状态
         onChange(info) {
-            console.log({info});
+            // console.log({info});
             if (info.file.status !== 'uploading') {
                 console.log(info.file, info.fileList);
             }
@@ -90,20 +100,72 @@ class CAUpload extends Component {
     }
 
     // 导出Excel表格
-    exportExcel() {
-        const url = Host + this.props.url + `/export?token=${Cookies.get('token')}&uid=${Cookies.get('uid')}`;
+    async exportExcel() {
+        const userData = localStorage.getItem('userData');
+        const {token} = JSON.parse(userData);
+        const url = Host + this.props.url + `/export?token=${token}`;
         window.open(url);
+        //获取  全院其他收支设置列表
+    }
+
+    openModal(){
+        const uploadProps = this.uploadProps;
+        Modal.confirm({
+            title:<React.Fragment>
+                      导入数据
+                    <Divider plain></Divider>
+                </React.Fragment>,
+            icon:null,
+            width:600,
+            okText:'确定',
+            cancelText:'取消',
+            onOk:()=>{
+                return new Promise((resolve,reject)=>{
+                      this.timer = setTimeout(()=>{
+                        resolve(true);
+                        this.customRequestCallback(this.file)
+                      },1500)
+                }).then(res=>{
+                    // console.log({res})
+                })
+                .catch(err =>console.log({err}))
+                
+            },
+            content:<React.Fragment >
+                 {this.props.content}
+                 <Divider plain></Divider>
+                 <Upload  style={{marginLeft: 10}} key='importExcel' {...uploadProps} >
+                     <Button icon={<ImportOutlined />} type="primary">选择上传文件</Button>
+                 </Upload>
+            </React.Fragment>
+        });
+    }
+
+    componentWillUnmount(){
+          clearTimeout( this.timer);
     }
 
     render() {
         const uploadProps = this.uploadProps;
-        return [
-            // <Button style={{marginLeft: 10}} key='exportExcel' onClick={this.exportExcel}>导出</Button>,
-            <Upload style={{marginLeft: 10}} key='importExcel' {...uploadProps} >
-                <Button type="primary">导入</Button>
-            </Upload>,
-            <Button style={{marginLeft: 10}} key='templateDowload' onClick={this.jumpTo}>模板下载</Button>
-        ]
+        const {type} = this.props;
+        if(type == 'normal'){
+            return [
+                // <Button style={{marginLeft: 10}} key='exportExcel' onClick={this.exportExcel}>导出</Button>,
+                <Upload style={{marginLeft: 10}} key='importExcel' {...uploadProps} >
+                    <Button type="primary">导入</Button>
+                </Upload>,
+                <Button  style={{marginLeft: 10}} key='templateDowload' onClick={this.jumpTo}>模板下载</Button>
+            ]
+        }
+        if(type == 'dialog'){
+              return [
+                <Button type="primary" key='a' onClick={()=>this.openModal()}>导入</Button>,
+                <Button style={{marginLeft: 10}} key='templateDowloadTwo' onClick={this.jumpTo}>模板下载</Button>
+            ]
+        }
+
+        return <></>
+        
     }
 }
 
@@ -115,8 +177,12 @@ CAUpload.propTypes = {
     url: PropTypes.string.isRequired,
     // 导入成功后的回调
     importSuccessCallback: PropTypes.func,
-
+    //最终必需resolve一个值
     customRequestCallback: PropTypes.func,
+    //上传功能类型 【‘normal’,'dialog'】
+    type:PropTypes.string,
+    //渲染节点
+    content:PropTypes.node,
 };
 
 

+ 0 - 0
src/components/DrawerContent/index.jsx


+ 4 - 2
src/components/RightContent/AvatarDropdown.jsx

@@ -21,8 +21,10 @@ const loginOut = async () => {
       const {hospSign,hospId} = JSON.parse(loginParams);
       sign = hospSign;
   }
-  // &hospSign=${sign}
-  // console.log({redirect,hospSign})
+
+  localStorage.removeItem('userData');
+  localStorage.removeItem('menus');
+  
   if (window.location.pathname !== `/user/login` && !redirect) {
     history.replace({
       pathname: `/user/login`,

+ 4 - 0
src/global.less

@@ -11,6 +11,10 @@ body,
 
 @primary-color: #00528E !important;
 
+.ant-table-cell-fix-right, .ant-table-cell-fix-right {
+    right: 0;
+}
+
 .ant-tree-checkbox-checked .ant-tree-checkbox-inner {
   background-color: #00528E;
   border-color: #00528E;

+ 40 - 0
src/menuIcons.js

@@ -0,0 +1,40 @@
+/*
+ * @Author: your name
+ * @Date: 2021-08-05 15:54:27
+ * @LastEditTime: 2021-08-05 16:46:29
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /CostAccountManaSys/src/menuIcons.js
+ */
+
+
+import React from 'react';
+import { SmileOutlined,
+     HomeOutlined, 
+     PicLeftOutlined, 
+     SettingOutlined,
+     NodeExpandOutlined,
+     BorderOuterOutlined,
+     CopyrightOutlined,
+     ProfileOutlined,
+     AccountBookOutlined,
+     ControlOutlined,
+     CrownOutlined,
+} from '@ant-design/icons';
+
+const iconEnum = {
+  smile: <SmileOutlined />,
+  home: <HomeOutlined />,
+  picLeft: <PicLeftOutlined />,
+  setting: <SettingOutlined />,
+  crown:<CrownOutlined />,
+  NodeExpandOutlined:<NodeExpandOutlined />,
+  BorderOuterOutlined:<BorderOuterOutlined />,
+  CopyrightOutlined:<CopyrightOutlined />,
+  ProfileOutlined:<ProfileOutlined />,
+  AccountBookOutlined:<AccountBookOutlined />,
+  ControlOutlined:<ControlOutlined />,
+  
+};
+
+export default iconEnum;

+ 2 - 1
src/pages/UserMana/index.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 10:13:13
- * @LastEditTime: 2021-08-03 17:44:32
+ * @LastEditTime: 2021-08-11 09:00:44
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
@@ -149,6 +149,7 @@ const UserMana = () => {
                 url='/costAccount/excel/importUser'
                 importSuccessCallback={() =>{}}
                 token={token}
+                type='normal'
                 customRequestCallback={customRequestCallback}
           />
         ]}

+ 14 - 11
src/pages/accountingSubject/index.jsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 10:13:13
- * @LastEditTime: 2021-08-03 16:55:26
+ * @LastEditTime: 2021-08-06 18:28:12
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
@@ -88,12 +88,12 @@ const AccountingSubject = () => {
   const [updateModalVisible, handleUpdateModalVisible] = useState(false);
   const actionRef = useRef();  //表格
   const ref = useRef();   //新增表单
-  const [currentRow, setCurrentRow] = useState({});
-  const [selectedLevelList, setSelectedLevelList] = useState(null); //类型
-  const [selectedLevel, setSelectedLevel] = useState(null);
+  const [currentRow, setCurrentRow] = useState(undefined);
+
+
   const [accountType, setAccountType] = useState(1);
   const [options, setOptions] = useState([]);
-  const [selectedAccountingSubject, setSelectedAccountingSubject] = useState([]);
+
   const [ifChild, setIfChild] = useState(false);
   const [expanedRowIds,setExpanedRowIds] = useState([]);
 
@@ -135,7 +135,7 @@ const AccountingSubject = () => {
   };
 
   const expandHandle = id=>{
-    console.log({id,expanedRowIds});
+   
     if(expanedRowIds.includes(id)){
       const temp = expanedRowIds;
       temp.splice(temp.findIndex(item => item == id), 1);
@@ -245,7 +245,7 @@ const AccountingSubject = () => {
   };
    
   const onTabChange = (key)=>{
-    console.log({key});
+
     setAccountType(Number(key));
     if (actionRef.current) {
       actionRef.current.reload();
@@ -309,7 +309,7 @@ const AccountingSubject = () => {
         layout={'horizontal'}
         visible={createModalVisible}
         onVisibleChange={(bool) => {
-          console.log({ currentRow });
+        
           if (ref.current) {
             ref.current.resetFields();
           }
@@ -318,8 +318,9 @@ const AccountingSubject = () => {
         }}
         formRef={ref}
         onFinish={async (value) => {
-          const { id } = currentRow;
-          const success = await addAccountingSubject({ ...value, id: id ? id : 0,accountingType:accountType });
+          let id=0;
+          currentRow&&(id=currentRow.id)
+          const success = await addAccountingSubject({ ...value, id:id,accountingType:accountType });
           //   console.log({ success });
           if (success) {
             handleModalVisible(false);
@@ -328,6 +329,7 @@ const AccountingSubject = () => {
               actionRef.current.reload();
             }
           }
+          setCurrentRow(undefined);
         }}
       >
        
@@ -380,7 +382,8 @@ const AccountingSubject = () => {
       {/* 更新 */}
       <UpdateForm
         onSubmit={async (value) => {
-          console.log({ '编辑': value });
+          // console.log({ '编辑': value });
+          console.log({currentRow});
           const success = await editAccountingSubjectList({...value,accountType});
 
           if (success) {

+ 1 - 0
src/pages/accountingSubject/updateForm.jsx

@@ -24,6 +24,7 @@ const UpdateForm = (props) => {
         >
           <ProFormText
             label="会计科目编码"
+            disabled
             rules={[
               {
                 required: true,

+ 106 - 0
src/pages/baseSetting/incomeCollectionSetting/component/drawer.jsx

@@ -0,0 +1,106 @@
+
+
+import React, { useState, useEffect, useRef } from 'react'
+import { PageContainer } from '@ant-design/pro-layout';
+import ProTable from '@ant-design/pro-table';
+import { Table } from 'antd';
+import { DrawerForm } from '@ant-design/pro-form';
+
+
+
+
+
+
+export default function DrawerContent(props) {
+
+    const {
+        title = 'Drawer',
+        visible = false,
+        onVisibleChange = () => { },
+        currentRow = {},
+        renderListFunc = () => { },
+        onFinishFunc = () => { console.log('init onFinishFunc') },
+        columns = [],
+        defaultSelected = [],
+        config = {},
+        onTabChange
+    } = props;
+
+    const { rowKeys = 'id', tableSearch = false,} = config;
+    const drawerRef = useRef();
+    const drawerTableRef = useRef();
+    const [selectedKeys, setSelectedKeys] = useState([]);
+
+    const renderDefault = () => {
+        const defaultSelects = defaultSelected;
+        setSelectedKeys(defaultSelects);
+    }
+
+    
+    const reloadTable = ()=>{
+        if(drawerTableRef.current){
+            drawerTableRef.current.reload();
+        }
+    }
+
+    useEffect(() => {
+        renderDefault();
+    }, [currentRow, defaultSelected])
+
+
+
+    return visible && currentRow && columns.length > 0 ? (
+        <DrawerForm
+            title={title}
+            visible={visible}
+            onVisibleChange={onVisibleChange}
+            formRef={drawerRef}
+            drawerProps={{
+                forceRender: true,
+                destroyOnClose: true,
+            }}
+            onFinish={async (values) => {
+                //   console.log({onFinishFunc,values});
+                onFinishFunc(values, selectedKeys);
+            }}
+
+        >
+            <PageContainer className="DrawerContent"
+                 header={{
+                       title:'',
+                       breadcrumb:''
+                 }}
+                 tabList={[
+                      {
+                        tab: '收益',
+                        key:1,
+                      },
+                    //   {
+                    //     tab: '支出',
+                    //     key:2,
+                    //   },
+                 ]}
+                 onTabChange={(key)=>onTabChange(key,reloadTable)}
+            >
+                <ProTable
+                    columns={columns}
+                    rowKey={rowKeys}
+                    tableClassName="drawerContent"
+                    request={renderListFunc}
+                    search={tableSearch}
+                    actionRef={drawerTableRef}
+                    rowSelection={{
+                        // 自定义选择项参考: https://ant.design/components/table-cn/#components-table-demo-row-selection-custom
+                        // 注释该行则默认不显示下拉选项
+                        selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT],
+                        checkStrictly:false,
+                        selectedRowKeys: selectedKeys,
+                        onChange: (selectedRowKeys, selectedRows) => {
+                            setSelectedKeys(selectedRowKeys);
+                        }
+                    }}
+                />
+            </PageContainer>
+        </DrawerForm>
+    ) : <></>
+}

+ 436 - 0
src/pages/baseSetting/incomeCollectionSetting/index.js

@@ -0,0 +1,436 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 10:13:13
+ * @LastEditTime: 2021-08-06 18:43:57
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
+ */
+
+import { PlusOutlined } from '@ant-design/icons';
+import { Button, Popconfirm,Cascader} from 'antd';
+import React, { useState, useRef } from 'react';
+
+import { PageContainer } from '@ant-design/pro-layout';
+import ProTable from '@ant-design/pro-table';
+import { ModalForm, ProFormSelect,ProFormDependency,ProFormDigit } from '@ant-design/pro-form';
+import UpdateForm from './updateForm';
+import {addIncomeCollectionList, editIncomeCollectionList, delIncomeCollectionList,getIncomeCollectionList,
+  getIncomeCollectionListHasConnected,incomeCollectionListConnectAccountingSubject } from './service';
+
+import {getResponsibilityCenterList} from '@/pages/responsibilityCenter/service';
+
+import {getAccountingSubjectList} from '@/pages/accountingSubject/service';
+
+import DrawerContent from './component/drawer';
+
+
+const IncomeCollectionSetting = () => {
+  const columns = [
+    {
+      title: '收入归集Id',
+      dataIndex: 'id',
+      key: 'id',
+      hideInSearch: true,
+    },
+    {
+      title: '开启科室状态',
+      dataIndex: 'openDepartmentStatus',
+      key: 'openDepartmentStatus',
+      hideInSearch: true,
+      render:num=><>{num==1?'收益中心':'成本中心'}</>
+    },
+    {
+      title: '开单科室比例',
+      dataIndex: 'openDepartmentProportion',
+      key: 'openDepartmentProportion',
+      hideInSearch: true,
+    },
+    {
+      title: '执行科室状态',
+      dataIndex: 'startDepartmentStatus',
+      key: 'startDepartmentStatus',
+      hideInSearch: true,
+      render:num=><>{num==1?'收益中心':'成本中心'}</>
+    },
+    {
+      title: '执行科室比例',
+      dataIndex: 'startDepartmentProportion',
+      key: 'startDepartmentProportion',
+      hideInSearch: true,
+    },
+    // {
+    //   title: '责任中心编码',
+    //   dataIndex: 'responsibilityCode',
+    //   key: 'responsibilityCode',
+    //   hideInSearch: true,
+    // },
+    {
+      title: '归集到其他责任中心',
+      dataIndex: 'responsibilityName',
+      key: 'responsibilityName',
+      hideInSearch: true,
+    },
+    {
+      title: '操作',
+      dataIndex: 'option',
+      valueType: 'option',
+      render: (_, record) =>{
+        const {accountStatus} = record;
+        const btnGroups = [
+          <a
+            key="config"
+            onClick={() => {
+              handleUpdateModalVisible(true);
+              setCurrentRow(record);
+            }}
+          >
+            编辑
+          </a>,
+          <Popconfirm
+            key="subscribeAlert"
+            title="是否确定删除?"
+            onConfirm={() => {
+              delUserHandler(record);
+            }}
+          >
+            <a>删除</a>
+          </Popconfirm>,
+        ]
+        return accountStatus==0?btnGroups:[<a
+          key="config2"
+          onClick={() => {
+            drawerOpenhandle(record);
+          }}
+        >
+          排除会计科目
+        </a>,...btnGroups]
+      }
+    },
+  ];
+
+  const accountingSubjectColumn = [
+    {
+      title: '会计科目编码',
+      dataIndex: 'accountingCode',
+      key: 'accountingCode',
+      hideInSearch: true,
+    },
+    {
+      title: '会计科目名',
+      dataIndex: 'accountingName',
+      key: 'accountingName',
+    },
+  ];
+
+  const [createModalVisible, handleModalVisible] = useState(false);
+  const [updateModalVisible, handleUpdateModalVisible] = useState(false);
+  const actionRef = useRef();
+  const [currentRow, setCurrentRow] = useState({});
+  const [ifAddZeroLevelMenu, setIfAddZeroLevelMenu] = useState(true);
+  const [options,setOptions] = useState([]);
+  const [responsibilityCodes,setResponsibilityCode] = useState(null);
+
+
+  const [accountType,setAccountType] = useState(1);
+  const [drawerVisible, setDrawerVisible] = useState(false);
+  const [selectedKeys,setSelectedKeys] = useState([]);
+
+  // const [shareParamsSetting,setShareParamsSetting] = useState(false);  //是否分摊参数设置
+
+  /**
+   *
+   * @param {Boolean} bool 弹窗展示状态
+   */
+  const updateModalVisibleChange = (bool) => {
+    handleUpdateModalVisible(bool);
+    if (!bool) setCurrentRow(undefined);
+  };
+
+  //获取列表
+  const getIncomeCollections = async (params = {}, sort, filter) => {
+    const res = await getIncomeCollectionList(params);
+    return {
+      data: res.data.list,
+      total: res.data.totalCount,
+      success: res.success,
+    };
+  };
+
+  /**
+   *
+   * @param {Object} value 删除项数据
+   */
+  const delUserHandler = async (value) => {
+    const ids = [value.id];
+    const resp = await delIncomeCollectionList({ ids });
+    if (resp.status == 200) {
+      if (actionRef.current) {
+        actionRef.current.reload();
+      }
+    }
+  };
+  
+  /**
+   * 
+   */
+  const addListhandle = async ()=>{
+    const resp = await getResponsibilityCenterList({pageSize:50,current:1});
+    const {status,data} = resp;
+    if(status==200){
+      setOptions(data.list);
+    }
+    setIfAddZeroLevelMenu(true);
+    handleModalVisible(true);
+  }
+
+
+  //获取Drawer表格列表
+  const getTableList = async (params = {}, sort, filter) => {
+    const res = await getAccountingSubjectList({ ...params,accountType});
+    return {
+      data: res.data.list,
+      total: res.data.totalCount,
+      success: res.success,
+    };
+  };
+  
+
+ 
+  const drawerOpenhandle = async (record)=>{
+    const {id} = record;
+    const resp = await getIncomeCollectionListHasConnected({id});
+    const {status,data=[]} = resp;
+    if(status == 200){
+       const tempArr = data&&data.map(item=>item.accountingCode);
+       setSelectedKeys(tempArr);
+    }
+    setDrawerVisible(true);
+    setCurrentRow(record);
+  }
+
+
+
+  return (
+    <PageContainer>
+      <ProTable
+        columns={columns}
+        request={getIncomeCollections}
+        actionRef={actionRef}
+        rowKey="id"
+        toolBarRender={() => [
+          <Button
+            key="button"
+            icon={<PlusOutlined />}
+            type="primary"
+            onClick={() => {
+              addListhandle()
+            }}
+          >
+            新增
+          </Button>,
+        ]}
+        pagination={{
+          pageSize: 10,
+        }}
+        search={false}
+      />
+
+      <ModalForm
+        title="新增收入归集设置"
+        width="800px"
+        labelCol={{ span: 5, offset: 3 }}
+        layout={'horizontal'}
+        modalProps={{
+          destroyOnClose:true
+        }}
+        visible={createModalVisible}
+        onVisibleChange={handleModalVisible}
+        onFinish={async (value) => {
+          const {openDepartmentProportion,startDepartmentProportion} = value;
+          console.log({responsibilityCodes});
+          const resp = await addIncomeCollectionList({
+            ...value,responsibilityCodes:responsibilityCodes?responsibilityCodes.join('/'):null,
+            startDepartmentProportion:startDepartmentProportion?startDepartmentProportion:0,
+            openDepartmentProportion:openDepartmentProportion?openDepartmentProportion:0
+          });
+          const { status } = resp;
+          if (status == 200) {
+      
+            if (actionRef.current) {
+              actionRef.current.reload();
+            }
+            return true;
+          }
+          setCurrentRow(undefined);
+        }}
+      >
+        <ProFormSelect
+          name="openDepartmentStatus"
+          label="开单科室状态"
+          width="sm"
+          options={[
+            { label: '收益中心', value: 1},
+            { label: '成本中心', value: 2 }
+          ]}
+          placeholder="请选择状态"
+          rules={[{ required: true, message: '请选择开单科室状态!' }]}
+        />
+        <ProFormDependency name={['openDepartmentStatus']}>
+           {
+             ({openDepartmentStatus})=>{
+                  
+                  return openDepartmentStatus==2?(
+                      <ProFormDigit
+                        disabled
+                        label="开单科室比例"
+                        initialValue={0}
+                        rules={[
+                          {
+                            required: false,
+                            message: '开单科室比例是必填项!',
+                          },
+                        ]}
+                        width="sm"
+                        name="openDepartmentProportion"
+                      />
+                  ):(
+                      <ProFormDigit
+                      label="开单科室比例"
+                      rules={[
+                        {
+                          required: true,
+                          message: '开单科室比例是必填项!',
+                        },
+                      ]}
+                      width="sm"
+                      name="openDepartmentProportion"
+                    />
+                  )
+             }
+           }
+        </ProFormDependency>
+        <ProFormSelect
+          name="startDepartmentStatus"
+          label="执行科室状态"
+          width="sm"
+          options={[
+            { label: '收益中心', value: 1},
+            { label: '成本中心', value: 2 }
+          ]}
+          placeholder="请选择状态"
+          rules={[{ required: true, message: '请选择执行科室状态!' }]}
+        />
+        <ProFormDependency name={['startDepartmentStatus']}>
+            {
+              ({startDepartmentStatus})=>{
+                  return startDepartmentStatus==2?(
+                    <ProFormDigit
+                    disabled
+                    label="执行科室比例"
+                    initialValue={0}
+                    rules={[
+                      {
+                        required: false,
+                        message: '执行科室比例是必填项!',
+                      },
+                    ]}
+                    width="sm"
+                    name="startDepartmentProportion"
+                  />
+                  ):(
+                    <ProFormDigit
+                    label="执行科室比例"
+                    rules={[
+                      {
+                        required: true,
+                        message: '执行科室比例是必填项!',
+                      },
+                    ]}
+                    width="sm"
+                    name="startDepartmentProportion"
+                  />
+                  )
+              }
+            }
+        </ProFormDependency>
+        <ProFormDependency name={['openDepartmentStatus','startDepartmentStatus']}>
+            {({ openDepartmentStatus, startDepartmentStatus }) => {
+              
+                return (openDepartmentStatus==2&&startDepartmentStatus==2)?(
+                  <>
+                    <span style={{display:'inline-block',marginLeft:180,marginRight:10}}>选择责任中心:</span>
+                    <Cascader
+                      fieldNames={{ label: 'responsibilityName', value: 'responsibilityCode', children: 'child' }}
+                      options={options}
+                      onChange={(code)=>{setResponsibilityCode(code);}}
+                      placeholder=""
+                    />
+                  </>
+                ):<></>  
+            }}
+        </ProFormDependency>
+        
+      </ModalForm>
+
+
+      {/* 对应设置抽屉 */}
+      <DrawerContent
+          title={'排除会计科室'}
+          columns={accountingSubjectColumn}  //shareParamsColumn
+          visible={drawerVisible}
+          currentRow={currentRow}
+          // tableRef = {drawerTableRef}
+          defaultSelected={selectedKeys}
+          onTabChange={(key,reloadTable)=>{
+            setAccountType(key);
+            reloadTable();
+          }}
+          onVisibleChange={(bool) => setDrawerVisible(bool)}
+          renderListFunc={getTableList}
+          config={{tableSearch:false,rowKeys:'accountingCode'}}
+          onFinishFunc={async (value, selectedRowKeys) => {
+         
+            const { id } = currentRow;
+            const resp = await incomeCollectionListConnectAccountingSubject({ id,accountCodes: selectedRowKeys });
+            const { status } = resp;
+            if (status == 200) {
+              setDrawerVisible(false);
+              setCurrentRow(undefined);
+              if (actionRef.current) {
+                actionRef.current.reload();
+              }
+            }
+          }}
+        />
+
+
+      {/* 更新 */}
+      <UpdateForm
+        onSubmit={async (value) => {
+          const {id} = currentRow;
+          const {responsibilityCodes} = value;
+          const resp = await editIncomeCollectionList({...value,id,responsibilityCodes:responsibilityCodes?responsibilityCodes.join('/'):null});
+          const {status} = resp;
+          if (status==200) {
+            handleUpdateModalVisible(false);
+            setCurrentRow(undefined);
+
+            if (actionRef.current) {
+              actionRef.current.reload();
+            }
+          }
+        }}
+        onCancel={() => {
+          handleUpdateModalVisible(false);
+          setCurrentRow(undefined);
+        }}
+        updateModalVisible={updateModalVisible}
+        updateModalVisibleChange={updateModalVisibleChange}
+        values={currentRow || {}}
+      />
+    </PageContainer>
+  );
+};
+
+export default IncomeCollectionSetting;

+ 79 - 0
src/pages/baseSetting/incomeCollectionSetting/service.js

@@ -0,0 +1,79 @@
+/*
+ * @Author: your name
+ * @Date: 2021-08-03 14:38:54
+ * @LastEditTime: 2021-08-06 11:04:09
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /CostAccountManaSys/src/pages/platformMana/menuManage/service.js
+ */
+
+
+
+import { request } from 'umi';
+
+//获收入归集列表
+export async function getIncomeCollectionList(params, options) {
+    return request('/api/costAccount/costincomegroupset/list', {
+      method: 'GET',
+      params: {...params},
+      ...(options || {}),
+    });
+}
+
+
+//获指定收入归集设置对应的会计科目
+export async function getIncomeCollectionListHasConnected(params, options) {
+
+  return request('/api/costAccount/costincomegroupset/getIncomeAccountStatus', {
+    method: 'GET',
+    params: {...params},
+    ...(options || {}),
+  });
+}
+
+//新增归集设置
+export async function addIncomeCollectionList(body, options) {
+    return request('/api/costAccount/costincomegroupset/addCostIncomeGroupSet', {
+      method: 'POST',
+      data: {...body},
+      ...(options || {}),
+    });
+}
+
+//编辑
+export async function editIncomeCollectionList(body, options) {
+  return request('/api/costAccount/costincomegroupset/update', {
+    method: 'POST',
+    data: {...body},
+    ...(options || {}),
+  });
+}
+
+//删除归集设置
+export async function delIncomeCollectionList(params, options) {
+  const {ids} = params;
+  return request(`/api/costAccount/costincomegroupset/delete`, {
+    data:ids,
+    method: 'POST',
+    ...(options || {}),
+  });
+}
+
+// //根据角色查询已绑用户
+// export async function getUsersByRoleId(params, options) {
+//   const {roleId} = params;
+//   return request(`/api/costAccount/role/editUserRole`, {
+//     data:{roleId, userIds},
+//     method: 'POST',
+//     ...(options || {}),
+//   });
+// }
+
+//收入归集设置添加会计科目
+export async function incomeCollectionListConnectAccountingSubject(data, options) {
+  return request(`/api/costAccount/costincomegroupset/addIncomeAccount`, {
+    data:data,
+    method: 'POST',
+    ...(options || {}),
+  });
+}

+ 171 - 0
src/pages/baseSetting/incomeCollectionSetting/updateForm.jsx

@@ -0,0 +1,171 @@
+import React, { useEffect, useState } from 'react';
+import {
+  ModalForm,
+  ProFormSelect,
+  ProFormDependency,
+  ProFormDigit
+} from '@ant-design/pro-form';
+
+import { Cascader, Form, Input } from 'antd';
+
+import { getResponsibilityCenterList } from '@/pages/responsibilityCenter/service'
+
+
+
+const UpdateForm = (props) => {
+  const { updateModalVisible, updateModalVisibleChange, values, onSubmit } = props;
+  const [options, setOptions] = useState([]);
+  const [responsibilityCodes, setResponsibilityCode] = useState(null);
+  const [selected, setSelected] = useState([]);
+  // console.log({'回显':values});
+
+  useEffect(async () => {
+    if (JSON.stringify(values) !== '{}') {
+      const { responsibilityCodes } = values;
+
+      setSelected(responsibilityCodes ? [].concat(responsibilityCodes.split('/')) : []);
+      const resp = await getResponsibilityCenterList({ pageSize: 50, current: 1 });
+      const { status, data } = resp;
+      if (status == 200) {
+        setOptions(data.list);
+      }
+    }
+  }, [values]);
+
+
+
+  return (
+    <>
+      {
+        JSON.stringify(values) !== '{}' && <ModalForm
+          title="编辑收入归集设置"
+          width="800px"
+          initialValues={{ ...values }}
+          labelCol={{ span: 5, offset: 3 }}
+          layout={'horizontal'}
+          visible={updateModalVisible}
+          onVisibleChange={(visible) => updateModalVisibleChange(visible)}
+          onFinish={(value) => onSubmit({ ...values, ...value, responsibilityCodes })}
+        >
+          <ProFormSelect
+            name="openDepartmentStatus"
+            label="开单科室状态"
+            width="sm"
+            options={[
+              { label: '收益中心', value: 1 },
+              { label: '成本中心', value: 2 }
+            ]}
+            placeholder="请选择状态"
+            rules={[{ required: true, message: '请选择开单科室状态!' }]}
+          />
+          <ProFormDependency name={['openDepartmentStatus']}>
+            {
+              ({ openDepartmentStatus }) => {
+
+                return openDepartmentStatus == 2 ? (
+                  <ProFormDigit
+                    disabled
+                    label="开单科室比例"
+                    initialValue={0}
+                    rules={[
+                      {
+                        required: false,
+                        message: '开单科室比例是必填项!',
+                      },
+                    ]}
+                    width="sm"
+                    name="openDepartmentProportion"
+                  />
+                ) : (
+                  <ProFormDigit
+                    label="开单科室比例"
+                    rules={[
+                      {
+                        required: true,
+                        message: '开单科室比例是必填项!',
+                      },
+                    ]}
+                    width="sm"
+                    name="openDepartmentProportion"
+                  />
+                )
+              }
+            }
+          </ProFormDependency>
+          <ProFormSelect
+            name="startDepartmentStatus"
+            label="执行科室状态"
+            width="sm"
+            options={[
+              { label: '收益中心', value: 1 },
+              { label: '成本中心', value: 2 }
+            ]}
+            placeholder="请选择状态"
+            rules={[{ required: true, message: '请选择执行科室状态!' }]}
+          />
+          <ProFormDependency name={['startDepartmentStatus']}>
+            {
+              ({ startDepartmentStatus }) => {
+                return startDepartmentStatus == 2 ? (
+                  <ProFormDigit
+                    disabled
+                    label="执行科室比例"
+                    initialValue={0}
+                    rules={[
+                      {
+                        required: false,
+                        message: '执行科室比例是必填项!',
+                      },
+                    ]}
+                    width="sm"
+                    name="startDepartmentProportion"
+                  />
+                ) : (
+                  <ProFormDigit
+                    label="执行科室比例"
+                    rules={[
+                      {
+                        required: true,
+                        message: '执行科室比例是必填项!',
+                      },
+                    ]}
+                    width="sm"
+                    name="startDepartmentProportion"
+                  />
+                )
+              }
+            }
+          </ProFormDependency>
+          <ProFormDependency name={['openDepartmentStatus', 'startDepartmentStatus']}>
+            {({ openDepartmentStatus, startDepartmentStatus }) => {
+
+              return (openDepartmentStatus == 2 && startDepartmentStatus == 2) ? (
+                <Form.Item label="选择责任中心" shouldUpdate valuePropName="responsibilityCodes">
+                  {
+                    form => {
+                      return (
+                        <Cascader
+                          defaultValue={form.getFieldValue("responsibilityCodes") ? (form.getFieldValue("responsibilityCodes").split('/')) : []}
+                          style={{ width: 200 }}
+                          expandTrigger="hover"
+                          fieldNames={{ label: 'responsibilityName', value: 'responsibilityCode', children: 'child' }}
+                          options={options}
+                          onChange={(code) => { setResponsibilityCode(code); }}
+                          placeholder=""
+                        />
+                      )
+                    }
+                  }
+                  {/* <Input  type="text" /> */}
+
+                </Form.Item>
+              ) : <></>
+            }}
+          </ProFormDependency>
+        </ModalForm>
+      }
+    </>
+  );
+};
+
+export default UpdateForm;

+ 98 - 0
src/pages/baseSetting/reportProjectSetting/component/drawer.jsx

@@ -0,0 +1,98 @@
+
+
+import React, { useState, useEffect, useRef } from 'react'
+import { PageContainer } from '@ant-design/pro-layout';
+import ProTable from '@ant-design/pro-table';
+import { Table } from 'antd';
+import { DrawerForm } from '@ant-design/pro-form';
+
+
+
+
+
+
+export default function DrawerContent(props) {
+
+    const {
+        title = 'Drawer',
+        visible = false,
+        onVisibleChange = () => { },
+        currentRow = {},
+        renderListFunc = () => { },
+        onFinishFunc = () => { console.log('init onFinishFunc') },
+        columns = [],
+        defaultSelected = [],
+        config = {},
+        tabList=[],
+        onTabChange
+    } = props;
+
+    const { rowKeys = 'id', tableSearch = false,} = config;
+    const drawerRef = useRef();
+    const drawerTableRef = useRef();
+    const [selectedKeys, setSelectedKeys] = useState([]);
+
+    const renderDefault = () => {
+        const defaultSelects = defaultSelected;
+        setSelectedKeys(defaultSelects);
+    }
+
+    
+    const reloadTable = ()=>{
+        console.log('刷新');
+        if(drawerTableRef.current){
+            drawerTableRef.current.reload();
+        }
+    }
+
+    useEffect(() => {
+        renderDefault();
+    }, [currentRow, defaultSelected])
+
+
+
+    return visible && currentRow && columns.length > 0 ? (
+        <DrawerForm
+            title={title}
+            visible={visible}
+            onVisibleChange={onVisibleChange}
+            formRef={drawerRef}
+            drawerProps={{
+                forceRender: true,
+                destroyOnClose: true,
+            }}
+            onFinish={async (values) => {
+                //   console.log({onFinishFunc,values});
+                onFinishFunc(values, selectedKeys);
+            }}
+
+        >
+            <PageContainer className="DrawerContent"
+                 header={{
+                       title:'',
+                       breadcrumb:''
+                 }}
+                 tabList={tabList}
+                 onTabChange={(key)=>onTabChange(key,reloadTable)}
+            >
+                <ProTable
+                    columns={columns}
+                    rowKey={rowKeys}
+                    tableClassName="drawerContent"
+                    request={renderListFunc}
+                    search={tableSearch}
+                    actionRef={drawerTableRef}
+                    rowSelection={{
+                        // 自定义选择项参考: https://ant.design/components/table-cn/#components-table-demo-row-selection-custom
+                        // 注释该行则默认不显示下拉选项
+                        selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT],
+                        selectedRowKeys: selectedKeys,
+                        onChange: (selectedRowKeys, selectedRows) => {
+                            setSelectedKeys(selectedRowKeys);
+                        }
+                    }}
+                />
+            </PageContainer>
+        </DrawerForm>
+    ) : <></>
+}

+ 521 - 0
src/pages/baseSetting/reportProjectSetting/index.js

@@ -0,0 +1,521 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 10:13:13
+ * @LastEditTime: 2021-08-06 19:00:19
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
+ */
+
+import { PlusOutlined } from '@ant-design/icons';
+import { Button, Popconfirm } from 'antd';
+import React, { useState, useRef } from 'react';
+
+import { PageContainer } from '@ant-design/pro-layout';
+import ProTable from '@ant-design/pro-table';
+import {
+  ModalForm,
+  ProFormText,
+  ProFormSelect,
+  ProFormDependency,
+  ProFormDigit,
+} from '@ant-design/pro-form';
+import UpdateForm from './updateForm';
+import {
+  addReportProjectSettingList,
+  editReportProjectSettingList,
+  delReportProjectSettingList,
+  getReportProjectSettingList,
+  saveReportRelation,
+  getHasSetReportRelation
+} from './service';
+
+import {getAccountingSubjectList} from '@/pages/accountingSubject/service'
+
+import {getApportionmentLevelList } from '@/pages/apportionmentLevel/service'
+
+
+import DrawerContent from './component/drawer';
+
+const IncomeCollectionSetting = () => {
+  const columns = [
+    {
+      title: '报表项目名',
+      dataIndex: 'reportName',
+      key: 'reportName',
+      hideInSearch: true,
+    },
+    {
+      title: 'Id',
+      dataIndex: 'id',
+      key: 'id',
+      hideInSearch: true,
+    },
+    {
+      title: '编号',
+      dataIndex: 'num',
+      key: 'num',
+      hideInSearch: true,
+    },
+    {
+      title: '计算方式',
+      dataIndex: 'calcType',
+      key: 'calcType',
+      hideInSearch: true,
+      //1.对应会计科目,2.对应分摊层级,3.小计,4.计算公式
+      render: (num) => {
+        switch (num) {
+          case 0:
+            return <>不设置</>;
+          case 1:
+            return <>对应会计科目</>;
+          case 2:
+            return <>对应分摊层级</>;
+          case 3:
+            return <>小计</>;
+          case 4:
+            return <>计算公式</>;
+        }
+      },
+    },
+    {
+      title: '报表类型',
+      dataIndex: 'reportType',
+      key: 'reportType',
+      hideInSearch: true,
+      //报表类型:0.损益表、1.完全成本法表、2.变动成本表、3.全院损益表、4.全成本报表
+      render: (num) => {
+        switch (num) {
+          case 0:
+            return <>损益表</>;
+          case 1:
+            return <>完全成本法表</>;
+          case 2:
+            return <>变动成本表</>;
+          case 3:
+            return <>全院损益表</>;
+          case 4:
+            return <>全成本报表</>;
+        }
+      },
+    },
+    {
+      title: '计算公式',
+      dataIndex: 'calcFormula',
+      key: 'calcFormula',
+      hideInSearch: true,
+    },
+    {
+      title: '排序',
+      dataIndex: 'sort',
+      key: 'sort',
+      hideInSearch: true,
+    },
+    {
+      title: '比率基数',
+      dataIndex: 'ratioBase',
+      key: 'ratioBase',
+      hideInSearch: true,
+    },
+    {
+      title: '操作',
+      dataIndex: 'option',
+      valueType: 'option',
+      render: (_, record) =>{
+            const {showAddRelation,parentId} = record;
+            const btnGroup = [
+              <a
+                key="config1"
+                onClick={() => {
+                  setIfAddZeroLevelMenu(false);
+                  handleModalVisible(true);
+                  setCurrentRow(record);
+                }}
+              >
+              {parentId==0&&'添加'}
+              </a>,
+              <a
+                key="config2"
+                onClick={() => {
+                  handleUpdateModalVisible(true);
+                  setCurrentRow(record);
+                }}
+              >
+                编辑
+              </a>,
+              <Popconfirm
+                key="subscribeAlert"
+                title="是否确定删除?"
+                onConfirm={() => {
+                  delUserHandler(record);
+                }}
+              >
+                <a>删除</a>
+              </Popconfirm>,
+            ]
+            
+
+
+            return showAddRelation?[<a
+              key="config3"
+              onClick={() => {
+                setRelationInit(showAddRelation,record);
+              }}
+            >
+               {showAddRelation==1?'对应会计科目设置':showAddRelation==2&&'对应分摊层级'}
+            </a>,...btnGroup]:btnGroup;
+      }
+    },
+  ];
+
+  const accountingSubjectColumn = [
+    {
+      title: '会计科目编码',
+      dataIndex: 'accountingCode',
+      key: 'accountingCode',
+      hideInSearch: true,
+    },
+    {
+      title: '会计科目名',
+      dataIndex: 'accountingName',
+      key: 'accountingName',
+    },
+  ];
+
+  const shareParamsColumn = [
+    {
+      title: '分摊层级Id',
+      dataIndex: 'id',
+      key: 'id',
+      hideInSearch: false,
+    },
+    {
+      title: '分摊层级名',
+      dataIndex: 'shareName',
+      key: 'shareName',
+      hideInSearch: false,
+    },
+  ];
+
+  const [createModalVisible, handleModalVisible] = useState(false);
+  const [updateModalVisible, handleUpdateModalVisible] = useState(false);
+  const actionRef = useRef();
+  const [currentRow, setCurrentRow] = useState(undefined);
+  const [ifAddZeroLevelMenu, setIfAddZeroLevelMenu] = useState(true);
+  const [reportType, setReportType] = useState(0);
+
+  const [accountType,setAccountType] = useState(1);
+
+  const [settingType, setSettingType] = useState(0);
+  const [drawerVisible, setDrawerVisible] = useState(false);
+
+
+  const [selectedKeys,setSelectedKeys] = useState([]);
+
+
+  /**
+   *
+   * @param {Boolean} bool 弹窗展示状态
+   */
+  const updateModalVisibleChange = (bool) => {
+    handleUpdateModalVisible(bool);
+    if (!bool) setCurrentRow(undefined);
+  };
+
+  //获取列表
+  const getReportProjectSetting = async (params = {}, sort, filter) => {
+    const res = await getReportProjectSettingList({ ...params, reportType });
+    return {
+      data: res.data.list,
+      total: res.data.totalCount,
+      success: res.success,
+    };
+  };
+
+
+  //获取Drawer表格列表
+  const getTableList = async (params = {}, sort, filter) => {
+    if(settingType==1){
+      const res = await getAccountingSubjectList({ ...params,accountType});
+      return {
+        data: res.data.list,
+        total: res.data.totalCount,
+        success: res.success,
+      };
+    }
+    if(settingType==2){
+      const res = await getApportionmentLevelList({ ...params});
+      return {
+        data: res.data.list,
+        total: res.data.totalCount,
+        success: res.success,
+      };
+    }
+  };
+
+  //tab切换
+  const onTabChangeHandle = (key) => {
+    setReportType(key);
+    if (actionRef.current) {
+      actionRef.current.reload();
+    }
+  };
+
+  /**
+   *
+   * @param {Object} value 删除项数据
+   */
+  const delUserHandler = async (value) => {
+    const ids = [value.id];
+    const resp = await delReportProjectSettingList({ ids });
+    if (resp.status == 200) {
+      if (actionRef.current) {
+        actionRef.current.reload();
+      }
+    }
+  };
+
+  /**
+   * 
+   * @param {Number} showAddRelation  1.对应会计科目设置,2.对应分摊参数设置
+   * @param {*} record 
+   */
+  const setRelationInit = async (showAddRelation,record)=>{
+
+    const {id:reportId} = record;
+    setSettingType(showAddRelation);
+    setCurrentRow(record);
+    
+    const resp = await getHasSetReportRelation({reportId,relation:showAddRelation});
+    const {status,data} = resp;
+    console.log({showAddRelation});
+    if(status==200){
+       if(showAddRelation==1){
+        const tempArr = data.map(item=>item.code);
+        setSelectedKeys(tempArr);
+       }
+       if(showAddRelation==2){
+        const tempArr = data.map(item=>Number(item.code));
+        console.log({tempArr,showAddRelation});
+        setSelectedKeys(tempArr);
+       }
+    }
+    setDrawerVisible(true);
+  }
+
+
+  return (
+    <PageContainer
+      tabList={[
+        {
+          tab: '损益表',
+          key: 0,
+        },
+        {
+          tab: '完全成本法表',
+          key: 1,
+        },
+        {
+          tab: '变动成本表',
+          key: 2,
+        },
+        {
+          tab: '全院损益表',
+          key: 3,
+        },
+        {
+          tab: '全成本报表',
+          key: 4,
+        },
+      ]}
+      onTabChange={onTabChangeHandle}
+    >
+      <ProTable
+        columns={columns}
+        request={getReportProjectSetting}
+        actionRef={actionRef}
+        rowKey="id"
+        toolBarRender={() => [
+          <Button
+            key="button"
+            icon={<PlusOutlined />}
+            type="primary"
+            onClick={() => {
+              setIfAddZeroLevelMenu(true);
+              handleModalVisible(true);
+            }}
+          >
+            新增
+          </Button>,
+        ]}
+        pagination={{
+          pageSize: 10,
+        }}
+        search={false}
+      />
+
+      <ModalForm
+        title="新增报表项目设置"
+        width="800px"
+        labelCol={{ span: 5, offset: 3 }}
+        layout={'horizontal'}
+        modalProps={{
+          destroyOnClose: true,
+        }}
+        visible={createModalVisible}
+        onVisibleChange={handleModalVisible}
+        onFinish={async (value) => {
+          let id = 0;
+          // console.log({currentRow,id});
+          currentRow&&(id = currentRow.id);
+          const resp = await addReportProjectSettingList({...value,reportType:Number(reportType),parentId:id});
+          const { status } = resp;
+          setCurrentRow(undefined);
+          if (status == 200) {
+            if (actionRef.current) {
+              actionRef.current.reload();
+            }
+            return true;
+          }
+        }}
+      >
+        <ProFormText
+          label="报表名"
+          rules={[
+            {
+              required: true,
+              message: '报表名是必填项!',
+            },
+          ]}
+          width="sm"
+          name="reportName"
+        />
+        <ProFormDigit
+          label="排序"
+          rules={[
+            {
+              required: true,
+              message: '排序必填项!',
+            },
+          ]}
+          width="sm"
+          name="sort"
+        />
+        <ProFormSelect
+          name="calcType"
+          label="计算类型"
+          width="sm"
+          options={[
+            { label: '不设置', value: 0 },
+            { label: '对应会计科目', value: 1 },
+            { label: '对应分摊层级', value: 2 },
+            { label: '小计', value: 3 },
+            { label: '计算公式', value: 4 },
+          ]}
+          placeholder="请选择状态"
+          rules={[{ required: true, message: '请选择开单科室状态!' }]}
+        />
+      
+        <ProFormDependency name={['calcType']}>
+          {({ calcType }) => {
+            // const resp = await getResponsibilityCenterList({pageSize:100,current:1});
+            return calcType == 4 ? (
+              <ProFormText
+                label="计算公示"
+                rules={[
+                  {
+                    required: true,
+                    message: '计算公式是必填项!',
+                  },
+                ]}
+                width="sm"
+                name="calcFormula"
+              />
+            ) : (
+              <></>
+            );
+          }}
+        </ProFormDependency>
+      </ModalForm>
+
+      {/* 对应设置抽屉 */}
+      <DrawerContent
+          title={settingType==1?'对应会计科目设置':'对应分摊层级'}
+          columns={settingType==1?accountingSubjectColumn:shareParamsColumn}  //shareParamsColumn
+          visible={drawerVisible}
+          currentRow={currentRow}
+          // tableRef = {drawerTableRef}
+          defaultSelected={selectedKeys}
+          tabList={settingType==1?[
+            {
+              tab: '收益',
+              key:1,
+            },
+            {
+              tab: '支出',
+              key:2,
+            },
+          ]:[]}
+          onTabChange={(key,reloadTable)=>{
+            // console.log({key,reloadTable});
+            setAccountType(key);
+            reloadTable();
+          }}
+          onVisibleChange={(bool) => setDrawerVisible(bool)}
+          renderListFunc={getTableList}
+          config={{tableSearch:false,rowKeys:settingType==1?'accountingCode':'id'}}
+          onFinishFunc={async (value, selectedRowKeys) => {
+            // console.log({value,selectedRowKeys});
+            let selectedRowKeysToStr = [];
+            if(settingType==2){
+              selectedRowKeys.map(item=>selectedRowKeysToStr.push(`${item}`))
+            }
+            const { id:reportId } = currentRow;
+            const resp = await saveReportRelation({ reportId,relation:settingType,relationCodes: settingType==1?selectedRowKeys:selectedRowKeysToStr });
+            const { status } = resp;
+            if (status == 200) {
+              setDrawerVisible(false);
+              setCurrentRow(undefined);
+              if (actionRef.current) {
+                actionRef.current.reload();
+              }
+            }
+          }}
+        />
+
+      {/* 更新 */}
+      <UpdateForm
+        onSubmit={async (value) => {
+          const { parentId,calcType:calcTypePrev } = currentRow;
+          const {id,reportName,sort,calcType} = value;
+          const updateData = {
+            id,parentId,reportName,sort,reportType,calcType
+          }
+
+  
+
+          const resp = await editReportProjectSettingList(updateData);
+          const { status } = resp;
+
+          if (status == 200) {
+            handleUpdateModalVisible(false);
+            setCurrentRow(undefined);
+
+            if (actionRef.current) {
+              actionRef.current.reload();
+            }
+          }
+        }}
+        onCancel={() => {
+          handleUpdateModalVisible(false);
+          setCurrentRow(undefined);
+        }}
+        updateModalVisible={updateModalVisible}
+        updateModalVisibleChange={updateModalVisibleChange}
+        values={currentRow || {}}
+      />
+    </PageContainer>
+  );
+};
+
+export default IncomeCollectionSetting;

+ 71 - 0
src/pages/baseSetting/reportProjectSetting/service.js

@@ -0,0 +1,71 @@
+/*
+ * @Author: your name
+ * @Date: 2021-08-03 14:38:54
+ * @LastEditTime: 2021-08-04 18:15:37
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /CostAccountManaSys/src/pages/platformMana/menuManage/service.js
+ */
+
+
+
+import { request } from 'umi';
+
+//获报表项目设置列表
+export async function getReportProjectSettingList(params, options) {
+    return request('/api/costAccount/reportForm/list', {
+      method: 'GET',
+      params: {...params},
+      ...(options || {}),
+    });
+}
+
+//新增报表项目设置
+export async function addReportProjectSettingList(body, options) {
+    return request('/api/costAccount/reportForm/save', {
+      method: 'POST',
+      data: {...body},
+      ...(options || {}),
+    });
+}
+
+//编辑
+export async function editReportProjectSettingList(body, options) {
+  return request('/api/costAccount/reportForm/edit', {
+    method: 'POST',
+    data: {...body},
+    ...(options || {}),
+  });
+}
+
+//删除报表项目设置
+export async function delReportProjectSettingList(params, options) {
+  const {ids} = params;
+  return request(`/api/costAccount/reportForm/delete`, {
+    data:ids,
+    method: 'POST',
+    ...(options || {}),
+  });
+}
+
+//会计科目对应/分摊参数对应设置
+export async function saveReportRelation(body, options) {
+  return request('/api/costAccount/reportForm/saveReportRelation', {
+    method: 'POST',
+    data: {...body},
+    ...(options || {}),
+  });
+}
+
+
+//根据关系类型,获取已绑定的关系数据
+export async function getHasSetReportRelation(params, options) {
+  return request('/api/costAccount/reportForm/getRelationList', {
+    method: 'GET',
+    params: {...params},
+    ...(options || {}),
+  });
+}
+
+
+

+ 89 - 0
src/pages/baseSetting/reportProjectSetting/updateForm.jsx

@@ -0,0 +1,89 @@
+import React from 'react';
+import {
+  ProFormText,
+  ModalForm,
+  ProFormSelect,
+  ProFormDependency,
+  ProFormDigit
+} from '@ant-design/pro-form';
+
+
+
+const UpdateForm = (props) => {
+  const { updateModalVisible, updateModalVisibleChange, values, onSubmit } = props;
+  return (
+    <>
+      {
+        JSON.stringify(values) !== '{}' && <ModalForm
+          title="编辑收入归集设置"
+          width="800px"
+          initialValues={{ ...values}}
+          labelCol={{ span: 5, offset: 3 }}
+          layout={'horizontal'}
+          visible={updateModalVisible}
+          onVisibleChange={(visible) => updateModalVisibleChange(visible)}
+          onFinish={(value) => onSubmit({ ...values, ...value })}
+        >
+             <ProFormText
+          label="报表名"
+          rules={[
+            {
+              required: true,
+              message: '报表名是必填项!',
+            },
+          ]}
+          width="sm"
+          name="reportName"
+        />
+        <ProFormDigit
+          label="排序"
+          rules={[
+            {
+              required: true,
+              message: '排序必填项!',
+            },
+          ]}
+          width="sm"
+          name="sort"
+        />
+        <ProFormSelect
+          name="calcType"
+          label="计算类型"
+          width="sm"
+          options={[
+            { label: '不设置', value: 0 },
+            { label: '对应会计科目', value: 1 },
+            { label: '对应分摊层级', value: 2 },
+            { label: '小计', value: 3 },
+            { label: '计算公式', value: 4 },
+          ]}
+          placeholder="请选择状态"
+          rules={[{ required: true, message: '请选择开单科室状态!' }]}
+        />
+      
+        <ProFormDependency name={['calcType']}>
+          {({ calcType }) => {
+            return calcType == 4 ? (
+              <ProFormText
+                label="计算公示"
+                rules={[
+                  {
+                    required: true,
+                    message: '计算公式是必填项!',
+                  },
+                ]}
+                width="sm"
+                name="calcFormula"
+              />
+            ) : (
+              <></>
+            );
+          }}
+        </ProFormDependency>
+        </ModalForm>
+      }
+    </>
+  );
+};
+
+export default UpdateForm;

+ 132 - 0
src/pages/baseSetting/visitsAndBedDayCostSetting/components/DrawerContent.jsx

@@ -0,0 +1,132 @@
+
+
+
+
+import React,{useState,useEffect,useRef} from 'react'
+// import { PageContainer } from '@ant-design/pro-layout';
+import ProTable from '@ant-design/pro-table';
+import {Table } from 'antd';
+import { DrawerForm } from '@ant-design/pro-form';
+import { PageContainer } from '@ant-design/pro-layout';
+
+
+
+
+
+
+export default function DrawerContent(props) {
+
+    const { 
+        visible=false,
+        onVisibleChange=()=>{},
+        currentRow={},
+        renderListFunc=()=>{},
+        onFinishFunc=()=>{console.log('init onFinishFunc')},
+        columns=[],
+        defaultSelected=[],
+        config={},
+        title,
+        type,
+        tabList,
+        onTabChange,
+        renderCell,
+        tabActiveKey,
+        expandable
+    } = props;
+    
+    const {rowKeys='id',tableSearch=false,} = config;
+    const drawerRef = useRef();
+    const drawerTableRef = useRef();
+    const [selectedKeys,setSelectedKeys] = useState([]);
+    const [defaultSelectedKeys,setDefaultSelectedKeys] = useState([]);
+    const [ifSearch,setIfSearch] = useState(false);
+    const [selectedRows,setSelectedRows] = useState([]);
+
+    const renderDefault = ()=>{
+        // console.log({defaultSelected});
+        const defaultSelects = defaultSelected;
+        setDefaultSelectedKeys(defaultSelected);
+        setSelectedKeys(defaultSelects);
+    }
+
+
+    useEffect(()=>{
+        // console.log({tabActiveKey});
+        renderDefault();
+    },[currentRow,defaultSelected]);
+
+
+    return visible&&currentRow&&columns.length>0 ? (
+        <>
+            <DrawerForm
+                title={title}
+                visible={visible}
+                onVisibleChange={onVisibleChange}
+                formRef={drawerRef}
+                drawerProps={{
+                    forceRender: true,
+                    destroyOnClose: true,
+                }}
+
+                onFinish={async (values) => {
+                      onFinishFunc(values,defaultSelectedKeys,selectedRows);
+                }}
+            
+            >
+                <PageContainer  
+                    header={{
+                         title:'',
+                         breadcrumb:''
+                    }}
+                    tabActiveKey={tabActiveKey}
+                    tabList={tabList}
+                    onTabChange={(key)=>onTabChange(key,drawerTableRef)}
+                >
+                <ProTable
+                    columns={columns}
+                    rowKey={rowKeys}
+                    tableClassName="drawerContent"
+                    request={renderListFunc}
+                    search={tableSearch}
+                    actionRef={drawerTableRef}
+                    onSubmit={(u)=>{
+                        //  console.log({u});
+                        setIfSearch(true);
+                    }}
+                    onReset={()=>{setIfSearch(false);}}
+                    expandable={expandable}
+                    rowSelection={{
+                        // 自定义选择项参考: https://ant.design/components/table-cn/#components-table-demo-row-selection-custom
+                        // 注释该行则默认不显示下拉选项
+                        type:type,
+                        selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT],
+                        checkStrictly:false,
+                        selectedRowKeys:selectedKeys,
+                        renderCell:renderCell,
+                        onChange:(selectedRowKeys, selectedRows)=>{
+                            setSelectedKeys(selectedRowKeys);
+                            setSelectedRows(selectedRows);
+                        },
+                        onSelect:(record, selected, selectedRows, nativeEvent)=>{
+                            // console.log({record, selected, selectedRows, nativeEvent,ifSearch});
+                            const _defaultSelectedKeys = defaultSelectedKeys;
+                            
+                            if(!selected){
+                                const index =  defaultSelectedKeys.findIndex(item=>item == record[rowKeys]);
+                                if(index != -1){
+                                     _defaultSelectedKeys.splice(index,1);
+                                     setDefaultSelectedKeys(_defaultSelectedKeys);
+                                }
+                            }else{
+                                _defaultSelectedKeys.push(record[rowKeys]);
+                                setDefaultSelectedKeys(_defaultSelectedKeys);
+                            }
+
+                        }
+                    }}
+                />
+                </PageContainer>
+            </DrawerForm>
+        </>
+    ) : <></>
+}

+ 589 - 0
src/pages/baseSetting/visitsAndBedDayCostSetting/index.jsx

@@ -0,0 +1,589 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 10:13:13
+ * @LastEditTime: 2021-08-10 16:29:33
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
+ */
+
+import { PlusOutlined } from '@ant-design/icons';
+import { Button, Popconfirm } from 'antd';
+import React, { useState, useRef, useEffect } from 'react';
+
+import { PageContainer } from '@ant-design/pro-layout';
+import ProTable from '@ant-design/pro-table';
+import { ModalForm, ProFormText, ProFormSelect } from '@ant-design/pro-form';
+import UpdateForm from './updateForm';
+import DrawerContent from './components/DrawerContent';
+import { getVisitsAndBedDayCostSettingList, delVisitsAndBedDayCostSettingList, addVisitsAndBedDayCostSettingList, 
+  getVisitsAndBedDayCostSettingListById,editVisitsAndBedDayCostSettingList } from './service';
+import { getCostshareparamList } from '@/pages/costAllocationParamsSetting/service';
+import { getReportProjectSettingList } from '@/pages/baseSetting/reportProjectSetting/service';
+
+const DistrictMana = () => {
+  const columns = [
+    {
+      title: '分配方式',
+      dataIndex: 'allocation',
+      key: 'allocation',
+      hideInSearch: true,
+      render: num => <>{num == 1 ? '按照收入比例分配' : '按照固定比例分配'}</>
+    },
+    {
+      title: '收入类型',
+      dataIndex: 'incomeType',
+      key: 'incomeType',
+      hideInSearch: true,
+      render: num => <>{num == 1 ? '门诊方式' : '住院方式'}</>
+    },
+    {
+      title: '对应值',
+      dataIndex: 'incomeFileName',
+      key: 'incomeFileName',
+      hideInSearch: false,
+    },
+    {
+      title: '分摊参数编码',
+      dataIndex: 'shareParamCode',
+      key: 'shareParamCode',
+      hideInSearch: true,
+    },
+    {
+      title: '分摊参数名称',
+      dataIndex: 'shareParamName',
+      key: 'shareParamName',
+      hideInSearch: true,
+    },
+    {
+      title: '成本对应',
+      dataIndex: 'costCorrespondingName',
+      key: 'costCorrespondingName',
+      hideInSearch: true,
+    },
+    {
+      title: '操作',
+      dataIndex: 'option',
+      valueType: 'option',
+      render: (_, record) => [
+        <a
+          key="config"
+          onClick={() => {
+            edithandle(record);
+          }}
+        >
+          编辑
+        </a>,
+        <Popconfirm
+          key="subscribeAlert"
+          title="是否确定删除?"
+          onConfirm={() => {
+            setCurrentRow(record);
+            delListHandler(record);
+          }}
+        >
+          <a>删除</a>
+        </Popconfirm>,
+      ],
+    },
+  ];
+
+  const drawerTableColumns = [
+    {
+      title: '分摊参数名称',
+      dataIndex: 'shareParamName',
+      key: 'shareParamName',
+      hideInSearch: true,
+    },
+    {
+      title: '分摊参数代码',
+      dataIndex: 'shareParamCode',
+      key: 'shareParamCode',
+      hideInSearch: true,
+    }
+  ]
+
+  const drawerTableReportColumns = [
+    {
+      title: '报表项目名',
+      dataIndex: 'reportName',
+      key: 'reportName',
+      hideInSearch: true,
+    },
+    {
+      title: '编号',
+      dataIndex: 'num',
+      key: 'num',
+      hideInSearch: true,
+    }
+  ]
+
+  const [createModalVisible, handleModalVisible] = useState(false);
+  const [updateModalVisible, handleUpdateModalVisible] = useState(false);
+  const actionRef = useRef();
+  const ref = useRef();   //新增表单
+  const [updateFormRef,setUpdateFormRef] = useState(null);
+  const [currentRow, setCurrentRow] = useState({});
+  const [drawerVisible, setDrawerVisible] = useState(false);
+  const [type, setType] = useState(0);   //1 分摊参数,2 报表
+  const [selectedShareparams, setSelectedShareparams] = useState(null);
+  const [selectedIncome, setSelectedIncome] = useState(null);
+  const [activeKey, setActiveKey] = useState('0');
+  const [selectedCost, setSelectedCost] = useState(null);
+  const [ifcostCorresponding, setIfcostCorresponding] = useState(true);
+  const [dataById, setDataById] = useState(null);
+  const [edit,setEdit] = useState(false);
+  const [expandedRowKeys,setExpandedRowKeys] = useState([]);
+  const [defaultReportTableSelected,setDefaultReportTableSelected] = useState([]);
+
+
+  const reportTableTypes = ['损益表','完全成本法表','变动成本表','全院损益表','全成本报表'];
+
+  /**
+   *
+   * @param {Boolean} bool 弹窗展示状态
+   */
+  const updateModalVisibleChange = (bool) => {
+
+    
+    handleUpdateModalVisible(bool);
+    if (!bool) setCurrentRow(undefined);
+  };
+
+  //获取列表
+  const getList = async (params = {}, sort, filter) => {
+    const res = await getVisitsAndBedDayCostSettingList({...params});
+    // console.log({res});
+    return {
+      data: res.data.list,
+      total: res.data.totalCount,
+      success: res.success,
+    };
+  };
+
+  //获取drawer 列表
+  const getDrawerTableList = async (params = {}, sort, filter) => {
+    if (type == 1) {
+      const res = await getCostshareparamList({ ...params });
+      return {
+        data: res.data.list,
+        total: res.data.totalCount,
+        success: res.success,
+      };
+    }
+    if (type == 2) {
+      const res = await getReportProjectSettingList({ ...params, reportType: activeKey });
+
+      const arr = res.data.list.map(item=>item.num);
+      setExpandedRowKeys(arr);
+
+      return {
+        data: res.data.list,
+        total: res.data.totalCount,
+        success: res.success,
+      };
+    }
+
+  };
+
+  /**
+   *
+   * @param {Object} value 删除项数据
+   */
+  const delListHandler = async (value) => {
+    const resp = await delVisitsAndBedDayCostSettingList(value);
+    // console.log({ resp });
+    if (resp.status) {
+      if (actionRef.current) {
+        actionRef.current.reload();
+      }
+    }
+  };
+
+  const edithandle = async (record) => {
+    setEdit(true);
+    const { id } = record;
+    //获取指定id数据
+    const resp = await getVisitsAndBedDayCostSettingListById({ id });
+    // console.log({ resp });
+    const { status, data } = resp;
+    if (status == 200) {
+      setDataById(data);
+    }
+    setCurrentRow(record);
+    handleUpdateModalVisible(true);
+  }
+
+
+  const openDrawerHandle = (num, bool) => {
+    setType(num);
+    setIfcostCorresponding(bool);
+    if(bool&&edit){
+      console.log('成本');
+      const {costFileType,costCorresponding} = dataById;
+      setDefaultReportTableSelected([].concat([costCorresponding]));
+      setActiveKey(`${costFileType}`);
+    }
+    if(!bool&&edit){
+      console.log('收入');
+      const {incomeFileType,incomeFieldNum} = dataById;
+      setDefaultReportTableSelected([].concat([incomeFieldNum]));
+      setActiveKey(`${incomeFileType}`);
+    }
+    setDrawerVisible(true);
+  }
+ 
+
+
+  useEffect(() => {
+
+  }, []);
+
+
+  return (
+    <PageContainer>
+      <ProTable
+        columns={columns}
+        request={getList}
+        actionRef={actionRef}
+        rowKey="id"
+        toolBarRender={() => [
+          <Button
+            key="button"
+            icon={<PlusOutlined />}
+            type="primary"
+            onClick={() => {
+              setEdit(false);
+              handleModalVisible(true);
+            }}
+          >
+            新增
+          </Button>
+        ]}
+
+        pagination={{
+          pageSize: 10,
+        }}
+        search={{
+          defaultCollapsed: false,
+          labelWidth: 'auto',
+        }}
+
+      />
+      {
+        <ModalForm
+          title="新增诊次/床日成本设置"
+          width="800px"
+          labelCol={{ span: 5, offset: 3 }}
+          layout={'horizontal'}
+          formRef={ref}
+          visible={createModalVisible}
+          onVisibleChange={(bool) => {
+            if (ref.current) {
+              ref.current.resetFields();
+            }
+            handleModalVisible(bool);
+          }}
+          onFinish={async (value) => {
+            const { allocation, incomeType } = value;
+            const { shareParamCode, shareParamName } = selectedShareparams;
+            const { num: incomeFieldNum, reportName: incomeFileName,reportType:incomeFileType } = selectedIncome;
+            const { num: costCorresponding, reportName: costCorrespondingName,reportType:costFileType } = selectedCost;
+            const data = { 
+               allocation, incomeType, shareParamCode, shareParamName, incomeFieldNum,
+               incomeFileName:`${reportTableTypes[incomeFileType]}${incomeFileName}`,
+               costCorresponding, costCorrespondingName:`${reportTableTypes[costFileType]}${costCorrespondingName}`,
+               incomeFileType,costFileType}
+            // console.log({data});
+            const success = await addVisitsAndBedDayCostSettingList(data);
+            if (success) {
+              handleModalVisible(false);
+
+              if (actionRef.current) {
+                actionRef.current.reload();
+              }
+            }
+            //清空
+            setSelectedCost(null);
+            setSelectedShareparams(null);
+            setSelectedIncome(null);
+          }}
+        >
+          <ProFormSelect
+            rules={[
+              {
+                required: true,
+                message: '请选择分配方式',
+              },
+            ]}
+            options={[
+              {
+                value: 1,
+                label: '按收入比例分配',
+              },
+              {
+                value: 2,
+                label: '按照固定比例分配',
+              },
+            ]}
+            width="sm"
+            name="allocation"
+            label="分配方式"
+          />
+          <ProFormSelect
+            rules={[
+              {
+                required: true,
+                message: '请选择收入类型',
+              },
+            ]}
+            options={[
+              {
+                value: 1,
+                label: '门诊方式',
+              },
+              {
+                value: 2,
+                label: '住院方式',
+              },
+            ]}
+            width="sm"
+            name="incomeType"
+            label="收入类型"
+          />
+          <ProFormText
+            fieldProps={{
+              onFocus: () => { openDrawerHandle(1) },
+              allowClear:false
+            }}
+            rules={[
+              {
+                required: true,
+                message: '请选择分摊参数',
+              },
+            ]}
+            width="sm"
+            name="shareParamName"
+            label="选择分摊参数"
+          />
+          <ProFormText
+            fieldProps={{
+              onFocus: () => { openDrawerHandle(2, false); },
+              allowClear:false
+            }}
+            rules={[
+              {
+                required: true,
+                message: '请选择对应收入字段',
+              },
+            ]}
+            width="sm"
+            name="incomeFileName"
+            label="对应收入字段"
+          />
+          <ProFormText
+            fieldProps={{
+              onFocus: () => { openDrawerHandle(2, true); },
+              allowClear:false
+            }}
+            rules={[
+              {
+                required: true,
+                message: '请选择对应成本字段',
+              },
+            ]}
+            width="sm"
+            name="costCorrespondingName"
+            label="对应成本字段"
+          />
+        </ModalForm>
+      }
+
+
+      {/* 抽屉内容 */}
+      {
+        type == 1 ? <DrawerContent
+          columns={drawerTableColumns}
+          visible={drawerVisible}
+          currentRow={currentRow}
+          title="选择分摊参数"
+          type='radio'
+          defaultSelected={edit?[dataById.shareParamCode]:[]}
+          onVisibleChange={(bool) => setDrawerVisible(bool)}
+          renderListFunc={getDrawerTableList}
+          config={{ tableSearch: false, rowKeys: 'shareParamCode' }}
+          onFinishFunc={async (value, selectedRowKeys, selectedRows) => {
+            console.log({ '分摊': selectedRows })
+            setSelectedShareparams(selectedRows[0]);
+            const { shareParamName } = selectedRows[0];
+            if(edit){
+              updateFormRef?.current?.setFieldsValue({
+                shareParamName: shareParamName,
+              });
+            }else{
+              ref?.current?.setFieldsValue({
+                shareParamName: shareParamName,
+              });
+            }
+            
+            setDrawerVisible(false);
+
+          }}
+        /> : <DrawerContent
+          columns={drawerTableReportColumns}
+          visible={drawerVisible}
+          currentRow={currentRow}
+          title={ifcostCorresponding ? '选择对应成本字段' : '选择对应收入字段'}
+          type='radio'
+          tabList={[
+            {
+              tab: '损益表',
+              key: 0,
+            },
+            {
+              tab: '完全成本法表',
+              key: 1,
+            },
+            {
+              tab: '变动成本表',
+              key: 2,
+            },
+            {
+              tab: '全院损益表',
+              key: 3,
+            },
+            {
+              tab: '全成本报表',
+              key: 4,
+            },
+          ]}
+          // tabActiveKey='3'
+          renderCell={(checked, record, index, originNode) => {
+            const { children } = record;
+            if (!children || children.length == 0) {
+              return originNode
+            } else {
+              return null
+            }
+          }}
+          onTabChange={(key, ref) => {
+            setActiveKey(key);
+            if (ref.current) ref.current.reload()
+          }}
+          expandable={{
+            expandedRowKeys:expandedRowKeys
+          }}
+          defaultSelected={defaultReportTableSelected}
+          onVisibleChange={(bool) => setDrawerVisible(bool)}
+          renderListFunc={getDrawerTableList}
+          config={{ tableSearch: false,rowKeys:'num'}}
+
+          tabActiveKey={activeKey}
+
+          onFinishFunc={async (value, selectedRowKeys, selectedRows) => {
+            // console.log({ '报表': selectedRows,'ifcostCorresponding':ifcostCorresponding,value });
+
+            if(selectedRows.length>0){
+              const { reportName,reportType } = selectedRows[0];
+              if (!ifcostCorresponding) {
+                setSelectedIncome(selectedRows[0]);
+                if(edit){
+                  updateFormRef?.current?.setFieldsValue({
+                    incomeFileName: reportName,
+                  });
+                }else{
+                  ref?.current?.setFieldsValue({
+                    incomeFileName: reportName,
+                  });
+                }
+              }
+              if (ifcostCorresponding) {
+                setSelectedCost(selectedRows[0]);
+                if(edit){
+                  updateFormRef?.current?.setFieldsValue({
+                    costCorrespondingName: reportName,
+                  });
+                }else{
+                  ref?.current?.setFieldsValue({
+                    costCorrespondingName: reportName,
+                  });
+                }
+                
+              }
+            }
+            
+            setDrawerVisible(false);
+            setActiveKey('0');
+          }}
+        />
+      }
+
+
+      {/* 更新 */}
+      <UpdateForm
+        onSubmit={async (value) => {
+          console.log({ '编辑': value });
+            const {id} = currentRow;
+            const { allocation, incomeType } = value;
+            let data = {id,allocation,incomeType};
+            if(selectedShareparams){
+              const { shareParamCode, shareParamName } = selectedShareparams;
+              data = {...data,shareParamCode, shareParamName}
+            }else{
+              const { shareParamCode, shareParamName } = dataById;
+              data = {...data,shareParamCode, shareParamName}
+            }
+
+            if(selectedIncome){
+              const { num: incomeFieldNum, reportName: incomeFileName,reportType:incomeFileType } = selectedIncome;
+              data = {...data,incomeFieldNum,incomeFileName,incomeFileType}
+            }else{
+              const { incomeFieldNum, incomeFileName,incomeFileType } = dataById;
+              data = {...data,incomeFieldNum,incomeFileName,incomeFileType}
+            }
+            
+            if(selectedCost){
+              const { num: costCorresponding, reportName: costCorrespondingName,reportType:costFileType } = selectedCost;
+              data = {...data,costCorresponding,costCorrespondingName,costFileType}
+            }else{
+              const { costCorresponding, costCorrespondingName,costFileType } = dataById;
+              data = {...data,costCorresponding,costCorrespondingName,costFileType}
+            }
+            
+            
+
+            const success = await editVisitsAndBedDayCostSettingList(data);
+
+          if (success) {
+            handleUpdateModalVisible(false);
+            setCurrentRow(undefined);
+
+            if (actionRef.current) {
+              actionRef.current.reload();
+            }
+          }
+
+           //清空
+           setSelectedCost(null);
+           setSelectedShareparams(null);
+           setSelectedIncome(null);
+           setDataById(null);
+           setDefaultReportTableSelected([]);
+           
+        }}
+        
+        openDrawerHandle={openDrawerHandle}
+        onCancel={() => {
+          handleUpdateModalVisible(false);
+          setCurrentRow(undefined);
+        }}
+        getFormRef={ref=>setUpdateFormRef(ref)}
+        updateModalVisible={updateModalVisible}
+        updateModalVisibleChange={updateModalVisibleChange}
+        values={currentRow || {}}
+      />
+    </PageContainer>
+  );
+};
+
+export default DistrictMana;

+ 62 - 0
src/pages/baseSetting/visitsAndBedDayCostSetting/service.js

@@ -0,0 +1,62 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 08:54:08
+ * @LastEditTime: 2021-08-10 10:03:05
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/src/pages/DepartmentMana/service.js
+ */
+
+import { request } from 'umi';
+
+
+//获取诊次/床日成本设置列表
+export async function getVisitsAndBedDayCostSettingList(params, options) {
+    const {incomeFileName:name,current,pageSize} = params;
+    return request('/api/costAccount/costnumberbedset/list', {
+      method: 'GET',
+      params:{current,pageSize,name},
+      ...(options || {}),
+    });
+}
+
+
+//获取指定诊次/床日成本设置列表数据
+export async function getVisitsAndBedDayCostSettingListById(params, options) {
+  return request('/api/costAccount/costnumberbedset/info', {
+    method: 'GET',
+    params:{...params},
+    ...(options || {}),
+  });
+}
+
+
+//编辑
+export async function editVisitsAndBedDayCostSettingList(body, options) {
+  return request('/api/costAccount/costnumberbedset/update', {
+    method: 'POST',
+    data:{...body},
+    ...(options || {}),
+  });
+}
+
+//新增诊次/床日成本设置
+export async function addVisitsAndBedDayCostSettingList(body, options) {
+  return request('/api/costAccount/costnumberbedset/save', {
+    method: 'POST',
+    data:{...body},
+    ...(options || {}),
+  });
+}
+
+//删除
+export async function delVisitsAndBedDayCostSettingList(params, options) {
+  const {id} = params;
+  const ids = [id];
+  return request(`/api/costAccount/costnumberbedset/delete`, {
+    method: 'POST',
+    data:ids,
+    ...(options || {}),
+  });
+}
+

+ 127 - 0
src/pages/baseSetting/visitsAndBedDayCostSetting/updateForm.jsx

@@ -0,0 +1,127 @@
+import React, { useState,useEffect,useRef} from 'react';
+import {
+  ProFormSelect,
+  ProFormText,
+  ModalForm
+} from '@ant-design/pro-form';
+
+import { getMainDistrictList } from './service';
+
+
+const UpdateForm = (props) => {
+  const { updateModalVisible, updateModalVisibleChange, values, onSubmit,openDrawerHandle,getFormRef} = props;
+  const [selectedHosp, setSelectedHosp] = useState({});
+  const updateFormRef = useRef();
+
+  useEffect(() => {
+    getFormRef(updateFormRef)
+  }, [props])
+  // console.log({values});
+  return (
+    <>
+      {
+        JSON.stringify(values) !== '{}' && <ModalForm
+          title="编辑诊次/床日成本设置"
+          width="800px"
+          initialValues={{ ...values }}
+          labelCol={{ span: 5, offset: 3 }}
+          layout={'horizontal'}
+          formRef={updateFormRef}
+          visible={updateModalVisible}
+          onVisibleChange={(visible) => updateModalVisibleChange(visible)}
+          onFinish={(value) => onSubmit({ ...values, ...value, parentName: selectedHosp.name })}
+        >
+          <ProFormSelect
+            rules={[
+              {
+                required: true,
+                message: '请选择分配方式',
+              },
+            ]}
+            options={[
+              {
+                value: 1,
+                label: '按收入比例分配',
+              },
+              {
+                value: 2,
+                label: '按照固定比例分配',
+              },
+            ]}
+            width="sm"
+            name="allocation"
+            label="分配方式"
+          />
+          <ProFormSelect
+            rules={[
+              {
+                required: true,
+                message: '请选择收入类型',
+              },
+            ]}
+            options={[
+              {
+                value: 1,
+                label: '门诊方式',
+              },
+              {
+                value: 2,
+                label: '住院方式',
+              },
+            ]}
+            width="sm"
+            name="incomeType"
+            label="收入类型"
+          />
+          <ProFormText
+            fieldProps={{
+              onFocus: () => { openDrawerHandle(1) },
+              allowClear:false
+            }}
+            rules={[
+              {
+                required: true,
+                message: '请选择分摊参数',
+              },
+            ]}
+            width="sm"
+            name="shareParamName"
+            label="选择分摊参数"
+          />
+          <ProFormText
+            fieldProps={{
+              onFocus: () => { openDrawerHandle(2,false); },
+              allowClear:false
+            }}
+            rules={[
+              {
+                required: true,
+                message: '请选择对应收入字段',
+              },
+            ]}
+            width="sm"
+            name="incomeFileName"
+            label="对应收入字段"
+          />
+          <ProFormText
+            fieldProps={{
+              onFocus: () => { openDrawerHandle(2,true); },
+              allowClear:false
+            }}
+            rules={[
+              {
+                required: true,
+                message: '请选择对应成本字段',
+              },
+            ]}
+            width="sm"
+            name="costCorrespondingName"
+            label="对应成本字段"
+          />
+        </ModalForm>
+      }
+    </>
+  );
+};
+
+export default UpdateForm;

+ 250 - 0
src/pages/baseSetting/wholeHospCostAndIncomeSet/index.jsx

@@ -0,0 +1,250 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 10:13:13
+ * @LastEditTime: 2021-08-10 16:40:42
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
+ */
+
+import { PlusOutlined } from '@ant-design/icons';
+import { Button, Popconfirm,Form,Input} from 'antd';
+import React, { useState, useRef } from 'react';
+
+import { PageContainer } from '@ant-design/pro-layout';
+import ProTable from '@ant-design/pro-table';
+import { ModalForm, ProFormText, ProFormSelect } from '@ant-design/pro-form';
+import UpdateForm from './updateForm';
+// import DrawerContent from '@/components/DrawerContent/index';
+import { getWholeHospCostList, editWholeHospCostList, delWholeHospCostList, addWholeHospCostList } from './service';
+import {getCostshareparamList} from '@/pages/costAllocationParamsSetting/service'
+
+const WholeHospCostAndIncomeSet = () => {
+  const columns = [
+    {
+      title: '收支类型',
+      dataIndex: 'paymentsType',
+      key: 'paymentsType',
+      hideInSearch: true,
+      render: num => <>{num == 1 ? '门诊方式' : '住院方式'}</>
+    },
+    {
+      title: '收支名称',
+      dataIndex: 'paymentsName',
+      key: 'paymentsName',
+      hideInSearch: true,
+    },
+    {
+      title: '操作',
+      dataIndex: 'option',
+      valueType: 'option',
+      render: (_, record) => [
+        <a
+          key="config"
+          onClick={() => {
+            handleUpdateModalVisible(true);
+            setCurrentRow(record);
+          }}
+        >
+          编辑
+        </a>,
+        <Popconfirm
+          key="subscribeAlert"
+          title="是否确定删除?"
+          onConfirm={() => {
+            setCurrentRow(record);
+            delListHandler(record);
+          }}
+        >
+          <a>删除</a>
+        </Popconfirm>,
+      ],
+    },
+  ];
+
+  const drawerTableColumns = [
+      {
+        title: '分摊参数名称',
+        dataIndex: 'shareParamName',
+        key: 'shareParamName',
+        hideInSearch: true,
+      },
+      {
+        title: '分摊参数代码',
+        dataIndex: 'shareParamCode',
+        key: 'shareParamCode',
+        hideInSearch: true,
+      }
+  ]
+
+  const [createModalVisible, handleModalVisible] = useState(false);
+  const [updateModalVisible, handleUpdateModalVisible] = useState(false);
+  const actionRef = useRef();
+  const ref = useRef();   //新增表单
+  const [currentRow, setCurrentRow] = useState({});
+  const [drawerVisible,setDrawerVisible] = useState(false);
+
+  /**
+   *
+   * @param {Boolean} bool 弹窗展示状态
+   */
+  const updateModalVisibleChange = (bool) => {
+    handleUpdateModalVisible(bool);
+    if (!bool) setCurrentRow(undefined);
+  };
+
+  //获取列表
+  const getList = async (params = {}, sort, filter) => {
+    const res = await getWholeHospCostList(params);
+    // console.log({res});
+    return {
+      data: res.data.list,
+      total: res.data.totalCount,
+      success: res.success,
+    };
+  };
+
+  
+
+  /**
+   *
+   * @param {Object} value 删除项数据
+   */
+  const delListHandler = async (value) => {
+    const resp = await delWholeHospCostList(value);
+    // console.log({ resp });
+    if (resp.status) {
+      if (actionRef.current) {
+        actionRef.current.reload();
+      }
+    }
+  };
+
+
+  const openDrawerHandle = ()=>{
+    console.log('focus');
+    setDrawerVisible(true);
+  }
+
+  // useEffect(()=>{
+  //   CARequest('/api/costAccount/hosptail/list');
+  // },[]);
+
+  return (
+    <PageContainer>
+      <ProTable
+        columns={columns}
+        request={getList}
+        actionRef={actionRef}
+        rowKey="id"
+        toolBarRender={() => [
+          <Button
+            key="button"
+            icon={<PlusOutlined />}
+            type="primary"
+            onClick={() => {
+              handleModalVisible(true);
+            }}
+          >
+            新增
+          </Button>
+        ]}
+
+        pagination={{
+          pageSize: 10,
+        }}
+        search={{
+          defaultCollapsed: false,
+          labelWidth: 'auto',
+        }}
+
+      />
+
+      <ModalForm
+        title="新增全院其他收支设置"
+        width="800px"
+        labelCol={{ span: 5, offset: 3 }}
+        layout={'horizontal'}
+        formRef={ref}
+        visible={createModalVisible}
+        onVisibleChange={(bool) => {
+          if (ref.current) {
+            ref.current.resetFields();
+          }
+          handleModalVisible(bool);
+        }}
+        onFinish={async (value) => {
+          
+          const resp = await addWholeHospCostList(value);
+          const {status,data} = resp;
+          if (status==200) {
+            handleModalVisible(false);
+            if (actionRef.current) {
+              actionRef.current.reload();
+            }
+          }
+        }}
+      >
+        <ProFormSelect
+          rules={[
+            {
+              required: true,
+              message: '请选择收支类型',
+            },
+          ]}
+          options={[
+            {
+              value: 1,
+              label: '收入',
+            },
+            {
+              value: 2,
+              label: '支出',
+            },
+          ]}
+          width="sm"
+          name="paymentsType"
+          label="选择收支类型"
+        />
+        <ProFormText
+          rules={[
+            {
+              required: true,
+              message: '请填写收支名称',
+            },
+          ]}
+          width="sm"
+          name="paymentsName"
+          label="收支名称"
+        />
+      </ModalForm>
+
+     
+      {/* 更新 */}
+      <UpdateForm
+        onSubmit={async (value) => {
+          // console.log({ '编辑': value });
+          const {id} = currentRow;
+          const success = await editWholeHospCostList({...value,id});
+          if (success) {
+            handleUpdateModalVisible(false);
+            setCurrentRow(undefined);
+
+            if (actionRef.current) {
+              actionRef.current.reload();
+            }
+          }
+        }}
+        onCancel={() => {
+          handleUpdateModalVisible(false);
+          setCurrentRow(undefined);
+        }}
+        updateModalVisible={updateModalVisible}
+        updateModalVisibleChange={updateModalVisibleChange}
+        values={currentRow || {}}
+      />
+    </PageContainer>
+  );
+};
+
+export default WholeHospCostAndIncomeSet;

+ 51 - 0
src/pages/baseSetting/wholeHospCostAndIncomeSet/service.js

@@ -0,0 +1,51 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 08:54:08
+ * @LastEditTime: 2021-08-10 16:34:56
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/src/pages/DepartmentMana/service.js
+ */
+
+import { request } from 'umi';
+
+
+//获取  全院其他收支设置列表
+export async function getWholeHospCostList(params, options) {
+    return request('/api/costAccount/costotherpayments/list', {
+      method: 'GET',
+      params:{...params},
+      ...(options || {}),
+    });
+}
+
+
+//编辑
+export async function editWholeHospCostList(body, options) {
+  return request('/api/costAccount/costotherpayments/update', {
+    method: 'POST',
+    data:{...body},
+    ...(options || {}),
+  });
+}
+
+//新增
+export async function addWholeHospCostList(body, options) {
+  return request('/api/costAccount/costotherpayments/save', {
+    method: 'POST',
+    data:{...body},
+    ...(options || {}),
+  });
+}
+
+//删除医院
+export async function delWholeHospCostList(params, options) {
+  const {id} = params;
+  const ids = [id];
+  return request(`/api/costAccount/costotherpayments/delete`, {
+    method: 'POST',
+    data:ids,
+    ...(options || {}),
+  });
+}
+

+ 66 - 0
src/pages/baseSetting/wholeHospCostAndIncomeSet/updateForm.jsx

@@ -0,0 +1,66 @@
+import React,{useState} from 'react';
+import {
+  ProFormSelect,
+  ProFormText,
+  ModalForm,
+  ProFormDependency
+} from '@ant-design/pro-form';
+
+import { getMainDistrictList } from './service';
+
+
+const UpdateForm = (props) => {
+  const { updateModalVisible, updateModalVisibleChange, values, onSubmit } = props;
+  // console.log({values});
+  return (
+    <>
+      {
+        JSON.stringify(values) !== '{}' && <ModalForm
+          title="编辑全院其他收支设置"
+          width="800px"
+          initialValues={{ ...values }}
+          labelCol={{ span: 5, offset: 3 }}
+          layout={'horizontal'}
+          visible={updateModalVisible}
+          onVisibleChange={(visible) => updateModalVisibleChange(visible)}
+          onFinish={(value) => onSubmit({ ...values, ...value})}
+        >
+            <ProFormSelect
+          rules={[
+            {
+              required: true,
+              message: '请选择收支类型',
+            },
+          ]}
+          options={[
+            {
+              value: 1,
+              label: '收入',
+            },
+            {
+              value: 2,
+              label: '支出',
+            },
+          ]}
+          width="sm"
+          name="paymentsType"
+          label="选择收支类型"
+        />
+        <ProFormText
+          rules={[
+            {
+              required: true,
+              message: '请填写收支名称',
+            },
+          ]}
+          width="sm"
+          name="paymentsName"
+          label="收支名称"
+        />
+        </ModalForm>
+      }
+    </>
+  );
+};
+
+export default UpdateForm;

+ 107 - 0
src/pages/costAccounting/afterCollectionSearch/components/DrawerContent.jsx

@@ -0,0 +1,107 @@
+
+
+
+
+import React,{useState,useEffect,useRef} from 'react'
+// import { PageContainer } from '@ant-design/pro-layout';
+import ProTable from '@ant-design/pro-table';
+import {Table } from 'antd';
+import { DrawerForm } from '@ant-design/pro-form';
+import { PageContainer } from '@ant-design/pro-layout';
+
+
+
+
+
+
+export default function DrawerContent(props) {
+
+    const { 
+        visible=false,
+        onVisibleChange=()=>{},
+        currentRow={},
+        renderListFunc=()=>{},
+        onFinishFunc=()=>{console.log('init onFinishFunc')},
+        columns=[],
+        defaultSelected=[],
+        config={},
+        title,
+        type,
+        tabList,
+        onTabChange,
+        renderCell,
+        tabActiveKey,
+        expandable
+    } = props;
+    
+    const {rowKeys='id',tableSearch=false,} = config;
+    const drawerRef = useRef();
+    const drawerTableRef = useRef();
+    const [selectedKeys,setSelectedKeys] = useState([]);
+    const [defaultSelectedKeys,setDefaultSelectedKeys] = useState([]);
+    const [ifSearch,setIfSearch] = useState(false);
+    const [selectedRows,setSelectedRows] = useState([]);
+
+    const renderDefault = ()=>{
+        // console.log({defaultSelected});
+        const defaultSelects = defaultSelected;
+        setDefaultSelectedKeys(defaultSelected);
+        setSelectedKeys(defaultSelects);
+    }
+
+
+    useEffect(()=>{
+        // console.log({tabActiveKey});
+        renderDefault();
+    },[props]);
+
+
+    return visible&&currentRow&&columns.length>0 ? (
+        <>
+            <DrawerForm
+                title={title}
+                visible={visible}
+                width={'90%'}
+                onVisibleChange={onVisibleChange}
+                formRef={drawerRef}
+                drawerProps={{
+                    forceRender: true,
+                    destroyOnClose: true,
+                    footer:null
+                }}
+
+                onFinish={async (values) => {
+                      onFinishFunc(values,defaultSelectedKeys,selectedRows);
+                }}
+            
+            >
+                <PageContainer  
+                    header={{
+                         title:'',
+                         breadcrumb:''
+                    }}
+                    tabActiveKey={tabActiveKey}
+                    tabList={tabList}
+                    onTabChange={(key)=>onTabChange(key,drawerTableRef)}
+                >
+                <ProTable
+                    columns={columns}
+                    rowKey={rowKeys}
+                    tableClassName="drawerContent"
+                    request={renderListFunc}
+                    search={tableSearch}
+                    actionRef={drawerTableRef}
+                    pagination={false}
+                    onSubmit={(u)=>{
+                        //  console.log({u});
+                        setIfSearch(true);
+                    }}
+                    onReset={()=>{setIfSearch(false);}}
+                    expandable={expandable}
+                    
+                />
+                </PageContainer>
+            </DrawerForm>
+        </>
+    ) : <></>
+}

+ 368 - 0
src/pages/costAccounting/afterCollectionSearch/index.jsx

@@ -0,0 +1,368 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 10:13:13
+ * @LastEditTime: 2021-08-12 13:36:36
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
+ */
+
+// import { PlusOutlined } from '@ant-design/icons';
+import { Cascader, Form, Button, Drawer,Table} from 'antd';
+import React, { useRef, useState, useEffect } from 'react';
+import { PageContainer } from '@ant-design/pro-layout';
+import ProTable from '@ant-design/pro-table';
+import {
+  ProFormDatePicker,
+  ProFormSelect,
+} from '@ant-design/pro-form';
+import { getAfterIncomeCollectionList } from './service';
+import { getResponsibilityCenterList } from '@/pages/responsibilityCenter/service';
+import { getCostProjecttList } from '@/pages/costProjectMana/service';
+import moment from 'moment';
+import 'moment/locale/zh-cn';
+import locale from 'antd/es/date-picker/locale/zh_CN';
+import './index.less';
+
+const AfterCollectionSearch = () => {
+
+  const [currentTime, setCurrentTime] = useState(moment().format('YYYY-MM'));
+  const [selectableResponsibilityList, setSelectableResponsibilityList] = useState([]);
+  // const [selectableCostProjectList, setSelectableCostProjectList] = useState([])
+
+  const columns = [
+    {
+      title: '选择时间',
+      key: 'dateTime',
+      hideInTable: true,
+      dataIndex: 'dateTime',
+      renderFormItem: (item, { type, defaultRender, formItemProps, fieldProps, ...rest }, form) => {
+
+        if (type === 'form') {
+          return null;
+        }
+        return (
+          <Form.Item >
+            <ProFormDatePicker initialValue={currentTime} fieldProps={{ picker: 'month', format: (value) => { return value.format('YYYY-MM') }, locale: locale }} name="dateTime" />
+          </Form.Item>
+        )
+      },
+    },
+    {
+      title: '执行责任中心',
+      key: 'responsibilityCode',
+      hideInTable: true,
+      fieldProps: (form, config) => {
+        console.log({ form, config });
+      },
+      dataIndex: 'responsibilityName',
+      renderFormItem: (item, { type, defaultRender, formItemProps, fieldProps, ...rest }, form) => {
+        // console.log({item,type, defaultRender,formItemProps, fieldProps,rest,form })
+        if (type === 'form') {
+          return null;
+        }
+
+        return (
+          <Form.Item name="responsibilityCode">
+            <Cascader options={selectableResponsibilityList}
+              fieldNames={{
+                label: 'responsibilityName',
+                value: 'responsibilityCode',
+                children: 'child'
+              }}
+              {...fieldProps}
+            />
+          </Form.Item>
+        )
+      },
+    },
+    {
+      title: '成本项目',
+      key: 'accountCode',
+      hideInTable: true,
+      dataIndex: 'accountCode',
+      renderFormItem: (item, { type, defaultRender, formItemProps, fieldProps, ...rest }, form) => {
+        // console.log({item,type, defaultRender,formItemProps, fieldProps,rest,form })
+        if (type === 'form') {
+          return null;
+        }
+
+        return (
+          <Form.Item name="accountCode">
+            <ProFormSelect
+              request={async () => {
+                const resp = await getCostProjecttList({ pageSize: 100 });
+                const { status, data: { list } } = resp;
+                if (status == 200) {
+                  console.log({ resp, list });
+                  const arr = list.map(item => ({
+                    'label': item.productName,
+                    'value': item.productCode
+                  }));
+
+                  return arr;
+                }
+              }}
+              width="md"
+              name="accountCode"
+            />
+          </Form.Item>
+        )
+      },
+    },
+    {
+      title: '年份',
+      dataIndex: 'year',
+      key: 'year',
+      hideInSearch: true,
+    },
+    {
+      title: '月份',
+      dataIndex: 'month',
+      key: 'month',
+      hideInSearch: true,
+    },
+    {
+      title: '科室编码',
+      dataIndex: 'departmentCode',
+      key: 'departmentCode',
+      hideInSearch: true,
+    },
+    {
+      title: '科室名称',
+      dataIndex: 'departmentName',
+      key: 'departmentName',
+      hideInSearch: true,
+    },
+    {
+      title: '责任中心编码',
+      dataIndex: 'responsibilityCode',
+      key: 'responsibilityCode',
+      hideInSearch: true,
+    },
+    {
+      title: '责任中心名',
+      dataIndex: 'responsibilityName',
+      key: 'responsibilityName',
+      hideInSearch: true,
+    },
+    {
+      title: '会计科目编码',
+      dataIndex: 'accountingCode',
+      key: 'accountingCode',
+      hideInSearch: true,
+    },
+    {
+      title: '会计科目名',
+      dataIndex: 'accountingName',
+      key: 'accountingName',
+      hideInSearch: true,
+    },
+    {
+      title: '成本项目编码',
+      dataIndex: 'projectCode',
+      key: 'projectCode',
+      hideInSearch: true,
+    },
+    {
+      title: '成本项目名',
+      dataIndex: 'projectName',
+      key: 'projectName',
+      hideInSearch: true,
+    },
+    {
+      title: '金额',
+      dataIndex: 'amount',
+      key: 'amount',
+      hideInSearch: true,
+    },
+  ];
+
+
+  const drawerTableColumns = [
+    {
+      title: '年份',
+      dataIndex: 'year',
+      key: 'year',
+      hideInSearch: true,
+      width:500,
+      fixed: 'left',
+    },
+    {
+      title: '月份',
+      dataIndex: 'month',
+      key: 'month',
+      width:500,
+      hideInSearch: true,
+    },
+    {
+      title: '科室编码',
+      dataIndex: 'departmentCode',
+      key: 'departmentCode',
+      width:500,
+      hideInSearch: true,
+    },
+    {
+      title: '科室名称',
+      dataIndex: 'departmentName',
+      key: 'departmentName',
+      width:500,
+      hideInSearch: true,
+    },
+    {
+      title: '责任中心编码',
+      dataIndex: 'responsibilityCode',
+      key: 'responsibilityCode',
+      width:500,
+      hideInSearch: true,
+    },
+    {
+      title: '责任中心名',
+      dataIndex: 'responsibilityName',
+      key: 'responsibilityName',
+      width:500,
+      hideInSearch: true,
+    },
+    {
+      title: '会计科目编码',
+      dataIndex: 'accountingCode',
+      key: 'accountingCode',
+      width:500,
+      hideInSearch: true,
+    },
+    {
+      title: '会计科目名',
+      dataIndex: 'accountingName',
+      key: 'accountingName',
+      width:500,
+      hideInSearch: true,
+    },
+    {
+      title: '成本项目编码',
+      dataIndex: 'projectCode',
+      key: 'projectCode',
+      hideInSearch: true,
+      width:500,
+    },
+    {
+      title: '成本项目名',
+      dataIndex: 'projectName',
+      key: 'projectName',
+      hideInSearch: true,
+      width:500,
+    },
+    {
+      title: '金额',
+      dataIndex: 'amount',
+      key: 'amount',
+      fixed: 'right',
+      width:500,
+      hideInSearch: true,
+    },
+  ]
+
+
+  const actionRef = useRef();
+  const [totalCount, setTotalCount] = useState(0);
+  const [drawerVisible, setDrawerVisible] = useState(false);
+
+
+  //获取列表
+  const getList = async (params = {}, sort, filter) => {
+    const { dateTime } = params;
+    // console.log(moment(dateTime).format('YYYY-MM'));
+    const res = await getAfterIncomeCollectionList({ ...params, dateTime: moment(dateTime).format('YYYY-MM') });
+    if (res && res.status) {
+      const { data: { totalAmount } } = res;
+      setTotalCount(totalAmount);
+      return {
+        data: res.data.list,
+        total: res.data.totalCount,
+        success: res.success,
+      };
+    }
+
+  };
+
+  const getDrawerTableList = async () => {
+    const resp = await getAfterIncomeCollectionList();
+    const { status, data } = resp;
+    if (status == 200) {
+      return {
+        data: data.list,
+        success: true,
+      };
+    }
+  }
+
+
+
+
+  useEffect(async () => {
+    const responsibilityList = await getResponsibilityCenterList({ pageSize: 50 });
+    const { data: { list } } = responsibilityList;
+    setSelectableResponsibilityList(list);
+  }, []);
+
+  return (
+    <PageContainer>
+      <ProTable
+        columns={columns}
+        request={getList}
+        actionRef={actionRef}
+        rowKey="id"
+        toolBarRender={() => [
+          <Button type='primary' onClick={() => setDrawerVisible(true)}>报表数据</Button>
+        ]}
+        pagination={{
+          pageSize: 10,
+        }}
+        search={{
+          defaultCollapsed: false,
+          labelWidth: 'auto',
+        }}
+        footer={() => <a>{`合计:${totalCount}`}</a>}
+
+      />
+
+      <Drawer
+        title="报表数据"
+        placement="right"
+        width={'90%'}
+        closable={true}
+        onClose={()=>setDrawerVisible(false)}
+        visible={drawerVisible}
+      >
+        <ProTable
+          columns={drawerTableColumns}
+          request={getList}
+          actionRef={actionRef}
+          rowKey="id"
+          
+          pagination={false}
+          search={false}
+          scroll={{ x: 1500, y: 300 }}
+          summary={() => (
+            <Table.Summary fixed>
+              <Table.Summary.Row className="rowCell">
+              <Table.Summary.Cell className="firstCell" index={0}>合计</Table.Summary.Cell>
+                {
+                  [1,2,3,4,5,6,7,8,9,10].map((item,index)=>{
+                      return (
+                        <Table.Summary.Cell  className={index==9?'ant-table-cell ant-table-cell-fix-right ant-table-cell-fix-right-last':'cell'} index={index}>10000</Table.Summary.Cell>
+                      )
+                  })
+                }
+              </Table.Summary.Row>
+            </Table.Summary>
+          )}
+          // footer={() => <a>{`合计:${totalCount}`}</a>}
+
+        />
+      </Drawer>
+
+    </PageContainer>
+  );
+};
+
+export default AfterCollectionSearch;

+ 13 - 0
src/pages/costAccounting/afterCollectionSearch/index.less

@@ -0,0 +1,13 @@
+
+
+.rowCell {
+    position: relative;
+}
+.firstCell {
+      z-index: 99 !important;
+}
+
+.lastCell {
+     position: sticky;
+     right: 0 !important;
+}

+ 33 - 0
src/pages/costAccounting/afterCollectionSearch/service.js

@@ -0,0 +1,33 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 08:54:08
+ * @LastEditTime: 2021-08-12 10:01:41
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/src/pages/DepartmentMana/service.js
+ */
+
+import { request } from 'umi';
+
+
+//获取  全院其他收支设置列表
+export async function getAfterIncomeCollectionList(params, options) {
+    return request('/api/costAccount/incomeCollection/collectList', {
+      method: 'GET',
+      params:{...params},
+      ...(options || {}),
+    });
+}
+
+
+//导入数据
+export async function addIncomeCostDataImport(body, options) {
+  const {fileFormData} = body;
+  return request('/api/costAccount/excel/importDataByFileType', {
+    method: 'POST',
+    data:fileFormData,
+    ...(options || {}),
+  });
+}
+
+

+ 223 - 0
src/pages/costAccounting/beforeCollectionSearch/index.jsx

@@ -0,0 +1,223 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 10:13:13
+ * @LastEditTime: 2021-08-12 08:53:20
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
+ */
+
+// import { PlusOutlined } from '@ant-design/icons';
+import { Cascader,Form } from 'antd';
+import React, { useRef, useState, useEffect } from 'react';
+import { PageContainer } from '@ant-design/pro-layout';
+import ProTable from '@ant-design/pro-table';
+import {
+  ProFormDatePicker,
+  ProFormSelect,
+} from '@ant-design/pro-form';
+import { getBeforeIncomeCollectionList } from './service';
+import { getResponsibilityCenterList } from '@/pages/responsibilityCenter/service';
+import {getCostProjecttList} from '@/pages/costProjectMana/service';
+import moment from 'moment';
+import 'moment/locale/zh-cn';
+import locale from 'antd/es/date-picker/locale/zh_CN';
+
+const IncomeCostDataImport = () => {
+
+  const [currentTime, setCurrentTime] = useState(moment().format('YYYY-MM'));
+  const [selectableResponsibilityList,setSelectableResponsibilityList] = useState([]);
+  // const [selectableCostProjectList, setSelectableCostProjectList] = useState([])
+
+  const columns = [
+    {
+      title: '选择时间',
+      key: 'dateTime',
+      hideInTable: true,
+      dataIndex: 'dateTime',
+      renderFormItem: (item, {type, defaultRender,formItemProps, fieldProps, ...rest }, form) => {
+       
+        if (type === 'form') {
+          return null;
+        }
+        return (
+          <Form.Item >
+             <ProFormDatePicker initialValue={currentTime} fieldProps={{picker:'month',format:(value)=>{return value.format('YYYY-MM')},locale:locale}}  name="dateTime" />
+          </Form.Item>
+        )
+      },
+    },
+    {
+      title: '执行责任中心',
+      key: 'responsibilityCode',
+      hideInTable: true,
+      fieldProps:(form,config)=>{
+           console.log({form,config});
+      },
+      dataIndex: 'responsibilityName',
+      renderFormItem: (item, { type, defaultRender,formItemProps, fieldProps, ...rest }, form) => {
+        // console.log({item,type, defaultRender,formItemProps, fieldProps,rest,form })
+        if (type === 'form') {
+          return null;
+        }
+
+        return (
+          <Form.Item name="responsibilityCode">
+          <Cascader options={selectableResponsibilityList} 
+          fieldNames={{
+            label:'responsibilityName',
+            value:'responsibilityCode',
+            children:'child'
+          }}
+          {...fieldProps}
+          />
+          </Form.Item>
+        )
+      },
+    },
+    {
+      title: '成本项目',
+      key: 'accountCode',
+      hideInTable: true,
+      dataIndex: 'accountCode',
+      renderFormItem: (item, { type, defaultRender,formItemProps, fieldProps, ...rest }, form) => {
+        // console.log({item,type, defaultRender,formItemProps, fieldProps,rest,form })
+        if (type === 'form') {
+          return null;
+        }
+
+        return (
+          <Form.Item name="accountCode">
+              <ProFormSelect
+                request={async ()=>{
+                     const resp = await getCostProjecttList({pageSize:100});
+                     const {status,data:{list}} = resp;
+                     if(status==200){
+                      console.log({resp,list});
+                          const arr = list.map(item=>({
+                               'label':item.productName,
+                               'value':item.productCode
+                          }));
+                          
+                          return arr;
+                     }
+                }}
+                width="md"
+                name="accountCode"
+              />
+          </Form.Item>
+        )
+      },
+    },
+    {
+      title: '年份',
+      dataIndex: 'dateYear',
+      key: 'dateYear',
+      hideInSearch: true,
+    },
+    {
+      title: '月份',
+      dataIndex: 'dateMonth',
+      key: 'dateMonth',
+      hideInSearch: true,
+    },
+    {
+      title: '开单责任中心',
+      dataIndex: 'openResponsibilityCodeName',
+      key: 'openResponsibilityCodeName',
+      hideInSearch: true,
+    },
+    {
+      title: '执行科室',
+      dataIndex: 'startDepartmentCodeName',
+      key: 'startDepartmentCodeName',
+      hideInSearch: true,
+    },
+    {
+      title: '执行责任中心',
+      dataIndex: 'startResponsibilityCodeName',
+      key: 'startResponsibilityCodeName',
+      hideInSearch: true,
+    },
+    {
+      title: '会计科目',
+      dataIndex: 'accountCodeName',
+      key: 'accountCodeName',
+      hideInSearch: true,
+    },
+    {
+      title: '成本项目',
+      dataIndex: 'productCodeName',
+      key: 'productCodeName',
+      hideInSearch: true,
+    },
+    {
+      title: '金额',
+      dataIndex: 'amount',
+      key: 'amount',
+      hideInSearch: true,
+    },
+    {
+      title: '文件序号',
+      dataIndex: 'fileId',
+      key: 'fileId',
+      hideInSearch: true,
+    },
+  ];
+
+
+  const actionRef = useRef();
+  const [totalCount, setTotalCount] = useState(0)
+
+
+  //获取列表
+  const getList = async (params = {}, sort, filter) => {
+    const {dateTime}  = params;
+    // console.log(moment(dateTime).format('YYYY-MM'));
+    const res = await getBeforeIncomeCollectionList({ ...params,dateTime:moment(dateTime).format('YYYY-MM')});
+    if(res&&res.status){
+      const { data: { totalAmount } } = res;
+      setTotalCount(totalAmount);
+      return {
+        data: res.data.list,
+        total: res.data.totalCount,
+        success: res.success,
+      };
+    }
+    
+  };
+
+
+
+
+  useEffect(async () => {
+       const responsibilityList = await getResponsibilityCenterList({pageSize:50});
+       const {data:{list}} = responsibilityList;
+       setSelectableResponsibilityList(list);
+  }, []);
+
+  return (
+    <PageContainer>
+      <ProTable
+        columns={columns}
+        request={getList}
+        actionRef={actionRef}
+        rowKey="id"
+        toolBarRender={() => [
+        ]}
+
+        pagination={{
+          pageSize: 10,
+        }}
+        search={{
+          defaultCollapsed: false,
+          labelWidth: 'auto',
+        }}
+        footer={() => <a>{`合计:${totalCount}`}</a>}
+
+      />
+    </PageContainer>
+  );
+};
+
+export default IncomeCostDataImport;

+ 33 - 0
src/pages/costAccounting/beforeCollectionSearch/service.js

@@ -0,0 +1,33 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 08:54:08
+ * @LastEditTime: 2021-08-11 11:12:12
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/src/pages/DepartmentMana/service.js
+ */
+
+import { request } from 'umi';
+
+
+//获取  全院其他收支设置列表
+export async function getBeforeIncomeCollectionList(params, options) {
+    return request('/api/costAccount/costincomegroup/list', {
+      method: 'GET',
+      params:{...params},
+      ...(options || {}),
+    });
+}
+
+
+//导入数据
+export async function addIncomeCostDataImport(body, options) {
+  const {fileFormData} = body;
+  return request('/api/costAccount/excel/importDataByFileType', {
+    method: 'POST',
+    data:fileFormData,
+    ...(options || {}),
+  });
+}
+
+

+ 168 - 0
src/pages/costAccounting/incomeCollection/index.jsx

@@ -0,0 +1,168 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 10:13:13
+ * @LastEditTime: 2021-08-11 19:17:42
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
+ */
+
+// import { PlusOutlined } from '@ant-design/icons';
+import {Button,Form } from 'antd';
+import React, { useRef, useState, useEffect } from 'react';
+import { PageContainer } from '@ant-design/pro-layout';
+import ProTable from '@ant-design/pro-table';
+import {
+  ProFormDatePicker,
+} from '@ant-design/pro-form';
+import moment from 'moment';
+import 'moment/locale/zh-cn';
+import locale from 'antd/es/date-picker/locale/zh_CN';
+import { getIncomeCollectionList,cancelIncomeCollection,startIncomeCollection } from './service';
+
+
+const IncomeCollection = () => {
+
+  const [currentTime, setCurrentTime] = useState(moment().format('YYYY-MM'));
+
+  const columns = [
+    {
+      title: '选择时间',
+      key: 'date',
+      hideInTable: true,
+      dataIndex: 'date',
+      
+      renderFormItem: (item, { type, defaultRender, ...rest }, form) => {
+       
+        if (type === 'form') {
+          return null;
+        }
+        return (
+          <Form.Item >
+             <ProFormDatePicker initialValue={currentTime} fieldProps={{format:'YYYY-MM',picker:'month',locale:locale}} name="date" />
+          </Form.Item>
+        )
+      },
+    },
+    
+    {
+      title: '年份',
+      dataIndex: 'year',
+      key: 'year',
+      hideInSearch: true,
+    },
+    {
+      title: '月份',
+      dataIndex: 'month',
+      key: 'month',
+      hideInSearch: true,
+    },
+    {
+      title: '金额',
+      dataIndex: 'amount',
+      key: 'amount',
+      hideInSearch: true,
+    },
+    {
+      title:'操作',
+      dataIndex: 'option',
+      valueType: 'option',
+      key: 'option',
+      width: '15%',
+      render: (_, record) =>{
+          const {isCollection} = record;
+
+          return [
+            <Button
+              key="config"
+              size='small'
+              type={isCollection?'default':'primary'}
+              onClick={() => {
+                setCurrentRow(record);
+                optionBtnGroupshandle(isCollection,record);
+              }}
+            >
+                <span style={{fontSize:12}}>{isCollection?'撤销归集':'开始归集'}</span>
+            </Button>
+          ]
+      },
+    },
+  ];
+
+
+  const actionRef = useRef();
+  const [currentRow,setCurrentRow] = useState(null);
+
+
+  //获取列表
+  const getList = async (params = {}, sort, filter) => {
+    const {date} = params;
+    const res = await getIncomeCollectionList({ ...params,date:date?moment(date).format('YYYYMM'):''});
+    if(res&&res.status){
+      return {
+        data: res.data.list,
+        total: res.data.totalCount,
+        success: res.success,
+      };
+    }
+    
+  };
+
+  /**
+   * 
+   * @param {Boolen} isCollection  
+   */
+  const optionBtnGroupshandle = async (isCollection,record)=>{
+    console.log({record});
+    const {year,month} = record;
+      if(isCollection){
+           const resp = await cancelIncomeCollection({year,month});
+           const {status} = resp;
+           if(status==200){
+                if(actionRef.current){
+                  actionRef.current.reload();
+                }
+           }
+      }else{
+           const resp = await startIncomeCollection({year,month});
+           const {status} = resp;
+           if(status==200){
+                if(actionRef.current){
+                  actionRef.current.reload();
+                }
+           }
+      }
+
+  }
+
+
+
+
+  useEffect(async () => {
+   
+  }, []);
+
+  return (
+    <PageContainer>
+      <ProTable
+        columns={columns}
+        request={getList}
+        actionRef={actionRef}
+        rowKey="id"
+        toolBarRender={() => [
+        ]}
+
+        pagination={{
+          pageSize: 10,
+        }}
+        search={{
+          defaultCollapsed: false,
+          labelWidth: 'auto',
+        }}
+
+      />
+    </PageContainer>
+  );
+};
+
+export default IncomeCollection;

+ 44 - 0
src/pages/costAccounting/incomeCollection/service.js

@@ -0,0 +1,44 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 08:54:08
+ * @LastEditTime: 2021-08-11 19:21:15
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/src/pages/DepartmentMana/service.js
+ */
+
+import { request } from 'umi';
+
+
+//获取收入归集列表
+export async function getIncomeCollectionList(params, options) {
+    return request('/api/costAccount/incomeCollection/getCollections', {
+      method: 'GET',
+      params:{...params},
+      ...(options || {}),
+    });
+}
+
+
+//开始归集
+export async function startIncomeCollection(params, options) {
+  const {year,month} = params;
+  return request('/api/costAccount/incomeCollection/collect', {
+    method: 'POST',
+    params:{year,month},
+    ...(options || {}),
+  });
+}
+
+
+//撤销归集
+export async function cancelIncomeCollection(body, options) {
+  const {year,month} = body;
+  return request('/api/costAccount/incomeCollection/cancelCollect', {
+    method: 'POST',
+    params:{year,month},
+    ...(options || {}),
+  });
+}
+
+

+ 43 - 19
src/pages/platformMana/menuManage/component/drawer.jsx → src/pages/costAccounting/incomeCostDataImport/components/DrawerContent.jsx

@@ -1,10 +1,13 @@
 
 
+
+
 import React,{useState,useEffect,useRef} from 'react'
-import { PageContainer } from '@ant-design/pro-layout';
+// import { PageContainer } from '@ant-design/pro-layout';
 import ProTable from '@ant-design/pro-table';
 import {Table } from 'antd';
 import { DrawerForm } from '@ant-design/pro-form';
+import { PageContainer } from '@ant-design/pro-layout';
 
 
 
@@ -21,29 +24,42 @@ export default function DrawerContent(props) {
         onFinishFunc=()=>{console.log('init onFinishFunc')},
         columns=[],
         defaultSelected=[],
-        config={}
+        config={},
+        title,
+        type,
+        tabList,
+        onTabChange,
+        renderCell,
+        tabActiveKey,
+        expandable
     } = props;
     
     const {rowKeys='id',tableSearch=false,} = config;
     const drawerRef = useRef();
+    const drawerTableRef = useRef();
     const [selectedKeys,setSelectedKeys] = useState([]);
+    const [defaultSelectedKeys,setDefaultSelectedKeys] = useState([]);
+    const [ifSearch,setIfSearch] = useState(false);
+    const [selectedRows,setSelectedRows] = useState([]);
 
     const renderDefault = ()=>{
+        // console.log({defaultSelected});
         const defaultSelects = defaultSelected;
+        setDefaultSelectedKeys(defaultSelected);
         setSelectedKeys(defaultSelects);
     }
 
 
     useEffect(()=>{
+        // console.log({tabActiveKey});
         renderDefault();
-    },[currentRow,defaultSelected])
-
+    },[props]);
 
 
     return visible&&currentRow&&columns.length>0 ? (
-        <PageContainer className="DrawerContent">
+        <>
             <DrawerForm
-                title="绑定用户"
+                title={title}
                 visible={visible}
                 onVisibleChange={onVisibleChange}
                 formRef={drawerRef}
@@ -51,31 +67,39 @@ export default function DrawerContent(props) {
                     forceRender: true,
                     destroyOnClose: true,
                 }}
+
                 onFinish={async (values) => {
-                    //   console.log({onFinishFunc,values});
-                      onFinishFunc(values,selectedKeys);
+                      onFinishFunc(values,defaultSelectedKeys,selectedRows);
                 }}
             
             >
-            
+                <PageContainer  
+                    header={{
+                         title:'',
+                         breadcrumb:''
+                    }}
+                    tabActiveKey={tabActiveKey}
+                    tabList={tabList}
+                    onTabChange={(key)=>onTabChange(key,drawerTableRef)}
+                >
                 <ProTable
                     columns={columns}
                     rowKey={rowKeys}
                     tableClassName="drawerContent"
                     request={renderListFunc}
                     search={tableSearch}
-                    rowSelection={{
-                        // 自定义选择项参考: https://ant.design/components/table-cn/#components-table-demo-row-selection-custom
-                        // 注释该行则默认不显示下拉选项
-                        selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT],
-                        selectedRowKeys:selectedKeys,
-                        onChange:(selectedRowKeys, selectedRows)=>{
-                            setSelectedKeys(selectedRowKeys);
-                        }
+                    actionRef={drawerTableRef}
+                    pagination={false}
+                    onSubmit={(u)=>{
+                        //  console.log({u});
+                        setIfSearch(true);
                     }}
+                    onReset={()=>{setIfSearch(false);}}
+                    expandable={expandable}
+                    
                 />
-            
+                </PageContainer>
             </DrawerForm>
-        </PageContainer>
+        </>
     ) : <></>
 }

+ 409 - 0
src/pages/costAccounting/incomeCostDataImport/index.jsx

@@ -0,0 +1,409 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 10:13:13
+ * @LastEditTime: 2021-08-12 09:54:26
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
+ */
+
+// import { PlusOutlined } from '@ant-design/icons';
+import { Button} from 'antd';
+import React, { useState, useRef } from 'react';
+import { PageContainer } from '@ant-design/pro-layout';
+import ProTable from '@ant-design/pro-table';
+import ProForm,{ ModalForm, ProFormText, ProFormSelect,ProFormDatePicker} from '@ant-design/pro-form';
+import UpdateForm from './updateForm';
+import DrawerContent from './components/DrawerContent';
+import CAUpload from '@/components/CAUpload/index';
+import { getIncomeCostDataImport,addIncomeCostDataImport,cancelIncomeCostDataImport,getIncomeCostDataImportErrList } from './service';
+
+
+const IncomeCostDataImport = () => {
+  const columns = [
+    {
+      title: '文件编号',
+      dataIndex: 'id',
+      key: 'id',
+      hideInSearch: true,
+    },
+    {
+      title: '导入类型',
+      dataIndex: 'fileType',
+      key: 'fileType',
+      hideInSearch: true,
+    },
+    {
+      title: '文件名称',
+      dataIndex: 'fileName',
+      key: 'fileName',
+    },
+    {
+      title: '导入时间',
+      dataIndex: 'dateTime',
+      key: 'dateTime',
+      hideInSearch: true,
+    },
+    {
+      title: '总数',
+      dataIndex: 'totalAmount',
+      key: 'totalAmount',
+      hideInSearch: true,
+    },
+    {
+      title: '导入数',
+      dataIndex: 'successAmount',
+      key: 'successAmount',
+      hideInSearch: true,
+    },
+    {
+      title: '导入人员',
+      dataIndex: 'userName',
+      key: 'userName',
+      hideInSearch: true,
+    },
+    {
+      title: '下载',
+      dataIndex: 'fileUrl',
+      key: 'fileUrl',
+      hideInSearch: true,
+      render: url =>{
+          const userData = localStorage.getItem('userData');
+          const {token} = JSON.parse(userData);
+           return <a href={`${url}?token=${token}`} target="_blank">下载</a>
+      } 
+    },
+    {
+      title: '操作',
+      dataIndex: 'option',
+      valueType: 'option',
+      render: (_, record) =>{
+          const {errStatus} = record;
+          setCurrentRow(record);
+          return [
+            <Button
+              key="config"
+              onClick={() => {
+                optionBtnGrouphandle(errStatus)
+              }}
+            >
+              {errStatus==1?'错误详情':'撤销导入'}
+            </Button>
+          ]
+      }
+    },
+  ];
+
+
+  const drawerTableColumns = [
+     {
+      title: '行数',
+      dataIndex: 'total',
+      key: 'total',
+      width:'10%',
+      hideInSearch: true,
+     },
+     {
+      title: '错误信息',
+      dataIndex: 'errMessage',
+      key: 'errMessage',
+      hideInSearch: true,
+     }
+  ]
+
+
+
+  const [createModalVisible, handleModalVisible] = useState(false);
+  const [updateModalVisible, handleUpdateModalVisible] = useState(false);
+  const actionRef = useRef();
+  const ref = useRef();   //新增表单
+  const importFormRef = useRef();   //导入表单
+  const [currentRow, setCurrentRow] = useState({});
+  const [drawerVisible,setDrawerVisible] = useState(false);
+  const [formData,setFormData] = useState(null);
+
+
+  
+  /**
+   * 
+   * @param {Number} errStatus  
+   */
+  const optionBtnGrouphandle = async (errStatus)=>{
+        if(errStatus != 1){
+             const {id} = currentRow;
+             const resp = await cancelIncomeCostDataImport({id});
+             const {status} = resp;
+             if(status==200){
+              if (actionRef.current) {
+                actionRef.current.reload();
+              }
+             }
+        }else{
+          setDrawerVisible(true);
+        }
+  }
+ 
+
+  /**
+   *
+   * @param {Boolean} bool 弹窗展示状态
+   */
+  const updateModalVisibleChange = (bool) => {
+    handleUpdateModalVisible(bool);
+    if (!bool) setCurrentRow(undefined);
+  };
+
+  //获取列表
+  const getList = async (params = {}, sort, filter) => {
+    const res = await getIncomeCostDataImport(params);
+    // console.log({res});
+    return {
+      data: res.data.list,
+      total: res.data.totalCount,
+      success: res.success,
+    };
+  };
+
+
+
+  //自定义上传回调
+  const customRequestCallback = (file)=>{
+    console.log({file});
+    const formData = new FormData();
+    formData.set('file',file);
+    setFormData(formData);
+    if(importFormRef.current){
+      importFormRef.current.setFieldsValue({
+          'formData':formData
+      });
+      importFormRef?.current?.submit();
+    }
+    
+
+  }
+
+  const ModalContent = ()=>{
+
+    return (
+      <ProForm
+        formRef={importFormRef}
+        layout={{
+          labelCol: { span: 4 },
+          wrapperCol: { span: 14 },
+        }}
+        onFinish={async (values)=>{
+              const formData = importFormRef.current.getFieldValue('formData');
+              const {fileType,dateTime} = values;
+              formData.set('fileType',fileType);
+              formData.set('dateTime',dateTime);
+              
+              const resp = await addIncomeCostDataImport({formData},{
+                'content-type':'multipart/form-data',
+              })
+              const {status} = resp;
+  
+              if(status==200){
+                if (actionRef.current) {
+                  actionRef.current.reload();
+                }
+              }
+        }}
+        submitter={{
+          render:false
+        }}
+      >
+        <ProFormDatePicker
+          rules={[
+            {
+              required: true,
+              message:'请选择数据年月',
+            },
+          ]}
+          width="sm"
+          name="dateTime"
+          fieldProps={{
+            format: 'YYYY-MM-DD',
+          }}
+          label="数据所属年月"
+        />
+        <ProFormSelect
+            rules={[
+              {
+                required: true,
+                message:'请选择数据类型',
+              },
+            ]}
+            options={[
+              {
+                value: 1,
+                label: '成本分摊参数值',
+              },
+              {
+                value: 2,
+                label: '收入数据',
+              },
+              {
+                value: 3,
+                label: '成本数据',
+              },
+            ]}
+            width="sm"
+            name="fileType"
+            label="选择数据类型"
+          />
+      </ProForm>
+    )
+  }
+  
+
+  const getDrawerTableList = async ()=>{
+        const {id} = currentRow;
+        const resp = await getIncomeCostDataImportErrList({id});
+        const {status,data} = resp;
+        if(status==200){
+          return {
+            data: data,
+            success:true,
+          };  
+        }
+  }
+
+  
+
+  // useEffect(()=>{
+  //   CARequest('/api/costAccount/hosptail/list');
+  // },[]);
+
+  return (
+    <PageContainer>
+      <ProTable
+        columns={columns}
+        request={getList}
+        actionRef={actionRef}
+        rowKey="id"
+        toolBarRender={() => [
+          <CAUpload
+            templateHref={'/costAccount/excel/getImportIncomeProductAccountTemplate'}
+            url='/costAccount/excel/importDataByFileType'
+            importSuccessCallback={() => { }}
+            type='dialog'
+            content={<ModalContent />}
+          // token={'123'}
+            customRequestCallback={customRequestCallback}
+          />
+        ]}
+
+        pagination={{
+          pageSize: 10,
+        }}
+        search={{
+          defaultCollapsed: false,
+          labelWidth: 'auto',
+        }}
+
+      />
+
+      <ModalForm
+        title="新增全院其他收支设置"
+        width="800px"
+        labelCol={{ span: 5, offset: 3 }}
+        layout={'horizontal'}
+        formRef={ref}
+        visible={createModalVisible}
+        onVisibleChange={(bool) => {
+          if (ref.current) {
+            ref.current.resetFields();
+          }
+          handleModalVisible(bool);
+        }}
+        onFinish={async (value) => {
+          const { name, isHospital, id, sign } = value;
+          const success = await addDistrict(isHospital == 0 ? {
+            name, isHospital, sign
+          } : {
+            name, isHospital, parentId: id
+          });
+          //   console.log({ success });
+          if (success) {
+            handleModalVisible(false);
+
+            if (actionRef.current) {
+              actionRef.current.reload();
+            }
+          }
+        }}
+      >
+        <ProFormSelect
+          rules={[
+            {
+              required: true,
+              message: '请选择收支类型',
+            },
+          ]}
+          options={[
+            {
+              value: 1,
+              label: '收入',
+            },
+            {
+              value: 2,
+              label: '支出',
+            },
+          ]}
+          width="sm"
+          name="paymentsType"
+          label="选择收支类型"
+        />
+        <ProFormText
+          rules={[
+            {
+              required: true,
+              message: '请填写收支名称',
+            },
+          ]}
+          width="sm"
+          name="paymentsName"
+          label="收支名称"
+        />
+      </ModalForm>
+
+
+      <DrawerContent
+          columns={drawerTableColumns}
+          visible={drawerVisible}
+          title="错误详情"
+          onVisibleChange={(bool) => setDrawerVisible(bool)}
+          renderListFunc={getDrawerTableList}
+          onFinishFunc={async (value, selectedRowKeys, selectedRows) => {
+          
+          }}
+      />
+
+
+      {/* 更新 */}
+      <UpdateForm
+        onSubmit={async (value) => {
+          // console.log({ '编辑': value });
+          const success = await editDistrictList(value);
+          if (success) {
+            handleUpdateModalVisible(false);
+            setCurrentRow(undefined);
+
+            if (actionRef.current) {
+              actionRef.current.reload();
+            }
+          }
+        }}
+        onCancel={() => {
+          handleUpdateModalVisible(false);
+          setCurrentRow(undefined);
+        }}
+        updateModalVisible={updateModalVisible}
+        updateModalVisibleChange={updateModalVisibleChange}
+        values={currentRow || {}}
+      />
+    </PageContainer>
+  );
+};
+
+export default IncomeCostDataImport;

+ 54 - 0
src/pages/costAccounting/incomeCostDataImport/service.js

@@ -0,0 +1,54 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 08:54:08
+ * @LastEditTime: 2021-08-11 18:58:01
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/src/pages/DepartmentMana/service.js
+ */
+
+import { request } from 'umi';
+
+
+//获取收入成本数据设置列表
+export async function getIncomeCostDataImport(params, options) {
+    return request('/api/costAccount/costincomefile/list', {
+      method: 'GET',
+      params:{...params},
+      ...(options || {}),
+    });
+}
+
+
+//获取导入错误详情列表
+export async function getIncomeCostDataImportErrList(params, options) {
+  
+  return request('/api/costAccount/costincomefile/getErrorList', {
+    method: 'GET',
+    params:{...params},
+    ...(options || {}),
+  });
+}
+
+
+//导入数据
+export async function addIncomeCostDataImport(body, options) {
+  const {fileFormData} = body;
+  return request('/api/costAccount/excel/importDataByFileType', {
+    method: 'POST',
+    data:fileFormData,
+    ...(options || {}),
+  });
+}
+
+//撤销导入
+export async function cancelIncomeCostDataImport(body, options) {
+  const {id} = body;
+  return request('/api/costAccount/costincomefile/deleteImport', {
+    method: 'POST',
+    params:{id},
+    ...(options || {}),
+  });
+}
+
+

+ 121 - 0
src/pages/costAccounting/incomeCostDataImport/updateForm.jsx

@@ -0,0 +1,121 @@
+import React,{useState} from 'react';
+import {
+  ProFormSelect,
+  ProFormText,
+  ModalForm,
+  ProFormDependency
+} from '@ant-design/pro-form';
+
+import { getMainDistrictList } from './service';
+
+
+const UpdateForm = (props) => {
+  const { updateModalVisible, updateModalVisibleChange, values, onSubmit } = props;
+  const [selectedHosp,setSelectedHosp] = useState({});
+  // console.log({values});
+  return (
+    <>
+      {
+        JSON.stringify(values) !== '{}' && <ModalForm
+          title="编辑医院"
+          width="800px"
+          initialValues={{ ...values }}
+          labelCol={{ span: 3, offset: 3 }}
+          layout={'horizontal'}
+          visible={updateModalVisible}
+          onVisibleChange={(visible) => updateModalVisibleChange(visible)}
+          onFinish={(value) => onSubmit({ ...values, ...value,parentName:selectedHosp.name})}
+        >
+          <ProFormText
+            label="医院名"
+            rules={[
+              {
+                required: true,
+                message:'医院名是必填项',
+              },
+            ]}
+            width="sm"
+            name="name"
+          />
+          <ProFormSelect
+            // initialValue={parseInt(values.isHospital)}
+            rules={[
+              {
+                required: true,
+                message:'请选择是否为主院',
+              },
+            ]}
+            options={[
+              {
+                value: 0,
+                label: '是',
+              },
+              {
+                value: 1,
+                label: '否',
+              },
+            ]}
+            width="xs"
+            name="isHospital"
+            label="是否为主院"
+          />
+
+          <ProFormDependency name={['isHospital']}>
+            {({ isHospital }) => {
+              return isHospital == 0 ? (
+                <ProFormText
+                  label="医院标识"
+                  rules={[
+                    {
+                      required: false,
+                      message:'',
+                    },
+                  ]}
+                  width="sm"
+                  name="sign"
+                />
+              ) : <></>;
+            }}
+          </ProFormDependency>
+          <ProFormDependency name={['isHospital']}>
+          {({ isHospital }) => {
+            return isHospital == 1 ? (
+              <ProFormSelect
+                name="parentId"
+                label="选择主医院"
+                request={async () =>{
+                      const resp = await getMainDistrictList();
+                      const {status,data,} = resp;
+                      
+                      if(status == 200){
+                        return data.map(item=>({
+                          label:item.name,
+                          value:item.id
+                        }))
+                      }
+                }}
+                fieldProps={{
+                  onChange: async (val) => {
+                    const resp = await getMainDistrictList();
+                    const {status,data,} = resp;
+                    if(status==200){
+                        const needItem = data.filter(item => item.id == val);
+                        needItem.length>0&&setSelectedHosp(needItem[0]);
+                    }
+                    
+                  },
+                }}
+                placeholder="请选择主医院"
+                width='sm'
+                rules={[{ required: true, message: '请选择主医院' }]}
+              />
+            ) : <></>
+          }}
+        </ProFormDependency>
+        </ModalForm>
+      }
+    </>
+  );
+};
+
+export default UpdateForm;

+ 2 - 1
src/pages/costAllocationParamsSetting/index.jsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 10:13:13
- * @LastEditTime: 2021-08-03 17:17:27
+ * @LastEditTime: 2021-08-09 16:16:36
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
@@ -330,6 +330,7 @@ const DepartmentMana = () => {
           rowSelection={{
             // 自定义选择项参考: https://ant.design/components/table-cn/#components-table-demo-row-selection-custom
             // 注释该行则默认不显示下拉选项
+            checkStrictly:false,
             selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT],
             selectedRowKeys:selectedRowKeys,
             onChange:(selectedRowKeys, selectedRows)=>{

+ 2 - 1
src/pages/costProjectMana/index.jsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 10:13:13
- * @LastEditTime: 2021-08-03 17:22:00
+ * @LastEditTime: 2021-08-11 16:07:08
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
@@ -28,6 +28,7 @@ const DepartmentMana = () => {
       title: 'Id',
       dataIndex: 'id',
       key: 'id',
+      hideInTable: true,
       hideInSearch: true,
     },
     {

+ 25 - 18
src/pages/platformMana/menuManage/index.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 10:13:13
- * @LastEditTime: 2021-08-03 17:30:43
+ * @LastEditTime: 2021-08-06 17:37:47
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
@@ -13,28 +13,29 @@ import React, { useState, useRef } from 'react';
 
 import { PageContainer } from '@ant-design/pro-layout';
 import ProTable from '@ant-design/pro-table';
-import { ModalForm, ProFormText, ProFormSelect } from '@ant-design/pro-form';
+import { ModalForm, ProFormText, ProFormSelect,ProFormDigit } from '@ant-design/pro-form';
 import UpdateForm from './updateForm';
 import {addList, editList, delList } from './service';
 import { getMenuList } from '@/pages/platformMana/menuManage/service';
 
 const UserMana = () => {
   const columns = [
+    {
+      title: '菜单名称',
+      dataIndex: 'name',
+      key: 'name',
+    },
     {
       title: '菜单Id',
       dataIndex: 'menuId',
       key: 'menuId',
       hideInSearch: true,
     },
-    {
-      title: '菜单名称',
-      dataIndex: 'name',
-      key: 'name',
-    },
     {
       title: 'URL',
       dataIndex: 'url',
       key: 'url',
+      hideInSearch: true,
     },
     {
       title: 'Path',
@@ -53,6 +54,7 @@ const UserMana = () => {
       dataIndex: 'modifyTime',
       key: 'modifyTime',
       valueType: 'date',
+      hideInSearch: true,
     },
     {
       title: '操作',
@@ -123,7 +125,7 @@ const UserMana = () => {
    * @param {Object} value 删除项数据
    */
   const delUserHandler = async (value) => {
-    const ids = [value.roleId];
+    const ids = [value.menuId];
     const resp = await delList({ ids });
     if (resp.status == 200) {
       if (actionRef.current) {
@@ -169,8 +171,10 @@ const UserMana = () => {
         visible={createModalVisible}
         onVisibleChange={handleModalVisible}
         onFinish={async (value) => {
-          const { parentId } = currentRow;
-          const resp = await addList({ ...value, parentId: ifAddZeroLevelMenu ? 0 : parentId });
+        
+          let id=0;
+          currentRow&&(id=currentRow.menuId);
+          const resp = await addList({ ...value, parentId:id });
           const { status } = resp;
           if (status == 200) {
       
@@ -192,6 +196,7 @@ const UserMana = () => {
           ]}
           width="sm"
           name="name"
+          placeholder="请输入菜单"
         />
         <ProFormText
           label="Path"
@@ -204,7 +209,7 @@ const UserMana = () => {
           width="sm"
           name="path"
         />
-        <ProFormText
+        {/* <ProFormText
           label="权限字段"
           rules={[
             {
@@ -214,7 +219,8 @@ const UserMana = () => {
           ]}
           width="sm"
           name="perms"
-        />
+          placeholder="请输入"
+        /> */}
         <ProFormSelect
           name="type"
           label="类型"
@@ -232,7 +238,7 @@ const UserMana = () => {
           placeholder="请选择类型"
           rules={[{ required: true, message: '请选择类型!' }]}
         />
-        <ProFormText
+        {/* <ProFormText
           label="菜单Icon"
           rules={[
             {
@@ -241,8 +247,8 @@ const UserMana = () => {
           ]}
           width="sm"
           name="icon"
-        />
-        <ProFormText
+        /> */}
+        <ProFormDigit
           label="菜单排序"
           rules={[
             {
@@ -251,22 +257,23 @@ const UserMana = () => {
           ]}
           width="sm"
           name="orderNum"
+          placeholder="请选择菜单序号"
         />
       </ModalForm>
 
       {/* 更新 */}
       <UpdateForm
         onSubmit={async (value) => {
-          const {menuId} = currentRow;
+          const {menuId,parentId=0} = currentRow;
+          // console.log({currentRow});
           // console.log({'编辑':value});
           const {
-            parentId,
             name,
             path,
             url,
             perms,
             type,
-            icon,
+            icon='ww',
             orderNum
           } = value;
 

+ 2 - 2
src/pages/platformMana/menuManage/service.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-08-03 14:38:54
- * @LastEditTime: 2021-08-03 16:34:48
+ * @LastEditTime: 2021-08-05 17:38:01
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /CostAccountManaSys/src/pages/platformMana/menuManage/service.js
@@ -41,7 +41,7 @@ export async function editList(body, options) {
 //删除角色
 export async function delList(params, options) {
   const {ids} = params;
-  return request(`/api/costAccount/role/delete`, {
+  return request(`/api/costAccount/menu/delete`, {
     data:ids,
     method: 'POST',
     ...(options || {}),

+ 7 - 6
src/pages/platformMana/menuManage/updateForm.jsx

@@ -2,7 +2,8 @@ import React from 'react';
 import {
   ProFormText,
   ModalForm,
-  ProFormSelect
+  ProFormSelect,
+  ProFormDigit
 } from '@ant-design/pro-form';
 
 
@@ -44,7 +45,7 @@ const UpdateForm = (props) => {
             width="sm"
             name="path"
           />
-          <ProFormText
+          {/* <ProFormText
             label="权限字段"
             rules={[
               {
@@ -54,7 +55,7 @@ const UpdateForm = (props) => {
             ]}
             width="sm"
             name="perms"
-          />
+          /> */}
           <ProFormSelect
             name="type"
             label="类型"
@@ -72,7 +73,7 @@ const UpdateForm = (props) => {
             placeholder="请选择类型"
             rules={[{ required: true, message: '请选择类型!' }]}
           />
-          <ProFormText
+          {/* <ProFormText
             label="菜单Icon"
             rules={[
               {
@@ -81,8 +82,8 @@ const UpdateForm = (props) => {
             ]}
             width="sm"
             name="icon"
-          />
-          <ProFormText
+          /> */}
+          <ProFormDigit
             label="菜单排序"
             rules={[
               {

+ 33 - 5
src/pages/platformMana/roleManage/component/drawer.jsx

@@ -21,15 +21,20 @@ export default function DrawerContent(props) {
         onFinishFunc=()=>{console.log('init onFinishFunc')},
         columns=[],
         defaultSelected=[],
-        config={}
+        config={},
+        title
     } = props;
     
     const {rowKeys='id',tableSearch=false,} = config;
     const drawerRef = useRef();
     const [selectedKeys,setSelectedKeys] = useState([]);
+    const [defaultSelectedKeys,setDefaultSelectedKeys] = useState([]);
+    const [ifSearch,setIfSearch] = useState(false);
+    const [underSearchlist,setUnderSearchlist] = useState([]);
 
     const renderDefault = ()=>{
         const defaultSelects = defaultSelected;
+        setDefaultSelectedKeys(defaultSelected);
         setSelectedKeys(defaultSelects);
     }
 
@@ -41,9 +46,9 @@ export default function DrawerContent(props) {
 
 
     return visible&&currentRow&&columns.length>0 ? (
-        <PageContainer className="DrawerContent">
+        <>
             <DrawerForm
-                title="绑定用户"
+                title={title}
                 visible={visible}
                 onVisibleChange={onVisibleChange}
                 formRef={drawerRef}
@@ -53,7 +58,7 @@ export default function DrawerContent(props) {
                 }}
                 onFinish={async (values) => {
                     //   console.log({onFinishFunc,values});
-                      onFinishFunc(values,selectedKeys);
+                      onFinishFunc(values,defaultSelectedKeys);
                 }}
             
             >
@@ -64,18 +69,41 @@ export default function DrawerContent(props) {
                     tableClassName="drawerContent"
                     request={renderListFunc}
                     search={tableSearch}
+                    onSubmit={(u)=>{
+                        //  console.log({u});
+                        setIfSearch(true);
+                    }}
+                    onReset={()=>{setIfSearch(false);}}
                     rowSelection={{
                         // 自定义选择项参考: https://ant.design/components/table-cn/#components-table-demo-row-selection-custom
                         // 注释该行则默认不显示下拉选项
                         selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT],
+                        checkStrictly:false,
                         selectedRowKeys:selectedKeys,
                         onChange:(selectedRowKeys, selectedRows)=>{
                             setSelectedKeys(selectedRowKeys);
+                        },
+                        onSelect:(record, selected, selectedRows, nativeEvent)=>{
+                            // console.log({record, selected, selectedRows, nativeEvent,ifSearch});
+                            const _defaultSelectedKeys = defaultSelectedKeys;
+                            if(!selected){
+                                const index =  defaultSelectedKeys.findIndex(item=>item == record[rowKeys]);
+                                // console.log(index,record[rowKeys],defaultSelectedKeys)
+                                if(index != -1){
+                        
+                                     _defaultSelectedKeys.splice(index,1);
+                                     setDefaultSelectedKeys(_defaultSelectedKeys);
+                                }
+                            }else{
+                                _defaultSelectedKeys.push(record[rowKeys]);
+                                setDefaultSelectedKeys(_defaultSelectedKeys);
+                            }
+
                         }
                     }}
                 />
             
             </DrawerForm>
-        </PageContainer>
+        </>
     ) : <></>
 }

+ 58 - 19
src/pages/platformMana/roleManage/index.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 10:13:13
- * @LastEditTime: 2021-08-03 17:32:25
+ * @LastEditTime: 2021-08-09 11:13:38
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
@@ -15,23 +15,23 @@ import ProTable from '@ant-design/pro-table';
 import { ModalForm, ProFormText } from '@ant-design/pro-form';
 import UpdateForm from './updateForm';
 import DrawerContent from './component/drawer';
-import { getRoleList, roleBindUser, addList, editList, delList,roleBindMenu } from './service';
+import { getRoleList, roleBindUser, addList, editList, delList,roleBindMenu,roleHasBindUsers,roleHasBindMenus } from './service';
 import { getUserList } from '@/pages/UserMana/service';
 
 import { getMenuList } from '@/pages/platformMana/menuManage/service';
 
 const UserMana = () => {
   const columns = [
-    {
-      title: '院区名称',
-      dataIndex: 'hospName',
-      key: 'hosp_name',
-      hideInSearch: true,
-    },
+    // {
+    //   title: '院区名称',
+    //   dataIndex: 'hospName',
+    //   key: 'hospName',
+    //   hideInSearch: true,
+    // },
     {
       title: '角色名',
       dataIndex: 'roleName',
-      key: 'role_name',
+      key: 'roleName',
     },
     {
       title: '变更人',
@@ -43,7 +43,7 @@ const UserMana = () => {
       title: '变更日期',
       dataIndex: 'modifyTime',
       key: 'modifyTime',
-      valueType: 'date',
+      valueType: 'dateRange',
     },
     {
       title: '操作',
@@ -53,9 +53,7 @@ const UserMana = () => {
         <a
           key="config"
           onClick={() => {
-            setEditRoleBindUsers(true);
-            setDrawerVisible(true);
-            setCurrentRow(record);
+            bindInitHandle(record,'user');
           }}
         >
           用户
@@ -63,9 +61,7 @@ const UserMana = () => {
         <a
           key="config"
           onClick={() => {
-            setEditRoleBindUsers(false);
-            setDrawerVisible(true);
-            setCurrentRow(record);
+            bindInitHandle(record,'menu');
           }}
         >
           权限
@@ -115,6 +111,7 @@ const UserMana = () => {
       dataIndex: 'hospitalStatus',
       key: 'hospitalStatus',
       hideInSearch: true,
+      render:num=><>{num==0?'离职':'在职'}</>
     },
   ];
   
@@ -139,6 +136,10 @@ const UserMana = () => {
   const [editRoleBindUsers, setEditRoleBindUsers] = useState(false);
   const [drawerVisible, setDrawerVisible] = useState(false);
 
+
+  const [selectedUsers,setSelectedUsers] = useState([]);
+  const [selectedMenus,setSelectedMenus] = useState([]);
+
   // const [shareParamsSetting,setShareParamsSetting] = useState(false);  //是否分摊参数设置
 
   /**
@@ -193,6 +194,37 @@ const UserMana = () => {
       }
     }
   };
+  
+  //绑定初始化
+  /**
+   * 
+   * @param {Object} record 
+   * @param {String} type   user/menu
+   */
+  const bindInitHandle = async (record,type)=>{
+    const {roleId} = record;
+    if(type == 'user'){
+      const resp = await roleHasBindUsers({roleId});
+      const {status,data} = resp;
+      if(status == 200){
+        const tempArr = data.map(item=>item.id);
+        setSelectedUsers(tempArr);
+      }
+      setEditRoleBindUsers(true);
+    }
+    if(type == 'menu'){
+      const resp = await roleHasBindMenus({roleId});
+      const {status,data} = resp;
+      if(status == 200){
+        const tempArr = data.map(item=>item.id);
+        setSelectedMenus(tempArr);
+      }
+      setEditRoleBindUsers(false);
+    }
+    setDrawerVisible(true);
+    setCurrentRow(record);
+  }
+
 
   return (
     <PageContainer>
@@ -229,6 +261,9 @@ const UserMana = () => {
         layout={'horizontal'}
         visible={createModalVisible}
         onVisibleChange={handleModalVisible}
+        modalProps={{
+          destroyOnClose:true
+        }}
         onFinish={async (value) => {
           const success = await addList(value);
           //   console.log({ success });
@@ -238,6 +273,7 @@ const UserMana = () => {
               actionRef.current.reload();
             }
           }
+          return true;
         }}
       >
         <ProFormText
@@ -279,6 +315,7 @@ const UserMana = () => {
               actionRef.current.reload();
             }
           }
+          
         }}
         onCancel={() => {
           handleUpdateModalVisible(false);
@@ -295,12 +332,13 @@ const UserMana = () => {
           columns={DrawerTableUsersColumns}
           visible={drawerVisible}
           currentRow={currentRow}
-          defaultSelected={[98, 87]}
+          title="绑定用户"
+          defaultSelected={selectedUsers}
           onVisibleChange={(bool) => setDrawerVisible(bool)}
           renderListFunc={getUsers}
           config={{tableSearch:true}}
           onFinishFunc={async (value, selectedRowKeys) => {
-            // console.log({value,selectedRowKeys});
+            
             const { roleId } = currentRow;
             const resp = await roleBindUser({ roleId, userIds: selectedRowKeys });
             const { status } = resp;
@@ -319,7 +357,8 @@ const UserMana = () => {
           columns={DrawerTableMenusColumns}
           visible={drawerVisible}
           currentRow={currentRow}
-          defaultSelected={[98, 87]}
+          title="绑定权限"
+          defaultSelected={selectedMenus}
           onVisibleChange={(bool) => setDrawerVisible(bool)}
           renderListFunc={getMenus}
           config={{rowKeys:'menuId',tableSearch:false}}

+ 23 - 1
src/pages/platformMana/roleManage/service.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 10:13:31
- * @LastEditTime: 2021-08-03 15:10:39
+ * @LastEditTime: 2021-08-04 14:11:18
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/UserMana/service.js
@@ -76,3 +76,25 @@ export async function roleBindMenu(params, options) {
     ...(options || {}),
   });
 }
+
+
+//获取角色已绑定的用户
+export async function roleHasBindUsers(params, options) {
+  const {roleId} = params;
+  return request(`/api/costAccount/role/roleUsers`, {
+    params:{roleId},
+    method: 'GET',
+    ...(options || {}),
+  });
+}
+
+
+//获取角色已绑定的菜单
+export async function roleHasBindMenus(params, options) {
+  const {roleId} = params;
+  return request(`/api/costAccount/role/roleMenus`, {
+    params:{roleId},
+    method: 'GET',
+    ...(options || {}),
+  });
+}

+ 3 - 1
src/pages/responsibilityCenter/index.jsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 10:13:13
- * @LastEditTime: 2021-08-03 17:34:40
+ * @LastEditTime: 2021-08-04 19:08:59
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
@@ -19,6 +19,8 @@ import UpdateForm from './updateForm';
 import { getResponsibilityCenterList, editResponsibilityCenterList, delResponsibilityCenter, addResponsibilityCenter } from './service';
 import { getApportionmentLevelListNoPage } from '../apportionmentLevel/service';
 
+
+
 const responsibilityCenter = () => {
   const columns = [
     {

+ 5 - 5
src/pages/responsibilityCenter/service.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 08:54:08
- * @LastEditTime: 2021-07-29 23:13:44
+ * @LastEditTime: 2021-08-11 14:30:42
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/DepartmentMana/service.js
@@ -10,7 +10,7 @@
 import { request } from 'umi';
 
 
-//获取科室列表
+//获取责任中心列表
 export async function getResponsibilityCenterList(params, options) {
     return request('/api/costAccount/responsibility/list', {
       method: 'GET',
@@ -19,7 +19,7 @@ export async function getResponsibilityCenterList(params, options) {
     });
 }
 
-//编辑科室
+//编辑
 export async function editResponsibilityCenterList(body, options) {
   return request('/api/costAccount/responsibility/edit', {
     method: 'POST',
@@ -28,7 +28,7 @@ export async function editResponsibilityCenterList(body, options) {
   });
 }
 
-//新增科室
+//新增
 export async function addResponsibilityCenter(body, options) {
   return request('/api/costAccount/responsibility/save', {
     method: 'POST',
@@ -37,7 +37,7 @@ export async function addResponsibilityCenter(body, options) {
   });
 }
 
-//删除科室
+//删除
 export async function delResponsibilityCenter(params, options) {
   const {id} = params;
   return request(`/api/costAccount/responsibility/delete?id=${id}`, {

+ 31 - 4
src/pages/user/Login/index.jsx

@@ -7,12 +7,14 @@ import React, { useState, useEffect } from 'react';
 import ProForm, {ProFormText} from '@ant-design/pro-form';
 import { Link, history, useModel } from 'umi';
 import Footer from '@/components/Footer';
-import { login } from '@/services/user';
-
+import { login,getMenus } from '@/services/user';
+import iconEnum from '../../../menuIcons';
 import styles from './index.less';
 
 
 
+const { query = {}, pathname } = history.location;
+
 const LoginMessage = ({ content }) => (
   <Alert
     style={{
@@ -24,6 +26,27 @@ const LoginMessage = ({ content }) => (
   />
 );
 
+
+
+//将服务端获取的菜单 icon 字符串映射为对应的 icon Dom
+const mappingIcon = menuData => {
+  // const mappingMenu = menuData.map(item => ({
+  //   ...item,
+  //   icon: iconEnum[item.icon],
+  //   children: item.children ? mappingIcon(item.children) : [],
+  // }));
+  return menuData;
+};
+
+
+const getMenuData = async ()=>{
+    
+      const menu = await getMenus();
+      const {data} = menu;
+      const menus = mappingIcon(data);
+      return menus;
+}
+
 const Login = () => {
   const [submitting, setSubmitting] = useState(false);
   const [userLoginState, setUserLoginState] = useState({});
@@ -35,7 +58,6 @@ const Login = () => {
 
 
 
-
   const { fetchSubHosp,sign } = initialState;
 
   const handleSubmit = async (values) => {
@@ -60,9 +82,14 @@ const Login = () => {
         localStorage.setItem('userData',JSON.stringify({...data,avatar: 'https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png',}));
 
         message.success(defaultloginSuccessMessage);
-        await setInitialState((s) => ({ ...s, currentUser:data }));
+        // await setInitialState((s) => ({ ...s, currentUser:data }));
         /** 此方法会跳转到 redirect 参数所在的位置 */
 
+        // const menus = await getMenuData();
+        await setInitialState((s) => ({ ...s, currentUser:data}));
+        // localStorage.setItem('menus',JSON.stringify(menus));
+      
+
         if (!history) return;
         const { query } = history.location;
         const { redirect } = query;

+ 9 - 1
src/services/user.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-07-23 14:26:44
- * @LastEditTime: 2021-07-29 23:14:28
+ * @LastEditTime: 2021-08-05 15:36:11
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/services/user.js
@@ -25,6 +25,14 @@ export async function login(body, options) {
 }
 
 
+//获取角色对应的菜单列表
+export async function getMenus() {
+  return request(`/api/costAccount/menu/nav`, {
+    method: 'GET',
+  });
+}
+
+
 //获取医院分院列表
 export async function getSubHosp(sign) {
     return request(`/api/costAccount/getHospArea?sign=${sign}`, {

+ 5 - 1
src/utils.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 13:50:44
- * @LastEditTime: 2021-08-03 17:46:47
+ * @LastEditTime: 2021-08-10 15:24:28
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/utils.js
@@ -29,6 +29,10 @@ const getQueryString = (name)=>{
     return null;
 } 
 
+
+
+
+
 /**
  * 
  * @param {Function} requestFunc request函数

BIN=BIN
成本核算_build0802.zip