diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareEditArchiveSlide/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareEditArchiveSlide/index.js
index ad549ea8..2a979f60 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareEditArchiveSlide/index.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareEditArchiveSlide/index.js
@@ -113,8 +113,31 @@ class Index extends Component {
}
});
};
- updateForm = () => {
+ covertPayload = (welfareType, paymentForm) => {
+ const { archivesStore: { welfareProfileForm } } = this.props;
+ const welfareData = welfareProfileForm.getFormParams();
+ const { formData } = this.state;
+ console.log(welfareData, formData, this.props, paymentForm);
+ return {
+ baseForm: {
+ ...formData[welfareType], ..._.reduce(_.keys(formData[welfareType]), (pre, cur) => {
+ if (welfareData[cur]) return { ...pre, [cur]: welfareData[cur] };
+ return { ...pre };
+ }, {}),
+ underTake: welfareData[`${_.lowerCase(welfareType.split("_")[0])}UnderTake`]
+ },
+ paymentForm: !_.isEmpty(paymentForm) ? _.reduce(paymentForm, (pre, cur) => {
+ if (formData[cur] || formData[cur] === 0) return { ...pre, [cur]: formData[cur] };
+ return { ...pre, [cur]: "0" };
+ }, {}) : "",
+ welfareType
+ };
};
+ save = () => {
+ console.log(this.covertPayload("SOCIAL_SECURITY", getConditionDomkeys(this.props.socialBase.items)));
+ };
+ updateFormData=()=>{
+ }
handleFormChange = (val) => {
const changeKey = _.keys(val)[0], changeVal = val[changeKey].value;
const { archivesStore: { setHasBeenModify }, onChangeProgramme, employeeId, paymentOrganization } = this.props;
@@ -127,6 +150,9 @@ class Index extends Component {
}
};
handleExtraChange = (key, value) => this.setState({ formData: { ...this.state.formData, [key]: value } });
+ handleNoPaymentChange = (type, value) => this.setState({
+ formData: { ...this.state.formData, [type]: { ...this.state.formData[type], nonPayment: value } }
+ });
renderTitle = () => {
const { loading } = this.state;
return
@@ -163,7 +189,12 @@ class Index extends Component {
top={0} width={800} height={100} measureT={"%"} measureX={"px"} measureY={"%"}
direction={"right"} title={this.renderTitle()} onClose={this.handleClose}
content={
- {getWelfareSearchsForm(welfareProfileForm, conditions, this.handleFormChange, this.handleExtraChange, formData, this.props)}
+ {
+ getWelfareSearchsForm(
+ welfareProfileForm, conditions, this.handleFormChange, this.handleNoPaymentChange, this.handleExtraChange,
+ formData, this.props
+ )
+ }
}
/>
);
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js
index 963e0e01..14e92020 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js
@@ -11,6 +11,7 @@ import { message, Modal, Spin } from "antd";
import WelfareEditArchiveSlide from "../welfareEditArchiveSlide";
import * as API from "../../../../../apis/welfareArchive";
import { welfareTypeEnum } from "../../config";
+import { getConditionDomkeys, getConditionFields } from "../../../../../util";
const getLabel = WeaLocaleProvider.getLabel;
const APILIST = {
@@ -239,6 +240,8 @@ class Index extends Component {
if (status) {
this.setState({
welfareEditSlide: { ...this.state.welfareEditSlide, [`${type}Base`]: data }
+ }, () => {
+ console.log(this.archiveSlideRef);
});
}
});
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/config.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/config.js
index 91714b3e..b21207de 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/config.js
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/config.js
@@ -656,10 +656,13 @@ export const welfareConditions = [
]
}
];
-export const getWelfareSearchsForm = (form, condition, onChange = () => void (0), onExtraChange = () => void (0), payload, extraFormField) => {
+export const getWelfareSearchsForm = (form, condition, onChange = () => void (0), onNoPaymentChange = () => void (0), onExtraChange = () => void (0), payload, extraFormField) => {
const CustomComponent = ({ type }) => {
const value = payload[type].nonPayment ? payload[type].nonPayment.toString() : "";
- return
;
+ return
onNoPaymentChange(type, v)}
+ />;
};
const { socialBase, fundBase, otherBase } = extraFormField;
const { isFormInit } = form;
@@ -720,7 +723,10 @@ const BenefitBaseComponent = (props) => {
/>
}))}
- customComponent={123
}
+ customComponent={
+ {getLabel(543195, "各项福利基数一致")}
+
+
}
title={title} col={2} showGroup className="twoColumns-welfare-info-wrapper"
/>;
})
diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/index.less
index 4b57066d..65aaa543 100644
--- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/index.less
+++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/index.less
@@ -205,6 +205,12 @@
background: #FFF;
border: 1px solid #e5e5e5;
}
+
+ .welfare-same-box {
+ & > span {
+ margin-right: 10px;
+ }
+ }
}
}
}
diff --git a/pc4mobx/hrmSalary/util/index.js b/pc4mobx/hrmSalary/util/index.js
index 9be126dc..d7c0f815 100644
--- a/pc4mobx/hrmSalary/util/index.js
+++ b/pc4mobx/hrmSalary/util/index.js
@@ -15,6 +15,15 @@ export const getConditionDomkeys = (condition) => {
});
return domkeyList;
};
+// 获取condition的field集合
+export const getConditionFields = (condition) => {
+ return _.reduce(condition, (pre, cur) => {
+ return {
+ ...pre,
+ ..._.reduce(cur.items, (pre1, cur1) => ({ ...pre1, [cur1["domkey"][0]]: cur1 }), {})
+ };
+ }, {});
+};
// 渲染form表单: 一般对form的渲染都统一使用该方法
export const getSearchs = (form, condition, col, isCenter, onChange = () => void (0), title) => {