/*
* Author: 黎永顺
* name: 薪资核算-列表
* Description:
* Date: 2023/10/9
*/
import React, { Component } from "react";
import { WeaHelpfulTip, WeaLocaleProvider, WeaTable } from "ecCom";
import { Dropdown, Menu, Tag } from "antd";
import { getSalaryAcctList } from "../../../../apis/calculate";
const getLabel = WeaLocaleProvider.getLabel;
class Index extends Component {
constructor(props) {
super(props);
this.state = {
loading: false, columns: [], dataSource: [],
pageInfo: { current: 1, pageSize: 10, total: 0 }
};
}
componentDidMount() {
this.getSalaryAcctList(this.props);
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.isRefresh !== this.props.isRefresh) this.getSalaryAcctList(nextProps);
}
getSalaryAcctList = (props) => {
const { pageInfo } = this.state, { queryParams, form } = props;
const { taxAgentIds } = form.getFormParams();
const { dateRange, ...extra } = queryParams;
const [startMonthStr, endMonthStr] = dateRange || [];
const params = { startMonthStr, endMonthStr, ...extra };
const payload = {
...pageInfo, ...params, taxAgentIds: taxAgentIds ? taxAgentIds.split(",") : []
};
this.setState({ loading: true });
getSalaryAcctList(payload).then(({ status, data }) => {
this.setState({ loading: false });
if (status) {
const { columns, list: dataSource, pageNum, pageSize, total } = data;
this.setState({
dataSource, pageInfo: { ...pageInfo, pageNum, pageSize, total },
columns: _.map(_.filter(columns, it => (it.dataIndex !== "backCalcStatus" && it.dataIndex !== "acctTimes")),
o => {
const { dataIndex } = o;
let width = "";
switch (dataIndex) {
case "status":
case "employeeSize":
width = "5%";
break;
case "salarySobName":
width = "20%";
break;
case "description":
width = "15%";
break;
default:
width = "10%";
break;
}
if (dataIndex === "operate") {
return {
...o, width: 170,
title:
{getLabel(30585, "操作")}