code4eat 4 жил өмнө
parent
commit
12c4260799

+ 1 - 2
config/config.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-07-22 15:04:09
- * @LastEditTime: 2021-08-05 16:04:37
+ * @LastEditTime: 2021-08-13 09:46:17
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/config/config.js
@@ -38,7 +38,6 @@ export default defineConfig({
   theme: {
     'primary-color':defaultSettings.primaryColor,
   },
- 
   // esbuild is father build tools
   // https://umijs.org/plugins/plugin-esbuild
   esbuild: {},

+ 109 - 12
mock/afterCollectionSearch.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-08-12 09:59:49
- * @LastEditTime: 2021-08-12 10:07:58
+ * @LastEditTime: 2021-08-12 20:32:24
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /CostAccountManaSys/mock/afterCollectionSearch.js
@@ -94,17 +94,114 @@ function delList(req, res, u, b) {
 }
 
 
-function getHasBindList(req, res, u, b){
+function getTableList(req, res, u, b){
    const data = {
-    id:98,
-    allocation:1,
-    incomeType:2,
-    shareParamCode:98,
-    shareParamName:'shareParamName 98',
-    incomeFieldNum:98,
-    incomeFileName:'incomeFileName 98',
-    costCorresponding:98,
-    costCorrespondingName:'costCorrespondingName 98'
+        titleMap:{
+            '1':'泌尿外科1',
+            '2':'泌尿外科2',
+            '3':'泌尿外科3',
+            '3':'泌尿外科4',
+            '5':'泌尿外科5',
+            '6':'泌尿外科6'
+        },
+        realData:[
+            {
+                "1": "医务收入",
+                "2": 2400,
+                "3": 2400,
+                "4": "医务收入4",
+                "5": 2400,
+                "6": 2400
+            },
+            {
+                "1": "医务收入",
+                "2": 2400,
+                "3": 2400,
+                "4": "医务收入4",
+                "5": 2400,
+                "6": 2400
+            },
+            {
+                "1": "医务收入",
+                "2": 2400,
+                "3": 2400,
+                "4": "医务收入4",
+                "5": 2400,
+                "6": 2400
+            },
+            {
+                "1": "医务收入",
+                "2": 2400,
+                "3": 2400,
+                "4": "医务收入4",
+                "5": 2400,
+                "6": 2400
+            },
+            {
+                "1": "医务收入",
+                "2": 2400,
+                "3": 2400,
+                "4": "医务收入4",
+                "5": 2400,
+                "6": 2400
+            },
+            {
+                "1": "医务收入",
+                "2": 2400,
+                "3": 2400,
+                "4": "医务收入4",
+                "5": 2400,
+                "6": 2400
+            },
+            {
+                "1": "医务收入",
+                "2": 2400,
+                "3": 2400,
+                "4": "医务收入4",
+                "5": 2400,
+                "6": 2400
+            },
+            {
+                "1": "医务收入",
+                "2": 2400,
+                "3": 2400,
+                "4": "医务收入4",
+                "5": 2400,
+                "6": 2400
+            },
+            {
+                "1": "医务收入",
+                "2": 2400,
+                "3": 2400,
+                "4": "医务收入4",
+                "5": 2400,
+                "6": 2400
+            },
+            {
+                "1": "医务收入",
+                "2": 2400,
+                "3": 2400,
+                "4": "医务收入4",
+                "5": 2400,
+                "6": 2400
+            },
+            {
+                "1": "医务收入",
+                "2": 2400,
+                "3": 2400,
+                "4": "医务收入4",
+                "5": 2400,
+                "6": 2400
+            }
+        ],
+        totalMap:{
+            "1": 1000,
+            "2": 2400,
+            "3": 2400,
+            "4": 400,
+            "5": 2400,
+        }
+        
    }
        
    const result = {
@@ -146,7 +243,7 @@ function bindList(req, res, u, b) {
 
 export default {
   'GET /api/costAccount/incomeCollection/collectList': getList,
-  'GET /api/costAccount/costotherpayments': getHasBindList,
+  'GET /api/costAccount/incomeCollection/collectTableList': getTableList,
   'GET /api/costAccount/role/roleMenus': getHasBindMenuList,
   'POST /api/costAccount/costotherpayments/save': postList,
   'POST /api/costAccount/role/delete': delList,

+ 1 - 1
mock/role.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-08-02 18:11:13
- * @LastEditTime: 2021-08-04 14:17:02
+ * @LastEditTime: 2021-08-13 10:20:57
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /CostAccountManaSys/mock/role.js

+ 3 - 6
src/app.jsx

@@ -212,7 +212,7 @@ const demoResponseInterceptors = async (response, options) => {
   try {
 
     const { status } = response;
-
+    // console.log({response});
     if (status != 200) {
       const { errorCode, } = response;
       if (errorCode == 500) {
@@ -226,12 +226,9 @@ const demoResponseInterceptors = async (response, options) => {
         });
       } else {
         notification.error({
-          message: errorMessage
+          message:`错误 ${status}`
         });
       }
-
-
-      return;
     }
 
     const _response = await response.clone().json();
@@ -245,7 +242,7 @@ const demoResponseInterceptors = async (response, options) => {
       }
       return response;
     } else {
-      console.log({ isExpired });
+      // console.log({ isExpired });
       if (errorCode == 499 && !isExpired) {
         isExpired = true;
         Modal.confirm({

+ 93 - 54
src/components/CAUpload/index.jsx

@@ -1,10 +1,10 @@
 
 
 
-import {ImportOutlined} from '@ant-design/icons';
+import { ImportOutlined } from '@ant-design/icons';
 import React, { Component } from 'react';
 import PropTypes from 'prop-types';
-import {Button,Upload,message,Modal,Divider} from 'antd';
+import { Button, Upload, message, Modal, Divider, Menu, Dropdown } from 'antd';
 // import Cookies from 'js-cookie';
 // 服务器地址,此处为了做演示,没有全局引入,直接写了
 const Host = 'http://112.124.59.133:8082';
@@ -22,17 +22,19 @@ class CAUpload extends Component {
         // 表格上传事件
         this.uploadProps.onChange = this.uploadProps.onChange.bind(this);
 
-        this.customRequestCallback = props.customRequestCallback?props.customRequestCallback.bind(this):()=>{};
+        this.customRequestCallback = props.customRequestCallback ? props.customRequestCallback.bind(this) : () => { };
 
-        this.timer=null;
+        this.timer = null;
 
         this.file = null;
+        
+        this.templeteUrl=''
     }
     // 模板下载
     jumpTo() {
         const userData = localStorage.getItem('userData');
-        const {token} = JSON.parse(userData);
-        window.open(`${Host}${this.props.templateHref}?token=${token}`);
+        const { token } = JSON.parse(userData);
+        window.open(`${Host}${this.templeteUrl}?token=${token}`);
     }
     // 上传参数
     uploadProps = {
@@ -46,7 +48,7 @@ class CAUpload extends Component {
         // showUploadList:false,
         // // 上传的参数
         // data: {
-            
+
         //     // uid: Cookies.get('uid')
         // },
         // // 设置上传的请求头部,IE10 以上有效
@@ -56,19 +58,19 @@ class CAUpload extends Component {
         //     'token':this.props.token,
         // },
         // 上传文件前的钩子函数
-        showUploadList:false,
+        showUploadList: false,
         beforeUpload() {
             message.loading('正在导入中...');
             return true;
         },
-        customRequest:({
-            file,data,action,onSuccess
-        })=>{
-               console.log({file,data,action,onSuccess});
-               const formData = new FormData();
-               formData.set('file',file);
-               this.file = file;
-               if(this.props.type != 'dialog')this.customRequestCallback(formData);
+        customRequest: ({
+            file, data, action, onSuccess
+        }) => {
+            console.log({ file, data, action, onSuccess });
+            const formData = new FormData();
+            formData.set('file', file);
+            this.file = file;
+            if (this.props.type != 'dialog') this.customRequestCallback(formData);
 
         },
         // 上传文件改变时的状态
@@ -102,77 +104,114 @@ class CAUpload extends Component {
     // 导出Excel表格
     async exportExcel() {
         const userData = localStorage.getItem('userData');
-        const {token} = JSON.parse(userData);
+        const { token } = JSON.parse(userData);
         const url = Host + this.props.url + `/export?token=${token}`;
         window.open(url);
         //获取  全院其他收支设置列表
     }
 
-    openModal(){
+    renderMenu(){
+        return (
+            <Menu onClick={this.handleMenuClick.bind(this)}>
+                  {
+                         this.props.templateHrefs&&Array.isArray(this.props.templateHrefs)&&this.props.templateHrefs.map((item,index)=>{
+                            return (
+                                <Menu.Item key={item.value}>{item.label}</Menu.Item>
+                            )
+                     })
+                  }
+            </Menu>
+        ) 
+    }
+
+
+    handleMenuClick(e){
+        // console.log('菜单点击',e);
+        const {key} = e;
+        this.templeteUrl = key;
+    }
+
+    handleButtonClick(e){
+         if(this.templeteUrl == ''){
+            message.error('请选择下载模板!');
+         }else{
+            this.jumpTo();
+         }
+    }
+
+    openModal() {
         const uploadProps = this.uploadProps;
         Modal.confirm({
-            title:<React.Fragment>
-                      导入数据
-                    <Divider plain></Divider>
-                </React.Fragment>,
-            icon:null,
-            width:600,
-            okText:'确定',
-            cancelText:'取消',
-            onOk:()=>{
-                return new Promise((resolve,reject)=>{
-                      this.timer = setTimeout(()=>{
+            title: <React.Fragment>
+                导入数据
+                <Divider plain></Divider>
+            </React.Fragment>,
+            icon: null,
+            width: 600,
+            okText: '确定',
+            cancelText: '取消',
+            onOk: () => {
+                return new Promise((resolve, reject) => {
+                    this.timer = setTimeout(() => {
                         resolve(true);
                         this.customRequestCallback(this.file)
-                      },1500)
-                }).then(res=>{
+                    }, 1500)
+                }).then(res => {
                     // console.log({res})
                 })
-                .catch(err =>console.log({err}))
-                
+                    .catch(err => console.log({ err }))
+
             },
-            content:<React.Fragment >
-                 {this.props.content}
-                 <Divider plain></Divider>
-                 <Upload  style={{marginLeft: 10}} key='importExcel' {...uploadProps} >
-                     <Button icon={<ImportOutlined />} type="primary">选择上传文件</Button>
-                 </Upload>
+            content: <React.Fragment >
+                {this.props.content}
+                <Divider plain></Divider>
+                <Upload style={{ marginLeft: 10 }} key='importExcel' {...uploadProps} >
+                    <Button icon={<ImportOutlined />} type="primary">选择上传文件</Button>
+                </Upload>
             </React.Fragment>
         });
     }
 
-    componentWillUnmount(){
-          clearTimeout( this.timer);
+    componentWillUnmount() {
+        clearTimeout(this.timer);
     }
 
     render() {
         const uploadProps = this.uploadProps;
-        const {type} = this.props;
-        if(type == 'normal'){
+        const { type,templateHrefs } = this.props;
+        console.log({...this.props});
+        if (type == 'normal') {
             return [
                 // <Button style={{marginLeft: 10}} key='exportExcel' onClick={this.exportExcel}>导出</Button>,
-                <Upload style={{marginLeft: 10}} key='importExcel' {...uploadProps} >
+                <Upload style={{ marginLeft: 10 }} key='importExcel' {...uploadProps} >
                     <Button type="primary">导入</Button>
                 </Upload>,
-                <Button  style={{marginLeft: 10}} key='templateDowload' onClick={this.jumpTo}>模板下载</Button>
+                <Button style={{ marginLeft: 10 }} key='templateDowload' onClick={()=>{this.templeteUrl = templateHrefs;this.jumpTo();}}>模板下载</Button>
             ]
         }
-        if(type == 'dialog'){
-              return [
-                <Button type="primary" key='a' onClick={()=>this.openModal()}>导入</Button>,
-                <Button style={{marginLeft: 10}} key='templateDowloadTwo' onClick={this.jumpTo}>模板下载</Button>
+        if (type == 'dialog') {
+            return [
+                <Button type="primary" key='a' onClick={() => this.openModal()}>导入</Button>,
+                // <Button style={{marginLeft: 10}} key='templateDowloadTwo' onClick={this.jumpTo}>模板下载</Button>,
+                <Dropdown.Button onClick={this.handleButtonClick.bind(this)} overlay={this.renderMenu()}>
+                    模板下载
+                </Dropdown.Button>
+
             ]
         }
 
         return <></>
-        
+
     }
 }
 
 // 定义参数类型
 CAUpload.propTypes = {
     // 模板下载地址
-    templateHref: PropTypes.string.isRequired,
+    templateHrefs: PropTypes.oneOfType([
+        PropTypes.array,
+        PropTypes.string,
+    ]),    
     // 上传地址
     url: PropTypes.string.isRequired,
     // 导入成功后的回调
@@ -180,9 +219,9 @@ CAUpload.propTypes = {
     //最终必需resolve一个值
     customRequestCallback: PropTypes.func,
     //上传功能类型 【‘normal’,'dialog'】
-    type:PropTypes.string,
+    type: PropTypes.string,
     //渲染节点
-    content:PropTypes.node,
+    content: PropTypes.node,
 };
 
 
@@ -190,7 +229,7 @@ CAUpload.propTypes = {
 
 
 // const CAUpload = (props)=>{
-    
+
 //     return (
 //         <Upload {...props}>
 //             <Button type="primary" icon={<ImportOutlined />}>导入</Button>

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

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 10:13:13
- * @LastEditTime: 2021-08-11 09:00:44
+ * @LastEditTime: 2021-08-12 19:19:17
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
@@ -145,7 +145,7 @@ const UserMana = () => {
             新增
           </Button>,
           <CAUpload  
-                templateHref={'/costAccount/excel/getImportUserTemplate'}
+                templateHrefs={'/costAccount/excel/getImportUserTemplate'}
                 url='/costAccount/excel/importUser'
                 importSuccessCallback={() =>{}}
                 token={token}

+ 9 - 9
src/pages/accountingSubject/index.jsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 10:13:13
- * @LastEditTime: 2021-08-06 18:28:12
+ * @LastEditTime: 2021-08-13 10:30:42
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
@@ -37,14 +37,14 @@ const AccountingSubject = () => {
       hideInSearch: true,
       width: '30%'
     },
-    {
-      title: '是否固定成本',
-      dataIndex: 'isBaseCost',
-      key: 'isBaseCost',
-      hideInSearch: true,
-      render: (text) => <>{text == 1 ? '是' : '否'}</>,
-      width: '20%'
-    },
+    // {
+    //   title: '是否固定成本',
+    //   dataIndex: 'isBaseCost',
+    //   key: 'isBaseCost',
+    //   hideInSearch: true,
+    //   render: (text) => <>{text == 1 ? '是' : '否'}</>,
+    //   width: '20%'
+    // },
     {
       title:'操作',
       dataIndex: 'option',

+ 12 - 11
src/pages/baseSetting/visitsAndBedDayCostSetting/index.jsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 10:13:13
- * @LastEditTime: 2021-08-10 16:29:33
+ * @LastEditTime: 2021-08-13 10:32:11
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
@@ -218,6 +218,7 @@ const DistrictMana = () => {
   const openDrawerHandle = (num, bool) => {
     setType(num);
     setIfcostCorresponding(bool);
+    if(!edit)setDefaultReportTableSelected([].concat([]));
     if(bool&&edit){
       console.log('成本');
       const {costFileType,costCorresponding} = dataById;
@@ -291,8 +292,8 @@ const DistrictMana = () => {
             const { num: costCorresponding, reportName: costCorrespondingName,reportType:costFileType } = selectedCost;
             const data = { 
                allocation, incomeType, shareParamCode, shareParamName, incomeFieldNum,
-               incomeFileName:`${reportTableTypes[incomeFileType]}${incomeFileName}`,
-               costCorresponding, costCorrespondingName:`${reportTableTypes[costFileType]}${costCorrespondingName}`,
+               incomeFileName:`[${reportTableTypes[incomeFileType]}]${incomeFileName}`,
+               costCorresponding, costCorrespondingName:`[${reportTableTypes[costFileType]}]${costCorrespondingName}`,
                incomeFileType,costFileType}
             // console.log({data});
             const success = await addVisitsAndBedDayCostSettingList(data);
@@ -321,10 +322,10 @@ const DistrictMana = () => {
                 value: 1,
                 label: '按收入比例分配',
               },
-              {
-                value: 2,
-                label: '按照固定比例分配',
-              },
+              // {
+              //   value: 2,
+              //   label: '按照固定比例分配',
+              // },
             ]}
             width="sm"
             name="allocation"
@@ -340,11 +341,11 @@ const DistrictMana = () => {
             options={[
               {
                 value: 1,
-                label: '门诊方式',
+                label: '门诊收入',
               },
               {
                 value: 2,
-                label: '住院方式',
+                label: '住院收入',
               },
             ]}
             width="sm"
@@ -413,7 +414,7 @@ const DistrictMana = () => {
           renderListFunc={getDrawerTableList}
           config={{ tableSearch: false, rowKeys: 'shareParamCode' }}
           onFinishFunc={async (value, selectedRowKeys, selectedRows) => {
-            console.log({ '分摊': selectedRows })
+            // console.log({ '分摊': selectedRows })
             setSelectedShareparams(selectedRows[0]);
             const { shareParamName } = selectedRows[0];
             if(edit){
@@ -522,7 +523,7 @@ const DistrictMana = () => {
       {/* 更新 */}
       <UpdateForm
         onSubmit={async (value) => {
-          console.log({ '编辑': value });
+          // console.log({ '编辑': value });
             const {id} = currentRow;
             const { allocation, incomeType } = value;
             let data = {id,allocation,incomeType};

+ 6 - 6
src/pages/baseSetting/visitsAndBedDayCostSetting/updateForm.jsx

@@ -43,10 +43,10 @@ const UpdateForm = (props) => {
                 value: 1,
                 label: '按收入比例分配',
               },
-              {
-                value: 2,
-                label: '按照固定比例分配',
-              },
+              // {
+              //   value: 2,
+              //   label: '按照固定比例分配',
+              // },
             ]}
             width="sm"
             name="allocation"
@@ -62,11 +62,11 @@ const UpdateForm = (props) => {
             options={[
               {
                 value: 1,
-                label: '门诊方式',
+                label: '门诊收入',
               },
               {
                 value: 2,
-                label: '住院方式',
+                label: '住院收入',
               },
             ]}
             width="sm"

+ 6 - 26
src/pages/baseSetting/wholeHospCostAndIncomeSet/index.jsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 10:13:13
- * @LastEditTime: 2021-08-10 16:40:42
+ * @LastEditTime: 2021-08-13 09:08:46
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
@@ -26,7 +26,7 @@ const WholeHospCostAndIncomeSet = () => {
       dataIndex: 'paymentsType',
       key: 'paymentsType',
       hideInSearch: true,
-      render: num => <>{num == 1 ? '门诊方式' : '住院方式'}</>
+      render: num => <>{num == 1 ? '收入' : '支出'}</>
     },
     {
       title: '收支名称',
@@ -62,27 +62,13 @@ const WholeHospCostAndIncomeSet = () => {
     },
   ];
 
-  const drawerTableColumns = [
-      {
-        title: '分摊参数名称',
-        dataIndex: 'shareParamName',
-        key: 'shareParamName',
-        hideInSearch: true,
-      },
-      {
-        title: '分摊参数代码',
-        dataIndex: 'shareParamCode',
-        key: 'shareParamCode',
-        hideInSearch: true,
-      }
-  ]
 
   const [createModalVisible, handleModalVisible] = useState(false);
   const [updateModalVisible, handleUpdateModalVisible] = useState(false);
   const actionRef = useRef();
   const ref = useRef();   //新增表单
   const [currentRow, setCurrentRow] = useState({});
-  const [drawerVisible,setDrawerVisible] = useState(false);
+
 
   /**
    *
@@ -95,7 +81,7 @@ const WholeHospCostAndIncomeSet = () => {
 
   //获取列表
   const getList = async (params = {}, sort, filter) => {
-    const res = await getWholeHospCostList(params);
+    const res = await getWholeHospCostList({...params});
     // console.log({res});
     return {
       data: res.data.list,
@@ -121,10 +107,7 @@ const WholeHospCostAndIncomeSet = () => {
   };
 
 
-  const openDrawerHandle = ()=>{
-    console.log('focus');
-    setDrawerVisible(true);
-  }
+
 
   // useEffect(()=>{
   //   CARequest('/api/costAccount/hosptail/list');
@@ -153,10 +136,7 @@ const WholeHospCostAndIncomeSet = () => {
         pagination={{
           pageSize: 10,
         }}
-        search={{
-          defaultCollapsed: false,
-          labelWidth: 'auto',
-        }}
+        search={false}
 
       />
 

+ 74 - 112
src/pages/costAccounting/afterCollectionSearch/index.jsx

@@ -1,14 +1,14 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 10:13:13
- * @LastEditTime: 2021-08-12 15:12:35
+ * @LastEditTime: 2021-08-12 21:09:11
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
  */
 
 // import { PlusOutlined } from '@ant-design/icons';
-import { Cascader, Form, Button, Drawer,Table} from 'antd';
+import { Cascader, Form, Button, Drawer, Table } from 'antd';
 import React, { useRef, useState, useEffect } from 'react';
 import { PageContainer } from '@ant-design/pro-layout';
 import ProTable from '@ant-design/pro-table';
@@ -16,7 +16,7 @@ import {
   ProFormDatePicker,
   ProFormSelect,
 } from '@ant-design/pro-form';
-import { getAfterIncomeCollectionList } from './service';
+import { getAfterIncomeCollectionList, getAfterIncomeCollectionTableData } from './service';
 import { getResponsibilityCenterList } from '@/pages/responsibilityCenter/service';
 import { getCostProjecttList } from '@/pages/costProjectMana/service';
 import moment from 'moment';
@@ -28,14 +28,17 @@ const AfterCollectionSearch = () => {
 
   const [currentTime, setCurrentTime] = useState(moment().format('YYYY-MM'));
   const [selectableResponsibilityList, setSelectableResponsibilityList] = useState([]);
+  const [selectedResponsibilityCode,setSelectedResponsibilityCode] = useState(null);
+  const [selectedAccountingCode,setSelectedAccountingCode] = useState(null)
+  
   // const [selectableCostProjectList, setSelectableCostProjectList] = useState([])
 
   const columns = [
     {
       title: '选择时间',
-      key: 'dateTime',
+      key: 'date',
       hideInTable: true,
-      dataIndex: 'dateTime',
+      dataIndex: 'date',
       renderFormItem: (item, { type, defaultRender, formItemProps, fieldProps, ...rest }, form) => {
 
         if (type === 'form') {
@@ -43,7 +46,7 @@ const AfterCollectionSearch = () => {
         }
         return (
           <Form.Item >
-            <ProFormDatePicker initialValue={currentTime} fieldProps={{ picker: 'month', format: (value) => { return value.format('YYYYMM') }, locale: locale }} name="dateTime" />
+            <ProFormDatePicker initialValue={currentTime} fieldProps={{ picker: 'month', format: (value) => { return value.format('YYYY-MM') }, locale: locale,onChange:(moment)=>{setCurrentTime(moment.format('YYYYMM'))} }} name="date" />
           </Form.Item>
         )
       },
@@ -68,8 +71,9 @@ const AfterCollectionSearch = () => {
               fieldNames={{
                 label: 'responsibilityName',
                 value: 'responsibilityCode',
-                children: 'child'
+                children: 'child',
               }}
+              onChange={(val)=>{setSelectedResponsibilityCode(val[0])}}
               {...fieldProps}
             />
           </Form.Item>
@@ -78,9 +82,9 @@ const AfterCollectionSearch = () => {
     },
     {
       title: '成本项目',
-      key: 'accountCode',
+      key: 'accountingCode',
       hideInTable: true,
-      dataIndex: 'accountCode',
+      dataIndex: 'accountingCode',
       renderFormItem: (item, { type, defaultRender, formItemProps, fieldProps, ...rest }, form) => {
         // console.log({item,type, defaultRender,formItemProps, fieldProps,rest,form })
         if (type === 'form') {
@@ -88,7 +92,7 @@ const AfterCollectionSearch = () => {
         }
 
         return (
-          <Form.Item name="accountCode">
+          <Form.Item name="accountingCode">
             <ProFormSelect
               request={async () => {
                 const resp = await getCostProjecttList({ pageSize: 100 });
@@ -103,8 +107,11 @@ const AfterCollectionSearch = () => {
                   return arr;
                 }
               }}
+              fieldProps={{
+                  onChange:(value)=>{setSelectedAccountingCode(value)}
+              }}
               width="md"
-              name="accountCode"
+              name="accountingCode"
             />
           </Form.Item>
         )
@@ -179,99 +186,19 @@ const AfterCollectionSearch = () => {
   ];
 
 
-  const drawerTableColumns = [
-    {
-      title: '年份',
-      dataIndex: 'year',
-      key: 'year',
-      hideInSearch: true,
-      width:500,
-      fixed: 'left',
-    },
-    {
-      title: '月份',
-      dataIndex: 'month',
-      key: 'month',
-      width:500,
-      hideInSearch: true,
-    },
-    {
-      title: '科室编码',
-      dataIndex: 'departmentCode',
-      key: 'departmentCode',
-      width:500,
-      hideInSearch: true,
-    },
-    {
-      title: '科室名称',
-      dataIndex: 'departmentName',
-      key: 'departmentName',
-      width:500,
-      hideInSearch: true,
-    },
-    {
-      title: '责任中心编码',
-      dataIndex: 'responsibilityCode',
-      key: 'responsibilityCode',
-      width:500,
-      hideInSearch: true,
-    },
-    {
-      title: '责任中心名',
-      dataIndex: 'responsibilityName',
-      key: 'responsibilityName',
-      width:500,
-      hideInSearch: true,
-    },
-    {
-      title: '会计科目编码',
-      dataIndex: 'accountingCode',
-      key: 'accountingCode',
-      width:500,
-      hideInSearch: true,
-    },
-    {
-      title: '会计科目名',
-      dataIndex: 'accountingName',
-      key: 'accountingName',
-      width:500,
-      hideInSearch: true,
-    },
-    {
-      title: '成本项目编码',
-      dataIndex: 'projectCode',
-      key: 'projectCode',
-      hideInSearch: true,
-      width:500,
-    },
-    {
-      title: '成本项目名',
-      dataIndex: 'projectName',
-      key: 'projectName',
-      hideInSearch: true,
-      width:500,
-    },
-    {
-      title: '金额',
-      dataIndex: 'amount',
-      key: 'amount',
-      fixed: 'right',
-      width:500,
-      hideInSearch: true,
-    },
-  ]
 
 
   const actionRef = useRef();
   const [totalCount, setTotalCount] = useState(0);
   const [drawerVisible, setDrawerVisible] = useState(false);
-
+  const [reportTableColumns, setReportTableColumns] = useState([]);
+  const [totalData,setTotalData] = useState([]);
 
   //获取列表
   const getList = async (params = {}, sort, filter) => {
     const { dateTime } = params;
     // console.log(moment(dateTime).format('YYYY-MM'));
-    const res = await getAfterIncomeCollectionList({ ...params, dateTime: moment(dateTime).format('YYYYMM') });
+    const res = await getAfterIncomeCollectionList({ ...params, date: moment(date).format('YYYYMM') });
     if (res && res.status) {
       const { data: { totalAmount } } = res;
       setTotalCount(totalAmount);
@@ -284,14 +211,48 @@ const AfterCollectionSearch = () => {
 
   };
 
-  const getDrawerTableList = async () => {
-    const resp = await getAfterIncomeCollectionList();
-    const { status, data } = resp;
+
+  const renderDrawerHandle = () => {
+   
+      setDrawerVisible(true);
+
+    
+  }
+
+  const getReportData = async (params = {}, sort, filter)=>{
+
+    const resp = await getAfterIncomeCollectionTableData({...params,date:currentTime,responsibilityCode:selectedResponsibilityCode,accountingCode:selectedAccountingCode});
+    const { status, data: { titleMap, realData, totalMap } } = resp;
     if (status == 200) {
-      return {
-        data: data.list,
+      const titleMapToArr = Object.entries(titleMap);
+      const totalMapToArr = Object.entries(totalMap);
+      const columns = [...titleMapToArr].map((item, index) => {
+        if (index == 0 || index == [...titleMapToArr].length - 1) {
+          return {
+            title: item[1],
+            dataIndex: item[0],
+            key: item[0],
+            fixed:index == 0?'left':'right',
+            hideInSearch: true,
+            width: 100,
+          }
+        }
+        return {
+          title: item[1],
+          dataIndex: item[0],
+          key: item[0],
+          hideInSearch: true,
+          width: 500,
+        }
+      });
+      
+      setReportTableColumns(columns);
+      setTotalData(totalMapToArr);
+
+      return Promise.resolve({
+        data: realData,
         success: true,
-      };
+      });
     }
   }
 
@@ -312,7 +273,7 @@ const AfterCollectionSearch = () => {
         actionRef={actionRef}
         rowKey="id"
         toolBarRender={() => [
-          <Button type='primary' onClick={() => setDrawerVisible(true)}>报表数据</Button>
+          <Button type='primary' onClick={() => renderDrawerHandle()}>报表数据</Button>
         ]}
         pagination={{
           pageSize: 10,
@@ -329,34 +290,35 @@ const AfterCollectionSearch = () => {
         title="报表数据"
         placement="right"
         width={'90%'}
+        destroyOnClose={true}
         closable={true}
-        onClose={()=>setDrawerVisible(false)}
+        onClose={() => setDrawerVisible(false)}
         visible={drawerVisible}
       >
         <ProTable
-          columns={drawerTableColumns}
-          request={getList}
+          columns={reportTableColumns}
+          request={getReportData}
           actionRef={actionRef}
           rowKey="id"
-          
+          bordered
           pagination={false}
           search={false}
           scroll={{ x: 1500, y: 300 }}
           summary={() => (
-            <Table.Summary fixed>
+            <Table.Summary fixed >
               <Table.Summary.Row className="rowCell">
-              <Table.Summary.Cell className="firstCell" index={0}>合计</Table.Summary.Cell>
+                <Table.Summary.Cell className="firstCell" index={0}>合计</Table.Summary.Cell>
                 {
-                  [1,2,3,4,5,6,7,8,9,10].map((item,index)=>{
-                      return (
-                        <Table.Summary.Cell  className={index==9?'ant-table-cell ant-table-cell-fix-right ant-table-cell-fix-right-last':'cell'} index={index}>10000</Table.Summary.Cell>
-                      )
+                  totalData.map((item, index) => {
+                    return (
+                      <Table.Summary.Cell key={index}  className={index == 9 ? 'ant-table-cell ant-table-cell-fix-right ant-table-cell-fix-right-last' : 'cell'} index={index+1}>{item[1]}</Table.Summary.Cell>
+                    )
                   })
                 }
               </Table.Summary.Row>
             </Table.Summary>
           )}
-          // footer={() => <a>{`合计:${totalCount}`}</a>}
+        // footer={() => <a>{`合计:${totalCount}`}</a>}
 
         />
       </Drawer>

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

@@ -10,4 +10,8 @@
 .lastCell {
      position: sticky;
      right: 0 !important;
+}
+
+.cell {
+    padding: 5px 8px !important;
 }

+ 11 - 8
src/pages/costAccounting/afterCollectionSearch/service.js

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

+ 2 - 2
src/pages/costAccounting/beforeCollectionSearch/index.jsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 10:13:13
- * @LastEditTime: 2021-08-12 08:53:20
+ * @LastEditTime: 2021-08-13 09:18:57
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
@@ -191,7 +191,7 @@ const IncomeCostDataImport = () => {
 
 
   useEffect(async () => {
-       const responsibilityList = await getResponsibilityCenterList({pageSize:50});
+       const responsibilityList = await getResponsibilityCenterList({pageSize:500});
        const {data:{list}} = responsibilityList;
        setSelectableResponsibilityList(list);
   }, []);

+ 2 - 2
src/pages/costAccounting/incomeCollection/index.jsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 10:13:13
- * @LastEditTime: 2021-08-11 19:17:42
+ * @LastEditTime: 2021-08-12 19:28:07
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
@@ -113,7 +113,7 @@ const IncomeCollection = () => {
    * @param {Boolen} isCollection  
    */
   const optionBtnGroupshandle = async (isCollection,record)=>{
-    console.log({record});
+   
     const {year,month} = record;
       if(isCollection){
            const resp = await cancelIncomeCollection({year,month});

+ 1 - 10
src/pages/costAccounting/incomeCostDataImport/components/DrawerContent.jsx

@@ -42,18 +42,9 @@ export default function DrawerContent(props) {
     const [ifSearch,setIfSearch] = useState(false);
     const [selectedRows,setSelectedRows] = useState([]);
 
-    const renderDefault = ()=>{
-        // console.log({defaultSelected});
-        const defaultSelects = defaultSelected;
-        setDefaultSelectedKeys(defaultSelected);
-        setSelectedKeys(defaultSelects);
-    }
-
 
     useEffect(()=>{
-        // console.log({tabActiveKey});
-        renderDefault();
-    },[props]);
+    },[props,currentRow]);
 
 
     return visible&&currentRow&&columns.length>0 ? (

+ 37 - 12
src/pages/costAccounting/incomeCostDataImport/index.jsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 10:13:13
- * @LastEditTime: 2021-08-12 14:30:35
+ * @LastEditTime: 2021-08-12 18:58:41
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
@@ -17,6 +17,10 @@ import DrawerContent from './components/DrawerContent';
 import CAUpload from '@/components/CAUpload/index';
 import { getIncomeCostDataImport,addIncomeCostDataImport,cancelIncomeCostDataImport,getIncomeCostDataImportErrList } from './service';
 
+import moment from 'moment';
+import 'moment/locale/zh-cn';
+import locale from 'antd/es/date-picker/locale/zh_CN';
+
 
 const IncomeCostDataImport = () => {
   const columns = [
@@ -78,12 +82,11 @@ const IncomeCostDataImport = () => {
       valueType: 'option',
       render: (_, record) =>{
           const {errStatus} = record;
-          setCurrentRow(record);
           return [
             <Button
               key="config"
               onClick={() => {
-                optionBtnGrouphandle(errStatus)
+                optionBtnGrouphandle(errStatus,record)
               }}
             >
               {errStatus==1?'错误详情':'撤销导入'}
@@ -117,7 +120,7 @@ const IncomeCostDataImport = () => {
   const actionRef = useRef();
   const ref = useRef();   //新增表单
   const importFormRef = useRef();   //导入表单
-  const [currentRow, setCurrentRow] = useState({});
+  const [currentRow, setCurrentRow] = useState(null);
   const [drawerVisible,setDrawerVisible] = useState(false);
   const [formData,setFormData] = useState(null);
 
@@ -127,9 +130,11 @@ const IncomeCostDataImport = () => {
    * 
    * @param {Number} errStatus  
    */
-  const optionBtnGrouphandle = async (errStatus)=>{
+  const optionBtnGrouphandle = async (errStatus,record)=>{
+        console.log({errStatus,record});
+        setCurrentRow(record);
         if(errStatus != 1){
-             const {id} = currentRow;
+             const {id} = record;
              const resp = await cancelIncomeCostDataImport({id});
              const {status} = resp;
              if(status==200){
@@ -167,7 +172,7 @@ const IncomeCostDataImport = () => {
 
   //自定义上传回调
   const customRequestCallback = (file)=>{
-    console.log({file});
+    // console.log({file});
     const formData = new FormData();
     formData.set('file',file);
     setFormData(formData);
@@ -195,7 +200,10 @@ const IncomeCostDataImport = () => {
               const {fileType,dateTime} = values;
               formData.set('fileType',fileType);
               formData.set('dateTime',dateTime);
-              
+              // console.log({formData});
+              // console.log(formData.get('fileType'));
+              // console.log(formData.get('dateTime'));
+              // console.log(formData.get('file'));
               const resp = await addIncomeCostDataImport({formData},{
                 'content-type':'multipart/form-data',
               })
@@ -221,7 +229,9 @@ const IncomeCostDataImport = () => {
           width="sm"
           name="dateTime"
           fieldProps={{
-            format: 'YYYY-MM-DD',
+            format: 'YYYY-MM',
+            picker:'month',
+            locale:locale
           }}
           label="数据所属年月"
         />
@@ -256,6 +266,7 @@ const IncomeCostDataImport = () => {
   
 
   const getDrawerTableList = async ()=>{
+        console.log({currentRow});
         const {id} = currentRow;
         const resp = await getIncomeCostDataImportErrList({id});
         const {status,data} = resp;
@@ -282,7 +293,20 @@ const IncomeCostDataImport = () => {
         rowKey="id"
         toolBarRender={() => [
           <CAUpload
-            templateHref={'/costAccount/excel/getImportIncomeProductAccountTemplate'}
+            templateHrefs={[
+                {
+                  label:'成本分摊参数模板',
+                  value:'/costAccount/excel/getShareParamTemplate'
+                },
+                {
+                  label:'收入数据模板',
+                  value:'/costAccount/excel/getImportIncomeProductAccountTemplate'
+                },
+                {
+                  label:'成本数据模板',
+                  value:'/costAccount/excel/getImportCostProductAccountTemplate'
+                }
+            ]}
             url='/costAccount/excel/importDataByFileType'
             importSuccessCallback={() => { }}
             type='dialog'
@@ -371,10 +395,11 @@ const IncomeCostDataImport = () => {
           columns={drawerTableColumns}
           visible={drawerVisible}
           title="错误详情"
-          onVisibleChange={(bool) => setDrawerVisible(bool)}
+          currentRow={currentRow}
+          onVisibleChange={(bool) =>{setDrawerVisible(bool);} }
           renderListFunc={getDrawerTableList}
           onFinishFunc={async (value, selectedRowKeys, selectedRows) => {
-          
+                
           }}
       />
     </PageContainer>

+ 14 - 5
src/pages/costAccounting/incomeCostDataImport/service.js

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 08:54:08
- * @LastEditTime: 2021-08-11 18:58:01
+ * @LastEditTime: 2021-08-12 18:24:15
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/DepartmentMana/service.js
@@ -31,16 +31,25 @@ export async function getIncomeCostDataImportErrList(params, options) {
 }
 
 
-//导入数据
+//导入收入数据
 export async function addIncomeCostDataImport(body, options) {
-  const {fileFormData} = body;
-  return request('/api/costAccount/excel/importDataByFileType', {
+  const {formData} = body;
+  const type = formData.get('fileType');
+  const urlMap = [
+    '/api/costAccount/excel/importShareParamGroup',//成本分摊
+    '/api/costAccount/excel/importDataByFileType',//收入
+    '/api/costAccount/excel/importCostingGroup',//成本
+  ];
+  // console.log({type},Number(type)-1);
+  return request(urlMap[Number(type)-1], {
     method: 'POST',
-    data:fileFormData,
+    data:formData,
     ...(options || {}),
   });
 }
 
+//addIncomeCostDataImport
+
 //撤销导入
 export async function cancelIncomeCostDataImport(body, options) {
   const {id} = body;

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

@@ -3,6 +3,7 @@ import React from 'react';
 import {
   ProFormText,
   ModalForm,
+  ProFormSelect
 } from '@ant-design/pro-form';
 
 
@@ -45,6 +46,27 @@ const UpdateForm = (props) => {
             width="sm"
             name="shareParamCode"
           />
+          <ProFormSelect
+          rules={[
+            {
+              required: true,
+              message:'请选择计算方式',
+            },
+          ]}
+          options={[
+            {
+              value: 1,
+              label: '手动填写',
+            },
+            {
+              value: 2,
+              label: '按对应会计科目计算',
+            },
+          ]}
+          width="sm"
+          name="calcType"
+          label="计算方式"
+        />
         </ModalForm>
       }
     </>

+ 22 - 11
src/pages/platformMana/roleManage/index.js

@@ -1,33 +1,31 @@
 /*
  * @Author: your name
  * @Date: 2021-07-26 10:13:13
- * @LastEditTime: 2021-08-09 11:13:38
+ * @LastEditTime: 2021-08-13 10:16:27
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /TracerMethodology_PC/src/pages/UserMana/index.js
  */
 
 import { PlusOutlined } from '@ant-design/icons';
-import { Button, Popconfirm} from 'antd';
+import { Button, Popconfirm,Form} from 'antd';
 import React, { useState, useRef } from 'react';
 import { PageContainer } from '@ant-design/pro-layout';
 import ProTable from '@ant-design/pro-table';
-import { ModalForm, ProFormText } from '@ant-design/pro-form';
+import { ModalForm, ProFormText,ProFormDateRangePicker } from '@ant-design/pro-form';
 import UpdateForm from './updateForm';
 import DrawerContent from './component/drawer';
 import { getRoleList, roleBindUser, addList, editList, delList,roleBindMenu,roleHasBindUsers,roleHasBindMenus } from './service';
 import { getUserList } from '@/pages/UserMana/service';
 
+import moment from 'moment';
+import 'moment/locale/zh-cn';
+import locale from 'antd/es/date-picker/locale/zh_CN';
+
 import { getMenuList } from '@/pages/platformMana/menuManage/service';
 
 const UserMana = () => {
   const columns = [
-    // {
-    //   title: '院区名称',
-    //   dataIndex: 'hospName',
-    //   key: 'hospName',
-    //   hideInSearch: true,
-    // },
     {
       title: '角色名',
       dataIndex: 'roleName',
@@ -43,7 +41,17 @@ const UserMana = () => {
       title: '变更日期',
       dataIndex: 'modifyTime',
       key: 'modifyTime',
-      valueType: 'dateRange',
+      renderFormItem: (item, { type, defaultRender, formItemProps, fieldProps, ...rest }, form) => {
+
+        if (type === 'form') {
+          return null;
+        }
+        return (
+          <Form.Item >
+            <ProFormDateRangePicker  fieldProps={{locale: locale,onChange:(moment)=>{console.log(moment)} }} name="modifyTime" />
+          </Form.Item>
+        )
+      },
     },
     {
       title: '操作',
@@ -153,7 +161,10 @@ const UserMana = () => {
 
   //获取列表
   const getList = async (params = {}, sort, filter) => {
-    const res = await getRoleList(params);
+    //format: (value) => { return [value[0].format('YYYY-MM-DD'),value[1].format('YYYY-MM-DD')] }
+    const {pageSize,current,modifyTime,roleName:keyword} = params;
+    const query = modifyTime?{pageSize,current,keyword,startDate:moment(modifyTime[0]).format('YYYY-MM-DD'),endDate:moment(modifyTime[1]).format('YYYY-MM-DD')}:{pageSize,current,keyword}
+    const res = await getRoleList(query);
     return {
       data: res.data.list,
       total: res.data.totalCount,