From 2c7633b0c9d584fd3fb9049402803a285bac7fbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Mon, 27 Nov 2023 15:29:07 +0800 Subject: [PATCH] =?UTF-8?q?feature/2.9.42310.02-=E7=A4=BE=E4=BF=9D?= =?UTF-8?q?=E7=A6=8F=E5=88=A9=E6=A1=A3=E6=A1=88=E9=A1=B5=E9=9D=A2=E9=87=8D?= =?UTF-8?q?=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../welfareEditArchiveSlide/index.js | 35 +++++++++++++++++-- .../components/welfareTableList/index.js | 3 ++ .../welfareArchive/config.js | 12 +++++-- .../welfareArchive/index.less | 6 ++++ pc4mobx/hrmSalary/util/index.js | 9 +++++ 5 files changed, 60 insertions(+), 5 deletions(-) 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) => {