多语言bug

This commit is contained in:
黎永顺 2024-04-02 17:45:59 +08:00
parent 75bb200e9d
commit 342aeed953
15 changed files with 96 additions and 42 deletions

View File

@ -62,7 +62,8 @@ class Index extends Component {
conditions: _.map(salaryFilesConditions, o => {
if (o.salaryFile) {
return {
...o, items: _.map(adjustSalaryItems, g => {
...o, title: getLabel(o.lanId, o.title), titleHelpful: getLabel(o.titleHelpfulLanId, o.titleHelpful),
items: _.map(adjustSalaryItems, g => {
const otherParams = g.dataType === "number" ? { precision: g.pattern } : {};
return {
colSpan: 3, fieldcol: 14, label: g.name, labelcol: 10, ...otherParams,
@ -73,7 +74,7 @@ class Index extends Component {
};
}
return {
...o, items: _.map(o.items, g => {
...o, title: getLabel(o.lanId, o.title), items: _.map(o.items, g => {
if (getKey(g) === "payStartDate") {
return {
...g, label: getLabel(g.lanId, g.label),

View File

@ -43,11 +43,11 @@ export const tabCondition = [
}
];
export const tabList = [
{ viewcondition: "pending", title: getLabel(542689, "待定薪"), showcount: true, groupid: "PENDING" },
{ viewcondition: "fixed", title: getLabel(544638, "发薪员工"), showcount: true, groupid: "FIXED" },
{ viewcondition: "suspend", title: getLabel(542691, "待停薪"), showcount: true, groupid: "SUSPEND" },
{ viewcondition: "stop", title: getLabel(544637, "停薪员工"), showcount: true, groupid: "STOP" },
{ viewcondition: "ext", title: getLabel(542679, "非系统人员"), showcount: true, groupid: "EXT" }
{ viewcondition: "pending", title: "待定薪", lanId: 542689, showcount: true, groupid: "PENDING" },
{ viewcondition: "fixed", title: "发薪员工", lanId: 544638, showcount: true, groupid: "FIXED" },
{ viewcondition: "suspend", title: "待停薪", lanId: 542691, showcount: true, groupid: "SUSPEND" },
{ viewcondition: "stop", title: "停薪员工", lanId: 544637, showcount: true, groupid: "STOP" },
{ viewcondition: "ext", title: "非系统人员", lanId: 542679, showcount: true, groupid: "EXT" }
];
export const renderReqBtns = (selectedKey, salaryImportTypes, onSalaryOpts, showOperateBtn) => {
let reqBtns = [
@ -367,7 +367,7 @@ export const salaryFileSearchConditions = [
export const salaryFilesConditions = [
{
defaultshow: true, title: getLabel(1361, "基本信息"),
col: 3,
col: 3, lanId: 1361,
items: [
{
colSpan: 3,
@ -439,7 +439,7 @@ export const salaryFilesConditions = [
},
{
defaultshow: true, title: getLabel(543329, "发薪设置"),
col: 1,
col: 1,lanId: 543329,
items: [
{
colSpan: 1,
@ -469,7 +469,8 @@ export const salaryFilesConditions = [
{
defaultshow: true, title: getLabel(538004, "薪资档案"),
titleHelpful: getLabel(543330, "提示:显示已生效的最新数据"),
col: 2, salaryFile: true,
titleHelpfulLanId: 543330,
col: 2, salaryFile: true,lanId: 538004,
items: []
}
];

View File

@ -242,6 +242,7 @@ class SalaryFiles extends Component {
salaryFileImpDialog, salaryImportTypes, logDialogVisible, filterConditions
} = this.state;
const { taxAgentStore: { showOperateBtn } } = this.props;
const tabs = _.map(tabList, o => ({ ...o, title: getLabel(o.lanId, o.title) }));
return (
<div className="salary-files-wrapper">
<WeaReqTop
@ -251,7 +252,7 @@ class SalaryFiles extends Component {
buttons={renderReqBtns(selectedKey, salaryImportTypes, this.handleReqBtnsCLick, showOperateBtn)}
replaceTab={
<WeaTab
datas={!showExtEmpsWitch ? _.dropRight(tabList) : tabList} autoCalculateWidth
datas={!showExtEmpsWitch ? _.dropRight(tabs) : tabs} autoCalculateWidth
keyParam="viewcondition" selectedKey={selectedKey} counts={topTabCount} countParam="groupid"
onChange={key => this.setState({ selectedKey: key })}
/>

View File

@ -106,6 +106,7 @@
.wea-select .wdb {
word-break: break-all !important;
word-wrap: break-word !important;
white-space: nowrap !important;
}
.wea-select .wea-select-input {

View File

@ -139,6 +139,7 @@
.wea-select .wdb {
word-break: break-all !important;
word-wrap: break-word !important;
white-space: nowrap !important;
}
.wea-select .wea-select-input {

View File

@ -104,6 +104,7 @@
.wea-select .wdb {
word-break: break-all !important;
word-wrap: break-word !important;
white-space: nowrap !important;
}
.wea-select .wea-select-input {

View File

@ -54,11 +54,11 @@ export const optTypeEnum = [
}
];
export const tabList = [
{ viewcondition: "1", title: getLabel(542711, "待增员"), showcount: true, groupid: "stayAdd" },
{ viewcondition: "2,3", title: getLabel(542504, "在缴员工"), showcount: true, groupid: "paying" },
{ viewcondition: "3", title: getLabel(542713, "待减员"), showcount: true, groupid: "stayDel" },
{ viewcondition: "4,5", title: getLabel(542505, "停缴员工"), showcount: true, groupid: "stopPay" },
{ viewcondition: "ext", title: getLabel(542679, "非系统人员"), showcount: true, groupid: "ext" }
{ viewcondition: "1", title: "待增员", lanId: 542711, showcount: true, groupid: "stayAdd" },
{ viewcondition: "2,3", title: "在缴员工", lanId: 542504, showcount: true, groupid: "paying" },
{ viewcondition: "3", title: "待减员", lanId: 542713, showcount: true, groupid: "stayDel" },
{ viewcondition: "4,5", title: "停缴员工", lanId: 542505, showcount: true, groupid: "stopPay" },
{ viewcondition: "ext", title: "非系统人员", lanId: 542679, showcount: true, groupid: "ext" }
];
export const welfareTipList = [
{
@ -143,7 +143,7 @@ export const renderDropMenuDatas = (selectedKey, getLabel, showOperateBtn) => {
key: "record",
icon: <i className="iconfont icon-caozuorizhi32"/>,
content: getLabel(111, "基数调整记录")
},{
}, {
key: "log",
icon: <i className="iconfont icon-caozuorizhi32"/>,
content: getLabel(545781, "操作日志")

View File

@ -147,6 +147,7 @@ class Index extends Component {
} = this.state;
const { taxAgentStore: { showOperateBtn } } = this.props;
const tipList = _.find(welfareTipList, o => o.viewcondition === selectedKey).list;
const tabs = _.map(tabList, o => ({ ...o, title: getLabel(o.lanId, o.title) }));
return (
<div className="salary-welfare-archive">
<WeaReqTop
@ -156,7 +157,7 @@ class Index extends Component {
buttons={renderReqBtns(selectedKey, getLabel, this.handleOpenAdvanceSearch, this.handleAdvanceSearch, this.onDropMenuClick, showOperateBtn)}
replaceTab={
<WeaTab
datas={!showExtEmpsWitch ? _.dropRight(tabList) : tabList} autoCalculateWidth
datas={!showExtEmpsWitch ? _.dropRight(tabs) : tabs} autoCalculateWidth
keyParam="viewcondition" selectedKey={selectedKey} counts={topTabCount} countParam="groupid"
onChange={key => this.setState({ selectedKey: key })}
/>

View File

@ -5,12 +5,13 @@
* Date: 2024/2/2
*/
import React, { Component } from "react";
import { WeaLocaleProvider } from "ecCom";
import { WeaLocaleProvider, WeaTools } from "ecCom";
import { Button } from "antd";
import { inject, observer } from "mobx-react";
import { getSearchs } from "../../../../../util";
import { searchConditons } from "../../config";
const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel;
@inject("programmeStore")
@ -27,7 +28,20 @@ class WelfarePlanAdvanceSearchPannel extends Component {
return (
<React.Fragment>
<div className="wea-advanced-searchsAd">
{getSearchs(planSearchForm, searchConditons, 2, false)}
{getSearchs(planSearchForm, _.map(searchConditons, item => ({
...item, title: getLabel(item.lanId, item.title),
items: _.map(item.items, o => {
if (getKey(o) === "paymentTypeEnum") {
return {
...o, label: getLabel(o.lanId, o.label),
options: _.map(o.options, k => ({ ...k, showname: getLabel(k.lanId, k.showname) }))
};
}
return {
...o, label: getLabel(o.lanId, o.label)
};
})
})), 2, false)}
</div>
<div className="wea-search-buttons">
<div style={{ textAlign: "center" }}>

View File

@ -54,7 +54,7 @@ class Index extends Component {
const { programmeStore: { planCopyForm }, conditions } = this.props;
return (
<WeaDialog
{...this.props} style={{ width: 480, height: 46 }} initLoadCss
{...this.props} style={{ width: 480, height: 80 }} initLoadCss
buttons={[
<Button type="primary" onClick={this.save} loading={loading}>{getLabel(537558, "保存")}</Button>
]}

View File

@ -48,15 +48,22 @@ class Index extends Component {
this.setState({
planDatas: schemeDetailList,
conditions: _.map(planConditons, item => ({
...item, items: _.map(item.items, o => {
...item, title: getLabel(item.lanId, item.title),
items: _.map(item.items, o => {
if (getKey(o) === "taxAgentIds") {
return {
...o, hide: schemeBatch["sharedType"] === "0" || _.isNil(schemeBatch["sharedType"]),
viewAttr: (schemeBatch["sharedType"] === "1" && showOperateBtn) ? 3 : showOperateBtn ? o.viewAttr : 1,
options: _.map(result, k => ({ key: k.id, showname: k.content }))
options: _.map(result, k => ({ key: k.id, showname: k.content })),
label: getLabel(o.lanId, o.label)
};
} else if (getKey(o) === "paymentType" || getKey(o) === "sharedType") {
return {
...o, label: getLabel(o.lanId, o.label),
options: _.map(o.options, k => ({ ...k, showname: getLabel(k.lanId, k.showname) }))
};
}
return { ...o, viewAttr: showOperateBtn ? o.viewAttr : 1 };
return { ...o, viewAttr: showOperateBtn ? o.viewAttr : 1, label: getLabel(o.lanId, o.label) };
})
}))
}, () => {

View File

@ -178,12 +178,18 @@ class Index extends Component {
this.setState({
copyDialog: {
visible: true, copyId: id, copyName: `${schemeName}-${getLabel(77, "复制")}`,
title: `${getLabel(77, "复制")}-${_.find(tabWelfarePlanList, o => o.key === selectedKey).title}`,
title: `${getLabel(77, "复制")}-${
getLabel(_.find(tabWelfarePlanList, o => o.key === selectedKey).lanId, _.find(tabWelfarePlanList, o => o.key === selectedKey).title)
}`,
conditions: welfarePlanCopyConditions[selectedKey]
}
}, () => {
const { copyDialog: { conditions, copyName } } = this.state;
planCopyForm.initFormFields(conditions);
planCopyForm.initFormFields(_.map(conditions, item => ({
...item, items: _.map(item.items, o => {
return { ...o, label: getLabel(o.lanId, o.label) };
})
})));
planCopyForm.updateFields({ [`${selectedKey}_schemeName`]: { value: copyName } });
});
break;
@ -311,7 +317,9 @@ class Index extends Component {
</div>
{
selectedKey === "CUSTOM" &&
<div className="adapt-right"><TipLabel tipList={welfarePlanCustomTipList}/></div>
<div className="adapt-right">
<TipLabel tipList={_.map(welfarePlanCustomTipList, o => getLabel(o.lanId, o.title))}/>
</div>
}
{/*复制方案*/}
<WelfarePlanCopyDialog {...copyDialog} selectedKey={selectedKey}

View File

@ -7,15 +7,18 @@ const getKey = WeaTools.getKey;
const getLabel = WeaLocaleProvider.getLabel;
export const tabWelfarePlanList = [
{ key: "SOCIAL_SECURITY", title: getLabel(538967, "社保") },
{ key: "ACCUMULATION_FUND", title: getLabel(538969, "公积金") },
{ key: "OTHER", title: getLabel(542717, "企业年金及其他福利") },
{ key: "CUSTOM", title: getLabel(543151, "自定义福利") }
{ key: "SOCIAL_SECURITY", title: "社保", lanId: 538967 },
{ key: "ACCUMULATION_FUND", title: "公积金", lanId: 538969 },
{ key: "OTHER", title: "企业年金及其他福利", lanId: 542717 },
{ key: "CUSTOM", title: "自定义福利", lanId: 543151 }
];
export const welfarePlanCustomTipList = [
getLabel(544345, "1、可以为社保、公积金、企业年金及其他福利新增自定义的福利项残疾保险等"),
getLabel(544346, "2、新增自定义福利默认启用社保福利方案中的自定义福利项均未开启缴纳当前页面的自定义福利项才可以停用停用后再新增方案时没有该福利项"),
getLabel(544347, "3、自定义福利若要缴纳需要在方案里填写缴纳相关数据")
{ lanId: 544345, title: "1、可以为社保、公积金、企业年金及其他福利新增自定义的福利项残疾保险等" },
{
lanId: 544346,
title: "2、新增自定义福利默认启用社保福利方案中的自定义福利项均未开启缴纳当前页面的自定义福利项才可以停用停用后再新增方案时没有该福利项"
},
{ lanId: 544347, title: "3、自定义福利若要缴纳需要在方案里填写缴纳相关数据" }
];
/*
* Author: 黎永顺
@ -40,7 +43,7 @@ export const renderReqBtns = (selectedKey, onSalaryOpts, showOperateBtn, customQ
reqBtns[reqBtns.length - 1] = <WeaSelect style={{ width: 220 }} onChange={v => onSalaryOpts("SEARCH", v)}
value={customQuery}
options={[
{ key: "", showname: getLabel(111, "全部"), selected: true },
{ key: "", showname: getLabel(332, "全部"), selected: true },
{ key: "SOCIAL_SECURITY", showname: getLabel(538967, "社保") },
{ key: "ACCUMULATION_FUND", showname: getLabel(538969, "公积金") },
{ key: "OTHER", showname: getLabel(542717, "企业年金及其他福利") }
@ -63,6 +66,7 @@ export const searchConditons = [
fieldcol: 16,
isQuickSearch: true,
label: getLabel(33162, "方案名称"),
lanId: 33162,
labelcol: 8,
value: "",
viewAttr: 2
@ -74,16 +78,18 @@ export const searchConditons = [
fieldcol: 16,
isQuickSearch: true,
label: getLabel(543163, "缴纳类型"),
lanId: 543163,
labelcol: 8,
value: "",
options: [
{ key: "SCHEME_TOWN", showname: getLabel(19702, "城镇") },
{ key: "SCHEME_VILLAGE", showname: getLabel(19703, "农村") }
{ key: "SCHEME_TOWN", showname: getLabel(19702, "城镇"), lanId: 19702 },
{ key: "SCHEME_VILLAGE", showname: getLabel(19703, "农村"), lanId: 19703 }
],
viewAttr: 2
}
],
title: getLabel(82743, "基础信息"),
lanId: 82743,
defaultshow: true
}
];
@ -96,6 +102,7 @@ export const welfarePlanCopyConditions = {
domkey: ["SOCIAL_SECURITY_schemeName"],
fieldcol: 16,
label: getLabel(111, "社保名称"),
lanId: 111,
labelcol: 8,
value: "",
rules: "required|string",
@ -115,6 +122,7 @@ export const welfarePlanCopyConditions = {
domkey: ["ACCUMULATION_FUND_schemeName"],
fieldcol: 16,
label: getLabel(111, "公积金名称"),
lanId: 111,
labelcol: 8,
value: "",
rules: "required|string",
@ -134,6 +142,7 @@ export const welfarePlanCopyConditions = {
domkey: ["OTHER_schemeName"],
fieldcol: 16,
label: getLabel(111, "企业年金及其他福利名称"),
lanId: 111,
labelcol: 8,
value: "",
rules: "required|string",
@ -154,10 +163,11 @@ export const planConditons = [
domkey: ["paymentType"],
fieldcol: 14,
label: getLabel(543163, "缴纳类型"),
lanId: 543163,
labelcol: 6,
options: [
{ key: "SCHEME_TOWN", showname: getLabel(19702, "城镇") },
{ key: "SCHEME_VILLAGE", showname: getLabel(19703, "农村") }
{ key: "SCHEME_TOWN", showname: getLabel(19702, "城镇"), lanId: 19702 },
{ key: "SCHEME_VILLAGE", showname: getLabel(19703, "农村"), lanId: 19703 }
],
value: "SCHEME_TOWN",
rules: "required|string",
@ -168,6 +178,7 @@ export const planConditons = [
domkey: ["schemeName"],
fieldcol: 14,
label: getLabel(33162, "方案名称"),
lanId: 33162,
labelcol: 6,
value: "",
rules: "required|string",
@ -178,10 +189,11 @@ export const planConditons = [
domkey: ["sharedType"],
fieldcol: 14,
label: getLabel(543164, "可见性"),
lanId: 543164,
labelcol: 6,
options: [
{ key: "0", showname: getLabel(111, "公共") },
{ key: "1", showname: getLabel(111, "私有") }
{ key: "0", showname: getLabel(111, "公共"), lanId: 111 },
{ key: "1", showname: getLabel(111, "私有"), lanId: 111 }
],
value: "0",
rules: "required|string",
@ -192,6 +204,7 @@ export const planConditons = [
domkey: ["taxAgentIds"],
fieldcol: 14,
label: getLabel(543165, "可见性范围"),
lanId: 543165,
labelcol: 6,
multiple: true,
options: [],
@ -204,12 +217,14 @@ export const planConditons = [
domkey: ["remarks"],
fieldcol: 14,
label: getLabel(536726, "备注"),
lanId: 536726,
labelcol: 6,
value: "",
viewAttr: 2
}
],
title: getLabel(82743, "基础信息"),
lanId: 82743,
defaultshow: true
}
];

View File

@ -13,6 +13,7 @@ import WelfarePlanList from "./components/welfarePlanList";
import LogDialog from "../../../components/logViewModal";
import cs from "classnames";
import "./index.less";
import { tabList } from "../welfareArchive/config";
const getLabel = WeaLocaleProvider.getLabel;
@ -64,12 +65,13 @@ class Index extends Component {
render() {
const { taxAgentStore: { showOperateBtn } } = this.props;
const { logDialogVisible, filterConditions, selectedKey, showSearchAd, isQuery, customQuery } = this.state;
const tabs = _.map(tabWelfarePlanList, o => ({ ...o, title: getLabel(o.lanId, o.title) }));
return (
<div className="salary-welfare-plan-wrapper">
<WeaReqTop
title={getLabel(538000, "社保福利方案")} buttonSpace={10} icon={<i className="icon-coms-fa"/>}
iconBgcolor="#F14A2D" showDropIcon dropMenuDatas={renderDropMenuDatas(selectedKey, showOperateBtn)}
onDropMenuClick={this.onDropMenuClick} tabDatas={tabWelfarePlanList} selectedKey={selectedKey}
onDropMenuClick={this.onDropMenuClick} tabDatas={tabs} selectedKey={selectedKey}
onChange={selectedKey => this.setState({ selectedKey, showSearchAd: false, customQuery: "" })}
buttons={renderReqBtns(selectedKey, this.handleReqBtnsCLick, showOperateBtn, customQuery)}
>

View File

@ -210,6 +210,7 @@
.wea-select .wdb {
word-break: break-all !important;
word-wrap: break-word !important;
white-space: nowrap !important;
}
.wea-select .wea-select-input {