feature/2.14.5.2406.03-工资单查看详情列表添加自定义列的功能
This commit is contained in:
parent
84ed52dfde
commit
b349327088
|
|
@ -24,7 +24,8 @@ import Calculate from "./pages/calculate/calculate"; //重构的薪资核算页
|
|||
// import Payroll from "./pages/payroll";
|
||||
import Payroll from "./pages/payrollRelease"; //重构的工资单发放页面
|
||||
import PayrollGrant from "./pages/payroll/payrollGrant";
|
||||
import PayrollDetail from "./pages/payroll/payrollDetail";
|
||||
import PayrollDetail from "./pages/payroll/payrollDetail/payrollDetail";
|
||||
import PayrollDetailDemo from "./pages/payroll/payrollDetail";
|
||||
// import Declare from "./pages/declare";
|
||||
import Declare from "./pages/declare/declare"; //重构的个税申报表
|
||||
import TaxRate from "./pages/taxRate";
|
||||
|
|
@ -149,6 +150,7 @@ const Routes = (
|
|||
<Route key="watermarkPreview" path="payroll/watermark/preview" component={WatermarkPreview}/>
|
||||
<Route key="payrollGrant" path="payrollGrant" component={PayrollGrant}/>
|
||||
<Route key="payrollDetail" path="payrollDetail" component={PayrollDetail}/>
|
||||
<Route key="payrollDetailDemo" path="payrollDetailDemo" component={PayrollDetailDemo}/>
|
||||
<Route key="templatePreview" path="templatePreview" component={TemplatePreview}/>
|
||||
<Route key="payrollinfo" path="payrollinfo" component={PayrollTemplatePreview}/>
|
||||
<Route key="declare" path="declare" component={Declare}/>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { Button } from "antd";
|
||||
import { WeaInputSearch, WeaLocaleProvider } from "ecCom";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("payrollStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
render() {
|
||||
const { payrollStore: { detailListConditionForm } } = this.props;
|
||||
return (
|
||||
<div className="advance-search">
|
||||
<WeaInputSearch value={detailListConditionForm.getFormParams().username}
|
||||
onChange={v => detailListConditionForm.updateFields({ username: v })}
|
||||
onSearch={this.props.onAdvanceSearch}
|
||||
/>
|
||||
<Button type="ghost" className="wea-advanced-search text-elli"
|
||||
onClick={this.props.onOpenAdvanceSearch}>{getLabel(111, "高级搜索")}</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
.advance-search {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
top: -2.5px;
|
||||
|
||||
.wea-advanced-search {
|
||||
top: 2px;
|
||||
left: -1px;
|
||||
height: 28px;
|
||||
line-height: 1;
|
||||
border-radius: 0;
|
||||
position: relative;
|
||||
color: #474747;
|
||||
padding: 4px 15px;
|
||||
}
|
||||
|
||||
.wea-advanced-search:hover {
|
||||
border: 1px solid #dadada;
|
||||
color: #474747;
|
||||
}
|
||||
|
||||
.text-elli {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,130 @@
|
|||
/*
|
||||
*
|
||||
* 查看工资单详情-列表
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/7/15
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { toJS } from "mobx";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
import { Spin } from "antd";
|
||||
import { WeaTableNew } from "comsMobx";
|
||||
import * as API from "../../../../../apis/payroll";
|
||||
import { getQueryString } from "../../../../../util/url";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
const WeaTableComx = WeaTableNew.WeaTable;
|
||||
|
||||
@inject("payrollStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false, dataSource: [], visible: false, updateSum: true, payload: {},
|
||||
pageInfo: { current: 1, pageSize: 10, total: 0 }
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
window.addEventListener("message", this.handleReceive, false);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
window.removeEventListener("message", this.handleReceive, false);
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.isQuery !== this.props.isQuery) {
|
||||
console.log("componentWillReceiveProps", nextProps.isQuery);
|
||||
}
|
||||
}
|
||||
|
||||
handleReceive = async ({ data }) => {
|
||||
const { type, payload: { id, params } = {} } = data;
|
||||
if (type === "init") {
|
||||
this.getPayrollDetailList();
|
||||
} else if (type === "turn") {
|
||||
switch (id) {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
getPayrollDetailList = () => {
|
||||
const { pageInfo } = this.state;
|
||||
const salarySendId = getQueryString("id");
|
||||
const { payrollStore: { detailListConditionForm: form, salaryTableStore } } = this.props;
|
||||
const payload = {
|
||||
salarySendId, ...pageInfo, ...form.getFormParams(),
|
||||
departmentIds: form.getFormParams().departmentIds ? form.getFormParams().departmentIds.split(",") : [],
|
||||
subCompanyIds: form.getFormParams().subCompanyIds ? form.getFormParams().subCompanyIds.split(",") : []
|
||||
};
|
||||
API.getPayrollDetailList(payload).then(({ status, data }) => {
|
||||
if (status) {
|
||||
const { dataKey, pageInfo, datas: dataSource } = data;
|
||||
const { datas } = dataKey;
|
||||
const { pageNum: current, pageSize, total } = pageInfo;
|
||||
salaryTableStore.getDatas(datas);
|
||||
this.setState({ payload, dataSource, pageInfo: { ...pageInfo, current, pageSize, total } });
|
||||
}
|
||||
});
|
||||
};
|
||||
getColumns = () => {
|
||||
const { payrollStore: { salaryTableStore }, showTotalCell } = this.props;
|
||||
const { dataSource, pageInfo, selectedRowKeys, payload, updateSum } = this.state;
|
||||
const columns = _.filter(toJS(salaryTableStore.columns), (item) => item.display === "true");
|
||||
const sumRowlistUrl = showTotalCell ? "/api/bs/hrmsalary/salaryBill/send/sum" : "";
|
||||
if (!_.isEmpty(columns)) {
|
||||
this.postMessageToChild({
|
||||
dataSource, pageInfo, selectedRowKeys, showTotalCell, calcDetail: true, tableScrollHeight: 154,
|
||||
sumRowlistUrl, payload: { ...payload, updateSum },
|
||||
columns: _.map(columns, (it, idx) => ({
|
||||
...it, width: it.oldWidth, fixed: (idx === 1 || idx === 0 || idx === 2) ? "left" : "",
|
||||
ellipsis: true
|
||||
}))
|
||||
});
|
||||
}
|
||||
return [];
|
||||
};
|
||||
postMessageToChild = (payload) => {
|
||||
const i18n = {
|
||||
"共": getLabel(18609, "共"), "条": getLabel(18256, "条"),
|
||||
"总计": getLabel(523, "总计")
|
||||
};
|
||||
const childFrameObj = document.getElementById("atdTable");
|
||||
childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*");
|
||||
};
|
||||
|
||||
|
||||
render() {
|
||||
const { payrollStore: { salaryTableStore } } = this.props;
|
||||
const { loading, pageInfo } = this.state;
|
||||
const { pageSize, total } = pageInfo;
|
||||
const columnNum = total > 10 ? pageSize + 1 : total + 1;
|
||||
return (
|
||||
<div style={{
|
||||
height: `calc((39px * ${columnNum + 2}) + 92px)`,
|
||||
maxHeight: "678px",
|
||||
minHeight: "342px"
|
||||
}}>
|
||||
<Spin spinning={loading}>
|
||||
<iframe
|
||||
style={{ border: 0, width: "100%", height: "100%" }}
|
||||
src="http://localhost:7607/#/calcTable"
|
||||
// src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/calcTable"
|
||||
id="atdTable"
|
||||
/>
|
||||
</Spin>
|
||||
<WeaTableComx style={{ display: "none" }} needScroll={true} columns={this.getColumns()}
|
||||
comsWeaTableStore={salaryTableStore}/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaLocaleProvider } from "ecCom";
|
||||
import { getSearchs } from "../../../../../util";
|
||||
import { Button } from "antd";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("payrollStore")
|
||||
@observer
|
||||
class Index extends Component {
|
||||
render() {
|
||||
const { payrollStore: { detailListConditionForm }, conditions } = this.props;
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className="wea-advanced-searchsAd">
|
||||
{getSearchs(detailListConditionForm, conditions, 2, false)}
|
||||
</div>
|
||||
<div className="wea-search-buttons">
|
||||
<div style={{ textAlign: "center" }}>
|
||||
<span style={{ marginLeft: 15 }}>
|
||||
<Button type="primary" onClick={this.props.onAdSearch}>{getLabel(388113, "搜索")}</Button>
|
||||
</span>
|
||||
<span style={{ marginLeft: 15 }}>
|
||||
<Button type="ghost" onClick={() => detailListConditionForm.resetForm()}>{getLabel(2022, "重置")}</Button>
|
||||
</span>
|
||||
<span style={{ marginLeft: 15 }}>
|
||||
<Button type="ghost" onClick={this.props.onCancel}>{getLabel(31129, "取消")}</Button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Index;
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
*
|
||||
* 薪资所属月-提示框
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/7/15
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaHelpfulTip, WeaLocaleProvider } from "ecCom";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
class SalaryMonthHelpfulTip extends Component {
|
||||
render() {
|
||||
const { salarySendDetailBaseInfo = {} } = this.props;
|
||||
const { salarySobCycle: { salaryCycle, taxCycle, attendCycle, socialSecurityCycle } } = salarySendDetailBaseInfo;
|
||||
const { fromDate, endDate } = salaryCycle;
|
||||
const { fromDate: aFromDate, endDate: aEndDate } = attendCycle;
|
||||
return (
|
||||
<WeaHelpfulTip width={200} placement="topLeft"
|
||||
title={<div>
|
||||
<div>{getLabel(111, "薪资周期")}</div>
|
||||
<div><span>{fromDate}</span><span>{getLabel(111, "至")}</span><span>{endDate}</span></div>
|
||||
<div>{getLabel(111, "税款所属期")}</div>
|
||||
<div>{taxCycle}</div>
|
||||
<div>{getLabel(111, "考勤取值周期")}</div>
|
||||
<div><span>{aFromDate}</span><span>{getLabel(111, "至")}</span><span>{aEndDate}</span></div>
|
||||
<div>{getLabel(111, "福利台账月份")}</div>
|
||||
<div>{`${getLabel(111, "引用")}${socialSecurityCycle}${getLabel(111, "的福利台账数据")}`}</div>
|
||||
</div>}/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default SalaryMonthHelpfulTip;
|
||||
|
|
@ -31,3 +31,75 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
//查看工资单详情-重构
|
||||
.salary-payroll-details-layout {
|
||||
.ant-spin-nested-loading, .ant-spin-container {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.salary-payroll-details {
|
||||
padding: 0 16px 16px;
|
||||
|
||||
.salary-tb-tip {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.salary-payroll-template-name {
|
||||
vertical-align: middle;
|
||||
margin-left: 40px;
|
||||
}
|
||||
|
||||
.label {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.searchAdvanced-condition-hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.searchAdvanced-condition-container {
|
||||
background: #FFF;
|
||||
margin-bottom: 10px;
|
||||
border: 1px solid #e5e5e5;
|
||||
|
||||
.wea-search-buttons {
|
||||
border-top: 1px solid #dadada;
|
||||
padding: 15px 0;
|
||||
}
|
||||
|
||||
.wea-advanced-searchsAd {
|
||||
height: 246px;
|
||||
overflow: hidden auto;
|
||||
|
||||
.formItem-delete {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: -40px;
|
||||
}
|
||||
|
||||
.searchAdvanced-commonSelect {
|
||||
border-top: 1px solid #ebebeb;
|
||||
margin: 0 25px;
|
||||
padding: 10px 0;
|
||||
}
|
||||
|
||||
.custom-advance-largeSpacing {
|
||||
padding-left: 26px;
|
||||
|
||||
.link {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
padding: 12px 10px 12px 26px;
|
||||
color: #2db7f5
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,106 @@
|
|||
/*
|
||||
*
|
||||
* 查看工资单详情-重构页面
|
||||
* @Author: 黎永顺
|
||||
* @Date: 2024/7/15
|
||||
* @Wechat:
|
||||
* @Email: 971387674@qq.com
|
||||
* @description:
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaLocaleProvider, WeaTop } from "ecCom";
|
||||
import { Button } from "antd";
|
||||
import AdvanceInputBtn from "./components/advanceInputBtn";
|
||||
import SalaryMonthHelpfulTip from "./components/salaryMonthHelpfulTip";
|
||||
import SalaryDetailSearchPannel from "./components/salaryDetailSearchPannel";
|
||||
import SalaryDetailList from "./components/salaryDetailList";
|
||||
import { getQueryString } from "../../../util/url";
|
||||
import { removePropertyCondition } from "../../../util/response";
|
||||
import { sysConfCodeRule } from "../../../apis/ruleconfig";
|
||||
import * as API from "../../../apis/payroll";
|
||||
import cs from "classnames";
|
||||
import "./index.less";
|
||||
|
||||
const getLabel = WeaLocaleProvider.getLabel;
|
||||
|
||||
@inject("taxAgentStore", "payrollStore")
|
||||
@observer
|
||||
class PayrollDetail extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
salarySendDetailBaseInfo: {}, showSearchAd: false, isQuery: false, conditions: [],
|
||||
showTotalCell: false
|
||||
};
|
||||
}
|
||||
|
||||
async componentDidMount() {
|
||||
const id = getQueryString("id");
|
||||
const { payrollStore: { detailListConditionForm } } = this.props;
|
||||
const [{ data: salarySendDetailBaseInfo }, { data }, { data: confCode }] = await Promise.all([
|
||||
API.getPayrollInfo({ id }), API.getPayrollDetailSa(),
|
||||
sysConfCodeRule({ code: "OPEN_ACCT_RESULT_SUM" })
|
||||
]);
|
||||
this.setState({
|
||||
salarySendDetailBaseInfo, showTotalCell: confCode === "1",
|
||||
conditions: removePropertyCondition(data.condition)
|
||||
}, () => detailListConditionForm.initFormFields(this.state.conditions));
|
||||
}
|
||||
|
||||
render() {
|
||||
const { salarySendDetailBaseInfo, showSearchAd, conditions, isQuery, showTotalCell } = this.state;
|
||||
const { taxAgentStore: { showOperateBtn }, payrollStore: { salaryTableStore } } = this.props;
|
||||
const { salaryMonth, template } = salarySendDetailBaseInfo;
|
||||
const dropMenuDatas = [
|
||||
{
|
||||
key: "BTN_COLUMN",
|
||||
icon: <i className="icon-coms-Custom"/>,
|
||||
content: getLabel(111, "显示列定制"),
|
||||
onClick: () => {
|
||||
salaryTableStore.setColSetVisible(true);
|
||||
salaryTableStore.tableColSet(true);
|
||||
}
|
||||
}
|
||||
];
|
||||
const btns = [
|
||||
<Button type="primary" onClick={this.handleExportAll}>{getLabel(111, "导出全部")}</Button>,
|
||||
<AdvanceInputBtn onOpenAdvanceSearch={() => this.setState({ showSearchAd: true })}
|
||||
onAdvanceSearch={() => this.setState({ isQuery: !isQuery })}/>
|
||||
];
|
||||
!showOperateBtn && btns.shift();
|
||||
return (
|
||||
<WeaTop
|
||||
title={getLabel(111, "查看工资单详情")} icon={<i className="icon-coms-fa"/>}
|
||||
iconBgcolor="#F14A2D" showDropIcon={true} dropMenuDatas={dropMenuDatas}
|
||||
buttons={btns} className="salary-payroll-details-layout"
|
||||
>
|
||||
<div className="salary-payroll-details">
|
||||
<div className="salary-tb-tip">
|
||||
<div>
|
||||
<span><span
|
||||
className="label">{getLabel(111, "薪资所属月")}</span>:<span>{salaryMonth}</span></span>
|
||||
{
|
||||
!_.isEmpty(salarySendDetailBaseInfo) &&
|
||||
<SalaryMonthHelpfulTip salarySendDetailBaseInfo={salarySendDetailBaseInfo}/>
|
||||
}
|
||||
<span
|
||||
className="salary-payroll-template-name"><span
|
||||
className="label">{getLabel(111, "工资单模板")}</span>:<span>{template}</span></span>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
className={cs("searchAdvanced-condition-container", { "searchAdvanced-condition-hide": !showSearchAd })}>
|
||||
<SalaryDetailSearchPannel onCancel={() => this.setState({ showSearchAd: false })}
|
||||
onAdSearch={() => this.setState({ isQuery: !isQuery })}
|
||||
conditions={conditions}/>
|
||||
</div>
|
||||
{/*列表*/}
|
||||
<SalaryDetailList isQuery={isQuery} showTotalCell={showTotalCell}/>
|
||||
</div>
|
||||
</WeaTop>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default PayrollDetail;
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
import React from 'react'
|
||||
import { payrollGrantDetailColumns, dataSource} from '../columns'
|
||||
|
||||
export default class PayrollGrantDeatail extends React.Component {
|
||||
|
||||
|
||||
render() {
|
||||
const handleMenuClick = () => {
|
||||
|
||||
}
|
||||
const menu = (
|
||||
<Menu onClick={handleMenuClick}>
|
||||
<Menu.Item key="1">导出选中</Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
const renderRightOperation = () => {
|
||||
return (
|
||||
<div style={{display: "inline-block"}}>
|
||||
<Dropdown.Button style={{marginRight: "10px"}} overlay={menu}>导出全部</Dropdown.Button>
|
||||
<WeaInputSearch />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
return (
|
||||
<div>
|
||||
<CustomTab
|
||||
searchOperationItem={
|
||||
renderRightOperation()
|
||||
}
|
||||
/>
|
||||
<div className="titleBar">
|
||||
<div className="titleBarLeft">
|
||||
<span>薪资所属月:2021-11</span>
|
||||
<WeaHelpfulTip
|
||||
style={{marginLeft: '10px', marginRight: "10px"}}
|
||||
width={200}
|
||||
title="薪资周期\n
|
||||
2021-11-01至2021-11-30\n
|
||||
税款所属期\n
|
||||
2021-12\n
|
||||
考勤取值周期\n
|
||||
2021-11-01至2021-11-30\n
|
||||
福利台账月份\n
|
||||
引用2021-11的福利台账数据"
|
||||
placement="topLeft"
|
||||
/>
|
||||
<span>工资单模板:上海泛微工资单1</span>
|
||||
</div>
|
||||
|
||||
<div className="titleBarRight">
|
||||
<span>已发放:111/<span style={{color: "red"}}>1111</span></span>
|
||||
<span style={{marginLeft: "10px"}}>未确认:111</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Table dataSource={dataSource} columns={payrollGrantDetailColumns} />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -69,6 +69,7 @@ export class payrollStore {
|
|||
@observable salarySendDetailDataSource = []; // 详情列表DataSource
|
||||
@observable salarySendDetailTableStore = new TableStore(); // 详情列表store
|
||||
@observable detailListConditionForm = new WeaForm(); // 详情页搜索条件
|
||||
@observable salaryTableStore = new TableStore();//薪资查看详情页表格Store
|
||||
@observable detailListShowSearchAd = false; // 详情页是否展开搜索面板
|
||||
@observable detailListCondition = []; // 详情页搜索条件
|
||||
@observable salarySendDetailPageInfo = {};
|
||||
|
|
|
|||
Loading…
Reference in New Issue