feature/2.9.42310.02-社保福利档案页面重构

This commit is contained in:
黎永顺 2023-11-07 19:13:38 +08:00
parent 675d583557
commit 8162e02796
4 changed files with 161 additions and 18 deletions

View File

@ -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] || "" });
}
});
});
}
});

View File

@ -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;

View File

@ -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(
<WeaSearchGroup col={c.col} needTigger={true} title={c.title} showGroup={c.defaultshow} items={items}
center={false} multiCol="multiCol"
center={false}
className={c.col === 3 ? "basic-welfare-info-wrapper" : c.col === 2 ? "twoColumns-welfare-info-wrapper" : ""}
/>);
});
return group;

View File

@ -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;
}
}
}
}