From 8162e0279692572eb06bde519193d63a0fd0031d 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, 7 Nov 2023 19:13:38 +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 | 40 ++++++++- .../components/welfareTableList/index.js | 17 +++- .../welfareArchive/config.js | 88 ++++++++++++++++++- .../welfareArchive/index.less | 34 ++++--- 4 files changed, 161 insertions(+), 18 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareEditArchiveSlide/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareEditArchiveSlide/index.js index 8a3a9a88..d5611b1d 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareEditArchiveSlide/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareEditArchiveSlide/index.js @@ -8,7 +8,9 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { WeaLocaleProvider, WeaSlideModal, WeaTools } from "ecCom"; import * as API from "../../../../../apis/welfareArchive"; +import { getTaxAgentSelectList } from "../../../../../apis/taxAgent"; import { getWelfareSearchsForm, welfareConditions } from "../../config"; +import { getConditionDomkeys } from "../../../../../util"; import { Button } from "antd"; const getKey = WeaTools.getKey; @@ -35,9 +37,10 @@ class Index extends Component { } } - getBaseForm = (props) => { - const { employeeId, paymentOrganization, welfareTypeEnum } = props; - const payload = { employeeId, paymentOrganization, welfareTypeEnum }; + getBaseForm = async (props) => { + const { data: taxAgentList } = await getTaxAgentSelectList(); + const { employeeId, paymentOrganization, socialItems } = props; + const payload = { employeeId, paymentOrganization, welfareTypeEnum: "" }; API.getBaseForm(payload).then(({ status, data }) => { if (status) { const { data: result } = data; @@ -50,6 +53,30 @@ class Index extends Component { return { ...g, label: getLabel(g.lanId, g.label) }; }) }; + } else if (o.title === "taxAgent") { + return { + ...o, title: getLabel(537996, "个税扣缴义务人"), + items: _.map(o.items, g => { + return { + ...g, label: getLabel(g.lanId, g.label), + options: _.map(taxAgentList, j => ({ key: j.id, showname: j.content })) + }; + }) + }; + } else if (o.title === "social") { + console.log(props); + return { + ...o, title: getLabel(543194, "社保基础信息"), + items: _.map(o.items, g => { + if (getKey(g) === "socialSchemeId" || getKey(g) === "underTake") { + return { + ...g, label: getLabel(g.lanId, g.label), + options: _.find(socialItems, j => j.domkey[0] === getKey(g)).options + }; + } + return { ...g, label: getLabel(g.lanId, g.label) }; + }) + }; } return { ...o, items: _.map(o.items, g => { @@ -61,6 +88,13 @@ class Index extends Component { const { archivesStore: { welfareProfileForm } } = props; console.log(this.state.conditions); welfareProfileForm.initFormFields(this.state.conditions); + _.map(getConditionDomkeys(this.state.conditions), k => { + if (k === "paymentOrganization") { + welfareProfileForm.updateFields({ [k]: paymentOrganization.toString() }); + } else { + welfareProfileForm.updateFields({ [k]: result[k] || "" }); + } + }); }); } }); diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js index bdaabe71..b3532e91 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js @@ -10,6 +10,7 @@ import { WeaLoadingGlobal, WeaLocaleProvider } from "ecCom"; import { message, Modal, Spin } from "antd"; import WelfareEditArchiveSlide from "../welfareEditArchiveSlide"; import * as API from "../../../../../apis/welfareArchive"; +import { welfareTypeEnum } from "../../config"; const getLabel = WeaLocaleProvider.getLabel; const APILIST = { @@ -80,10 +81,19 @@ class Index extends Component { break; case "EDIT": case "VIEW": + const payload = { employeeId, paymentOrganization }; + const [socialItems, fundItems, othersItems] = await Promise.all([ + this.getProfileTypeForm({ ...payload, welfareTypeEnum: welfareTypeEnum["social"] }), + this.getProfileTypeForm({ ...payload, welfareTypeEnum: welfareTypeEnum["fund"] }), + this.getProfileTypeForm({ ...payload, welfareTypeEnum: welfareTypeEnum["others"] }) + ]); this.setState({ welfareEditSlide: { ...this.state.welfareEditSlide, visible: true, - employeeId, paymentOrganization + employeeId, paymentOrganization, + socialItems: socialItems.data.items[0].items, + fundItems: fundItems.data.items[0].items, + othersItems: othersItems.data.items[0].items } }); break; @@ -108,6 +118,11 @@ class Index extends Component { } } }; + getProfileTypeForm = async (props) => { + const { employeeId, paymentOrganization, welfareTypeEnum } = props; + const payload = { employeeId, paymentOrganization, welfareTypeEnum }; + return API.getBaseForm(payload); + }; getWelfareList = (props) => { const { pageInfo } = this.state; const { archivesStore: { welfareForm }, runStatuses, onChangeTopTabCount, showOperateBtn } = props; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/config.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/config.js index f191cba4..daf8b50e 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/config.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/config.js @@ -429,6 +429,91 @@ export const welfareConditions = [ viewAttr: 1 } ] + }, + { + defaultshow: true, + title: "taxAgent", + col: 1, + items: [ + { + colSpan: 3, + conditionType: "SELECT", + domkey: ["paymentOrganization"], + fieldcol: 16, + label: "个税扣缴义务人", + lanId: 537996, + labelcol: 8, + value: "", + options: [], + viewAttr: 1 + } + ] + }, + { + defaultshow: true, + title: "social", + col: 2, + items: [ + { + colSpan: 3, + conditionType: "SELECT", + domkey: ["socialSchemeId"], + fieldcol: 14, + label: "社保方案名称", + lanId: 111, + labelcol: 10, + value: "", + options: [], + viewAttr: 2 + }, + { + colSpan: 3, + conditionType: "SELECT", + domkey: ["underTake"], + fieldcol: 14, + label: "社保个人实际承担方", + lanId: 111, + labelcol: 10, + value: "", + options: [], + viewAttr: 2 + }, + { + colSpan: 3, + conditionType: "MONTHPICKER", + domkey: ["socialStartTime"], + fieldcol: 14, + label: "社保起始缴纳月", + lanId: 542507, + labelcol: 10, + value: "", + options: [], + viewAttr: 2 + }, + { + colSpan: 3, + conditionType: "INPUT", + domkey: ["schemeAccount"], + fieldcol: 14, + label: "社保账号", + lanId: 81594, + labelcol: 10, + value: "", + viewAttr: 2 + }, + { + colSpan: 3, + conditionType: "MONTHPICKER", + domkey: ["socialEndTime"], + fieldcol: 14, + label: "社保最后缴纳月", + lanId: 542508, + labelcol: 10, + value: "", + options: [], + viewAttr: 2 + } + ] } ]; export const getWelfareSearchsForm = (form, condition, onSearch = () => void (0)) => { @@ -453,7 +538,8 @@ export const getWelfareSearchsForm = (form, condition, onSearch = () => void (0) }); group.push( ); }); return group; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/index.less b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/index.less index 8d9e0c5e..1ae8b8c6 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/index.less +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/index.less @@ -155,30 +155,38 @@ overflow-y: auto; padding: 16px; + .basic-welfare-info-wrapper { + .wea-form-cell-wrapper { + & > div:nth-child(1), & > div:nth-child(2) { + border-right: 1px solid #e5e5e5; + border-bottom: 1px solid #e5e5e5; + } + + & > div:nth-child(3) { + border-bottom: 1px solid #e5e5e5; + } + + & > div:nth-child(4), & > div:nth-child(5) { + border-right: 1px solid #e5e5e5; + } + } + } + .wea-search-group, .wea-form-cell { padding: 0; .wea-form-item { padding: 5px 16px; + + .wea-form-item-label { + color: #666; + } } } .wea-form-cell-wrapper { background: #FFF; border: 1px solid #e5e5e5; - - & > div:nth-child(1), & > div:nth-child(2) { - border-right: 1px solid #e5e5e5; - border-bottom: 1px solid #e5e5e5; - } - - & > div:nth-child(3) { - border-bottom: 1px solid #e5e5e5; - } - - & > div:nth-child(4), & > div:nth-child(5) { - border-right: 1px solid #e5e5e5; - } } } }