|
@@ -3,7 +3,7 @@ import { Button, Checkbox, Dropdown, Form, FormInstance, Input, Menu, Space, Too
|
|
|
import { ActionType, EditableFormInstance, ProColumns, ProFormInstance, ProTable } from '@ant-design/pro-components';
|
|
|
import { baseFun, ContextMenu, DictTree, EditType, SDAreaTtile, SDButton, SDForm, SDFormDict, SDFormText, SDLayout, SDModalForm, SDOperate, SDPage, SDSubmitButton, SDTree } from '@sundata/ui-frame';
|
|
|
import { SysFunButtonInfoModel } from '@/services/authMng/funcMng';
|
|
|
-import { getDetail1, getFunTree1,save, rules_addone, rules_list, rwaCalcConfOffbalanceprotypeModel, rwaCalcConfOffbalanceprotyperuleModel, shunxu, save2, rules_modifyone, rules_deleteone, info_deleteone, jiaoyan, deleteFunc } from '@/services/rwa/info_list';
|
|
|
+import { getDetail1, getFunTree1,save, rules_addone, rules_list, rwaCalcConfOffbalanceprotypeModel, rwaCalcConfOffbalanceprotyperuleModel, shunxu, save2, rules_modifyone, rules_deleteone, info_deleteone, jiaoyan, deleteFunc, getoffobjectStageId } from '@/services/rwa/info_list';
|
|
|
import { DataNode } from 'antd/lib/tree';
|
|
|
import { MenuInfo } from 'rc-menu/lib/interface';
|
|
|
import { CheckSquareOutlined, CloseSquareTwoTone, DownOutlined, WomanOutlined } from '@ant-design/icons';
|
|
@@ -19,6 +19,7 @@ type aaa ={
|
|
|
ismini ?:any;
|
|
|
offobjectNo ?:any;
|
|
|
offobjectSuper ?:any;
|
|
|
+ offobjectStageId :any;
|
|
|
}
|
|
|
const infolist: React.FC<aaa> = (prop :aaa) => {
|
|
|
const [selectedNode, setSelectedNode] = useState(null);
|
|
@@ -50,6 +51,7 @@ const [state1,setState1] = useState<String>();
|
|
|
const [dataSource, setDataSource] = useState<any>() ;
|
|
|
|
|
|
const [offobjec,setOffobjec]=useState<boolean>(false);
|
|
|
+const [defaultOut,setDefaultOut]= useState<any>() ;
|
|
|
|
|
|
|
|
|
const [mockData, setMockData] = useState<rwaCalcConfOffbalanceprotyperuleModel[]>([]);
|
|
@@ -61,10 +63,11 @@ const [offobjec,setOffobjec]=useState<boolean>(false);
|
|
|
console.log(treeData1);
|
|
|
return data;
|
|
|
});
|
|
|
+
|
|
|
formInit(data[0].value);
|
|
|
});
|
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
|
- }, []);
|
|
|
+ }, [setDefaultOut]);
|
|
|
|
|
|
|
|
|
const [selectedKeys, setSelectedKeys] = useState([]);
|
|
@@ -80,6 +83,8 @@ return data;
|
|
|
|
|
|
const formInit = async (offobjectNo : any) => {
|
|
|
const data1 = await getDetail1(offobjectNo);
|
|
|
+ const getoffobjectStage = await getoffobjectStageId(offobjectNo);
|
|
|
+ setDefaultOut(getoffobjectStage);
|
|
|
if (!data1.buttonList) data1.buttonList = [];
|
|
|
let i = 0;
|
|
|
data1.buttonList = data1.buttonList.map((item:any) => {
|
|
@@ -311,13 +316,24 @@ const items: any[] = [
|
|
|
|
|
|
{ title : '输入',
|
|
|
dataIndex : 'ruleIn',
|
|
|
+ hideInTable:true,
|
|
|
+ width : 150
|
|
|
+ },
|
|
|
+ { title : '输入',
|
|
|
+ dataIndex : 'ruleInName',
|
|
|
width : 150
|
|
|
},
|
|
|
|
|
|
{ title : '输出',
|
|
|
dataIndex : 'ruleOut',
|
|
|
+ hideInTable:true,
|
|
|
width : 150
|
|
|
- }, {
|
|
|
+ },
|
|
|
+ { title : '输出',
|
|
|
+ dataIndex : 'ruleOutName',
|
|
|
+ width : 150
|
|
|
+ },
|
|
|
+ {
|
|
|
title: '操作',
|
|
|
dataIndex: 'operate',
|
|
|
valueType: 'option',
|
|
@@ -353,12 +369,14 @@ const items: any[] = [
|
|
|
]
|
|
|
const handleSave =async(formData:rwaCalcConfOffbalanceprotypeModel)=>{
|
|
|
// formData.buttonList=mockData
|
|
|
- if(mockData.length<=0){
|
|
|
+ if(mockData.length<=0 && formData.ismini=='1'){
|
|
|
baseFun.warning("表外项目分类认定规则列表中至少有一条记录");
|
|
|
}else{
|
|
|
if(editType=='update'){
|
|
|
await save({...formData})
|
|
|
+ if(formData.ismini=='1'){
|
|
|
save1(formData.offobjectNo);
|
|
|
+ }
|
|
|
refreshTree().then((data) => {
|
|
|
formInit(data[0].value);
|
|
|
});
|
|
@@ -372,7 +390,9 @@ const items: any[] = [
|
|
|
formRef.current?.setFieldValue('offobjectNo',null)
|
|
|
}else{
|
|
|
await save({...formData})
|
|
|
+ if(formData.ismini=='1'){
|
|
|
save1(formData.offobjectNo);
|
|
|
+ }
|
|
|
refreshTree().then((data) => {
|
|
|
formInit(data[0].value);
|
|
|
});
|
|
@@ -414,6 +434,8 @@ const setRuleNoAdd = () => {
|
|
|
const funccode = node[0] as string;
|
|
|
// 右键菜单点击新增按钮后,再点击树节点时,需要重置editType
|
|
|
setEditType('update');
|
|
|
+ const getoffobjectStage = await getoffobjectStageId(funccode);
|
|
|
+ setDefaultOut(getoffobjectStage);
|
|
|
// formRef.current?.resetFields(); TODO 尝试配合request解决表单内容不刷新问题
|
|
|
formRef.current?.setFieldsValue(await formInit(funccode));
|
|
|
|
|
@@ -433,7 +455,7 @@ const setRuleNoAdd = () => {
|
|
|
<DirectoryTree treeData={treeData1} onSelect={onNodeClick} checkable showLine={true} onCheck={checkedSelectTreeKeys} autoExpandParent={true}
|
|
|
// onCheck={handleTreeCheck}
|
|
|
//checkedKeys={selectedKeys}
|
|
|
-
|
|
|
+
|
|
|
// MenuProps={{
|
|
|
// selectedKeys: selectedKeys,
|
|
|
// }}
|
|
@@ -475,7 +497,7 @@ const setRuleNoAdd = () => {
|
|
|
<SDForm
|
|
|
formRef={formRef}
|
|
|
editType={editType}
|
|
|
- initialValues={{state:'1',ismini:prop.ismini,offobjectNo:prop.offobjectNo}}
|
|
|
+ initialValues={{state:'1',ismini:prop.ismini,offobjectNo:prop.offobjectNo,offobjectStageId:prop.offobjectStageId}}
|
|
|
onValuesChange={(changedValues,value)=>{
|
|
|
if(value.ismini!='' && value.ismini!=undefined){
|
|
|
if(value.ismini=='0'){
|
|
@@ -486,6 +508,10 @@ const setRuleNoAdd = () => {
|
|
|
setVisible2(true);
|
|
|
}
|
|
|
}
|
|
|
+ if(value.offobjectStageId!='' &&value.offobjectStageId!=undefined ){
|
|
|
+ setDefaultOut(value.offobjectStageId)
|
|
|
+ }
|
|
|
+ //setDefaultOut(value.offobjectStageId)
|
|
|
setState1(value.offobjectNo)
|
|
|
}}
|
|
|
>
|
|
@@ -493,10 +519,10 @@ const setRuleNoAdd = () => {
|
|
|
<SDFormText name="offobjectName" label="表外项目名称" required />
|
|
|
<SDFormText name="offobjectSuper" label="上级表外项目代码" required readonlyCond='both' />
|
|
|
<SDFormText name="offobjectSuperName" label="上级表外项目名称" required readonlyCond='both' />
|
|
|
-<SDFormDict name="ismini" label="是否最细一级" required dictKey='YESORNO'/>
|
|
|
+<SDFormDict name="ismini" required dictKey='YESORNO' label="是否最细一级"/>
|
|
|
{ismini1&&(<SDFormText name="ccf" label="转换系数(%)" required={ismini1} />)}
|
|
|
-<SDFormText name="defaultOut" label="默认输出数据源" required />
|
|
|
-{offobjec &&<SDFormText name="offobjectStageId" label="所属阶段" required ={offobjec}/>}
|
|
|
+<SDFormDict name="defaultOut" label="默认输出数据源" required dictKey='@selectdefaultOut1' dictParam={`{"defaultOut":"${defaultOut}"}`} />
|
|
|
+{offobjec &&<SDFormDict name="offobjectStageId" label="所属阶段" required ={offobjec} dictKey='@offobjectStageId'/>}
|
|
|
<SDFormText name="offobjectIndex" label="认定顺序号" required />
|
|
|
<SDFormText name="yesorno" label="状态" readonlyCond='both'/>
|
|
|
</SDForm>
|
|
@@ -571,8 +597,8 @@ const setRuleNoAdd = () => {
|
|
|
}
|
|
|
}}]} />
|
|
|
<SDFormDict name="ruleProductNo" label="产品名称" dictKey='@ruleProductNo' />
|
|
|
-<SDFormText name="ruleIn" label="输入数据源 " />
|
|
|
-<SDFormText name="ruleOut" label="输出数据源" />
|
|
|
+<SDFormDict name="ruleIn" label="输入数据源 " dictKey='@ruleIn1' dictParam={`{"defaultOut":"${defaultOut}"}`} />
|
|
|
+<SDFormDict name="ruleOut" label="输出数据源" dictKey='@selectdefaultOut1' dictParam={`{"defaultOut":"${defaultOut}"}`} />
|
|
|
<SDFormText name="ruleIndex" label="规则序号" />
|
|
|
<SDFormText name="ruleGetdata" label="表外项目分类认定规则" />
|
|
|
</SDForm>
|