this.setState({ Welfare })}
+ onBlurChange={this.handleChangeWelfare}/>}
title={title} col={2} showGroup
/>;
})
@@ -118,12 +168,14 @@ export default class SocialSecurityForm extends React.Component {
}
}
export const ConsistentWelfare = (props) => {
- const { value, onChange, key } = props;
+ const { onChange, onBlurChange, value } = props;
return
各项福利基数一致:
onChange({ key, value: val })}
+ style={{ width: 100 }}
+ onBlur={onBlurChange}
+ value={value}
+ onChange={onChange}
precision={2}
/>
;
@@ -147,10 +199,15 @@ export const SocialEditInput = (props) => {
);
};
export const SocialInputNumber = (props) => {
- const { key, value, onChange, label, labelColSpan = 12, wrapperColSpan = 12 } = props;
+ const { key, value, onChange, label, min, max, labelColSpan = 12, wrapperColSpan = 12 } = props;
+ const minNum = !_.isNil(min) ? Number(min) : 0, maxNum = !_.isNil(max) ? Number(max) : 0;
return (
- onChange({ key, value: val })} min={0} precision={2}/>
+ onChange({ key, value: val })} precision={2}
+ min={minNum > 0 ? minNum : -999999999999999}
+ max={maxNum > 0 ? maxNum : 999999999999999}
+ />
);
};
diff --git a/pc4mobx/hrmSalary/stores/archives.js b/pc4mobx/hrmSalary/stores/archives.js
index 02548e9b..db21b4e2 100644
--- a/pc4mobx/hrmSalary/stores/archives.js
+++ b/pc4mobx/hrmSalary/stores/archives.js
@@ -1,4 +1,4 @@
-import { action, observable } from "mobx";
+import { action, observable, toJS } from "mobx";
import { message } from "antd";
import { WeaForm, WeaTableNew } from "comsMobx";
import { removePropertyCondition } from "../util/response";
@@ -176,7 +176,7 @@ export class ArchivesStore {
_.map(baseList.items, item => {
obj = {
...obj,
- [item["domkey"][0]]: "0"
+ [item["domkey"][0]]: ""
};
});
}
@@ -207,13 +207,37 @@ export class ArchivesStore {
let paymentForm = "";
if (welfareType === "SOCIAL_SECURITY") {
baseForm = JSON.stringify(this.socialSecurityForm.data);
- paymentForm = this.socialSecurityForm.data.socialSchemeId ? JSON.stringify(this.socialSecurityPaymentForm.data) : "";
+ if (this.socialSecurityForm.data.socialSchemeId) {
+ const socialSecurityPaymentData = toJS(this.socialSecurityPaymentForm).data;
+ const socialSecurityPaymentItems = toJS(this.socialSecurityPaymentForm).items[0].items;
+ const payload = socialSecurityPaymentItems.reduce((pre, cur) => {
+ const { domkey } = cur;
+ return Object.assign(pre, { [domkey[0]]: socialSecurityPaymentData[domkey[0]] ? socialSecurityPaymentData[domkey[0]].toString() : "0" });
+ }, {});
+ paymentForm = JSON.stringify(payload);
+ }
} else if (welfareType === "ACCUMULATION_FUND") {
baseForm = JSON.stringify(this.accumulationFundForm.data);
- paymentForm = this.accumulationFundForm.data.fundSchemeId ? JSON.stringify(this.accumulationFundPaymentForm.data) : "";
+ if (this.accumulationFundForm.data.fundSchemeId) {
+ const accumulationFundPaymentData = toJS(this.accumulationFundPaymentForm).data;
+ const accumulationFundPaymentItems = toJS(this.accumulationFundPaymentForm).items[0].items;
+ const payload = accumulationFundPaymentItems.reduce((pre, cur) => {
+ const { domkey } = cur;
+ return Object.assign(pre, { [domkey[0]]: accumulationFundPaymentData[domkey[0]] ? accumulationFundPaymentData[domkey[0]].toString() : "0" });
+ }, {});
+ paymentForm = JSON.stringify(payload);
+ }
} else if (welfareType === "OTHER") {
baseForm = JSON.stringify(this.otherForm.data);
- paymentForm = this.otherForm.data.otherSchemeId ? JSON.stringify(this.otherPaymentForm.data) : "";
+ if (this.otherForm.data.fundSchemeId) {
+ const otherPaymentData = toJS(this.otherPaymentForm).data;
+ const otherPaymentItems = toJS(this.otherPaymentForm).items[0].items;
+ const payload = otherPaymentItems.reduce((pre, cur) => {
+ const { domkey } = cur;
+ return Object.assign(pre, { [domkey[0]]: otherPaymentData[domkey[0]] ? otherPaymentData[domkey[0]].toString() : "0" });
+ }, {});
+ paymentForm = JSON.stringify(payload);
+ }
}
return new Promise((resolve, reject) => {
API.save({ welfareType, baseForm, paymentForm }).then(res => {