feature/2.9.42310.02-社保福利档案页面重构

This commit is contained in:
黎永顺 2023-11-30 15:13:09 +08:00
parent f113cb437f
commit b14c2f9f87
2 changed files with 20 additions and 9 deletions

View File

@ -40,7 +40,7 @@ class Index extends Component {
getBaseForm = async (props) => {
const { data: taxAgentList } = await getTaxAgentSelectList();
const {
archivesStore: { welfareProfileForm }, socialBase, fundBase, otherBase,
archivesStore: { welfareProfileForm }, socialBase, fundBase, otherBase, runStatuses,
employeeId, paymentOrganization, socialBaseData, fundBaseData, othersBaseData
} = props;
const payload = { employeeId, paymentOrganization, welfareTypeEnum: "" };
@ -57,6 +57,7 @@ class Index extends Component {
if (o.title === "basic") {
return {
...o, title: getLabel(542699, "员工基本信息"),
viewAttr: runStatuses === "4,5" ? 1 : o.viewAttr,
items: _.map(o.items, g => {
return { ...g, label: getLabel(g.lanId, g.label) };
})
@ -80,16 +81,23 @@ class Index extends Component {
const key = _.lowerCase(getKey(g)).indexOf("take") !== -1 ? "underTake" : getKey(g);
return {
...g, label: getLabel(g.lanId, g.label),
viewAttr: runStatuses === "4,5" ? 1 : g.viewAttr,
options: _.find(props[`${o.title}Items`], j => j.domkey[0] === key).options
};
}
return { ...g, label: getLabel(g.lanId, g.label) };
return {
...g, label: getLabel(g.lanId, g.label),
viewAttr: runStatuses === "4,5" ? 1 : g.viewAttr,
};
})
};
}
return {
...o, items: _.map(o.items, g => {
return { ...g, label: getLabel(g.lanId, g.label) };
return {
...g, label: getLabel(g.lanId, g.label),
viewAttr: runStatuses === "4,5" ? 1 : g.viewAttr,
};
})
};
})

View File

@ -662,9 +662,10 @@ export const getWelfareSearchsForm = (form, condition, onChange = () => void (0)
return <WeaCheckbox
value={value} content={getLabel(543196, "暂不缴纳")}
onChange={v => onNoPaymentChange(type, v)}
disabled={runStatuses === "4,5"}
/>;
};
const { socialBase, fundBase, otherBase } = extraFormField;
const { socialBase, fundBase, otherBase, runStatuses } = extraFormField;
const { isFormInit } = form;
const formParams = form.getFormParams();
let group = [];
@ -695,22 +696,22 @@ export const getWelfareSearchsForm = (form, condition, onChange = () => void (0)
if (cur.props.title === getLabel(543194, "社保基础信息") && _.every(socialBase.items, o => o.items.length > 0)) {
return [...pre, cur,
<BenefitBaseComponent dataSource={socialBase.items} value={payload} onChange={onExtraChange}
onSameChange={onSameChange}/>];
onSameChange={onSameChange} runStatuses={runStatuses}/>];
} else if (cur.props.title === getLabel(543197, "公积金基础信息") && _.every(fundBase.items, o => o.items.length > 0)) {
return [...pre, cur,
<BenefitBaseComponent dataSource={fundBase.items} value={payload} onChange={onExtraChange}
onSameChange={onSameChange}/>];
onSameChange={onSameChange} runStatuses={runStatuses}/>];
} else if (cur.props.title === getLabel(543198, "其他福利基础信息") && _.every(otherBase.items, o => o.items.length > 0)) {
return [...pre, cur,
<BenefitBaseComponent dataSource={otherBase.items} value={payload} onChange={onExtraChange}
onSameChange={onSameChange}/>];
onSameChange={onSameChange} runStatuses={runStatuses}/>];
}
return [...pre, cur];
}, []);
};
const BenefitBaseComponent = (props) => {
const { dataSource, value, onChange, onSameChange } = props;
const { dataSource, value, onChange, onSameChange, runStatuses } = props;
return <React.Fragment>
{
_.map(dataSource, item => {
@ -723,12 +724,14 @@ const BenefitBaseComponent = (props) => {
min={child.min !== "0.000" ? child.min : -999999999999999}
max={child.max !== "0.000" ? child.max : 999999999999999}
onChange={v => onChange(getKey(child), v)}
viewAttr={runStatuses === "4,5" ? 1 : 2}
/>
</WeaFormItem>
}))}
customComponent={<div className="welfare-same-box">
<span>{getLabel(543195, "各项福利基数一致")}</span>
<WeaInputNumber style={{ width: 100 }} onBlur={v => onSameChange(items, v)}/>
<WeaInputNumber style={{ width: 100 }} onBlur={v => onSameChange(items, v)}
disabled={runStatuses === "4,5"}/>
</div>}
title={title} col={2} showGroup className="twoColumns-welfare-info-wrapper"
/>;