custom/上海港湾多语言

This commit is contained in:
黎永顺 2024-07-09 10:52:09 +08:00
parent 72fd9a50e0
commit d68ec3743b
4 changed files with 70 additions and 9 deletions

View File

@ -98,3 +98,7 @@ export const getTaxAgentSelectListAsAdmin = (params) => {
export const hasIconInTax = (params) => {
return WeaTools.callApi("/api/bs/hrmsalary/sys/conf/code?code=hideIconInTax", "GET", params);
};
//港湾二开-获取用工关系
export const getYggxList = (params) => {
return WeaTools.callApi("/api/bs/hrmsalary/taxAgent/range/yggxList", "GET", params);
};

View File

@ -5,14 +5,15 @@
* Date: 2022/11/30
*/
import React, { Component } from "react";
import { WeaBrowser, WeaDialog, WeaFormItem, WeaSearchGroup, WeaSelect, WeaLocaleProvider } from "ecCom";
import { WeaBrowser, WeaDialog, WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaSelect } from "ecCom";
import { Button, message, Modal } from "antd";
import { getTaxAgentRangeForm } from "../../apis/taxAgent";
import { getTaxAgentRangeForm, getYggxList } from "../../apis/taxAgent";
import { commonEnumList } from "../../apis/ruleconfig";
import { SelectWithAll } from "../../pages/socialSecurityBenefits/standingBookDetail/components/regAddEmployee";
import "./index.less";
const getLabel = WeaLocaleProvider.getLabel;
class PersonalScopeModal extends Component {
constructor(props) {
super(props);
@ -24,7 +25,8 @@ class PersonalScopeModal extends Component {
targetTypeIds: "",
targetTypeIdsNames: "",
status: "",
statusAll: ""
statusAll: "",
yggxOptions: []
};
}
@ -33,7 +35,8 @@ class PersonalScopeModal extends Component {
if (isTaxgent) {
this.getTaxAgentRangeForm();
} else {
this.commonEnumList();
this.commonEnumList().then(r => {
});
// const employeeStatus = [
// { key: "TRIAL", showname: "试用" },
// { key: "FORMAL", showname: "正式" },
@ -69,7 +72,8 @@ class PersonalScopeModal extends Component {
}
}
commonEnumList = () => {
commonEnumList = async () => {
const { data: reslut } = await getYggxList();
commonEnumList({ enumClass: "com.engine.salary.enums.UserStatusEnum" }).then(({ status, data }) => {
if (status) {
const targetTypeList = [
@ -92,11 +96,20 @@ class PersonalScopeModal extends Component {
key: "POSITION",
showname: getLabel(6086, "岗位"),
selected: false
},
{
key: "YGGX",
showname: getLabel(547801, "用工关系"),
selected: false
}
];
this.setState({
targetTypeList,
employeeStatus: _.map(_.filter(data, o => o.value !== 7), it => ({ key: it.enum, showname: it.defaultLabel }))
employeeStatus: _.map(_.filter(data, o => o.value !== 7), it => ({
key: it.enum,
showname: it.defaultLabel
})),
yggxOptions: _.map(reslut, it => ({ key: it.id, showname: it.name }))
});
}
});
@ -183,7 +196,9 @@ class PersonalScopeModal extends Component {
render() {
const { onCancel, title, visible } = this.props;
const { employeeStatus, targetTypeList, targetType, status, statusAll, loading } = this.state;
const {
employeeStatus, targetTypeList, targetType, status, statusAll, loading, yggxOptions, targetTypeIds
} = this.state;
const buttons = [
<Button type="primary" onClick={this.handleSubmit} loading={loading}>{getLabel(826, "确定")}</Button>,
<Button type="ghost" onClick={this.handleReset}>{getLabel(2022, "重置")}</Button>
@ -214,7 +229,17 @@ class PersonalScopeModal extends Component {
options={targetTypeList}
onChange={(targetType) => this.setState({ targetType })}
/>
{this.renderBrowser()}
{
targetType !== "YGGX" ? this.renderBrowser() :
<WeaSelect
viewAttr={3} value={targetTypeIds} multiple
options={yggxOptions} style={{ width: 200 }}
onChange={(targetTypeIds, targetTypeIdsNames) => this.setState({
targetTypeIds,
targetTypeIdsNames
})}
/>
}
</div>
</WeaFormItem>
{

View File

@ -316,6 +316,15 @@
//关联人员弹框
.associatesWrapper {
.yggx-select {
.wea-select-input {
& > span {
position: absolute;
top: 14px;
}
}
}
.wea-select, .ant-select-selection, .ant-select {
width: 100%;
}

View File

@ -1,6 +1,7 @@
import React from "react";
import { Button, Col, Row } from "antd";
import { WeaBrowser, WeaCheckbox, WeaDialog, WeaError, WeaLocaleProvider, WeaSelect } from "ecCom";
import { getYggxList } from "../../apis/taxAgent";
import "../ledger/index.less";
const getLabel = WeaLocaleProvider.getLabel;
@ -11,10 +12,19 @@ export default class AddTaxAgentModal extends React.Component {
selectedKey: "EMPLOYEE",
checkboxValue: "",
checkAll: "0",
ids: ""
ids: "",
yggxOptions: []
};
}
componentDidMount() {
getYggxList().then(({ status, data }) => {
if (status) {
this.setState({ yggxOptions: _.map(data, it => ({ key: it.id, showname: it.name })) });
}
});
}
onCheckboxChange = (checkboxValue) => {
const { employeeStatus } = this.props;
const checked = _.map(employeeStatus, it => it.id);
@ -72,6 +82,7 @@ export default class AddTaxAgentModal extends React.Component {
render() {
const { employeeStatus, targetTypeList, visible, onCancel, loading } = this.props;
const { yggxOptions } = this.state;
return (
<WeaDialog
visible={visible}
@ -183,6 +194,18 @@ export default class AddTaxAgentModal extends React.Component {
/>
</WeaError>
)}
{this.state.selectedKey === "YGGX" && (
<WeaError tipPosition="bottom"
style={{ width: "100%" }}
ref="weaError"
error={getLabel(547804, "请选择用工关系")}>
<WeaSelect
viewAttr={3} value={this.state.ids} multiple className="yggx-select"
options={yggxOptions} style={{ width: 200 }}
onChange={ids => this.setState({ ids })}
/>
</WeaError>
)}
</div>
</Col>
</Row>