feature/2.19.1.2501.01-薪酬批量操作

This commit is contained in:
lys 2025-06-03 17:22:18 +08:00
parent 2b639ad388
commit b9efc6386e
19 changed files with 490 additions and 153 deletions

View File

@ -10,6 +10,10 @@ export const getSalaryAcctList = params => {
export const saveBasic = params => {
return postFetch("/api/bs/hrmsalary/salaryacct/basic/save", params);
};
// 薪资记录--批量薪资核算
export const batSaveBasic = params => {
return postFetch("/api/bs/hrmsalary/salaryacct/basic/batSave", params);
};
// 薪资记录--薪资核算详情
export const salaryacctGetForm = params => {
@ -120,6 +124,10 @@ export const fileSalaryAcct = (params) => {
}
}).then(res => res.json());
};
// 薪资记录-批量归档
export const batFile = (params) => {
return postFetch("/api/bs/hrmsalary/salaryacct/batFile", params);
};
// 薪资记录-回算
export const backCalculate = (params) => {
return postFetch("/api/bs/hrmsalary/salaryacct/backCalculate", params);
@ -129,6 +137,10 @@ export const backCalculate = (params) => {
export const reAccounting = (params) => {
return postFetch("/api/bs/hrmsalary/salaryacct/reAccounting", params);
};
// 薪资记录-批量重新核算
export const batReAccounting = (params) => {
return postFetch("/api/bs/hrmsalary/salaryacct/batReAccounting", params);
};
// 薪资结果-编辑表单保存
export const saveAcctResult = (params) => {
@ -219,7 +231,7 @@ export const exportComparisonResult = (salaryAcctRecordId) => {
// 核算进度条
export const getCalculateProgress = (id = "", paymentOrganization = "") => {
const extra= paymentOrganization ? `_${paymentOrganization}` : paymentOrganization
const extra = paymentOrganization ? `_${paymentOrganization}` : paymentOrganization;
return WeaTools.callApi(`/api/bs/hrmsalary/progress/getRate?cacheKey=ACCT_PROGRESS_${id}${extra}`, "get", {});
};

View File

@ -10,6 +10,10 @@ export const getDeclareList = params => {
export const saveDeclare = params => {
return postFetch("/api/bs/hrmsalary/taxdeclaration/save", params);
};
//个税申报表-个税申报表批量生成
export const batSaveDeclare = params => {
return postFetch("/api/bs/hrmsalary/taxdeclaration/batSave", params);
};
//个税申报表-个税申报表相关信息
export const getDeclareInfo = params => {

View File

@ -25,11 +25,19 @@ export const getPaySa = params => {
export const grantPayroll = params => {
return postFetch("/api/bs/hrmsalary/salaryBill/send/grant", params);
};
//工资单-批量工资单发放
export const batGrantPayroll = params => {
return postFetch("/api/bs/hrmsalary/salaryBill/send/batGrant", params);
};
//工资单-工资单撤回
export const withdrawPayroll = params => {
return postFetch("/api/bs/hrmsalary/salaryBill/send/withdraw", params);
};
//工资单-批量工资单撤回
export const batWithdrawPayroll = params => {
return postFetch("/api/bs/hrmsalary/salaryBill/send/batWithdraw", params);
};
//工资单-工资单发放详情列表
export const getPayrollDetailList = params => {

View File

@ -33,6 +33,10 @@ export const getChangeList = (params) => {
export const save = (params) => {
return postFetch("/api/bs/hrmsalary/siaccount/save", params);
};
//社会福利台账-批量核算
export const batSave = (params) => {
return postFetch("/api/bs/hrmsalary/siaccount/batSave", params);
};
//社会福利台账-归档
export const siaccountFile = (params) => {
return postFetch("/api/bs/hrmsalary/siaccount/file", params);
@ -75,7 +79,10 @@ export const commonAccount = (params) => {
export const socialSecurityBenefitsRecalculate = (params) => {
return postFetch("/api/bs/hrmsalary/siaccount/socialSecurityBenefitsRecalculate", params);
};
// 社保福利台账批量重新核算
export const batSocialSecurityBenefitsRecalculate = (params) => {
return postFetch("/api/bs/hrmsalary/siaccount/batSocialSecurityBenefitsRecalculate", params);
};
// 获取当前管理员下的所有的个税扣缴义务人
export const getAdminTaxAgentList = () => {

View File

@ -8,14 +8,21 @@ import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaLocaleProvider, WeaTools, WeaTop } from "ecCom";
import { WeaForm } from "comsMobx";
import { Button, message, Modal } from "antd";
import { Button, Dropdown, Icon, Menu, message, Modal } from "antd";
import moment from "moment";
import CalculateQuery from "./components/calculateQuery";
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,
batFile,
batReAccounting,
deleteSalaryacct,
fileSalaryAcct,
reAccounting
} from "../../apis/calculate";
import FormInfo from "../../components/FormInfo";
import { queryConditions } from "./config";
import { getTaxAgentSelectList } from "../../apis/taxAgent";
@ -38,7 +45,7 @@ class Calculate extends Component {
moment(new Date()).subtract(1, "year").startOf("year").format("YYYY-MM"),
moment(new Date()).endOf("year").format("YYYY-MM")
]
}, isRefresh: false, logDialogVisible: false, conditions: [],
}, isRefresh: false, logDialogVisible: false, conditions: [], selectedRowKeys: [],
progressModule: { visible: false, progress: 0, title: getLabel(111, "正在归档中请稍后") },
calcDaialog: { visible: false, title: "" }, showAdvance: false
};
@ -63,7 +70,13 @@ class Calculate extends Component {
renderCalculateOpts = () => {
const { taxAgentStore: { showOperateBtn } } = this.props;
const { queryParams, isRefresh, showAdvance } = this.state;
const { queryParams, isRefresh, showAdvance, selectedRowKeys } = this.state;
const menu = (
<Menu onClick={({ key }) => this.onDropMenuClick(key)}>
<Menu.Item key="batDel" disabled={_.isEmpty(selectedRowKeys)}>{getLabel(111, "批量删除")}</Menu.Item>
<Menu.Item key="batReAcct" disabled={_.isEmpty(selectedRowKeys)}>{getLabel(111, "批量重新核算")}</Menu.Item>
</Menu>
);
let calculateOpts = [
<Button type="primary" onClick={() => this.setState({
calcDaialog: {
@ -71,13 +84,18 @@ class Calculate extends Component {
title: getLabel(538780, "核算")
}
})}>{getLabel(538780, "核算")}</Button>,
<Dropdown overlay={menu}>
<Button type="primary" onClick={() => this.onDropMenuClick("batArchiving")}
disabled={_.isEmpty(selectedRowKeys)}>{getLabel(111, "批量归档")} <Icon type="down"
style={{ marginLeft: 8 }}/></Button>
</Dropdown>,
<CalculateQuery queryParams={queryParams} onAdvance={() => this.setState({ showAdvance: !showAdvance })}
onChange={v => this.setState({
isRefresh: _.keys(v)[0] === "name" ? isRefresh : !isRefresh,
queryParams: { ...queryParams, ...v }
})} onSearch={() => this.setState({ isRefresh: !isRefresh })}/>
];
return !showOperateBtn ? calculateOpts.slice(1) : calculateOpts;
return !showOperateBtn ? calculateOpts.slice(2) : calculateOpts;
};
handleCalcOpts = ({ key }, record) => {
const { isRefresh, progressModule } = this.state, { id } = record;
@ -199,6 +217,48 @@ class Calculate extends Component {
};
onDropMenuClick = (key, targetid = "") => {
switch (key) {
case "batArchiving":
batFile({ ids: this.state.selectedRowKeys }).then(({ status, errormsg }) => {
if (status) {
message.success(getLabel(111, "操作成功!"));
this.setState({ isRefresh: !this.state.isRefresh });
} else {
message.error(errormsg);
}
});
break;
case "batReAcct":
Modal.confirm({
title: getLabel(111, "确认信息"),
content: getLabel(111, "重新核算后,选中的台账数据将可以删除且可以进行此月份的核算,是否确认取消归档?"),
onOk: () => {
batReAccounting({ salaryAcctRecordIds: this.state.selectedRowKeys })
.then(({ status, errormsg }) => {
if (status) {
message.success(getLabel(30700, "操作成功!"));
this.setState({ isRefresh: !this.state.isRefresh });
} else {
message.error(errormsg);
}
});
}
});
break;
case "batDel":
Modal.confirm({
title: getLabel(111, "确认信息"), content: getLabel(388758, "确认要删除吗?"),
onOk: () => {
deleteSalaryacct(this.state.selectedRowKeys).then(({ status, errormsg }) => {
if (status) {
message.success(getLabel(502230, "删除成功!"));
this.setState({ selectedRowKeys: [], isRefresh: !this.state.isRefresh });
} else {
message.error(errormsg);
}
});
}
});
break;
case "log":
this.setState({
logDialogVisible: true,
@ -212,7 +272,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 (
<WeaTop title={getLabel(538011, "薪资核算")} icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
@ -237,13 +298,13 @@ class Calculate extends Component {
</div>
</div>
<CalculateTablelist form={form} queryParams={queryParams} isRefresh={isRefresh}
onCalcOpts={this.handleCalcOpts}/>
selectedRowKeys={selectedRowKeys} onCalcOpts={this.handleCalcOpts}
onChangeSelectedRowKeys={v => this.setState({ selectedRowKeys: v })}/>
<CalculateDialog {...calcDaialog}
onCancel={(bool, id) => this.setState({
calcDaialog: { ...calcDaialog, visible: false },
isRefresh: bool === "refresh" ? !isRefresh : isRefresh
}, () => bool === "refresh" && window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/calculate/${id}`))}
/>
})}/>
{/*操作日志*/}
<LogDialog visible={logDialogVisible} logFunction="acctrecord" filterConditions={filterConditions}
onCancel={() => this.setState({ logDialogVisible: false })}/>

View File

@ -1,46 +1,39 @@
export const calculateConditions = [
{
items: [
{
colSpan: 1,
conditionType: "MONTHPICKER",
domkey: ["salaryMonthStr"],
fieldcol: 14,
label: "薪资所属月",
lanId: 542604,
labelcol: 6,
value: "",
rules: "required|string",
viewAttr: 3
},
{
colSpan: 1,
conditionType: "SELECT",
domkey: ["salarySobId"],
fieldcol: 14,
label: "核算账套",
lanId: 519146,
labelcol: 6,
options: [],
otherParams: {
showSearch: true, optionFilterProp: "children"
},
rules: "required|string",
viewAttr: 3
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["description"],
fieldcol: 14,
label: "备注",
lanId: 536726,
labelcol: 6,
value: "",
viewAttr: 2
}
],
defaultshow: true,
title: ""
}
];
export const calculateConditions = [{
items: [{
colSpan: 1,
conditionType: "MONTHPICKER",
domkey: ["salaryMonthStr"],
fieldcol: 14,
label: "薪资所属月",
lanId: 542604,
labelcol: 6,
value: "",
rules: "required|string",
viewAttr: 3
}, {
colSpan: 1,
conditionType: "SELECT",
domkey: ["salarySobId"],
fieldcol: 14,
label: "核算账套",
lanId: 519146,
labelcol: 6,
options: [],
multiple: true,
otherParams: {
showSearch: true, optionFilterProp: "children"
},
rules: "required|string",
viewAttr: 3
}, {
colSpan: 1,
conditionType: "INPUT",
domkey: ["description"],
fieldcol: 14,
label: "备注",
lanId: 536726,
labelcol: 6,
value: "",
viewAttr: 2
}], defaultshow: true, title: ""
}];

View File

@ -9,7 +9,7 @@ import { inject, observer } from "mobx-react";
import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom";
import { Button, message } from "antd";
import { getSearchs } from "../../../../util";
import { salaryacctGetForm, saveBasic } from "../../../../apis/calculate";
import { batSaveBasic, salaryacctGetForm } from "../../../../apis/calculate";
import { calculateConditions } from "./condition";
const getKey = WeaTools.getKey;
@ -56,17 +56,18 @@ class Index extends Component {
const { calculateStore: { calculateForm } } = this.props;
calculateForm.validateForm().then(f => {
if (f.isValid) {
const payload = calculateForm.getFormParams();
const { salarySobId, salaryMonthStr, ...payload } = calculateForm.getFormParams();
this.setState({ loading: true });
saveBasic({ ...payload }).then(({ status, data, errormsg }) => {
this.setState({ loading: false });
if (status) {
message.success(getLabel(30700, "操作成功"));
this.props.onCancel("refresh", data);
} else {
message.error(errormsg);
}
}).catch(() => this.setState({ loading: false }));
batSaveBasic({ ...payload, salaryMonth: `${salaryMonthStr}-01`, salarySobIds: salarySobId.split(",") })
.then(({ status, data, errormsg }) => {
this.setState({ loading: false });
if (status) {
message.success(getLabel(30700, "操作成功"));
this.props.onCancel("refresh", data);
} else {
message.error(errormsg);
}
}).catch(() => this.setState({ loading: false }));
} else {
f.showErrors();
}
@ -78,9 +79,9 @@ class Index extends Component {
const { calculateStore: { calculateForm } } = this.props;
return (
<WeaDialog
{...this.props} style={{ width: 480, height: 174 }} initLoadCss
{...this.props} style={{ width: 480, height: 174 }} initLoadCss className="salary-acct-container"
buttons={[
<Button type="primary" onClick={this.save} loading={loading}>{getLabel(543233, "保存并进入核算")}</Button>
<Button type="primary" onClick={this.save} loading={loading}>{getLabel(111, "确认")}</Button>
]}
>
<div className="calculate-dialog-layout">{getSearchs(calculateForm, conditions, 1, false)}</div>

View File

@ -8,6 +8,7 @@ import React, { Component } from "react";
import { WeaHelpfulTip, WeaLocaleProvider, WeaTable } from "ecCom";
import { Dropdown, Menu, Tag } from "antd";
import { getSalaryAcctList } from "../../../../apis/calculate";
import { calcPageNo } from "../../../../util";
const getLabel = WeaLocaleProvider.getLabel;
@ -25,7 +26,18 @@ class Index extends Component {
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.isRefresh !== this.props.isRefresh) this.getSalaryAcctList(nextProps);
if (nextProps.isRefresh !== this.props.isRefresh) {
const { selectedRowKeys } = nextProps;
const selectDelDataLen = _.isEmpty(selectedRowKeys) ? 1 : selectedRowKeys.length;
this.setState({
pageInfo: {
...this.state.pageInfo,
current: calcPageNo(this.state.pageInfo.total, this.state.pageInfo.current, 10, selectDelDataLen)
}
}, () => {
this.getSalaryAcctList(nextProps);
});
}
}
getSalaryAcctList = (props) => {
@ -125,7 +137,10 @@ class Index extends Component {
};
render() {
const { loading, dataSource, columns, pageInfo } = this.state;
const { loading, dataSource, columns, pageInfo } = this.state, {
selectedRowKeys,
onChangeSelectedRowKeys
} = this.props;
const pagination = {
...pageInfo,
showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
@ -143,10 +158,14 @@ class Index extends Component {
}, () => this.getSalaryAcctList(this.props));
}
};
const rowSelection = {
selectedRowKeys,
onChange: onChangeSelectedRowKeys
};
return (
<WeaTable
rowKey="id" scroll={{ y: "calc(100vh - 152px)" }}
dataSource={dataSource} loading={loading}
dataSource={dataSource} loading={loading} rowSelection={rowSelection}
pagination={pagination} columns={columns}
/>
);

View File

@ -146,6 +146,49 @@
}
}
.salary-acct-container {
.wea-form-item-wrapper {
display: inline-block !important;
.wea-select, .ant-select, .ant-select-selection {
width: 100%;
}
.wea-select .wea-select-input .arrow {
position: absolute;
right: 4px;
top: 8px;
color: #666;
}
.wea-select .wdb {
word-break: break-all !important;
word-wrap: break-word !important;
white-space: nowrap !important;
}
.wea-select .wea-select-input {
height: 30px;
white-space: nowrap;
min-width: 100px;
max-width: 426.16px;
width: 100%;
display: inline-block;
padding: 4px 17px 4px 4px;
position: relative;
min-height: 30px;
border: 1px solid #d9d9d9;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-o-text-overflow: ellipsis;
text-overflow: ellipsis;
overflow: hidden;
}
}
}
.calculate-dialog-layout {
background: #f6f6f6;
@ -181,3 +224,5 @@
}
}
}

View File

@ -22,6 +22,7 @@ export const declareConditions = [
lanId: 537996,
labelcol: 6,
options: [],
multiple: true,
rules: "required|string",
viewAttr: 3,
},

View File

@ -10,7 +10,7 @@ import { WeaDialog, WeaLocaleProvider, WeaTools } from "ecCom";
import { Button, message } from "antd";
import { getSearchs } from "../../../../util";
import { getTaxAgentSelectListAsAdmin } from "../../../../apis/taxAgent";
import { saveDeclare } from "../../../../apis/declare";
import { batSaveDeclare } from "../../../../apis/declare";
import { declareConditions } from "./condition";
import * as API from "../../../../apis/ruleconfig";
@ -63,10 +63,11 @@ class Index extends Component {
const { declareStore: { declareForm } } = this.props;
declareForm.validateForm().then(f => {
if (f.isValid) {
const payload = declareForm.getFormParams();
const { taxAgentId, ...payload } = declareForm.getFormParams();
this.setState({ loading: true });
saveDeclare({
...payload, taxCycle: `${payload.salaryMonthStr}-01`, salaryDate: `${payload.salaryMonthStr}-01`
batSaveDeclare({
...payload, taxCycle: `${payload.salaryMonthStr}-01`, salaryDate: `${payload.salaryMonthStr}-01`,
taxAgentIds: taxAgentId.split(",")
}).then(({ status, errormsg }) => {
this.setState({ loading: false });
if (status) {
@ -87,7 +88,7 @@ class Index extends Component {
const { declareStore: { declareForm } } = this.props;
return (
<WeaDialog
{...this.props} style={{ width: 500, height: 174 }} initLoadCss
{...this.props} style={{ width: 500, height: 174 }} initLoadCss className="salary-declare-container"
buttons={[
<Button type="primary" onClick={this.save} loading={loading}>{getLabel(543618, "生成申报表")}</Button>
]}

View File

@ -89,3 +89,46 @@
}
}
}
.salary-declare-container {
.wea-form-item-wrapper {
display: inline-block !important;
.wea-select, .ant-select, .ant-select-selection {
width: 100%;
}
.wea-select .wea-select-input .arrow {
position: absolute;
right: 4px;
top: 8px;
color: #666;
}
.wea-select .wdb {
word-break: break-all !important;
word-wrap: break-word !important;
white-space: nowrap !important;
}
.wea-select .wea-select-input {
height: 30px;
white-space: nowrap;
min-width: 100px;
max-width: 426.16px;
width: 100%;
display: inline-block;
padding: 4px 17px 4px 4px;
position: relative;
min-height: 30px;
border: 1px solid #d9d9d9;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-o-text-overflow: ellipsis;
text-overflow: ellipsis;
overflow: hidden;
}
}
}

View File

@ -100,7 +100,7 @@ class Index extends Component {
render() {
const { loading, dataSource, columns, pageInfo } = this.state;
const { taxAgentStore: { showOperateBtn } } = this.props;
const { taxAgentStore: { showOperateBtn }, selectedRowKeys, onChangeSelectedRowKeys } = this.props;
const pagination = {
...pageInfo,
showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
@ -118,10 +118,14 @@ class Index extends Component {
}, () => this.getPayrollList(this.props));
}
};
const rowSelection = {
selectedRowKeys,
onChange: onChangeSelectedRowKeys
};
return (
<WeaTable
rowKey="id"
dataSource={dataSource} loading={loading} pagination={pagination}
dataSource={dataSource} loading={loading} pagination={pagination} rowSelection={rowSelection}
columns={[
...columns,
{

View File

@ -13,7 +13,8 @@ import GrantTableList from "./components/grantTableList";
import PayrollTemplateTableList from "./components/payrollTemplateTableList";
import TemplateBaseSettings from "../payroll/templateBaseSettings";
import LogDialog from "../../components/logViewModal";
import { Button } from "antd";
import * as API from "../../apis/payroll";
import { Button, Dropdown, Icon, Menu, message } from "antd";
import moment from "moment";
import "./index.less";
@ -25,7 +26,7 @@ class Index extends Component {
constructor(props) {
super(props);
this.state = {
selectedKey: "grant", isRefresh: false, baseSetSaveLoading: false,
selectedKey: "grant", isRefresh: false, baseSetSaveLoading: false, selectedRowKeys: [],
queryParams: {
salarySobId: "", name: "",
dateRange: [
@ -41,16 +42,29 @@ class Index extends Component {
renderReqBtns = () => {
const { taxAgentStore: { showOperateBtn } } = this.props;
const { selectedKey, isRefresh, queryParams } = this.state;
const menu = (
<Menu onClick={({ key }) => this.onDropMenuClick(key)}>
<Menu.Item key="batWithdrawn"
disabled={_.isEmpty(this.state.selectedRowKeys)}>{getLabel(111, "全部撤回")}</Menu.Item>
</Menu>
);
let reqBtns = [];
switch (selectedKey) {
case "grant":
reqBtns = [
<Dropdown overlay={menu}>
<Button type="primary" onClick={() => this.onDropMenuClick("batDistributed")}
disabled={_.isEmpty(this.state.selectedRowKeys)}>{getLabel(111, "全部发放")}
<Icon type="down"
style={{ marginLeft: 8 }}/></Button>
</Dropdown>,
<GrantQuery queryParams={queryParams}
onChange={v => this.setState({
isRefresh: !isRefresh,
queryParams: { ...queryParams, ...v }
})}/>
];
!showOperateBtn && reqBtns.slice(1);
break;
case "template":
const loading = this.templateRef ? this.templateRef.wrappedInstance.state.delLoading : false;
@ -85,16 +99,16 @@ class Index extends Component {
return reqBtns;
};
renderContent = () => {
const { selectedKey, queryParams, isRefresh } = this.state;
const { selectedKey, queryParams, isRefresh, selectedRowKeys } = this.state;
let dom = null;
switch (selectedKey) {
case "grant":
dom = <GrantTableList queryParams={queryParams} isRefresh={isRefresh}
dom = <GrantTableList queryParams={queryParams} isRefresh={isRefresh} selectedRowKeys={selectedRowKeys}
onUpdateTemp={(id) => this.setState({ selectedKey: "template" }, () => {
this.templateRef.wrappedInstance.handleOpts({ key: "edit" }, { id });
})}
onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)}
/>;
onChangeSelectedRowKeys={v => this.setState({ selectedRowKeys: v })}
onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)}/>;
break;
case "template":
dom = <PayrollTemplateTableList ref={dom => this.templateRef = dom} queryParams={queryParams}
@ -114,6 +128,28 @@ class Index extends Component {
};
onDropMenuClick = (key, targetid = "") => {
switch (key) {
case "batDistributed":
API.batGrantPayroll({ ids: [], salarySendIds: this.state.selectedRowKeys })
.then(({ status, errormsg }) => {
if (status) {
message.success(getLabel(111, "操作成功!"));
this.setState({ isRefresh: !this.state.isRefresh });
} else {
message.error(errormsg);
}
});
break;
case "batWithdrawn":
API.batWithdrawPayroll({ ids: [], salarySendIds: this.state.selectedRowKeys })
.then(({ status, errormsg }) => {
if (status) {
message.success(getLabel(111, "操作成功!"));
this.setState({ isRefresh: !this.state.isRefresh });
} else {
message.error(errormsg);
}
});
break;
case "log":
this.setState({
logDialogVisible: true,

View File

@ -22,6 +22,7 @@ export const socialAccountConditions = [
lanId: 537996,
labelcol: 6,
options: [],
multiple: true,
rules: "required|string",
viewAttr: 3
},

View File

@ -64,9 +64,7 @@ class Accountdialog extends Component {
style={{ width: 520, height: 156 }}
initLoadCss className="accountDialogWrapper"
buttons={[
<Button type="primary" onClick={this.handleSubmit} loading={loading}>
保存并进入核算
</Button>
<Button type="primary" onClick={this.handleSubmit} loading={loading}>{getLabel(111, "确认")}</Button>
]}>
{getSearchs(accountForm, conditions, 1, false)}
</WeaDialog>

View File

@ -33,6 +33,47 @@
border: 1px solid #e5e5e5;
border-bottom: none;
.wea-form-item-wrapper {
display: inline-block !important;
.wea-select, .ant-select, .ant-select-selection {
width: 100%;
}
.wea-select .wea-select-input .arrow {
position: absolute;
right: 4px;
top: 8px;
color: #666;
}
.wea-select .wdb {
word-break: break-all !important;
word-wrap: break-word !important;
white-space: nowrap !important;
}
.wea-select .wea-select-input {
height: 30px;
white-space: nowrap;
min-width: 100px;
max-width: 426.16px;
width: 100%;
display: inline-block;
padding: 4px 17px 4px 4px;
position: relative;
min-height: 30px;
border: 1px solid #d9d9d9;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-o-text-overflow: ellipsis;
text-overflow: ellipsis;
overflow: hidden;
}
}
.wea-form-item {
padding: 5px 16px;
border-bottom: 1px solid #e5e5e5;

View File

@ -47,6 +47,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 = {
@ -126,7 +130,7 @@ class WelfareRecordList extends Component {
childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
};
getWelfareRecordList = () => {
const { queryForm, taxAgentStore: { showOperateBtn } } = this.props;
const { queryForm, taxAgentStore: { showOperateBtn }, selectedRowKeys } = this.props;
const { pageInfo } = this.state;
const payload = { ...pageInfo, ...queryForm, taxAgents: queryForm.taxAgents ? queryForm.taxAgents.split(",") : [] };
this.setState({ loading: true });
@ -139,7 +143,7 @@ class WelfareRecordList extends Component {
pageInfo: { ...pageInfo, current, pageSize, total },
dataSource, columns
}, () => this.postMessageToChild({
scrollHeight: 108, dataSource, columns, pageInfo: this.state.pageInfo, showOperateBtn,
scrollHeight: 108, dataSource, columns, pageInfo: this.state.pageInfo, showOperateBtn, selectedRowKeys,
unitTableType: "welfareRecord"
}));
}

View File

@ -8,14 +8,12 @@
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaLocaleProvider, WeaTop } from "ecCom";
import { Button, message } from "antd";
import { Button, Dropdown, Icon, Menu, message, Modal } from "antd";
import * as API from "../../../apis/standingBook";
import { getCalculateProgress } from "../../../apis/calculate";
import WelfareRecordQuery from "./components/welfareRecordQuery";
import WelfareRecordList from "./components/welfareRecordList";
import Accountdialog from "./components/accountDialog";
import ProgressModal from "../../../components/progressModal";
import { convertToUrlString } from "../../../util/url";
import LogDialog from "../../../components/logViewModal";
import moment from "moment";
import "./index.less";
@ -32,7 +30,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: [],
accountDialog: { visible: false, title: "", loading: false, options: [] },
logDialogVisible: false, filterConditions: "[]"
};
@ -47,66 +45,112 @@ class StandingBook extends Component {
* Date: 2024/1/23
*/
handleAccount = async (formVal) => {
const { billMonth, ...extra } = formVal;
const { billMonth, paymentOrganization, ...extra } = formVal;
const payload = {
billMonth: moment(billMonth).format("YYYY-MM"),
paymentOrganizations: paymentOrganization.split(","),
...extra
};
this.setState({ accountDialog: { ...this.state.accountDialog, loading: true } });
const { data: creator, status, errormsg } = await API.save(payload);
if (status) {
this.setState({
accountDialog: { ...this.state.accountDialog, loading: false },
progressVisible: true
}, () => {
this.timer = setInterval(() => {
getCalculateProgress(moment(billMonth).format("YYYY-MM"), payload.paymentOrganization)
.then(({ status, data }) => {
if (status) {
if (!data.status) {
clearInterval(this.timer);
this.setState({ progressVisible: false, progress: 0 });
message.error(data.message);
return;
}
if (this.state.progress !== 100) {
this.setState({
progress: (Number(data.progress).toFixed(2)) * 100
});
} else {
clearInterval(this.timer);
this.setState({ progressVisible: false, progress: 0 }, () => {
message.success(getLabel(543232, "核算成功"));
this.setState({
accountDialog: { ...this.state.accountDialog, visible: false }
}, () => {
this.wfListRef.wrappedInstance.getWelfareRecordList();
const calcPayload = { ...payload, creator };
window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/standingBookDetail?${convertToUrlString(calcPayload)}`);
});
});
}
} else {
clearInterval(this.timer);
this.setState({ progressVisible: false, progress: 0 });
}
}).catch(() => {
clearInterval(this.timer);
this.setState({ progressVisible: false, progress: 0 });
});
}, 600);
});
} else {
message.error(errormsg);
clearInterval(this.timer);
this.setState({
accountDialog: { ...this.state.accountDialog, loading: false },
progressVisible: false, progress: 0
});
}
API.batSave(payload).then(({ status, errormsg }) => {
this.setState({ accountDialog: { ...this.state.accountDialog, loading: false } });
if (status) {
message.success(getLabel(543232, "核算成功"));
this.setState({
accountDialog: { ...this.state.accountDialog, visible: false }
}, () => {
this.wfListRef.wrappedInstance.getWelfareRecordList();
});
} else {
message.error(errormsg);
}
});
// const { data: creator, status, errormsg } = await API.save(payload);
// if (status) {
// this.setState({
// accountDialog: { ...this.state.accountDialog, loading: false },
// progressVisible: true
// }, () => {
// this.timer = setInterval(() => {
// getCalculateProgress(moment(billMonth).format("YYYY-MM"), payload.paymentOrganization)
// .then(({ status, data }) => {
// if (status) {
// if (!data.status) {
// clearInterval(this.timer);
// this.setState({ progressVisible: false, progress: 0 });
// message.error(data.message);
// return;
// }
// if (this.state.progress !== 100) {
// this.setState({
// progress: (Number(data.progress).toFixed(2)) * 100
// });
// } else {
// clearInterval(this.timer);
// this.setState({ progressVisible: false, progress: 0 }, () => {
// message.success(getLabel(543232, "核算成功"));
// this.setState({
// accountDialog: { ...this.state.accountDialog, visible: false }
// }, () => {
// this.wfListRef.wrappedInstance.getWelfareRecordList();
// const calcPayload = { ...payload, creator };
// window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/standingBookDetail?${convertToUrlString(calcPayload)}`);
// });
// });
// }
// } else {
// clearInterval(this.timer);
// this.setState({ progressVisible: false, progress: 0 });
// }
// }).catch(() => {
// clearInterval(this.timer);
// this.setState({ progressVisible: false, progress: 0 });
// });
// }, 600);
// });
// } else {
// message.error(errormsg);
// clearInterval(this.timer);
// this.setState({
// accountDialog: { ...this.state.accountDialog, loading: false },
// progressVisible: false, progress: 0
// });
// }
};
onDropMenuClick = (key, targetid = "") => {
switch (key) {
case "batReAcct":
Modal.confirm({
title: getLabel(111, "确认信息"),
content: getLabel(111, "重新核算后,选中的台账数据将可以删除且可以进行此月份的核算,是否确认取消归档?"),
onOk: () => {
API.batSocialSecurityBenefitsRecalculate({ ids: this.state.selectedRowKeys })
.then(({ status, errormsg }) => {
if (status) {
message.success(getLabel(30700, "操作成功!"));
this.wfListRef.wrappedInstance.getWelfareRecordList();
} else {
message.error(errormsg);
}
});
}
});
break;
case "batDel":
Modal.confirm({
title: getLabel(111, "确认信息"), content: getLabel(388758, "确认要删除吗?"),
onOk: () => {
// API.siaccountDelete(module).then(({ status, errormsg }) => {
// if (status) {
// message.success(getLabel(502230, "删除成功"));
// this.wfListRef.wrappedInstance.getWelfareRecordList();
// } else {
// message.error(errormsg);
// }
// });
}
});
break;
case "log":
this.setState({
logDialogVisible: true,
@ -119,11 +163,24 @@ class StandingBook extends Component {
};
render() {
const { accountDialog, queryForm, logDialogVisible, filterConditions } = this.state;
const { accountDialog, queryForm, logDialogVisible, filterConditions, selectedRowKeys } = this.state;
const { taxAgentStore: { showOperateBtn } } = this.props;
const rightBtns = [<Button type="primary" onClick={() => this.setState({
accountDialog: { ...accountDialog, visible: true, title: getLabel(538780, "核算") }
})}>{getLabel(538780, "核算")}</Button>];
const menu = (
<Menu onClick={({ key }) => this.onDropMenuClick(key)}>
<Menu.Item key="batDel" disabled={_.isEmpty(selectedRowKeys)}>{getLabel(111, "批量删除")}</Menu.Item>
<Menu.Item key="batReAcct" disabled={_.isEmpty(selectedRowKeys)}>{getLabel(111, "批量重新核算")}</Menu.Item>
</Menu>
);
const rightBtns = [
<Button type="primary" onClick={() => this.setState({
accountDialog: { ...accountDialog, visible: true, title: getLabel(538780, "核算") }
})}>{getLabel(538780, "核算")}</Button>,
<Dropdown overlay={menu}>
<Button type="primary" onClick={() => this.onDropMenuClick("batArchiving")}
disabled={_.isEmpty(selectedRowKeys)}>{getLabel(111, "批量归档")} <Icon type="down"
style={{ marginLeft: 8 }}/></Button>
</Dropdown>
];
return (<WeaTop title={getLabel(538002, "社保福利台账")} icon={<i className="icon-coms-fa"/>}
iconBgcolor="#F14A2D" buttons={showOperateBtn ? rightBtns : []} className="salary-welfare-record"
showDropIcon onDropMenuClick={this.onDropMenuClick}
@ -142,8 +199,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)}/>
<WelfareRecordList ref={dom => this.wfListRef = dom} queryForm={queryForm} selectedRowKeys={selectedRowKeys}
onFilterLog={(type, targetid) => this.onDropMenuClick(type, targetid)}
onChangeSelectedRowKeys={v => this.setState({ selectedRowKeys: v })}/>
</div>
<Accountdialog {...accountDialog}
onCancel={() => this.setState({