hotfix/2.15.1.2407.01

This commit is contained in:
黎永顺 2024-08-15 10:28:18 +08:00
parent d9fc164504
commit 23e9a6ba42
2 changed files with 31 additions and 11 deletions

View File

@ -5,7 +5,7 @@
* Date: 2022/11/30
*/
import React, { Component } from "react";
import { WeaBrowser, WeaDialog, WeaFormItem, WeaSearchGroup, WeaSelect } from "ecCom";
import { WeaBrowser, WeaDialog, WeaFormItem, WeaSearchGroup, WeaSelect, WeaTextarea } from "ecCom";
import { Button, message, Modal } from "antd";
import { getTaxAgentRangeForm } from "../../apis/taxAgent";
import { commonEnumList } from "../../apis/ruleconfig";
@ -91,6 +91,11 @@ class PersonalScopeModal extends Component {
key: "POSITION",
showname: "岗位",
selected: false
},
{
key: "SQL",
showname: "SQL",
selected: false
}
];
this.setState({
@ -124,7 +129,9 @@ class PersonalScopeModal extends Component {
const payload = {
employeeStatus: status.split(","),
includeType,
targetParams: _.map(targetTypeIds.split(","), it => ({ targetType, targetId: it })),
targetParams: targetType !== "SQL" ?
_.map(targetTypeIds.split(","), it => ({ targetType, targetId: it, target: "" })) :
[{ targetType, targetId: "0", target: targetTypeIds }],
[saveKeyVal["key"]]: saveKeyVal["value"]
};
this.setState({ loading: true });
@ -156,6 +163,9 @@ class PersonalScopeModal extends Component {
case "POSITION":
browserType = { ...browserType, type: 278, title: "岗位选择" };
break;
case "SQL":
return <WeaTextarea minRows={2} viewAttr={3} style={{ width: 290 }} value={targetTypeIds}
onChange={val => this.setState({ targetTypeIds: val, targetTypeIdsNames: val })}/>;
default:
break;
}

View File

@ -1,8 +1,9 @@
import React from "react";
import { Button, Col, Row } from "antd";
import { WeaBrowser, WeaCheckbox, WeaDialog, WeaError, WeaSelect } from "ecCom";
import { WeaBrowser, WeaCheckbox, WeaDialog, WeaError, WeaLocaleProvider, WeaSelect, WeaTextarea } from "ecCom";
import "../ledger/index.less";
const { getLabel } = WeaLocaleProvider;
export default class AddTaxAgentModal extends React.Component {
constructor(props) {
super(props);
@ -24,7 +25,7 @@ export default class AddTaxAgentModal extends React.Component {
this.setState({
checkAll: "1"
});
}else{
} else {
this.setState({
checkAll: "0"
});
@ -38,10 +39,10 @@ export default class AddTaxAgentModal extends React.Component {
const { checkboxValue, ids, selectedKey } = this.state;
const payload = {
employeeStatus: checkboxValue.split(","),
targetParams: _.map(ids.split(","), (it) => ({
targetType: selectedKey,
targetParams: selectedKey !== "SQL" ? _.map(ids.split(","), (it) => ({
targetType: selectedKey, target: "",
targetId: it
}))
})) : [{ targetType: selectedKey, targetId: "0", target: ids }]
};
if (_.isEmpty(ids) && _.isEmpty(checkboxValue)) {
this.refs.weaError.showError();
@ -64,7 +65,7 @@ export default class AddTaxAgentModal extends React.Component {
this.setState({
selectedKey: "EMPLOYEE",
checkboxValue: "",
checkAll: '0',
checkAll: "0",
ids: ""
});
};
@ -182,6 +183,15 @@ export default class AddTaxAgentModal extends React.Component {
/>
</WeaError>
)}
{this.state.selectedKey === "SQL" && (
<WeaError tipPosition="bottom"
style={{ width: "100%" }}
ref="weaError"
error={getLabel(111, "请输入SQL")}>
<WeaTextarea minRows={2} viewAttr={3} style={{ width: 290 }} value={this.state.ids}
onChange={ids => this.setState({ ids })}/>
</WeaError>
)}
</div>
</Col>
</Row>
@ -197,13 +207,13 @@ export default class AddTaxAgentModal extends React.Component {
if (checkAll === "1") {
const checked = _.map(employeeStatus, it => it.id);
this.setState({
checkAll: '1',
checkAll: "1",
checkboxValue: checked.join(",")
});
} else {
this.setState({
checkAll: '0',
checkboxValue: ''
checkAll: "0",
checkboxValue: ""
});
}
}}/>