|
@@ -126,14 +126,16 @@ const reportfillingconfig : React.FC<widowRush> = (prop:widowRush) => {
|
|
|
let keys ='';
|
|
|
await updateReportData(data);
|
|
|
fillInFormDataBk.forEach((items)=>{
|
|
|
- keys = keys+items.id+","
|
|
|
+ keys = keys+items.reportUnitNo+","
|
|
|
});
|
|
|
await updateCalcReportData(fillInFormData,keys);
|
|
|
closeAndRefresh();
|
|
|
} else if (editType == 'create' ) {
|
|
|
fillInFormData.push(...calculateFormData);
|
|
|
await createReportData(data);
|
|
|
- await createCalcReportData(fillInFormData);
|
|
|
+ if (data?.reportNo) {
|
|
|
+ await createCalcReportData(fillInFormData,data?.reportNo);
|
|
|
+ }
|
|
|
closeAndRefresh();
|
|
|
}
|
|
|
setDetailVisible(false);
|
|
@@ -441,13 +443,8 @@ const analyseFile = async (data: ReportDefinitionModel) => {
|
|
|
successMessage=""
|
|
|
onClick={
|
|
|
()=>{
|
|
|
- if (record?.id != null ) {
|
|
|
- fillInActionRef.current?.startEditable(record?.id);
|
|
|
- } else {
|
|
|
- fillInActionRef.current?.startEditable(''+index);
|
|
|
- }
|
|
|
-
|
|
|
- } }
|
|
|
+ fillInActionRef.current?.startEditable(record?.reportUnitNo);
|
|
|
+ }}
|
|
|
>
|
|
|
编辑
|
|
|
</SDOperate>,
|
|
@@ -464,7 +461,7 @@ const analyseFile = async (data: ReportDefinitionModel) => {
|
|
|
search: false,
|
|
|
hideInTable: false,
|
|
|
editable:false,
|
|
|
- render: (text, record, index) => { index = index + 1;record.id=''+index; return index},
|
|
|
+ render: (text, record, index) => { index = index + 1; return index},
|
|
|
},
|
|
|
{
|
|
|
title: '所在sheet页位置',
|
|
@@ -532,7 +529,7 @@ const analyseFile = async (data: ReportDefinitionModel) => {
|
|
|
successMessage=""
|
|
|
onClick={
|
|
|
()=>{
|
|
|
- calculateActionRef.current?.startEditable(record.id);
|
|
|
+ calculateActionRef.current?.startEditable(record.reportUnitNo);
|
|
|
}}
|
|
|
>
|
|
|
编辑
|
|
@@ -696,7 +693,7 @@ const analyseFile = async (data: ReportDefinitionModel) => {
|
|
|
<SDLayout>
|
|
|
<SDAreaTtile title='需填报的单元详情'/>
|
|
|
<EditableProTable
|
|
|
- rowKey={(record) => record.id}
|
|
|
+ rowKey={(record) => record.reportUnitNo}
|
|
|
// rowKey="id"
|
|
|
columns={reportCalculateColumns}
|
|
|
recordCreatorProps={false}
|
|
@@ -722,7 +719,7 @@ const analyseFile = async (data: ReportDefinitionModel) => {
|
|
|
onClick={() => {
|
|
|
//setIntoRestId();
|
|
|
fillInActionRef.current?.addEditRecord?.({
|
|
|
- id: reptId+1,
|
|
|
+ reportUnitNo: reptId+1,
|
|
|
title: 'NEWROW',
|
|
|
});
|
|
|
}}
|
|
@@ -733,15 +730,20 @@ const analyseFile = async (data: ReportDefinitionModel) => {
|
|
|
key="import"
|
|
|
successMessage=''
|
|
|
onClick={() => {
|
|
|
- if (selectRowData.id) {
|
|
|
- if (newCreateFormData.some((item)=> item.id == selectRowData.id)) {
|
|
|
- setFillInFormData(...[fillInFormData.filter((item)=>{return item.id !== selectRowData.id})]);
|
|
|
- fillInActionRef.current?.reload();
|
|
|
- } else {
|
|
|
- baseFun.error('只能删除手动添加的元素');
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
+ //if (selectRowData.reportUnitNo) {
|
|
|
+ // if (newCreateFormData.some((item)=> item.id == selectRowData.id)) {
|
|
|
+ // setFillInFormData(...[fillInFormData.filter((item)=>{return item.id !== selectRowData.id})]);
|
|
|
+ // fillInActionRef.current?.reload();
|
|
|
+ // } else {
|
|
|
+ // baseFun.error('只能删除手动添加的元素');
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+ if (!newCreateFormData.some((item)=> item.reportUnitNo === selectRowData.reportUnitNo)) {
|
|
|
+ baseFun.error('只能删除手动添加的元素');
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ setFillInFormData(...[fillInFormData.filter((item)=>{return item.reportUnitNo !== selectRowData.reportUnitNo})]);
|
|
|
}
|
|
|
}}
|
|
|
>
|
|
@@ -749,15 +751,20 @@ const analyseFile = async (data: ReportDefinitionModel) => {
|
|
|
</SDButton>,
|
|
|
]:[]}
|
|
|
onChange={ (value: readonly ReportCalculationModel[]) => {
|
|
|
+ // let fillList = fillInFormData.filter(obj1 => formRef.current?.getFieldValue('reportNo')+
|
|
|
+ // value[value.length-1].reportUnitSheet+value[value.length-1].reportUnitRow+
|
|
|
+ // value[value.length-1].reportUnitCell !== obj1.reportUnitNo);
|
|
|
+ // fillList.push(value[value.length-1]);
|
|
|
newCreateFormData.push(value[value.length-1]);
|
|
|
setNewCreateFormData([...newCreateFormData]);
|
|
|
setFillInFormData([...value]);
|
|
|
+ //setFillInFormData([...fillList]);
|
|
|
}}
|
|
|
/>
|
|
|
</SDLayout>
|
|
|
<SDAreaTtile title='需计算的单元详情'/>
|
|
|
<EditableProTable
|
|
|
- rowKey="id"
|
|
|
+ rowKey={(record) => record.reportUnitNo}
|
|
|
columns={reportCalculateOtherColumns}
|
|
|
recordCreatorProps={false}
|
|
|
actionRef={calculateActionRef}
|