2023-11-27 19:17:44 +08:00
|
|
|
/*
|
|
|
|
|
* Author: 黎永顺
|
|
|
|
|
* name: 薪资账套查询
|
|
|
|
|
* Description:
|
|
|
|
|
* Date: 2023/11/27
|
|
|
|
|
*/
|
|
|
|
|
import React, { Component } from "react";
|
|
|
|
|
import { inject, observer } from "mobx-react";
|
|
|
|
|
import { Button } from "antd";
|
2023-11-28 13:44:53 +08:00
|
|
|
import { WeaSwitch } from "comsMobx";
|
|
|
|
|
import { WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom";
|
2023-11-27 19:17:44 +08:00
|
|
|
import { searchConditions } from "../config";
|
2023-11-28 13:44:53 +08:00
|
|
|
import { getTaxAgentSelectList } from "../../../apis/taxAgent";
|
2023-11-27 19:17:44 +08:00
|
|
|
|
2023-11-28 13:44:53 +08:00
|
|
|
const getKey = WeaTools.getKey;
|
2023-11-27 19:17:44 +08:00
|
|
|
const getLabel = WeaLocaleProvider.getLabel;
|
|
|
|
|
|
|
|
|
|
@inject("ledgerStore")
|
|
|
|
|
@observer
|
|
|
|
|
class LedgerSearchComp extends Component {
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props);
|
|
|
|
|
this.state = {
|
|
|
|
|
conditions: []
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
2023-11-28 13:44:53 +08:00
|
|
|
this.getTaxAgentSelectList();
|
2023-11-27 19:17:44 +08:00
|
|
|
}
|
|
|
|
|
|
2023-11-28 13:44:53 +08:00
|
|
|
getTaxAgentSelectList = () => {
|
|
|
|
|
const { ledgerStore: { searchForm } } = this.props;
|
|
|
|
|
getTaxAgentSelectList().then(({ status, data }) => {
|
|
|
|
|
if (status) {
|
|
|
|
|
this.setState({
|
|
|
|
|
conditions: _.map(searchConditions, o => {
|
|
|
|
|
return {
|
|
|
|
|
...o,
|
|
|
|
|
items: _.map(o.items, j => {
|
|
|
|
|
if (getKey(j) === "taxAgentId") {
|
|
|
|
|
return {
|
|
|
|
|
...j,
|
2023-12-07 13:55:52 +08:00
|
|
|
options: [{ key: "", showname: getLabel(332, "全部") }, ..._.map(data, g => ({
|
|
|
|
|
key: g.id,
|
|
|
|
|
showname: g.content
|
|
|
|
|
}))]
|
2023-11-28 13:44:53 +08:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
return { ...j };
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
})
|
|
|
|
|
}, () => searchForm.initFormFields(this.state.conditions));
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
2023-11-27 19:17:44 +08:00
|
|
|
formRender = (form, condition) => {
|
|
|
|
|
const { isFormInit } = form, formParams = form.getFormParams();
|
|
|
|
|
let group = [];
|
|
|
|
|
isFormInit && condition && condition.map(c => {
|
|
|
|
|
let items = [];
|
|
|
|
|
c.items.map(fields => {
|
|
|
|
|
items.push({
|
|
|
|
|
com: (
|
|
|
|
|
<WeaFormItem label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }}
|
|
|
|
|
wrapperCol={{ span: `${fields.fieldcol}` }} error={form.getError(fields)}
|
|
|
|
|
tipPosition="bottom"
|
|
|
|
|
>
|
|
|
|
|
<WeaSwitch fieldConfig={fields} form={form} formParams={formParams}/>
|
|
|
|
|
</WeaFormItem>),
|
|
|
|
|
colSpan: 2
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
group.push(
|
|
|
|
|
<WeaSearchGroup col={2} needTigger={true} title={c.title} showGroup={c.defaultshow} center={false}
|
|
|
|
|
items={items}/>);
|
|
|
|
|
});
|
|
|
|
|
return group;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
render() {
|
2023-11-28 13:44:53 +08:00
|
|
|
const { conditions } = this.state;
|
2023-11-27 19:17:44 +08:00
|
|
|
const { ledgerStore: { searchForm } } = this.props;
|
|
|
|
|
return (
|
|
|
|
|
<div className="ledgerSearch-Wrapper">
|
2023-11-28 13:44:53 +08:00
|
|
|
{this.formRender(searchForm, conditions)}
|
|
|
|
|
<Button type="primary" onClick={this.props.onSearch}>{getLabel(388113, "搜索")}</Button>
|
2023-11-27 19:17:44 +08:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default LedgerSearchComp;
|