社保福利档案新增编辑页面重构
This commit is contained in:
parent
661cc02ed4
commit
f2030e971f
|
|
@ -214,6 +214,7 @@ export default class Archives extends React.Component {
|
|||
const { archivesStore: { save, socialSecurityForm, accumulationFundForm, otherForm } } = this.props;
|
||||
if (selectedTab == 1) {
|
||||
const { data } = socialSecurityForm;
|
||||
console.log(socialSecurityForm);
|
||||
if (data.socialSchemeId && !data.socialStartTime) {
|
||||
Modal.warning({
|
||||
title: "信息确认",
|
||||
|
|
@ -221,9 +222,9 @@ export default class Archives extends React.Component {
|
|||
});
|
||||
return;
|
||||
}
|
||||
save("SOCIAL_SECURITY").then(() => {
|
||||
this.query();
|
||||
});
|
||||
// save("SOCIAL_SECURITY").then(() => {
|
||||
// this.query();
|
||||
// });
|
||||
} else if (selectedTab == 2) {
|
||||
const { data } = accumulationFundForm;
|
||||
if (data.fundSchemeId && !data.fundStartTime) {
|
||||
|
|
|
|||
|
|
@ -20,6 +20,11 @@
|
|||
}
|
||||
}
|
||||
|
||||
.welfareBaseWrapper {
|
||||
.title {
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.mySalaryBenefitsWrapper {
|
||||
|
|
|
|||
|
|
@ -33,30 +33,21 @@ export default class SocialSecurityForm extends React.Component {
|
|||
getPaymentForm(employeeId, "SOCIAL_SECURITY", value, paymentOrganization);
|
||||
};
|
||||
|
||||
//基数变化
|
||||
handlePaymentChange(params) {
|
||||
handlePaymentChange = ({ key, value }) => {
|
||||
const params = { [key]: value };
|
||||
const { archivesStore: { socialSecurityPaymentForm, setSocialSecurityPaymentForm } } = this.props;
|
||||
const { data } = socialSecurityPaymentForm;
|
||||
let request = { ...data, ...params };
|
||||
let form = { ...socialSecurityPaymentForm };
|
||||
form.data = request;
|
||||
setSocialSecurityPaymentForm(form);
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { archivesStore: { socialSecurityForm, socialSecurityPaymentForm } } = this.props;
|
||||
const { items, data: socialData } = socialSecurityForm;
|
||||
const paymentData = socialSecurityPaymentForm.data;
|
||||
const paymentItems = socialSecurityPaymentForm.items;
|
||||
// Integer数据转为string
|
||||
// let socialData = { ...baseData };
|
||||
// if (!_.isNil(socialData)) {
|
||||
// Object.keys(socialData).map(key => {
|
||||
// if (!_.isNil(socialData[key])) {
|
||||
// socialData[key] = socialData[key].toString();
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
const {
|
||||
nonPayment = "", schemeAccount = "", socialStartTime = "", socialEndTime = "",
|
||||
socialName = ""
|
||||
|
|
@ -101,7 +92,7 @@ export default class SocialSecurityForm extends React.Component {
|
|||
<div className="socialFormWrapper">
|
||||
<WeaSearchGroup
|
||||
title="社保基础信息"
|
||||
customComponent={<SocialTitle key="nonPayment" value={nonPayment.toString()}
|
||||
customComponent={<SocialTitle keyname="nonPayment" value={nonPayment.toString()}
|
||||
onChange={this.handleFormChange}/>}
|
||||
items={socialItems} col={2} showGroup needTigger={false}/>
|
||||
{
|
||||
|
|
@ -113,124 +104,31 @@ export default class SocialSecurityForm extends React.Component {
|
|||
key: child["domkey"][0],
|
||||
label: child.label,
|
||||
value: !_.isNil(paymentData[child["domkey"][0]]) ? paymentData[child["domkey"][0]].toString() : "",
|
||||
onChange: this.handleFormChange
|
||||
onChange: this.handlePaymentChange
|
||||
})
|
||||
}))}
|
||||
customComponent={<ConsistentWelfare/>}
|
||||
title={title} col={2} showGroup
|
||||
/>;
|
||||
})
|
||||
}
|
||||
{/*<div style={{ overflow: "hidden" }}>*/}
|
||||
{/* <WeaCheckbox*/}
|
||||
{/* style={{ float: "right", marginRight: "10px", marginTop: "10px" }}*/}
|
||||
{/* value={data && data.nonPayment}*/}
|
||||
{/* id="nonPayment"*/}
|
||||
{/* content="暂不缴纳"*/}
|
||||
{/* onChange={(value) => {*/}
|
||||
{/* this.handleFormChange({ nonPayment: value });*/}
|
||||
{/* }}*/}
|
||||
{/* />*/}
|
||||
{/*</div>*/}
|
||||
{/*<GroupCard title="社保基础信息">*/}
|
||||
{/* <Row>*/}
|
||||
{/* <Col span={6} className="formItem borderR-none borderB-none">社保起始缴纳月:</Col>*/}
|
||||
{/* <Col span={6} className="formItem borderR-none borderB-none">*/}
|
||||
{/* <WeaDatePicker*/}
|
||||
{/* viewAttr={(socialSecurityForm.data && socialSecurityForm.data.socialSchemeId) ? 3 : 2}*/}
|
||||
{/* format="YYYY-MM"*/}
|
||||
{/* value={data && data.socialStartTime}*/}
|
||||
{/* onChange={value => {*/}
|
||||
{/* this.handleFormChange({ socialStartTime: value });*/}
|
||||
{/* }}*/}
|
||||
{/* />*/}
|
||||
{/* </Col>*/}
|
||||
{/* <Col span={6} className="formItem borderR-none borderB-none">社保方案名称:</Col>*/}
|
||||
{/* <Col span={6} className="formItem">*/}
|
||||
{/* <WeaSelect*/}
|
||||
{/* options={(items && items[0].items && items[0].items[0]) ? [{*/}
|
||||
{/* key: "",*/}
|
||||
{/* showname: ""*/}
|
||||
{/* }, ...items[0].items[0].options] : []}*/}
|
||||
{/* value={data && data.socialSchemeId}*/}
|
||||
{/* style={{ width: "100%" }}*/}
|
||||
{/* onChange={(value, showName) => {*/}
|
||||
{/* this.handleFormChange({ socialName: showName, socialSchemeId: value });*/}
|
||||
{/* this.handleFetchPaymentForm(value);*/}
|
||||
{/* }}*/}
|
||||
{/* />*/}
|
||||
{/* </Col>*/}
|
||||
{/* </Row>*/}
|
||||
{/* <Row>*/}
|
||||
{/* <Col span={6} className="formItem borderR-none borderB-none">社保最后缴纳月:</Col>*/}
|
||||
{/* <Col span={6} className="formItem borderR-none borderB-none">*/}
|
||||
{/* <WeaDatePicker*/}
|
||||
{/* format="YYYY-MM"*/}
|
||||
{/* value={data && data.socialEndTime}*/}
|
||||
{/* onChange={value => this.handleFormChange({ socialEndTime: value })}*/}
|
||||
{/* />*/}
|
||||
{/* </Col>*/}
|
||||
{/* <Col span={6} className="formItem borderR-none">社保账号:</Col>*/}
|
||||
{/* <Col span={6} className="formItem">*/}
|
||||
{/* <WeaInput value={data && data.schemeAccount} onChange={(value) => {*/}
|
||||
{/* this.handleFormChange({ schemeAccount: value });*/}
|
||||
{/* }}/>*/}
|
||||
{/* </Col>*/}
|
||||
{/* </Row>*/}
|
||||
{/* <Row>*/}
|
||||
{/* <Col span={6} className="formItem borderR-none">社保个人实际承担方:</Col>*/}
|
||||
{/* <Col span={6} className="formItem">*/}
|
||||
{/* <WeaSelect*/}
|
||||
{/* options={(items && items[0].items && items[0].items[2]) ? items[0].items[2].options : []}*/}
|
||||
{/* value={data && data.underTake}*/}
|
||||
{/* style={{ width: "100%" }}*/}
|
||||
{/* onChange={(value) => {*/}
|
||||
{/* this.handleFormChange({ underTake: value });*/}
|
||||
{/* }}*/}
|
||||
{/* />*/}
|
||||
{/* </Col>*/}
|
||||
{/* </Row>*/}
|
||||
{/*</GroupCard>*/}
|
||||
{/*{*/}
|
||||
{/* data.socialSchemeId && paymentItems && paymentItems.map(group => (*/}
|
||||
{/* <div>*/}
|
||||
{/* {*/}
|
||||
{/* group.items && group.items.length > 0 && <GroupCard title={group.title}>*/}
|
||||
{/* <Row>*/}
|
||||
{/* {*/}
|
||||
{/* group.items && group.items.map((item, idx) => (*/}
|
||||
{/* <Col span={12}>*/}
|
||||
{/* <Row>*/}
|
||||
{/* <Col span={12}*/}
|
||||
{/* className={cs("formItem", "borderR-none", { "borderB-none": idx !== group.items.length - 1 && idx !== group.items.length - 2 })}>{item.label}:</Col>*/}
|
||||
{/* <Col span={12} className={cs("formItem", {*/}
|
||||
{/* "borderR-none": idx === 0 || idx === 2,*/}
|
||||
{/* "borderB-none": idx === 0 || idx === 2 || idx === 1*/}
|
||||
{/* })}>*/}
|
||||
{/* <WeaInputNumber*/}
|
||||
{/* min={0}*/}
|
||||
{/* precision={2}*/}
|
||||
{/* value={(paymentData && paymentData[item.domkey[0]]) ? Number(paymentData[item.domkey[0]]) : 0}*/}
|
||||
{/* onChange={(value) => {*/}
|
||||
{/* this.handlePaymentChange({ [item.domkey[0]]: value ? String(value) : '0' });*/}
|
||||
{/* }}*/}
|
||||
{/* />*/}
|
||||
{/* </Col>*/}
|
||||
{/* </Row>*/}
|
||||
{/* </Col>*/}
|
||||
{/* ))*/}
|
||||
{/* }*/}
|
||||
{/* </Row>*/}
|
||||
{/* </GroupCard>*/}
|
||||
{/* }*/}
|
||||
{/* </div>*/}
|
||||
{/* ))*/}
|
||||
{/*}*/}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
const SocialTitle = (props) => {
|
||||
const ConsistentWelfare = (props) => {
|
||||
const { value, onChange, key } = props;
|
||||
return <div className="welfareBaseWrapper">
|
||||
<span className="title">各项福利基数一致:</span>
|
||||
<WeaInputNumber
|
||||
style={{ width: 100 }} value={value}
|
||||
onChange={(val) => onChange({ key, value: val })}
|
||||
precision={2}
|
||||
/>
|
||||
</div>;
|
||||
};
|
||||
const SocialTitle = (props) => {
|
||||
const { value, onChange, keyname: key } = props;
|
||||
return <WeaCheckbox value={value} content="暂不缴纳" onChange={(val) => onChange({ key, value: val })}/>;
|
||||
};
|
||||
const SocialSelect = (props) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue