custom/钱智

This commit is contained in:
lys 2025-11-14 10:34:18 +08:00
parent 7aa1c7afc6
commit 72adc68307
3 changed files with 36 additions and 10 deletions

View File

@ -311,3 +311,7 @@ export const afterTaxAccounting = (params) => {
export const getAfterTaxAccountingProgress = (id) => { export const getAfterTaxAccountingProgress = (id) => {
return WeaTools.callApi("/api/bs/hrmsalary/progress/getRate?cacheKey=AFTER_TAX_ACCT_PROGRESS_" + id, "get", {}); 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);
};

View File

@ -15,7 +15,7 @@ import CalculateTablelist from "./components/calculateTablelist";
import CalculateDialog from "./components/calculateDialog"; import CalculateDialog from "./components/calculateDialog";
import ProgressModal from "../../components/progressModal"; import ProgressModal from "../../components/progressModal";
import LogDialog from "../../components/logViewModal"; 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 FormInfo from "../../components/FormInfo";
import { queryConditions } from "./config"; import { queryConditions } from "./config";
import { postFetch } from "../../util/request"; import { postFetch } from "../../util/request";
@ -40,7 +40,8 @@ class Calculate extends Component {
] ]
}, isRefresh: false, logDialogVisible: false, conditions: [], }, isRefresh: false, logDialogVisible: false, conditions: [],
progressModule: { visible: false, progress: 0, title: getLabel(111, "正在归档中请稍后") }, 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.timer = null;
this.handleDebounce = null; this.handleDebounce = null;
@ -63,7 +64,7 @@ class Calculate extends Component {
renderCalculateOpts = () => { renderCalculateOpts = () => {
const { taxAgentStore: { PageAndOptAuth } } = this.props; 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"); const admin = PageAndOptAuth.opts.includes("admin");
let calculateOpts = [ let calculateOpts = [
<Button type="primary" onClick={() => this.setState({ <Button type="primary" onClick={() => this.setState({
@ -72,13 +73,28 @@ class Calculate extends Component {
title: getLabel(538780, "核算") title: getLabel(538780, "核算")
} }
})}>{getLabel(538780, "核算")}</Button>, })}>{getLabel(538780, "核算")}</Button>,
<Button type="ghost" loading={loading} disabled={_.isEmpty(selectedRowKeys)}
onClick={this.handleBatAccounting}>{getLabel(111, "批量计算薪资")}</Button>,
<CalculateQuery queryParams={queryParams} onAdvance={() => this.setState({ showAdvance: !showAdvance })} <CalculateQuery queryParams={queryParams} onAdvance={() => this.setState({ showAdvance: !showAdvance })}
onChange={v => this.setState({ onChange={v => this.setState({
isRefresh: _.keys(v)[0] === "name" ? isRefresh : !isRefresh, isRefresh: _.keys(v)[0] === "name" ? isRefresh : !isRefresh,
queryParams: { ...queryParams, ...v } queryParams: { ...queryParams, ...v }
})} onSearch={() => this.setState({ isRefresh: !isRefresh })}/> })} 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) => { handleCalcOpts = ({ key }, record) => {
const { isRefresh, progressModule } = this.state, { id } = record; const { isRefresh, progressModule } = this.state, { id } = record;
@ -213,7 +229,8 @@ class Calculate extends Component {
render() { render() {
const { const {
queryParams, isRefresh, calcDaialog, progressModule, logDialogVisible, filterConditions, conditions, showAdvance queryParams, isRefresh, calcDaialog, progressModule, logDialogVisible, filterConditions, conditions, showAdvance,
selectedRowKeys
} = this.state; } = this.state;
return ( return (
<WeaTop title={getLabel(538011, "薪资核算")} icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D" <WeaTop title={getLabel(538011, "薪资核算")} icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
@ -237,7 +254,8 @@ class Calculate extends Component {
</div> </div>
</div> </div>
<CalculateTablelist form={form} queryParams={queryParams} isRefresh={isRefresh} <CalculateTablelist form={form} queryParams={queryParams} isRefresh={isRefresh}
onCalcOpts={this.handleCalcOpts}/> onCalcOpts={this.handleCalcOpts} selectedRowKeys={selectedRowKeys}
onSelectChange={v => this.setState({ selectedRowKeys: v })}/>
<CalculateDialog {...calcDaialog} <CalculateDialog {...calcDaialog}
onCancel={(bool, id) => this.setState({ onCancel={(bool, id) => this.setState({
calcDaialog: { ...calcDaialog, visible: false }, calcDaialog: { ...calcDaialog, visible: false },

View File

@ -130,7 +130,7 @@ class Index extends Component {
}; };
render() { render() {
const { loading, dataSource, columns, pageInfo } = this.state; const { loading, dataSource, columns, pageInfo } = this.state, { selectedRowKeys, onSelectChange } = this.props;
const pagination = { const pagination = {
...pageInfo, ...pageInfo,
showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`, showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
@ -148,11 +148,15 @@ class Index extends Component {
}, () => this.getSalaryAcctList(this.props)); }, () => this.getSalaryAcctList(this.props));
} }
}; };
const rowSelection = {
selectedRowKeys,
onChange: onSelectChange
};
return ( return (
<WeaTable <WeaTable
rowKey="id" scroll={{ y: "calc(100vh - 152px)" }} rowKey="id" scroll={{ y: "calc(100vh - 152px)" }}
dataSource={dataSource} loading={loading} dataSource={dataSource} loading={loading}
pagination={pagination} columns={columns} pagination={pagination} columns={columns} rowSelection={rowSelection}
/> />
); );
} }