From 0f2b63c980266685dc196f8918a8af9f145441d4 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Mon, 24 Nov 2025 16:59:34 +0800 Subject: [PATCH] =?UTF-8?q?custom/=E9=92=B1=E6=99=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/apis/payroll.js | 9 +++++- .../components/grantTableList/index.js | 32 +++++++++++++++---- .../hrmSalary/pages/payrollRelease/index.js | 15 +++++++-- 3 files changed, 47 insertions(+), 9 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/payroll.js b/pc4mobx/hrmSalary/apis/payroll.js index fdef4e0e..751235a5 100644 --- a/pc4mobx/hrmSalary/apis/payroll.js +++ b/pc4mobx/hrmSalary/apis/payroll.js @@ -264,4 +264,11 @@ export const salaryBillPreview = (params) => { export const exportDetailList_reconfig = (params) => { return postExportFetch("/api/bs/hrmsalary/salaryBill/send/exportDetailList", params); }; - +//工资单-钱智批量发放 +export const batGrant = params => { + return postFetch("/api/bs/hrmsalary/salaryBill/send/batGrant", params); +}; +//工资单-钱智批量撤回 +export const batWithdraw = params => { + return postFetch("/api/bs/hrmsalary/salaryBill/send/batWithdraw", params); +}; \ No newline at end of file diff --git a/pc4mobx/hrmSalary/pages/payrollRelease/components/grantTableList/index.js b/pc4mobx/hrmSalary/pages/payrollRelease/components/grantTableList/index.js index 4bdb7293..30143435 100644 --- a/pc4mobx/hrmSalary/pages/payrollRelease/components/grantTableList/index.js +++ b/pc4mobx/hrmSalary/pages/payrollRelease/components/grantTableList/index.js @@ -7,17 +7,20 @@ import React, { Component } from "react"; import { WeaLocaleProvider, WeaTable } from "ecCom"; import { Dropdown, Menu, message, Tag } from "antd"; -import { getPayrollList } from "../../../../apis/payroll"; +import { batGrant, batWithdraw, getPayrollList } from "../../../../apis/payroll"; import moment from "moment"; const getLabel = WeaLocaleProvider.getLabel; +const batAPI = { + batGrant, batWithdraw +}; class Index extends Component { constructor(props) { super(props); this.state = { - loading: false, columns: [], dataSource: [], - pageInfo: { current: 1, pageSize: 10, total: 0 } + loading: false, columns: [], dataSource: [], selectedRowKeys: [], + pageInfo: { current: 1, pageSize: 10, total: 0 }, batLoading: false }; } @@ -87,6 +90,19 @@ class Index extends Component { message.warning(getLabel(543602, "请设置默认模板")); } break; + case "batGrant": + case "batWithdraw": + this.setState({ batLoading: true }); + batAPI[key]({ salarySendIds: this.state.selectedRowKeys }).then(({ status, errormsg }) => { + this.setState({ batLoading: false }); + if (status) { + message.success(getLabel(111, "操作成功!")); + this.getPayrollList(this.props); + } else { + message.error(errormsg); + } + }).catch(() => this.setState({ batLoading: false })); + break; case "log": this.props.onFilterLog(key, id); break; @@ -96,7 +112,7 @@ class Index extends Component { }; render() { - const { loading, dataSource, columns, pageInfo } = this.state; + const { loading, dataSource, columns, pageInfo, selectedRowKeys } = this.state; const pagination = { ...pageInfo, showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, @@ -114,10 +130,14 @@ class Index extends Component { }, () => this.getPayrollList(this.props)); } }; + const rowSelection = { + selectedRowKeys, + onChange: selectedRowKeys => this.setState({ selectedRowKeys }, () => this.props.forceUpdate()) + }; return ( { + this.grantRef.handleOpts({ key: "batGrant" }, {}); + }}>{getLabel(111, "批量发放")}, + , this.setState({ isRefresh: !isRefresh, queryParams: { ...queryParams, ...v } })}/> ]; + !showOperateBtn && (reqBtns = reqBtns.slice(-1)); break; case "template": const loading = this.templateRef ? this.templateRef.state.delLoading : false; @@ -92,7 +102,8 @@ class Index extends Component { let dom = null; switch (selectedKey) { case "grant": - dom = this.grantRef = dom} + forceUpdate={() => this.forceUpdate()} onUpdateTemp={(id) => this.setState({ selectedKey: "template" }, () => { this.templateRef.handleOpts({ key: "edit" }, { id }); })} @@ -163,4 +174,4 @@ class Index extends Component { } } -export default Index; +export default Index; \ No newline at end of file