From 7c4e2f5588f80ab22aa847a48737cb04388fbc09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 14 Feb 2023 14:32:02 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A4=BE=E4=BF=9D=E7=A6=8F=E5=88=A9=E6=A1=A3?= =?UTF-8?q?=E6=A1=88=E6=96=B0=E5=A2=9E=E7=BC=96=E8=BE=91=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../archives/index.less | 4 + .../archives/socialSecurityForm.js | 84 +++++++++++++++---- 2 files changed, 74 insertions(+), 14 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.less index 8b29b6ef..348327f9 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.less +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/index.less @@ -12,6 +12,10 @@ padding: 4px 16px; border-bottom: 1px solid #e5e5e5; border-right: 1px solid #e5e5e5; + + .wea-form-item { + padding: 0; + } } } } diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js index bc0c538f..d1f69780 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/archives/socialSecurityForm.js @@ -1,6 +1,7 @@ import React from "react"; -import { WeaCheckbox, WeaSearchGroup } from "ecCom"; +import { WeaCheckbox, WeaDatePicker, WeaFormItem, WeaInput, WeaSearchGroup, WeaSelect } from "ecCom"; import { inject, observer } from "mobx-react"; +import { toJS } from "mobx"; import "./index.less"; @inject("archivesStore") @@ -46,27 +47,58 @@ export default class SocialSecurityForm extends React.Component { render() { const { archivesStore: { socialSecurityForm, socialSecurityPaymentForm } } = this.props; - const { items } = socialSecurityForm; + const { items, data: socialData } = socialSecurityForm; let baseData = socialSecurityForm.data; let paymentData = socialSecurityPaymentForm.data; let paymentItems = socialSecurityPaymentForm.items; // Integer数据转为string - let data = { ...baseData }; - if (!_.isNil(data)) { - Object.keys(data).map(key => { - if (!_.isNil(data[key])) { - data[key] = data[key].toString(); - } - }); - } - const { nonPayment } = data; - console.log(baseData, data); + // 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 = "" } = socialData || {}; + const socialItems = !_.isNil(toJS(items)) ? [ + ..._.map(_.filter(toJS(items)[0].items, it => it.domkey[0] !== "paymentOrganization"), + item => ({ + com: SocialSelect({ + label: item.label, + value: !_.isNil(socialData[item["domkey"][0]]) ? socialData[item["domkey"][0]].toString() : "", + options: item.options, + onChange: this.handleFormChange + }) + })), + { + com: SocialDatePicker({ + label: "社保起始缴纳月", + value: socialStartTime, + onChange: this.handleFormChange + }) + }, + { + com: SocialEditInput({ + label: "社保账号", + value: schemeAccount, + onChange: this.handleFormChange + }) + }, + { + com: SocialDatePicker({ + label: "社保最后缴纳月", + value: socialEndTime, + onChange: this.handleFormChange + }) + } + ] : []; return (