/* * * 查看工资单详情-重构页面 * @Author: 黎永顺 * @Date: 2024/7/15 * @Wechat: * @Email: 971387674@qq.com * @description: */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { toJS } from "mobx"; import { WeaLoadingGlobal, WeaLocaleProvider, WeaTop } from "ecCom"; import { Button } from "antd"; import AdvanceInputBtn from "./components/advanceInputBtn"; import SalaryMonthHelpfulTip from "./components/salaryMonthHelpfulTip"; import SalaryDetailSearchPannel from "./components/salaryDetailSearchPannel"; import SalaryDetailList from "./components/salaryDetailList"; import { getQueryString } from "../../../util/url"; import { removePropertyCondition } from "../../../util/response"; import { sysConfCodeRule } from "../../../apis/ruleconfig"; import * as API from "../../../apis/payroll"; import cs from "classnames"; import "./index.less"; const getLabel = WeaLocaleProvider.getLabel; @inject("taxAgentStore", "payrollStore") @observer class PayrollDetail extends Component { constructor(props) { super(props); this.state = { salarySendDetailBaseInfo: {}, showSearchAd: false, isQuery: false, conditions: [], showTotalCell: false }; this.listRef = null; } async componentDidMount() { const id = getQueryString("id"); const { payrollStore: { detailListConditionForm } } = this.props; const [{ data: salarySendDetailBaseInfo }, { data }, { data: confCode }] = await Promise.all([ API.getPayrollInfo({ id }), API.getPayrollDetailSa(), sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" }) ]); this.setState({ salarySendDetailBaseInfo, showTotalCell: confCode === "1", conditions: removePropertyCondition(data.condition) }, () => detailListConditionForm.initFormFields(this.state.conditions)); } handleExportAll = () => { const { payrollStore: { salaryTableStore } } = this.props; const columns = _.filter(toJS(salaryTableStore.columns), (item) => item.display === "true"); WeaLoadingGlobal.start(); const salarySendId = getQueryString("id"); const promise = API.exportDetailList_reconfig({ salarySendId, columns: _.map(columns, it => it.dataIndex) }); }; render() { const { salarySendDetailBaseInfo, showSearchAd, conditions, isQuery, showTotalCell } = this.state; const { taxAgentStore: { showOperateBtn } } = this.props; const { salaryMonth, template } = salarySendDetailBaseInfo; const dropMenuDatas = [ { key: "BTN_COLUMN", icon: , content: getLabel(111, "显示列定制"), onClick: () => this.listRef.wrappedInstance.handleSetCustomCols() } ]; const btns = [ , this.setState({ showSearchAd: true })} onAdvanceSearch={() => this.setState({ isQuery: !isQuery })}/> ]; !showOperateBtn && btns.shift(); return ( } iconBgcolor="#F14A2D" showDropIcon={true} dropMenuDatas={dropMenuDatas} buttons={btns} className="salary-payroll-details-layout" >
{getLabel(111, "薪资所属月")}{salaryMonth}    { !_.isEmpty(salarySendDetailBaseInfo) && } {getLabel(111, "工资单模板")}{template}
this.setState({ showSearchAd: false })} onAdSearch={() => this.setState({ isQuery: !isQuery })} conditions={conditions}/>
{/*列表*/} this.listRef = dom}/>
); } } export default PayrollDetail;