|
@@ -2,109 +2,109 @@
|
|
* @Author: code4eat awesomedema@gmail.com
|
|
* @Author: code4eat awesomedema@gmail.com
|
|
* @Date: 2023-03-03 11:30:33
|
|
* @Date: 2023-03-03 11:30:33
|
|
* @LastEditors: code4eat awesomedema@gmail.com
|
|
* @LastEditors: code4eat awesomedema@gmail.com
|
|
- * @LastEditTime: 2023-11-30 19:45:14
|
|
|
|
|
|
+ * @LastEditTime: 2023-11-09 13:49:35
|
|
* @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
|
|
* @FilePath: /KC-MiddlePlatform/src/pages/platform/setting/pubDicTypeMana/index.tsx
|
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
|
|
-import { createFromIconfontCN } from '@ant-design/icons';
|
|
|
|
-import { ModalForm, ProFormSelect, ProFormText, ProFormTextArea } from '@ant-design/pro-form';
|
|
|
|
-import { ProColumns } from '@ant-design/pro-table';
|
|
|
|
-import { Dropdown, Input, MenuProps, message, Tooltip, Popconfirm, TreeProps } from 'antd';
|
|
|
|
|
|
|
|
-import { Key } from 'react';
|
|
|
|
-import { useEffect, useRef, useState } from 'react';
|
|
|
|
-import DirectoryTree from 'antd/es/tree/DirectoryTree';
|
|
|
|
-import { DataNode } from 'antd/es/tree';
|
|
|
|
|
|
+import KCIMPagecontainer from '@/components/KCIMPageContainer';
|
|
|
|
+import { KCIMTable } from '@/components/KCIMTable';
|
|
|
|
+import { formatMoneyNumber } from '@/utils/format';
|
|
|
|
+import { createFromIconfontCN } from '@ant-design/icons';
|
|
|
|
+import FormItem from 'antd/es/form/FormItem';
|
|
|
|
|
|
-import { getAccountingItemMap, addTableData, delData, getAccountingList, batchDelTableData } from './service';
|
|
|
|
|
|
+import { ActionType, ProFormDatePicker, ProFormDateTimePicker, ProFormInstance, ProFormText } from '@ant-design/pro-components';
|
|
|
|
+import { ModalForm, ProFormDependency, ProFormDigit, ProFormRadio, ProFormSelect, ProFormSwitch } from '@ant-design/pro-form'
|
|
|
|
+import { ProColumns } from '@ant-design/pro-table';
|
|
|
|
+import { Input, message, Popconfirm, Form } from 'antd';
|
|
|
|
+import { Fragment, useEffect, useRef, useState } from 'react';
|
|
|
|
|
|
|
|
+import 'moment/locale/zh-cn';
|
|
|
|
+import locale from 'antd/es/date-picker/locale/zh_CN';
|
|
|
|
|
|
-import './style.less';
|
|
|
|
|
|
|
|
-import expandedIcon from '../../../static/treenode_open.png';
|
|
|
|
-import closeIcon from '../../../static/treenode_collapse.png';
|
|
|
|
|
|
|
|
|
|
+import { addData, delData, editData, getDrugTableData, getDrugTypeReq, importDataPost } from './service';
|
|
|
|
|
|
-import '../../utils/zhongtaiB'
|
|
|
|
-import KCIMPagecontainer from '@/components/KCIMPageContainer';
|
|
|
|
-import { KCIMTable } from '@/components/KCIMTable';
|
|
|
|
|
|
+import './style.less';
|
|
|
|
+import KCIMUpload from '@/components/KCIMUpload';
|
|
|
|
+import { downloadTemplateReq } from '@/utils/tooljs';
|
|
|
|
|
|
-import TableSelecter from './tableSelector';
|
|
|
|
-import { getDeepestTreeData } from '@/utils/tooljs';
|
|
|
|
-import { ActionType } from '@ant-design/pro-components';
|
|
|
|
|
|
|
|
const IconFont = createFromIconfontCN({
|
|
const IconFont = createFromIconfontCN({
|
|
scriptUrl: '',
|
|
scriptUrl: '',
|
|
});
|
|
});
|
|
|
|
|
|
-let _currentSelectedType: any = undefined;
|
|
|
|
|
|
|
|
-const ChargeItemMap = () => {
|
|
|
|
|
|
+
|
|
|
|
+export default function DrugCostManagement() {
|
|
|
|
|
|
const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
|
|
const [tableDataFilterParams, set_tableDataFilterParams] = useState<any | undefined>();
|
|
const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
|
|
const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
|
|
-
|
|
|
|
- const [treeData, set_treeData] = useState<any[]>([]);
|
|
|
|
- const [currentSelectedTreeNode, set_currentSelectedTreeNode] = useState<null | any>(null);
|
|
|
|
- const [expandedKeys, set_expandedKeys] = useState<Key[]>([]);
|
|
|
|
- const [autoExpandParent, set_autoExpandParent] = useState(true);
|
|
|
|
- const [searchValue, set_searchValue] = useState('');
|
|
|
|
- const [currentTreeDataFilter, set_currentTreeDataFilter] = useState({ name: '全部', code: 0 });
|
|
|
|
- const [treeFilterVisible, set_treeFilterVisible] = useState(false);
|
|
|
|
- const [selectedRowKeys,set_selectedRowKeys] = useState<Key[]>([]);
|
|
|
|
-
|
|
|
|
- const [tableSelecterVisible, set_tableSelecterVisible] = useState(false);
|
|
|
|
-
|
|
|
|
- const [treeDataDefault, set_treeDataDefault] = useState<any[]>([]);
|
|
|
|
-
|
|
|
|
- const [leftDataSearchKeyVal, set_leftDataSearchKeyVal] = useState<undefined | string>(undefined);
|
|
|
|
-
|
|
|
|
const tableRef = useRef<ActionType>();
|
|
const tableRef = useRef<ActionType>();
|
|
-
|
|
|
|
- const column: ProColumns[] = [
|
|
|
|
|
|
+ const formRef = useRef<ProFormInstance>();
|
|
|
|
+ const [stopStat,set_stopStat] = useState(0);
|
|
|
|
+ const columns: ProColumns[] = [
|
|
|
|
|
|
{
|
|
{
|
|
- title: '收费项目代码',
|
|
|
|
- ellipsis: true,
|
|
|
|
- width: 120,
|
|
|
|
- dataIndex: 'itemCode',
|
|
|
|
-
|
|
|
|
|
|
+ title: '项目代码',
|
|
|
|
+ dataIndex: 'code',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- title: '收费项目名称',
|
|
|
|
- dataIndex: 'itemName',
|
|
|
|
-
|
|
|
|
|
|
+ title: '项目名称',
|
|
|
|
+ dataIndex: 'name',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- title: '收费项目类别',
|
|
|
|
- width: 100,
|
|
|
|
|
|
+ title: '项目类型',
|
|
dataIndex: 'typeName',
|
|
dataIndex: 'typeName',
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ title: '单价',
|
|
|
|
+ dataIndex: 'price',
|
|
|
|
+ renderText(num) {
|
|
|
|
+ return formatMoneyNumber(num)
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '成本',
|
|
|
|
+ dataIndex: 'cost',
|
|
|
|
+ renderText(num) {
|
|
|
|
+ return formatMoneyNumber(num)
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '停用',
|
|
|
|
+ dataIndex: 'status',
|
|
|
|
+ renderText(stat) {
|
|
|
|
+ return stat ? '是' : '否'
|
|
|
|
+ },
|
|
|
|
+ },
|
|
{
|
|
{
|
|
title: '操作',
|
|
title: '操作',
|
|
key: 'option',
|
|
key: 'option',
|
|
- width: 60,
|
|
|
|
|
|
+ width: 120,
|
|
valueType: 'option',
|
|
valueType: 'option',
|
|
render: (_: any, record: any) => {
|
|
render: (_: any, record: any) => {
|
|
return [
|
|
return [
|
|
|
|
+ <UpDataActBtn key={'act'} record={record} type='EDIT' />,
|
|
<Popconfirm
|
|
<Popconfirm
|
|
title="是否确认删除?"
|
|
title="是否确认删除?"
|
|
key="del"
|
|
key="del"
|
|
- onConfirm={() => delTableData(record.id)}
|
|
|
|
|
|
+ onConfirm={() => delTableData(record)}
|
|
>
|
|
>
|
|
<a>删除</a>
|
|
<a>删除</a>
|
|
</Popconfirm>
|
|
</Popconfirm>
|
|
]
|
|
]
|
|
},
|
|
},
|
|
},
|
|
},
|
|
|
|
+
|
|
]
|
|
]
|
|
|
|
|
|
|
|
|
|
const getTableData = async (params: any) => {
|
|
const getTableData = async (params: any) => {
|
|
-
|
|
|
|
- const resp = await getAccountingItemMap({ ...params });
|
|
|
|
|
|
+ const resp = await getDrugTableData({...params,stop:stopStat});
|
|
if (resp) {
|
|
if (resp) {
|
|
return {
|
|
return {
|
|
data: resp.list,
|
|
data: resp.list,
|
|
@@ -113,335 +113,249 @@ const ChargeItemMap = () => {
|
|
pageSize: resp.pageSize,
|
|
pageSize: resp.pageSize,
|
|
totalPage: resp.totalPage,
|
|
totalPage: resp.totalPage,
|
|
}
|
|
}
|
|
- } else {
|
|
|
|
- return []
|
|
|
|
}
|
|
}
|
|
|
|
+ return []
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
- //获取左侧列表
|
|
|
|
- const getPageLeftData = async () => {
|
|
|
|
- const resp = await getAccountingList('', currentTreeDataFilter.code);
|
|
|
|
- set_treeData(resp);
|
|
|
|
- set_treeDataDefault(resp);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- const delTableData = async (id: number) => {
|
|
|
|
- const resp = await delData(id);
|
|
|
|
|
|
+ const delTableData = async (record: any) => {
|
|
|
|
+ const resp = await delData(record.id);
|
|
if (resp) {
|
|
if (resp) {
|
|
message.success('操作成功!');
|
|
message.success('操作成功!');
|
|
tableRef.current?.reload();
|
|
tableRef.current?.reload();
|
|
|
|
+ // message.success('操作成功!');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ const updateTable = async (formVal: any, type: 'EDIT' | "ADD") => {
|
|
|
|
|
|
- const tableSelecterCommit = async (keys: Key[], rows: any[]) => {
|
|
|
|
-
|
|
|
|
- const arr = rows.map((a, index) => ({
|
|
|
|
- itemCode: a.itemCode,
|
|
|
|
- itemName: a.itemName,
|
|
|
|
- type: a.itemType,
|
|
|
|
- }));
|
|
|
|
const result = {
|
|
const result = {
|
|
- accountingCode: currentSelectedTreeNode.accountingCode,
|
|
|
|
- accountingName: currentSelectedTreeNode.accountingName,
|
|
|
|
- itemMaps: arr
|
|
|
|
- }
|
|
|
|
- const resp = await addTableData(result);
|
|
|
|
- if (resp) {
|
|
|
|
- message.success('操作成功');
|
|
|
|
- set_tableSelecterVisible(false);
|
|
|
|
- tableRef.current?.reload();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- const tableDataSearchHandle = (paramName: string) => {
|
|
|
|
-
|
|
|
|
- set_tableDataFilterParams({
|
|
|
|
- ...tableDataFilterParams,
|
|
|
|
- [`${paramName}`]: tableDataSearchKeywords
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- const batchDelHandle = async () => {
|
|
|
|
- const resp = await batchDelTableData(selectedRowKeys);
|
|
|
|
- if (resp) {
|
|
|
|
- message.success('操作成功!');
|
|
|
|
- set_selectedRowKeys([]);
|
|
|
|
- tableRef.current?.reload();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- const onSelect: TreeProps['onSelect'] = (selectedKeys, info: any) => {
|
|
|
|
- const { node } = info;
|
|
|
|
- if (!node.children || node.children.length == 0) {
|
|
|
|
- set_currentSelectedTreeNode(node);
|
|
|
|
|
|
+ ...formVal
|
|
}
|
|
}
|
|
- };
|
|
|
|
-
|
|
|
|
- const onExpand = (newExpandedKeys: React.Key[]) => {
|
|
|
|
- // setExpandedKeys(newExpandedKeys);
|
|
|
|
- // setAutoExpandParent(false);
|
|
|
|
- set_expandedKeys(newExpandedKeys);
|
|
|
|
- set_autoExpandParent(false);
|
|
|
|
- };
|
|
|
|
|
|
|
|
-
|
|
|
|
- const dataList: any[] = [];
|
|
|
|
-
|
|
|
|
- const getParentKey = (key: React.Key, tree: any[]): React.Key => {
|
|
|
|
- let parentKey: React.Key;
|
|
|
|
- for (let i = 0; i < tree.length; i++) {
|
|
|
|
- const node = tree[i];
|
|
|
|
- if (node.children) {
|
|
|
|
- if (node.children.some((item: { accountingCode: React.Key; }) => item.accountingCode === key)) {
|
|
|
|
- parentKey = node.accountingCode;
|
|
|
|
- } else if (getParentKey(key, node.children)) {
|
|
|
|
- parentKey = getParentKey(key, node.children);
|
|
|
|
- }
|
|
|
|
|
|
+ if (type == 'ADD') {
|
|
|
|
+ const resp = await addData(result);
|
|
|
|
+ if (resp) {
|
|
|
|
+ tableRef.current?.reload();
|
|
|
|
+ message.success('操作成功!');
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
- return parentKey!;
|
|
|
|
- };
|
|
|
|
|
|
+ if (type == 'EDIT') {
|
|
|
|
|
|
- const generateList = (data: any[]) => {
|
|
|
|
- for (let i = 0; i < data.length; i++) {
|
|
|
|
- const node = data[i];
|
|
|
|
- dataList.push(node);
|
|
|
|
- if (node.children) {
|
|
|
|
- generateList(node.children);
|
|
|
|
|
|
+ const resp = await editData({...result});
|
|
|
|
+ if (resp) {
|
|
|
|
+ tableRef.current?.reload();
|
|
|
|
+ message.success('操作成功!');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- };
|
|
|
|
-
|
|
|
|
- generateList(treeData as any);
|
|
|
|
|
|
+ return true;
|
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
- const onTreeSearchKeyChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
|
|
|
|
|
|
- const { value } = e.target;
|
|
|
|
|
|
+ const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD' }) => {
|
|
|
|
|
|
- const newExpandedKeys = dataList
|
|
|
|
- .map((item) => {
|
|
|
|
- if (item.accountingName.indexOf(value) > -1) {
|
|
|
|
- return getParentKey(item.accountingCode, treeData);
|
|
|
|
|
|
+ return (
|
|
|
|
+ <ModalForm
|
|
|
|
+ title={`${type == 'EDIT' ? '编辑' : '新增'}药品`}
|
|
|
|
+ width={350}
|
|
|
|
+ formRef={formRef}
|
|
|
|
+ initialValues={type == 'EDIT' ? {
|
|
|
|
+ ...record,
|
|
|
|
+ } : {status:0}}
|
|
|
|
+ trigger={
|
|
|
|
+ type == 'EDIT' ? <a key="edit" >编辑</a> : <span className='add'>新增</span>
|
|
}
|
|
}
|
|
- return null;
|
|
|
|
- });
|
|
|
|
|
|
+ onFinish={(val) => {
|
|
|
|
+ return updateTable(type == 'EDIT' ? { ...record, ...val } : { ...val }, type);
|
|
|
|
+ }}
|
|
|
|
+ modalProps={{ destroyOnClose: true }}
|
|
|
|
+ colProps={{ span: 24 }}
|
|
|
|
+ grid
|
|
|
|
+ >
|
|
|
|
+ <ProFormText
|
|
|
|
+ name="code"
|
|
|
|
+ label="项目代码:"
|
|
|
|
+ placeholder="请输入"
|
|
|
|
+ rules={[{ required: true, message: '项目代码不能为空!' }]}
|
|
|
|
+ />
|
|
|
|
+ <ProFormText
|
|
|
|
+ name="name"
|
|
|
|
+ label="项目名称:"
|
|
|
|
+ placeholder="请输入"
|
|
|
|
+ rules={[{ required: true, message: '项目名称不能为空!' }]}
|
|
|
|
+ />
|
|
|
|
+ <ProFormSelect
|
|
|
|
+ name="type"
|
|
|
|
+ label="项目类型:"
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ request={async () => {
|
|
|
|
+ const resp = await getDrugTypeReq();
|
|
|
|
+ if(resp){
|
|
|
|
+ return resp.map((a:any)=>({label:a.name,value:a.code}))
|
|
|
|
+ }
|
|
|
|
+ }}
|
|
|
|
+ rules={[{ required: true, message: '项目类型不能为空!' }]}
|
|
|
|
+ />
|
|
|
|
+ <ProFormDigit
|
|
|
|
+ name="price"
|
|
|
|
+ label="单价:"
|
|
|
|
+ placeholder="请输入"
|
|
|
|
+ rules={[{ required: true, message: '单价不能为空!' }]}
|
|
|
|
+ />
|
|
|
|
+ <ProFormDigit
|
|
|
|
+ name="cost"
|
|
|
|
+ label="成本:"
|
|
|
|
+ placeholder="请输入"
|
|
|
|
+ rules={[{ required: true, message: '成本不能为空!' }]}
|
|
|
|
+ />
|
|
|
|
+ <Form.Item style={{ width: 322 }} label={<span style={{}}><i style={{ fontSize: 14, color: '#FF4060', fontWeight: 400, position: 'relative', paddingRight: 4, paddingLeft: 4 }}>*</i>停用:</span>}>
|
|
|
|
+ <div style={{ display: 'flex', flex: 1, flexDirection: 'row', justifyContent: 'space-between' }}>
|
|
|
|
+ <ProFormRadio.Group
|
|
|
|
+ name="status"
|
|
|
|
+ noStyle
|
|
|
|
+ colProps={{ span: 10 }}
|
|
|
|
+ options={[
|
|
|
|
+ {
|
|
|
|
+ label: '否',
|
|
|
|
+ value: 0
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ label: '是',
|
|
|
|
+ value: 1
|
|
|
|
+ }
|
|
|
|
+ ]}
|
|
|
|
+ />
|
|
|
|
+ {/* style={{position:'relative',left:-10}} */}
|
|
|
|
+ <ProFormDependency name={['status']}>
|
|
|
|
+ {
|
|
|
|
+ ({ status }) => {
|
|
|
|
+ // console.log({report});
|
|
|
|
+ return (
|
|
|
|
+
|
|
|
|
+ status ? <ProFormDateTimePicker fieldProps={{locale}} name="stopTime" placeholder="请选择停用时间" rules={[{ required: true, message: '时间不能为空!' }]} colProps={{ span: 14 }} noStyle />:null
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ </ProFormDependency>
|
|
|
|
|
|
- set_expandedKeys(newExpandedKeys as React.Key[]);
|
|
|
|
- set_searchValue(value);
|
|
|
|
- set_autoExpandParent(true);
|
|
|
|
- }
|
|
|
|
|
|
+ </div>
|
|
|
|
+ </Form.Item>
|
|
|
|
|
|
- //左侧树结构筛选
|
|
|
|
- const changeTreeDataFilter = (obj: any) => {
|
|
|
|
|
|
|
|
- set_currentTreeDataFilter(obj);
|
|
|
|
- set_treeFilterVisible(false);
|
|
|
|
|
|
+ </ModalForm>
|
|
|
|
+ )
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ const tableDataSearchHandle = (paramName: string) => {
|
|
|
|
|
|
|
|
+ set_tableDataFilterParams({
|
|
|
|
+ ...tableDataFilterParams,
|
|
|
|
+ [`${paramName}`]: tableDataSearchKeywords
|
|
|
|
+ })
|
|
|
|
|
|
- useEffect(() => {
|
|
|
|
-
|
|
|
|
- if (currentSelectedTreeNode) {
|
|
|
|
- set_tableDataFilterParams({ ...tableDataFilterParams, accountingCode: currentSelectedTreeNode.accountingCode });
|
|
|
|
- }
|
|
|
|
- }, [currentSelectedTreeNode])
|
|
|
|
-
|
|
|
|
- useEffect(() => {
|
|
|
|
- //初始化左侧树结构数据后
|
|
|
|
-
|
|
|
|
- if (treeData?.length > 0) {
|
|
|
|
- if (!currentSelectedTreeNode) {
|
|
|
|
- if (treeData[0].children && treeData[0].children.length > 0) {
|
|
|
|
- const [node, nodeParent] = getDeepestTreeData(treeData[0], 'children');
|
|
|
|
- set_currentSelectedTreeNode(node);
|
|
|
|
- set_expandedKeys([nodeParent.accountingCode]);
|
|
|
|
- } else {
|
|
|
|
- set_currentSelectedTreeNode(treeData[0]);
|
|
|
|
- set_expandedKeys([treeData[0].accountingCode]);
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ const downloadTemplate = async () => {
|
|
|
|
+ await downloadTemplateReq('/costAccount/setting/exportDrug');
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ const importData = () => {
|
|
|
|
+ return (
|
|
|
|
+ <ModalForm
|
|
|
|
+ width={360}
|
|
|
|
+ title={`导入数据`}
|
|
|
|
+ trigger={
|
|
|
|
+ <a className="import" key="3">
|
|
|
|
+ 导入
|
|
|
|
+ </a>
|
|
}
|
|
}
|
|
- }
|
|
|
|
- }, [treeData]);
|
|
|
|
|
|
+ submitter={{
|
|
|
|
+ render: (props, defaultDoms) => {
|
|
|
|
+ const needBtn = defaultDoms.filter((b) => {
|
|
|
|
+ return b.key != 'rest';
|
|
|
|
+ });
|
|
|
|
+ return [
|
|
|
|
+ // <Button
|
|
|
|
+ // key="ok"
|
|
|
|
+ // onClick={auditType == '0' ? () => downloadTemplate(index) : () => { }}
|
|
|
|
+ // >
|
|
|
|
+ // 下载模板
|
|
|
|
+ // </Button>,
|
|
|
|
+ ...needBtn,
|
|
|
|
+ ];
|
|
|
|
+ },
|
|
|
|
+ }}
|
|
|
|
+ onFinish={async (values) => {
|
|
|
|
+ const {
|
|
|
|
+ importFile: { fileList },
|
|
|
|
+ } = values;
|
|
|
|
+
|
|
|
|
+ let formData = new FormData();
|
|
|
|
+ formData.append('file', fileList[0].originFileObj);
|
|
|
|
+ const resp = await importDataPost(formData);
|
|
|
|
+
|
|
|
|
+ if (resp) {
|
|
|
|
+ tableRef.current?.reload();
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ }}
|
|
|
|
+ >
|
|
|
|
+ <FormItem name={'importFile'}>
|
|
|
|
+ <KCIMUpload downloadTemplateFile={() => downloadTemplate()} />
|
|
|
|
+ </FormItem>
|
|
|
|
+ </ModalForm>
|
|
|
|
+ );
|
|
|
|
+ };
|
|
|
|
|
|
- useEffect(() => {
|
|
|
|
- getPageLeftData();
|
|
|
|
- }, [currentTreeDataFilter])
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
- getPageLeftData();
|
|
|
|
- }, [])
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
+ }, [])
|
|
|
|
|
|
return (
|
|
return (
|
|
- <KCIMPagecontainer title={false} className='ChargeItemMap'>
|
|
|
|
- <TableSelecter
|
|
|
|
- onVisibleChange={(bool) => set_tableSelecterVisible(bool)}
|
|
|
|
- title='添加'
|
|
|
|
- rowKey={'itemCode'}
|
|
|
|
- defaultSelectedKeys={[]}
|
|
|
|
- record={_currentSelectedType}
|
|
|
|
- open={tableSelecterVisible}
|
|
|
|
- onFinish={(keys, rows) => tableSelecterCommit(keys, rows)}
|
|
|
|
- />
|
|
|
|
-
|
|
|
|
- {selectedRowKeys.length > 0 && (
|
|
|
|
- <div className='bottomBar'>
|
|
|
|
- <span>已选择<a>{selectedRowKeys.length}</a>项</span>
|
|
|
|
- <a onClick={() => batchDelHandle()}>批量删除</a>
|
|
|
|
- </div>
|
|
|
|
- )}
|
|
|
|
-
|
|
|
|
- {
|
|
|
|
- treeFilterVisible && (
|
|
|
|
- <div className='selecterList'>
|
|
|
|
- <div onClick={() => changeTreeDataFilter({ name: '全部', code: 0 })} className={currentTreeDataFilter.code == 0 ? 'list on' : 'list'}>全部</div>
|
|
|
|
- <div onClick={() => changeTreeDataFilter({ name: '已对照', code: 1 })} className={currentTreeDataFilter.code == 2 ? 'list on' : 'list'}>{'未对照'}</div>
|
|
|
|
- <div onClick={() => changeTreeDataFilter({ name: '未对照', code: 2 })} className={currentTreeDataFilter.code == 1 ? 'list on' : 'list'}>{'已对照'}</div>
|
|
|
|
- </div>
|
|
|
|
- )
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- <div className='left'>
|
|
|
|
- <div className='toolbar'>
|
|
|
|
- <Input placeholder={'会计科目名称'} allowClear
|
|
|
|
- suffix={
|
|
|
|
- <IconFont type="iconsousuo" style={{ color: '#99A6BF' }} />
|
|
|
|
- }
|
|
|
|
- value={leftDataSearchKeyVal}
|
|
|
|
- style={{ width: 156 }}
|
|
|
|
- onChange={onTreeSearchKeyChange}
|
|
|
|
- />
|
|
|
|
- <Tooltip placement="top" title={currentTreeDataFilter.name}>
|
|
|
|
- <div className={currentTreeDataFilter.code == 0 ? 'filter' : currentTreeDataFilter.code == 1 ? 'filter orange' : 'filter blue'} onClick={() => set_treeFilterVisible(true)}></div>
|
|
|
|
- </Tooltip>
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
- <div className='wrap'>
|
|
|
|
- {
|
|
|
|
- treeData && treeData.length > 0 && currentSelectedTreeNode && (
|
|
|
|
- <DirectoryTree
|
|
|
|
- fieldNames={{ title: 'accountingName', key: 'accountingCode' }}
|
|
|
|
- rootStyle={{ height: '100%', paddingBottom: 50, padding: '0 16px' }}
|
|
|
|
- onSelect={onSelect}
|
|
|
|
- onExpand={onExpand}
|
|
|
|
- expandedKeys={expandedKeys}
|
|
|
|
- autoExpandParent={autoExpandParent}
|
|
|
|
- selectedKeys={[currentSelectedTreeNode.accountingCode]}
|
|
|
|
- blockNode={true}
|
|
|
|
-
|
|
|
|
- icon={() => null}
|
|
|
|
-
|
|
|
|
- titleRender={
|
|
|
|
- (nodeData: any) => {
|
|
|
|
- const strTitle = nodeData.accountingName as string;
|
|
|
|
- const index = strTitle.indexOf(searchValue);
|
|
|
|
- const beforeStr = strTitle.substring(0, index);
|
|
|
|
- const afterStr = strTitle.slice(index + searchValue.length);
|
|
|
|
- const title =
|
|
|
|
- index > -1 ? (
|
|
|
|
- <span>
|
|
|
|
- {beforeStr}
|
|
|
|
- <span className="site-tree-search-value" style={{ color: '#3377ff', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{searchValue}</span>
|
|
|
|
- {afterStr}
|
|
|
|
- </span>
|
|
|
|
- ) : (
|
|
|
|
- <span className='strTitle'>{strTitle}</span>
|
|
|
|
- );
|
|
|
|
- return <div style={{
|
|
|
|
- display: 'flex', flexDirection: 'row',
|
|
|
|
- width: '100%',
|
|
|
|
- justifyContent: 'space-between', alignItems: 'center', height: 32,
|
|
|
|
- borderRadius: '4px',
|
|
|
|
- overflow: 'hidden',
|
|
|
|
- color: '#17181A',
|
|
|
|
- textOverflow: 'ellipsis',
|
|
|
|
- whiteSpace: 'nowrap'
|
|
|
|
-
|
|
|
|
- }}>
|
|
|
|
- {title}
|
|
|
|
- {!nodeData.map && <span className={nodeData.unitType ? 'point lastChild' : 'point'}></span>}
|
|
|
|
- </div>
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- defaultSelectedKeys={[currentSelectedTreeNode.accountingCode]}
|
|
|
|
- treeData={treeData as unknown as DataNode[]}
|
|
|
|
- // treeData={treeDataNew}
|
|
|
|
- switcherIcon={(props: any) => {
|
|
|
|
- const { expanded } = props;
|
|
|
|
- return !expanded ? <img style={{ width: 20, height: 20, position: 'relative', top: 5 }} src={expandedIcon} /> : <img style={{ width: 20, height: 20, position: 'relative', top: 5 }} src={closeIcon} />
|
|
|
|
- }}
|
|
|
|
- />
|
|
|
|
- )
|
|
|
|
- }
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- <div className='right'>
|
|
|
|
- <div className='toolBar'>
|
|
|
|
- <div className='filter'>
|
|
|
|
- <div className='filterItem'>
|
|
|
|
- <span className='label' style={{ whiteSpace: 'nowrap' }}> 检索:</span>
|
|
|
|
- <Input placeholder={'收费项目名称'} allowClear
|
|
|
|
- suffix={
|
|
|
|
- <IconFont type="iconsousuo" style={{ color: '#99A6BF' }} onClick={() => tableDataSearchHandle('itemName')} />
|
|
|
|
- }
|
|
|
|
- onChange={(e) => {
|
|
|
|
- set_tableDataSearchKeywords(e.target.value);
|
|
|
|
- if (e.target.value.length == 0) {
|
|
|
|
- set_tableDataFilterParams({
|
|
|
|
- ...tableDataFilterParams,
|
|
|
|
- itemName: ''
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- }}
|
|
|
|
- onPressEnter={(e) => {
|
|
|
|
-
|
|
|
|
|
|
+ <KCIMPagecontainer className='DrugCostManagement' title={false}>
|
|
|
|
+ <div className='toolBar'>
|
|
|
|
+ <div className='filter'>
|
|
|
|
+ <div className='filterItem'>
|
|
|
|
+ <span className='label' style={{ whiteSpace: 'nowrap' }}> 项目名称:</span>
|
|
|
|
+ <Input placeholder={'请输入'} allowClear
|
|
|
|
+ suffix={
|
|
|
|
+ <IconFont type="iconsousuo" style={{color:'#99A6BF'}} onClick={() => tableDataSearchHandle('name')} />
|
|
|
|
+ }
|
|
|
|
+ onChange={(e) => {
|
|
|
|
+ set_tableDataSearchKeywords(e.target.value);
|
|
|
|
+ if (e.target.value.length == 0) {
|
|
set_tableDataFilterParams({
|
|
set_tableDataFilterParams({
|
|
...tableDataFilterParams,
|
|
...tableDataFilterParams,
|
|
- itemName: (e.target as HTMLInputElement).value
|
|
|
|
|
|
+ name: ''
|
|
});
|
|
});
|
|
- }}
|
|
|
|
|
|
+ }
|
|
|
|
+ }}
|
|
|
|
+ onPressEnter={(e) => {
|
|
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- <div className='btnGroup'>
|
|
|
|
- <span className='add' onClick={() => set_tableSelecterVisible(true)}>添加</span>
|
|
|
|
|
|
+ set_tableDataFilterParams({
|
|
|
|
+ ...tableDataFilterParams,
|
|
|
|
+ name: (e.target as HTMLInputElement).value
|
|
|
|
+ });
|
|
|
|
+ }}
|
|
|
|
+
|
|
|
|
+ />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <div style={{ marginTop: 16 }}>
|
|
|
|
- {currentSelectedTreeNode && <KCIMTable actionRef={tableRef} columns={column}
|
|
|
|
- scroll={{ y: 500 }}
|
|
|
|
- rowKey='id'
|
|
|
|
- params={tableDataFilterParams}
|
|
|
|
- request={(params) => getTableData(params)}
|
|
|
|
- tableAlertRender={false}
|
|
|
|
- rowSelection={{
|
|
|
|
- onChange(selectedRowKeys, selectedRows, info) {
|
|
|
|
- set_selectedRowKeys(selectedRowKeys);
|
|
|
|
- },
|
|
|
|
- }}
|
|
|
|
- />}
|
|
|
|
|
|
+ <div className='btnGroup'>
|
|
|
|
+ <span style={{paddingRight:16}}><ProFormSwitch noStyle fieldProps={{size:'small',onChange:(bool)=>{
|
|
|
|
+ set_stopStat(bool ? 1 : 0);
|
|
|
|
+ tableRef.current?.reload();
|
|
|
|
+ }}} /> 显示停用项目</span>
|
|
|
|
+ {importData()}
|
|
|
|
+ <UpDataActBtn record type='ADD' />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
|
|
+ <div style={{ marginTop: 16 }}>
|
|
|
|
+ <KCIMTable columns={columns as ProColumns[]} actionRef={tableRef} rowKey='id' params={tableDataFilterParams} request={(params) => getTableData(params)} />
|
|
|
|
+ </div>
|
|
</KCIMPagecontainer>
|
|
</KCIMPagecontainer>
|
|
)
|
|
)
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
-export default ChargeItemMap;
|
|
|
|
-function getParentKey(code: any, treeData: any[]) {
|
|
|
|
- throw new Error('Function not implemented.');
|
|
|
|
-}
|
|
|
|
-
|
|
|