From a7daf5e3c0a5922aab250c49fd262b8904235ca1 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, 3 Jan 2023 16:46:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E7=BC=B4=E6=96=B0=E5=A2=9E=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/businessAccounting.js | 64 +++++++++ .../standingBookDetail/components/index.less | 33 +++++ .../components/inputPaymentAmount.js | 82 +++++++++++ .../components/supplementarySlide.js | 133 +++++++++++++++++- 4 files changed, 307 insertions(+), 5 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/businessAccounting.js create mode 100644 pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/inputPaymentAmount.js diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/businessAccounting.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/businessAccounting.js new file mode 100644 index 00000000..d3f9f281 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/businessAccounting.js @@ -0,0 +1,64 @@ +/* + * Author: 黎永顺 + * name: 按补缴人员的历史月份核算基数和当前档案方案核算 + * Description: + * Date: 2023/1/3 + */ +import React, { Component } from "react"; +import { WeaInputNumber, WeaSearchGroup } from "ecCom"; +import "./index.less"; + +class BusinessAccounting extends Component { + renderBaseItem = (dataSource = [], type) => { + return ; + }; + handleChangeBaseItem = (item, value, type) => { + const { onChangeBaseItem, socialSecurityBase, fundBase, otherBase } = this.props; + _.map(this.props[type], it => { + if (item.insuranceId === it.insuranceId) { + it.insuranceBase = value; + } + }); + onChangeBaseItem(socialSecurityBase, fundBase, otherBase); + }; + + render() { + const { socialSecurityBase, fundBase, otherBase } = this.props; + return ( +
+ { + !_.isEmpty(socialSecurityBase) && + {this.renderBaseItem(socialSecurityBase, "socialSecurityBase")} + } + { + !_.isEmpty(fundBase) && + {this.renderBaseItem(fundBase, "fundBase")} + } + { + !_.isEmpty(otherBase) && + {this.renderBaseItem(otherBase, "otherBase")} + } +
+ ); + } +} + +export default BusinessAccounting; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less index 492bdaf8..3a60edf1 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/index.less @@ -114,6 +114,10 @@ text-align: left; } + .wea-slide-modal-title + div { + padding-bottom: 70px !important; + } + .rodal-close { z-index: 99; top: 10px !important; @@ -145,3 +149,32 @@ } } } + +//补缴新增 +.baseFieldItemWrapper { + border: 1px solid #e5e5e5; + border-bottom: none; + + & > li { + border-bottom: 1px solid #e5e5e5; + padding: 5px 16px; + display: flex; + align-items: center; + + & > div:first-child { + width: 25%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + color: #666; + } + + & > div:last-child { + flex: 1; + + .wea-input-number { + width: 20% !important; + } + } + } +} diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/inputPaymentAmount.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/inputPaymentAmount.js new file mode 100644 index 00000000..ea62431c --- /dev/null +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/inputPaymentAmount.js @@ -0,0 +1,82 @@ +/* + * Author: 黎永顺 + * name: 手动输入补缴金额 + * Description: + * Date: 2023/1/3 + */ +import React, { Component } from "react"; +import { WeaInputNumber, WeaSearchGroup, WeaTable } from "ecCom"; + +class InputPaymentAmount extends Component { + + renderInputItem = (dataSource = [], type) => { + const columns = [ + { + dataIndex: "insuranceName", title: "福利项" + }, + { + dataIndex: "per", title: "个人缴纳金额", + render: (text, record) => { + return ( + this.handleChangeBaseItem(record, val, type, "per")} + /> + ); + } + }, + { + dataIndex: "com", title: "单位缴纳金额", + render: (text, record) => { + return ( + this.handleChangeBaseItem(record, val, type, "com")} + /> + ); + } + } + ]; + return ; + }; + handleChangeBaseItem = (item, value, type, paymentType) => { + const { onChangeInputItem, socialPayment, fundPayment, otherPayment } = this.props; + _.map(this.props[type], it => { + const key = `${it.insuranceId}_${paymentType}`; + if (item.insuranceId === it.insuranceId) { + _.assign(it, { [key]: value }); + } + }); + onChangeInputItem(socialPayment, fundPayment, otherPayment); + }; + + render() { + const { socialPayment, fundPayment, otherPayment } = this.props; + return ( +
+ { + !_.isEmpty(socialPayment) && + {this.renderInputItem(socialPayment, "socialPayment")} + } + { + !_.isEmpty(fundPayment) && + {this.renderInputItem(fundPayment, "fundPayment")} + } + { + !_.isEmpty(otherPayment) && + {this.renderInputItem(otherPayment, "otherPayment")} + } +
+ ); + } +} + +export default InputPaymentAmount; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/supplementarySlide.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/supplementarySlide.js index 25c34933..bb41a849 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/supplementarySlide.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBookDetail/components/supplementarySlide.js @@ -13,6 +13,8 @@ import { Picker, SelectWithAll } from "./regAddEmployee"; import { Browser } from "../../../dataAcquisition/addItems"; import { getPaymentGroup, getSupplementPaymentForm, siaccountSupplementarySave } from "../../../../apis/standingBook"; import "./index.less"; +import BusinessAccounting from "./businessAccounting"; +import InputPaymentAmount from "./inputPaymentAmount"; @inject("taxAgentStore") @observer @@ -29,10 +31,88 @@ class SupplementarySlide extends Component { projects: "", billMonthList: "", historyMonth: "" + }, + businessAccounting: { + socialSecurityBase: [], + fundBase: [], + otherBase: [] + }, + inputPaymentAmount: { + socialPayment: [], + fundPayment: [], + otherPayment: [] } }; } + /* + * Author: 黎永顺 + * Description: 按补缴人员的历史月份核算基数和当前档案方案核算 数据转换 + * Params: socialSecurityBase fundBase otherBase + * Date: 2023/1/3 + */ + convertBusinessAccounting = () => { + let payload = { socialPaymentBaseString: {}, fundPaymentBaseString: {}, otherPaymentBaseString: {} }; + const { businessAccounting } = this.state; + _.map(Object.keys(businessAccounting), item => { + _.map(businessAccounting[item], child => { + const key = child.insuranceId, value = child.insuranceBase; + _.assign( + payload[item === "socialSecurityBase" ? "socialPaymentBaseString" : item === "fundBase" ? "fundPaymentBaseString" : "otherPaymentBaseString"], + { [key]: value ? value.toString() : "" } + ); + }); + }); + for (let i in payload) { + _.assign(payload, { [i]: JSON.stringify(payload[i]) }); + } + return payload; + }; + /* + * Author: 黎永顺 + * Description: 动输入补缴金额数据整改 + * Params: + * Date: 2023/1/3 + */ + convertInputPaymentAmount = () => { + let payload = { + socialPaymentPerString: {}, + socialPaymentComString: {}, + fundPaymentPerString: {}, + fundPaymentComString: {}, + otherPaymentPerString: {}, + otherPaymentComString: {} + }; + const { inputPaymentAmount } = this.state; + _.map(Object.keys(inputPaymentAmount), item => { + _.map(inputPaymentAmount[item], child => { + const key = child.insuranceId, valuePer = child[`${child.insuranceId}_per`], + valueCom = child[`${child.insuranceId}_com`]; + _.assign(payload[`${item}PerString`], { [key]: valuePer ? valuePer.toString() : "" }); + _.assign(payload[`${item}ComString`], { [key]: valueCom ? valueCom.toString() : "" }); + }); + }); + for (let i in payload) { + _.assign(payload, { [i]: JSON.stringify(payload[i]) }); + } + return payload; + }; + convertData = (dataSource) => { + let endList = []; + _.values(_.groupBy(dataSource, "insuranceName")).forEach((itemList) => { + let data = {}; + itemList.forEach(d => { + const perKey = `${d.insuranceId}_per`, comKey = `${d.insuranceId}_com`; + data = _.assign(data, { + ...d, + [perKey]: "", + [comKey]: "" + }); + }); + return endList.push(data); + }); + return endList; + }; handleSaveSupplementSalary = () => { const { billMonth, paymentOrganization, onCancel } = this.props; const { baseInfo } = this.state; @@ -50,7 +130,9 @@ class SupplementarySlide extends Component { billMonth, paymentOrganization, billMonthList: billMonthList.split(","), - includes: includes.split(",") + includes: includes.split(","), + ...this.convertBusinessAccounting(), + ...this.convertInputPaymentAmount() }; this.setState({ loading: true }); siaccountSupplementarySave(payload).then(({ status, errormsg }) => { @@ -72,6 +154,11 @@ class SupplementarySlide extends Component { projectsAll: "", projects: "", billMonthList: "" + }, + businessAccounting: { + socialSecurityBase: [], + fundBase: [], + otherBase: [] } }); }; @@ -89,7 +176,13 @@ class SupplementarySlide extends Component { }; getSupplementPaymentForm(payload).then(({ status, data, errormsg }) => { if (status) { - + this.setState({ + businessAccounting: { + socialSecurityBase: _.filter(data, it => it.title === "社保"), + fundBase: _.filter(data, it => it.title === "公积金"), + otherBase: _.filter(data, it => it.title === "企业年金及其它福利") + } + }); } else { message.error(errormsg || ""); } @@ -102,16 +195,36 @@ class SupplementarySlide extends Component { employeeId: Number(includes), projects: projectsAll ? projectsAll.split(",").concat(projects.split(",")) : projects.split(",") }; - getPaymentGroup(payload).then((status, data) => { - console.log(data); + getPaymentGroup(payload).then(({ status, data, errormsg }) => { + if (status) { + this.setState({ + inputPaymentAmount: { + socialPayment: this.convertData(_.filter(data, it => it.title === "社保")), + fundPayment: this.convertData(_.filter(data, it => it.title === "公积金")), + otherPayment: this.convertData(_.filter(data, it => it.title === "企业年金及其它福利")) + } + }); + } else { + message.error(errormsg || ""); + } }); } } }; + handleChangeBaseFieldItem = (socialSecurityBase, fundBase, otherBase) => { + this.setState({ + businessAccounting: { socialSecurityBase, fundBase, otherBase } + }); + }; + handleChangeInputItem = (socialPayment, fundPayment, otherPayment) => { + this.setState({ + inputPaymentAmount: { socialPayment, fundPayment, otherPayment } + }); + }; render() { const { title, visible, onCancel, taxAgentStore: { showOperateBtn } } = this.props; - const { baseInfo, loading } = this.state; + const { baseInfo, loading, businessAccounting, inputPaymentAmount } = this.state; const baseItems = [ { com: Browser({ @@ -256,6 +369,16 @@ class SupplementarySlide extends Component { items={baseInfo.supplementType === "2" ? [...baseItems, ...baseExtraItems] : baseItems} showGroup col={1} /> + {/* 按补缴人员的历史月份核算基数和当前档案方案核算 */} + { + baseInfo.supplementType === "2" && + + } + {/* 动输入补缴金额 */} + { + baseInfo.supplementType === "3" && + + } } onClose={() => {