code4eat %!s(int64=4) %!d(string=hai) anos
pai
achega
316d9274d0
Modificáronse 58 ficheiros con 6513 adicións e 111 borrados
  1. 2 2
      config/defaultSettings.js
  2. 11 2
      config/proxy.js
  3. 68 12
      config/routes.js
  4. 198 0
      mock/apportionmentLevel.js
  5. 220 0
      mock/department.js
  6. 229 0
      mock/districtMana.js
  7. 218 0
      mock/responsibilityCenter.js
  8. 218 0
      mock/responsibilityCenterConnect.js
  9. 35 10
      mock/user.js
  10. 179 0
      mock/userMana.js
  11. 16 4
      package.json
  12. BIN=BIN
      public/KC-color-square.png
  13. BIN=BIN
      public/KC-color.png
  14. BIN=BIN
      public/KC_white.png
  15. 64 12
      src/app.jsx
  16. 120 0
      src/components/CAUpload/index.jsx
  17. 35 0
      src/components/Dialog/index.jsx
  18. 1 1
      src/components/Footer/index.jsx
  19. 13 4
      src/components/RightContent/AvatarDropdown.jsx
  20. 4 0
      src/global.less
  21. 209 37
      src/pages/DepartmentMana/index.jsx
  22. 55 0
      src/pages/DepartmentMana/service.js
  23. 59 0
      src/pages/DepartmentMana/updateForm.jsx
  24. 1 0
      src/pages/TableList/index.jsx
  25. 254 0
      src/pages/UserMana/index.js
  26. 49 0
      src/pages/UserMana/service.js
  27. 87 0
      src/pages/UserMana/updateForm.jsx
  28. 502 0
      src/pages/accountingSubject/index.jsx
  29. 57 0
      src/pages/accountingSubject/service.js
  30. 64 0
      src/pages/accountingSubject/updateForm.jsx
  31. 220 0
      src/pages/accountingSubjectConnect/index.jsx
  32. 43 0
      src/pages/accountingSubjectConnect/service.js
  33. 135 0
      src/pages/accountingSubjectConnect/updateForm.jsx
  34. 274 0
      src/pages/apportionmentLevel/index.jsx
  35. 62 0
      src/pages/apportionmentLevel/service.js
  36. 96 0
      src/pages/apportionmentLevel/updateForm.jsx
  37. 275 0
      src/pages/costAllocationParamsConnect/index.jsx
  38. 75 0
      src/pages/costAllocationParamsConnect/service.js
  39. 59 0
      src/pages/costAllocationParamsConnect/updateForm.jsx
  40. 240 0
      src/pages/costAllocationParamsSetting/index.jsx
  41. 55 0
      src/pages/costAllocationParamsSetting/service.js
  42. 59 0
      src/pages/costAllocationParamsSetting/updateForm.jsx
  43. 225 0
      src/pages/costProjectMana/index.jsx
  44. 67 0
      src/pages/costProjectMana/service.js
  45. 59 0
      src/pages/costProjectMana/updateForm.jsx
  46. 297 0
      src/pages/districtMana/index.jsx
  47. 59 0
      src/pages/districtMana/service.js
  48. 109 0
      src/pages/districtMana/updateForm.jsx
  49. 1 1
      src/pages/document.ejs
  50. 406 0
      src/pages/responsibilityCenter/index.jsx
  51. 48 0
      src/pages/responsibilityCenter/service.js
  52. 154 0
      src/pages/responsibilityCenter/updateForm.jsx
  53. 225 0
      src/pages/responsibilityCenterConnect/index.jsx
  54. 43 0
      src/pages/responsibilityCenterConnect/service.js
  55. 135 0
      src/pages/responsibilityCenterConnect/updateForm.jsx
  56. 67 24
      src/pages/user/Login/index.jsx
  57. 10 2
      src/services/user.js
  58. 47 0
      src/utils.js

+ 2 - 2
config/defaultSettings.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-07-22 15:04:09
- * @LastEditTime: 2021-07-23 15:31:47
+ * @LastEditTime: 2021-07-29 08:44:10
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/config/defaultSettings.js
@@ -19,7 +19,7 @@ const Settings = {
   colorWeak: false,
   title: '全成本核算管理系统',
   pwa: false,
-  logo:'https://i.postimg.cc/SNMZzg0v/kcLogo.png',
+  logo:'https://i.postimg.cc/WzYX2nfQ/KC-white.png',
   iconfontUrl: '',
 };
 export default Settings;

+ 11 - 2
config/proxy.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-07-22 15:04:09
- * @LastEditTime: 2021-07-23 14:34:45
+ * @LastEditTime: 2021-07-28 17:11:31
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/config/proxy.js
@@ -15,9 +15,18 @@
  * https://pro.ant.design/docs/deploy
  */
 export default {
+  mock: {
+    '/api/': {
+      target: 'http://localhost',
+      changeOrigin: true,
+      pathRewrite: {
+        '^/api': '',
+      },
+    },
+  },
   dev: {
     '/api/': {
-      target: 'http://121.43.139.179:8802',
+      target: 'http://112.124.59.133:8082',    //开发本地:192.168.51.76 ,dev:112.124.59.133:8082
       changeOrigin: true,
       pathRewrite: {
         '^/api': '',

+ 68 - 12
config/routes.js

@@ -1,3 +1,11 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-22 15:04:09
+ * @LastEditTime: 2021-07-29 19:47:41
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/config/routes.js
+ */
 export default [
   {
     path: '/user',
@@ -21,24 +29,72 @@ export default [
     icon: 'smile',
     component: './Welcome',
   },
+  {
+    path: '/UserMana',
+    name: '用户管理',
+    icon: 'tool',
+    component: './UserMana/index',
+  },
+  {
+    path: '/districtMana',
+    name: '院区管理',
+    icon: 'InsertRowLeftOutlined',
+    component: './districtMana/index',
+  },
   {
     path: '/DepartmentMana',
     name: '科室管理',
     icon: 'smile',
     component: './DepartmentMana/index',
   },
-  // {
-  //   path: '/',
-  //   name: '责任中心管理',
-  //   icon: 'smile',
-  //   component: './ResponsibilityCenterMana',
-  // },
-  // {
-  //   path: '/list',
-  //   name: '责任中心对应',
-  //   icon: 'smile',
-  //   component: './ResponsibilityCenterCorrespondence',
-  // },
+  {
+    path: '/responsibilityCenter',
+    name: '责任中心管理',
+    icon: 'smile',
+    component: './responsibilityCenter/index',
+  },
+  {
+    path: '/responsibilityCenterConnect',
+    name: '责任中心对应',
+    icon: 'smile',
+    component: './responsibilityCenterConnect/index',
+  },
+  {
+    path: '/apportionmentLevel',
+    name: '分摊层级设置',
+    icon: 'smile',
+    component: './apportionmentLevel/index',
+  },
+  {
+    path: '/accountingSubject',
+    name: '会计科目管理',
+    icon: 'smile',
+    component: './accountingSubject/index',
+  },
+  {
+    path: '/accountingSubjectConnect',
+    name: '会计科目对应',
+    icon: 'smile',
+    component: './accountingSubjectConnect/index',
+  },
+  {
+    path: '/costProjectMana',
+    name: '成本收入项目管理',
+    icon: 'smile',
+    component: './costProjectMana/index',
+  },
+  {
+    path: '/costAllocationParamsSetting',
+    name: '成本分摊参数设置',
+    icon: 'smile',
+    component: './costAllocationParamsSetting/index',
+  },
+  {
+    path: '/costAllocationParamsConnect',
+    name: '成本分摊参数对应',
+    icon: 'smile',
+    component: './costAllocationParamsConnect/index',
+  },
   {
     path: '/admin',
     name: 'admin',

+ 198 - 0
mock/apportionmentLevel.js

@@ -0,0 +1,198 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-27 19:23:55
+ * @LastEditTime: 2021-07-27 19:26:28
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/config/apportionmentLevel.js
+ */
+
+
+
+
+
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 08:51:42
+ * @LastEditTime: 2021-07-27 16:42:44
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/mock/department.js
+ */
+
+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,
+      shareName: `分摊层级名 ${index}`,
+      targetLevel:1,
+      leverSort: `分摊层级序号 ${index}`,
+      calcType:1,
+    //   owner: '曲丽丽',
+    //   desc: '这是一段描述',
+    //   updatedAt: moment().format('YYYY-MM-DD'),
+      createTime: 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;
+  const params = parse(realUrl, true).query;
+  let dataSource = [...tableListDataSource].slice((current - 1) * pageSize, current * pageSize);
+
+  if (params.sorter) {
+    const sorter = JSON.parse(params.sorter);
+    dataSource = dataSource.sort((prev, next) => {
+      let sortNumber = 0;
+      Object.keys(sorter).forEach((key) => {
+        if (sorter[key] === 'descend') {
+          if (prev[key] - next[key] > 0) {
+            sortNumber += -1;
+          } else {
+            sortNumber += 1;
+          }
+
+          return;
+        }
+
+        if (prev[key] - next[key] > 0) {
+          sortNumber += 1;
+        } else {
+          sortNumber += -1;
+        }
+      });
+      return sortNumber;
+    });
+  }
+
+  if (params.filter) {
+    const filter = JSON.parse(params.filter);
+
+    if (Object.keys(filter).length > 0) {
+      dataSource = dataSource.filter((item) => {
+        return Object.keys(filter).some((key) => {
+          if (!filter[key]) {
+            return true;
+          }
+
+          if (filter[key].includes(`${item[key]}`)) {
+            return true;
+          }
+
+          return false;
+        });
+      });
+    }
+  }
+
+  if (params.name) {
+    dataSource = dataSource.filter((data) => data?.name?.includes(params.name || ''));
+  }
+
+  const result = {
+    data: {
+      list: dataSource,
+      totalCount: tableListDataSource.length,
+      pageSize: pageSize,
+    },
+    status: 200,
+    success: true,
+  };
+  return res.json(result);
+}
+
+function updateList(req, res, u, b) {
+  let realUrl = u;
+
+  if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
+    realUrl = req.url;
+  }
+
+  //   const body = (b && b.body) || req.body;
+  const { method, body } = req;
+  const { name,isHospital,parentId,parentName} = body;
+
+  switch (method) {
+    /* eslint no-case-declarations:0 */
+    case 'DELETE':
+      const {ids} = body;
+      // console.log({realUrl});
+      tableListDataSource = tableListDataSource.filter((item) => !ids.includes(item.id));
+      break;
+
+    case 'POST':
+      (() => {
+        const i = Math.ceil(Math.random() * 10000);
+        const newRule = {
+          key: tableListDataSource.length,
+          id:tableListDataSource.length,
+          avatar: [
+            'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
+            'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
+          ][i % 2],
+          name,isHospital,parentId,parentName,
+          createdAt: moment().format('YYYY-MM-DD'),
+        };
+        tableListDataSource.unshift(newRule);
+        return res.json(newRule);
+      })();
+
+      return;
+
+    case 'update':
+      (() => {
+        let newRule = {};
+        tableListDataSource = tableListDataSource.map((item) => {
+          if (item.key === key) {
+            newRule = { ...item, desc, name };
+            return { ...item, desc, name };
+          }
+
+          return item;
+        });
+        return res.json(newRule);
+      })();
+
+      return;
+
+    default:
+      break;
+  }
+
+  const result = {
+    list: tableListDataSource,
+    pagination: {
+      total: tableListDataSource.length,
+    },
+  };
+  res.json(result);
+}
+
+export default {
+  // GET 科室列表
+
+  'GET /api/costsharelevel/list':getList,
+  'POST /api/costsharelevel/save': updateList,
+  'DELETE /api/costsharelevel/delete': updateList,
+};

+ 220 - 0
mock/department.js

@@ -0,0 +1,220 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 08:51:42
+ * @LastEditTime: 2021-07-27 14:12:56
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/mock/department.js
+ */
+
+import moment from 'moment';
+import { parse } from 'url'; // mock tableListDataSource
+
+// const departmentListList = (current, pageSize) => {
+//     const tableListDataSource = [];
+
+//     for (let i = 0; i < pageSize; i += 1) {
+//       const index = (current - 1) * 10 + i;
+//       tableListDataSource.push({
+//         key: index,
+//         id:index,
+//         disabled: i % 6 === 0,
+//         department_name: `科室 ${index}`,
+//         department_code:`科室编码 ${index}`,
+//         hosp_id:`医院Id ${index}`,
+
+//         owner: '曲丽丽',
+//         desc: '这是一段描述',
+//         callNo: Math.floor(Math.random() * 1000),
+//         status: Math.floor(Math.random() * 10) % 4,
+//         updatedAt: moment().format('YYYY-MM-DD'),
+//         create_time: moment().format('YYYY-MM-DD'),
+//         progress: Math.ceil(Math.random() * 100),
+//       });
+//     }
+
+//     tableListDataSource.reverse();
+//     return {
+//          data:{
+//            list:tableListDataSource,
+//            totalCount:tableListDataSource.length,
+//            pageSize
+//          }
+//     };
+// };
+
+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,
+      disabled: i % 6 === 0,
+      departmentName: `科室 ${index}`,
+      departmentCode: `科室编码 ${index}`,
+      hospId: `医院Id ${index}`,
+
+      owner: '曲丽丽',
+      desc: '这是一段描述',
+      callNo: Math.floor(Math.random() * 1000),
+      status: Math.floor(Math.random() * 10) % 4,
+      updatedAt: moment().format('YYYY-MM-DD'),
+      createTime: moment().format('YYYY-MM-DD'),
+      progress: Math.ceil(Math.random() * 100),
+    });
+  }
+  //   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;
+  const params = parse(realUrl, true).query;
+  let dataSource = [...tableListDataSource].slice((current - 1) * pageSize, current * pageSize);
+
+  if (params.sorter) {
+    const sorter = JSON.parse(params.sorter);
+    dataSource = dataSource.sort((prev, next) => {
+      let sortNumber = 0;
+      Object.keys(sorter).forEach((key) => {
+        if (sorter[key] === 'descend') {
+          if (prev[key] - next[key] > 0) {
+            sortNumber += -1;
+          } else {
+            sortNumber += 1;
+          }
+
+          return;
+        }
+
+        if (prev[key] - next[key] > 0) {
+          sortNumber += 1;
+        } else {
+          sortNumber += -1;
+        }
+      });
+      return sortNumber;
+    });
+  }
+
+  if (params.filter) {
+    const filter = JSON.parse(params.filter);
+
+    if (Object.keys(filter).length > 0) {
+      dataSource = dataSource.filter((item) => {
+        return Object.keys(filter).some((key) => {
+          if (!filter[key]) {
+            return true;
+          }
+
+          if (filter[key].includes(`${item[key]}`)) {
+            return true;
+          }
+
+          return false;
+        });
+      });
+    }
+  }
+
+  if (params.name) {
+    dataSource = dataSource.filter((data) => data?.name?.includes(params.name || ''));
+  }
+
+  const result = {
+    data: {
+      list: dataSource,
+      totalCount: tableListDataSource.length,
+      pageSize: pageSize,
+    },
+    status: 200,
+    success: true,
+  };
+  return res.json(result);
+}
+
+function updateList(req, res, u, b) {
+  let realUrl = u;
+
+  if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
+    realUrl = req.url;
+  }
+
+  //   const body = (b && b.body) || req.body;
+  const { method, body } = req;
+  const { departmentCode,departmentName,hospId } = body;
+
+  switch (method) {
+    /* eslint no-case-declarations:0 */
+    case 'DELETE':
+      const {ids} = body;
+      // console.log({realUrl});
+      tableListDataSource = tableListDataSource.filter((item) => !ids.includes(item.id));
+      break;
+
+    case 'POST':
+      (() => {
+        const i = Math.ceil(Math.random() * 10000);
+        const newRule = {
+          key: tableListDataSource.length,
+          id:tableListDataSource.length,
+          avatar: [
+            'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
+            'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
+          ][i % 2],
+          departmentCode,departmentName,hospId,
+          createdAt: moment().format('YYYY-MM-DD'),
+        };
+        tableListDataSource.unshift(newRule);
+        return res.json(newRule);
+      })();
+
+      return;
+
+    case 'update':
+      (() => {
+        let newRule = {};
+        tableListDataSource = tableListDataSource.map((item) => {
+          if (item.key === key) {
+            newRule = { ...item, desc, name };
+            return { ...item, desc, name };
+          }
+
+          return item;
+        });
+        return res.json(newRule);
+      })();
+
+      return;
+
+    default:
+      break;
+  }
+
+  const result = {
+    list: tableListDataSource,
+    pagination: {
+      total: tableListDataSource.length,
+    },
+  };
+  res.json(result);
+}
+
+export default {
+  // GET 科室列表
+
+  'GET /api/department/list':getList,
+  'POST /api/department/save': updateList,
+  'DELETE /api/department/delete': updateList,
+};

+ 229 - 0
mock/districtMana.js

@@ -0,0 +1,229 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-27 14:29:29
+ * @LastEditTime: 2021-07-27 16:09:51
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/mock/districtMana.js
+ */
+
+
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 08:51:42
+ * @LastEditTime: 2021-07-27 14:12:56
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/mock/department.js
+ */
+
+import moment from 'moment';
+import { parse } from 'url'; // mock tableListDataSource
+
+// const departmentListList = (current, pageSize) => {
+//     const tableListDataSource = [];
+
+//     for (let i = 0; i < pageSize; i += 1) {
+//       const index = (current - 1) * 10 + i;
+//       tableListDataSource.push({
+//         key: index,
+//         id:index,
+//         disabled: i % 6 === 0,
+//         department_name: `科室 ${index}`,
+//         department_code:`科室编码 ${index}`,
+//         hosp_id:`医院Id ${index}`,
+
+//         owner: '曲丽丽',
+//         desc: '这是一段描述',
+//         callNo: Math.floor(Math.random() * 1000),
+//         status: Math.floor(Math.random() * 10) % 4,
+//         updatedAt: moment().format('YYYY-MM-DD'),
+//         create_time: moment().format('YYYY-MM-DD'),
+//         progress: Math.ceil(Math.random() * 100),
+//       });
+//     }
+
+//     tableListDataSource.reverse();
+//     return {
+//          data:{
+//            list:tableListDataSource,
+//            totalCount:tableListDataSource.length,
+//            pageSize
+//          }
+//     };
+// };
+
+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,
+      name: `医院名 ${index}`,
+      isHospital:'1',
+      departmentCode: `科室编码 ${index}`,
+      sign: `医院标识 ${index}`,
+      parentId:1,
+      parentName:`parentName ${index}`,
+
+    //   owner: '曲丽丽',
+    //   desc: '这是一段描述',
+    //   updatedAt: moment().format('YYYY-MM-DD'),
+      createTime: 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;
+  const params = parse(realUrl, true).query;
+  let dataSource = [...tableListDataSource].slice((current - 1) * pageSize, current * pageSize);
+
+  if (params.sorter) {
+    const sorter = JSON.parse(params.sorter);
+    dataSource = dataSource.sort((prev, next) => {
+      let sortNumber = 0;
+      Object.keys(sorter).forEach((key) => {
+        if (sorter[key] === 'descend') {
+          if (prev[key] - next[key] > 0) {
+            sortNumber += -1;
+          } else {
+            sortNumber += 1;
+          }
+
+          return;
+        }
+
+        if (prev[key] - next[key] > 0) {
+          sortNumber += 1;
+        } else {
+          sortNumber += -1;
+        }
+      });
+      return sortNumber;
+    });
+  }
+
+  if (params.filter) {
+    const filter = JSON.parse(params.filter);
+
+    if (Object.keys(filter).length > 0) {
+      dataSource = dataSource.filter((item) => {
+        return Object.keys(filter).some((key) => {
+          if (!filter[key]) {
+            return true;
+          }
+
+          if (filter[key].includes(`${item[key]}`)) {
+            return true;
+          }
+
+          return false;
+        });
+      });
+    }
+  }
+
+  if (params.name) {
+    dataSource = dataSource.filter((data) => data?.name?.includes(params.name || ''));
+  }
+
+  const result = {
+    data: {
+      list: dataSource,
+      totalCount: tableListDataSource.length,
+      pageSize: pageSize,
+    },
+    status: 200,
+    success: true,
+  };
+  return res.json(result);
+}
+
+function updateList(req, res, u, b) {
+  let realUrl = u;
+
+  if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
+    realUrl = req.url;
+  }
+
+  //   const body = (b && b.body) || req.body;
+  const { method, body } = req;
+  const { name,isHospital,parentId,parentName} = body;
+
+  switch (method) {
+    /* eslint no-case-declarations:0 */
+    case 'DELETE':
+      const {ids} = body;
+      // console.log({realUrl});
+      tableListDataSource = tableListDataSource.filter((item) => !ids.includes(item.id));
+      break;
+
+    case 'POST':
+      (() => {
+        const i = Math.ceil(Math.random() * 10000);
+        const newRule = {
+          key: tableListDataSource.length,
+          id:tableListDataSource.length,
+          avatar: [
+            'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
+            'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
+          ][i % 2],
+          name,isHospital,parentId,parentName,
+          createdAt: moment().format('YYYY-MM-DD'),
+        };
+        tableListDataSource.unshift(newRule);
+        return res.json(newRule);
+      })();
+
+      return;
+
+    case 'update':
+      (() => {
+        let newRule = {};
+        tableListDataSource = tableListDataSource.map((item) => {
+          if (item.key === key) {
+            newRule = { ...item, desc, name };
+            return { ...item, desc, name };
+          }
+
+          return item;
+        });
+        return res.json(newRule);
+      })();
+
+      return;
+
+    default:
+      break;
+  }
+
+  const result = {
+    list: tableListDataSource,
+    pagination: {
+      total: tableListDataSource.length,
+    },
+  };
+  res.json(result);
+}
+
+export default {
+  // GET 科室列表
+
+  'GET /api/hosptail/list':getList,
+  'POST /api/hosptail/save': updateList,
+  'DELETE /api/hosptail/delete': updateList,
+};

+ 218 - 0
mock/responsibilityCenter.js

@@ -0,0 +1,218 @@
+
+
+
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 08:51:42
+ * @LastEditTime: 2021-07-27 16:42:44
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/mock/department.js
+ */
+
+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,
+      responsibilityName: `责任中心名 ${index}`,
+      responsibilityLevel:1,
+      responsibilityCode: `责任中心编码 ${index}`,
+      isGatherCenter:1,
+      responsibilityType:1,
+      shareLevel:1,
+      shareName:`责任中心分摊名 ${index}`,
+      parentName:`parentName ${index}`,
+      child:[
+          {
+            key: index,
+            id: index,
+            responsibilityName: `责任中心名 ${index}-0`,
+            responsibilityLevel:1,
+            responsibilityCode: `责任中心编码 ${index}-0`,
+            isGatherCenter:1,
+            responsibilityType:1,
+            shareLevel:1,
+            shareName:`责任中心分摊名 ${index}-0`,
+            parentName:`parentName ${index}-0`,
+          },
+          {
+            key: index,
+            id: index,
+            responsibilityName: `责任中心名 ${index}-1`,
+            responsibilityLevel:1,
+            responsibilityCode: `责任中心编码 ${index}-1`,
+            isGatherCenter:1,
+            responsibilityType:1,
+            shareLevel:1,
+            shareName:`责任中心分摊名 ${index}-1`,
+            parentName:`parentName ${index}-1`,
+          }
+      ],
+    //   owner: '曲丽丽',
+    //   desc: '这是一段描述',
+    //   updatedAt: moment().format('YYYY-MM-DD'),
+      createTime: 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;
+  const params = parse(realUrl, true).query;
+  let dataSource = [...tableListDataSource].slice((current - 1) * pageSize, current * pageSize);
+
+  if (params.sorter) {
+    const sorter = JSON.parse(params.sorter);
+    dataSource = dataSource.sort((prev, next) => {
+      let sortNumber = 0;
+      Object.keys(sorter).forEach((key) => {
+        if (sorter[key] === 'descend') {
+          if (prev[key] - next[key] > 0) {
+            sortNumber += -1;
+          } else {
+            sortNumber += 1;
+          }
+
+          return;
+        }
+
+        if (prev[key] - next[key] > 0) {
+          sortNumber += 1;
+        } else {
+          sortNumber += -1;
+        }
+      });
+      return sortNumber;
+    });
+  }
+
+  if (params.filter) {
+    const filter = JSON.parse(params.filter);
+
+    if (Object.keys(filter).length > 0) {
+      dataSource = dataSource.filter((item) => {
+        return Object.keys(filter).some((key) => {
+          if (!filter[key]) {
+            return true;
+          }
+
+          if (filter[key].includes(`${item[key]}`)) {
+            return true;
+          }
+
+          return false;
+        });
+      });
+    }
+  }
+
+  if (params.name) {
+    dataSource = dataSource.filter((data) => data?.name?.includes(params.name || ''));
+  }
+
+  const result = {
+    data: {
+      list: dataSource,
+      totalCount: tableListDataSource.length,
+      pageSize: pageSize,
+    },
+    status: 200,
+    success: true,
+  };
+  return res.json(result);
+}
+
+function updateList(req, res, u, b) {
+  let realUrl = u;
+
+  if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
+    realUrl = req.url;
+  }
+
+  //   const body = (b && b.body) || req.body;
+  const { method, body } = req;
+  const { name,isHospital,parentId,parentName} = body;
+
+  switch (method) {
+    /* eslint no-case-declarations:0 */
+    case 'DELETE':
+      const {ids} = body;
+      // console.log({realUrl});
+      tableListDataSource = tableListDataSource.filter((item) => !ids.includes(item.id));
+      break;
+
+    case 'POST':
+      (() => {
+        const i = Math.ceil(Math.random() * 10000);
+        const newRule = {
+          key: tableListDataSource.length,
+          id:tableListDataSource.length,
+          avatar: [
+            'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
+            'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
+          ][i % 2],
+          name,isHospital,parentId,parentName,
+          createdAt: moment().format('YYYY-MM-DD'),
+        };
+        tableListDataSource.unshift(newRule);
+        return res.json(newRule);
+      })();
+
+      return;
+
+    case 'update':
+      (() => {
+        let newRule = {};
+        tableListDataSource = tableListDataSource.map((item) => {
+          if (item.key === key) {
+            newRule = { ...item, desc, name };
+            return { ...item, desc, name };
+          }
+
+          return item;
+        });
+        return res.json(newRule);
+      })();
+
+      return;
+
+    default:
+      break;
+  }
+
+  const result = {
+    list: tableListDataSource,
+    pagination: {
+      total: tableListDataSource.length,
+    },
+  };
+  res.json(result);
+}
+
+export default {
+  // GET 科室列表
+
+  'GET /api/responsibility/list':getList,
+  'POST /api/responsibility/save': updateList,
+  'DELETE /api/responsibility/delete': updateList,
+};

+ 218 - 0
mock/responsibilityCenterConnect.js

@@ -0,0 +1,218 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-27 19:58:13
+ * @LastEditTime: 2021-07-27 20:25:41
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/mock/responsibilityCenterConnect.js
+ */
+
+
+
+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,
+      responsibilityId: `责任中心id ${index}`,
+      responsibilityName: `责任中心名 ${index}`,
+      child:[
+          {
+            key: `one${index}`,
+            id: `one${index}`,
+            responsibilityName: `责任中心名 ${index}-0`,
+            responsibilityId: `责任中心id ${index}-0`,
+            departments:[
+                {
+                    departmentId:`two${index}`,
+                    departmentName:`科室名 ${index}`
+                },
+                {
+                    departmentId:`two${index}`,
+                    departmentName:`科室名 ${index}`
+                }
+            ]
+          },
+          {
+            key: index,
+            id: index,
+            responsibilityName: `责任中心名 ${index}-1`,
+            responsibilityId: `责任中心id ${index}-1`,
+            departments:[
+                {
+                    departmentId:index,
+                    departmentName:`科室名 ${index}`
+                },
+                {
+                    departmentId:`three${index}`,
+                    departmentName:`科室名 ${index}`
+                }
+            ]
+          }
+      ],
+    //   owner: '曲丽丽',
+    //   desc: '这是一段描述',
+    //   updatedAt: moment().format('YYYY-MM-DD'),
+      createTime: 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;
+  const params = parse(realUrl, true).query;
+  let dataSource = [...tableListDataSource].slice((current - 1) * pageSize, current * pageSize);
+
+  if (params.sorter) {
+    const sorter = JSON.parse(params.sorter);
+    dataSource = dataSource.sort((prev, next) => {
+      let sortNumber = 0;
+      Object.keys(sorter).forEach((key) => {
+        if (sorter[key] === 'descend') {
+          if (prev[key] - next[key] > 0) {
+            sortNumber += -1;
+          } else {
+            sortNumber += 1;
+          }
+
+          return;
+        }
+
+        if (prev[key] - next[key] > 0) {
+          sortNumber += 1;
+        } else {
+          sortNumber += -1;
+        }
+      });
+      return sortNumber;
+    });
+  }
+
+  if (params.filter) {
+    const filter = JSON.parse(params.filter);
+
+    if (Object.keys(filter).length > 0) {
+      dataSource = dataSource.filter((item) => {
+        return Object.keys(filter).some((key) => {
+          if (!filter[key]) {
+            return true;
+          }
+
+          if (filter[key].includes(`${item[key]}`)) {
+            return true;
+          }
+
+          return false;
+        });
+      });
+    }
+  }
+
+  if (params.name) {
+    dataSource = dataSource.filter((data) => data?.name?.includes(params.name || ''));
+  }
+
+  const result = {
+    data: {
+      list: dataSource,
+      totalCount: tableListDataSource.length,
+      pageSize: pageSize,
+    },
+    status: 200,
+    success: true,
+  };
+  return res.json(result);
+}
+
+function updateList(req, res, u, b) {
+  let realUrl = u;
+
+  if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
+    realUrl = req.url;
+  }
+
+  //   const body = (b && b.body) || req.body;
+  const { method, body } = req;
+  const { name,isHospital,parentId,parentName} = body;
+
+  switch (method) {
+    /* eslint no-case-declarations:0 */
+    case 'DELETE':
+      const {ids} = body;
+      // console.log({realUrl});
+      tableListDataSource = tableListDataSource.filter((item) => !ids.includes(item.id));
+      break;
+
+    case 'POST':
+      (() => {
+        const i = Math.ceil(Math.random() * 10000);
+        const newRule = {
+          key: tableListDataSource.length,
+          id:tableListDataSource.length,
+          avatar: [
+            'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
+            'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
+          ][i % 2],
+          name,isHospital,parentId,parentName,
+          createdAt: moment().format('YYYY-MM-DD'),
+        };
+        tableListDataSource.unshift(newRule);
+        return res.json(newRule);
+      })();
+
+      return;
+
+    case 'update':
+      (() => {
+        let newRule = {};
+        tableListDataSource = tableListDataSource.map((item) => {
+          if (item.key === key) {
+            newRule = { ...item, desc, name };
+            return { ...item, desc, name };
+          }
+
+          return item;
+        });
+        return res.json(newRule);
+      })();
+
+      return;
+
+    default:
+      break;
+  }
+
+  const result = {
+    list: tableListDataSource,
+    pagination: {
+      total: tableListDataSource.length,
+    },
+  };
+  res.json(result);
+}
+
+export default {
+  // GET 科室列表
+
+  'GET /api/centerDepartment/list':getList,
+  'POST /api/centerDepartment/save': updateList,
+};

+ 35 - 10
mock/user.js

@@ -115,25 +115,37 @@ export default {
       address: 'Sidney No. 1 Lake Park',
     },
   ],
-  'POST /api/login/account': async (req, res) => {
-    const { password, username, type } = req.body;
+  'POST /api/costAccount/login': async (req, res) => {
+    const { password, account, type } = req.body;
     await waitTime(2000);
-
-    if (password === 'ant.design' && username === 'admin') {
+    console.log({password, account, type});
+    if (password == '123456' && account === 'admin') {
       res.send({
-        status: 'ok',
+        status:200,
         type,
-        currentAuthority: 'admin',
+        data:{
+          currentAuthority: 'admin',
+          name: 'Serati Ma',
+          avatar: 'https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png',
+          access: getAccess(),
+          token:'token'
+        }
       });
       access = 'admin';
       return;
     }
 
-    if (password === 'ant.design' && username === 'user') {
+    if (password == '123456' && account === 'user') {
       res.send({
-        status: 'ok',
+        status:200,
         type,
-        currentAuthority: 'user',
+        data:{
+          currentAuthority: 'user',
+          name: 'Serata',
+          avatar: 'https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png',
+          access: getAccess(),
+          token:'token'
+        }
       });
       access = 'user';
       return;
@@ -152,7 +164,9 @@ export default {
     res.send({
       status: 'error',
       type,
-      currentAuthority: 'guest',
+      data:{
+        currentAuthority: 'guest',
+      }
     });
     access = 'guest';
   },
@@ -170,6 +184,17 @@ export default {
       success: true,
     });
   },
+  //获取分院列表
+  'GET /api/costAccount/getHospArea':[
+      {
+         id:1,
+         name:'分院名1'
+      },
+      {
+        id:2,
+        name:'分院名2'
+      }
+  ],
   'GET /api/500': (req, res) => {
     res.status(500).send({
       timestamp: 1513932555104,

+ 179 - 0
mock/userMana.js

@@ -0,0 +1,179 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 15:20:30
+ * @LastEditTime: 2021-07-27 10:04:54
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/mock/userMana.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,
+          name:`用户${i}`,
+          account:`账户${i}`,
+          hospitalStatus:0,
+          id:index,
+          password:'123'
+    });
+  }
+//   console.log({tableListDataSource});
+  tableListDataSource.reverse();
+  return tableListDataSource;
+};
+
+let tableListDataSource = genList(1, 100);
+
+function getUser(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;
+  const params = parse(realUrl, true).query;
+  let dataSource = [...tableListDataSource].slice((current - 1) * pageSize, current * pageSize);
+
+  if (params.sorter) {
+    const sorter = JSON.parse(params.sorter);
+    dataSource = dataSource.sort((prev, next) => {
+      let sortNumber = 0;
+      Object.keys(sorter).forEach((key) => {
+        if (sorter[key] === 'descend') {
+          if (prev[key] - next[key] > 0) {
+            sortNumber += -1;
+          } else {
+            sortNumber += 1;
+          }
+
+          return;
+        }
+
+        if (prev[key] - next[key] > 0) {
+          sortNumber += 1;
+        } else {
+          sortNumber += -1;
+        }
+      });
+      return sortNumber;
+    });
+  }
+
+  if (params.filter) {
+    const filter = JSON.parse(params.filter);
+
+    if (Object.keys(filter).length > 0) {
+      dataSource = dataSource.filter((item) => {
+        return Object.keys(filter).some((key) => {
+          if (!filter[key]) {
+            return true;
+          }
+
+          if (filter[key].includes(`${item[key]}`)) {
+            return true;
+          }
+
+          return false;
+        });
+      });
+    }
+  }
+
+  if (params.name) {
+    dataSource = dataSource.filter((data) => data?.name?.includes(params.name || ''));
+  }
+
+  const result = {
+    data: {
+        list:dataSource,
+        totalCount:tableListDataSource.length,
+        pageSize:pageSize,
+    },
+    status:200,
+    success: true,
+  };
+  return res.json(result);
+}
+
+function postUser(req, res, u, b) {
+  let realUrl = u;
+
+  if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
+    realUrl = req.url;
+  }
+
+//   const body = (b && b.body) || req.body;
+  const { method,body} = req;
+  const {name,account, hospitalStatus,password } = body;
+
+  switch (method) {
+    /* eslint no-case-declarations:0 */
+    case 'delete':
+      tableListDataSource = tableListDataSource.filter((item) => key.indexOf(item.key) === -1);
+      break;
+
+    case 'POST':
+      (() => {
+        const i = Math.ceil(Math.random() * 10000);
+        const newRule = {
+          key: tableListDataSource.length,
+          avatar: [
+            'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
+            'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
+          ][i % 2],
+          name,
+          account,
+          hospitalStatus,
+          password,
+          createdAt: moment().format('YYYY-MM-DD'),
+        };
+        tableListDataSource.unshift(newRule);
+        return res.json(newRule);
+      })();
+
+      return;
+
+    case 'update':
+      (() => {
+        let newRule = {};
+        tableListDataSource = tableListDataSource.map((item) => {
+          if (item.key === key) {
+            newRule = { ...item, desc, name };
+            return { ...item, desc, name };
+          }
+
+          return item;
+        });
+        return res.json(newRule);
+      })();
+
+      return;
+
+    default:
+      break;
+  }
+
+  const result = {
+    list: tableListDataSource,
+    pagination: {
+      total: tableListDataSource.length,
+    },
+  };
+  res.json(result);
+}
+
+export default {
+  'GET /api/costAccount/user/list': getUser,
+  'POST /api/costAccount/user/save': postUser,
+};

+ 16 - 4
package.json

@@ -23,6 +23,7 @@
     "prettier": "prettier -c --write \"src/**/*\"",
     "start": "cross-env UMI_ENV=dev umi dev",
     "start:dev": "cross-env REACT_APP_ENV=dev MOCK=none UMI_ENV=dev umi dev",
+    "start:mock": "cross-env REACT_APP_ENV=mock UMI_ENV=dev umi dev",
     "start:no-mock": "cross-env MOCK=none UMI_ENV=dev umi dev",
     "start:no-ui": "cross-env UMI_UI=none UMI_ENV=dev umi dev",
     "start:pre": "cross-env REACT_APP_ENV=pre UMI_ENV=dev umi dev",
@@ -37,9 +38,15 @@
   "lint-staged": {
     "**/*.less": "stylelint --syntax less",
     "**/*.{js,jsx,ts,tsx}": "npm run lint-staged:js",
-    "**/*.{js,jsx,tsx,ts,less,md,json}": ["prettier --write"]
+    "**/*.{js,jsx,tsx,ts,less,md,json}": [
+      "prettier --write"
+    ]
   },
-  "browserslist": ["> 1%", "last 2 versions", "not ie <= 10"],
+  "browserslist": [
+    "> 1%",
+    "last 2 versions",
+    "not ie <= 10"
+  ],
   "dependencies": {
     "@ant-design/icons": "^4.5.0",
     "@ant-design/pro-descriptions": "^1.6.8",
@@ -49,6 +56,7 @@
     "@umijs/route-utils": "^1.0.36",
     "antd": "^4.14.0",
     "classnames": "^2.2.6",
+    "js-cookie": "^3.0.0",
     "lodash": "^4.17.11",
     "moment": "^2.25.3",
     "omit.js": "^2.0.2",
@@ -93,6 +101,10 @@
     "stylelint": "^13.0.0",
     "typescript": "^4.2.2"
   },
-  "engines": { "node": ">=10.0.0" },
-  "gitHooks": { "commit-msg": "fabric verify-commit" }
+  "engines": {
+    "node": ">=10.0.0"
+  },
+  "gitHooks": {
+    "commit-msg": "fabric verify-commit"
+  }
 }

BIN=BIN
public/KC-color-square.png


BIN=BIN
public/KC-color.png


BIN=BIN
public/KC_white.png


+ 64 - 12
src/app.jsx

@@ -5,8 +5,12 @@ import RightContent from '@/components/RightContent';
 import Footer from '@/components/Footer';
 import { currentUser as queryCurrentUser } from './services/ant-design-pro/api';
 import { BookOutlined, LinkOutlined } from '@ant-design/icons';
+import {getQueryString} from './utils';
+import {getSubHosp} from './services/user';
+
 const isDev = process.env.NODE_ENV === 'development';
 const loginPath = '/user/login';
+
 /** 获取用户信息比较慢的时候会展示一个 loading */
 
 export const initialStateConfig = {
@@ -18,28 +22,40 @@ export const initialStateConfig = {
 
 export async function getInitialState() {
   const fetchUserInfo = async () => {
-    try {
-      const msg = await queryCurrentUser();
-      return msg.data;
-    } catch (error) {
-      history.push(loginPath);
+    const userData = localStorage.getItem('userData');
+    if(userData){
+      return JSON.parse(userData);
     }
-
     return undefined;
   }; // 如果是登录页面,不执行
 
+  //医院标识
+  const sign = getQueryString('hospSign');
+
+  const fetchSubHosp = async ()=>{
+    try {
+      const msg = await getSubHosp(sign);
+    } catch (error) {
+      
+    }
+  }
+
   if (history.location.pathname !== loginPath) {
     const currentUser = await fetchUserInfo();
     return {
       fetchUserInfo,
       currentUser,
       settings: {},
+      fetchSubHosp,
+      sign
     };
   }
 
   return {
     fetchUserInfo,
     settings: {},
+    fetchSubHosp,
+    sign
   };
 }
 /**
@@ -83,26 +99,60 @@ export async function getInitialState() {
 
 //请求拦截器
 const authHeaderInterceptor = (url, options) => {
-  const authHeader = { };
+  const userData = localStorage.getItem('userData');
+  let authHeader = {};
+  if(userData){
+    const {token} = JSON.parse(userData);
+    authHeader.token = token;
+  }
+
   return {
     url: `${url}`,
     options: { ...options, interceptors: true, headers: authHeader },
   };
 };
 
+
+
+
 //响应拦截器
-const demoResponseInterceptors = (response, options) => {
+const demoResponseInterceptors = async (response, options) => {
   // response.headers.append('interceptors', 'yes yo');
-  console.log({response, options});
-  return response;
-};
+  const {status} = response;
 
+  if(status != 200){
+        if(status == 500){
+          notification.error({
+            message: '抱歉,服务器出现错误!'
+          });
+        }
+        if(status == 404){
+          notification.error({
+            message: '抱歉,服务器未找到请求!'
+          });
+        }
+  }
+
+  const _response = await response.clone().json();
+  const {status:dataStatus,msg,errorMessage} = _response;
+  
+  if(dataStatus == 200){
+    // notification.error({
+    //   message:errorMessage
+    // });
+    return response;
+  }else{
+    notification.error({
+      message:errorMessage
+    });
+  }
+}
 
 
 export const request = {
   errorHandler: (error) => {
+    // console.log({error});
     const { response } = error;
-
     if (!response) {
       notification.error({
         description: '您的网络发生异常,无法连接服务器',
@@ -110,6 +160,8 @@ export const request = {
       });
     }
 
+    
+
     throw error;
   },
   // 新增自动添加AccessToken的请求前拦截器

+ 120 - 0
src/components/CAUpload/index.jsx

@@ -0,0 +1,120 @@
+
+
+
+import { SearchOutlined,ImportOutlined} from '@ant-design/icons';
+import React, { Component } from 'react';
+import PropTypes from 'prop-types';
+import {Button,Upload,message,} from 'antd';
+import Cookies from 'js-cookie';
+// 服务器地址,此处为了做演示,没有全局引入,直接写了
+const Host = 'http://112.124.59.133:8082';
+
+class CAUpload extends Component {
+    constructor(props) {
+        super(props);
+        // 模板下载事件
+        this.jumpTo = this.jumpTo.bind(this);
+        // 表格导出事件
+        this.exportExcel = this.exportExcel.bind(this);
+        // 表格上传事件
+        this.uploadProps.onChange = this.uploadProps.onChange.bind(this);
+    }
+    // 模板下载
+    jumpTo() {
+        window.open(Host+this.props.templateHref);
+    }
+    // 上传参数
+    uploadProps = {
+        // 发到后台的文件参数名
+        name: 'file',
+        // 接受的文件类型
+        accept: '.xls,.xlsx',
+        // 上传的地址
+        action: Host + this.props.url,
+        // 是否展示上传的文件
+        showUploadList:false,
+        // 上传的参数
+        data: {
+            
+            // uid: Cookies.get('uid')
+        },
+        // 设置上传的请求头部,IE10 以上有效
+        headers: {
+            // authorization: 'authorization-text',
+            'Content-Type':'multipart/form-data',
+            'token':this.props.token,
+        },
+        // 上传文件前的钩子函数
+        beforeUpload() {
+            message.loading('正在导入中...');
+            return true;
+        },
+        // 上传文件改变时的状态
+        onChange(info) {
+            if (info.file.status !== 'uploading') {
+                console.log(info.file, info.fileList);
+            }
+            if (info.file.status === 'done') {
+                if (info.file.response.code !== 200) {
+                    setTimeout(() => {
+                        message.destroy();
+                        message.error(info.file.response.message);
+                    });
+                } else {
+                    this.props.importSuccessCallback && this.props.importSuccessCallback();
+                    setTimeout(() => {
+                        message.destroy();
+                        message.success('导入成功');
+                    });
+                }
+            } else if (info.file.status === 'error') {
+                setTimeout(() => {
+                    message.destroy();
+                    message.error('导入失败');
+                });
+            }
+        },
+    }
+
+    // 导出Excel表格
+    exportExcel() {
+        const url = Host + this.props.url + `/export?token=${Cookies.get('token')}&uid=${Cookies.get('uid')}`;
+        window.open(url);
+    }
+
+    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>
+        ]
+    }
+}
+
+// 定义参数类型
+CAUpload.propTypes = {
+    // 模板下载地址
+    templateHref: PropTypes.string.isRequired,
+    // 上传地址
+    url: PropTypes.string.isRequired,
+    // 导入成功后的回调
+    importSuccessCallback: PropTypes.func
+};
+
+
+
+
+
+// const CAUpload = (props)=>{
+    
+//     return (
+//         <Upload {...props}>
+//             <Button type="primary" icon={<ImportOutlined />}>导入</Button>
+//         </Upload>
+//     )
+// }
+
+export default CAUpload;

+ 35 - 0
src/components/Dialog/index.jsx

@@ -0,0 +1,35 @@
+
+
+
+
+import { SearchOutlined } from '@ant-design/icons';
+import { Modal } from 'antd';
+import useMergedState from 'rc-util/es/hooks/useMergedState';
+import React, { Children, useRef, useState } from 'react';
+import classNames from 'classnames';
+// import styles from './index.less';
+
+
+
+const CustomDialog = (props) => {
+    const {
+        title,
+        visible,
+        handleOk=()=>{},
+        handleCancel=()=>{}
+    } = props;
+
+    const [isModalVisible, setIsModalVisible] = useState(true);
+
+    const showModal = () => {
+        setIsModalVisible(true);
+    };
+
+    return (
+        <Modal title={title} visible={visible} onOk={handleOk} onCancel={handleCancel}>
+            {props.Children}
+        </Modal>
+    )
+}
+
+export default CustomDialog

+ 1 - 1
src/components/Footer/index.jsx

@@ -4,7 +4,7 @@ export default () => {
 
   return (
     <DefaultFooter
-      copyright={`2021 新医智联技术出品`}
+      copyright={`2021 康程智医技术出品`}
     />
   );
 };

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

@@ -11,15 +11,24 @@ import { outLogin } from '@/services/ant-design-pro/api';
  * 退出登录,并且将当前的 url 保存
  */
 const loginOut = async () => {
-  await outLogin();
+  // await outLogin();
   const { query = {}, pathname } = history.location;
-  const { redirect } = query; // Note: There may be security issues, please note
+  const { redirect,hospSign } = query; // Note: There may be security issues, please note
+  const loginParams = localStorage.getItem('loginParams');
 
-  if (window.location.pathname !== '/user/login' && !redirect) {
+  let sign;
+  if(loginParams){
+      const {hospSign,hospId} = JSON.parse(loginParams);
+      sign = hospSign;
+  }
+  // &hospSign=${sign}
+  // console.log({redirect,hospSign})
+  if (window.location.pathname !== `/user/login` && !redirect) {
     history.replace({
-      pathname: '/user/login',
+      pathname: `/user/login`,
       search: stringify({
         redirect: pathname,
+        hospSign:sign
       }),
     });
   }

+ 4 - 0
src/global.less

@@ -17,6 +17,10 @@ body,
   filter: invert(80%);
 }
 
+// .customExpandIcon {
+//     position: absolute !important;
+// }
+
 .ant-layout {
   min-height: 100vh;
 }

+ 209 - 37
src/pages/DepartmentMana/index.jsx

@@ -1,51 +1,223 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 10:13:13
+ * @LastEditTime: 2021-07-28 14:33:10
+ * @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, message, Input, Drawer } from 'antd';
-import React, { useState, useRef } from 'react';
+import { Button, Popconfirm, message, Input, Drawer } from 'antd';
+import React, { useState, useRef, useEffect } from 'react';
 import { useIntl, FormattedMessage } from 'umi';
 import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
 import ProTable from '@ant-design/pro-table';
-import { ModalForm, ProFormText, ProFormTextArea } from '@ant-design/pro-form';
-import ProDescriptions from '@ant-design/pro-descriptions';
-// import UpdateForm from './components/UpdateForm';
-import { rule, addRule, updateRule, removeRule } from '@/services/ant-design-pro/api';
-
-
+import { ModalForm, ProFormText, ProFormSelect } from '@ant-design/pro-form';
+import UpdateForm from './updateForm';
+// import CAUpload from '@/components/CAUpload';
+import { getDepartmentList ,editDepartmentList,delDepartment,addDepartment} from './service';
 
 const DepartmentMana = () => {
-  const intl = useIntl();
   const columns = [
-      {
-        title: 'Name',
-        dataIndex: 'name',
-        key: 'name',
-        render: text => <a>{text}</a>,
-      },
-      {
-        title: 'Age',
-        dataIndex: 'age',
-        key: 'age',
-      },
-      {
-        title: 'Address',
-        dataIndex: 'address',
-        key: 'address',
-      },
+    {
+      title: 'ID',
+      dataIndex: 'id',
+      key: 'name',
+      hideInSearch: true,
+      render: (text) => <a>{text}</a>,
+    },
+    {
+      title: '科室名',
+      dataIndex: 'departmentName',
+      key: 'departmentName',
+      hideInSearch: false,
+    },
+    {
+      title: '科室编号',
+      dataIndex: 'departmentCode',
+      key: 'departmentCode',
+      hideInSearch: false,
+    },
+    {
+      title: '医院Id',
+      dataIndex: 'hospId',
+      key: 'hospId',
+      hideInSearch: true,
+    },
+    {
+      title: '创建时间',
+      dataIndex: 'createTime',
+      key: 'createTime',
+      hideInSearch: true,
+    },
+    {
+      title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="Operating" />,
+      dataIndex: 'option',
+      valueType: 'option',
+      render: (_, record) => [
+        <a
+          key="config"
+          onClick={() => {
+            handleUpdateModalVisible(true);
+            console.log({ record });
+            setCurrentRow(record);
+          }}
+        >
+          编辑
+        </a>,
+        <Popconfirm
+          key="subscribeAlert"
+          title="是否确定删除?"
+          onConfirm={() => {
+            setCurrentRow(record);
+            delListHandler(record);
+          }}
+        >
+          <a>删除</a>
+        </Popconfirm>,
+      ],
+    },
   ];
 
+  const [createModalVisible, handleModalVisible] = useState(false);
+  const [updateModalVisible, handleUpdateModalVisible] = useState(false);
+  const actionRef = useRef();
+  const [currentRow, setCurrentRow] = useState({});
+
+  /**
+   *
+   * @param {Boolean} bool 弹窗展示状态
+   */
+  const updateModalVisibleChange = (bool) => {
+    handleUpdateModalVisible(bool);
+    if (!bool) setCurrentRow(undefined);
+  };
+
+  //获取科室列表
+  const getList = async (params = {}, sort, filter) => {
+    const res = await getDepartmentList(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 delDepartment(value);
+    if(resp.status==200){
+      if (actionRef.current) {
+        actionRef.current.reload();
+      }
+    }
+  };
+
+  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: 3, offset: 3 }}
+        layout={'horizontal'}
+        visible={createModalVisible}
+        onVisibleChange={handleModalVisible}
+        onFinish={async (value) => {
+          const success = await addDepartment(value);
+          //   console.log({ success });
+          if (success) {
+            handleModalVisible(false);
+
+            if (actionRef.current) {
+              actionRef.current.reload();
+            }
+          }
+        }}
+      >
+        <ProFormText
+          label="科室名"
+          rules={[
+            {
+              required: true,
+              message: (
+                <FormattedMessage id="pages.searchTable.departmentName" defaultMessage="科室名是必填项" />
+              ),
+            },
+          ]}
+          width="sm"
+          name="departmentName"
+        />
+        <ProFormText
+          label="科室编号"
+          rules={[
+            {
+              required: true,
+              message: (
+                <FormattedMessage id="pages.searchTable.departmentCode" defaultMessage="科室编号是必填项" />
+              ),
+            },
+          ]}
+          width="sm"
+          name="departmentCode"
+        />
+      </ModalForm>
+
+      {/* 更新 */}
+      <UpdateForm
+        onSubmit={async (value) => {
+          console.log({'编辑':value});
+          const success = await editDepartmentList(value);
+
+          if (success) {
+            handleUpdateModalVisible(false);
+            setCurrentRow(undefined);
 
-    return (
-        <PageContainer>
-               <ProTable
-                    columns={columns}
-                    toolBarRender={()=>[
-                        <Button key="button" icon={<PlusOutlined />} type="primary">
-                            新增
-                        </Button>
-                    ]}
-               />
-        </PageContainer>
-    );
+            if (actionRef.current) {
+              actionRef.current.reload();
+            }
+          }
+        }}
+        onCancel={() => {
+          handleUpdateModalVisible(false);
+          setCurrentRow(undefined);
+        }}
+        updateModalVisible={updateModalVisible}
+        updateModalVisibleChange={updateModalVisibleChange}
+        values={currentRow || {}}
+      />
+    </PageContainer>
+  );
 };
 
 export default DepartmentMana;

+ 55 - 0
src/pages/DepartmentMana/service.js

@@ -0,0 +1,55 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 08:54:08
+ * @LastEditTime: 2021-07-28 14:32:20
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/src/pages/DepartmentMana/service.js
+ */
+
+import { request } from 'umi';
+
+
+//获取科室列表
+export async function getDepartmentList(params, options) {
+    const {departmentName,current,pageSize} = params;
+    return request('/api/costAccount/department/list', {
+      method: 'GET',
+      params:{
+          name:departmentName,
+          current,
+          pageSize
+      },
+      ...(options || {}),
+    });
+}
+
+//编辑科室
+export async function editDepartmentList(body, options) {
+  return request('/api/costAccount/department/update', {
+    method: 'POST',
+    data:{...body},
+    ...(options || {}),
+  });
+}
+
+//新增科室
+export async function addDepartment(body, options) {
+  return request('/api/costAccount/department/save', {
+    method: 'POST',
+    data:{...body},
+    ...(options || {}),
+  });
+}
+
+//删除科室
+export async function delDepartment(params, options) {
+  const {id} = params;
+  const ids = [id];
+  return request(`/api/costAccount/department/delete`, {
+    method: 'POST',
+    data:ids,
+    ...(options || {}),
+  });
+}
+

+ 59 - 0
src/pages/DepartmentMana/updateForm.jsx

@@ -0,0 +1,59 @@
+import React from 'react';
+import { Modal } from 'antd';
+import {
+    ProFormSelect,
+    ProFormText,
+    ModalForm,
+} from '@ant-design/pro-form';
+import { useIntl, FormattedMessage } from 'umi';
+
+
+const UpdateForm = (props) => {
+    const {updateModalVisible,updateModalVisibleChange,values,onSubmit} = props;
+    // 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})}
+             >
+               <ProFormText
+                 label="科室名"
+                 rules={[
+                   {
+                     required: true,
+                     message: (
+                       <FormattedMessage id="pages.searchTable.departmentName" defaultMessage="科室名是必填项" />
+                     ),
+                   },
+                 ]}
+                 width="sm"
+                 name="departmentName"
+               />
+               <ProFormText
+                 label="科室编码"
+                 rules={[
+                   {
+                     required: true,
+                     message: (
+                       <FormattedMessage id="pages.searchTable.departmentCode" defaultMessage="科室编码是必填项" />
+                     ),
+                   },
+                 ]}
+                 width="sm"
+                 name="departmentCode"
+               />
+             </ModalForm>
+           }
+        </>
+    );
+};
+
+export default UpdateForm;

+ 1 - 0
src/pages/TableList/index.jsx

@@ -328,6 +328,7 @@ const TableList = () => {
         }}
       >
         <ProFormText
+          label="查询选择器 - valueEnum"
           rules={[
             {
               required: true,

+ 254 - 0
src/pages/UserMana/index.js

@@ -0,0 +1,254 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 10:13:13
+ * @LastEditTime: 2021-07-29 17:14:18
+ * @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, message, Input, Drawer } from 'antd';
+import React, { useState, useRef, useEffect } from 'react';
+import { useIntl, FormattedMessage,useModel } from 'umi';
+import { PageContainer, FooterToolbar } 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 CAUpload from '@/components/CAUpload';
+import { getUserList, addUser, editUser, delUser } from './service';
+
+const UserMana = () => {
+  const columns = [
+    {
+      title: 'Id',
+      dataIndex: 'id',
+      key: 'id',
+      hideInSearch: true,
+      render: (text) => <a>{text}</a>,
+    },
+    {
+      title: '姓名',
+      dataIndex: 'name',
+      key: 'name',
+      render: (text) => <a>{text}</a>,
+    },
+    {
+      title: '用户名',
+      dataIndex: 'account',
+      key: 'account',
+      hideInSearch: true,
+    },
+    {
+      title: '在院状态',
+      dataIndex: 'hospitalStatus',
+      key: 'hospitalStatus',
+      hideInSearch: true,
+    },
+    {
+      title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="Operating" />,
+      dataIndex: 'option',
+      valueType: 'option',
+      render: (_, record) => [
+        <a
+          key="config"
+          onClick={() => {
+            handleUpdateModalVisible(true);
+            console.log({ record });
+            setCurrentRow(record);
+          }}
+        >
+          编辑
+        </a>,
+        <Popconfirm
+          key="subscribeAlert"
+          title="是否确定删除?"
+          onConfirm={() => {
+            setCurrentRow(record);
+            delUserHandler(record);
+          }}
+        >
+          <a>删除</a>
+        </Popconfirm>,
+      ],
+    },
+  ];
+
+  const [createModalVisible, handleModalVisible] = useState(false);
+  const [updateModalVisible, handleUpdateModalVisible] = useState(false);
+  const actionRef = useRef();
+  const [currentRow, setCurrentRow] = useState({});
+  const { initialState, setInitialState } = useModel('@@initialState');
+  const {currentUser:{token}} = initialState;
+
+  console.log({initialState});
+  
+  /**
+   *
+   * @param {Boolean} bool 弹窗展示状态
+   */
+  const updateModalVisibleChange = (bool) => {
+    handleUpdateModalVisible(bool);
+    if (!bool) setCurrentRow(undefined);
+  };
+
+  //获取用户列表
+  const getUserlist = async (params = {}, sort, filter) => {
+    const res = await getUserList(params);
+    return {
+      data: res.data.list,
+      total: res.data.totalCount,
+      success: res.success,
+    };
+  };
+
+  /**
+   *
+   * @param {Object} value 删除项数据
+   */
+  const delUserHandler = async (value) => {
+    const resp = await delUser(value);
+    if(resp.msg){
+      if (actionRef.current) {
+        actionRef.current.reload();
+      }
+    }
+  };
+
+  return (
+    <PageContainer>
+      <ProTable
+        columns={columns}
+        request={getUserlist}
+        actionRef={actionRef}
+        rowKey="id"
+        toolBarRender={() => [
+          <Button
+            key="button"
+            icon={<PlusOutlined />}
+            type="primary"
+            onClick={() => {
+              handleModalVisible(true);
+            }}
+          >
+            新增
+          </Button>,
+          <CAUpload  
+                templateHref={'/costAccount/excel/getImportUserTemplate'}
+                url='/costAccount/excel/importUser'
+                importSuccessCallback={() =>{}}
+                token={token}
+          />
+        ]}
+        pagination={{
+          pageSize: 10,
+        }}
+        search={{
+          defaultCollapsed: false,
+          labelWidth: 'auto',
+        }}
+      />
+
+      <ModalForm
+        title="新增人员"
+        width="800px"
+        labelCol={{ span: 3, offset: 3 }}
+        layout={'horizontal'}
+        visible={createModalVisible}
+        onVisibleChange={handleModalVisible}
+        onFinish={async (value) => {
+          const success = await addUser(value);
+          //   console.log({ success });
+          if (success) {
+            handleModalVisible(false);
+
+            if (actionRef.current) {
+              actionRef.current.reload();
+            }
+          }
+        }}
+      >
+        <ProFormText
+          label="姓名"
+          rules={[
+            {
+              required: true,
+              message: (
+                <FormattedMessage id="pages.searchTable.ruleName" defaultMessage="人员名是必填项" />
+              ),
+            },
+          ]}
+          width="sm"
+          name="name"
+        />
+        <ProFormText
+          label="账户"
+          rules={[
+            {
+              required: true,
+              message: (
+                <FormattedMessage id="pages.searchTable.ruleName" defaultMessage="账户名是必填项" />
+              ),
+            },
+          ]}
+          width="sm"
+          name="account"
+        />
+        <ProFormText
+          label="密码"
+          rules={[
+            {
+              required: true,
+              message: (
+                <FormattedMessage id="pages.searchTable.ruleName" defaultMessage="密码是必填项" />
+              ),
+            },
+          ]}
+          width="sm"
+          name="password"
+        />
+        <ProFormSelect
+          options={[
+            {
+              value: 0,
+              label: '不在院',
+            },
+            {
+              value: 1,
+              label: '在院',
+            },
+          ]}
+          width="sm"
+          name="hospitalStatus"
+          label="在院状态"
+        />
+      </ModalForm>
+
+      {/* 更新 */}
+      <UpdateForm
+        onSubmit={async (value) => {
+          // console.log({value});
+          const success = await editUser(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 UserMana;

+ 49 - 0
src/pages/UserMana/service.js

@@ -0,0 +1,49 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 10:13:31
+ * @LastEditTime: 2021-07-28 10:45:53
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/src/pages/UserMana/service.js
+ */
+
+
+import { request } from 'umi';
+
+//获用户列表
+export async function getUserList(params, options) {
+    return request('/api/costAccount/user/list', {
+      method: 'GET',
+      params: {...params},
+      ...(options || {}),
+    });
+}
+
+//新增人员
+export async function addUser(body, options) {
+    return request('/api/costAccount/user/save', {
+      method: 'POST',
+      data: {...body},
+      ...(options || {}),
+    });
+}
+
+//编辑人员
+export async function editUser(body, options) {
+  return request('/api/costAccount/user/update', {
+    method: 'POST',
+    data: {...body},
+    ...(options || {}),
+  });
+}
+
+//删除人员
+export async function delUser(params, options) {
+  const {id} = params;
+  const ids = [id];
+  return request(`/api/costAccount/user/delete`, {
+    data:ids,
+    method: 'POST',
+    ...(options || {}),
+  });
+}

+ 87 - 0
src/pages/UserMana/updateForm.jsx

@@ -0,0 +1,87 @@
+import React from 'react';
+import { Modal } from 'antd';
+import {
+    ProFormSelect,
+    ProFormText,
+    ModalForm,
+} from '@ant-design/pro-form';
+import { useIntl, FormattedMessage } from 'umi';
+
+
+const UpdateForm = (props) => {
+    const {updateModalVisible,updateModalVisibleChange,values,onSubmit} = props;
+    // 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})}
+             >
+               <ProFormText
+                 label="姓名"
+                 rules={[
+                   {
+                     required: true,
+                     message: (
+                       <FormattedMessage id="pages.searchTable.ruleName" defaultMessage="人员名是必填项" />
+                     ),
+                   },
+                 ]}
+                 width="sm"
+                 name="name"
+               />
+               <ProFormText
+                 label="账户"
+                 rules={[
+                   {
+                     required: true,
+                     message: (
+                       <FormattedMessage id="pages.searchTable.ruleName" defaultMessage="账户名是必填项" />
+                     ),
+                   },
+                 ]}
+                 width="sm"
+                 name="account"
+               />
+               <ProFormText
+                 label="密码"
+                 rules={[
+                   {
+                     required: true,
+                     message: (
+                       <FormattedMessage id="pages.searchTable.ruleName" defaultMessage="密码是必填项" />
+                     ),
+                   },
+                 ]}
+                 width="sm"
+                 name="password"
+               />
+               <ProFormSelect
+                 options={[
+                   {
+                     value: 0,
+                     label: '不在院',
+                   },
+                   {
+                     value: 1,
+                     label: '在院',
+                   },
+                 ]}
+                 width="sm"
+                 name="hospitalStatus"
+                 label="在院状态"
+               />
+             </ModalForm>
+           }
+        </>
+    );
+};
+
+export default UpdateForm;

+ 502 - 0
src/pages/accountingSubject/index.jsx

@@ -0,0 +1,502 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 10:13:13
+ * @LastEditTime: 2021-07-29 17:00:03
+ * @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, Table, Space, Cascader } from 'antd';
+import React, { useState, useRef, useEffect } from 'react';
+import { useIntl, FormattedMessage } from 'umi';
+import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
+import ProTable from '@ant-design/pro-table';
+import ProForm, { ModalForm, ProFormText, ProFormSelect, ProFormDependency, LightFilter, ProFormDatePicker } from '@ant-design/pro-form';
+import UpdateForm from './updateForm';
+// import CAUpload from '@/components/CAUpload';
+import { getAccountingSubjectList, editAccountingSubjectList, delAccountingSubject, addAccountingSubject, getAccountingSubjectForSelecter } from './service';
+import { idText } from 'typescript';
+// import { getApportionmentLevelListNoPage } from '../apportionmentLevel/service';
+
+
+
+const dataSource = [
+  {
+    key: 1,
+    accountingName: 'John Brown sr.',
+    accountingCode: 60,
+    isBaseCost:1,
+    children: [
+      {
+        key: 11,
+        name: 'John Brown',
+        age: 42,
+        address: 'New York No. 2 Lake Park',
+      },
+      {
+        key: 12,
+        name: 'John Brown jr.',
+        age: 30,
+        address: 'New York No. 3 Lake Park',
+        children: [
+          {
+            key: 121,
+            name: 'Jimmy Brown',
+            age: 16,
+            address: 'New York No. 3 Lake Park',
+          },
+        ],
+      },
+      {
+        key: 13,
+        name: 'Jim Green sr.',
+        age: 72,
+        address: 'London No. 1 Lake Park',
+        children: [
+          {
+            key: 131,
+            name: 'Jim Green',
+            age: 42,
+            address: 'London No. 2 Lake Park',
+            children: [
+              {
+                key: 1311,
+                name: 'Jim Green jr.',
+                age: 25,
+                address: 'London No. 3 Lake Park',
+              },
+              {
+                key: 1312,
+                name: 'Jimmy Green sr.',
+                age: 18,
+                address: 'London No. 4 Lake Park',
+              },
+            ],
+          },
+        ],
+      },
+    ],
+  },
+  {
+    key: 2,
+    name: 'Joe Black',
+    age: 32,
+    address: 'Sidney No. 1 Lake Park',
+  },
+];
+
+const AccountingSubject = () => {
+  const columns = [
+    {
+      title: '会计科目名称',
+      dataIndex: 'accountingName',
+      key: 'accountingName',
+      hideInSearch: false,
+      width: '30%'
+    },
+    {
+      title: '会计科目编码',
+      dataIndex: 'accountingCode',
+      key: 'accountingCode',
+      hideInSearch: true,
+      width: '30%'
+    },
+    {
+      title: '是否固定成本',
+      dataIndex: 'isBaseCost',
+      key: 'isBaseCost',
+      hideInSearch: true,
+      render: (text) => <>{text == 1 ? '是' : '否'}</>,
+      width: '20%'
+    },
+    {
+      title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="Operating" />,
+      dataIndex: 'option',
+      valueType: 'option',
+      key: 'option',
+      width: '15%',
+      render: (_, record) => [
+        <a
+          key="config"
+          onClick={() => {
+            setCurrentRow(record);
+            handleModalVisible(true)
+          }}
+        >
+          添加
+        </a>,
+        <a
+          key="config"
+          onClick={() => {
+            handleUpdateModalVisible(true);
+            setCurrentRow(record);
+          }}
+        >
+          编辑
+        </a>,
+        <Popconfirm
+          key="subscribeAlert"
+          title="是否确定删除?"
+          onConfirm={() => {
+            setCurrentRow(record);
+            delListHandler(record);
+          }}
+        >
+          <a>删除</a>
+        </Popconfirm>,
+      ],
+    },
+  ];
+
+  const [createModalVisible, handleModalVisible] = useState(false);
+  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 [accountType, setAccountType] = useState(1);
+  const [options, setOptions] = useState([]);
+  const [selectedAccountingSubject, setSelectedAccountingSubject] = useState([]);
+  const [ifChild, setIfChild] = useState(false);
+  const [expanedRowIds,setExpanedRowIds] = useState([]);
+
+
+  /**
+   *
+   * @param {Boolean} bool 弹窗展示状态
+   */
+  const updateModalVisibleChange = (bool) => {
+    handleUpdateModalVisible(bool);
+    setIfChild(false);
+    if (!bool) setCurrentRow(undefined);
+  };
+
+
+
+  //获取科室列表
+  const getList = async (params = {}, sort, filter) => {
+    const res = await getAccountingSubjectList({ ...params, accountType: accountType });
+    // 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 delAccountingSubject(value);
+    if (resp.status == 200) {
+      if (actionRef.current) {
+        actionRef.current.reload();
+      }
+    }
+  };
+
+  const expandHandle = id=>{
+    console.log({id,expanedRowIds});
+    if(expanedRowIds.includes(id)){
+      const temp = expanedRowIds;
+      temp.splice(temp.findIndex(item => item == id), 1);
+      setExpanedRowIds([...temp])
+    }else{
+      setExpanedRowIds([...expanedRowIds,id])
+    }
+  }
+  
+
+  /**
+   * 
+   * @param {Object} record  record对象
+   * @param {String} type  可选值[del,edit,‘add’]
+   */
+  const customRowUpdata = (record,type)=>{
+      //  console.log({record});
+       const {accountingCode,accountingName,id} = record;
+       const needRowData = {accountingCode,accountingName,id};
+       setIfChild(true);
+       setCurrentRow(needRowData);
+    
+       if(type == 'add')handleModalVisible(true);
+       if(type == 'edit')handleUpdateModalVisible(true);
+       if(type == 'del')delListHandler(needRowData);
+  }
+
+  //展开table
+  const expandedRowRender = (record, index, indent, expanded) => {
+    // console.log({ record, index, indent, expanded });
+    const { child } = record;
+    const _columns = columns.filter(item => !(['id', 'option'].includes(item.key)));
+
+    return (<table>
+      <tbody>
+        {
+          child&&child.map((item, index) => {
+            const { accountingCode, accountingName, id, child } = item;
+            console.log({ accountingCode, accountingName, id, child });
+            return (
+              <React.Fragment  key={index}>
+                <tr key={id} style={{ position: 'relative' }}>
+                  <td>
+                    <table>
+                      <tbody>
+                      <tr>
+                        <td style={{ position: 'absolute', width: 0 }}>
+                          {
+                            child&&child.length > 0 &&(
+                              <button onClick={()=>expandHandle(id)} style={{top:12}} className={
+                                expanedRowIds.includes(id)?'ant-table-row-expand-icon ant-table-row-expand-icon-expanded':'ant-table-row-expand-icon ant-table-row-expand-icon-collapsed'
+                              }></button>
+                            ) 
+                          }
+                          {/* <button className="ant-table-row-expand-icon ant-table-row-expand-icon-expanded customExpandIcon"></button> */}
+                        </td>
+                        <td width="30%" style={{ paddingLeft: '0.8%',paddingTop:10,paddingBottom:10 }}><span style={{transform:'rotateY(180deg)'}}>↵</span>会计科目名称:{accountingName}</td>
+                        <td width="30%" style={{ paddingLeft: '0.3%' }}>会计科目编码:{accountingCode}</td>
+                        <td width="20%" style={{ paddingLeft: '0.7%' }}>否</td>
+                        <td width="15%" style={{ paddingLeft: '0.9%' }}>
+                          <a onClick={()=>customRowUpdata(item,'add')}>添加</a>
+                          <a onClick={()=>customRowUpdata(item,'edit')}>编辑</a>
+                          <a onClick={()=>customRowUpdata(item,'del')}>删除</a>
+                        </td>
+                      </tr>
+                      </tbody>
+                    </table>
+                  </td>
+                </tr>
+                {
+                  expanedRowIds.includes(id)&&<tr key={`expand${id}`}>
+                  <td width="100%">
+                    <table>
+                      <tbody>
+                        {
+                          child.map((data, index) => {
+                    
+                            const { accountingCode, accountingName, id, child } = data;
+                            return (
+                              <tr key={id} style={{ position: 'relative' }}>
+                                <td style={{ position: 'absolute', width: 0 }}>
+                                  {
+                                   child&&child.length > 0 && <button  class="ant-table-row-expand-icon ant-table-row-expand-icon-collapsed"></button>
+                                 }
+                                </td>
+                                <td width="30%" style={{ paddingLeft: '2.5%',paddingTop:10,paddingBottom:10 }}>↵会计科目名称:{accountingName}</td>
+                                <td width="30%" style={{ paddingLeft: '0.3%' }}>会计科目编码:{accountingCode}</td>
+                                <td width="20%" style={{ paddingLeft: '0.7%' }}>否</td>
+                                <td width="15%" style={{ paddingLeft: '0.9%' }}><a >编辑</a></td>
+                              </tr>
+                            )
+                          })
+                        }
+                      </tbody>
+                    </table>
+                  </td>
+                </tr>
+                }
+              </React.Fragment>
+            )
+          })
+        }
+      </tbody>
+    </table>
+    )
+    
+  };
+
+
+  useEffect(async () => {
+    const respForSelecter = await getAccountingSubjectForSelecter();
+    if (respForSelecter.status == 200) {
+      setOptions(respForSelecter.data);
+    }
+  }, [])
+
+  return (
+    <PageContainer>
+
+      <ProTable
+        columns={columns}
+        request={getList}
+        actionRef={actionRef}
+        rowKey="id"
+        expandable={{defaultExpandedRowKeys:[]}}
+        // expandable={{ expandedRowRender }}
+        toolbar={{
+          actions: [
+            <Button
+              key="button"
+              // icon={<PlusOutlined />}
+              type="primary"
+              onClick={() => {
+                setAccountType(1)
+              }}
+            >
+              收入
+            </Button>,
+            <Button
+              key="button"
+              // icon={<PlusOutlined />}
+              type="primary"
+              onClick={() => {
+                setAccountType(2)
+              }}
+            >
+              支出
+            </Button>,
+            <Button
+              key="button"
+              icon={<PlusOutlined />}
+              type="primary"
+              onClick={() => {
+                handleModalVisible(true);
+              }}
+            >
+              新增
+            </Button>
+          ],
+        }}
+        search={false}
+        pagination={{
+          pageSize: 10,
+        }}
+      />
+
+      <ModalForm
+        title="新增会计科目"
+        width="800px"
+        labelCol={{ span: 5, offset: 3 }}
+        layout={'horizontal'}
+        visible={createModalVisible}
+        onVisibleChange={(bool) => {
+          console.log({ currentRow });
+          if (ref.current) {
+            ref.current.resetFields();
+          }
+          setIfChild(false);
+          handleModalVisible(bool);
+        }}
+        formRef={ref}
+        onFinish={async (value) => {
+          const { id } = currentRow;
+          const success = await addAccountingSubject({ ...value, id: id ? id : 0 });
+          //   console.log({ success });
+          if (success) {
+            handleModalVisible(false);
+
+            if (actionRef.current) {
+              actionRef.current.reload();
+            }
+          }
+        }}
+      >
+       
+
+        <ProFormText
+          label="会计科目编码"
+          rules={[
+            {
+              required: true,
+              message: (
+                <FormattedMessage id="pages.searchTable.accountingCode" defaultMessage="会计科目编码是必填项" />
+              ),
+            },
+          ]}
+          width="sm"
+          name="accountingCode"
+        />
+        <ProFormText
+          label="会计科目名"
+          rules={[
+            {
+              required: true,
+              message: (
+                <FormattedMessage id="pages.searchTable.accountingName" defaultMessage="会计科目名是必填项" />
+              ),
+            },
+          ]}
+          width="sm"
+          name="accountingName"
+        />
+        <ProFormSelect
+          rules={[
+            {
+              required: true,
+              message: (
+                <FormattedMessage id="pages.searchTable.accountingType" defaultMessage="请选择会计科目类型" />
+              ),
+            },
+          ]}
+          options={[
+            {
+              value: 1,
+              label: '收入',
+            },
+            {
+              value: 2,
+              label: '支出',
+            },
+          ]}
+          width="sm"
+          name="accountingType"
+          label="会计科目类型"
+        />
+        <ProFormSelect
+          rules={[
+            {
+              required: false,
+              message: (
+                <FormattedMessage id="pages.searchTable.isBaseCode" defaultMessage="请选择" />
+              ),
+            },
+          ]}
+          options={[
+            {
+              value: 0,
+              label: '不是',
+            },
+            {
+              value: 1,
+              label: '是',
+            },
+          ]}
+          width="sm"
+          name="isBaseCode"
+          label="是否固定成本"
+        />
+      </ModalForm>
+
+      {/* 更新 */}
+      <UpdateForm
+        onSubmit={async (value) => {
+          console.log({ '编辑': value });
+          const success = await editAccountingSubjectList(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 AccountingSubject;

+ 57 - 0
src/pages/accountingSubject/service.js

@@ -0,0 +1,57 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 08:54:08
+ * @LastEditTime: 2021-07-28 19:10:38
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/src/pages/DepartmentMana/service.js
+ */
+
+import { request } from 'umi';
+
+
+//获取会计科目列表
+export async function getAccountingSubjectList(params, options) {
+    return request('/api/costAccount/accounting/list', {
+      method: 'GET',
+      params:{...params},
+      ...(options || {}),
+    });
+}
+
+//编辑会计科目
+export async function editAccountingSubjectList(body, options) {
+  return request('/api/costAccount/accounting/edit', {
+    method: 'POST',
+    data:{...body},
+    ...(options || {}),
+  });
+}
+
+//新增会计科目
+export async function addAccountingSubject(body, options) {
+  return request('/api/costAccount/accounting/save', {
+    method: 'POST',
+    data:{...body},
+    ...(options || {}),
+  });
+}
+
+//删除会计科目
+export async function delAccountingSubject(params, options) {
+  const {id} = params;
+  return request(`/api/costAccount/accounting/delete?id=${id}`, {
+    method: 'POST',
+    ...(options || {}),
+  });
+}
+
+//获取所有可选会计科目
+export async function getAccountingSubjectForSelecter(params, options) {
+
+  return request(`/api/costAccount/accounting/selectAccounting`, {
+    method: 'GET',
+    ...(options || {}),
+  });
+}
+

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

@@ -0,0 +1,64 @@
+import React, { useState } from 'react';
+import {
+  ProFormSelect,
+  ProFormText,
+  ModalForm,
+  ProFormDependency
+} from '@ant-design/pro-form';
+import { useIntl, FormattedMessage } from 'umi';
+
+import { getApportionmentLevelListNoPage } from '../apportionmentLevel/service';
+
+
+const UpdateForm = (props) => {
+  const { updateModalVisible, updateModalVisibleChange, values, onSubmit } = props;
+  const [selectedLevelList, setSelectedLevelList] = useState(null); //可选的分摊层级列表
+  const [selectedLevel, setSelectedLevel] = useState(null);
+  // 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 })}
+        >
+          <ProFormText
+            label="会计科目编码"
+            rules={[
+              {
+                required: true,
+                message: (
+                  <FormattedMessage id="pages.searchTable.accountingCode" defaultMessage="会计科目编码是必填项" />
+                ),
+              },
+            ]}
+            width="sm"
+            name="accountingCode"
+          />
+          <ProFormText
+            label="会计科目名"
+            rules={[
+              {
+                required: true,
+                message: (
+                  <FormattedMessage id="pages.searchTable.accountingName" defaultMessage="会计科目名是必填项" />
+                ),
+              },
+            ]}
+            width="sm"
+            name="accountingName"
+          />
+          
+        </ModalForm>
+      }
+    </>
+  );
+};
+
+export default UpdateForm;

+ 220 - 0
src/pages/accountingSubjectConnect/index.jsx

@@ -0,0 +1,220 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 10:13:13
+ * @LastEditTime: 2021-07-29 16:56: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 { Button, Space, Table, Tag } from 'antd';
+import React, { useState, useRef, useEffect } from 'react';
+import { useIntl, FormattedMessage } from 'umi';
+import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
+import ProTable from '@ant-design/pro-table';
+import { DrawerForm, formRef } from '@ant-design/pro-form';
+import UpdateForm from './updateForm';
+// import CAUpload from '@/components/CAUpload';
+import { getAccountProductConnectList,getAccountProductConnectableList,saveAccountProductConnected } from './service';
+
+const ResponsibilityCenterConnect = () => {
+  const columns = [
+    {
+      title: '会计科目名称',
+      dataIndex: 'accountingName',
+      key: 'accountingName',
+      hideInSearch: false,
+      width: '20%'
+    },
+    {
+      title: '会计科目编号',
+      dataIndex: 'accountingCode',
+      key: 'accountingCode',
+      hideInSearch: true,
+      width: '20%'
+    },
+    {
+      title: '成本列表',
+      dataIndex: 'productVOs',
+      key: 'productVOs',
+      hideInSearch: false,
+      render: (productVOs) => {
+
+        if (Array.isArray(productVOs)) {
+          return productVOs.map((item, index) => { return <Tag key={index}>{item.productName}</Tag> })
+        } else {
+          return <></>
+        }
+      }
+    },
+    {
+      title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="Operating" />,
+      dataIndex: 'option',
+      key: 'option',
+      valueType: 'option',
+      width: '15%',
+      render: (_, record) => {
+        const { isParent } = record;
+        return !isParent ? [
+          <a
+            key="config"
+            onClick={() => {
+              setDrawerVisible(true);
+              setCurrentRow(record);
+            }}
+          >
+            绑定成本中心
+          </a>,
+        ] : []
+      },
+    }
+  ];
+  const drawerTableColumns = [
+    {
+      title: 'Id',
+      dataIndex: 'id',
+      key: 'id',
+      hideInSearch: true,
+    },
+    {
+      title: '成本中心名称',
+      dataIndex: 'name',
+      key: 'name',
+      hideInSearch: false,
+    }
+
+  ];
+
+  const actionRef = useRef();  //表格
+  const drawerFormRef = useRef(); //DrawerForm
+  const actionDrawertableRef = useRef(); //Drawertable
+  const [currentRow, setCurrentRow] = useState({});
+  const [drawerVisible, setDrawerVisible] = useState(false);
+  const [selectedRowKeys,setSelectedRowKeys] = useState([]);
+
+  /**
+   * 
+   * @param {Boolean} bool 
+   */
+  const drawerVisibleChange = (bool) => {
+    // console.log({currentRow});
+    const {productVOs} = currentRow;
+    console.log({currentRow});
+    const selected = productVOs?productVOs.map(item=>item.id):[];
+    if (bool)setSelectedRowKeys(selected==undefined?[]:selected);
+    setDrawerVisible(bool);
+    if (!bool) setCurrentRow(undefined);
+  }
+
+
+  //获取责任中心对应列表
+  const getList = async (params = {}, sort, filter) => {
+    const res = await getAccountProductConnectList(params);
+    // console.log({res});
+    return {
+      data: res.data.list,
+      total: res.data.totalCount,
+      success: res.success,
+    };
+  };
+
+  //获取责任中心可绑定科室列表
+  const getConnectableList = async (params = {}, sort, filter)=>{
+    const {responsibilityId} = currentRow;
+    const res = await getAccountProductConnectableList({...params,responsibilityId});
+    const {data,status} = res;
+    // console.log({res,data,status});
+    if(status == 200){
+        return {
+          data:data,
+          success:true,
+        }
+    }
+  }
+
+
+  return (
+    <PageContainer>
+      <ProTable
+        columns={columns}
+        request={getList}
+        actionRef={actionRef}
+        rowKey="id"
+        childrenColumnName="child"
+        expandable={{ defaultExpandedRowKeys: [] }}
+        toolBarRender={() => []}
+
+        pagination={{
+          pageSize: 10,
+        }}
+
+        search={false}
+
+      />
+      <DrawerForm
+        title="可绑定成本中心列表"
+        formRef={drawerFormRef}
+        visible={drawerVisible}
+        onVisibleChange={(visible) => drawerVisibleChange(visible)}
+        // onFinish={(value) => onSubmit({ ...values, ...value })}
+        onFinish={async ()=>{
+             console.log({selectedRowKeys,currentRow});
+             const {id} = currentRow;
+             const resp = await saveAccountProductConnected({id,products:selectedRowKeys});
+             const {status} = resp;
+             if(status==200){
+              setDrawerVisible(false);
+              if (actionRef.current) {
+                actionRef.current.reload();
+              }
+             }
+        }}
+      >
+        <ProTable
+          columns={drawerTableColumns}
+          request={getConnectableList}
+          rowKey="id"
+          toolBarRender={() => []}
+          actionRef={actionDrawertableRef}
+          pagination={{
+            pageSize: 10,
+          }}
+          rowSelection={{
+            // 自定义选择项参考: https://ant.design/components/table-cn/#components-table-demo-row-selection-custom
+            // 注释该行则默认不显示下拉选项
+            selectedRowKeys,
+            selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT],
+            onChange:(selectedRowKeys)=>{
+              setSelectedRowKeys([...selectedRowKeys]);
+            }
+          }}
+          tableAlertRender={({ selectedRowKeys, selectedRows, onCleanSelected }) => {
+              // console.log({selectedRowKeys});
+              return (
+                <Space size={24}>
+                  <span>
+                    已选 {selectedRowKeys.length} 项
+                    <a style={{ marginLeft: 8 }} onClick={onCleanSelected}>
+                      取消选择
+                    </a>
+                  </span>
+                </Space>
+              )
+          }}
+          tableAlertOptionRender={() => {
+            return (
+              <Space size={16}>
+                {/* <a>批量绑定</a> */}
+              </Space>
+            );
+          }}
+          search={false}
+
+        />
+      </DrawerForm>
+    </PageContainer>
+  );
+};
+
+export default ResponsibilityCenterConnect;

+ 43 - 0
src/pages/accountingSubjectConnect/service.js

@@ -0,0 +1,43 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 08:54:08
+ * @LastEditTime: 2021-07-29 16:38:10
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/src/pages/DepartmentMana/service.js
+ */
+
+import { request } from 'umi';
+
+
+//获取会计科目对应列表
+export async function getAccountProductConnectList(params, options) {
+    return request('/api/costAccount/accountProduct/list', {
+      method: 'GET',
+      params:{...params},
+      ...(options || {}),
+    });
+}
+
+
+//获取责任中心对应可绑定科室列表
+export async function getAccountProductConnectableList(params, options) {
+  
+  return request('/api/costAccount/product/getProducts', {
+    method: 'GET',
+    params:{...params},
+    ...(options || {}),
+  });
+}
+
+//保存绑定信息
+export async function saveAccountProductConnected(body, options) {
+  return request('/api/costAccount/accountProduct/save', {
+    method: 'POST',
+    data:{...body},
+    ...(options || {}),
+  });
+}
+
+
+

+ 135 - 0
src/pages/accountingSubjectConnect/updateForm.jsx

@@ -0,0 +1,135 @@
+import React from 'react';
+import {
+  ProFormSelect,
+  ProFormText,
+  ModalForm,
+  ProFormDependency
+} from '@ant-design/pro-form';
+import { useIntl, FormattedMessage } from 'umi';
+
+
+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 })}
+        >
+          <ProFormText
+            label="责任中心名"
+            rules={[
+              {
+                required: true,
+                message: (
+                  <FormattedMessage id="pages.searchTable.responsibilityName" defaultMessage="医院名是必填项" />
+                ),
+              },
+            ]}
+            width="sm"
+            name="responsibilityName"
+          />
+          <ProFormSelect
+            rules={[
+              {
+                required: true,
+                message: (
+                  <FormattedMessage id="pages.searchTable.isGatherCenter" defaultMessage="请选择是否为汇总中心" />
+                ),
+              },
+            ]}
+            options={[
+              {
+                value: 1,
+                label: '是',
+              },
+              {
+                value: 0,
+                label: '否',
+              },
+            ]}
+            width="sm"
+            name="isGatherCenter"
+            label="是否汇总中心"
+          />
+          <ProFormSelect
+            rules={[
+              {
+                required: true,
+                message: (
+                  <FormattedMessage id="pages.searchTable.responsibilityType" defaultMessage="请选择责任类型" />
+                ),
+              },
+            ]}
+            options={[
+              {
+                value: 1,
+                label: '收费中心',
+              },
+              {
+                value: 2,
+                label: '成本(费用)中心',
+              },
+            ]}
+            width="sm"
+            name="responsibilityType"
+            label="选择责任类型"
+          />
+          <ProFormSelect
+            rules={[
+              {
+                required: true,
+                message: (
+                  <FormattedMessage id="pages.searchTable.shareLevel" defaultMessage="请选择分摊级别" />
+                ),
+              },
+            ]}
+            options={[
+              {
+                value: 1,
+                label: '收费中心',
+              },
+              {
+                value: 2,
+                label: '成本(费用)中心',
+              },
+            ]}
+            width="sm"
+            name="shareLevel"
+            label="选择分摊级别"
+          />
+
+          <ProFormDependency name={['shareLevel']}>
+            {({ label }) => {
+              return label ? (
+                <ProFormText
+                  initialValue={label}
+                  label="主医院名称"
+                  rules={[
+                    {
+                      required: false,
+                      message: (
+                        <FormattedMessage id="pages.searchTable.parentName" defaultMessage="..." />
+                      ),
+                    },
+                  ]}
+                  width="sm"
+                />
+              ) : <></>;
+            }}
+          </ProFormDependency>
+        </ModalForm>
+      }
+    </>
+  );
+};
+
+export default UpdateForm;

+ 274 - 0
src/pages/apportionmentLevel/index.jsx

@@ -0,0 +1,274 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 10:13:13
+ * @LastEditTime: 2021-07-27 19:44:56
+ * @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, Table, Space } from 'antd';
+import React, { useState, useRef, useEffect } from 'react';
+import { useIntl, FormattedMessage } from 'umi';
+import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
+import ProTable from '@ant-design/pro-table';
+import { ModalForm, ProFormText, ProFormSelect, ProFormDependency } from '@ant-design/pro-form';
+import UpdateForm from './updateForm';
+// import CAUpload from '@/components/CAUpload';
+import { getApportionmentLevelList, editApportionmentLevelList, delApportionmentLevel, addApportionmentLevel } from './service';
+
+const ApportionmentLevel = () => {
+  const columns = [
+
+    {
+      title: '分摊层级名',
+      dataIndex: 'shareName',
+      key: 'shareName',
+      hideInSearch: false,
+    },
+    {
+      title: '分摊层级序号',
+      dataIndex: 'leverSort',
+      key: 'leverSort',
+      hideInSearch: true,
+    },
+    {
+      title: '目标层级',
+      dataIndex: 'targetLevel',
+      key: 'targetLevel',
+      hideInSearch: true,
+    },
+    {
+      title: '计算方式',
+      dataIndex: 'calcType',
+      key: 'calcType',
+      hideInSearch: true,
+      render: (text) => <a>{text == 0 ? '合并计算' : '分开计算'}</a>,
+    },
+    {
+      title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="Operating" />,
+      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 [createModalVisible, handleModalVisible] = useState(false);
+  const [updateModalVisible, handleUpdateModalVisible] = useState(false);
+  const actionRef = useRef();
+  const [currentRow, setCurrentRow] = useState({});
+
+  /**
+   *
+   * @param {Boolean} bool 弹窗展示状态
+   */
+  const updateModalVisibleChange = (bool) => {
+    handleUpdateModalVisible(bool);
+    if (!bool) setCurrentRow(undefined);
+  };
+
+  //获取科室列表
+  const getList = async (params = {}, sort, filter) => {
+
+    const res = await getApportionmentLevelList(params);
+    return {
+      data: res.data.list,
+      total: res.data.totalCount,
+      success: res.success,
+    };
+  };
+
+  /**
+   *
+   * @param {Object} value 删除项数据
+   */
+  const delListHandler = async (value) => {
+    const resp = await delApportionmentLevel(value);
+    console.log({ resp });
+  };
+
+  return (
+    <PageContainer>
+      <ProTable
+        columns={columns}
+        request={getList}
+        actionRef={actionRef}
+        rowKey="id"
+        toolBarRender={() => [
+          <Button
+            key="button"
+            icon={<PlusOutlined />}
+            type="primary"
+            onClick={() => {
+              handleModalVisible(true);
+            }}
+          >
+            新增
+          </Button>
+        ]}
+        rowSelection={{
+          selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT],
+        }}
+        pagination={{
+          pageSize: 10,
+        }}
+        search={{
+          defaultCollapsed: false,
+          labelWidth: 'auto',
+        }}
+        tableAlertOptionRender={({ selectedRowKeys, selectedRows, onCleanSelected }) => {
+          // console.log({selectedRowKeys, selectedRows, onCleanSelected});
+          return (
+            <Space size={16}>
+              <span>
+                <a style={{ marginLeft: 8 }} onClick={onCleanSelected}>
+                  取消选择
+                </a>
+              </span>
+              <Popconfirm
+                title="是否确定批量删除选中列表?"
+                onConfirm={() => {
+                  delListHandler({ id: selectedRowKeys });
+                }}
+              >
+                <a>批量删除</a>
+              </Popconfirm>
+            </Space>
+          );
+        }}
+      />
+
+      <ModalForm
+        title="新增分摊层级"
+        width="800px"
+        labelCol={{ span: 5, offset: 3 }}
+        layout={'horizontal'}
+        visible={createModalVisible}
+        onVisibleChange={handleModalVisible}
+        onFinish={async (value) => {
+          const success = await addApportionmentLevel(value);
+          //   console.log({ success });
+          if (success) {
+            handleModalVisible(false);
+
+            if (actionRef.current) {
+              actionRef.current.reload();
+            }
+          }
+        }}
+      >
+        <ProFormText
+          label="分摊层级序号"
+          rules={[
+            {
+              required: true,
+              message: (
+                <FormattedMessage id="pages.searchTable.leverSort" defaultMessage="分摊层级序号是必填项" />
+              ),
+            },
+          ]}
+          width="sm"
+          name="leverSort"
+        />
+
+        <ProFormText
+          label="分摊层级名"
+          rules={[
+            {
+              required: true,
+              message: (
+                <FormattedMessage id="pages.searchTable.shareName" defaultMessage="分摊层级名是必填项" />
+              ),
+            },
+          ]}
+          width="sm"
+          name="shareName"
+        />
+        <ProFormText
+          label="目标层级"
+          rules={[
+            {
+              required: true,
+              message: (
+                <FormattedMessage id="pages.searchTable.targetLevel" defaultMessage="目标层级是必填项" />
+              ),
+            },
+          ]}
+          width="sm"
+          name="targetLevel"
+        />
+        <ProFormSelect
+          rules={[
+            {
+              required: true,
+              message: (
+                <FormattedMessage id="pages.searchTable.calcType" defaultMessage="请选择计算方式" />
+              ),
+            },
+          ]}
+          options={[
+            {
+              value: 0,
+              label: '合并计算',
+            },
+            {
+              value: 1,
+              label: '分开计算',
+            },
+          ]}
+          width="sm"
+          name="calcType"
+          label="计算方式"
+        />
+
+      </ModalForm>
+
+      {/* 更新 */}
+      <UpdateForm
+        onSubmit={async (value) => {
+          console.log({ '编辑': value });
+          const success = await editApportionmentLevelList(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 ApportionmentLevel;

+ 62 - 0
src/pages/apportionmentLevel/service.js

@@ -0,0 +1,62 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 08:54:08
+ * @LastEditTime: 2021-07-28 15:10:14
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/src/pages/DepartmentMana/service.js
+ */
+
+import { request } from 'umi';
+
+
+//获取分摊层级列表
+export async function getApportionmentLevelList(params, options) {
+    const  {shareName,current,pageSize,} = params;
+    return request('/api/costAccount/costsharelevel/list', {
+      method: 'GET',
+      params:{
+           name:shareName,
+           current,
+           pageSize
+      },
+      ...(options || {}),
+    });
+}
+
+
+//获取分摊层级列表无分页
+export async function getApportionmentLevelListNoPage(params, options) {
+  return request('/api/costAccount/costsharelevel/list', {
+    method: 'GET',
+    ...(options || {}),
+  });
+}
+
+//编辑分摊层级
+export async function editApportionmentLevelList(body, options) {
+  return request('/api/costAccount/costsharelevel/update', {
+    method: 'POST',
+    data:{...body},
+    ...(options || {}),
+  });
+}
+
+//新增分摊层级
+export async function addApportionmentLevel(body, options) {
+  return request('/api/costAccount/costsharelevel/save', {
+    method: 'POST',
+    data:{...body},
+    ...(options || {}),
+  });
+}
+
+//删除分摊层级
+export async function delApportionmentLevel(params, options) {
+  const {id} = params;
+  return request(`/api/costAccount/costsharelevel/delete?ids=${id}`, {
+    method: 'POST',
+    ...(options || {}),
+  });
+}
+

+ 96 - 0
src/pages/apportionmentLevel/updateForm.jsx

@@ -0,0 +1,96 @@
+import React from 'react';
+import {
+  ProFormSelect,
+  ProFormText,
+  ModalForm,
+  ProFormDependency
+} from '@ant-design/pro-form';
+import { useIntl, FormattedMessage } from 'umi';
+
+
+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 })}
+        >
+          <ProFormText
+            label="分摊层级序号"
+            rules={[
+              {
+                required: true,
+                message: (
+                  <FormattedMessage id="pages.searchTable.leverSort" defaultMessage="分摊层级序号是必填项" />
+                ),
+              },
+            ]}
+            width="sm"
+            name="leverSort"
+          />
+
+          <ProFormText
+            label="分摊层级名"
+            rules={[
+              {
+                required: true,
+                message: (
+                  <FormattedMessage id="pages.searchTable.shareName" defaultMessage="分摊层级名是必填项" />
+                ),
+              },
+            ]}
+            width="sm"
+            name="shareName"
+          />
+          <ProFormText
+            label="目标层级"
+            rules={[
+              {
+                required: true,
+                message: (
+                  <FormattedMessage id="pages.searchTable.targetLevel" defaultMessage="目标层级是必填项" />
+                ),
+              },
+            ]}
+            width="sm"
+            name="targetLevel"
+          />
+          <ProFormSelect
+            rules={[
+              {
+                required: true,
+                message: (
+                  <FormattedMessage id="pages.searchTable.calcType" defaultMessage="请选择计算方式" />
+                ),
+              },
+            ]}
+            options={[
+              {
+                value: 0,
+                label: '合并计算',
+              },
+              {
+                value: 1,
+                label: '分开计算',
+              },
+            ]}
+            width="sm"
+            name="calcType"
+            label="计算方式"
+          />
+        </ModalForm>
+      }
+    </>
+  );
+};
+
+export default UpdateForm;

+ 275 - 0
src/pages/costAllocationParamsConnect/index.jsx

@@ -0,0 +1,275 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 10:13:13
+ * @LastEditTime: 2021-07-29 20:09: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, useEffect } from 'react';
+import { useIntl, FormattedMessage } from 'umi';
+import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
+import ProTable from '@ant-design/pro-table';
+import ProForm, { ModalForm, ProFormDependency, ProFormSelect, ProFormTextArea } from '@ant-design/pro-form';
+import UpdateForm from './updateForm';
+// import CAUpload from '@/components/CAUpload';
+import {
+  getCostshareparamConnectList, editCostshareparamConnectList, delCostshareparamConnect,
+  addCostshareparamConnect, getResponsibilityCenterSelecterList, getAccountingSubjectForSelecter
+} from './service';
+
+const DepartmentMana = () => {
+  const columns = [
+
+    {
+      title: '分摊级别',
+      dataIndex: 'shareLevel',
+      key: 'shareLevel',
+      hideInSearch: true,
+    },
+    {
+      title: '责任中心编码',
+      dataIndex: 'responsibilityCode',
+      key: 'responsibilityCode',
+      hideInSearch: true,
+    },
+    {
+      title: '责任中心名',
+      dataIndex: 'responsibilityName',
+      key: 'responsibilityName',
+      hideInSearch: false,
+    },
+    {
+      title: '成本项目名称',
+      dataIndex: 'accountingName',
+      key: 'accountingName',
+      hideInSearch: true,
+    },
+    {
+      title: '成本项目编码',
+      dataIndex: 'accountingCode',
+      key: 'accountingCode',
+      hideInSearch: true,
+    },
+    {
+      title: '备注',
+      dataIndex: 'costNode',
+      key: 'costNode',
+      hideInSearch: true,
+    },
+    {
+      title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="Operating" />,
+      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 [createModalVisible, handleModalVisible] = useState(false);
+  const [updateModalVisible, handleUpdateModalVisible] = useState(false);
+  const [cascaderOptions, setCascaderOptions] = useState([]);
+  const actionRef = useRef(); //表格
+  const ref = useRef();   //新增表单
+  const [selectedCascader, setSelectedCascader] = useState(null);
+  const [currentRow, setCurrentRow] = useState({});
+
+  /**
+   *
+   * @param {Boolean} bool 弹窗展示状态
+   */
+  const updateModalVisibleChange = (bool) => {
+    handleUpdateModalVisible(bool);
+    if (!bool) setCurrentRow(undefined);
+  };
+
+  //获取科室列表
+  const getList = async (params = {}, sort, filter) => {
+    const res = await getCostshareparamConnectList(params);
+    return {
+      data: res.data.list,
+      total: res.data.totalCount,
+      success: res.success,
+    };
+  };
+
+  /**
+   *
+   * @param {Object} value 删除项数据
+   */
+  const delListHandler = async (value) => {
+    const resp = await delCostshareparamConnect(value);
+    if (resp.status == 200) {
+      if (actionRef.current) {
+        actionRef.current.reload();
+      }
+    }
+  };
+
+  //级联回调
+  const cascaderChangeHandle = (value) => {
+    console.log({ value });
+    setSelectedCascader(value[value.length - 1]);
+  }
+
+
+  useEffect(async () => {
+    const respForSelecter = await getAccountingSubjectForSelecter();
+    if (respForSelecter.status == 200) {
+      setCascaderOptions(respForSelecter.data);
+    }
+  }, [])
+
+  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'}
+        visible={createModalVisible}
+        formRef={ref}
+        onVisibleChange={(bool) => {
+          if (ref.current) {
+            ref.current.resetFields();
+          }
+          handleModalVisible(bool);
+        }}
+        onFinish={async (value) => {
+
+          const success = await addCostshareparamConnect({
+
+          });
+          //   console.log({ success });
+          if (success) {
+            handleModalVisible(false);
+
+            if (actionRef.current) {
+              actionRef.current.reload();
+            }
+          }
+        }}
+      >
+        <ProFormSelect
+          rules={[
+            {
+              required: true,
+              message: (
+                <FormattedMessage id="pages.searchTable.accountingType" defaultMessage="请选择责任中心" />
+              ),
+            },
+          ]}
+          request={async () => {
+            const resp = await getResponsibilityCenterSelecterList();
+            const { data, msg, status } = resp;
+            if (status == 200) {
+              return data.map(item => ({
+                label: item.responsibilityName,
+                value: item.id
+              }))
+            }
+          }}
+          width="sm"
+          name="responsibilityId"
+          label="请选择责任中心"
+        />
+        <ProFormDependency name={['responsibilityId']}>
+          {({ responsibilityId }) => {
+            // const resp = await getResponsibilityCenterSelecterList();
+            // const { data, msg, status } = resp;
+            // if (status == 200) {
+            //   // data.findIndex(item=>item.)
+            // }
+            return (
+              <ProForm.Group style={{ marginBottom: 20 }}>
+                <div style={{ marginLeft: 115 }}>请选择成本科目:</div>
+                <Cascader options={cascaderOptions} onChange={cascaderChangeHandle} placeholder="请选择成本科目" />
+              </ProForm.Group>
+            );
+          }}
+        </ProFormDependency>
+
+        <ProFormTextArea
+          name="costNode"
+          label="备注"
+          width={300}
+          placeholder="请输入备注"
+        />
+      </ModalForm>
+
+      {/* 更新 */}
+      <UpdateForm
+        onSubmit={async (value) => {
+          console.log({ '编辑': value });
+          const success = await editCostshareparamConnectList(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 DepartmentMana;

+ 75 - 0
src/pages/costAllocationParamsConnect/service.js

@@ -0,0 +1,75 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 08:54:08
+ * @LastEditTime: 2021-07-29 19:38:36
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/src/pages/DepartmentMana/service.js
+ */
+
+import { request } from 'umi';
+
+
+//获取列表
+export async function getCostshareparamConnectList(params, options) {
+    const {shareParamName,current,pageSize} = params;
+    return request('/api/costAccount/costaccountshare/list', {
+      method: 'GET',
+      params:{
+          name:shareParamName,
+          current,
+          pageSize
+      },
+      ...(options || {}),
+    });
+}
+
+
+//获取责任中心选择列表
+export async function getResponsibilityCenterSelecterList(params, options) {
+  // const {shareParamName,current,pageSize} = params;
+  return request('/api/costAccount/responsibility/getLevelTwo', {
+    method: 'GET',
+    ...(options || {}),
+  });
+}
+
+//编辑科室
+export async function editCostshareparamConnectList(body, options) {
+  return request('/api/costAccount/costaccountshare/update', {
+    method: 'POST',
+    data:{...body},
+    ...(options || {}),
+  });
+}
+
+//新增科室
+export async function addCostshareparamConnect(body, options) {
+  return request('/api/costAccount/costaccountshare/save', {
+    method: 'POST',
+    data:{...body},
+    ...(options || {}),
+  });
+}
+
+//删除科室
+export async function delCostshareparamConnect(params, options) {
+  const {id} = params;
+  const ids = [id];
+  return request(`/api/costAccount/costaccountshare/delete`, {
+    method: 'POST',
+    data:ids,
+    ...(options || {}),
+  });
+}
+
+
+//获取所有可选会计科目
+export async function getAccountingSubjectForSelecter(params, options) {
+
+  return request(`/api/costAccount/accounting/selectAccounting`, {
+    method: 'GET',
+    ...(options || {}),
+  });
+}
+

+ 59 - 0
src/pages/costAllocationParamsConnect/updateForm.jsx

@@ -0,0 +1,59 @@
+import React from 'react';
+import { Modal } from 'antd';
+import {
+  ProFormSelect,
+  ProFormText,
+  ModalForm,
+} from '@ant-design/pro-form';
+import { useIntl, FormattedMessage } from 'umi';
+
+
+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 })}
+        >
+          <ProFormText
+            label="成本分摊参数名"
+            rules={[
+              {
+                required: true,
+                message: (
+                  <FormattedMessage id="pages.searchTable.shareParamName" defaultMessage="成本分摊参数名是必填项" />
+                ),
+              },
+            ]}
+            width="sm"
+            name="shareParamName"
+          />
+          <ProFormText
+            label="成本分摊参数编号"
+            rules={[
+              {
+                required: true,
+                message: (
+                  <FormattedMessage id="pages.searchTable.shareParamCode" defaultMessage="成本分摊参数编号是必填项" />
+                ),
+              },
+            ]}
+            width="sm"
+            name="shareParamCode"
+          />
+        </ModalForm>
+      }
+    </>
+  );
+};
+
+export default UpdateForm;

+ 240 - 0
src/pages/costAllocationParamsSetting/index.jsx

@@ -0,0 +1,240 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 10:13:13
+ * @LastEditTime: 2021-07-28 20:54: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, message, Input, Drawer } from 'antd';
+import React, { useState, useRef, useEffect } from 'react';
+import { useIntl, FormattedMessage } from 'umi';
+import { PageContainer, FooterToolbar } 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 CAUpload from '@/components/CAUpload';
+import { getCostshareparamList, editCostshareparamList, delCostshareparam, addCostshareparam } from './service';
+
+const DepartmentMana = () => {
+  const columns = [
+
+    {
+      title: '成本分摊参数名',
+      dataIndex: 'shareParamName',
+      key: 'shareParamName',
+      hideInSearch: false,
+    },
+    {
+      title: '成本分摊参数编号',
+      dataIndex: 'shareParamCode',
+      key: 'shareParamCode',
+      hideInSearch: true,
+    },
+    {
+      title: '计算方式',
+      dataIndex: 'calcType',
+      key: 'calcType',
+      hideInSearch: true,
+      render: (text) => <>{text == 1 ? '手动填写' : '按对应成本项目计算'}</>,
+    },
+    {
+      title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="Operating" />,
+      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 [createModalVisible, handleModalVisible] = useState(false);
+  const [updateModalVisible, handleUpdateModalVisible] = useState(false);
+  const actionRef = useRef(); //表格
+  const ref = useRef();   //新增表单
+  const [currentRow, setCurrentRow] = useState({});
+
+  /**
+   *
+   * @param {Boolean} bool 弹窗展示状态
+   */
+  const updateModalVisibleChange = (bool) => {
+    handleUpdateModalVisible(bool);
+    if (!bool) setCurrentRow(undefined);
+  };
+
+  //获取科室列表
+  const getList = async (params = {}, sort, filter) => {
+    const res = await getCostshareparamList(params);
+    return {
+      data: res.data.list,
+      total: res.data.totalCount,
+      success: res.success,
+    };
+  };
+
+  /**
+   *
+   * @param {Object} value 删除项数据
+   */
+  const delListHandler = async (value) => {
+    const resp = await delCostshareparam(value);
+    if (resp.status == 200) {
+      if (actionRef.current) {
+        actionRef.current.reload();
+      }
+    }
+  };
+
+  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'}
+        visible={createModalVisible}
+        formRef={ref}
+        onVisibleChange={(bool)=>{
+          if (ref.current) {
+            ref.current.resetFields();
+          }
+          handleModalVisible(bool);
+        }}
+        onFinish={async (value) => {
+          const success = await addCostshareparam(value);
+          //   console.log({ success });
+          if (success) {
+            handleModalVisible(false);
+
+            if (actionRef.current) {
+              actionRef.current.reload();
+            }
+          }
+        }}
+      >
+        <ProFormText
+          label="成本分摊参数名"
+          rules={[
+            {
+              required: true,
+              message: (
+                <FormattedMessage id="pages.searchTable.shareParamName" defaultMessage="成本分摊参数名是必填项" />
+              ),
+            },
+          ]}
+          width="sm"
+          name="shareParamName"
+        />
+        <ProFormText
+          label="成本分摊参数编号"
+          rules={[
+            {
+              required: true,
+              message: (
+                <FormattedMessage id="pages.searchTable.shareParamCode" defaultMessage="成本分摊参数编号是必填项" />
+              ),
+            },
+          ]}
+          width="sm"
+          name="shareParamCode"
+        />
+        <ProFormSelect
+          rules={[
+            {
+              required: true,
+              message: (
+                <FormattedMessage id="pages.searchTable.accountingType" defaultMessage="请选择会计科目类型" />
+              ),
+            },
+          ]}
+          options={[
+            {
+              value: 1,
+              label: '收入',
+            },
+            {
+              value: 2,
+              label: '支出',
+            },
+          ]}
+          width="sm"
+          name="calcType"
+          label="会计科目类型"
+        />
+      </ModalForm>
+
+      {/* 更新 */}
+      <UpdateForm
+        onSubmit={async (value) => {
+          console.log({ '编辑': value });
+          const success = await editCostshareparamList(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 DepartmentMana;

+ 55 - 0
src/pages/costAllocationParamsSetting/service.js

@@ -0,0 +1,55 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 08:54:08
+ * @LastEditTime: 2021-07-28 20:40:52
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/src/pages/DepartmentMana/service.js
+ */
+
+import { request } from 'umi';
+
+
+//获取科室列表
+export async function getCostshareparamList(params, options) {
+    const {shareParamName,current,pageSize} = params;
+    return request('/api/costAccount/costshareparam/list', {
+      method: 'GET',
+      params:{
+          name:shareParamName,
+          current,
+          pageSize
+      },
+      ...(options || {}),
+    });
+}
+
+//编辑科室
+export async function editCostshareparamList(body, options) {
+  return request('/api/costAccount/costshareparam/update', {
+    method: 'POST',
+    data:{...body},
+    ...(options || {}),
+  });
+}
+
+//新增科室
+export async function addCostshareparam(body, options) {
+  return request('/api/costAccount/costshareparam/save', {
+    method: 'POST',
+    data:{...body},
+    ...(options || {}),
+  });
+}
+
+//删除科室
+export async function delCostshareparam(params, options) {
+  const {id} = params;
+  const ids = [id];
+  return request(`/api/costAccount/costshareparam/delete`, {
+    method: 'POST',
+    data:ids,
+    ...(options || {}),
+  });
+}
+

+ 59 - 0
src/pages/costAllocationParamsSetting/updateForm.jsx

@@ -0,0 +1,59 @@
+import React from 'react';
+import { Modal } from 'antd';
+import {
+  ProFormSelect,
+  ProFormText,
+  ModalForm,
+} from '@ant-design/pro-form';
+import { useIntl, FormattedMessage } from 'umi';
+
+
+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 })}
+        >
+          <ProFormText
+            label="成本分摊参数名"
+            rules={[
+              {
+                required: true,
+                message: (
+                  <FormattedMessage id="pages.searchTable.shareParamName" defaultMessage="成本分摊参数名是必填项" />
+                ),
+              },
+            ]}
+            width="sm"
+            name="shareParamName"
+          />
+          <ProFormText
+            label="成本分摊参数编号"
+            rules={[
+              {
+                required: true,
+                message: (
+                  <FormattedMessage id="pages.searchTable.shareParamCode" defaultMessage="成本分摊参数编号是必填项" />
+                ),
+              },
+            ]}
+            width="sm"
+            name="shareParamCode"
+          />
+        </ModalForm>
+      }
+    </>
+  );
+};
+
+export default UpdateForm;

+ 225 - 0
src/pages/costProjectMana/index.jsx

@@ -0,0 +1,225 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 10:13:13
+ * @LastEditTime: 2021-07-29 19:49:09
+ * @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, useEffect } from 'react';
+import { useIntl, FormattedMessage } from 'umi';
+import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
+import ProTable from '@ant-design/pro-table';
+import ProForm, { ModalForm, ProFormText, ProFormSelect,ProFormTextArea } from '@ant-design/pro-form';
+import UpdateForm from './updateForm';
+// import CAUpload from '@/components/CAUpload';
+import {
+  getCostProjecttList, editCostProject, delCostProject,
+  addCostProject
+} from './service';
+
+const DepartmentMana = () => {
+  const columns = [
+
+    {
+      title: 'Id',
+      dataIndex: 'id',
+      key: 'id',
+      hideInSearch: true,
+    },
+    {
+      title: '成本编号',
+      dataIndex: 'productCode',
+      key: 'productCode',
+      hideInSearch: true,
+    },
+    {
+      title: '成本项目名',
+      dataIndex: 'productName',
+      key: 'productName',
+      hideInSearch: false,
+    },
+    {
+      title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="Operating" />,
+      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 [createModalVisible, handleModalVisible] = useState(false);
+  const [updateModalVisible, handleUpdateModalVisible] = useState(false);
+  const [cascaderOptions, setCascaderOptions] = useState([]);
+  const actionRef = useRef(); //表格
+  const ref = useRef();   //新增表单
+  const [selectedCascader,setSelectedCascader] = useState(null);
+  const [currentRow, setCurrentRow] = useState({});
+
+  /**
+   *
+   * @param {Boolean} bool 弹窗展示状态
+   */
+  const updateModalVisibleChange = (bool) => {
+    handleUpdateModalVisible(bool);
+    if (!bool) setCurrentRow(undefined);
+  };
+
+  //获取科室列表
+  const getList = async (params = {}, sort, filter) => {
+    const res = await getCostProjecttList(params);
+    return {
+      data: res.data.list,
+      total: res.data.totalCount,
+      success: res.success,
+    };
+  };
+
+  /**
+   *
+   * @param {Object} value 删除项数据
+   */
+  const delListHandler = async (value) => {
+    const resp = await delCostProject(value);
+    if (resp.status == 200) {
+      if (actionRef.current) {
+        actionRef.current.reload();
+      }
+    }
+  };
+
+
+
+  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'}
+        visible={createModalVisible}
+        formRef={ref}
+        onVisibleChange={(bool) => {
+          if (ref.current) {
+            ref.current.resetFields();
+          }
+          handleModalVisible(bool);
+        }}
+        onFinish={async (value) => {
+       
+          const success = await addCostProject(value);
+          //   console.log({ success });
+          if (success) {
+            handleModalVisible(false);
+
+            if (actionRef.current) {
+              actionRef.current.reload();
+            }
+          }
+        }}
+      >
+        <ProFormText
+          label="成本项目编码"
+          rules={[
+            {
+              required: true,
+              message: (
+                <FormattedMessage id="pages.searchTable.productCode" defaultMessage="成本项目编码是必填项" />
+              ),
+            },
+          ]}
+          width="sm"
+          name="productCode"
+        />
+        <ProFormText
+          label="成本项目名"
+          rules={[
+            {
+              required: true,
+              message: (
+                <FormattedMessage id="pages.searchTable.productName" defaultMessage="成本项目名是必填项" />
+              ),
+            },
+          ]}
+          width="sm"
+          name="productName"
+        />
+          
+      </ModalForm>
+
+      {/* 更新 */}
+      <UpdateForm
+        onSubmit={async (value) => {
+          // console.log({ '编辑': value });
+          const success = await editCostProject(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 DepartmentMana;

+ 67 - 0
src/pages/costProjectMana/service.js

@@ -0,0 +1,67 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 08:54:08
+ * @LastEditTime: 2021-07-29 19:48:25
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/src/pages/DepartmentMana/service.js
+ */
+
+import { request } from 'umi';
+
+
+//获取科室列表
+export async function getCostProjecttList(params, options) {
+    const {productName,current,pageSize} = params;
+    return request('/api/costAccount/product/list', {
+      method: 'GET',
+      params:{
+          name:productName,
+          current,
+          pageSize
+      },
+      ...(options || {}),
+    });
+}
+
+
+
+//编辑成本项目
+export async function editCostProject(body, options) {
+  return request('/api/costAccount/product/edit', {
+    method: 'POST',
+    data:{...body},
+    ...(options || {}),
+  });
+}
+
+//新增成本项目
+export async function addCostProject(body, options) {
+  return request('/api/costAccount/product/save', {
+    method: 'POST',
+    data:{...body},
+    ...(options || {}),
+  });
+}
+
+//删除成本项目
+export async function delCostProject(params, options) {
+  const {id} = params;
+  const ids = [id];
+  return request(`/api/costAccount/product/delete`, {
+    method: 'POST',
+    data:ids,
+    ...(options || {}),
+  });
+}
+
+
+//获取所有可选会计科目
+export async function getAccountingSubjectForSelecter(params, options) {
+
+  return request(`/api/costAccount/accounting/selectAccounting`, {
+    method: 'GET',
+    ...(options || {}),
+  });
+}
+

+ 59 - 0
src/pages/costProjectMana/updateForm.jsx

@@ -0,0 +1,59 @@
+import React from 'react';
+import { Modal } from 'antd';
+import {
+  ProFormSelect,
+  ProFormText,
+  ModalForm,
+} from '@ant-design/pro-form';
+import { useIntl, FormattedMessage } from 'umi';
+
+
+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 })}
+        >
+          <ProFormText
+          label="成本项目编码"
+          rules={[
+            {
+              required: true,
+              message: (
+                <FormattedMessage id="pages.searchTable.productCode" defaultMessage="成本项目编码是必填项" />
+              ),
+            },
+          ]}
+          width="sm"
+          name="productCode"
+        />
+        <ProFormText
+          label="成本项目名"
+          rules={[
+            {
+              required: true,
+              message: (
+                <FormattedMessage id="pages.searchTable.productName" defaultMessage="成本项目名是必填项" />
+              ),
+            },
+          ]}
+          width="sm"
+          name="productName"
+        />
+        </ModalForm>
+      }
+    </>
+  );
+};
+
+export default UpdateForm;

+ 297 - 0
src/pages/districtMana/index.jsx

@@ -0,0 +1,297 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 10:13:13
+ * @LastEditTime: 2021-07-28 14:15: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 { Button, Popconfirm, Table, Space } from 'antd';
+import React, { useState, useRef, useEffect } from 'react';
+import { useIntl, FormattedMessage } from 'umi';
+import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
+import ProTable from '@ant-design/pro-table';
+import { ModalForm, ProFormText, ProFormSelect, ProFormDependency } from '@ant-design/pro-form';
+import UpdateForm from './updateForm';
+import { CARequest } from '../../utils';
+// import CAUpload from '@/components/CAUpload';
+import { getDistrictList, editDistrictList, delDistrict, addDistrict,getMainDistrictList } from './service';
+
+const DistrictMana = () => {
+  const columns = [
+    {
+      title: '医院/院区ID',
+      dataIndex: 'id',
+      key: 'id',
+      hideInSearch: true,
+      render: (text) => <a>{text}</a>,
+    },
+    {
+      title: '医院名称',
+      dataIndex: 'name',
+      key: 'name',
+      hideInSearch: false,
+    },
+    {
+      title: '是否为院区',
+      dataIndex: 'isHospital',
+      key: 'isHospital',
+      hideInSearch: true,
+      render: (text) => <a>{text == 1 ? '是' : '否'}</a>,
+    },
+    {
+      title: '医院标识',
+      dataIndex: 'sign',
+      key: 'sign',
+      hideInSearch: true,
+    },
+    {
+      title: '医院Id',
+      dataIndex: 'parentId',
+      key: 'parentId',
+      hideInSearch: true,
+    },
+    {
+      title: '主医院名',
+      dataIndex: 'parentName',
+      key: 'parentName',
+      hideInSearch: true,
+    },
+    {
+      title: '创建时间',
+      dataIndex: 'createTime',
+      key: 'createTime',
+      hideInSearch: true,
+    },
+    {
+      title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="Operating" />,
+      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 [createModalVisible, handleModalVisible] = useState(false);
+  const [updateModalVisible, handleUpdateModalVisible] = useState(false);
+  const actionRef = useRef();
+  const [currentRow, setCurrentRow] = useState({});
+
+  /**
+   *
+   * @param {Boolean} bool 弹窗展示状态
+   */
+  const updateModalVisibleChange = (bool) => {
+    handleUpdateModalVisible(bool);
+    if (!bool) setCurrentRow(undefined);
+  };
+
+  //获取科室列表
+  const getList = async (params = {}, sort, filter) => {
+    const res = await getDistrictList(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 delDistrict(value);
+    console.log({ resp });
+    if (resp.status) {
+      if (actionRef.current) {
+        actionRef.current.reload();
+      }
+    }
+  };
+
+  // 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: 3, offset: 3 }}
+        layout={'horizontal'}
+        visible={createModalVisible}
+        onVisibleChange={handleModalVisible}
+        onFinish={async (value) => {
+          const success = await addDistrict(value);
+          //   console.log({ success });
+          if (success) {
+            handleModalVisible(false);
+
+            if (actionRef.current) {
+              actionRef.current.reload();
+            }
+          }
+        }}
+      >
+        <ProFormText
+          label="医院名"
+          rules={[
+            {
+              required: true,
+              message: (
+                <FormattedMessage id="pages.searchTable.name" defaultMessage="医院名是必填项" />
+              ),
+            },
+          ]}
+          width="sm"
+          name="name"
+        />
+        <ProFormSelect
+          rules={[
+            {
+              required: true,
+              message: (
+                <FormattedMessage id="pages.searchTable.isHospital" defaultMessage="请选择是否为主院" />
+              ),
+            },
+          ]}
+          options={[
+            {
+              value: 1,
+              label: '是',
+            },
+            {
+              value: 0,
+              label: '否',
+            },
+          ]}
+          width="xs"
+          name="isHospital"
+          label="是否为主院"
+        />
+
+        <ProFormDependency name={['isHospital']}>
+          {({ isHospital }) => {
+            return isHospital == '0' ? (
+              <ProFormText
+                label="主医院名称"
+                rules={[
+                  {
+                    required: false,
+                    message: (
+                      <FormattedMessage id="pages.searchTable.parentName" defaultMessage="..." />
+                    ),
+                  },
+                ]}
+                width="sm"
+                name="parentName"
+              />
+            ) : <></>;
+          }}
+        </ProFormDependency>
+        <ProFormDependency name={['isHospital']}>
+          {({ isHospital }) => {
+            return isHospital == '0' ? (
+              <ProFormSelect
+                name="parentId"
+                label="主医院Id"
+                request={async () =>{
+                      const resp = await getMainDistrictList();
+                      const {status,data,} = resp;
+                      
+                      if(status == 200){
+                        return data.map(item=>({
+                          label:item.name,
+                          value:item.id
+                        }))
+                      }
+                }}
+                placeholder=""
+                width='sm'
+                rules={[{ required: true, message: '请选择主医院ID' }]}
+              />
+            ) : <></>
+          }}
+        </ProFormDependency>
+      </ModalForm>
+
+      {/* 更新 */}
+      <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 DistrictMana;

+ 59 - 0
src/pages/districtMana/service.js

@@ -0,0 +1,59 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 08:54:08
+ * @LastEditTime: 2021-07-28 14:11:21
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/src/pages/DepartmentMana/service.js
+ */
+
+import { request } from 'umi';
+
+
+//获取所有医院列表
+export async function getDistrictList(params, options) {
+    return request('/api/costAccount/hosptail/list', {
+      method: 'GET',
+      params:{...params},
+      ...(options || {}),
+    });
+}
+
+//获取主医院列表
+export async function getMainDistrictList(params, options) {
+  return request('/api/costAccount/hosptail/getAll', {
+    method: 'GET',
+    params:{...params},
+    ...(options || {}),
+  });
+}
+
+//编辑医院
+export async function editDistrictList(body, options) {
+  return request('/api/costAccount/hosptail/update', {
+    method: 'POST',
+    data:{...body},
+    ...(options || {}),
+  });
+}
+
+//新增医院
+export async function addDistrict(body, options) {
+  return request('/api/costAccount/hosptail/save', {
+    method: 'POST',
+    data:{...body},
+    ...(options || {}),
+  });
+}
+
+//删除医院
+export async function delDistrict(params, options) {
+  const {id} = params;
+  const ids = [id];
+  return request(`/api/costAccount/hosptail/delete`, {
+    method: 'POST',
+    data:ids,
+    ...(options || {}),
+  });
+}
+

+ 109 - 0
src/pages/districtMana/updateForm.jsx

@@ -0,0 +1,109 @@
+import React from 'react';
+import {
+  ProFormSelect,
+  ProFormText,
+  ModalForm,
+  ProFormDependency
+} from '@ant-design/pro-form';
+import { useIntl, FormattedMessage } from 'umi';
+
+
+const UpdateForm = (props) => {
+  const { updateModalVisible, updateModalVisibleChange, values, onSubmit } = props;
+  // 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 })}
+        >
+          <ProFormText
+            label="医院名"
+            rules={[
+              {
+                required: true,
+                message: (
+                  <FormattedMessage id="pages.searchTable.name" defaultMessage="医院名是必填项" />
+                ),
+              },
+            ]}
+            width="sm"
+            name="name"
+          />
+          <ProFormSelect
+            // initialValue={parseInt(values.isHospital)}
+            rules={[
+              {
+                required: true,
+                message: (
+                  <FormattedMessage id="pages.searchTable.isHospital" defaultMessage="请选择是否为主院" />
+                ),
+              },
+            ]}
+            options={[
+              {
+                value: 1,
+                label: '是',
+              },
+              {
+                value: 0,
+                label: '否',
+              },
+            ]}
+            width="xs"
+            name="isHospital"
+            label="是否为主院"
+          />
+
+          <ProFormDependency name={['isHospital']}>
+            {({ isHospital }) => {
+              return isHospital == '1' ? (
+                <ProFormText
+                  label="主医院名称"
+                  rules={[
+                    {
+                      required: false,
+                      message: (
+                        <FormattedMessage id="pages.searchTable.parentName" defaultMessage="..." />
+                      ),
+                    },
+                  ]}
+                  width="sm"
+                  name="parentName"
+                />
+              ) : <></>;
+            }}
+          </ProFormDependency>
+          <ProFormDependency name={['isHospital']}>
+            {({ isHospital }) => {
+              return isHospital == '1' ? (
+                <ProFormText
+                  label="主医院Id"
+                  rules={[
+                    {
+                      required: false,
+                      message: (
+                        <FormattedMessage id="pages.searchTable.parentId" defaultMessage="" />
+                      ),
+                    },
+                  ]}
+                  width="sm"
+                  name="parentId"
+                />
+              ) : <></>
+            }}
+          </ProFormDependency>
+        </ModalForm>
+      }
+    </>
+  );
+};
+
+export default UpdateForm;

+ 1 - 1
src/pages/document.ejs

@@ -22,7 +22,7 @@
       content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
     />
     <title>Ant Design Pro</title>
-    <link rel="icon" href="<%= context.config.publicPath +'favicon.ico'%>" type="image/x-icon" />
+    <link rel="icon" href="<%= context.config.publicPath +'KC-color-square.png'%>" type="image/x-icon" />
   </head>
   <body>
     <noscript>Out-of-the-box mid-stage front/design solution!</noscript>

+ 406 - 0
src/pages/responsibilityCenter/index.jsx

@@ -0,0 +1,406 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 10:13:13
+ * @LastEditTime: 2021-07-29 14: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, Table, Space } from 'antd';
+import React, { useState, useRef, useEffect } from 'react';
+import { useIntl, FormattedMessage } from 'umi';
+import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
+import ProTable from '@ant-design/pro-table';
+import { ModalForm, ProFormText, ProFormSelect, ProFormDependency } from '@ant-design/pro-form';
+import UpdateForm from './updateForm';
+// import CAUpload from '@/components/CAUpload';
+import { getResponsibilityCenterList, editResponsibilityCenterList, delResponsibilityCenter, addResponsibilityCenter } from './service';
+import { getApportionmentLevelListNoPage } from '../apportionmentLevel/service';
+
+const responsibilityCenter = () => {
+  const columns = [
+    {
+      title: '责任中心名称',
+      dataIndex: 'responsibilityName',
+      key: 'responsibilityName',
+      hideInSearch: false,
+      width: '15%'
+    },
+    // {
+    //   title: '责任中心编码',
+    //   dataIndex: 'responsibilityCode',
+    //   key: 'responsibilityCode',
+    //   hideInSearch: true,
+    // },
+    {
+      title: '责任中心级别',
+      dataIndex: 'responsibilityLevel',
+      key: 'responsibilityLevel',
+      hideInSearch: true,
+      width: '10%'
+    },
+    {
+      title: '是否汇总中心',
+      dataIndex: 'isGatherCenter',
+      key: 'isGatherCenter',
+      hideInSearch: true,
+      render: (text) => <>{text == 1 ? '是' : '否'}</>,
+      width: '15%'
+    },
+    {
+      title: '责任类型',
+      dataIndex: 'responsibilityType',
+      key: 'responsibilityType',
+      hideInSearch: true,
+      width: '15%'
+    },
+    {
+      title: '分摊级别',
+      dataIndex: 'shareLevel',
+      key: 'shareLevel',
+      hideInSearch: true,
+      width: '10%'
+    },
+    {
+      title: '分摊级别名称',
+      dataIndex: 'shareName',
+      key: 'shareName',
+      hideInSearch: true,
+      width: '15%'
+    },
+    {
+      title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="Operating" />,
+      dataIndex: 'option',
+      valueType: 'option',
+      width: '15%',
+      render: (_, record) => [
+        <a
+          key="config"
+          onClick={() => {
+            handleUpdateModalVisible(true);
+            setCurrentRow(record);
+          }}
+        >
+          编辑
+        </a>,
+        <Popconfirm
+          key="subscribeAlert"
+          title="是否确定删除?"
+          onConfirm={() => {
+            setCurrentRow(record);
+            delListHandler(record);
+          }}
+        >
+          <a>删除</a>
+        </Popconfirm>,
+      ],
+    },
+  ];
+
+  const [createModalVisible, handleModalVisible] = useState(false);
+  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);
+
+  /**
+   *
+   * @param {Boolean} bool 弹窗展示状态
+   */
+  const updateModalVisibleChange = (bool) => {
+    handleUpdateModalVisible(bool);
+    if (!bool) setCurrentRow(undefined);
+  };
+
+
+  //获取科室列表
+  const getList = async (params = {}, sort, filter) => {
+    const res = await getResponsibilityCenterList(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 delResponsibilityCenter(value);
+    if(resp.status==200){
+      if (actionRef.current) {
+        actionRef.current.reload();
+      }
+    }
+  };
+
+  //展开table
+  const expandedRowRender = (record, index, indent, expanded) => {
+    // console.log({ record, index, indent, expanded });
+    const _columns = columns.filter(item => !(['id'].includes(item.key)));
+    return (
+      <ProTable
+        columns={[..._columns]}
+        headerTitle={false}
+        showHeader={false}
+        search={false}
+        options={false}
+        rowKey="id"
+        dataSource={record.child}
+        pagination={false}
+      />
+    );
+  };
+
+  return (
+    <PageContainer>
+      <ProTable
+        columns={columns}
+        request={getList}
+        actionRef={actionRef}
+        rowKey="id"
+        childrenColumnName="child"
+        expandable={{defaultExpandedRowKeys:[]}}
+        toolBarRender={() => [
+          <Button
+            key="button"
+            icon={<PlusOutlined />}
+            type="primary"
+            onClick={() => {
+              handleModalVisible(true);
+            }}
+          >
+            新增
+          </Button>
+        ]}
+
+        pagination={{
+          pageSize: 10,
+        }}
+
+        search={false}
+
+      />
+
+      <ModalForm
+        title="新增责任中心"
+        width="800px"
+        labelCol={{ span: 5, offset: 3 }}
+        layout={'horizontal'}
+        visible={createModalVisible}
+        onVisibleChange={(bool)=>{
+          if (ref.current) {
+            ref.current.resetFields();
+          }
+          handleModalVisible(bool);
+        }}
+        formRef={ref}
+        onFinish={async (value) => {
+          const success = await addResponsibilityCenter({...value,shareName:selectedLevel.shareName});
+          //   console.log({ success });
+          if (success) {
+            handleModalVisible(false);
+
+            if (actionRef.current) {
+              actionRef.current.reload();
+            }
+          }
+        }}
+      >
+
+        <ProFormSelect
+          name="id"
+          label="责任管理中心"
+          showSearch
+          request={async ({ keyWords }) => {
+            const res = await getResponsibilityCenterList();
+            if(res.status == 200){
+              // console.log({res});
+                 const filter_arr = res.data.list.filter(item=>{
+                  //  console.log({item});
+                   if(keyWords){
+                    return item.responsibilityName.indexOf(keyWords) != -1
+                   }else {
+                    return item
+                   }
+                   
+                 });
+                 const arr = filter_arr.map(item=>({label:item.responsibilityName, value:item.id}));
+                 return arr;
+            }else {
+                 return [];
+            }
+
+          }}
+          width='md'
+          placeholder="选择需要新增在哪个责任中心下,默认新增最外层"
+          rules={[{ required: false, message: '' }]}
+        />
+
+        <ProFormText
+          label="责任中心名"
+          rules={[
+            {
+              required: true,
+              message: (
+                <FormattedMessage id="pages.searchTable.responsibilityName" defaultMessage="医院名是必填项" />
+              ),
+            },
+          ]}
+          width="sm"
+          name="responsibilityName"
+        />
+        <ProFormText
+          label="责任中心编码"
+          rules={[
+            {
+              required: true,
+              message: (
+                <FormattedMessage id="pages.searchTable.responsibilityCode" defaultMessage="责任中心编码是必填项" />
+              ),
+            },
+          ]}
+          width="sm"
+          name="responsibilityCode"
+        />
+        <ProFormSelect
+          rules={[
+            {
+              required: true,
+              message: (
+                <FormattedMessage id="pages.searchTable.isGatherCenter" defaultMessage="请选择是否为汇总中心" />
+              ),
+            },
+          ]}
+          options={[
+            {
+              value: 1,
+              label: '是',
+            },
+            {
+              value: 0,
+              label: '否',
+            },
+          ]}
+          width="sm"
+          name="isGatherCenter"
+          label="是否汇总中心"
+        />
+        <ProFormSelect
+          rules={[
+            {
+              required: true,
+              message: (
+                <FormattedMessage id="pages.searchTable.responsibilityType" defaultMessage="请选择责任类型" />
+              ),
+            },
+          ]}
+          options={[
+            {
+              value: 1,
+              label: '收费中心',
+            },
+            {
+              value: 2,
+              label: '成本(费用)中心',
+            },
+          ]}
+          width="sm"
+          name="responsibilityType"
+          label="选择责任类型"
+        />
+        <ProFormSelect
+          rules={[
+            {
+              required: true,
+              message: (
+                <FormattedMessage id="pages.searchTable.shareLevel" defaultMessage="请选择分摊级别" />
+              ),
+            },
+          ]}
+          request={ async ()=>{
+                const resp = await getApportionmentLevelListNoPage();
+                const {status,data} = resp;
+                if(status==200){
+                    setSelectedLevelList(data.list);
+                    return data.list.map(item=>({label:item.leverSort,value:item.leverSort}))
+                }else{
+                   return []
+                }
+          }}
+          width="sm"
+          name={['shareLevel']}
+          label="选择分摊级别"
+        />
+
+        <ProFormDependency name={['shareLevel']}>
+          {({shareLevel}) => {
+  
+            let name='12',render=false;
+            if(shareLevel&&selectedLevelList&&selectedLevelList.length>0){
+              const arr = selectedLevelList.filter(item=>item.leverSort == shareLevel);
+              // console.log({arr,selectedLevelList,shareLevel});
+              if(arr.length>0){
+                name = arr[0].shareName;
+                setSelectedLevel(arr[0]);
+                render=true;
+              }
+              
+            }
+            // console.log({name});
+            return shareLevel&&render ? (
+              <ProFormText
+                initialValue={name}
+                disabled
+                label="分摊层级名称"
+                rules={[
+                  {
+                    required: false,
+                    message: (
+                      <FormattedMessage id="pages.searchTable.parentName" defaultMessage="..." />
+                    ),
+                  },
+                ]}
+                placeholder={name}
+                width="sm"
+              />
+            ) : <></>;
+          }}
+        </ProFormDependency>
+      </ModalForm>
+
+      {/* 更新 */}
+      <UpdateForm
+        onSubmit={async (value) => {
+          console.log({ '编辑': value });
+          const success = await editResponsibilityCenterList(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 responsibilityCenter;

+ 48 - 0
src/pages/responsibilityCenter/service.js

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

+ 154 - 0
src/pages/responsibilityCenter/updateForm.jsx

@@ -0,0 +1,154 @@
+import React,{useState} from 'react';
+import {
+  ProFormSelect,
+  ProFormText,
+  ModalForm,
+  ProFormDependency
+} from '@ant-design/pro-form';
+import { useIntl, FormattedMessage } from 'umi';
+
+import { getApportionmentLevelListNoPage } from '../apportionmentLevel/service';
+
+
+const UpdateForm = (props) => {
+  const { updateModalVisible, updateModalVisibleChange, values, onSubmit } = props;
+  const [selectedLevelList,setSelectedLevelList] = useState(null); //可选的分摊层级列表
+  const [selectedLevel,setSelectedLevel] = useState(null);
+  // 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 })}
+        >
+          <ProFormText
+            label="责任中心名"
+            rules={[
+              {
+                required: true,
+                message: (
+                  <FormattedMessage id="pages.searchTable.responsibilityName" defaultMessage="医院名是必填项" />
+                ),
+              },
+            ]}
+            width="sm"
+            name="responsibilityName"
+          />
+          <ProFormSelect
+            rules={[
+              {
+                required: true,
+                message: (
+                  <FormattedMessage id="pages.searchTable.isGatherCenter" defaultMessage="请选择是否为汇总中心" />
+                ),
+              },
+            ]}
+            options={[
+              {
+                value: 1,
+                label: '是',
+              },
+              {
+                value: 0,
+                label: '否',
+              },
+            ]}
+            width="sm"
+            name="isGatherCenter"
+            label="是否汇总中心"
+          />
+          <ProFormSelect
+            rules={[
+              {
+                required: true,
+                message: (
+                  <FormattedMessage id="pages.searchTable.responsibilityType" defaultMessage="请选择责任类型" />
+                ),
+              },
+            ]}
+            options={[
+              {
+                value: 1,
+                label: '收费中心',
+              },
+              {
+                value: 2,
+                label: '成本(费用)中心',
+              },
+            ]}
+            width="sm"
+            name="responsibilityType"
+            label="选择责任类型"
+          />
+          <ProFormSelect
+          rules={[
+            {
+              required: true,
+              message: (
+                <FormattedMessage id="pages.searchTable.shareLevel" defaultMessage="请选择分摊级别" />
+              ),
+            },
+          ]}
+          request={ async ()=>{
+                const resp = await getApportionmentLevelListNoPage();
+                const {status,data} = resp;
+                if(status==200){
+                    setSelectedLevelList(data.list);
+                    return data.list.map(item=>({label:item.leverSort,value:item.leverSort}))
+                }else{
+                   return []
+                }
+          }}
+          width="sm"
+          name={['shareLevel']}
+          label="选择分摊级别"
+        />
+
+        <ProFormDependency name={['shareLevel']}>
+          {({shareLevel}) => {
+  
+            let name='12',render=false;
+            if(shareLevel&&selectedLevelList&&selectedLevelList.length>0){
+              const arr = selectedLevelList.filter(item=>item.leverSort == shareLevel);
+              // console.log({arr,selectedLevelList,shareLevel});
+              if(arr.length>0){
+                name = arr[0].shareName;
+                setSelectedLevel(arr[0]);
+                render=true;
+              }
+              
+            }
+            // console.log({name});
+            return shareLevel&&render ? (
+              <ProFormText
+                initialValue={name}
+                disabled
+                label="分摊层级名称"
+                rules={[
+                  {
+                    required: false,
+                    message: (
+                      <FormattedMessage id="pages.searchTable.parentName" defaultMessage="..." />
+                    ),
+                  },
+                ]}
+                placeholder={name}
+                width="sm"
+              />
+            ) : <></>;
+          }}
+        </ProFormDependency>
+        </ModalForm>
+      }
+    </>
+  );
+};
+
+export default UpdateForm;

+ 225 - 0
src/pages/responsibilityCenterConnect/index.jsx

@@ -0,0 +1,225 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 10:13:13
+ * @LastEditTime: 2021-07-29 16:16:50
+ * @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, Space, Table, Tag } from 'antd';
+import React, { useState, useRef, useEffect } from 'react';
+import { useIntl, FormattedMessage } from 'umi';
+import { PageContainer, FooterToolbar } from '@ant-design/pro-layout';
+import ProTable from '@ant-design/pro-table';
+import { DrawerForm, formRef } from '@ant-design/pro-form';
+import UpdateForm from './updateForm';
+// import CAUpload from '@/components/CAUpload';
+import { getResponsibilityCenterConnectList,getResponsibilityCenterConnectableList,saveResponsibilityCenterConnected } from './service';
+
+const ResponsibilityCenterConnect = () => {
+  const columns = [
+    {
+      title: '责任中心名称',
+      dataIndex: 'responsibilityName',
+      key: 'responsibilityName',
+      hideInSearch: false,
+      width: '20%'
+    },
+    {
+      title: '责任中心Id',
+      dataIndex: 'responsibilityId',
+      key: 'responsibilityId',
+      hideInSearch: true,
+      width: '20%'
+    },
+    {
+      title: '部门列表',
+      dataIndex: 'departments',
+      key: 'departments',
+      hideInSearch: false,
+      render: (departments) => {
+
+        if (Array.isArray(departments)) {
+          return departments.map((item, index) => { return <Tag key={index}>{item.departmentName}</Tag> })
+        } else {
+          return <></>
+        }
+      }
+    },
+    {
+      title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="Operating" />,
+      dataIndex: 'option',
+      key: 'option',
+      valueType: 'option',
+      width: '15%',
+      render: (_, record) => {
+        const { isParent } = record;
+        return !isParent ? [
+          <a
+            key="config"
+            onClick={() => {
+              setDrawerVisible(true);
+              setCurrentRow(record);
+            }}
+          >
+            绑定科室
+          </a>,
+        ] : []
+      },
+    }
+  ];
+  const drawerTableColumns = [
+    {
+      title: 'Id',
+      dataIndex: 'id',
+      key: 'id',
+      hideInSearch: true,
+    },
+    {
+      title: '科室名称',
+      dataIndex: 'departmentName',
+      key: 'departmentName',
+      hideInSearch: false,
+    },
+    {
+      title: '科室编码',
+      dataIndex: 'departmentCode',
+      key: 'departmentCode',
+      hideInSearch: true,
+    },
+
+  ];
+
+  const actionRef = useRef();  //表格
+  const drawerFormRef = useRef(); //DrawerForm
+  const actionDrawertableRef = useRef(); //Drawertable
+  const [currentRow, setCurrentRow] = useState({});
+  const [drawerVisible, setDrawerVisible] = useState(false);
+  const [selectedRowKeys,setSelectedRowKeys] = useState([]);
+
+  /**
+   * 
+   * @param {Boolean} bool 
+   */
+  const drawerVisibleChange = (bool) => {
+    // console.log({currentRow});
+    const {departments} = currentRow;
+    const selected = departments.map(item=>item.departmentId);
+    if (bool)setSelectedRowKeys(selected==undefined?[]:selected);
+    setDrawerVisible(bool);
+    if (!bool) setCurrentRow(undefined);
+  }
+
+
+  //获取责任中心对应列表
+  const getList = async (params = {}, sort, filter) => {
+    const res = await getResponsibilityCenterConnectList(params);
+    // console.log({res});
+    return {
+      data: res.data.list,
+      total: res.data.totalCount,
+      success: res.success,
+    };
+  };
+
+  //获取责任中心可绑定科室列表
+  const getConnectableList = async (params = {}, sort, filter)=>{
+    const {responsibilityId} = currentRow;
+    const res = await getResponsibilityCenterConnectableList({...params,responsibilityId});
+    const {data,status} = res;
+    // console.log({res,data,status});
+    if(status == 200){
+        return {
+          data:data,
+          success:true,
+        }
+    }
+  }
+
+
+  return (
+    <PageContainer>
+      <ProTable
+        columns={columns}
+        request={getList}
+        actionRef={actionRef}
+        rowKey="responsibilityId"
+        childrenColumnName="child"
+        expandable={{ defaultExpandedRowKeys: [] }}
+        toolBarRender={() => []}
+
+        pagination={{
+          pageSize: 10,
+        }}
+
+        search={false}
+
+      />
+      <DrawerForm
+        title="可绑定科室列表"
+        formRef={drawerFormRef}
+        visible={drawerVisible}
+        onVisibleChange={(visible) => drawerVisibleChange(visible)}
+        // onFinish={(value) => onSubmit({ ...values, ...value })}
+        onFinish={async ()=>{
+            //  console.log({selectedRowKeys,currentRow});
+             const {responsibilityId} = currentRow;
+             const resp = await saveResponsibilityCenterConnected({responsibilityId,departmentIds:selectedRowKeys});
+             const {status} = resp;
+             if(status==200){
+              setDrawerVisible(false);
+              if (actionRef.current) {
+                actionRef.current.reload();
+              }
+             }
+        }}
+      >
+        <ProTable
+          columns={drawerTableColumns}
+          request={getConnectableList}
+          rowKey="id"
+          toolBarRender={() => []}
+          actionRef={actionDrawertableRef}
+          pagination={{
+            pageSize: 10,
+          }}
+          rowSelection={{
+            // 自定义选择项参考: https://ant.design/components/table-cn/#components-table-demo-row-selection-custom
+            // 注释该行则默认不显示下拉选项
+            selectedRowKeys,
+            selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT],
+            onChange:(selectedRowKeys)=>{
+              setSelectedRowKeys([...selectedRowKeys]);
+            }
+          }}
+          tableAlertRender={({ selectedRowKeys, selectedRows, onCleanSelected }) => {
+              // console.log({selectedRowKeys});
+              return (
+                <Space size={24}>
+                  <span>
+                    已选 {selectedRowKeys.length} 项
+                    <a style={{ marginLeft: 8 }} onClick={onCleanSelected}>
+                      取消选择
+                    </a>
+                  </span>
+                </Space>
+              )
+          }}
+          tableAlertOptionRender={() => {
+            return (
+              <Space size={16}>
+                {/* <a>批量绑定</a> */}
+              </Space>
+            );
+          }}
+          search={false}
+
+        />
+      </DrawerForm>
+    </PageContainer>
+  );
+};
+
+export default ResponsibilityCenterConnect;

+ 43 - 0
src/pages/responsibilityCenterConnect/service.js

@@ -0,0 +1,43 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 08:54:08
+ * @LastEditTime: 2021-07-29 16:11:07
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/src/pages/DepartmentMana/service.js
+ */
+
+import { request } from 'umi';
+
+
+//获取责任中心对应列表
+export async function getResponsibilityCenterConnectList(params, options) {
+    return request('/api/costAccount/centerDepartment/list', {
+      method: 'GET',
+      params:{...params},
+      ...(options || {}),
+    });
+}
+
+
+//获取责任中心对应可绑定科室列表
+export async function getResponsibilityCenterConnectableList(params, options) {
+  
+  return request('/api/costAccount/costresponsibilitydepartment/getById', {
+    method: 'GET',
+    params:{...params},
+    ...(options || {}),
+  });
+}
+
+//保存绑定信息
+export async function saveResponsibilityCenterConnected(body, options) {
+  return request('/api/costAccount/centerDepartment/save', {
+    method: 'POST',
+    data:{...body},
+    ...(options || {}),
+  });
+}
+
+
+

+ 135 - 0
src/pages/responsibilityCenterConnect/updateForm.jsx

@@ -0,0 +1,135 @@
+import React from 'react';
+import {
+  ProFormSelect,
+  ProFormText,
+  ModalForm,
+  ProFormDependency
+} from '@ant-design/pro-form';
+import { useIntl, FormattedMessage } from 'umi';
+
+
+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 })}
+        >
+          <ProFormText
+            label="责任中心名"
+            rules={[
+              {
+                required: true,
+                message: (
+                  <FormattedMessage id="pages.searchTable.responsibilityName" defaultMessage="医院名是必填项" />
+                ),
+              },
+            ]}
+            width="sm"
+            name="responsibilityName"
+          />
+          <ProFormSelect
+            rules={[
+              {
+                required: true,
+                message: (
+                  <FormattedMessage id="pages.searchTable.isGatherCenter" defaultMessage="请选择是否为汇总中心" />
+                ),
+              },
+            ]}
+            options={[
+              {
+                value: 1,
+                label: '是',
+              },
+              {
+                value: 0,
+                label: '否',
+              },
+            ]}
+            width="sm"
+            name="isGatherCenter"
+            label="是否汇总中心"
+          />
+          <ProFormSelect
+            rules={[
+              {
+                required: true,
+                message: (
+                  <FormattedMessage id="pages.searchTable.responsibilityType" defaultMessage="请选择责任类型" />
+                ),
+              },
+            ]}
+            options={[
+              {
+                value: 1,
+                label: '收费中心',
+              },
+              {
+                value: 2,
+                label: '成本(费用)中心',
+              },
+            ]}
+            width="sm"
+            name="responsibilityType"
+            label="选择责任类型"
+          />
+          <ProFormSelect
+            rules={[
+              {
+                required: true,
+                message: (
+                  <FormattedMessage id="pages.searchTable.shareLevel" defaultMessage="请选择分摊级别" />
+                ),
+              },
+            ]}
+            options={[
+              {
+                value: 1,
+                label: '收费中心',
+              },
+              {
+                value: 2,
+                label: '成本(费用)中心',
+              },
+            ]}
+            width="sm"
+            name="shareLevel"
+            label="选择分摊级别"
+          />
+
+          <ProFormDependency name={['shareLevel']}>
+            {({ label }) => {
+              return label ? (
+                <ProFormText
+                  initialValue={label}
+                  label="主医院名称"
+                  rules={[
+                    {
+                      required: false,
+                      message: (
+                        <FormattedMessage id="pages.searchTable.parentName" defaultMessage="..." />
+                      ),
+                    },
+                  ]}
+                  width="sm"
+                />
+              ) : <></>;
+            }}
+          </ProFormDependency>
+        </ModalForm>
+      }
+    </>
+  );
+};
+
+export default UpdateForm;

+ 67 - 24
src/pages/user/Login/index.jsx

@@ -6,14 +6,16 @@ import {
   UserOutlined,
   WeiboCircleOutlined,
 } from '@ant-design/icons';
-import { Alert, message } from 'antd';
-import React, { useState } from 'react';
-import ProForm, { ProFormCaptcha, ProFormCheckbox, ProFormText } from '@ant-design/pro-form';
+import { Alert, message,notification} from 'antd';
+import React, { useState, useEffect } from 'react';
+import ProForm, { ProFormCaptcha, ProFormCheckbox, ProFormText, ProFormDependency, ProFormSelect } from '@ant-design/pro-form';
 import { useIntl, Link, history, FormattedMessage, SelectLang, useModel } from 'umi';
 import Footer from '@/components/Footer';
-import { login } from '@/services/user';
+import { login, getSubHosp } from '@/services/user';
 import { getFakeCaptcha } from '@/services/ant-design-pro/login';
 import styles from './index.less';
+import CustomDialog from '@/components/Dialog';
+import { getQueryString } from '../../../utils.js';
 
 const LoginMessage = ({ content }) => (
   <Alert
@@ -30,7 +32,7 @@ const Login = () => {
   const [submitting, setSubmitting] = useState(false);
   const [userLoginState, setUserLoginState] = useState({});
   const [type, setType] = useState('account');
-  const [hospSign, setHospSign] = useState('8CJYqxlGIdLEIwaG');
+  const [subHospList, setSubHospList] = useState([]);
   const { initialState, setInitialState } = useModel('@@initialState');
   const intl = useIntl();
 
@@ -42,22 +44,34 @@ const Login = () => {
   //   }
   // };
 
+  const { fetchSubHosp, sign } = initialState;
+
   const handleSubmit = async (values) => {
     setSubmitting(true);
 
     try {
 
       // 登录
-      const msg = await login({ ...values,hospSign});
-      console.log({msg});
-
-      if (msg.status === 200) {
+      const loginResp = await login({ ...values, hospSign: sign });
+      const {status,msg,data} = loginResp;
+      // console.log({status,msg,data});
+      if (status == 200) {
         const defaultloginSuccessMessage = intl.formatMessage({
           id: 'pages.login.success',
           defaultMessage: '登录成功!',
         });
+
+        if (localStorage.getItem('userData') == null || localStorage.getItem('userData') == undefined) {
+          localStorage.setItem('userData',null);
+        }
+        if (localStorage.getItem('loginParams') == null || localStorage.getItem('loginParams') == undefined) {
+          localStorage.setItem('loginParams',null);
+        }
+        localStorage.setItem('loginParams',JSON.stringify({hospSign:sign}));
+        localStorage.setItem('userData',JSON.stringify(data));
+
         message.success(defaultloginSuccessMessage);
-        await setInitialState((s) => ({ ...s, currentUser: msg.data }));
+        await setInitialState((s) => ({ ...s, currentUser:data }));
         /** 此方法会跳转到 redirect 参数所在的位置 */
 
         if (!history) return;
@@ -65,10 +79,15 @@ const Login = () => {
         const { redirect } = query;
         history.push(redirect || '/');
         return;
-      } // 如果失败去设置用户错误信息
+      }else {
+        notification.error({
+          message:msg
+        })
+      }
 
-      setUserLoginState(msg);
+      setUserLoginState(data);
     } catch (error) {
+      console.log({error});
       const defaultloginFailureMessage = intl.formatMessage({
         id: 'pages.login.failure',
         defaultMessage: '登录失败,请重试!',
@@ -78,15 +97,30 @@ const Login = () => {
 
     setSubmitting(false);
   };
-
+  //登录类型
   const { status, type: loginType } = userLoginState;
+
+  useEffect(() => {
+
+    fetchSubHosp().then(res => {
+      if (res&&res.success) {
+        const temp = res.map(item => ({
+          'value': item.id,
+          'label': item.name
+        }))
+        setSubHospList(temp);
+      }
+    })
+  }, []);
+
+
   return (
     <div className={styles.container}>
       <div className={styles.content}>
         <div className={styles.top}>
           <div className={styles.header}>
             <Link to="/">
-              <img alt="logo" className={styles.logo} src="/kcLogo.png" />
+              <img alt="logo" className={styles.logo} src="/KC-color.png" />
               <span className={styles.title}>全成本核算管理系统</span>
             </Link>
           </div>
@@ -134,10 +168,7 @@ const Login = () => {
                     size: 'large',
                     prefix: <UserOutlined className={styles.prefixIcon} />,
                   }}
-                  placeholder={intl.formatMessage({
-                    id: 'pages.login.username.placeholder',
-                    defaultMessage: '用户名:',
-                  })}
+                  placeholder={'用户名:'}
                   rules={[
                     {
                       required: true,
@@ -156,10 +187,7 @@ const Login = () => {
                     size: 'large',
                     prefix: <LockOutlined className={styles.prefixIcon} />,
                   }}
-                  placeholder={intl.formatMessage({
-                    id: 'pages.login.password.placeholder',
-                    defaultMessage: '密码:',
-                  })}
+                  placeholder={'密码:'}
                   rules={[
                     {
                       required: true,
@@ -174,7 +202,22 @@ const Login = () => {
                 />
               </>
             )}
-            
+
+            <ProFormDependency name={['name', ['name2', 'text']]}>
+              {({ name, name2 }) => {
+                return (
+                  <ProFormSelect
+                    options={
+                      subHospList
+                    }
+                    width="md"
+                    name="useMode"
+                    label='请选择分院'
+                  />
+                );
+              }}
+            </ProFormDependency>
+
             <div
               style={{
                 marginBottom: 24,
@@ -182,7 +225,7 @@ const Login = () => {
             >
             </div>
           </ProForm>
-          
+
         </div>
       </div>
       <Footer />

+ 10 - 2
src/services/user.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-07-23 14:26:44
- * @LastEditTime: 2021-07-23 14:56:28
+ * @LastEditTime: 2021-07-26 14:19:50
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/services/user.js
@@ -14,7 +14,7 @@ import { request } from 'umi';
 /** 登录接口 POST */
 
 export async function login(body, options) {
-    return request('/api/employee/login', {
+    return request('/api/costAccount/login', {
       method: 'POST',
       headers: {
         'Content-Type': 'application/json',
@@ -22,4 +22,12 @@ export async function login(body, options) {
       data: body,
       ...(options || {}),
     });
+}
+
+
+//获取医院分院列表
+export async function getSubHosp(sign) {
+    return request(`/api/costAccount/getHospArea?sign=${sign}`, {
+      method: 'GET',
+    });
 }

+ 47 - 0
src/utils.js

@@ -0,0 +1,47 @@
+/*
+ * @Author: your name
+ * @Date: 2021-07-26 13:50:44
+ * @LastEditTime: 2021-07-28 11:46:46
+ * @LastEditors: Please set LastEditors
+ * @Description: In User Settings Edit
+ * @FilePath: /TracerMethodology_PC/src/utils.js
+ */
+
+
+//获取url参数
+/**
+ * 
+ * @param {*} name 需要获取的query名
+ * @returns 
+ */
+
+
+ import { useRequest,request } from 'umi';
+
+
+const getQueryString = (name)=>{
+    let reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
+    let r = window.location.search.substr(1).match(reg);
+    console.log({r});
+    if (r != null) {
+        return decodeURIComponent(r[2]);
+    };
+    return null;
+} 
+
+/**
+ * 
+ * @param {Function} requestFunc request函数
+ */
+const CARequest = (url)=>{
+      const { data, error, loading } = useRequest(() => {
+        return request(url);
+      });
+      console.log({data, error, loading});
+      
+}
+
+export  {
+    getQueryString,
+    CARequest
+}