|
@@ -1,14 +1,14 @@
|
|
|
/*
|
|
|
* @Author: your name
|
|
|
* @Date: 2021-07-26 10:13:13
|
|
|
- * @LastEditTime: 2021-08-30 17:35:45
|
|
|
+ * @LastEditTime: 2021-09-10 09:12:58
|
|
|
* @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, Tag, Modal, Form, Switch } from 'antd';
|
|
|
import React, { useState, useRef } from 'react';
|
|
|
|
|
|
import { PageContainer } from '@ant-design/pro-layout';
|
|
@@ -28,20 +28,20 @@ import {
|
|
|
getReportProjectSettingList,
|
|
|
saveReportRelation,
|
|
|
getHasSetReportRelation,
|
|
|
- copyDataToSelectedType
|
|
|
+ copyDataToSelectedType,
|
|
|
} from './service';
|
|
|
|
|
|
import { getAccountingSubjectList } from '@/pages/accountingSubject/service';
|
|
|
|
|
|
import { getApportionmentLevelList } from '@/pages/apportionmentLevel/service';
|
|
|
|
|
|
-import {getResponsibilityCenterList} from '@/pages/responsibilityCenter/service';
|
|
|
+import { getResponsibilityCenterList } from '@/pages/responsibilityCenter/service';
|
|
|
|
|
|
import DrawerContent from './component/drawerContent';
|
|
|
|
|
|
-import {reportTypes} from '@/projectConstant';
|
|
|
+import { reportTypes } from '@/projectConstant';
|
|
|
|
|
|
-import {deepGetAllParents} from '@/utils';
|
|
|
+import { deepGetAllParents } from '@/utils';
|
|
|
|
|
|
const ReportProjectSetting = () => {
|
|
|
const columns = [
|
|
@@ -50,23 +50,27 @@ const ReportProjectSetting = () => {
|
|
|
dataIndex: 'reportName',
|
|
|
key: 'reportName',
|
|
|
hideInSearch: true,
|
|
|
+ ellipsis: true,
|
|
|
},
|
|
|
{
|
|
|
title: 'Id',
|
|
|
dataIndex: 'id',
|
|
|
key: 'id',
|
|
|
hideInSearch: true,
|
|
|
+ ellipsis: true,
|
|
|
},
|
|
|
{
|
|
|
title: '编号',
|
|
|
dataIndex: 'num',
|
|
|
key: 'num',
|
|
|
+ ellipsis: true,
|
|
|
hideInSearch: true,
|
|
|
},
|
|
|
{
|
|
|
title: '计算方式',
|
|
|
dataIndex: 'calcType',
|
|
|
key: 'calcType',
|
|
|
+ ellipsis: true,
|
|
|
hideInSearch: true,
|
|
|
//1.对应会计科目,2.对应分摊层级,3.小计,4.计算公式
|
|
|
render: (num) => {
|
|
@@ -90,6 +94,7 @@ const ReportProjectSetting = () => {
|
|
|
title: '报表类型',
|
|
|
dataIndex: 'reportType',
|
|
|
key: 'reportType',
|
|
|
+ ellipsis: true,
|
|
|
hideInSearch: true,
|
|
|
//报表类型:0.损益表、1.完全成本法表、2.变动成本表、3.全院损益表、4.全成本报表
|
|
|
render: (num) => {
|
|
@@ -112,17 +117,20 @@ const ReportProjectSetting = () => {
|
|
|
dataIndex: 'calcFormula',
|
|
|
key: 'calcFormula',
|
|
|
hideInSearch: true,
|
|
|
+ ellipsis: true,
|
|
|
},
|
|
|
{
|
|
|
title: '排序',
|
|
|
dataIndex: 'sort',
|
|
|
key: 'sort',
|
|
|
+ ellipsis: true,
|
|
|
hideInSearch: true,
|
|
|
},
|
|
|
{
|
|
|
title: '比率基数',
|
|
|
dataIndex: 'ratioBase',
|
|
|
key: 'ratioBase',
|
|
|
+ ellipsis: true,
|
|
|
hideInSearch: true,
|
|
|
},
|
|
|
{
|
|
@@ -135,7 +143,8 @@ const ReportProjectSetting = () => {
|
|
|
<a
|
|
|
key="config1"
|
|
|
onClick={() => {
|
|
|
- setIfAddZeroLevelMenu(false);
|
|
|
+ setIfOperateZeroLevelMenu(false);
|
|
|
+ setEdit(false);
|
|
|
handleModalVisible(true);
|
|
|
setModalFormType(1);
|
|
|
setCurrentRow(record);
|
|
@@ -146,7 +155,10 @@ const ReportProjectSetting = () => {
|
|
|
<a
|
|
|
key="config2"
|
|
|
onClick={() => {
|
|
|
- handleUpdateModalVisible(true);
|
|
|
+ setIfOperateZeroLevelMenu(parentId==0?true:false);
|
|
|
+ setEdit(true);
|
|
|
+ setModalFormType(1);
|
|
|
+ handleModalVisible(true);
|
|
|
setCurrentRow(record);
|
|
|
}}
|
|
|
>
|
|
@@ -171,7 +183,11 @@ const ReportProjectSetting = () => {
|
|
|
setRelationInit(showAddRelation, record);
|
|
|
}}
|
|
|
>
|
|
|
- {showAddRelation == 1 ? '对应会计科目设置' : showAddRelation == 2 ? '对应分摊层级设置':showAddRelation==3&&'对应责任中心设置'}
|
|
|
+ {showAddRelation == 1
|
|
|
+ ? '对应会计科目设置'
|
|
|
+ : showAddRelation == 2
|
|
|
+ ? '对应分摊层级设置'
|
|
|
+ : showAddRelation == 3 && '对应责任中心设置'}
|
|
|
</a>,
|
|
|
...btnGroup,
|
|
|
]
|
|
@@ -186,11 +202,13 @@ const ReportProjectSetting = () => {
|
|
|
dataIndex: 'accountingCode',
|
|
|
key: 'accountingCode',
|
|
|
hideInSearch: true,
|
|
|
+ ellipsis: true,
|
|
|
},
|
|
|
{
|
|
|
title: '会计科目名',
|
|
|
dataIndex: 'accountingName',
|
|
|
key: 'accountingName',
|
|
|
+ ellipsis: true,
|
|
|
},
|
|
|
];
|
|
|
|
|
@@ -199,12 +217,14 @@ const ReportProjectSetting = () => {
|
|
|
title: '分摊层级Id',
|
|
|
dataIndex: 'id',
|
|
|
key: 'id',
|
|
|
+ ellipsis: true,
|
|
|
hideInSearch: false,
|
|
|
},
|
|
|
{
|
|
|
title: '分摊层级名',
|
|
|
dataIndex: 'shareName',
|
|
|
key: 'shareName',
|
|
|
+ ellipsis: true,
|
|
|
hideInSearch: false,
|
|
|
},
|
|
|
];
|
|
@@ -215,27 +235,28 @@ const ReportProjectSetting = () => {
|
|
|
dataIndex: 'responsibilityCode',
|
|
|
key: 'responsibilityCode',
|
|
|
hideInSearch: false,
|
|
|
+ ellipsis: true,
|
|
|
},
|
|
|
{
|
|
|
title: '责任中心名',
|
|
|
dataIndex: 'responsibilityName',
|
|
|
key: 'responsibilityName',
|
|
|
hideInSearch: false,
|
|
|
+ ellipsis: true,
|
|
|
},
|
|
|
];
|
|
|
|
|
|
-
|
|
|
- const tabList = [
|
|
|
- ...reportTypes
|
|
|
- ]
|
|
|
+ const tabList = [...reportTypes].filter((item) => item.key == 0 || item.key == 3);
|
|
|
|
|
|
const [createModalVisible, handleModalVisible] = useState(false);
|
|
|
const [updateModalVisible, handleUpdateModalVisible] = useState(false);
|
|
|
const actionRef = useRef();
|
|
|
const [currentRow, setCurrentRow] = useState(undefined);
|
|
|
- const [ifAddZeroLevelMenu, setIfAddZeroLevelMenu] = useState(true);
|
|
|
+ const [ifOperateZeroLevelMenu, setIfOperateZeroLevelMenu] = useState(true);
|
|
|
const [reportType, setReportType] = useState(0);
|
|
|
|
|
|
+ const [edit, setEdit] = useState(false);
|
|
|
+
|
|
|
const [accountType, setAccountType] = useState(1);
|
|
|
|
|
|
const [modalFormType, setModalFormType] = useState(0); // 1 新增表单 2 复制表单
|
|
@@ -247,7 +268,7 @@ const ReportProjectSetting = () => {
|
|
|
|
|
|
const [selectedKeys, setSelectedKeys] = useState([]);
|
|
|
|
|
|
- const [defaultExpandedKeys,setDefaultExpandedKeys] = useState([]);
|
|
|
+ const [defaultExpandedKeys, setDefaultExpandedKeys] = useState([]);
|
|
|
|
|
|
/**
|
|
|
*
|
|
@@ -272,8 +293,8 @@ const ReportProjectSetting = () => {
|
|
|
const getTableList = async (params = {}, sort, filter) => {
|
|
|
if (settingType == 1) {
|
|
|
const res = await getAccountingSubjectList({ ...params, accountType });
|
|
|
- const opendedArr = deepGetAllParents(res.data.list,'children');
|
|
|
- opendedArr&&setDefaultExpandedKeys(opendedArr.map(item=>item.accountingCode));
|
|
|
+ const opendedArr = deepGetAllParents(res.data.list, 'children');
|
|
|
+ opendedArr && setDefaultExpandedKeys(opendedArr.map((item) => item.accountingCode));
|
|
|
|
|
|
return {
|
|
|
data: res.data.list,
|
|
@@ -291,8 +312,8 @@ const ReportProjectSetting = () => {
|
|
|
}
|
|
|
if (settingType == 3) {
|
|
|
const res = await getResponsibilityCenterList({ ...params });
|
|
|
- const opendedArr = deepGetAllParents(res.data.list,'child');
|
|
|
- opendedArr&&setDefaultExpandedKeys(opendedArr.map(item=>item.responsibilityCode));
|
|
|
+ const opendedArr = deepGetAllParents(res.data.list, 'child');
|
|
|
+ opendedArr && setDefaultExpandedKeys(opendedArr.map((item) => item.responsibilityCode));
|
|
|
return {
|
|
|
data: res.data.list,
|
|
|
total: res.data.totalCount,
|
|
@@ -334,7 +355,7 @@ const ReportProjectSetting = () => {
|
|
|
setCurrentRow(record);
|
|
|
|
|
|
const resp = await getHasSetReportRelation({ reportId, relation: showAddRelation });
|
|
|
- const { status, data=[] } = resp;
|
|
|
+ const { status, data = [] } = resp;
|
|
|
if (status == 200) {
|
|
|
if (showAddRelation == 1) {
|
|
|
const tempArr = data.map((item) => item.code);
|
|
@@ -345,25 +366,56 @@ const ReportProjectSetting = () => {
|
|
|
setSelectedKeys(tempArr);
|
|
|
}
|
|
|
if (showAddRelation == 3) {
|
|
|
- const tempArr = data.map((item) =>item.code);
|
|
|
+ const tempArr = data.map((item) => item.code);
|
|
|
setSelectedKeys(tempArr);
|
|
|
}
|
|
|
}
|
|
|
setDrawerVisible(true);
|
|
|
};
|
|
|
|
|
|
-
|
|
|
+ const openRule = () => {
|
|
|
+ Modal.info({
|
|
|
+ title: '报表项目填写注意事项!',
|
|
|
+ width: 800,
|
|
|
+ content: (
|
|
|
+ <div>
|
|
|
+ <h4>计算类型说明 </h4>
|
|
|
+ <span>不设置:</span>
|
|
|
+ 一般用于第一层。 对应成本科目:对应的是成本科目,如工资,收入类等
|
|
|
+ <div></div>
|
|
|
+ <span>对应责任中心:</span>
|
|
|
+ 对应的是分摊的责任中心,放射科,功能科等
|
|
|
+ <div></div>
|
|
|
+ <span>对应分摊层级:</span>
|
|
|
+ 对应的是分摊的层级,如“护理”分摊层级,“医技”分摊层级。
|
|
|
+ <div></div>
|
|
|
+ <span>小计:</span>
|
|
|
+ 是对第一层下的所有项目的合计计算。
|
|
|
+ <div></div>
|
|
|
+ <span>计算公式:</span>
|
|
|
+ 是按编号对报表项目的项目进行计算结果,支持加/减法。
|
|
|
+ <div style={{ marginBottom: 20 }}></div>
|
|
|
+ <h4>报表项目顺序注意事项</h4>
|
|
|
+ 计算类型是小计报表项目需要维护在对应层级的其他项目之后
|
|
|
+ <div></div>
|
|
|
+ 计算类型是计算公式的报表项目需要维护在公式里包含的其他项目之后
|
|
|
+ </div>
|
|
|
+ ),
|
|
|
+ });
|
|
|
+ };
|
|
|
|
|
|
return (
|
|
|
- <PageContainer
|
|
|
- tabList={tabList}
|
|
|
- onTabChange={onTabChangeHandle}
|
|
|
- >
|
|
|
+ <PageContainer tabList={tabList} onTabChange={onTabChangeHandle}>
|
|
|
<ProTable
|
|
|
columns={columns}
|
|
|
request={getReportProjectSetting}
|
|
|
actionRef={actionRef}
|
|
|
rowKey="id"
|
|
|
+ headerTitle={
|
|
|
+ <Tag style={{ cursor: 'pointer' }} onClick={openRule} color="warning">
|
|
|
+ 注意事项
|
|
|
+ </Tag>
|
|
|
+ }
|
|
|
toolBarRender={() => [
|
|
|
<Button
|
|
|
key="button"
|
|
@@ -380,7 +432,8 @@ const ReportProjectSetting = () => {
|
|
|
type="primary"
|
|
|
onClick={() => {
|
|
|
setModalFormType(1);
|
|
|
- setIfAddZeroLevelMenu(true);
|
|
|
+ setEdit(false);
|
|
|
+ setIfOperateZeroLevelMenu(true);
|
|
|
handleModalVisible(true);
|
|
|
}}
|
|
|
>
|
|
@@ -394,45 +447,86 @@ const ReportProjectSetting = () => {
|
|
|
/>
|
|
|
|
|
|
<ModalForm
|
|
|
- title="新增报表项目设置"
|
|
|
+ title={modalFormType==2?'复制数据':edit ? '编辑报表项目设置' : '新增报表项目设置'}
|
|
|
width="800px"
|
|
|
labelCol={{ span: 5, offset: 3 }}
|
|
|
layout={'horizontal'}
|
|
|
+ initialValues={edit?{...currentRow}:{}}
|
|
|
modalProps={{
|
|
|
destroyOnClose: true,
|
|
|
}}
|
|
|
visible={createModalVisible}
|
|
|
- onVisibleChange={handleModalVisible}
|
|
|
+ onVisibleChange={(bool) => {
|
|
|
+ !bool && setCurrentRow(undefined);
|
|
|
+ handleModalVisible(bool);
|
|
|
+ }}
|
|
|
onFinish={async (value) => {
|
|
|
- if(modalFormType ==1){
|
|
|
- let id = 0;
|
|
|
- currentRow && (id = currentRow.id);
|
|
|
- const resp = await addReportProjectSettingList({
|
|
|
- ...value,
|
|
|
- reportType: Number(reportType),
|
|
|
- parentId: id,
|
|
|
- });
|
|
|
- const { status } = resp;
|
|
|
- setCurrentRow(undefined);
|
|
|
- if (status == 200) {
|
|
|
- if (actionRef.current) {
|
|
|
- actionRef.current.reload();
|
|
|
+ // console.log({edit,value});
|
|
|
+ if (modalFormType == 1) {
|
|
|
+ //新增数据
|
|
|
+
|
|
|
+ if (edit) {
|
|
|
+ //编辑
|
|
|
+ const { parentId,id} = currentRow;
|
|
|
+ const {reportName, sort, calcType=0, calcFormula='', isLoss } = value;
|
|
|
+ const updateData = {
|
|
|
+ id,
|
|
|
+ parentId,
|
|
|
+ reportName,
|
|
|
+ sort,
|
|
|
+ reportType,
|
|
|
+ calcType,
|
|
|
+ calcFormula,
|
|
|
+ isLoss: isLoss ? 1 : 0,
|
|
|
+ };
|
|
|
+
|
|
|
+ const resp = await editReportProjectSettingList(updateData);
|
|
|
+ const { status } = resp;
|
|
|
+
|
|
|
+ if (status == 200) {
|
|
|
+ if (actionRef.current) {
|
|
|
+ actionRef.current.reload();
|
|
|
+ }
|
|
|
+ return true;
|
|
|
}
|
|
|
- return true;
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- if(modalFormType == 2){
|
|
|
- const {toReportType} = value;
|
|
|
- const resp = await copyDataToSelectedType({fromReportType:Number(reportType),toReportType});
|
|
|
- if (resp) {
|
|
|
+ if (!edit) {
|
|
|
+ //新增
|
|
|
+ const { calcType = 0, calcFormula = '' } = value;
|
|
|
+ let id = 0;
|
|
|
+ currentRow && (id = currentRow.id);
|
|
|
+ const resp = await addReportProjectSettingList({
|
|
|
+ ...value,
|
|
|
+ calcType,
|
|
|
+ calcFormula,
|
|
|
+ isLoss: value.isLoss ? 1 : 0,
|
|
|
+ reportType: Number(reportType),
|
|
|
+ parentId: id,
|
|
|
+ });
|
|
|
+ const { status } = resp;
|
|
|
+ if (status == 200) {
|
|
|
if (actionRef.current) {
|
|
|
actionRef.current.reload();
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (modalFormType == 2) {
|
|
|
+ //复制数据
|
|
|
+ const { toReportType } = value;
|
|
|
+ const resp = await copyDataToSelectedType({
|
|
|
+ fromReportType: Number(reportType),
|
|
|
+ toReportType,
|
|
|
+ });
|
|
|
+ if (resp) {
|
|
|
+ if (actionRef.current) {
|
|
|
+ actionRef.current.reload();
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
}}
|
|
|
>
|
|
|
{modalFormType == 1 && (
|
|
@@ -459,71 +553,104 @@ const ReportProjectSetting = () => {
|
|
|
width="sm"
|
|
|
name="sort"
|
|
|
/>
|
|
|
- <ProFormSelect
|
|
|
- name="calcType"
|
|
|
- label="计算类型"
|
|
|
- width="sm"
|
|
|
- options={[
|
|
|
- { label: '不设置', value: 0 },
|
|
|
- { label: '对应会计科目', value: 1 },
|
|
|
- { label: '对应分摊层级', value: 2 },
|
|
|
- { label: '小计', value: 3 },
|
|
|
- { label: '计算公式', value: 4 },
|
|
|
- { label: '按责任中心', value: 5 },
|
|
|
- ]}
|
|
|
- placeholder="请选择状态"
|
|
|
- rules={[{ required: true, message: '请选择开单科室状态!' }]}
|
|
|
- />
|
|
|
-
|
|
|
- <ProFormDependency name={['calcType']}>
|
|
|
- {({ calcType }) => {
|
|
|
- // const resp = await getResponsibilityCenterList({pageSize:100,current:1});
|
|
|
- return calcType == 4 ? (
|
|
|
- <ProFormText
|
|
|
- label="计算公示"
|
|
|
- rules={[
|
|
|
- {
|
|
|
- required: true,
|
|
|
- message: '计算公式是必填项!',
|
|
|
- },
|
|
|
- ]}
|
|
|
- width="sm"
|
|
|
- placeholder="例如:[1] + [2]"
|
|
|
- name="calcFormula"
|
|
|
- />
|
|
|
- ) : (
|
|
|
- <></>
|
|
|
- );
|
|
|
- }}
|
|
|
- </ProFormDependency>
|
|
|
+ {!ifOperateZeroLevelMenu&& (
|
|
|
+ //编辑/新增顶级不展示
|
|
|
+ <>
|
|
|
+ <ProFormSelect
|
|
|
+ name="calcType"
|
|
|
+ label="计算类型"
|
|
|
+ width="sm"
|
|
|
+ options={[
|
|
|
+ { label: '不设置', value: 0 },
|
|
|
+ { label: '对应会计科目', value: 1 },
|
|
|
+ { label: '对应分摊层级', value: 2 },
|
|
|
+ { label: '小计', value: 3 },
|
|
|
+ { label: '计算公式', value: 4 },
|
|
|
+ { label: '按责任中心', value: 5 },
|
|
|
+ ]}
|
|
|
+ placeholder="请选择状态"
|
|
|
+ rules={[{ required: true, message: '请选择开单科室状态!' }]}
|
|
|
+ />
|
|
|
+
|
|
|
+ <ProFormDependency name={['calcType']}>
|
|
|
+ {({ calcType }) => {
|
|
|
+ // const resp = await getResponsibilityCenterList({pageSize:100,current:1});
|
|
|
+ return calcType == 4 ? (
|
|
|
+ <ProFormText
|
|
|
+ label="计算公示"
|
|
|
+ rules={[
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '计算公式是必填项!',
|
|
|
+ },
|
|
|
+ ]}
|
|
|
+ width="sm"
|
|
|
+ placeholder="例如:[1] + [2]"
|
|
|
+ name="calcFormula"
|
|
|
+ />
|
|
|
+ ) : (
|
|
|
+ <></>
|
|
|
+ );
|
|
|
+ }}
|
|
|
+ </ProFormDependency>
|
|
|
+ <ProFormDependency name={['calcType']}>
|
|
|
+ {({ calcType }) => {
|
|
|
+ // const resp = await getResponsibilityCenterList({pageSize:100,current:1});
|
|
|
+ return calcType == 4 && reportType == 3 ? (
|
|
|
+ <Form.Item
|
|
|
+ name="isLoss"
|
|
|
+ label="损益标志"
|
|
|
+ valuePropName="checked"
|
|
|
+ >
|
|
|
+ <Switch />
|
|
|
+ </Form.Item>
|
|
|
+ ) : (
|
|
|
+ <></>
|
|
|
+ );
|
|
|
+ }}
|
|
|
+ </ProFormDependency>
|
|
|
+ </>
|
|
|
+ )}
|
|
|
</>
|
|
|
)}
|
|
|
{modalFormType == 2 && (
|
|
|
- <ProFormSelect
|
|
|
- name="toReportType"
|
|
|
- label="复制到"
|
|
|
- width="sm"
|
|
|
- options={(()=>{
|
|
|
- const tempArr = tabList.map(item=>({label:item.tab,value:item.key}));
|
|
|
- return tempArr.filter(item=>item.value != reportType);
|
|
|
- })()}
|
|
|
- placeholder="请选择"
|
|
|
- rules={[{ required: true, message: '请选择复制到目标!' }]}
|
|
|
- />
|
|
|
+ <ProFormSelect
|
|
|
+ name="toReportType"
|
|
|
+ label="复制到"
|
|
|
+ width="sm"
|
|
|
+ options={(() => {
|
|
|
+ const tempArr = tabList.map((item) => ({ label: item.tab, value: item.key }));
|
|
|
+ return tempArr.filter((item) => item.value != reportType);
|
|
|
+ })()}
|
|
|
+ placeholder="请选择"
|
|
|
+ rules={[{ required: true, message: '请选择复制到目标!' }]}
|
|
|
+ />
|
|
|
)}
|
|
|
</ModalForm>
|
|
|
|
|
|
{/* 对应设置抽屉 */}
|
|
|
<DrawerContent
|
|
|
- title={settingType == 1 ? '对应会计科目设置' : settingType==2?'对应分摊层级设置':'对应责任中心设置'}
|
|
|
- columns={settingType == 1 ? accountingSubjectColumn : settingType==2?shareParamsColumn:responsibilityColumn} //shareParamsColumn
|
|
|
+ title={
|
|
|
+ settingType == 1
|
|
|
+ ? '对应会计科目设置'
|
|
|
+ : settingType == 2
|
|
|
+ ? '对应分摊层级设置'
|
|
|
+ : '对应责任中心设置'
|
|
|
+ }
|
|
|
+ columns={
|
|
|
+ settingType == 1
|
|
|
+ ? accountingSubjectColumn
|
|
|
+ : settingType == 2
|
|
|
+ ? shareParamsColumn
|
|
|
+ : responsibilityColumn
|
|
|
+ } //shareParamsColumn
|
|
|
visible={drawerVisible}
|
|
|
currentRow={currentRow}
|
|
|
// tableRef = {drawerTableRef}
|
|
|
defaultSelected={selectedKeys}
|
|
|
expandable={{
|
|
|
- childrenColumnName:settingType==1?'children':'child',
|
|
|
- expandedRowKeys:defaultExpandedKeys
|
|
|
+ childrenColumnName: settingType == 1 ? 'children' : 'child',
|
|
|
+ expandedRowKeys: defaultExpandedKeys,
|
|
|
}}
|
|
|
pageContainerConfig={(tableRef) => {
|
|
|
return {
|
|
@@ -553,14 +680,23 @@ const ReportProjectSetting = () => {
|
|
|
},
|
|
|
};
|
|
|
}}
|
|
|
- onVisibleChange={(bool) => {!bool&&setAccountType(1);setDrawerVisible(bool)}}
|
|
|
+ onVisibleChange={(bool) => {
|
|
|
+ !bool && setAccountType(1);
|
|
|
+ setDrawerVisible(bool);
|
|
|
+ }}
|
|
|
renderListFunc={getTableList}
|
|
|
- config={{ tableSearch: false, rowKeys: settingType == 1 ? 'accountingCode' :settingType==2?'id':'responsibilityCode' }}
|
|
|
+ config={{
|
|
|
+ tableSearch: false,
|
|
|
+ rowKeys:
|
|
|
+ settingType == 1 ? 'accountingCode' : settingType == 2 ? 'id' : 'responsibilityCode',
|
|
|
+ }}
|
|
|
onFinishFunc={async (value, selectedRowKeys) => {
|
|
|
// console.log({value,selectedRowKeys});
|
|
|
let selectedRowKeysToStr = [];
|
|
|
if (settingType == 2) {
|
|
|
- selectedRowKeys?selectedRowKeys.map((item) => selectedRowKeysToStr.push(`${item}`)):[];
|
|
|
+ selectedRowKeys
|
|
|
+ ? selectedRowKeys.map((item) => selectedRowKeysToStr.push(`${item}`))
|
|
|
+ : [];
|
|
|
}
|
|
|
const { id: reportId } = currentRow;
|
|
|
const resp = await saveReportRelation({
|
|
@@ -578,42 +714,6 @@ const ReportProjectSetting = () => {
|
|
|
}
|
|
|
}}
|
|
|
/>
|
|
|
-
|
|
|
- {/* 更新 */}
|
|
|
- <UpdateForm
|
|
|
- onSubmit={async (value) => {
|
|
|
- const { parentId, calcType: calcTypePrev } = currentRow;
|
|
|
- const { id, reportName, sort, calcType,calcFormula } = value;
|
|
|
- const updateData = {
|
|
|
- id,
|
|
|
- parentId,
|
|
|
- reportName,
|
|
|
- sort,
|
|
|
- reportType,
|
|
|
- calcType,
|
|
|
- calcFormula
|
|
|
- };
|
|
|
-
|
|
|
- const resp = await editReportProjectSettingList(updateData);
|
|
|
- const { status } = resp;
|
|
|
-
|
|
|
- if (status == 200) {
|
|
|
- handleUpdateModalVisible(false);
|
|
|
- setCurrentRow(undefined);
|
|
|
-
|
|
|
- if (actionRef.current) {
|
|
|
- actionRef.current.reload();
|
|
|
- }
|
|
|
- }
|
|
|
- }}
|
|
|
- onCancel={() => {
|
|
|
- handleUpdateModalVisible(false);
|
|
|
- setCurrentRow(undefined);
|
|
|
- }}
|
|
|
- updateModalVisible={updateModalVisible}
|
|
|
- updateModalVisibleChange={updateModalVisibleChange}
|
|
|
- values={currentRow || {}}
|
|
|
- />
|
|
|
</PageContainer>
|
|
|
);
|
|
|
};
|