|
@@ -2,13 +2,14 @@ import React, { useEffect, useRef, useState } from "react";
|
|
|
import { type ProColumns, type ActionType, type ProFormInstance, ProTable, EditableProTable } from '@ant-design/pro-components';
|
|
|
import type {FormInstance} from 'antd'
|
|
|
import {Upload} from 'antd'
|
|
|
-import { SDPage,SDFormText,SDModalForm,SDTable,SDFormItem,SDButton,SDSubmitButton,EditType, SDAreaTtile, SDOperate, baseFun,SDModal, validateFun, SDLayout, } from "@sundata/ui-frame";
|
|
|
+import { SDPage,SDFormText,SDModalForm,SDTable,SDFormItem,SDButton,SDSubmitButton,EditType, SDAreaTtile, SDOperate, baseFun,SDModal, validateFun, SDLayout, SDFormDict, } from "@sundata/ui-frame";
|
|
|
import type { DataSupplementTaskExampleModel,DataSupplementInstancesIntaskModel } from '@/services/rwa/product/datasupplementary/datasupplementation';
|
|
|
import {getDataList,selectDetailData} from '@/services/rwa/product/datasupplementary/datasupplementation';
|
|
|
import { PlusSquareTwoTone, PoweroffOutlined, WomanOutlined } from "@ant-design/icons";
|
|
|
import { ProductProps } from "@/sundataImport";
|
|
|
import { ReportCalculationModel } from "@/services/rwa/product/report_form_config_reportcreater/reportfillingconfig";
|
|
|
import { useModel } from "@umijs/max";
|
|
|
+import dayjs from 'dayjs';
|
|
|
type widowRush = {
|
|
|
onCancel: () => void;
|
|
|
onChangeVisible(visible: boolean, type: string): unknown;
|
|
@@ -25,13 +26,15 @@ const datasupplementation : React.FC<widowRush> = (prop:widowRush) => {
|
|
|
/** 表格引用对象,刷新表格使用 */
|
|
|
const actionRef = useRef<ActionType>();
|
|
|
const formRef = useRef<FormInstance<any>>();
|
|
|
+ const formRef1 = useRef<FormInstance<any>>();
|
|
|
+ const formRef2 = useRef<FormInstance<any>>();
|
|
|
const templateRef = useRef<FormInstance<any>>();
|
|
|
|
|
|
- const [formDetailData, setFormDetailData] = useState<DataSupplementInstancesIntaskModel[]>();
|
|
|
- const [templateCheckData, setTemplateCheckData] = useState<DataSupplementInstancesIntaskModel[]>();
|
|
|
+ const [templateCheckData, setTemplateCheckData] = useState<DataSupplementInstancesIntaskModel[]>([]);
|
|
|
|
|
|
// 页面数据
|
|
|
var formDataList = new Array<DataSupplementTaskExampleModel>;
|
|
|
+ var formDataList1 = new Array<DataSupplementInstancesIntaskModel>;
|
|
|
/**上传文件 */
|
|
|
const [fileData, setFileData] = useState<File>();
|
|
|
// 导入窗口显示
|
|
@@ -41,6 +44,7 @@ const datasupplementation : React.FC<widowRush> = (prop:widowRush) => {
|
|
|
|
|
|
const { fetchDict } = useModel('dict');
|
|
|
|
|
|
+
|
|
|
/**上传属性 */
|
|
|
const fileProps = {
|
|
|
onRemove: () => {
|
|
@@ -50,19 +54,22 @@ const datasupplementation : React.FC<widowRush> = (prop:widowRush) => {
|
|
|
setFileData(info);
|
|
|
},
|
|
|
};
|
|
|
+const { initialState } = useModel('@@initialState');
|
|
|
+const workdate = initialState?.workDate;
|
|
|
|
|
|
/** 字段关系序号编辑 */
|
|
|
var dataIndex = 1;
|
|
|
|
|
|
useEffect(() => {
|
|
|
+
|
|
|
}, []);
|
|
|
-
|
|
|
|
|
|
// 修改查询查询
|
|
|
- const selectData = async (formdata : DataSupplementTaskExampleModel) => {
|
|
|
- const data = await selectDetailData(formdata);
|
|
|
- formRef.current?.setFieldsValue(data);
|
|
|
-
|
|
|
+ const selectData = async (record : DataSupplementTaskExampleModel) => {
|
|
|
+ const data = await selectDetailData(record);
|
|
|
+ console.log(JSON.stringify(data));
|
|
|
+ //setTemplateCheckData(data);
|
|
|
+ setTemplateCheckData(eval('['+JSON.stringify(data)+']'));
|
|
|
}
|
|
|
|
|
|
|
|
@@ -119,7 +126,7 @@ const datasupplementation : React.FC<widowRush> = (prop:widowRush) => {
|
|
|
},
|
|
|
{
|
|
|
title: '数据补录任务',
|
|
|
- dataIndex: 'taskName',
|
|
|
+ dataIndex: 'tmpName',
|
|
|
valueType:'select',
|
|
|
request:()=>fetchDict({dictKey : '@taskName'}),
|
|
|
hideInTable: false,
|
|
@@ -132,7 +139,7 @@ const datasupplementation : React.FC<widowRush> = (prop:widowRush) => {
|
|
|
},
|
|
|
{
|
|
|
title: '首选责任人',
|
|
|
- dataIndex: 'account',
|
|
|
+ dataIndex: 'tmpName',
|
|
|
search: false,
|
|
|
hideInTable: false,
|
|
|
},
|
|
@@ -154,6 +161,7 @@ const datasupplementation : React.FC<widowRush> = (prop:widowRush) => {
|
|
|
onClick={
|
|
|
()=>{
|
|
|
selectData(record);
|
|
|
+ setSelectVisible(false);
|
|
|
setFieldDetailVisible(true);
|
|
|
// setDetailVisible(true);
|
|
|
setEditType('update');
|
|
@@ -167,9 +175,9 @@ const datasupplementation : React.FC<widowRush> = (prop:widowRush) => {
|
|
|
successMessage=""
|
|
|
onClick={
|
|
|
()=>{
|
|
|
- selectData(record);
|
|
|
+ // selectData(record);
|
|
|
setSelectVisible(true);
|
|
|
- setEditType('update');
|
|
|
+ setEditType('display');
|
|
|
} }
|
|
|
>
|
|
|
查看
|
|
@@ -223,14 +231,14 @@ const templateCheckColumns: ProColumns<DataSupplementInstancesIntaskModel>[] = [
|
|
|
},
|
|
|
{
|
|
|
title: '补录人',
|
|
|
- dataIndex: 'taskFirstPerson',
|
|
|
+ dataIndex: 'account',
|
|
|
hideInTable: false,
|
|
|
width:150,
|
|
|
ellipsis:true
|
|
|
},
|
|
|
{
|
|
|
title: '补录机构',
|
|
|
- dataIndex: 'taskOrgCode',
|
|
|
+ dataIndex: 'orgCode',
|
|
|
hideInTable: false,
|
|
|
width:150,
|
|
|
ellipsis:true
|
|
@@ -269,7 +277,7 @@ const templateCheckColumns: ProColumns<DataSupplementInstancesIntaskModel>[] = [
|
|
|
dataIndex: 'operate',
|
|
|
valueType: 'option',
|
|
|
width:150,
|
|
|
- ellipsis:true,
|
|
|
+ ellipsis:false,
|
|
|
render: (_, record) => [
|
|
|
<SDOperate
|
|
|
key="roleCfg"
|
|
@@ -355,7 +363,7 @@ const templateCheckColumns: ProColumns<DataSupplementInstancesIntaskModel>[] = [
|
|
|
visible={detailVisible}
|
|
|
onVisibleChange={() => {setDetailVisible(false)}}
|
|
|
footer={[
|
|
|
- <SDSubmitButton editType={editType} formRef={formRef} doSubmit={handleExecute} >发起</SDSubmitButton>,
|
|
|
+ <SDSubmitButton editType={editType} formRef={formRef1} doSubmit={handleExecute} >发起</SDSubmitButton>,
|
|
|
<SDButton
|
|
|
key="closeUpdate"
|
|
|
successMessage=''
|
|
@@ -364,21 +372,23 @@ const templateCheckColumns: ProColumns<DataSupplementInstancesIntaskModel>[] = [
|
|
|
}}>关闭</SDButton>
|
|
|
]}
|
|
|
tableRef={actionRef}
|
|
|
- formRef={formRef}
|
|
|
+ formRef={formRef1}
|
|
|
+ initialValues={{term:workdate}}
|
|
|
>
|
|
|
<SDAreaTtile title='补录数据任务发起'/>
|
|
|
- <SDFormText name="term" label="数据期次"/>
|
|
|
- <SDFormText name="tmpType" label="数据补录任务"/>
|
|
|
- <SDFormText name="rowRange" label="数据补录模板"/>
|
|
|
+ <SDFormText name="term" label="数据期次" type="prodmonth" readonlyCond="both"/>
|
|
|
+ <SDFormDict name="tmpType" label="数据补录任务" dictKey="@taskName" />
|
|
|
+ <SDFormDict name="rowRange" label="数据补录模板" dictKey="@rowRange"/>
|
|
|
</SDModalForm>
|
|
|
)}
|
|
|
|
|
|
{fieldDetailVisible && (
|
|
|
+
|
|
|
<SDModalForm
|
|
|
visible={fieldDetailVisible}
|
|
|
onVisibleChange={() => {setFieldDetailVisible(false)}}
|
|
|
footer={[
|
|
|
- <SDSubmitButton editType={editType} formRef={formRef} doSubmit={handleSave} >确定</SDSubmitButton>,
|
|
|
+ <SDSubmitButton editType={editType} formRef={formRef2} doSubmit={handleSave} >确定</SDSubmitButton>,
|
|
|
<SDButton
|
|
|
key="closeUpdate"
|
|
|
successMessage=''
|
|
@@ -392,9 +402,10 @@ const templateCheckColumns: ProColumns<DataSupplementInstancesIntaskModel>[] = [
|
|
|
<ProTable
|
|
|
search={false}
|
|
|
rowKey="index"
|
|
|
- formRef={formRef}
|
|
|
+ formRef={formRef2}
|
|
|
columns={templateCheckColumns}
|
|
|
dataSource={templateCheckData}
|
|
|
+ actionRef={actionRef}
|
|
|
/>
|
|
|
</SDLayout>
|
|
|
</SDModalForm>
|
|
@@ -448,7 +459,7 @@ const templateCheckColumns: ProColumns<DataSupplementInstancesIntaskModel>[] = [
|
|
|
onVisibleChange={() => {setFieldDetailVisible(false)}}
|
|
|
>
|
|
|
<SDAreaTtile title='补录数据任务发起'/>
|
|
|
- <SDFormText name="term" label="数据期次"/>
|
|
|
+ <SDFormText name="term" label="数据期次" type="date" />
|
|
|
<SDFormText name="tmpType" label="数据补录任务"/>
|
|
|
<SDFormText name="rowRange" label="数据补录模板"/>
|
|
|
|