/* * 领悦二开 * 核算账簿-推送弹框 * @Author: 黎永顺 * @Date: 2024/10/10 * @Wechat: * @Email: 971387674@qq.com * @description: */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom"; import { getHszb } from "../../../../apis/custom-apis/lingyue"; import { acctBookConditions } from "./conditions"; import { getSearchs } from "../../../../util"; import { Button } from "antd"; import moment from "moment"; const getLabel = WeaLocaleProvider.getLabel; const getKey = WeaTools.getKey; @inject("LYStore") @observer class AcctBookDialog extends Component { constructor(props) { super(props); this.state = { conditions: [] }; } componentWillReceiveProps(nextProps, nextContext) { if (nextProps.visible !== this.props.visible && nextProps.visible) this.acctBookForm(); if (nextProps.visible !== this.props.visible && !nextProps.visible) nextProps.LYStore.initAcctBookForm(); } acctBookForm = async () => { const { data } = await getHszb({ ffgsqc: decodeURI(WeaTools.getUrlParams().ffgsqc) }); this.setState({ conditions: _.map(acctBookConditions, item => ({ ...item, items: _.map(item.items, o => { if (getKey(o) === "zdrq") { return { ...o, label: getLabel(o.lanId, o.label), value: moment().format("YYYY-MM-DD") }; } else if (getKey(o) === "zbbm") { return { ...o, label: getLabel(o.lanId, o.label), browserConditionParam: { ...o.browserConditionParam, replaceDatas: [data] } }; } return { ...o, label: getLabel(o.lanId, o.label) }; }) })) }, () => { const { LYStore: { acctBookForm } } = this.props; acctBookForm.initFormFields(this.state.conditions); }); }; save = () => { const { LYStore: { acctBookForm } } = this.props; acctBookForm.validateForm().then(f => { if (f.isValid) { this.props.onPushNotifications(); } else { f.showErrors(); } }); }; render() { const { conditions } = this.state; const { LYStore: { acctBookForm }, loading } = this.props; return ( (pre += cur.items.length), 0) * 47 + 33 }} buttons={[ ]} >
{getSearchs(acctBookForm, conditions, 1, false)}
); } } export default AcctBookDialog;