From 72adc68307ae9e530bc86ad9ec77ad052f2d99b2 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Fri, 14 Nov 2025 10:34:18 +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/calculate.js | 4 +++ .../hrmSalary/pages/calculate/calculate.js | 32 +++++++++++++++---- .../components/calculateTablelist/index.js | 10 ++++-- 3 files changed, 36 insertions(+), 10 deletions(-) diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js index 8cbdba28..aee23326 100644 --- a/pc4mobx/hrmSalary/apis/calculate.js +++ b/pc4mobx/hrmSalary/apis/calculate.js @@ -311,3 +311,7 @@ export const afterTaxAccounting = (params) => { export const getAfterTaxAccountingProgress = (id) => { return WeaTools.callApi("/api/bs/hrmsalary/progress/getRate?cacheKey=AFTER_TAX_ACCT_PROGRESS_" + id, "get", {}); }; +// 批量计算薪资-钱智 +export const batAccounting = (params) => { + return postFetch("/api/bs/hrmsalary/salaryacct/batAccounting", params); +}; \ No newline at end of file diff --git a/pc4mobx/hrmSalary/pages/calculate/calculate.js b/pc4mobx/hrmSalary/pages/calculate/calculate.js index b05b7b3e..bffb5f4d 100644 --- a/pc4mobx/hrmSalary/pages/calculate/calculate.js +++ b/pc4mobx/hrmSalary/pages/calculate/calculate.js @@ -15,7 +15,7 @@ import CalculateTablelist from "./components/calculateTablelist"; import CalculateDialog from "./components/calculateDialog"; import ProgressModal from "../../components/progressModal"; import LogDialog from "../../components/logViewModal"; -import { backCalculate, deleteSalaryacct, fileSalaryAcct, reAccounting } from "../../apis/calculate"; +import { backCalculate, batAccounting, deleteSalaryacct, fileSalaryAcct, reAccounting } from "../../apis/calculate"; import FormInfo from "../../components/FormInfo"; import { queryConditions } from "./config"; import { postFetch } from "../../util/request"; @@ -40,7 +40,8 @@ class Calculate extends Component { ] }, isRefresh: false, logDialogVisible: false, conditions: [], progressModule: { visible: false, progress: 0, title: getLabel(111, "正在归档中请稍后") }, - calcDaialog: { visible: false, title: "" }, showAdvance: false + calcDaialog: { visible: false, title: "" }, showAdvance: false, selectedRowKeys: [], + loading: false }; this.timer = null; this.handleDebounce = null; @@ -63,7 +64,7 @@ class Calculate extends Component { renderCalculateOpts = () => { const { taxAgentStore: { PageAndOptAuth } } = this.props; - const { queryParams, isRefresh, showAdvance } = this.state; + const { queryParams, isRefresh, showAdvance, loading, selectedRowKeys } = this.state; const admin = PageAndOptAuth.opts.includes("admin"); let calculateOpts = [ , + , this.setState({ showAdvance: !showAdvance })} onChange={v => this.setState({ isRefresh: _.keys(v)[0] === "name" ? isRefresh : !isRefresh, queryParams: { ...queryParams, ...v } })} onSearch={() => this.setState({ isRefresh: !isRefresh })}/> ]; - return !admin ? calculateOpts.slice(1) : calculateOpts; + return !admin ? calculateOpts.slice(2) : calculateOpts; + }; + handleBatAccounting = () => { + const { selectedRowKeys: salaryAcctRecordIds, isRefresh } = this.state; + this.setState({ loading: true }); + batAccounting({ salaryAcctRecordIds }).then(({ status, errormsg }) => { + this.setState({ loading: false }); + if (status) { + message.success(getLabel(111, "操作成功!")); + this.setState({ isRefresh: !isRefresh }); + } else { + message.error(errormsg); + } + }); }; handleCalcOpts = ({ key }, record) => { const { isRefresh, progressModule } = this.state, { id } = record; @@ -213,7 +229,8 @@ class Calculate extends Component { render() { const { - queryParams, isRefresh, calcDaialog, progressModule, logDialogVisible, filterConditions, conditions, showAdvance + queryParams, isRefresh, calcDaialog, progressModule, logDialogVisible, filterConditions, conditions, showAdvance, + selectedRowKeys } = this.state; return ( } iconBgcolor="#F14A2D" @@ -237,7 +254,8 @@ class Calculate extends Component { + onCalcOpts={this.handleCalcOpts} selectedRowKeys={selectedRowKeys} + onSelectChange={v => this.setState({ selectedRowKeys: v })}/> this.setState({ calcDaialog: { ...calcDaialog, visible: false }, @@ -268,4 +286,4 @@ class Calculate extends Component { } } -export default Calculate; +export default Calculate; \ No newline at end of file diff --git a/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js b/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js index 0b4ea0a0..f0928ada 100644 --- a/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js +++ b/pc4mobx/hrmSalary/pages/calculate/components/calculateTablelist/index.js @@ -130,7 +130,7 @@ class Index extends Component { }; render() { - const { loading, dataSource, columns, pageInfo } = this.state; + const { loading, dataSource, columns, pageInfo } = this.state, { selectedRowKeys, onSelectChange } = this.props; const pagination = { ...pageInfo, showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, @@ -148,14 +148,18 @@ class Index extends Component { }, () => this.getSalaryAcctList(this.props)); } }; + const rowSelection = { + selectedRowKeys, + onChange: onSelectChange + }; return ( ); } } -export default Index; +export default Index; \ No newline at end of file