|
@@ -0,0 +1,854 @@
|
|
|
+import React, { useEffect, useRef, useState } from "react";
|
|
|
+import { type ProColumns, type ActionType, ProTable } from '@ant-design/pro-components';
|
|
|
+import {type FormInstance} from 'antd'
|
|
|
+import { SDPage,SDTable,EditType,DictTree,SDButton, baseFun,SDModalForm,SDOperate,SDSubmitButton, SDAreaTtile, SDFormDict, SDFormText, SDLayout, validateFun, SDModal, SDTabs } from "@sundata/ui-frame";
|
|
|
+import { ProductProps, renderTemplate } from "@/sundataImport";
|
|
|
+import { useModel } from '@umijs/max';
|
|
|
+import {getDataList,createMeteringRule,updateMeteringRule,deleteMeteringRule,selectMeteringRule,getMeteringRuleStepsList
|
|
|
+ ,createMeteringRuleSteps,getInDataList,getOutDataList,getProductDataList,
|
|
|
+ deleteMeteringRuleSteps,selectMeteringRuleSteps,isNotExist} from "@/services/rwa/product/rwa_calc_config_004rwa/creditriskmeteringrule";
|
|
|
+import { PlusSquareTwoTone, WomanOutlined } from "@ant-design/icons";
|
|
|
+import { MeteringRuleModel, MeteringRuleStepsModel,productListModel,inOrOutDataListModel } from "@/services/rwa/product/rwa_calc_config_004rwa/creditriskmeteringrule";
|
|
|
+import { rwaCalcConfProductrulesModel,product_modifyone1,product_modifyone2 } from "@/services/rwa/product_list";
|
|
|
+
|
|
|
+type widowProps = {
|
|
|
+ onCancel: () => void;
|
|
|
+ onChangeVisible(visible: boolean, type: string): unknown;
|
|
|
+ onChangeVisdible:(visible:boolean,type ?: 'none' | 'raload' )=>void;
|
|
|
+ treeData: DictTree[];
|
|
|
+}& ProductProps;
|
|
|
+// 客户基本信息表
|
|
|
+const creditriskmeteringrule : React.FC<widowProps> = (prop:widowProps) => {
|
|
|
+
|
|
|
+ /** 编辑方式,查看、修改、新增按钮时设置,详细信息表单中使用 */
|
|
|
+ const [editType, setEditType] = useState<EditType>(prop.editType || 'display');
|
|
|
+ const [toolRuleEditType, setToolRuleEditType] = useState<EditType>(prop.editType || 'display');
|
|
|
+ /** 是否显示详细信息窗口 */
|
|
|
+ const [detailVisible, setDetailVisible] = useState<boolean>(false);
|
|
|
+
|
|
|
+ /** 信用风险RWA计量规则定义信息窗口 */
|
|
|
+ const [StageConfigRuleVisible, setStageConfigRuleVisible] = useState<boolean>(false);
|
|
|
+
|
|
|
+ /** 产品列表信息窗口 */
|
|
|
+ const [productListVisible, setProductListVisible] = useState<boolean>(false);
|
|
|
+
|
|
|
+ /** 源数据列表信息窗口 */
|
|
|
+ const [inOrOutListVisible, setInOrOutListVisible] = useState<boolean>(false);
|
|
|
+ /** 产品列表查看跳转页面 */
|
|
|
+ const [transferVisible,setTransferVisible] = useState<boolean>(false);
|
|
|
+
|
|
|
+
|
|
|
+ const [currentRow, setCurrentRow] = useState<MeteringRuleModel>();
|
|
|
+ const [stageFormData,setStageFormData] = useState<MeteringRuleStepsModel[]>([]);
|
|
|
+ /** 表格引用对象,刷新表格使用 */
|
|
|
+ const actionRef = useRef<ActionType>();
|
|
|
+ const ruleActionRef = useRef<ActionType>();
|
|
|
+ const formRef = useRef<FormInstance<any>>();
|
|
|
+ const toolRuleFormRef = useRef<FormInstance<any>>();
|
|
|
+ const productFormRef = useRef<FormInstance<any>>();
|
|
|
+ const { fetchDict } = useModel('dict');
|
|
|
+ const [editRuleNo, setEditRuleNo] = useState<any>();
|
|
|
+ const [stageConfigKey, setStageConfigKey] = useState<any>();
|
|
|
+ // 页面数据
|
|
|
+ var formDataList = new Array<MeteringRuleModel>;
|
|
|
+
|
|
|
+ // 默认输出源
|
|
|
+ const [inOrOutKey,setInOrOutKey] = useState<any>();
|
|
|
+ // 默认输出源
|
|
|
+ const [productKey,setProductKey] = useState<any>();
|
|
|
+
|
|
|
+ useEffect(() => {
|
|
|
+ }, []);
|
|
|
+
|
|
|
+
|
|
|
+ //关闭窗口刷新父页面
|
|
|
+ const closeAndRefresh = ()=>{
|
|
|
+ actionRef.current?.reloadAndRest?.();
|
|
|
+ }
|
|
|
+
|
|
|
+ // 缓释工具类型修改查询查询
|
|
|
+ const selecReleaseTypeData = async (formdata : MeteringRuleModel) => {
|
|
|
+ const data = await selectMeteringRule(formdata);
|
|
|
+ if (data && data.creditRiskNo) {
|
|
|
+ setStageConfigKey(data.creditRiskNo);
|
|
|
+ const resData = await getMeteringRuleStepsList({
|
|
|
+ calcIndex: "",
|
|
|
+ startDate: "",
|
|
|
+ endDate: "",
|
|
|
+ term: "",
|
|
|
+ dataDate: "",
|
|
|
+ creditRiskNo: data.creditRiskNo,
|
|
|
+ stepNo: "",
|
|
|
+ stepName: "",
|
|
|
+ stepType: "",
|
|
|
+ stepIndex: "",
|
|
|
+ stepRule: "",
|
|
|
+ stepIns: [],
|
|
|
+ stepOuts: []
|
|
|
+ })
|
|
|
+ setStageFormData(resData);
|
|
|
+ formRef.current?.setFieldsValue(data);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ // 缓释工具规则修改查询查询
|
|
|
+ const selectReleaseRuleData = async (formdata : MeteringRuleStepsModel) => {
|
|
|
+ const data = await selectMeteringRuleSteps(formdata);
|
|
|
+ toolRuleFormRef.current?.setFieldsValue({...formdata});
|
|
|
+ }
|
|
|
+
|
|
|
+ // 阶段删除
|
|
|
+ const delReleaseTypeRows =async(record:any)=>{
|
|
|
+ baseFun.confirm('请确实是否继续操作',async() =>{
|
|
|
+ await deleteMeteringRule(record);
|
|
|
+ closeAndRefresh();
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ // 步骤删除
|
|
|
+ const delReleaseRuleRows =async(record:any)=>{
|
|
|
+ baseFun.confirm('确认删除?',async() =>{
|
|
|
+ await deleteMeteringRuleSteps(record.detailRuleNo);
|
|
|
+ baseFun.info("删除成功");
|
|
|
+ closeAndRefresh();
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ // 插入或者更新数据
|
|
|
+ const handleReleaseTypeSave = async(data: MeteringRuleModel,) => {
|
|
|
+
|
|
|
+ if (editType == 'update' ) {
|
|
|
+ await updateMeteringRule(data);
|
|
|
+ if (stageFormData.length>=1) {
|
|
|
+ // 规则新增
|
|
|
+ await createMeteringRuleSteps(stageFormData);
|
|
|
+
|
|
|
+ }
|
|
|
+ closeAndRefresh();
|
|
|
+ } else if (editType == 'create' ) {
|
|
|
+ await createMeteringRule(data);
|
|
|
+ // 规则新增
|
|
|
+ await createMeteringRuleSteps(stageFormData);
|
|
|
+
|
|
|
+ closeAndRefresh();
|
|
|
+ }
|
|
|
+ setDetailVisible(false);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 插入或者更新数据
|
|
|
+ const handleReleaseRuleSave = async(data: MeteringRuleStepsModel,) => {
|
|
|
+
|
|
|
+ data.creditRiskNo = stageConfigKey;
|
|
|
+
|
|
|
+ if (toolRuleEditType == 'update' ) {
|
|
|
+ if (stageFormData.length>=1) {
|
|
|
+ const arr = stageFormData.filter((item)=> item.creditRiskNo !== data.creditRiskNo);
|
|
|
+ arr.push(data);
|
|
|
+ setStageFormData([...arr]);
|
|
|
+ } else {
|
|
|
+ stageFormData[0]={...data};
|
|
|
+ setStageFormData([...stageFormData]);
|
|
|
+ }
|
|
|
+ // await updateStageConfigRule(data);
|
|
|
+ // closeAndRefreshRule();
|
|
|
+ } else if (toolRuleEditType == 'create' ) {
|
|
|
+ stageFormData.push(data);
|
|
|
+ setStageFormData([...stageFormData]);
|
|
|
+ }
|
|
|
+ setStageConfigRuleVisible(false);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ // 清除增加项
|
|
|
+ const removeRow = (key: any) => {
|
|
|
+ setStageFormData([...stageFormData.filter((item) => item.stepNo !== key)]);
|
|
|
+ };
|
|
|
+
|
|
|
+ // 阶段信息页面展示元素
|
|
|
+ const columns: ProColumns<MeteringRuleModel>[] = [
|
|
|
+ {
|
|
|
+ title: '计算实例号',
|
|
|
+ dataIndex: 'calcindex',
|
|
|
+ search: false,
|
|
|
+ hideInTable: true,
|
|
|
+ width:150,
|
|
|
+ ellipsis:true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '起始数据日期',
|
|
|
+ dataIndex: 'startDate',
|
|
|
+ search: false,
|
|
|
+ hideInTable: true,
|
|
|
+ width:150,
|
|
|
+ ellipsis:true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '截止数据日期',
|
|
|
+ dataIndex: 'endDate',
|
|
|
+ search: false,
|
|
|
+ hideInTable: true,
|
|
|
+ width:150,
|
|
|
+ ellipsis:true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '年月',
|
|
|
+ dataIndex: 'yearMonth',
|
|
|
+ search: false,
|
|
|
+ hideInTable: true,
|
|
|
+ width:150,
|
|
|
+ ellipsis:true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '数据日期',
|
|
|
+ dataIndex: 'dataDate',
|
|
|
+ search:false,
|
|
|
+ hideInTable: true,
|
|
|
+ width:150,
|
|
|
+ ellipsis:true,
|
|
|
+ valueType: 'date',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '规则编号',
|
|
|
+ dataIndex: 'creditRiskNo',
|
|
|
+ hideInTable: false,
|
|
|
+ width:150,
|
|
|
+ ellipsis:true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '规则名称',
|
|
|
+ dataIndex: 'creditRiskName',
|
|
|
+ hideInTable: false,
|
|
|
+ width:150,
|
|
|
+ ellipsis:true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '所属业务',
|
|
|
+ dataIndex: 'creditRiskBussinessCode',
|
|
|
+ hideInTable: false,
|
|
|
+ width:150,
|
|
|
+ ellipsis:true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '默认规则',
|
|
|
+ dataIndex: 'defaultRule',
|
|
|
+ search:false,
|
|
|
+ hideInTable: true,
|
|
|
+ width:150,
|
|
|
+ ellipsis:true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '默认输出',
|
|
|
+ dataIndex: 'defaultOut',
|
|
|
+ search: false,
|
|
|
+ hideInTable: true,
|
|
|
+ width:150,
|
|
|
+ ellipsis:true,
|
|
|
+ valueType: 'treeSelect',
|
|
|
+ request: () => fetchDict('org'),
|
|
|
+ fieldProps: {
|
|
|
+ treeDefaultExpandAll: true,
|
|
|
+ treeCheckable:true,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '规则序号',
|
|
|
+ dataIndex: 'creditRiskIndex',
|
|
|
+ search: false,
|
|
|
+ hideInTable: true,
|
|
|
+ width:150,
|
|
|
+ ellipsis:true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '操作',
|
|
|
+ dataIndex: 'operate',
|
|
|
+ valueType: 'option',
|
|
|
+ render: (_, record) => [
|
|
|
+ <SDOperate
|
|
|
+ key="update"
|
|
|
+ icon={<WomanOutlined />}
|
|
|
+ successMessage=""
|
|
|
+ onClick={
|
|
|
+ ()=>{
|
|
|
+ setStageConfigKey(record.creditRiskNo);
|
|
|
+ selecReleaseTypeData(record);
|
|
|
+ setDetailVisible(true);
|
|
|
+ setEditType('update')
|
|
|
+ } }
|
|
|
+ >
|
|
|
+ 修改
|
|
|
+ </SDOperate>,
|
|
|
+ <SDOperate
|
|
|
+ key="delete"
|
|
|
+ icon={<WomanOutlined />}
|
|
|
+ successMessage=""
|
|
|
+ onClick={()=>{delReleaseTypeRows(record) } }
|
|
|
+ >
|
|
|
+ 删除
|
|
|
+ </SDOperate>,
|
|
|
+ <SDOperate
|
|
|
+ key="see"
|
|
|
+ icon={<WomanOutlined />}
|
|
|
+ successMessage=""
|
|
|
+ onClick={()=>{
|
|
|
+ setProductKey(record.creditRiskNo);
|
|
|
+ setProductListVisible(true);
|
|
|
+ } }
|
|
|
+ >
|
|
|
+ 产品列表
|
|
|
+ </SDOperate>,
|
|
|
+ <SDOperate
|
|
|
+ key="see"
|
|
|
+ icon={<WomanOutlined />}
|
|
|
+ successMessage=""
|
|
|
+ onClick={()=>{
|
|
|
+ //selecReleaseTypeData(record);
|
|
|
+ setInOrOutKey(record.defaultOut);
|
|
|
+ setInOrOutListVisible(true);
|
|
|
+ //setEditType('display')
|
|
|
+ } }
|
|
|
+ >
|
|
|
+ 输入输出列表
|
|
|
+ </SDOperate>,
|
|
|
+ ],
|
|
|
+ },
|
|
|
+];
|
|
|
+
|
|
|
+
|
|
|
+ // 阶段步骤列表信息页面展示元素
|
|
|
+ const stageListColumns: ProColumns<MeteringRuleStepsModel>[] = [
|
|
|
+ {
|
|
|
+ title: '计算实例号',
|
|
|
+ dataIndex: 'calcindex',
|
|
|
+ search: false,
|
|
|
+ hideInTable: true,
|
|
|
+ width:150,
|
|
|
+ ellipsis:true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '起始数据日期',
|
|
|
+ dataIndex: 'startDate',
|
|
|
+ search: false,
|
|
|
+ hideInTable: true,
|
|
|
+ width:150,
|
|
|
+ ellipsis:true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '截止数据日期',
|
|
|
+ dataIndex: 'endDate',
|
|
|
+ search: false,
|
|
|
+ hideInTable: true,
|
|
|
+ width:150,
|
|
|
+ ellipsis:true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '年月',
|
|
|
+ dataIndex: 'yearMonth',
|
|
|
+ search: false,
|
|
|
+ hideInTable: true,
|
|
|
+ width:150,
|
|
|
+ ellipsis:true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '数据日期',
|
|
|
+ dataIndex: 'dataDate',
|
|
|
+ search: false,
|
|
|
+ hideInTable: true,
|
|
|
+ width:150,
|
|
|
+ ellipsis:true,
|
|
|
+ valueType: 'date',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '步骤序号',
|
|
|
+ dataIndex: 'stepIndex',
|
|
|
+ search:false,
|
|
|
+ hideInTable: false,
|
|
|
+ width:150,
|
|
|
+ ellipsis:true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '步骤编号',
|
|
|
+ dataIndex: 'stepNo',
|
|
|
+ search: false,
|
|
|
+ hideInTable: false,
|
|
|
+ width:150,
|
|
|
+ ellipsis:true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '步骤名称',
|
|
|
+ dataIndex: 'stepName',
|
|
|
+ search: false,
|
|
|
+ hideInTable: false,
|
|
|
+ width:150,
|
|
|
+ ellipsis:true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '步骤类型(预留)',
|
|
|
+ dataIndex: 'stepType',
|
|
|
+ search: false,
|
|
|
+ hideInTable: false,
|
|
|
+ width:150,
|
|
|
+ ellipsis:true,
|
|
|
+ valueType: 'treeSelect',
|
|
|
+ request: () => fetchDict('STEP_TYPE'),
|
|
|
+ fieldProps: {
|
|
|
+ treeDefaultExpandAll: true,
|
|
|
+ treeCheckable:true,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '输入数据源',
|
|
|
+ dataIndex: 'stepIns',
|
|
|
+ search:false,
|
|
|
+ hideInTable: false,
|
|
|
+ width:150,
|
|
|
+ ellipsis:true,
|
|
|
+ valueType: 'treeSelect',
|
|
|
+ request: () => fetchDict('org'),
|
|
|
+ fieldProps: {
|
|
|
+ treeDefaultExpandAll: true,
|
|
|
+ treeCheckable:true,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '输出数据源',
|
|
|
+ dataIndex: 'stepOuts',
|
|
|
+ hideInTable: false,
|
|
|
+ width:150,
|
|
|
+ ellipsis:true,
|
|
|
+ valueType: 'treeSelect',
|
|
|
+ request: () => fetchDict('org'),
|
|
|
+ fieldProps: {
|
|
|
+ treeDefaultExpandAll: true,
|
|
|
+ treeCheckable:true,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '操作',
|
|
|
+ dataIndex: 'operate',
|
|
|
+ valueType: 'option',
|
|
|
+ render: (_, record) => [
|
|
|
+ <SDOperate
|
|
|
+ key="update"
|
|
|
+ icon={<WomanOutlined />}
|
|
|
+ successMessage=""
|
|
|
+ onClick={
|
|
|
+ ()=>{
|
|
|
+ selectReleaseRuleData(record);
|
|
|
+ setStageConfigRuleVisible(true);
|
|
|
+ setToolRuleEditType('update');
|
|
|
+ } }
|
|
|
+ >
|
|
|
+ 修改
|
|
|
+ </SDOperate>,
|
|
|
+ <SDOperate
|
|
|
+ key="delete"
|
|
|
+ icon={<WomanOutlined />}
|
|
|
+ successMessage=""
|
|
|
+ onClick={()=>{
|
|
|
+ removeRow(record.stepNo);
|
|
|
+ } }
|
|
|
+ >
|
|
|
+ 删除
|
|
|
+ </SDOperate>,
|
|
|
+
|
|
|
+ ],
|
|
|
+ },
|
|
|
+];
|
|
|
+
|
|
|
+
|
|
|
+const productColumns: ProColumns<productListModel>[] = [
|
|
|
+
|
|
|
+ { title : '产品代码',
|
|
|
+ dataIndex : 'productNo',
|
|
|
+ width : 150
|
|
|
+ },
|
|
|
+
|
|
|
+ { title : '产品名称',
|
|
|
+ dataIndex : 'productName',
|
|
|
+ width : 150
|
|
|
+ },
|
|
|
+
|
|
|
+ { title : '产品大类',
|
|
|
+ dataIndex : 'productType',
|
|
|
+ valueType:"select",
|
|
|
+ request:()=>fetchDict(''),
|
|
|
+ width : 150
|
|
|
+ },
|
|
|
+ { title : '来源系统',
|
|
|
+ dataIndex : 'productFromSystem',
|
|
|
+ search:false,
|
|
|
+ hideInTable:false,
|
|
|
+ width : 150
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '操作',
|
|
|
+ dataIndex: 'operate',
|
|
|
+ valueType: 'option',
|
|
|
+ render: (_, record) => [
|
|
|
+ <SDOperate
|
|
|
+ key="roleCfg"
|
|
|
+ icon={<WomanOutlined />}
|
|
|
+ successMessage=""
|
|
|
+ onClick={async ()=>{
|
|
|
+ // disdata(record);
|
|
|
+ const sd = await product_modifyone1(record.productNo);
|
|
|
+ productFormRef.current?.setFieldsValue(sd);
|
|
|
+ setTransferVisible(true);
|
|
|
+ closeAndRefresh();
|
|
|
+ // setVisible(true);
|
|
|
+ // setEditType('display')
|
|
|
+ } }
|
|
|
+ >
|
|
|
+ 查看
|
|
|
+ </SDOperate>,
|
|
|
+ ],
|
|
|
+ },
|
|
|
+]
|
|
|
+
|
|
|
+const inOrOutColumns: ProColumns<inOrOutDataListModel>[] = [
|
|
|
+
|
|
|
+ { title : '数据源代码',
|
|
|
+ dataIndex : 'dataClassCode',
|
|
|
+ width : 150
|
|
|
+ },
|
|
|
+
|
|
|
+ { title : '数据源名称',
|
|
|
+ dataIndex : 'dataClassName',
|
|
|
+ width : 150
|
|
|
+ },
|
|
|
+
|
|
|
+ { title : '数据库表英文名',
|
|
|
+ dataIndex : 'tableName',
|
|
|
+ width : 150
|
|
|
+ },
|
|
|
+
|
|
|
+]
|
|
|
+
|
|
|
+const columns1: ProColumns<rwaCalcConfProductrulesModel>[] = [
|
|
|
+ { title : '计算实例号',
|
|
|
+ dataIndex : 'calcindex',
|
|
|
+ search:false,
|
|
|
+ hideInTable:true,
|
|
|
+ width : 150
|
|
|
+ },
|
|
|
+
|
|
|
+ { title : '起始数据日期',
|
|
|
+ dataIndex : 'sdate',
|
|
|
+ search:false,
|
|
|
+ hideInTable:true,
|
|
|
+ width : 150
|
|
|
+ },
|
|
|
+
|
|
|
+ { title : '截止数据日期',
|
|
|
+ dataIndex : 'edate',
|
|
|
+ search:false,
|
|
|
+ hideInTable:true,
|
|
|
+ width : 150
|
|
|
+ },
|
|
|
+
|
|
|
+ { title : '年月',
|
|
|
+ dataIndex : 'term',
|
|
|
+ search:false,
|
|
|
+ hideInTable:true,
|
|
|
+ width : 150
|
|
|
+ },
|
|
|
+
|
|
|
+ { title : '数据日期',
|
|
|
+ dataIndex : 'dataDate',
|
|
|
+ search:false,
|
|
|
+ hideInTable:true,
|
|
|
+ width : 150
|
|
|
+ },
|
|
|
+
|
|
|
+ { title : '产品编号',
|
|
|
+ dataIndex : 'productNo',
|
|
|
+ search:false,
|
|
|
+ hideInTable:true,
|
|
|
+ width : 150
|
|
|
+ },
|
|
|
+
|
|
|
+ { title : '规则编号',
|
|
|
+ dataIndex : 'ruleCode',
|
|
|
+ width : 150
|
|
|
+ },
|
|
|
+
|
|
|
+ { title : '规则名称',
|
|
|
+ dataIndex : 'ruleName',
|
|
|
+ width : 150
|
|
|
+ },
|
|
|
+
|
|
|
+ { title : '数据类型',
|
|
|
+ dataIndex : 'dataType',
|
|
|
+ width : 150
|
|
|
+ },
|
|
|
+
|
|
|
+ { title : '对应科目号',
|
|
|
+ dataIndex : 'ruleSubject',
|
|
|
+ width : 150
|
|
|
+ },
|
|
|
+
|
|
|
+ { title : '输入数据源',
|
|
|
+ dataIndex : 'ruleIn',
|
|
|
+ width : 150
|
|
|
+ },
|
|
|
+
|
|
|
+ { title : '输出数据源',
|
|
|
+ dataIndex : 'ruleOut',
|
|
|
+ width : 150
|
|
|
+ },
|
|
|
+
|
|
|
+ { title : '科目取数规则',
|
|
|
+ dataIndex : 'ruleGetdata',
|
|
|
+ width : 150
|
|
|
+ },
|
|
|
+ { title : '规则序号',
|
|
|
+ dataIndex : 'ruleIndex',
|
|
|
+ width : 150
|
|
|
+ },
|
|
|
+]
|
|
|
+
|
|
|
+return (
|
|
|
+ <SDPage>
|
|
|
+ <SDTable
|
|
|
+ title="查询表格"
|
|
|
+ rowKey="regularRrcsRuleNo"
|
|
|
+ request={async (formdata:MeteringRuleModel) =>{
|
|
|
+ const formDatas = await getDataList(formdata);
|
|
|
+ // 解构数组(导出用)
|
|
|
+ formDataList=[...formDatas];
|
|
|
+ return {data: formDatas}
|
|
|
+ } }
|
|
|
+ columns={columns}
|
|
|
+ toolBarRender={(_, { selectedRows }) => [
|
|
|
+ <SDButton
|
|
|
+ key="create"
|
|
|
+ icon={<PlusSquareTwoTone/>}
|
|
|
+ successMessage=''
|
|
|
+ onClick={() => {
|
|
|
+ setDetailVisible(true);
|
|
|
+ setEditType('create');
|
|
|
+ setStageFormData([]);
|
|
|
+ setStageConfigKey('');
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 新增
|
|
|
+ </SDButton>,
|
|
|
+ ]}
|
|
|
+ actionRef={actionRef}
|
|
|
+ formRef={formRef}
|
|
|
+ setDetailVisible={() => {setDetailVisible(true)}}
|
|
|
+ setEditType={setEditType}
|
|
|
+ setCurrentRow={setCurrentRow}
|
|
|
+ />
|
|
|
+
|
|
|
+ {detailVisible && (
|
|
|
+ <SDModalForm
|
|
|
+ editType={editType}
|
|
|
+ params={currentRow}
|
|
|
+ visible={detailVisible}
|
|
|
+ onVisibleChange={() => {
|
|
|
+ setDetailVisible(false);
|
|
|
+ }}
|
|
|
+ onValuesChange={(changevalue,values)=>{
|
|
|
+ setStageConfigKey(formRef.current?.getFieldValue('creditRiskNo'));
|
|
|
+ }}
|
|
|
+ footer={[
|
|
|
+ <SDSubmitButton editType={editType} formRef={formRef} doSubmit={handleReleaseTypeSave} >保存</SDSubmitButton>,
|
|
|
+ <SDButton
|
|
|
+ key="closeUpdate"
|
|
|
+ successMessage=''
|
|
|
+ onClick={() => {
|
|
|
+ setDetailVisible(false);
|
|
|
+ }}>关闭</SDButton>
|
|
|
+ ]}
|
|
|
+ tableRef={actionRef}
|
|
|
+ formRef={formRef}
|
|
|
+ >
|
|
|
+
|
|
|
+ <SDAreaTtile title='规则信息'/>
|
|
|
+ <SDFormText name="creditRiskNo" bgValidater={(creditRiskNo: string) => isNotExist(
|
|
|
+ {
|
|
|
+ calcIndex: "",
|
|
|
+ startDate: "",
|
|
|
+ endDate: "",
|
|
|
+ term: "",
|
|
|
+ dataDate: "",
|
|
|
+ creditRiskNo: creditRiskNo,
|
|
|
+ creditRiskName: "",
|
|
|
+ creditRiskBussinessCode: "",
|
|
|
+ defaultRule: "",
|
|
|
+ defaultOut: "",
|
|
|
+ creditRiskIndex: ""
|
|
|
+ }
|
|
|
+ )} readonlyCond="update" rules={[{max:50}]} required={true} label="规则编号"/>
|
|
|
+ <SDFormText name="creditRiskName" required={true} rules={[{max:100,message:'最多100个汉字'},{validator:validateFun.chineseRex}]} label="规则名称"/>
|
|
|
+ <SDFormDict dictKey='org' required={true} name="creditRiskBussinessCode" label="所属业务" />
|
|
|
+ <SDFormDict dictKey='org' required={true} name="defaultOut" label="默认输出数据源"/>
|
|
|
+ <SDFormText name="creditRiskIndex" required={true} label="规则序号"/>
|
|
|
+ <SDFormText name="defaultRule" required={true} type="textarea" label="默认规则"/>
|
|
|
+ <SDLayout>
|
|
|
+ <SDAreaTtile title='规则步骤列表'/>
|
|
|
+ <ProTable
|
|
|
+ search={false}
|
|
|
+ rowKey="detailRuleNo"
|
|
|
+ columns={stageListColumns}
|
|
|
+ dataSource={stageFormData}
|
|
|
+ toolBarRender={(_, { selectedRows }) =>
|
|
|
+ editType == 'update' || editType == 'create'? [
|
|
|
+ <SDButton
|
|
|
+ key="create"
|
|
|
+ icon={<PlusSquareTwoTone />}
|
|
|
+ successMessage=''
|
|
|
+ onClick={(record) => {
|
|
|
+ setStageConfigRuleVisible(true);
|
|
|
+ setToolRuleEditType('create');
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 新建
|
|
|
+ </SDButton>,
|
|
|
+ ]:[]}
|
|
|
+ actionRef={ruleActionRef}
|
|
|
+ formRef={toolRuleFormRef}
|
|
|
+
|
|
|
+ />
|
|
|
+ </SDLayout>
|
|
|
+
|
|
|
+ {StageConfigRuleVisible && (
|
|
|
+ <SDModalForm
|
|
|
+ visible={StageConfigRuleVisible}
|
|
|
+ onVisibleChange={() => {setStageConfigRuleVisible(false)}}
|
|
|
+ initialValues={{
|
|
|
+ detailRuleNo:editRuleNo
|
|
|
+ }}
|
|
|
+ editType={toolRuleEditType}
|
|
|
+ formRef={toolRuleFormRef}
|
|
|
+ footer={[
|
|
|
+ <SDSubmitButton editType={toolRuleEditType} formRef={toolRuleFormRef} doSubmit={handleReleaseRuleSave} >保存</SDSubmitButton>,
|
|
|
+ <SDButton
|
|
|
+ key="closeUpdate"
|
|
|
+ successMessage=''
|
|
|
+ onClick={() => {
|
|
|
+ setStageConfigRuleVisible(false);
|
|
|
+ }}>关闭</SDButton>
|
|
|
+ ]}
|
|
|
+ >
|
|
|
+ <SDAreaTtile title='步骤信息'/>
|
|
|
+ <SDFormText name="stepNo" max={30} rules={[{validator: validateFun.zinteger,message:'请输入数字类型'},]} label="步骤编号"/>
|
|
|
+ <SDFormText name="stepName" max={30} rules={[{max:100,message:'最多100个汉字'},{validator:validateFun.chineseRex}]} label="步骤名称" />
|
|
|
+ <SDFormDict dictKey='STEP_TYPE' name="stepType" label="步骤类型"/>
|
|
|
+ <SDFormDict dictKey='org' multiple={true} name="stepIns" label="输入数据源" />
|
|
|
+ <SDFormDict dictKey='org' multiple={true} name="stepOuts" label="输出数据源"/>
|
|
|
+ <SDFormText type="textarea" name="stepRule" label="步骤规则"/>
|
|
|
+
|
|
|
+
|
|
|
+ </SDModalForm>
|
|
|
+ )}
|
|
|
+
|
|
|
+ </SDModalForm>
|
|
|
+ )}
|
|
|
+
|
|
|
+{productListVisible && (
|
|
|
+ <SDModalForm
|
|
|
+ visible={productListVisible}
|
|
|
+ onVisibleChange={() => {setProductListVisible(false)}
|
|
|
+ }>
|
|
|
+ <SDTable
|
|
|
+ title="产品列表"
|
|
|
+ rowKey="productNo"
|
|
|
+ search={false}
|
|
|
+ request={async () =>{
|
|
|
+ const formDatas = await getProductDataList(productKey);
|
|
|
+ return {data: formDatas}
|
|
|
+ } }
|
|
|
+ columns={productColumns}
|
|
|
+ setDetailVisible={() => {setProductListVisible(true)}}
|
|
|
+ />
|
|
|
+ </SDModalForm>
|
|
|
+ )}
|
|
|
+{inOrOutListVisible && (
|
|
|
+ <SDModalForm
|
|
|
+ visible={inOrOutListVisible}
|
|
|
+ onVisibleChange={() => {setInOrOutListVisible(false)}
|
|
|
+ }>
|
|
|
+ <SDLayout>
|
|
|
+ <SDTable
|
|
|
+ title="输入数据源"
|
|
|
+ rowKey="productNo"
|
|
|
+ search={false}
|
|
|
+ request={async () =>{
|
|
|
+ const formDatas = await getInDataList(inOrOutKey);
|
|
|
+ return {data: formDatas}
|
|
|
+ } }
|
|
|
+ columns={inOrOutColumns}
|
|
|
+ setDetailVisible={() => {setInOrOutListVisible(true)}}
|
|
|
+ />
|
|
|
+ </SDLayout>
|
|
|
+
|
|
|
+
|
|
|
+ <SDLayout>
|
|
|
+ <SDTable
|
|
|
+ title="输出数据源"
|
|
|
+ rowKey="productNo"
|
|
|
+ search={false}
|
|
|
+ request={async () =>{
|
|
|
+ const formDatas = await getOutDataList(inOrOutKey);
|
|
|
+ return {data: formDatas}
|
|
|
+ } }
|
|
|
+ columns={inOrOutColumns}
|
|
|
+ setDetailVisible={() => {setInOrOutListVisible(true)}}
|
|
|
+ />
|
|
|
+ </SDLayout>
|
|
|
+ </SDModalForm>
|
|
|
+)
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+{transferVisible &&(
|
|
|
+ <SDModalForm title={''}
|
|
|
+ visible={transferVisible}
|
|
|
+ editType={editType}
|
|
|
+ formRef={productFormRef}
|
|
|
+ onVisibleChange={() => { setTransferVisible(false); }}
|
|
|
+ >
|
|
|
+ <span style={{display:'none'}}>
|
|
|
+ <SDFormText name="calcindex" label="计算实例号" />
|
|
|
+ <SDFormText name="sdate" label="起始数据日期" />
|
|
|
+ <SDFormText name="edate" label="截止数据日期" />
|
|
|
+ <SDFormText name="term" label="年月" />
|
|
|
+ <SDFormText name="dataDate" label="数据日期" />
|
|
|
+ </span>
|
|
|
+ <SDFormText name="productNo" label="产品代码" />
|
|
|
+ <SDFormText name="productName" label="产品名称" />
|
|
|
+ <SDFormText name="productType" label="产品大类" />
|
|
|
+ <SDFormText name="productIndex" label="产品序号" />
|
|
|
+ <SDFormText name="productStageId" label="所属阶段" />
|
|
|
+ <SDFormText name="productFromSystem" label="来源系统" />
|
|
|
+ <SDFormText name="defaultOut" label="默认输出数据源" />
|
|
|
+ <SDFormText name="productBussinessCode" label="所属业务" />
|
|
|
+ <SDFormText name="defaultGetdatarule" label="默认取数逻辑" />
|
|
|
+ <SDAreaTtile title='科目取数规则列表' />
|
|
|
+ <SDLayout>
|
|
|
+ <ProTable
|
|
|
+ rowKey="ruleCode"
|
|
|
+ search={false}
|
|
|
+ request={(async ()=>{
|
|
|
+ const formDatas = await product_modifyone2(productKey)
|
|
|
+ return {data:formDatas}
|
|
|
+ })
|
|
|
+ }
|
|
|
+ columns={columns1}
|
|
|
+ />
|
|
|
+ </SDLayout>
|
|
|
+ </SDModalForm>
|
|
|
+)}
|
|
|
+
|
|
|
+
|
|
|
+ </SDPage>
|
|
|
+
|
|
|
+);
|
|
|
+}
|
|
|
+export default creditriskmeteringrule;
|