custom/钱智

This commit is contained in:
lys 2025-12-03 14:35:21 +08:00
parent 19129e8b5c
commit f0a536e0ff
4 changed files with 79 additions and 13 deletions

View File

@ -229,3 +229,15 @@ export const addSocialAcctEmp = (params) => {
export const deleteSocialAcctEmp = (params) => {
return postFetch("/api/bs/hrmsalary/siaccount/deleteSocialAcctEmp", params);
};
// 钱智二开-社保报表导出
export const exportQZReport = params => {
return postExportFetch("/api/bs/hrmsalary/siaccount/exportQZReport", params);
};
// 钱智二开-封存
export const batFC = params => {
return postFetch("/api/bs/hrmsalary/siaccount/batFC", params);
};
// 钱智二开-封存权限
export const fcAuth = params => {
return postFetch("/api/bs/hrmsalary/siaccount/fcAuth", params);
};

View File

@ -265,7 +265,7 @@ class EditCalcTable extends Component {
if (status) {
const { columns, pageInfo: list, msg } = data;
const { list: dataSource, pageNum: current, pageSize, total } = list;
this.props.onSetFormInfo(msg);
this.props.onSetFormInfo && this.props.onSetFormInfo(msg);
this.setState({ pageInfo: { ...pageInfo, current, pageSize, total } }, () => {
const { pageInfo, selectedRowKeys } = this.state;
const sumRowlistUrl = this.props.showTotalCell ? "/api/bs/hrmsalary/salaryacct/acctresult/sum" : "";

View File

@ -44,6 +44,10 @@ class WelfareRecordList extends Component {
case "PAGEINFO":
this.setState({ pageInfo: { ...pageInfo, ...params } }, () => this.getWelfareRecordList());
break;
case "CHECKBOX":
const { selectedRowKeys } = params;
this.props.onChangeSelectedRowKeys(selectedRowKeys);
break;
case "CALC":
case "VIEW":
const payload = {
@ -105,6 +109,17 @@ class WelfareRecordList extends Component {
case "log":
this.props.onFilterLog(id, params.id);
break;
case "FC":
API.batFC({ ids: [params.id], fc: !params.fc ? "FC" : "JF" })
.then(({ status, data, errormsg }) => {
if (status) {
message.success(data || getLabel(111, "操作成功!"));
this.getWelfareRecordList();
} else {
message.error(errormsg);
}
});
break;
default:
break;
}
@ -123,7 +138,7 @@ class WelfareRecordList extends Component {
childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
};
getWelfareRecordList = () => {
const { queryForm } = this.props;
const { queryForm, selectedRowKeys, fcAuth } = this.props;
const { pageInfo } = this.state;
const payload = { ...pageInfo, ...queryForm, taxAgents: queryForm.taxAgents ? queryForm.taxAgents.split(",") : [] };
this.setState({ loading: true });
@ -133,11 +148,18 @@ class WelfareRecordList extends Component {
const { pageInfo: result } = data;
let { columns, list: dataSource, pageNum: current, pageSize, total } = result;
columns = _.map(columns, o => ({ ...o, width: o.dataIndex === "paymentOrganization" ? 300 : o.width }));
dataSource = _.map(dataSource, o => {
if (o.billStatus === "1" && fcAuth) {
return { ...o, qzOpts: [{ key: "FC", label: !o.fc ? getLabel(111, "封存") : getLabel(111, "解封") }] };
}
return o;
});
this.setState({
pageInfo: { ...pageInfo, current, pageSize, total },
dataSource, columns
}, () => this.postMessageToChild({
scrollHeight: 108, dataSource, columns, pageInfo: this.state.pageInfo, unitTableType: "welfareRecord"
scrollHeight: 108, dataSource, columns, pageInfo: this.state.pageInfo, unitTableType: "welfareRecord",
selectedRowKeys
}));
}
}).catch(() => this.setState({ loading: false }));

View File

@ -7,7 +7,7 @@
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaLocaleProvider, WeaTop } from "ecCom";
import { WeaLoadingGlobal, WeaLocaleProvider, WeaTop } from "ecCom";
import { Button, message } from "antd";
import * as API from "../../../apis/standingBook";
import { getCalculateProgress } from "../../../apis/calculate";
@ -32,7 +32,7 @@ class StandingBook extends Component {
startTime: moment(new Date()).subtract(1, "year").startOf("year").format("YYYY-MM"),
endTime: moment(new Date()).endOf("year").format("YYYY-MM"),
taxAgents: ""
}, progressVisible: false, progress: 0,
}, progressVisible: false, progress: 0, selectedRowKeys: [], fcAuth: false,
accountDialog: { visible: false, title: "", loading: false, options: [] },
logDialogVisible: false, filterConditions: "[]"
};
@ -40,6 +40,10 @@ class StandingBook extends Component {
this.timer = null;
}
componentDidMount() {
API.fcAuth({}).then(({ data, status }) => this.setState({ fcAuth: status && data }));
}
/*
* Author: 黎永顺
* Description: 社保福利台账重构-核算
@ -60,7 +64,10 @@ class StandingBook extends Component {
progressVisible: true
}, () => {
this.timer = setInterval(() => {
getCalculateProgress(moment(billMonth).format("YYYY-MM"), payload.paymentOrganization).then(({ status, data }) => {
getCalculateProgress(moment(billMonth).format("YYYY-MM"), payload.paymentOrganization).then(({
status,
data
}) => {
if (status) {
if (!data.status) {
clearInterval(this.timer);
@ -112,18 +119,41 @@ class StandingBook extends Component {
filterConditions: targetid ? `[{\"connectCondition\":\"AND\",\"columIndex\":\"targetid\",\"type\":\"=\",\"value\":\"${targetid}\"}]` : "[]"
});
break;
case "QZBatchExp":
WeaLoadingGlobal.start();
const promise = API.exportQZReport({ ids: this.state.selectedRowKeys });
break;
case "QZBatchFc":
API.batFC({ ids: this.state.selectedRowKeys, fc: targetid }).then(({ status, data, errormsg }) => {
if (status) {
message.success(data || getLabel(111, "操作成功!"));
this.wfListRef.getWelfareRecordList();
} else {
message.error(errormsg);
}
});
break;
default:
break;
}
};
render() {
const { accountDialog, queryForm, logDialogVisible, filterConditions } = this.state;
const { accountDialog, queryForm, logDialogVisible, filterConditions, selectedRowKeys, fcAuth } = this.state;
const { taxAgentStore: { PageAndOptAuth } } = this.props;
const showOperateBtn = PageAndOptAuth.opts.includes("admin");
const rightBtns = [<Button type="primary" onClick={() => this.setState({
accountDialog: { ...accountDialog, visible: true, title: getLabel(538780, "核算") }
})}>{getLabel(538780, "核算")}</Button>];
const rightBtns = [
<Button type="primary" disabled={_.isEmpty(selectedRowKeys)}
onClick={() => this.onDropMenuClick("QZBatchExp")}>{getLabel(111, "批量导出")}</Button>,
<Button type="primary" disabled={_.isEmpty(selectedRowKeys)}
onClick={() => this.onDropMenuClick("QZBatchFc", "FC")}>{getLabel(111, "批量封存")}</Button>,
<Button type="primary" disabled={_.isEmpty(selectedRowKeys)}
onClick={() => this.onDropMenuClick("QZBatchFc", "JF")}>{getLabel(111, "批量解封")}</Button>,
<Button type="primary" onClick={() => this.setState({
accountDialog: { ...accountDialog, visible: true, title: getLabel(538780, "核算") }
})}>{getLabel(538780, "核算")}</Button>
];
!fcAuth && rightBtns.splice(1, 2);
return (<WeaTop title={getLabel(538002, "社保福利台账")} icon={<i className="icon-coms-fa"/>}
iconBgcolor="#F14A2D" buttons={showOperateBtn ? rightBtns : []} className="salary-welfare-record"
showDropIcon onDropMenuClick={this.onDropMenuClick}
@ -143,7 +173,9 @@ class StandingBook extends Component {
onPutAccountOptions={options => this.setState({ accountDialog: { ...accountDialog, options } })}
/>
<WelfareRecordList ref={dom => this.wfListRef = dom} queryForm={queryForm}
onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)}/>
onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)}
selectedRowKeys={selectedRowKeys} fcAuth={fcAuth}
onChangeSelectedRowKeys={v => this.setState({ selectedRowKeys: v })}/>
</div>
<Accountdialog {...accountDialog}
onCancel={() => this.setState({