/* * Author: 黎永顺 * name: 薪资账套查询 * Description: * Date: 2023/11/27 */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { Button } from "antd"; import { WeaSwitch } from "comsMobx"; import { WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom"; import { searchConditions } from "../config"; import { getTaxAgentSelectList } from "../../../apis/taxAgent"; const getKey = WeaTools.getKey; const getLabel = WeaLocaleProvider.getLabel; @inject("ledgerStore") @observer class LedgerSearchComp extends Component { constructor(props) { super(props); this.state = { conditions: [] }; } componentDidMount() { this.getTaxAgentSelectList(); } 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, options: [{ key: "", showname: getLabel(332, "全部") }, ..._.map(data, g => ({ key: g.id, showname: g.content }))] }; } return { ...j }; }) }; }) }, () => searchForm.initFormFields(this.state.conditions)); } }); }; 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: ( ), colSpan: 2 }); }); group.push(); }); return group; }; render() { const { conditions } = this.state; const { ledgerStore: { searchForm } } = this.props; return ({this.formRender(searchForm, conditions)}); } } export default LedgerSearchComp;