|
@@ -4,7 +4,7 @@
|
|
* @Author: code4eat awesomedema@gmail.com
|
|
* @Author: code4eat awesomedema@gmail.com
|
|
* @Date: 2022-12-16 09:42:52
|
|
* @Date: 2022-12-16 09:42:52
|
|
* @LastEditors: code4eat awesomedema@gmail.com
|
|
* @LastEditors: code4eat awesomedema@gmail.com
|
|
- * @LastEditTime: 2023-06-15 17:57:19
|
|
|
|
|
|
+ * @LastEditTime: 2023-06-29 15:56:47
|
|
* @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlySet/index.tsx
|
|
* @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlySet/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
|
|
*/
|
|
*/
|
|
@@ -24,7 +24,7 @@ import closeIcon from '../../../../../static/treenode_collapse.png';
|
|
import { BMSTable } from '@/components/BMSTable';
|
|
import { BMSTable } from '@/components/BMSTable';
|
|
import { ActionType, ModalForm, ProColumns, ProColumnType, ProFormDigit, ProFormSelect } from '@ant-design/pro-components';
|
|
import { ActionType, ModalForm, ProColumns, ProColumnType, ProFormDigit, ProFormSelect } from '@ant-design/pro-components';
|
|
import { createFromIconfontCN } from '@ant-design/icons';
|
|
import { createFromIconfontCN } from '@ant-design/icons';
|
|
-import { delRequest, getIndicTableData, getBillingItemTableData, getTreeDataRespType, getTreeData, getAllCheckUnit, saveCopyRequest, getAllCheckUnitProjectData, addBillingItemData, editBillingItemData, addIndicItemData, editIndicItemData, getNonCheckTableData, addNonCheckItemData } from './service';
|
|
|
|
|
|
+import { delRequest, getIndicTableData, getBillingItemTableData, getTreeDataRespType, getTreeData, getAllCheckUnit, saveCopyRequest, getAllCheckUnitProjectData, addBillingItemData, editBillingItemData, addIndicItemData, editIndicItemData, getNonCheckTableData, addNonCheckItemData, getCostItemsTableData, addCostItemData, editCostItemData } from './service';
|
|
import { TransferItem, TransferProps } from 'antd/es/transfer';
|
|
import { TransferItem, TransferProps } from 'antd/es/transfer';
|
|
import { getComputeDate } from '@/pages/Home/service';
|
|
import { getComputeDate } from '@/pages/Home/service';
|
|
|
|
|
|
@@ -42,6 +42,7 @@ import { getNonCheckProjectTableData } from '../nonAssessmentProjectMana/service
|
|
|
|
|
|
|
|
|
|
import '../../../../utils/zhongtaiB';
|
|
import '../../../../utils/zhongtaiB';
|
|
|
|
+import { getCostProjectTable } from '../costIncomeProjectSet/service';
|
|
|
|
|
|
const IconFont = createFromIconfontCN({
|
|
const IconFont = createFromIconfontCN({
|
|
scriptUrl: '',
|
|
scriptUrl: '',
|
|
@@ -83,7 +84,9 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
|
|
|
|
const ref = React.createRef<{ save: any; getSelectedKeys: any }>();
|
|
const ref = React.createRef<{ save: any; getSelectedKeys: any }>();
|
|
|
|
|
|
- const [currentEditCoreFlag,set_currentEditCoreFlag] = useState(0);
|
|
|
|
|
|
+ const [currentEditCoreFlag, set_currentEditCoreFlag] = useState(0);
|
|
|
|
+ const [tableSelecterColumn, set_tableSelecterColumn] = useState<ProColumns[]>([]);
|
|
|
|
+ const [isCopy, set_isCopy] = useState(false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -97,24 +100,24 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
renderText(text, record, index, action) {
|
|
renderText(text, record, index, action) {
|
|
return <span style={{ display: 'inline-block', height: '26px', lineHeight: '26px' }}>{text}</span>
|
|
return <span style={{ display: 'inline-block', height: '26px', lineHeight: '26px' }}>{text}</span>
|
|
},
|
|
},
|
|
- ellipsis:true
|
|
|
|
|
|
+ ellipsis: true
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '项目名称',
|
|
title: '项目名称',
|
|
dataIndex: 'itemName',
|
|
dataIndex: 'itemName',
|
|
- ellipsis:true
|
|
|
|
|
|
+ ellipsis: true
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '项目类别',
|
|
title: '项目类别',
|
|
dataIndex: 'itemType',
|
|
dataIndex: 'itemType',
|
|
- ellipsis:true
|
|
|
|
|
|
+ ellipsis: true
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '点值',
|
|
title: '点值',
|
|
width: 120,
|
|
width: 120,
|
|
- ellipsis:true,
|
|
|
|
|
|
+ ellipsis: true,
|
|
dataIndex: 'orderPointValue',
|
|
dataIndex: 'orderPointValue',
|
|
- renderText:(text, record, index, action)=>{
|
|
|
|
|
|
+ renderText: (text, record, index, action) => {
|
|
if (ifEdit && currentEditRow?.id == record.id) {
|
|
if (ifEdit && currentEditRow?.id == record.id) {
|
|
return <ProFormDigit noStyle fieldProps={{
|
|
return <ProFormDigit noStyle fieldProps={{
|
|
defaultValue: text, onChange(value) {
|
|
defaultValue: text, onChange(value) {
|
|
@@ -132,17 +135,17 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
{
|
|
{
|
|
title: '类型',
|
|
title: '类型',
|
|
width: 120,
|
|
width: 120,
|
|
- ellipsis:true,
|
|
|
|
|
|
+ ellipsis: true,
|
|
dataIndex: 'coreFlagName',
|
|
dataIndex: 'coreFlagName',
|
|
- renderText:(text, record, index, action)=>{
|
|
|
|
|
|
+ renderText: (text, record, index, action) => {
|
|
if (ifEdit && currentEditRow && currentEditRow?.id == record.id) {
|
|
if (ifEdit && currentEditRow && currentEditRow?.id == record.id) {
|
|
- return <Select defaultValue={record.coreFlag} style={{width:'100%'}} options={
|
|
|
|
|
|
+ return <Select defaultValue={record.coreFlag} style={{ width: '100%' }} options={
|
|
[
|
|
[
|
|
- { label: '核心', value: 1 }, { label: '非核心', value: 0 },{ label: '不计', value:2 }
|
|
|
|
|
|
+ { label: '核心', value: 1 }, { label: '非核心', value: 0 }, { label: '不计', value: 2 }
|
|
]
|
|
]
|
|
- } onChange={(a, b) => { set_currentEditCoreFlag(a)}} />
|
|
|
|
|
|
+ } onChange={(a, b) => { set_currentEditCoreFlag(a) }} />
|
|
} else {
|
|
} else {
|
|
- return <span style={{ display: 'inline-block', width:120}}>{text}</span>
|
|
|
|
|
|
+ return <span style={{ display: 'inline-block', width: 120 }}>{text}</span>
|
|
}
|
|
}
|
|
},
|
|
},
|
|
}
|
|
}
|
|
@@ -152,30 +155,30 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
{
|
|
{
|
|
title: '项目代码',
|
|
title: '项目代码',
|
|
dataIndex: 'indicatorCode',
|
|
dataIndex: 'indicatorCode',
|
|
- ellipsis:true,
|
|
|
|
|
|
+ ellipsis: true,
|
|
renderText(text, record, index, action) {
|
|
renderText(text, record, index, action) {
|
|
return <span style={{ display: 'inline-block', height: '26px', lineHeight: '26px' }}>{text}</span>
|
|
return <span style={{ display: 'inline-block', height: '26px', lineHeight: '26px' }}>{text}</span>
|
|
},
|
|
},
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '项目名称',
|
|
title: '项目名称',
|
|
- ellipsis:true,
|
|
|
|
|
|
+ ellipsis: true,
|
|
dataIndex: 'indicatorName',
|
|
dataIndex: 'indicatorName',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '类型',
|
|
title: '类型',
|
|
- ellipsis:true,
|
|
|
|
|
|
+ ellipsis: true,
|
|
dataIndex: 'indicatorTypeName',
|
|
dataIndex: 'indicatorTypeName',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '定义',
|
|
title: '定义',
|
|
- ellipsis:true,
|
|
|
|
|
|
+ ellipsis: true,
|
|
dataIndex: 'indicatorDefinition',
|
|
dataIndex: 'indicatorDefinition',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '点值',
|
|
title: '点值',
|
|
width: 120,
|
|
width: 120,
|
|
- ellipsis:true,
|
|
|
|
|
|
+ ellipsis: true,
|
|
dataIndex: 'orderPointValue',
|
|
dataIndex: 'orderPointValue',
|
|
renderText(text, record, index, action) {
|
|
renderText(text, record, index, action) {
|
|
if (ifEdit && currentEditRow?.id == record.id) {
|
|
if (ifEdit && currentEditRow?.id == record.id) {
|
|
@@ -196,7 +199,7 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
const nonCheckTableColumn: ProColumns[] = [
|
|
const nonCheckTableColumn: ProColumns[] = [
|
|
{
|
|
{
|
|
title: '项目名称',
|
|
title: '项目名称',
|
|
- ellipsis:true,
|
|
|
|
|
|
+ ellipsis: true,
|
|
dataIndex: 'nonAssessmentName',
|
|
dataIndex: 'nonAssessmentName',
|
|
renderText(text, record, index, action) {
|
|
renderText(text, record, index, action) {
|
|
return <span style={{ display: 'inline-block', height: '26px', lineHeight: '26px' }}>{text}</span>
|
|
return <span style={{ display: 'inline-block', height: '26px', lineHeight: '26px' }}>{text}</span>
|
|
@@ -204,34 +207,66 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '分配方式',
|
|
title: '分配方式',
|
|
- ellipsis:true,
|
|
|
|
|
|
+ ellipsis: true,
|
|
dataIndex: 'distributionTypeName',
|
|
dataIndex: 'distributionTypeName',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '分配对象',
|
|
title: '分配对象',
|
|
- ellipsis:true,
|
|
|
|
|
|
+ ellipsis: true,
|
|
dataIndex: 'distributionTargetName',
|
|
dataIndex: 'distributionTargetName',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '上限值',
|
|
title: '上限值',
|
|
- ellipsis:true,
|
|
|
|
|
|
+ ellipsis: true,
|
|
dataIndex: 'ceiling',
|
|
dataIndex: 'ceiling',
|
|
},
|
|
},
|
|
{
|
|
{
|
|
title: '评分项',
|
|
title: '评分项',
|
|
width: 260,
|
|
width: 260,
|
|
dataIndex: 'orderPointValue',
|
|
dataIndex: 'orderPointValue',
|
|
- ellipsis:true,
|
|
|
|
|
|
+ ellipsis: true,
|
|
renderText(text, record) {
|
|
renderText(text, record) {
|
|
- return record.secondItem?record.secondItem.reduce((prev: any,cur: any)=>`${prev.length>0?prev+'|':prev}${cur.secondItemName}`,''):''
|
|
|
|
|
|
+ return record.secondItem ? record.secondItem.reduce((prev: any, cur: any) => `${prev.length > 0 ? prev + '|' : prev}${cur.secondItemName}`, '') : ''
|
|
},
|
|
},
|
|
}
|
|
}
|
|
];
|
|
];
|
|
|
|
+ const costTableColumn: ProColumns[] = [
|
|
|
|
+ {
|
|
|
|
+ title: '项目名称',
|
|
|
|
+ ellipsis: true,
|
|
|
|
+ dataIndex: 'name',
|
|
|
|
+ // renderText(text, record, index, action) {
|
|
|
|
+ // return <span style={{ display: 'inline-block', height: '26px', lineHeight: '26px' }}>{text}</span>
|
|
|
|
+ // },
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '类型',
|
|
|
|
+ ellipsis: true,
|
|
|
|
+ dataIndex: 'itemTypeName',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '可控',
|
|
|
|
+ ellipsis: true,
|
|
|
|
+ dataIndex: 'ctrlFlag',
|
|
|
|
+ renderText(text, record, index, action) {
|
|
|
|
+ return ifEdit ? <ProFormSelect noStyle fieldProps={{
|
|
|
|
+ defaultValue: text, onChange(value, option) {
|
|
|
|
+ set_currentEditRow({ ...currentEditRow, ctrlFlag: value })
|
|
|
|
+ },
|
|
|
|
+ }} options={[{ label: '是', value: 1 }, { label: '否', value: 0 }]} /> : text == 1 ? '是' : '否'
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ title: '序号',
|
|
|
|
+ ellipsis: true,
|
|
|
|
+ dataIndex: 'seqNo',
|
|
|
|
+ },
|
|
|
|
+ ];
|
|
|
|
|
|
|
|
|
|
const delHandle = async (record: any) => {
|
|
const delHandle = async (record: any) => {
|
|
- const { id } = record;
|
|
|
|
- const resp = await delRequest({id: id},currentSelectedTabKey);
|
|
|
|
|
|
+ const { id } = record;
|
|
|
|
+ const resp = await delRequest({ id: id }, currentSelectedTabKey);
|
|
if (resp) {
|
|
if (resp) {
|
|
message.success('操作成功');
|
|
message.success('操作成功');
|
|
tableRef.current?.reload();
|
|
tableRef.current?.reload();
|
|
@@ -240,10 +275,10 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- const onSelect: TreeProps['onSelect'] = (selectedKeys, info:any) => {
|
|
|
|
|
|
+ const onSelect: TreeProps['onSelect'] = (selectedKeys, info: any) => {
|
|
// console.log('selected', selectedKeys, info);
|
|
// console.log('selected', selectedKeys, info);
|
|
- const { node} = info;
|
|
|
|
- if(!node.child)set_currentSelectedTreeNode(node);
|
|
|
|
|
|
+ const { node } = info;
|
|
|
|
+ if (!node.child) set_currentSelectedTreeNode(node);
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
@@ -260,7 +295,7 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- const getTableData = async (type: 'BILL' | 'INDIC' | 'NONCHECK', params: any, sort: any, filter: any) => {
|
|
|
|
|
|
+ const getTableData = async (type: 'BILL' | 'INDIC' | 'NONCHECK' | 'COST', params: any, sort: any, filter: any) => {
|
|
// console.log({ currentSelectedTreeNode });
|
|
// console.log({ currentSelectedTreeNode });
|
|
// console.log({ params, sort, filter });
|
|
// console.log({ params, sort, filter });
|
|
|
|
|
|
@@ -323,6 +358,23 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
success: true
|
|
success: true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if (type == 'COST') {
|
|
|
|
+ const resp = await getCostItemsTableData({
|
|
|
|
+ unitCode: currentSelectedTreeNode.code,
|
|
|
|
+ ...params
|
|
|
|
+ });
|
|
|
|
+ if (resp) {
|
|
|
|
+
|
|
|
|
+ return {
|
|
|
|
+ data: resp,
|
|
|
|
+ success: true,
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return {
|
|
|
|
+ data: [],
|
|
|
|
+ success: true
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
return []
|
|
return []
|
|
@@ -349,7 +401,7 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
},
|
|
},
|
|
];
|
|
];
|
|
|
|
|
|
- const tableSelecterColumn = [
|
|
|
|
|
|
+ const checkUnitColumns = [
|
|
{
|
|
{
|
|
title: '核算单元名称',
|
|
title: '核算单元名称',
|
|
dataIndex: 'unitName',
|
|
dataIndex: 'unitName',
|
|
@@ -359,6 +411,12 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
dataIndex: 'unitTypeName',
|
|
dataIndex: 'unitTypeName',
|
|
|
|
|
|
},
|
|
},
|
|
|
|
+ ];
|
|
|
|
+ const costItemColumns = [
|
|
|
|
+ {
|
|
|
|
+ title: '项目名称',
|
|
|
|
+ dataIndex: 'name',
|
|
|
|
+ }
|
|
]
|
|
]
|
|
|
|
|
|
|
|
|
|
@@ -366,6 +424,7 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
const openCopyHandleModal = () => {
|
|
const openCopyHandleModal = () => {
|
|
|
|
|
|
set_ifShowModal(true);
|
|
set_ifShowModal(true);
|
|
|
|
+ set_isCopy(true);
|
|
}
|
|
}
|
|
|
|
|
|
const openTransfer = () => {
|
|
const openTransfer = () => {
|
|
@@ -374,7 +433,7 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
title: '添加',
|
|
title: '添加',
|
|
icon: <></>,
|
|
icon: <></>,
|
|
width: 800,
|
|
width: 800,
|
|
- centered:true,
|
|
|
|
|
|
+ centered: true,
|
|
okText: '确定',
|
|
okText: '确定',
|
|
cancelText: '取消',
|
|
cancelText: '取消',
|
|
content: <TableTransfer
|
|
content: <TableTransfer
|
|
@@ -397,39 +456,81 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
|
|
|
|
const [datasource, set_datasource] = useState<any[]>([]);
|
|
const [datasource, set_datasource] = useState<any[]>([]);
|
|
const [selectedKeys, setSelectedKeys] = useState<React.Key[]>([]);
|
|
const [selectedKeys, setSelectedKeys] = useState<React.Key[]>([]);
|
|
|
|
+ const [selectedRows, set_selectedRows] = useState<any[]>([])
|
|
const [showList, set_showList] = useState<any[]>([]);
|
|
const [showList, set_showList] = useState<any[]>([]);
|
|
|
|
+ const [tableParams, set_tableParams] = useState<any>({});
|
|
|
|
+ const [keywords, set_keywords] = useState('');
|
|
|
|
|
|
//获取表格数据
|
|
//获取表格数据
|
|
const getFuncList = async () => {
|
|
const getFuncList = async () => {
|
|
- const resp = await getAllCheckUnit();
|
|
|
|
- if (resp) {
|
|
|
|
- const filteredData = resp.filter((a:any)=>a.code != currentSelectedTreeNode.code);
|
|
|
|
- set_datasource(filteredData);
|
|
|
|
- set_showList(filteredData);
|
|
|
|
|
|
+ if (isCopy) {
|
|
|
|
+ const resp = await getAllCheckUnit();
|
|
|
|
+ if (resp) {
|
|
|
|
+ const filteredData = resp.filter((a: any) => a.code != currentSelectedTreeNode.code);
|
|
|
|
+ set_datasource(filteredData);
|
|
|
|
+ set_showList(filteredData);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ //成本项目添加
|
|
|
|
+ const resp = await getCostProjectTable();
|
|
|
|
+ if (resp) {
|
|
|
|
+ //const filteredData = resp.filter((a:any)=>a.code != currentSelectedTreeNode.code);
|
|
|
|
+ set_datasource(resp);
|
|
|
|
+ set_showList(resp);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- const onSelectChange = (newSelectedRowKeys: React.Key[]) => {
|
|
|
|
|
|
+ const onSelectChange = (newSelectedRowKeys: React.Key[], selectedRows: any) => {
|
|
setSelectedKeys([...newSelectedRowKeys]);
|
|
setSelectedKeys([...newSelectedRowKeys]);
|
|
|
|
+ set_selectedRows(selectedRows);
|
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
const save = async () => {
|
|
const save = async () => {
|
|
|
|
+ if (!isCopy && currentSelectedTabKey == '4') {
|
|
|
|
+ //console.log({selectedKeys,selectedRows});
|
|
|
|
+ const result = {
|
|
|
|
+ itemList: selectedRows.map((a: any) => ({
|
|
|
|
+ code: a.code,
|
|
|
|
+ ctrlFlag: a.ctrlFlag,
|
|
|
|
+ itemType: a.itemType,
|
|
|
|
+ name: a.name,
|
|
|
|
+ parentCode: a.parentCode,
|
|
|
|
+ seqNo: a.seqNo,
|
|
|
|
+ statFlag: a.statFlag,
|
|
|
|
+ summaryFlag: a.summaryFlag
|
|
|
|
+ })),
|
|
|
|
+ unitCode: currentSelectedTreeNode.code
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ const resp = await addCostItemData(result);
|
|
|
|
+
|
|
|
|
+ if (resp) {
|
|
|
|
+ message.success('操作成功!');
|
|
|
|
+ set_ifShowModal(false);
|
|
|
|
+ tableRef.current?.reload();
|
|
|
|
+ }
|
|
|
|
|
|
- const result = {
|
|
|
|
- unitCodeList: selectedKeys,
|
|
|
|
- unitCode: currentSelectedTreeNode.code
|
|
|
|
- };
|
|
|
|
|
|
+ } else {
|
|
|
|
+ const result = {
|
|
|
|
+ unitCodeList: selectedKeys,
|
|
|
|
+ unitCode: currentSelectedTreeNode.code
|
|
|
|
+ };
|
|
|
|
|
|
- const resp = await saveCopyRequest(result, currentSelectedTabKey);
|
|
|
|
|
|
+ const resp = await saveCopyRequest(result, currentSelectedTabKey);
|
|
|
|
|
|
- if (resp) {
|
|
|
|
- message.success('复制成功!');
|
|
|
|
- set_ifShowModal(false);
|
|
|
|
- tableRef.current?.reload();
|
|
|
|
|
|
+ if (resp) {
|
|
|
|
+ message.success('复制成功!');
|
|
|
|
+ set_ifShowModal(false);
|
|
|
|
+ tableRef.current?.reload();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
@@ -440,19 +541,53 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
<div className='TableSelecter'>
|
|
<div className='TableSelecter'>
|
|
<Input placeholder={'请输入'} allowClear
|
|
<Input placeholder={'请输入'} allowClear
|
|
suffix={
|
|
suffix={
|
|
- <IconFont type="iconsousuo" />
|
|
|
|
|
|
+ <IconFont type="iconsousuo" onClick={() => {
|
|
|
|
+ //console.log('iconsousuo', currentSelectedTabKey, keywords);
|
|
|
|
+ if (isCopy) {
|
|
|
|
+ set_tableParams({ ...tableParams, name: keywords })
|
|
|
|
+ }
|
|
|
|
+ }} />
|
|
}
|
|
}
|
|
style={{ marginBottom: 8 }}
|
|
style={{ marginBottom: 8 }}
|
|
onChange={(e) => {
|
|
onChange={(e) => {
|
|
- if (e.target.value.length != 0) {
|
|
|
|
- const result = datasource.filter(item => item.unitName.indexOf(e.target.value) != -1);
|
|
|
|
- set_showList(result);
|
|
|
|
- } else {
|
|
|
|
- set_showList(datasource);
|
|
|
|
|
|
+ if (currentSelectedTabKey != '4') {
|
|
|
|
+ if (e.target.value.length != 0) {
|
|
|
|
+ const result = datasource.filter(item => item.unitName.indexOf(e.target.value) != -1);
|
|
|
|
+ set_showList(result);
|
|
|
|
+ } else {
|
|
|
|
+ set_showList(datasource);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (currentSelectedTabKey == '4') {
|
|
|
|
+ //set_keywords(e.target.value);
|
|
|
|
+ const search: any = (data: any, name: string) => {
|
|
|
|
+ let result = [];
|
|
|
|
+
|
|
|
|
+ for (let i = 0; i < data.length; i++) {
|
|
|
|
+ const item = data[i];
|
|
|
|
+ if (item.name.indexOf(name) != -1) {
|
|
|
|
+ result.push(item);
|
|
|
|
+ }
|
|
|
|
+ if (item.children) {
|
|
|
|
+ result.push(...search(item.children, name));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(e.target.value.length>0){
|
|
|
|
+ const foundItem = search(datasource,e.target.value);
|
|
|
|
+ set_showList(foundItem);
|
|
|
|
+ }else{
|
|
|
|
+ set_showList(datasource);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
}}
|
|
}}
|
|
|
|
|
|
|
|
+
|
|
/>
|
|
/>
|
|
<BMSTable columns={tableSelecterColumn}
|
|
<BMSTable columns={tableSelecterColumn}
|
|
options={{
|
|
options={{
|
|
@@ -461,12 +596,14 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
listsHeight: 100,
|
|
listsHeight: 100,
|
|
},
|
|
},
|
|
}}
|
|
}}
|
|
|
|
+ params={tableParams}
|
|
rowKey='code'
|
|
rowKey='code'
|
|
tableAlertRender={false}
|
|
tableAlertRender={false}
|
|
rowSelection={{
|
|
rowSelection={{
|
|
// 自定义选择项参考: https://ant.design/components/table-cn/#components-table-demo-row-selection-custom
|
|
// 自定义选择项参考: https://ant.design/components/table-cn/#components-table-demo-row-selection-custom
|
|
// 注释该行则默认不显示下拉选项
|
|
// 注释该行则默认不显示下拉选项
|
|
onChange: onSelectChange,
|
|
onChange: onSelectChange,
|
|
|
|
+ checkStrictly: false
|
|
}}
|
|
}}
|
|
pagination={{ showSizeChanger: false, pageSize: 10, simple: true, showTitle: false }}
|
|
pagination={{ showSizeChanger: false, pageSize: 10, simple: true, showTitle: false }}
|
|
dataSource={showList}
|
|
dataSource={showList}
|
|
@@ -486,8 +623,8 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
const [targetKeys, setTargetKeys] = useState<string[]>([]);
|
|
const [targetKeys, setTargetKeys] = useState<string[]>([]);
|
|
const [datasource, set_datasource] = useState<any[]>([]);
|
|
const [datasource, set_datasource] = useState<any[]>([]);
|
|
const [selectedKeys, setSelectedKeys] = useState<string[]>([]);
|
|
const [selectedKeys, setSelectedKeys] = useState<string[]>([]);
|
|
- const [targetData,set_targetData] = useState<any[]>([]);
|
|
|
|
- const [loading,set_loading] = useState(true);
|
|
|
|
|
|
+ const [targetData, set_targetData] = useState<any[]>([]);
|
|
|
|
+ const [loading, set_loading] = useState(true);
|
|
|
|
|
|
|
|
|
|
//获取单元
|
|
//获取单元
|
|
@@ -505,7 +642,7 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
if (resp1) {
|
|
if (resp1) {
|
|
let allData = resp;
|
|
let allData = resp;
|
|
set_targetData(resp1.list);
|
|
set_targetData(resp1.list);
|
|
- const defaultSelctedkeys = (resp1.list).map((a:any) => a.itemPointCode);
|
|
|
|
|
|
+ const defaultSelctedkeys = (resp1.list).map((a: any) => a.itemPointCode);
|
|
set_datasource(allData);
|
|
set_datasource(allData);
|
|
setTargetKeys(defaultSelctedkeys);
|
|
setTargetKeys(defaultSelctedkeys);
|
|
}
|
|
}
|
|
@@ -570,29 +707,29 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
const items = datasource.filter(a => targetKeys.includes(a.code));
|
|
const items = datasource.filter(a => targetKeys.includes(a.code));
|
|
//拿到当前的表格数据覆盖全量表格数据
|
|
//拿到当前的表格数据覆盖全量表格数据
|
|
//console.log({items,targetKeys});
|
|
//console.log({items,targetKeys});
|
|
- const uodatedData = items.map(a=>{
|
|
|
|
- if(targetData.length>0){
|
|
|
|
- const result = targetData.filter(b=>b.itemPointCode == a.code);
|
|
|
|
- if(result.length>0){
|
|
|
|
- return {
|
|
|
|
- ...a,
|
|
|
|
- orderPointValue:result[0].orderPointValue,
|
|
|
|
- coreFlag:result[0].coreFlag,
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- return a
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- return a
|
|
|
|
|
|
+ const uodatedData = items.map(a => {
|
|
|
|
+ if (targetData.length > 0) {
|
|
|
|
+ const result = targetData.filter(b => b.itemPointCode == a.code);
|
|
|
|
+ if (result.length > 0) {
|
|
|
|
+ return {
|
|
|
|
+ ...a,
|
|
|
|
+ orderPointValue: result[0].orderPointValue,
|
|
|
|
+ coreFlag: result[0].coreFlag,
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ return a
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ return a
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ })
|
|
const result = {
|
|
const result = {
|
|
unitCode: currentSelectedTreeNode.code,
|
|
unitCode: currentSelectedTreeNode.code,
|
|
- item: uodatedData.map(a=>({
|
|
|
|
- itemPointCode:a.itemCode,
|
|
|
|
- itemName:a.itemName,
|
|
|
|
- orderPointValue:a.orderPointValue,
|
|
|
|
- coreFlag:a.coreFlag
|
|
|
|
|
|
+ item: uodatedData.map(a => ({
|
|
|
|
+ itemPointCode: a.itemCode,
|
|
|
|
+ itemName: a.itemName,
|
|
|
|
+ orderPointValue: a.orderPointValue,
|
|
|
|
+ coreFlag: a.coreFlag
|
|
}))
|
|
}))
|
|
}
|
|
}
|
|
const resp = await addBillingItemData(result);
|
|
const resp = await addBillingItemData(result);
|
|
@@ -604,22 +741,22 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
const items = datasource.filter(a => targetKeys.includes(a.code));
|
|
const items = datasource.filter(a => targetKeys.includes(a.code));
|
|
|
|
|
|
//拿到当前的表格数据覆盖全量表格数据
|
|
//拿到当前的表格数据覆盖全量表格数据
|
|
- const uodatedData = items.map(a=>{
|
|
|
|
- if(targetData.length>0){
|
|
|
|
- const result = targetData.filter(b=>b.indicatorCode == a.code);
|
|
|
|
- if(result.length>0){
|
|
|
|
- return {
|
|
|
|
- ...a,
|
|
|
|
- orderPointValue:result[0].orderPointValue
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
- return a
|
|
|
|
- }
|
|
|
|
- }else{
|
|
|
|
|
|
+ const uodatedData = items.map(a => {
|
|
|
|
+ if (targetData.length > 0) {
|
|
|
|
+ const result = targetData.filter(b => b.indicatorCode == a.code);
|
|
|
|
+ if (result.length > 0) {
|
|
|
|
+ return {
|
|
|
|
+ ...a,
|
|
|
|
+ orderPointValue: result[0].orderPointValue
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ return a
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
return a
|
|
return a
|
|
- }
|
|
|
|
|
|
+ }
|
|
})
|
|
})
|
|
- const commitData = uodatedData.map((a:any) => ({
|
|
|
|
|
|
+ const commitData = uodatedData.map((a: any) => ({
|
|
indicatorCode: a.code,
|
|
indicatorCode: a.code,
|
|
indicatorName: a.indicatorName,
|
|
indicatorName: a.indicatorName,
|
|
orderPointValue: a.orderPointValue,
|
|
orderPointValue: a.orderPointValue,
|
|
@@ -638,8 +775,8 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
if (currentSelectedTabKey == '3') {
|
|
if (currentSelectedTabKey == '3') {
|
|
const items = datasource.filter(a => targetKeys.includes(a.code));
|
|
const items = datasource.filter(a => targetKeys.includes(a.code));
|
|
const commitData = items.map(a => ({
|
|
const commitData = items.map(a => ({
|
|
- code:a.code,
|
|
|
|
- name:a.name
|
|
|
|
|
|
+ code: a.code,
|
|
|
|
+ name: a.name
|
|
}))
|
|
}))
|
|
const result = {
|
|
const result = {
|
|
unitCode: currentSelectedTreeNode.code,
|
|
unitCode: currentSelectedTreeNode.code,
|
|
@@ -672,7 +809,7 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
searchPlaceholder: '请输入',
|
|
searchPlaceholder: '请输入',
|
|
}}
|
|
}}
|
|
// oneWay={true}
|
|
// oneWay={true}
|
|
-
|
|
|
|
|
|
+
|
|
onChange={onChange}
|
|
onChange={onChange}
|
|
onSelectChange={onSelectChange}
|
|
onSelectChange={onSelectChange}
|
|
dataSource={datasource}
|
|
dataSource={datasource}
|
|
@@ -680,8 +817,8 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
targetKeys={targetKeys}
|
|
targetKeys={targetKeys}
|
|
selectedKeys={selectedKeys}
|
|
selectedKeys={selectedKeys}
|
|
filterOption={(inputValue, item) => {
|
|
filterOption={(inputValue, item) => {
|
|
- if(item.itemName!.indexOf(inputValue) !== -1){
|
|
|
|
- console.log({item});
|
|
|
|
|
|
+ if (item.itemName!.indexOf(inputValue) !== -1) {
|
|
|
|
+ console.log({ item });
|
|
}
|
|
}
|
|
return item.itemName!.indexOf(inputValue) !== -1
|
|
return item.itemName!.indexOf(inputValue) !== -1
|
|
|
|
|
|
@@ -709,7 +846,7 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
onItemSelectAll(diffKeys as string[], selected);
|
|
onItemSelectAll(diffKeys as string[], selected);
|
|
},
|
|
},
|
|
onSelect({ code }, selected) {
|
|
onSelect({ code }, selected) {
|
|
- console.log({code,selected})
|
|
|
|
|
|
+ console.log({ code, selected })
|
|
onItemSelect(code as string, selected);
|
|
onItemSelect(code as string, selected);
|
|
},
|
|
},
|
|
selectedRowKeys: listSelectedKeys,
|
|
selectedRowKeys: listSelectedKeys,
|
|
@@ -724,7 +861,7 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
loading={loading}
|
|
loading={loading}
|
|
bordered={false}
|
|
bordered={false}
|
|
rowKey={'code'}
|
|
rowKey={'code'}
|
|
- pagination={{ showTitle: false, pageSize:9, showLessItems: false, simple: true,showTotal:()=>false }}
|
|
|
|
|
|
+ pagination={{ showTitle: false, pageSize: 9, showLessItems: false, simple: true, showTotal: () => false }}
|
|
tableAlertRender={false}
|
|
tableAlertRender={false}
|
|
style={{ pointerEvents: listDisabled ? 'none' : undefined }}
|
|
style={{ pointerEvents: listDisabled ? 'none' : undefined }}
|
|
onRow={({ code, disabled: itemDisabled }) => ({
|
|
onRow={({ code, disabled: itemDisabled }) => ({
|
|
@@ -738,7 +875,14 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
}}
|
|
}}
|
|
</Transfer>
|
|
</Transfer>
|
|
)
|
|
)
|
|
- })
|
|
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //成本项目添加
|
|
|
|
+ const addCostProject = () => {
|
|
|
|
+ set_isCopy(false);
|
|
|
|
+ set_ifShowModal(true);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -751,17 +895,17 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
//编辑按钮操作
|
|
//编辑按钮操作
|
|
const editBtnHandle = async () => {
|
|
const editBtnHandle = async () => {
|
|
let flag = false;
|
|
let flag = false;
|
|
-
|
|
|
|
|
|
+
|
|
if (ifEdit) {
|
|
if (ifEdit) {
|
|
//保存操作
|
|
//保存操作
|
|
if (currentSelectedTabKey == '1' && currentEditRow) {
|
|
if (currentSelectedTabKey == '1' && currentEditRow) {
|
|
//收费项目
|
|
//收费项目
|
|
- console.log({currentEditRow});
|
|
|
|
|
|
+ console.log({ currentEditRow });
|
|
const result = {
|
|
const result = {
|
|
id: currentEditRow.id,
|
|
id: currentEditRow.id,
|
|
unitCode: currentSelectedTreeNode.code,
|
|
unitCode: currentSelectedTreeNode.code,
|
|
orderPointValue: `${currentEditRow.orderPointValue}`,
|
|
orderPointValue: `${currentEditRow.orderPointValue}`,
|
|
- coreFlag:currentEditCoreFlag
|
|
|
|
|
|
+ coreFlag: currentEditCoreFlag
|
|
}
|
|
}
|
|
const resp = await editBillingItemData(result);
|
|
const resp = await editBillingItemData(result);
|
|
if (resp) flag = true;
|
|
if (resp) flag = true;
|
|
@@ -779,6 +923,18 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
const resp = await editIndicItemData(result);
|
|
const resp = await editIndicItemData(result);
|
|
if (resp) flag = true;
|
|
if (resp) flag = true;
|
|
}
|
|
}
|
|
|
|
+ if (currentSelectedTabKey == '4' && currentEditRow) {
|
|
|
|
+ //成本项目
|
|
|
|
+ //console.log({ currentEditRow });
|
|
|
|
+ const result = {
|
|
|
|
+ id: currentEditRow.id,
|
|
|
|
+ ctrlFlag: currentEditRow.ctrlFlag
|
|
|
|
+ }
|
|
|
|
+ const resp = await editCostItemData(result);
|
|
|
|
+ if (resp) flag = true;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
//开启编辑模式
|
|
//开启编辑模式
|
|
set_ifEdit(true);
|
|
set_ifEdit(true);
|
|
@@ -862,6 +1018,9 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
if (currentSelectedTabKey == '3') {
|
|
if (currentSelectedTabKey == '3') {
|
|
set_tableColumn(nonCheckTableColumn);
|
|
set_tableColumn(nonCheckTableColumn);
|
|
}
|
|
}
|
|
|
|
+ if (currentSelectedTabKey == '4') {
|
|
|
|
+ set_tableColumn(costTableColumn);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
@@ -884,6 +1043,15 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
setTableColumn();
|
|
setTableColumn();
|
|
}, [currentSelectedTabKey]);
|
|
}, [currentSelectedTabKey]);
|
|
|
|
|
|
|
|
+ useEffect(() => {
|
|
|
|
+ if (!isCopy) {
|
|
|
|
+ set_tableSelecterColumn(costItemColumns);
|
|
|
|
+ } else {
|
|
|
|
+ set_tableSelecterColumn(checkUnitColumns);
|
|
|
|
+ }
|
|
|
|
+ }, [isCopy])
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
//初始化左侧树结构数据后
|
|
//初始化左侧树结构数据后
|
|
@@ -912,7 +1080,7 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
return (
|
|
return (
|
|
<div className='CheckUnitProjectSet'>
|
|
<div className='CheckUnitProjectSet'>
|
|
|
|
|
|
- <ModalForm title={`复制(${currentSelectedTreeNode?currentSelectedTreeNode.name:''})`} width={400} submitter={{
|
|
|
|
|
|
+ <ModalForm title={isCopy ? `复制(${currentSelectedTreeNode ? currentSelectedTreeNode.name : ''})` : `添加成本项目(${currentSelectedTreeNode ? currentSelectedTreeNode.name : ''})`} width={400} submitter={{
|
|
render: (props, defaultDoms) => []
|
|
render: (props, defaultDoms) => []
|
|
}} open={ifShowModal} modalProps={{
|
|
}} open={ifShowModal} modalProps={{
|
|
closable: false,
|
|
closable: false,
|
|
@@ -1011,6 +1179,10 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
label: `非考核项目`,
|
|
label: `非考核项目`,
|
|
key: '3',
|
|
key: '3',
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ label: `成本项目`,
|
|
|
|
+ key: '4',
|
|
|
|
+ },
|
|
]}
|
|
]}
|
|
/>
|
|
/>
|
|
|
|
|
|
@@ -1053,8 +1225,8 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
editBtnHandle();
|
|
editBtnHandle();
|
|
}
|
|
}
|
|
|
|
|
|
- }}>{(ifEdit&¤tEditRow?.id == record.id )? '保存' : '编辑'}</a>,
|
|
|
|
- <Fragment key={'cancel'}>{(ifEdit&¤tEditRow?.id == record.id ) && <a onClick={() => set_ifEdit(false)}>取消</a>}</Fragment>,
|
|
|
|
|
|
+ }}>{(ifEdit && currentEditRow?.id == record.id) ? '保存' : '编辑'}</a>,
|
|
|
|
+ <Fragment key={'cancel'}>{(ifEdit && currentEditRow?.id == record.id) && <a onClick={() => set_ifEdit(false)}>取消</a>}</Fragment>,
|
|
<Popconfirm key="popconfirm" title={`确认删除吗?`} okText="是" cancelText="否" onConfirm={() => delHandle(record)}>
|
|
<Popconfirm key="popconfirm" title={`确认删除吗?`} okText="是" cancelText="否" onConfirm={() => delHandle(record)}>
|
|
{(currentEditRow?.id != record.id || !ifEdit) && <a key={'del'}>删除</a>}
|
|
{(currentEditRow?.id != record.id || !ifEdit) && <a key={'del'}>删除</a>}
|
|
</Popconfirm>
|
|
</Popconfirm>
|
|
@@ -1104,8 +1276,8 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
editBtnHandle();
|
|
editBtnHandle();
|
|
}
|
|
}
|
|
|
|
|
|
- }}>{(ifEdit&¤tEditRow?.id == record.id ) ? '保存' : '编辑'}</a>,
|
|
|
|
- <Fragment key={'cancel'}>{(ifEdit&¤tEditRow?.id == record.id ) && <a onClick={() => set_ifEdit(false)}>取消</a>}</Fragment>,
|
|
|
|
|
|
+ }}>{(ifEdit && currentEditRow?.id == record.id) ? '保存' : '编辑'}</a>,
|
|
|
|
+ <Fragment key={'cancel'}>{(ifEdit && currentEditRow?.id == record.id) && <a onClick={() => set_ifEdit(false)}>取消</a>}</Fragment>,
|
|
<Popconfirm key="popconfirm" title={`确认删除吗?`} okText="是" cancelText="否" onConfirm={() => delHandle(record)}>
|
|
<Popconfirm key="popconfirm" title={`确认删除吗?`} okText="是" cancelText="否" onConfirm={() => delHandle(record)}>
|
|
{(currentEditRow?.id != record.id || !ifEdit) && <a key={'del'}>删除</a>}
|
|
{(currentEditRow?.id != record.id || !ifEdit) && <a key={'del'}>删除</a>}
|
|
</Popconfirm>
|
|
</Popconfirm>
|
|
@@ -1139,19 +1311,68 @@ const CheckUnitProjectSet: React.FC = () => {
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- {currentSelectedTreeNode && <BMSTable actionRef={tableRef} params={searchParams} rowKey='id' columns={[...tableColumn,{
|
|
|
|
|
|
+ {currentSelectedTreeNode && <BMSTable actionRef={tableRef} params={searchParams} rowKey='id' columns={[...tableColumn, {
|
|
title: '操作',
|
|
title: '操作',
|
|
key: 'option',
|
|
key: 'option',
|
|
valueType: 'option',
|
|
valueType: 'option',
|
|
render: (text, record: any) => [
|
|
render: (text, record: any) => [
|
|
<Popconfirm key="popconfirm" title={`确认删除吗?`} okText="是" cancelText="否" onConfirm={() => delHandle(record)}>
|
|
<Popconfirm key="popconfirm" title={`确认删除吗?`} okText="是" cancelText="否" onConfirm={() => delHandle(record)}>
|
|
- { <a key={'del'}>删除</a>}
|
|
|
|
|
|
+ {<a key={'del'}>删除</a>}
|
|
</Popconfirm>
|
|
</Popconfirm>
|
|
],
|
|
],
|
|
}]} request={(params, sort, filter) => getTableData('NONCHECK', params, sort, filter)} />}
|
|
}]} request={(params, sort, filter) => getTableData('NONCHECK', params, sort, filter)} />}
|
|
</div>
|
|
</div>
|
|
)
|
|
)
|
|
}
|
|
}
|
|
|
|
+ {
|
|
|
|
+ currentSelectedTabKey == '4' && (
|
|
|
|
+ <div className='tabContent'>
|
|
|
|
+ <div className='tableToolbar'>
|
|
|
|
+ <div className='search'>
|
|
|
|
+ <span>检索:</span><Input className='searchInput' allowClear placeholder="请输入项目名称" onChange={(e) => {
|
|
|
|
+ set_searchKeywords(e.target.value);
|
|
|
|
+
|
|
|
|
+ if (e.target.value.length == 0) {
|
|
|
|
+ set_searchParams({
|
|
|
|
+ ...searchParams,
|
|
|
|
+ name: ''
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }} suffix={
|
|
|
|
+ <IconFont type="iconsousuo" onClick={() => tableSearchHandle()} />
|
|
|
|
+ } />
|
|
|
|
+ </div>
|
|
|
|
+ <div className={'btnGroup'}>
|
|
|
|
+ <span key="2" onClick={() => openCopyHandleModal()}>复制</span>
|
|
|
|
+ <span key="3" onClick={() => addCostProject()}>添加</span>
|
|
|
|
+
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ {currentSelectedTreeNode && <BMSTable actionRef={tableRef} pagination={false} params={searchParams} rowKey='id' columns={[...tableColumn, {
|
|
|
|
+ title: '操作',
|
|
|
|
+ key: 'option',
|
|
|
|
+ width: 140,
|
|
|
|
+ valueType: 'option',
|
|
|
|
+ render: (text, record: any) => [
|
|
|
|
+ <a key={'edit'} onClick={() => {
|
|
|
|
+ if (!ifEdit) {
|
|
|
|
+ set_ifEdit(true);
|
|
|
|
+ set_currentEditRow(record)
|
|
|
|
+ }
|
|
|
|
+ if (ifEdit) {
|
|
|
|
+ editBtnHandle();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }}>{(ifEdit && currentEditRow?.id == record.id) ? '保存' : '编辑'}</a>,
|
|
|
|
+ <Fragment key={'cancel'}>{(ifEdit && currentEditRow?.id == record.id) && <a onClick={() => set_ifEdit(false)}>取消</a>}</Fragment>,
|
|
|
|
+ <Popconfirm key="popconfirm" title={`确认删除吗?`} okText="是" cancelText="否" onConfirm={() => delHandle(record)}>
|
|
|
|
+ {(currentEditRow?.id != record.id || !ifEdit) && <a key={'del'}>删除</a>}
|
|
|
|
+ </Popconfirm>
|
|
|
|
+ ],
|
|
|
|
+ }]} request={(params, sort, filter) => getTableData('COST', params, sort, filter)} />}
|
|
|
|
+ </div>
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
|
|
</BMSPagecontainer>
|
|
</BMSPagecontainer>
|
|
</div>
|
|
</div>
|