feature/2.9.42310.01-工资单发放导出PDF

20230926
This commit is contained in:
黎永顺 2023-09-26 16:38:47 +08:00
parent 1f37bdde4b
commit 4bb3bc403a
1 changed files with 38 additions and 10 deletions

View File

@ -306,7 +306,6 @@ export default class PayrollGrant extends React.Component {
const { selectedKey, showFeedbackColumn } = this.state;
const { payrollStore } = this.props;
const { salaryGrantTableStore: columns, salarySendDetailBaseInfo } = payrollStore;
const notShowGrantOrWithdraw = salarySendDetailBaseInfo.haveBackCalc === 1 && salarySendDetailBaseInfo.salaryAcctType === "0";
return _.map([
..._.filter(toJS(columns), it => ((selectedKey === "0" && it.dataIndex !== "billReadStatus" && it.dataIndex !== "billConfirmStatus") || (selectedKey === "1" && !showFeedbackColumn && it.dataIndex !== "billReadStatus" && it.dataIndex !== "billConfirmStatus") || (selectedKey === "1" && showFeedbackColumn))),
{
@ -315,14 +314,37 @@ export default class PayrollGrant extends React.Component {
dataIndex: "",
display: true,
render: (text, record) => {
if (record.sendStatus === "1" && salarySendDetailBaseInfo.canSend) {
return (
<a
href="javascript:void(0);"
onClick={() => this.handleWithdraw({ ids: [record.id] })}>
撤回
</a>
);
if (record.sendStatus === "1") {
if (salarySendDetailBaseInfo.canSend) {
return (
<React.Fragment>
<a
href="javascript:void(0);" style={{ marginRight: 10 }}
onClick={() => this.handleWithdraw({ ids: [record.id] })}>
撤回
</a>
<a
href="javascript:void(0);"
onClick={() => {
window.open(`${window.ecologyContentPath || ""}/api/bs/hrmsalary/salaryBill/send/exportPdf?id=${record.id}`, "_blank");
}}>
{getLabel(111, "导出PDF")}
</a>
</React.Fragment>
);
} else {
return (
<React.Fragment>
<a
href="javascript:void(0);"
onClick={() => {
window.open(`${window.ecologyContentPath || ""}/api/bs/hrmsalary/salaryBill/send/exportPdf?id=${record.id}`, "_blank");
}}>
{getLabel(111, "导出PDF")}
</a>
</React.Fragment>
);
}
} else if (salarySendDetailBaseInfo.canSend) {
return (
<a
@ -350,7 +372,6 @@ export default class PayrollGrant extends React.Component {
getSearchsAdQuick() {
const { payrollStore } = this.props;
const { salarySendDetailBaseInfo, btnLoading } = payrollStore;
const notShowGrantOrWithdraw = salarySendDetailBaseInfo.haveBackCalc === 1 && salarySendDetailBaseInfo.salaryAcctType === "0";
const { selectedKey } = this.state;
const handleMenuClick = e => {
switch (e.key) {
@ -360,6 +381,9 @@ export default class PayrollGrant extends React.Component {
case "4":
this.handleExportSelect();
break;
case "5":
window.open(`${window.ecologyContentPath || ""}/api/bs/hrmsalary/salaryBill/send/exportPdf?salarySendId=${getQueryString("id")}`, "_blank");
break;
default:
break;
}
@ -368,6 +392,10 @@ export default class PayrollGrant extends React.Component {
<Menu onClick={handleMenuClick}>
<Menu.Item key="3">全部导出</Menu.Item>
<Menu.Item key="4">导出选中</Menu.Item>
{
selectedKey === "1" &&
<Menu.Item key="5">{getLabel(111, "导出PDF")}</Menu.Item>
}
</Menu>
);
let btnDom = [