feature/2.10.1.2401.01-社保福利台账列表页面重构

This commit is contained in:
黎永顺 2024-01-24 13:50:45 +08:00
parent 6a91ce8b3c
commit c6ad730e1e
6 changed files with 117 additions and 11 deletions

View File

@ -47,13 +47,14 @@ export const welfareRQConditions = [
{
colSpan: 1,
conditionType: "SELECT",
domkey: ["paymentOrganization"],
domkey: ["taxAgents"],
fieldcol: 8,
label: "个税扣缴义务人",
lanId: 537996,
labelcol: 6,
options: [],
viewAttr: 2
viewAttr: 2,
multiple: true
}
],
defaultshow: true,

View File

@ -5,13 +5,17 @@
* Date: 2024/1/23
*/
import React, { Component } from "react";
import { Spin } from "antd";
import { inject, observer } from "mobx-react";
import { message, Modal, Spin } from "antd";
import { WeaLocaleProvider } from "ecCom";
import { getIframeParentHeight } from "../../../../util";
import * as API from "../../../../apis/standingBook";
import { convertToUrlString } from "../../../../util/url";
const getLabel = WeaLocaleProvider.getLabel;
@inject("taxAgentStore")
@observer
class WelfareRecordList extends Component {
constructor(props) {
super(props);
@ -35,10 +39,72 @@ class WelfareRecordList extends Component {
if (type === "init") {
this.getWelfareRecordList();
} else if (type === "turn") {
const module = {
billMonth: params.billMonth,
paymentOrganization: params.paymentOrganizationId
};
switch (id) {
case "PAGEINFO":
this.setState({ pageInfo: { ...pageInfo, ...params } }, () => this.getWelfareRecordList());
break;
case "CALC":
case "VIEW":
const payload = {
billMonth: params.billMonth,
paymentOrganization: params.paymentOrganizationId,
creator: params.creator,
type: id === "VIEW" ? "detail" : ""
};
window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/socialSecurityBenefits/standingBookDetail?${convertToUrlString(payload)}`);
break;
case "DELRC":
Modal.confirm({
title: getLabel(111, "确认信息"), content: getLabel(388758, "确认要删除吗?"),
onOk: () => {
API.siaccountDelete(module).then(({ status, errormsg }) => {
if (status) {
message.success(getLabel(502230, "删除成功"));
this.getWelfareRecordList();
} else {
message.error(errormsg);
}
});
}
});
break;
case "RECALC":
Modal.confirm({
title: getLabel(111, "确认信息"),
content: getLabel(111, "重新核算后,此条台账数据将可以删除且可以进行此月份的核算,是否确认取消归档?"),
onOk: () => {
API.socialSecurityBenefitsRecalculate({ id: params.id })
.then(({ status, errormsg }) => {
if (status) {
message.success(getLabel(30700, "操作成功!"));
this.getWelfareRecordList();
} else {
message.error(errormsg);
}
});
}
});
break;
case "FILE":
Modal.confirm({
title: getLabel(111, "确认信息"),
content: getLabel(111, "归档后,此条台账数据无法删除且不可以再进行此月份的核算,是否确认归档?"),
onOk: () => {
API.siaccountFile(module).then(({ status, errormsg }) => {
if (status) {
message.success(getLabel(30700, "操作成功!"));
this.getWelfareRecordList();
} else {
message.error(errormsg);
}
});
}
});
break;
default:
break;
}
@ -57,9 +123,9 @@ class WelfareRecordList extends Component {
childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
};
getWelfareRecordList = () => {
const { queryForm } = this.props;
const { queryForm, taxAgentStore: { showOperateBtn } } = this.props;
const { pageInfo } = this.state;
const payload = { ...pageInfo, ...queryForm };
const payload = { ...pageInfo, ...queryForm, taxAgents: queryForm.taxAgents ? queryForm.taxAgents.split(",") : [] };
this.setState({ loading: true });
API.getCommonList(payload).then(({ status, data }) => {
this.setState({ loading: false });
@ -70,7 +136,7 @@ class WelfareRecordList extends Component {
pageInfo: { ...pageInfo, current, pageSize, total },
dataSource, columns
}, () => this.postMessageToChild({
scrollHeight: 100, dataSource, columns, pageInfo: this.state.pageInfo
scrollHeight: 108, dataSource, columns, pageInfo: this.state.pageInfo, showOperateBtn
}));
}
}).catch(() => this.setState({ loading: false }));

View File

@ -38,7 +38,7 @@ class WelfareRecordQuery extends Component {
return {
...item,
items: _.map(item.items, o => {
if (getKey(o) === "paymentOrganization") {
if (getKey(o) === "taxAgents") {
return { ...o, options: _.map(data, g => ({ key: g.id.toString(), showname: g.name })) };
}
return o;

View File

@ -88,13 +88,50 @@
align-items: center;
}
}
.wea-select, .ant-select, .ant-select-selection {
width: 100%;
background: #FFF;
}
.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;
}
.wea-select .wea-select-input {
height: 30px;
white-space: nowrap;
min-width: 100px;
max-width: 345px;
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;
}
}
}
.salary-welfare-record-list {
.ant-spin-nested-loading,
.ant-spin-container {
height: 99%;
height: 100%;
}
}
}

View File

@ -26,7 +26,7 @@ class StandingBook extends Component {
queryForm: {
startTime: moment(new Date()).subtract(1, "year").startOf("year").format("YYYY-MM"),
endTime: moment(new Date()).endOf("year").format("YYYY-MM"),
paymentOrganization: ""
taxAgents: ""
},
accountDialog: { visible: false, title: "", loading: false, options: [] }
};
@ -60,7 +60,9 @@ class StandingBook extends Component {
iconBgcolor="#F14A2D" buttons={showOperateBtn ? rightBtns : []}>
<div className="salary-welfare-record-content">
<WelfareRecordQuery onSearch={(payload) => {
this.setState({ queryForm: { ...queryForm, ...payload } }, () => this.wfListRef.getWelfareRecordList());
this.setState({
queryForm: { ...queryForm, ...payload }
}, () => this.wfListRef.wrappedInstance.getWelfareRecordList());
}}/>
<WelfareRecordList ref={dom => this.wfListRef = dom} queryForm={queryForm}/>
</div>

View File

@ -138,7 +138,7 @@ export const getIframeParentHeight = (selector, total, extraHeight) => {
const dom = document.querySelector(selector);
let height = 280;
if (dom && total > 0) {
height = (parseFloat(dom.style.height) > 620 && total === 10) ? total * 39 + 113 : total < 10 ? total * 39 + 113 : parseFloat(dom.style.height) - extraHeight;
height = (parseFloat(dom.style.height) > 620 && total === 10) ? total * 48 + 108: total < 10 ? total * 48 + 108 : parseFloat(dom.style.height) - extraHeight;
}
return height;
};