个税对接-薪资账套个税申报字段对应开发

This commit is contained in:
黎永顺 2023-08-17 10:16:29 +08:00
parent bfc9f1363c
commit acadba0946
2 changed files with 26 additions and 20 deletions

View File

@ -17,7 +17,7 @@ class IncomeTaxFields extends Component {
super(props);
this.state = {
selectedKey: "", tabs: [],
incomeTaxFields: [],
incomeTaxFields: []
};
}
@ -65,7 +65,7 @@ class IncomeTaxFields extends Component {
...it,
taxReportRules: _.map(it.taxReportRules, child => {
if (child.id === recordRuleId) {
return { ...child, visible: false, salaryItem: [salaryItem] };
return { ...child, visible: false, salaryItem };
}
return { ...child, visible: false };
})

View File

@ -5,12 +5,11 @@
* Date: 2023/8/16
*/
import React, { Component } from "react";
import { Button, Icon, Input, Popover } from "antd";
import { WeaLocaleProvider } from "ecCom";
import { Icon, Popover } from "antd";
import { WeaInputSearch, WeaLocaleProvider } from "ecCom";
import { commonBrowserData } from "../../../apis";
const { getLabel } = WeaLocaleProvider;
const InputGroup = Input.Group;
class LedgerFieldsItemPopver extends Component {
constructor(props) {
@ -26,10 +25,24 @@ class LedgerFieldsItemPopver extends Component {
if (nextProps.record !== this.props.record && nextProps.record.visible) {
this.commonBrowserData(nextProps);
} else {
this.setState({ dataList: [] });
const { record } = nextProps;
const salaryItemName = record.salaryItem[0] ? record.salaryItem[0].name : "";
this.setState({ dataList: [], keywords: salaryItemName });
}
}
handleFocusChange = (visible) => {
const { keywords } = this.state;
const { record, onChangeSwitch } = this.props;
visible && onChangeSwitch(visible, record.id);
if (visible && keywords) {
this.setState({ keywords: "" });
}
};
handleChange = (keywords) => {
this.setState({ keywords }, () => this.handleSearch());
!keywords && this.props.onChange([], this.props.record.id);
};
commonBrowserData = (props) => {
const { salarySobId } = props;
const { keywords } = this.state;
@ -56,13 +69,12 @@ class LedgerFieldsItemPopver extends Component {
handleClickItem = (item) => {
this.setState({
keywords: item.name
}, () => this.props.onChange(item, this.props.record.id));
}, () => this.props.onChange([item], this.props.record.id));
};
render() {
const { keywords, dataList } = this.state;
const { record, onChangeSwitch } = this.props;
const salaryItemName = record.salaryItem[0] ? record.salaryItem[0].name : "";
return (
<Popover content={
<ul className="income_result_wrapper">
@ -79,18 +91,12 @@ class LedgerFieldsItemPopver extends Component {
visible={record.visible}
onVisibleChange={(visible) => onChangeSwitch(visible, record.id)}
>
<InputGroup className="incomeSearchGroup">
<Input placeholder={getLabel(18214, "请选择")} value={keywords}
onFocus={() => onChangeSwitch(true, record.id)} style={{ width: "auto" }}
onChange={(e) => this.setState({ keywords: e.target.value }, () => this.handleSearch())}
/>
<Button icon="search"/>
</InputGroup>
{/*<WeaInputSearch*/}
{/* style={{ width: 200 }} placeholder={getLabel(18214, "请选择")}*/}
{/* onFocusChange={(visible) => this.setState({ keywords: visible ? "" : salaryItemName }, () => onChangeSwitch(visible, record.id))}*/}
{/* value={keywords} onChange={(keywords) => this.setState({ keywords }, () => this.handleSearch())}*/}
{/*/>*/}
<WeaInputSearch
style={{ width: 200 }} placeholder={getLabel(18214, "请选择")}
onFocusChange={this.handleFocusChange}
value={keywords} onSearchChange={this.handleChange}
onSearch={() => alert(1)}
/>
</Popover>
);
}