feature/2.9.42310.01-工资单发放页面重构

This commit is contained in:
黎永顺 2023-10-13 10:20:14 +08:00
parent 02863814ba
commit ab3be2c1f9
1 changed files with 26 additions and 10 deletions

View File

@ -5,6 +5,7 @@
* Date: 2023/10/12
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaLocaleProvider, WeaTable } from "ecCom";
import { Dropdown, Menu, Tag } from "antd";
import { getPayrollList } from "../../../../apis/payroll";
@ -12,6 +13,8 @@ import moment from "moment";
const getLabel = WeaLocaleProvider.getLabel;
@inject("taxAgentStore")
@observer
class Index extends Component {
constructor(props) {
super(props);
@ -80,6 +83,7 @@ class Index extends Component {
render() {
const { loading, dataSource, columns, pageInfo } = this.state;
const { taxAgentStore: { showOperateBtn } } = this.props;
const pagination = {
...pageInfo,
showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
@ -106,17 +110,29 @@ class Index extends Component {
{
dataIndex: "operate", title: getLabel(30585, "操作"), width: 170,
render: (__, record) => {
const { canSeeDetail, sendNum, sendTotal, haveBackCalc, salaryAcctType } = record;
//显示更新模板
const showGrant = haveBackCalc === 1 && salaryAcctType === 0;
return <React.Fragment>
<a href="javascript:void(0);" style={{ marginRight: 10 }}>{getLabel(542702, "发放")}</a>
<a href="javascript:void(0);" style={{ marginRight: 10 }}>{getLabel(83110, "查看详情")}</a>
<Dropdown
overlay={<Menu>
<Menu.Item key="1">{getLabel(543603, "更新模板")}</Menu.Item>
</Menu>
}
>
<a href="javascript:void(0);"><i className="icon-coms-more"/></a>
</Dropdown>
{
showOperateBtn &&
<a href="javascript:void(0);" style={{ marginRight: 10 }}>{getLabel(542702, "发放")}</a>
}
{
canSeeDetail &&
<a href="javascript:void(0);" style={{ marginRight: 10 }}>{getLabel(83110, "查看详情")}</a>
}
{
sendNum !== sendTotal && !showGrant &&
<Dropdown
overlay={<Menu>
<Menu.Item key="1">{getLabel(543603, "更新模板")}</Menu.Item>
</Menu>
}
>
<a href="javascript:void(0);"><i className="icon-coms-more"/></a>
</Dropdown>
}
</React.Fragment>;
}
}