diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js index d67c1566..461f542c 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js @@ -15,25 +15,23 @@ export default class SocialSecurityForm extends React.Component { getPaymentForm(this.props.employeeId, "SOCIAL_SECURITY", siSchemeId, this.props.record.paymentOrganization); } - // 表单变化 - handleFormChange = (params) => { - console.log("params", params); - return; + handleFormChange = ({ key, value }) => { + const params = { [key]: value }; const { archivesStore: { socialSecurityForm, setSocialSecurityForm }, onChangeRecordSchemeId } = this.props; const { data } = socialSecurityForm; let request = { ...data, ...params }; let form = { ...socialSecurityForm }; form.data = request; setSocialSecurityForm(form); - Object.keys(params).length > 1 && - onChangeRecordSchemeId(params.socialSchemeId); + key === "socialName" && this.handleFetchPaymentForm(value); + key === "socialName" && onChangeRecordSchemeId(value); }; - // 获取基数表单 - handleFetchPaymentForm(value) { - const { archivesStore: { getPaymentForm } } = this.props; - getPaymentForm(this.props.employeeId, "SOCIAL_SECURITY", value, this.props.record.paymentOrganization); - } + handleFetchPaymentForm = (value) => { + const { archivesStore: { getPaymentForm }, employeeId, record } = this.props; + const { paymentOrganization } = record; + getPaymentForm(employeeId, "SOCIAL_SECURITY", value, paymentOrganization); + }; //基数变化 handlePaymentChange(params) { @@ -67,6 +65,7 @@ export default class SocialSecurityForm extends React.Component { ..._.map(_.filter(toJS(items)[0].items, it => it.domkey[0] !== "paymentOrganization"), item => ({ com: SocialSelect({ + key: item["domkey"][0], label: item.label, value: !_.isNil(socialData[item["domkey"][0]]) ? socialData[item["domkey"][0]].toString() : "", options: item.options, @@ -75,6 +74,7 @@ export default class SocialSecurityForm extends React.Component { })), { com: SocialDatePicker({ + key: "socialStartTime", label: "社保起始缴纳月", value: socialStartTime, onChange: this.handleFormChange @@ -82,6 +82,7 @@ export default class SocialSecurityForm extends React.Component { }, { com: SocialEditInput({ + key: "schemeAccount", label: "社保账号", value: schemeAccount, onChange: this.handleFormChange @@ -89,6 +90,7 @@ export default class SocialSecurityForm extends React.Component { }, { com: SocialDatePicker({ + key: "socialEndTime", label: "社保最后缴纳月", value: socialEndTime, onChange: this.handleFormChange @@ -99,7 +101,8 @@ export default class SocialSecurityForm extends React.Component {