产品-系统多语言·

This commit is contained in:
黎永顺 2023-04-18 16:08:54 +08:00
parent eeb8c3a917
commit a9309d9005
14 changed files with 169 additions and 150 deletions

View File

@ -1,12 +1,14 @@
import React from "react";
import { Button } from "antd";
import { WeaLocaleProvider } from "ecCom";
const getLabel = WeaLocaleProvider.getLabel;
export default class HeaderSet extends React.Component {
render() {
return (
<div style={{ display: "inline-block" }}>
<Button type="default" style={{ marginLeft: "10px", marginRight: "10px" }} onClick={this.props.onSetClick}
loading={this.props.loading}>表头设置</Button>
loading={this.props.loading}>{getLabel(111, "表头设置")}</Button>
{/*<WeaCheckbox style={{marginRight: "10px"}}/>*/}
{/*<WeaHelpfulTip*/}
{/* className="headSetTips"*/}

View File

@ -5,11 +5,11 @@
* LastEditTime: 2022-06-29 10:06:13
*/
import React from "react";
import { WeaCheckbox, WeaDialog, WeaInputSearch } from "ecCom";
import { WeaCheckbox, WeaDialog, WeaInputSearch, WeaLocaleProvider } from "ecCom";
import { Button } from "antd";
import "./index.less";
const getLabel = WeaLocaleProvider.getLabel;
export default class SelectItemModal extends React.Component {
constructor(props) {
super(props);
@ -31,18 +31,18 @@ export default class SelectItemModal extends React.Component {
title, onSearchItemSet, onShowOnlyChecked, children,
onMoreOpts, onSave, ...extra
} = this.props;
const btns = [<Button type="primary" onClick={onSave}>保存</Button>];
const btns = [<Button type="primary" onClick={onSave}>{getLabel(111, "保存")}</Button>];
const moreBtn = {
datas: [
{
key: "recovery",
content: "恢复默认设置",
content: getLabel(111, "恢复默认设置"),
icon: <i className="icon-coms-Flow-setting"/>,
onClick: key => onMoreOpts(key)
},
{
key: "setting",
content: "设为默认设置",
content: getLabel(111, "设为默认设置"),
icon: <i className="icon-coms-Flow-setting"/>,
onClick: key => onMoreOpts(key)
}
@ -51,11 +51,11 @@ export default class SelectItemModal extends React.Component {
const titleComp = <div className="setHeaderWrapper">
<span>{title}</span>
<WeaInputSearch value={searchValue} onChange={searchValue => this.setState({ searchValue })}
placeholder="请输入关键字" style={{ width: 200 }}
placeholder={getLabel(111, "请输入关键字")} style={{ width: 200 }}
onSearch={onSearchItemSet}
/>
</div>;
const bottomLeft = <WeaCheckbox content="只显示已选中字段" onChange={onShowOnlyChecked}/>;
const bottomLeft = <WeaCheckbox content={getLabel(111, "只显示已选中字段")} onChange={onShowOnlyChecked}/>;
return (
<WeaDialog {...extra} hasScroll title={titleComp}
style={{ width: 592, height: 248 }}

View File

@ -5,7 +5,9 @@
* Date: 2023/3/6
*/
import React, { Component } from "react";
import { WeaCheckbox, WeaSearchGroup } from "ecCom";
import { WeaCheckbox, WeaLocaleProvider, WeaSearchGroup } from "ecCom";
const getLabel = WeaLocaleProvider.getLabel;
class SelectItemsWrapper extends Component {
constructor(props) {
@ -19,7 +21,7 @@ class SelectItemsWrapper extends Component {
}
componentDidMount() {
const { dataSource } = this.props
const { dataSource } = this.props;
this.setState({
selectItem: _.map(_.filter(_.reduce(dataSource, (pre, cur) => {
return [...pre, ...cur.items];
@ -59,7 +61,7 @@ class SelectItemsWrapper extends Component {
const value = _.every(items, it => !!it.checked) ? "1" : "0";
return <div className="setGroupWrapper">
<WeaCheckbox content={groupName} value={value} onChange={(val) => onSelectGroupAll(groupId, val)}/>
<span className="checkedtitle">已选择{number}个字段</span>
<span className="checkedtitle">{`${getLabel(111, "已选择")}${number}${getLabel(111, "个字段")}`}</span>
</div>;
};
@ -94,7 +96,7 @@ class SelectItemsWrapper extends Component {
<div className="itemsWrapper">
{
_.isEmpty(items) ?
<span className="empty">暂无数据</span> :
<span className="empty">{getLabel(111, "暂无数据")}</span> :
<ul className="itemContUl">
{
_.map(items, child => {

View File

@ -105,8 +105,6 @@ const Routes = (
/>
</Route>
<Route key="salaryItem" path="salaryItem" component={SalaryItem}/>
{/*系统语言改造截止处*/}
<Route key="salaryFile" path="salaryFile" component={PayrollFiles}/>
<Route
key="dataAcquisition"
@ -118,6 +116,7 @@ const Routes = (
<Route key="attendance" path="attendance" component={Attendance}/>
<Route key="specialAddDeduction" path="specialAddDeduction" component={SpecialAddDeduction}/>
</Route>
{/*系统语言改造截止处*/}
<Route key="ledger" path="ledger" component={Ledger}/>
<Route key="calculate" path="calculate" component={Calculate}/>
<Route

View File

@ -1,66 +1,69 @@
import { WeaLocaleProvider } from "ecCom";
const getLabel = WeaLocaleProvider.getLabel;
export const columns = [
{
title: "姓名",
title: getLabel(111, "姓名"),
dataIndex: "username",
key: "username"
},
{
title: "个税扣缴义务人",
title: getLabel(111, "个税扣缴义务人"),
dataIndex: "ywr",
key: "ywr"
},
{
title: "部门",
title: getLabel(111, "部门"),
dataIndex: "bm",
key: "title"
},
{
title: "手机号",
title: getLabel(111, "手机号"),
dataIndex: "sjh",
key: "sjh"
},
{
title: "工号",
title: getLabel(111, "工号"),
dataIndex: "gh",
key: "gh"
},
{
title: "证件号码",
title: getLabel(111, "证件号码"),
dataIndex: "sfzh",
key: "sfzh"
},
{
title: "入职日期",
title: getLabel(111, "入职日期"),
dataIndex: "rzrq",
key: "rzrq"
},
{
title: "累计子女教育",
title: getLabel(111, "累计子女教育"),
dataIndex: "ljznjy",
key: "ljznjy"
},
{
title: "累计继续教育",
title: getLabel(111, "累计继续教育"),
dataIndex: "ljjxjy",
key: "ljjxjy"
},
{
title: "累计住房贷款利息",
title: getLabel(111, "累计住房贷款利息"),
dataIndex: "ljzfdklx",
key: "ljfdklx"
},
{
title: "累计住房租金",
title: getLabel(111, "累计住房租金"),
dataIndex: "ljzfzj",
key: "ljzfzj"
},
{
title: "累计赡养老人",
title: getLabel(111, "累计赡养老人"),
dataIndex: "ljsylr",
key: "ljsylr"
},
{
title: "操作",
title: getLabel(111, "操作"),
dataIndex: "cz",
key: "cz",
render: (text, record) => {
@ -76,31 +79,31 @@ export const fieldsColumns = [
display: true
},
{
title: "字段名称",
title: getLabel(111, "字段名称"),
dataIndex: "fieldName",
key: "fieldName",
display: true
},
{
title: "来源",
title: getLabel(111, "来源"),
dataIndex: "sourceType",
key: "sourceType",
display: true
},
{
title: "类型",
title: getLabel(111, "类型"),
dataIndex: "fieldType",
key: "fieldType",
display: true
},
{
title: "是否启用",
title: getLabel(111, "是否启用"),
dataIndex: "enableStatus",
key: "enableStatus",
display: true
},
{
title: "备注",
title: getLabel(111, "备注"),
dataIndex: "description",
key: "description",
display: true
@ -115,7 +118,7 @@ export const conditions = [
domkey: ["fieldName"],
fieldcol: 14,
rules: "required|string",
label: "字段名称",
label: getLabel(111, "字段名称"),
labelcol: 6,
value: "",
viewAttr: 3
@ -126,19 +129,19 @@ export const conditions = [
domkey: ["fieldType"],
fieldcol: 14,
isQuickSearch: false,
label: "类型",
label: getLabel(111, "类型"),
labelcol: 6,
valueList:[],
valueList: [],
options: [
{
key: "NUMBER",
selected: true,
showname: "数值"
showname: getLabel(111, "数值")
},
{
key: "TEXT",
selected: false,
showname: "文本"
showname: getLabel(111, "文本")
}
],
rules: "required|string",
@ -149,7 +152,7 @@ export const conditions = [
conditionType: "SWITCH",
domkey: ["enableStatus"],
fieldcol: 14,
label: "是否启用",
label: getLabel(111, "是否启用"),
labelcol: 6,
viewAttr: 3,
rules: "required"
@ -159,7 +162,7 @@ export const conditions = [
conditionType: "INPUT",
domkey: ["description"],
fieldcol: 14,
label: "备注",
label: getLabel(111, "备注"),
labelcol: 6,
value: "",
viewAttr: 2
@ -177,7 +180,7 @@ export const reFrenceConditions = [
domkey: ["salaryYearMonth"],
fieldcol: 18,
rules: "required|string",
label: "薪资所属月",
label: getLabel(111, "薪资所属月"),
labelcol: 6,
value: "",
viewAttr: 3
@ -188,9 +191,9 @@ export const reFrenceConditions = [
domkey: ["salarySobId"],
fieldcol: 18,
isQuickSearch: false,
label: "薪资账套",
label: getLabel(111, "薪资账套"),
labelcol: 6,
valueList:[],
valueList: [],
options: [],
rules: "required|string",
viewAttr: 3
@ -200,7 +203,7 @@ export const reFrenceConditions = [
conditionType: "INPUT",
domkey: ["description"],
fieldcol: 18,
label: "备注",
label: getLabel(111, "备注"),
labelcol: 6,
value: "",
viewAttr: 2

View File

@ -6,13 +6,14 @@
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaDialog } from "ecCom";
import { WeaDialog, WeaLocaleProvider } from "ecCom";
import { Button, message } from "antd";
import { conditions } from "../columns";
import { getSearchs } from "../../../../util";
import { saveAttendanceField } from "../../../../apis/attendance";
import "./index.less";
const getLabel = WeaLocaleProvider.getLabel;
@inject("attendanceStore")
@observer
class AttendanceCustomFieldsModal extends Component {
@ -39,11 +40,11 @@ class AttendanceCustomFieldsModal extends Component {
const payload = form.getFormParams();
saveAttendanceField(payload).then(({ status, errormsg }) => {
if (status) {
message.success("新增成功");
message.success(getLabel(111, "新增成功"));
onCancel();
onRefresh();
} else {
message.error(errormsg || "新增失败");
message.error(errormsg || getLabel(111, "新增失败"));
}
});
} else {
@ -59,7 +60,7 @@ class AttendanceCustomFieldsModal extends Component {
render() {
const { attendanceStore: { form } } = this.props;
const buttons = [
<Button type="primary" onClick={this.handleSubmitFields}>保存</Button>
<Button type="primary" onClick={this.handleSubmitFields}>{getLabel(111, "保存")}</Button>
];
return (
<WeaDialog

View File

@ -5,7 +5,7 @@
* Date: 2023/2/24
*/
import React, { Component } from "react";
import { WeaTable } from "ecCom";
import { WeaTable, WeaLocaleProvider } from "ecCom";
import { message, Modal } from "antd";
import {
deleteAttendance,
@ -28,6 +28,7 @@ import SelectItemsWrapper from "../../../../components/selectItemsModal/selectIt
import AttendanceRefrenceDataModal from "./attendanceRefrenceDataModal";
import AttendanceDataViewSlide from "./attendanceDataViewSlide";
const getLabel = WeaLocaleProvider.getLabel;
class AttendanceDataComp extends Component {
constructor(props) {
super(props);
@ -128,15 +129,15 @@ class AttendanceDataComp extends Component {
};
handleDeleteAttendanceData = ({ id }) => {
Modal.confirm({
title: "信息确认",
content: "确认要删除吗?",
title: getLabel(111, "信息确认"),
content: getLabel(111, "确认要删除吗?"),
onOk: () => {
deleteAttendance([id]).then(({ status, errormsg }) => {
if (status) {
message.success("删除成功");
message.success(getLabel(111, "删除成功"));
this.getAttendanceList();
} else {
message.error(errormsg || "删除失败");
message.error(errormsg || getLabel(111, "删除失败"));
}
});
}
@ -206,7 +207,7 @@ class AttendanceDataComp extends Component {
const { importFormPayload } = this.state;
const { salarySobId, salaryYearMonth } = importFormPayload;
if (!salarySobId || !salaryYearMonth) {
message.warning("请完善导入选项,再下载");
message.warning(getLabel(111, "请完善导入选项,再下载"));
return;
}
window.open(`/api/bs/hrmsalary/attendQuote/downloadTemplate?salaryYearMonth=${salaryYearMonth}&salarySobId=${salarySobId}`);
@ -226,7 +227,7 @@ class AttendanceDataComp extends Component {
this.setState({
fieldSetPayload: {
...fieldSetPayload,
visible: true, title: "导入字段设置",
visible: true, title: getLabel(111, "导入字段设置"),
children: <SelectItemsWrapper
ref={dom => this.setItemRef = dom}
dataSource={data}
@ -256,10 +257,10 @@ class AttendanceDataComp extends Component {
case "recovery":
returnToAttendanceFieldSettingDefault({ sourceType: "IMPORT" }).then(({ status, errormsg }) => {
if (status) {
message.success("操作成功");
message.success(getLabel(111, "操作成功"));
this.handleHeaderSettings({ sourceType: "IMPORT" });
} else {
message.error(errormsg || "操作失败");
message.error(errormsg || getLabel(111, "操作失败"));
}
});
break;
@ -278,9 +279,9 @@ class AttendanceDataComp extends Component {
const payload = { currentSettingFields, sourceType: "IMPORT" };
saveAttendanceFieldSettingAsDefault(payload).then(({ status, errormsg }) => {
if (status) {
message.success("操作成功");
message.success(getLabel(111, "操作成功"));
} else {
message.error(errormsg || "操作失败");
message.error(errormsg || getLabel(111, "操作失败"));
}
});
break;
@ -303,10 +304,10 @@ class AttendanceDataComp extends Component {
const payload = { currentSettingFields, sourceType: "IMPORT" };
saveAttendanceFieldSetting(payload).then(({ status, errormsg }) => {
if (status) {
message.success("保存成功");
message.success(getLabel(111, "保存成功"));
this.handleCloseSettings();
} else {
message.error(errormsg || "保存失败");
message.error(errormsg || getLabel(111, "保存失败"));
}
});
};
@ -335,7 +336,7 @@ class AttendanceDataComp extends Component {
const { showOperateBtn, salaryYearMonth } = this.props;
const pagination = {
...pageInfo,
showTotal: total => `${total}`,
showTotal: total => `${getLabel(83698, "共")} ${total} ${getLabel(18256, "条")}`,
showQuickJumper: true,
showSizeChanger: true,
pageSizeOptions: ["10", "20", "50", "100"],
@ -356,15 +357,15 @@ class AttendanceDataComp extends Component {
columns={[
...columns,
{
title: "操作",
title: getLabel(111, "操作"),
width: 120,
dataIndex: "operate",
render: (_, record) => {
return (
<div className="linkWapper">
<a href="javascript: void(0);" onClick={() => this.handleViewAttendanceData(record)}>查看</a>
<a href="javascript: void(0);" onClick={() => this.handleViewAttendanceData(record)}>{getLabel(111, "查看")}</a>
{showOperateBtn &&
<a href="javascript: void(0);" onClick={() => this.handleDeleteAttendanceData(record)}>删除</a>
<a href="javascript: void(0);" onClick={() => this.handleDeleteAttendanceData(record)}>{getLabel(111, "删除")}</a>
}
</div>
);

View File

@ -5,13 +5,15 @@
* Date: 2023/3/7
*/
import React, { Component } from "react";
import { WeaFormItem, WeaInput, WeaInputSearch, WeaSlideModal } from "ecCom";
import { WeaFormItem, WeaInput, WeaInputSearch, WeaLocaleProvider, WeaSlideModal } from "ecCom";
import { Button } from "antd";
import SlideModalTitle from "../../../../components/slideModalTitle";
import { viewAttendQuote } from "../../../../apis/attendance";
import UnifiedTable from "../../../../components/UnifiedTable";
import "./index.less";
const getLabel = WeaLocaleProvider.getLabel;
class AttendanceDataViewSlide extends Component {
constructor(props) {
super(props);
@ -57,7 +59,7 @@ class AttendanceDataViewSlide extends Component {
<WeaInputSearch
value={keyword}
style={{ marginLeft: 10 }}
placeholder="请输入姓名/部门/工号/手机号"
placeholder={getLabel(111, "请输入姓名/部门/工号/手机号")}
onChange={keyword => this.setState({ keyword })}
onSearch={() => this.viewAttendQuote({ current: 1 }, this.props)}
/>
@ -81,7 +83,7 @@ class AttendanceDataViewSlide extends Component {
const { columns, dataSource, loading, pageInfo } = this.state;
const pagination = {
...pageInfo,
showTotal: (total) => `${total}`,
showTotal: total => `${getLabel(83698, "共")} ${total} ${getLabel(18256, "条")}`,
pageSizeOptions: ["10", "20", "50", "100"],
showSizeChanger: true,
showQuickJumper: true,
@ -109,7 +111,7 @@ class AttendanceDataViewSlide extends Component {
direction="right"
title={
<SlideModalTitle
subtitle="考勤数据"
subtitle={getLabel(111, "考勤数据")}
editable={false}
showOperateBtn={showOperateBtn}
customOperate={this.renderCustomOperate()}
@ -117,7 +119,7 @@ class AttendanceDataViewSlide extends Component {
}
content={
<div>
<WeaFormItem label="考勤周期" labelCol={{ span: 4 }} wrapperCol={{ span: 20 }} underline>
<WeaFormItem label={getLabel(111, "考勤周期")} labelCol={{ span: 4 }} wrapperCol={{ span: 20 }} underline>
<WeaInput value={salaryYearMonth} viewAttr={1}/>
</WeaFormItem>
<UnifiedTable

View File

@ -6,7 +6,7 @@
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaDialog } from "ecCom";
import { WeaDialog, WeaLocaleProvider } from "ecCom";
import { Button, message } from "antd";
import { reFrenceConditions } from "../columns";
import { getSearchs } from "../../../../util";
@ -20,6 +20,7 @@ import SelectItemModal from "../../../../components/selectItemsModal";
import SelectItemsWrapper from "../../../../components/selectItemsModal/selectItemsWrapper";
import "./index.less";
const getLabel = WeaLocaleProvider.getLabel;
@inject("attendanceStore")
@observer
class AttendanceRefrenceDataModal extends Component {
@ -81,10 +82,10 @@ class AttendanceRefrenceDataModal extends Component {
syncAttendanceRefer(payload).then(({ status, errormsg }) => {
this.setState({ loading: false });
if (status) {
message.success("同步成功");
message.success(getLabel(111, "同步成功"));
onCancel(true);
} else {
message.error(errormsg || "同步失败");
message.error(errormsg || getLabel(111, "同步失败"));
}
}).catch(() => this.setState({ loading: false }));
} else {
@ -116,7 +117,7 @@ class AttendanceRefrenceDataModal extends Component {
this.setState({
headerSetPayload: {
...headerSetPayload,
visible: true, title: "引用考勤字段设置",
visible: true, title: getLabel(111, "引用考勤字段设置"),
children: <SelectItemsWrapper
ref={dom => this.setItemRef = dom}
dataSource={data}
@ -146,10 +147,10 @@ class AttendanceRefrenceDataModal extends Component {
case "recovery":
returnToAttendanceFieldSettingDefault({ sourceType: "QUOTE" }).then(({ status, errormsg }) => {
if (status) {
message.success("操作成功");
message.success(getLabel(111, "操作成功"));
this.handleHeaderSetting({ sourceType: "QUOTE" });
} else {
message.error(errormsg || "操作失败");
message.error(errormsg || getLabel(111, "操作失败"));
}
});
break;
@ -168,9 +169,9 @@ class AttendanceRefrenceDataModal extends Component {
const payload = { currentSettingFields, sourceType: "QUOTE" };
saveAttendanceFieldSettingAsDefault(payload).then(({ status, errormsg }) => {
if (status) {
message.success("操作成功");
message.success(getLabel(111, "操作成功"));
} else {
message.error(errormsg || "操作失败");
message.error(errormsg || getLabel(111, "操作失败"));
}
});
break;
@ -193,10 +194,10 @@ class AttendanceRefrenceDataModal extends Component {
const payload = { currentSettingFields, sourceType: "QUOTE" };
saveAttendanceFieldSetting(payload).then(({ status, errormsg }) => {
if (status) {
message.success("保存成功");
message.success(getLabel(111, "保存成功"));
this.handleCloseSettings();
} else {
message.error(errormsg || "保存失败");
message.error(errormsg || getLabel(111, "保存失败"));
}
});
};
@ -205,8 +206,8 @@ class AttendanceRefrenceDataModal extends Component {
const { condition, loading, headerSetLoading, headerSetPayload } = this.state;
const { attendanceStore: { refenceform } } = this.props;
const buttons = [
<Button type="primary" onClick={this.handleSubmitFields} loading={loading}>同步</Button>,
<Button type="ghost" onClick={this.handleHeaderSetting} loading={headerSetLoading}>表头设置</Button>
<Button type="primary" onClick={this.handleSubmitFields} loading={loading}>{getLabel(111, "同步")}</Button>,
<Button type="ghost" onClick={this.handleHeaderSetting} loading={headerSetLoading}>{getLabel(111, "表头设置")}</Button>
];
return (
<WeaDialog

View File

@ -5,13 +5,15 @@
* Date: 2023/2/24
*/
import React, { Component } from "react";
import { WeaCheckbox, WeaTable } from "ecCom";
import { WeaCheckbox, WeaLocaleProvider, WeaTable } from "ecCom";
import { Col, message, Row } from "antd";
import AttendanceCustomFieldsModal from "./attendanceCustomFieldsModal";
import { getAttendanceFieldList, updateAttendanceFieldStatus } from "../../../../apis/attendance";
import TipLabel from "../../../../components/TipLabel";
import { fieldsColumns } from "../columns";
const getLabel = WeaLocaleProvider.getLabel;
class FieldMangComp extends Component {
constructor(props) {
super(props);
@ -28,7 +30,7 @@ class FieldMangComp extends Component {
},
addPayload: {
visible: false,
title: "新建考勤自定义字段"
title: getLabel(111, "新建考勤自定义字段")
}
};
}
@ -61,10 +63,10 @@ class FieldMangComp extends Component {
const payload = { id, enableStatus: enableStatus === "1" };
updateAttendanceFieldStatus(payload).then(({ status, errormsg }) => {
if (status) {
message.success("操作成功");
message.success(getLabel(111, "操作成功"));
this.getAttendanceFieldList();
} else {
message.error(errormsg || "操作失败");
message.error(errormsg || getLabel(111, "操作失败"));
}
});
};
@ -94,7 +96,7 @@ class FieldMangComp extends Component {
const { fieldName } = this.props;
const pagination = {
...pageInfo,
showTotal: total => `${total}`,
showTotal: total => `${getLabel(83698, "共")} ${total} ${getLabel(18256, "条")}`,
showQuickJumper: true,
showSizeChanger: true,
pageSizeOptions: ["10", "20", "50", "100"],
@ -126,8 +128,8 @@ class FieldMangComp extends Component {
<Col xs={24} sm={24} md={8} lg={6}>
<TipLabel
tipList={[
"1、考勤字段包含自定义字段和考勤模块的统计字段,所有字段不可重名;",
"2、停用自定义字段将影响其参与计算的账套核算;"
`1、${getLabel(111, "考勤字段包含自定义字段和考勤模块的统计字段,所有字段不可重名;")}`,
`2、${getLabel(111, "停用自定义字段将影响其参与计算的账套核算;")}`
]}
/>
</Col>

View File

@ -5,10 +5,11 @@
* Date: 2023/3/3
*/
import React, { Component } from "react";
import { WeaFormItem, WeaInput, WeaSearchGroup } from "ecCom";
import { WeaFormItem, WeaInput, WeaSearchGroup, WeaLocaleProvider } from "ecCom";
import { DataCollectionDatePicker, DataCollectionSelect } from "../../cumDeduct";
import "./index.less";
const getLabel = WeaLocaleProvider.getLabel;
const Input = (label, value, labelCol = 8, wrapperCol = 16) => {
return (
<WeaFormItem label={label} labelCol={{ span: labelCol }} wrapperCol={{ span: wrapperCol }}>
@ -28,7 +29,7 @@ class ImportFormOptions extends Component {
const items = [
{
com: DataCollectionDatePicker({
label: "薪资所属月",
label: getLabel(111, "薪资所属月"),
value: salaryYearMonth,
onChange: this.screenChange,
key: "salaryYearMonth",
@ -37,15 +38,15 @@ class ImportFormOptions extends Component {
},
{
com: DataCollectionSelect({
label: "薪资账套",
label: getLabel(111, "薪资账套"),
value: salarySobId || "",
onChange: this.screenChange,
options: [{ key: "", showname: "" }, ...salarySobList],
key: "salarySobId"
})
},
{ com: Input("薪资周期", salaryCycle) },
{ com: Input("考勤周期", attendCycle, 10, 14) }
{ com: Input(getLabel(111, "薪资周期"), salaryCycle) },
{ com: Input(getLabel(111, "考勤周期"), attendCycle, 10, 14) }
];
return (
<WeaSearchGroup className="attendanceFormWrapper" showGroup needTigger={false} items={items}

View File

@ -7,12 +7,13 @@
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { Button, DatePicker } from "antd";
import { WeaFormItem, WeaNewScroll, WeaTab } from "ecCom";
import { WeaFormItem, WeaNewScroll, WeaTab, WeaLocaleProvider } from "ecCom";
import AttendanceDataComp from "./components/attendanceDataComp";
import FieldMangComp from "./components/fieldMangComp";
import moment from "moment";
import "./index.less";
const getLabel = WeaLocaleProvider.getLabel;
const { MonthPicker } = DatePicker;
@inject("taxAgentStore")
@ -36,7 +37,7 @@ class Index extends Component {
getAttendanceDataScreen = () => {
const { salaryMonth } = this.state;
const [value1 = "", value2 = ""] = salaryMonth;
return <WeaFormItem label="薪资所属月" labelCol={{ span: 2 }} wrapperCol={{ span: 22 }}>
return <WeaFormItem label={getLabel(111, "薪资所属月")} labelCol={{ span: 2 }} wrapperCol={{ span: 22 }}>
<MonthPicker
value={value1} format="YYYY-MM"
disabledDate={(current) => {
@ -44,7 +45,7 @@ class Index extends Component {
}}
onChange={(val) => this.handleChangeSalaryMonth([val ? moment(val).format("YYYY-MM") : "", value2])}
/>
<span className="to"></span>
<span className="to">{getLabel(111, "")}</span>
<MonthPicker
value={value2} format="YYYY-MM"
disabledDate={(current) => {
@ -64,7 +65,7 @@ class Index extends Component {
}
handleQuoteAttendanceData= ()=>{
this.attendanceTableRef.handleQuoteAttendanceData({
visible: true, title: "引用考勤数据"
visible: true, title: getLabel(111, "引用考勤数据")
});
}
@ -72,18 +73,18 @@ class Index extends Component {
const { selectedKey, salaryMonth, fieldName } = this.state;
const { taxAgentStore: { showOperateBtn } } = this.props;
const topTab = [
{ title: "考勤数据", viewcondition: "DATA" },
{ title: "字段管理", viewcondition: "FIELD" }
{ title: getLabel(111, "考勤数据"), viewcondition: "DATA" },
{ title: getLabel(111, "字段管理"), viewcondition: "FIELD" }
];
const buttons = selectedKey === "DATA" ? [
<Button type="primary" onClick={this.handleQuoteAttendanceData}>引用</Button>,
<Button type="ghost" onClick={this.handleImportAttendanceData}>导入</Button>
] : [<Button type="primary" onClick={this.handleAddAttendFileds}>新建</Button>];
<Button type="primary" onClick={this.handleQuoteAttendanceData}>{getLabel(111, "引用")}</Button>,
<Button type="ghost" onClick={this.handleImportAttendanceData}>{getLabel(111, "导入")}</Button>
] : [<Button type="primary" onClick={this.handleAddAttendFileds}>{getLabel(111, "新建")}</Button>];
return (
<div className="attendanceRefWrapper">
<WeaTab
datas={topTab} keyParam="viewcondition" selectedKey={selectedKey} buttons={buttons}
searchType={selectedKey === "FIELD" ? ["base"] : []} searchsBasePlaceHolder="请输入字段名称"
searchType={selectedKey === "FIELD" ? ["base"] : []} searchsBasePlaceHolder={getLabel(111, "请输入字段名称")}
onChange={v => this.setState({ selectedKey: v })}
searchsBaseValue={fieldName} onSearchChange={fieldName => this.setState({ fieldName })}
onSearch={() => this.fieldMangRef.getAttendanceFieldList({ fieldName, current: 1 })}

View File

@ -1,3 +1,6 @@
import { WeaLocaleProvider } from "ecCom";
const getLabel = WeaLocaleProvider.getLabel;
export const condition = [
{
items: [
@ -5,7 +8,7 @@ export const condition = [
conditionType: "INPUT",
domkey: ["childrenEducation"],
fieldcol: 14,
label: "子女教育",
label: getLabel(111, "子女教育"),
labelcol: 8,
value: "",
viewAttr: 2
@ -14,7 +17,7 @@ export const condition = [
conditionType: "INPUT",
domkey: ["continuingEducation"],
fieldcol: 14,
label: "继续教育",
label: getLabel(111, "继续教育"),
labelcol: 8,
value: "",
viewAttr: 2
@ -23,7 +26,7 @@ export const condition = [
conditionType: "INPUT",
domkey: ["housingLoanInterest"],
fieldcol: 14,
label: "住房贷款利息",
label: getLabel(111, "住房贷款利息"),
labelcol: 8,
value: "",
viewAttr: 2
@ -32,7 +35,7 @@ export const condition = [
conditionType: "INPUT",
domkey: ["housingRent"],
fieldcol: 14,
label: "住房租金",
label: getLabel(111, "住房租金"),
labelcol: 8,
value: "",
viewAttr: 2
@ -41,7 +44,7 @@ export const condition = [
conditionType: "INPUT",
domkey: ["supportingElder"],
fieldcol: 14,
label: "赡养老人",
label: getLabel(111, "赡养老人"),
labelcol: 8,
value: "",
viewAttr: 2
@ -50,7 +53,7 @@ export const condition = [
conditionType: "INPUT",
domkey: ["seriousIllnessTreatment"],
fieldcol: 14,
label: "大病医疗",
label: getLabel(111, "大病医疗"),
labelcol: 8,
value: "",
viewAttr: 2
@ -59,13 +62,13 @@ export const condition = [
conditionType: "INPUT",
domkey: ["infantCare"],
fieldcol: 14,
label: "婴幼儿照护",
label: getLabel(111, "婴幼儿照护"),
labelcol: 8,
value: "",
viewAttr: 2
}
],
title: "数据采集",
title: getLabel(111, "数据采集"),
defaultshow: true
}
];
@ -77,7 +80,7 @@ export const searchCondition = [
conditionType: "INPUT",
domkey: ["username"],
fieldcol: 16,
label: "姓名",
label: getLabel(111, "姓名"),
labelcol: 8,
value: "",
viewAttr: 2
@ -93,7 +96,7 @@ export const searchCondition = [
dataURL: null,
isSearch: false,
key: "2",
name: "组织结构",
name: getLabel(111, "组织结构"),
selected: false,
showOrder: 0
},
@ -102,12 +105,12 @@ export const searchCondition = [
dataURL: null,
isSearch: true,
key: "1",
name: "按列表",
name: getLabel(111, "按列表"),
selected: false,
showOrder: 0
}
],
title: '部门',
title: getLabel(111, "部门"),
type: "4",
viewAttr: 2,
pageSize: 10,
@ -117,7 +120,7 @@ export const searchCondition = [
iconBgcolor: "#217346"
},
fieldcol: 16,
label: "部门",
label: getLabel(111, "部门"),
labelcol: 8,
value: "",
viewAttr: 2
@ -126,13 +129,13 @@ export const searchCondition = [
conditionType: "INPUT",
domkey: ["jobNum"],
fieldcol: 16,
label: "工号",
label: getLabel(111, "工号"),
labelcol: 8,
value: "",
viewAttr: 2
}
],
title: "常用条件",
title: getLabel(111, "常用条件"),
defaultshow: true
}
];

View File

@ -1,6 +1,6 @@
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaSearchGroup } from "ecCom";
import { WeaSearchGroup, WeaLocaleProvider } from "ecCom";
import { Button, Dropdown, Menu, message, Modal } from "antd";
import DataTables from "../dataTables";
import Layout from "../layout";
@ -23,6 +23,7 @@ import TableRecord from "../components/tableRecord";
import { specialModalColumns } from "../cumDeduct/columns";
import { convertToUrlString } from "../../../util/url";
const getLabel = WeaLocaleProvider.getLabel;
@inject("taxAgentStore", "specialAddStore")
@observer
class Index extends Component {
@ -77,22 +78,22 @@ class Index extends Component {
specialAddDeductionEditData({ ...payload, id }).then(({ status, errormsg }) => {
this.setState({ saveLoading: false });
if (status) {
message.success("编辑成功");
message.success(getLabel(111, "编辑成功"));
this.handleCloseSlide();
this.tableRef.getTableDate();
} else {
message.error(errormsg || "编辑失败");
message.error(errormsg || getLabel(111, "编辑失败"));
}
});
} else {
specialAddDeductionCreateData(payload).then(({ status, errormsg }) => {
this.setState({ saveLoading: false });
if (status) {
message.success("新增成功");
message.success(getLabel(111, "新增成功"));
this.handleCloseSlide();
this.tableRef.getTableDate();
} else {
message.error(errormsg || "新增失败");
message.error(errormsg || getLabel(111, "新增失败"));
}
});
}
@ -128,7 +129,7 @@ class Index extends Component {
importPayload: { ...importPayload, slideDataSource: preview }
});
} else {
message.error(errormsg || "预览失败");
message.error(errormsg || getLabel(111, "预览失败"));
}
});
};
@ -157,15 +158,15 @@ class Index extends Component {
const { taxAgentId } = this.state;
const payload = { taxAgentId };
Modal.confirm({
title: "信息确认",
content: `确定清空所有专项附加扣除数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。`,
title: getLabel(111, "信息确认"),
content: getLabel(111, "确定清空所有专项附加扣除数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。"),
onOk: () => {
specialAddDeductionDeleteAllData(payload).then(({ status, errormsg }) => {
if (status) {
message.success("删除成功");
message.success(getLabel(111, "删除成功"));
this.tableRef.getTableDate();
} else {
message.error(errormsg || "删除失败");
message.error(errormsg || getLabel(111, "删除失败"));
}
});
}
@ -181,22 +182,22 @@ class Index extends Component {
const { selectedRowKeys: ids } = this.tableRef.state;
const { id, departmentName, username } = record;
if (ids.length === 0 && !id) {
message.warning("请选择表格数据");
message.warning(getLabel(111, "请选择表格数据"));
return;
}
const payload = { ids: !id ? ids : [id] };
Modal.confirm({
title: "信息确认",
content: !id ? "确定删除所选数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。" :
`确定删除${departmentName}${username}的累计专项附加扣除数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。`,
title: getLabel(111, "信息确认"),
content: !id ? getLabel(111, "确定删除所选数据吗?若数据已参与核算,已参与核算的数据不会受影响,点击核算将会按当前列表最新数据重新核算。") :
`${getLabel(111, "确定删除")}${departmentName}${username}${getLabel(111, "的累计专项附加扣除数据吗")}?${getLabel(111, "若数据已参与核算")}${getLabel(111, "已参与核算的数据不会受影响")}${getLabel(111, "点击核算将会按当前列表最新数据重新核算")}`,
onOk: () => {
specialAddDeductionDeleteSelectData(payload).then(({ status, errormsg }) => {
if (status) {
message.success("删除成功");
message.success(getLabel(111, "删除成功"));
this.tableRef.getTableDate();
this.tableRef.handleClearRows();
} else {
message.error(errormsg || "删除失败");
message.error(errormsg || getLabel(111, "删除失败"));
}
});
}
@ -226,7 +227,7 @@ class Index extends Component {
const { selectedRowKeys: ids } = this.tableRef.state;
const { taxAgentId, exportPayloadType } = this.state;
if (ids.length === 0) {
message.warning("请选择需要导出的数据");
message.warning(getLabel(111, "请选择需要导出的数据"));
return;
}
this.setState({
@ -246,10 +247,10 @@ class Index extends Component {
const items = [
{
com: DataCollectionSelect({
label: "个税扣缴义务人",
label: getLabel(111, "个税扣缴义务人"),
value: taxAgentId,
onChange: this.screenChange,
options: [{ key: "", showname: "全部" }, ...taxAgentOption],
options: [{ key: "", showname: getLabel(111, "全部") }, ...taxAgentOption],
key: "taxAgentId"
})
}
@ -268,19 +269,19 @@ class Index extends Component {
*/
getTopBtns = () => {
return [
<Button type="primary" onClick={this.handleOpenImport}>导入</Button>,
<Button type="ghost" onClick={() => this.handleAddData()}>新建</Button>,
<Button type="primary" onClick={this.handleOpenImport}>{getLabel(111, "导入")}</Button>,
<Button type="ghost" onClick={() => this.handleAddData()}>{getLabel(111, "新建")}</Button>,
<Dropdown
overlay={
<Menu className="dropdownMenuWrapper" onClick={this.handleDataMenuClick}>
<Menu.Item key="specialAddDeductionDeleteSelectData">批量删除</Menu.Item>
<Menu.Item key="specialAddDeductionDeleteAllData">一键清空</Menu.Item>
<Menu.Item key="handleExportSelect">导出选中</Menu.Item>
<Menu.Item key="handleExportAll">导出全部</Menu.Item>
<Menu.Item key="specialAddDeductionDeleteSelectData">{getLabel(111, "批量删除")}</Menu.Item>
<Menu.Item key="specialAddDeductionDeleteAllData">{getLabel(111, "一键清空")}</Menu.Item>
<Menu.Item key="handleExportSelect">{getLabel(111, "导出选中")}</Menu.Item>
<Menu.Item key="handleExportAll">{getLabel(111, "导出全部")}</Menu.Item>
</Menu>
}
>
<Button type="ghost">更多</Button>
<Button type="ghost">{getLabel(111, "更多")}</Button>
</Dropdown>
];
};
@ -291,7 +292,7 @@ class Index extends Component {
* Params: screenParams规则日期必须放在数组最后一位人员信息必须第一位
* Date: 2023/2/20
*/
handleAddData = (title = "新建", editId = {}) => {
handleAddData = (title = getLabel(111, "新建"), editId = {}) => {
const { taxAgentStore, specialAddStore: { addForm } } = this.props;
const { slidePayload } = this.state;
const { taxAgentOption } = taxAgentStore;
@ -331,7 +332,7 @@ class Index extends Component {
handleTableOperate = ({ key }, record) => {
const { id } = record;
key === "handleAddData" ? getSpecialAddDeduction({ id }).then(({ status, data }) => {
if (status) this[key]("编辑", data);
if (status) this[key](getLabel(111, "编辑"), data);
}) : this.specialAddDeductionDeleteSelectData(record);
};
handleCloseSlide = () => {
@ -354,8 +355,8 @@ class Index extends Component {
const bool = _.every(_.pick(baseInfo, ["taxAgentId", "employeeId"]), v => !!v);
if (!bool) {
Modal.warning({
title: "信息确认",
content: "必要信息不完整,红色*为必填项!"
title: getLabel(111, "信息确认"),
content: getLabel(111, "必要信息不完整,红色*为必填项!")
});
return;
}
@ -424,7 +425,7 @@ class Index extends Component {
} = this.state;
const tablePayload = { taxAgentId };
return (
<Layout title="专项附加扣除" btns={this.getTopBtns()} leftComp={this.getScreen()}
<Layout title={getLabel(111, "专项附加扣除")} btns={this.getTopBtns()} leftComp={this.getScreen()}
onResizeWindowInnerWidth={this.handleResize} slidePayload={slidePayload}
onClose={this.handleCloseSlide} onSave={this.handleSaveData}
slideLoading={saveLoading} exportPayloadUrl={exportPayloadUrl}
@ -442,7 +443,7 @@ class Index extends Component {
isSpecial
showOperateBtn={showOperateBtn}
onTableOperate={this.handleTableOperate}
onViewDetails={(record) => this.handleAddData("专项附加扣除记录", record)}
onViewDetails={(record) => this.handleAddData(getLabel(111, "专项附加扣除记录"), record)}
form={advanceForm}
/>
</Layout>