custom/常州光阳摩托车有限公司-聚才林

This commit is contained in:
lys 2025-07-30 16:37:51 +08:00
parent 1d8a1419ff
commit 6541a2f26d
2 changed files with 94 additions and 43 deletions

View File

@ -90,27 +90,19 @@
font-size: 9pt;
word-wrap: break-word;
word-break: break-word;
min-width: 60px;
}
}
}
tbody {
tr {
td:first-child {
padding-left: 0 !important;
}
td {
height: 35px;
border: 1px solid #d9d9d9;
text-align: left;
text-align: center;
font-size: 9pt;
width: 100px;
word-wrap: break-word;
word-break: break-word;
padding-left: 5px;
min-width: 60px;
}
}
}
@ -132,10 +124,40 @@
@media print {
body {
height: auto !important;
overflow-x: auto;
}
.print-summary-salary-detail-container {
table {
thead {
tr {
th {
height: inherit !important;
}
}
}
tbody {
tr {
td {
height: inherit !important;
}
}
}
}
}
table {
page-break-inside: auto;
width: 100%;
thead {
tr {
th {
text-align: center;
}
}
}
}
tr {

View File

@ -9,6 +9,7 @@
*/
import React, { Component } from "react";
import { WeaLocaleProvider, WeaTools } from "ecCom";
import cs from "classnames";
import moment from "moment";
import * as API from "../api";
import "../index.less";
@ -49,7 +50,7 @@ class Index extends Component {
getList[type](payload).then(({ status, data }) => {
if (status) {
const { column: columns, data: dataSource } = data;
this.setState({ columns, dataSource, userInfo });
this.setState({ columns: _.filter(columns, o => o.column !== "workcode"), dataSource, userInfo });
}
});
}
@ -65,39 +66,67 @@ class Index extends Component {
render() {
const { columns, dataSource, userInfo } = this.state, { salaryMonth, type } = WeaTools.getUrlParams();
return (<div className="print-salary-detail-container">
<table>
<thead>
{type === "summary" && <tr>
<th colSpan={columns.length + 1}>
<span>{`常州光阳摩托车有限公司${moment(salaryMonth).format('YYYY年MM月')}发放工资汇总`}</span>
</th>
</tr>}
<tr>
<th width={30}><span>{getLabel(111, "序号")}</span></th>
{_.map(columns, col => (<th key={col.column}><span>{col.text}</span></th>))}
</tr>
</thead>
<tbody>
{_.map(dataSource, (item, index) => (<tr>
<td width={30}><span>{index + 1}</span></td>
{_.map(columns, col => (<td key={col.column}><span>{item[col.column]}</span></td>))}
</tr>))}
</tbody>
<tfoot>
<tr>
<td colSpan={columns.length + 1}>
<div className="print-table-bottom-info">
<p>{getLabel(111, "总经理:")}<span></span></p>
<p>{getLabel(111, "副总经理:")}<span></span></p>
<p>{getLabel(111, "管理中心:")}<span></span></p>
<p>{getLabel(111, "制表人:")}<span>{userInfo.username}</span></p>
</div>
</td>
</tr>
</tfoot>
</table>
</div>);
return (
<div
className={cs("print-salary-detail-container", { "print-summary-salary-detail-container": type === "summary" })}>
<table>
<colgroup>
<col style={{ width: 30 }}/>
{
_.map(columns, o => {
let width = 60;
switch (o.column) {
case "userName":
width = 110;
break;
case "gfr":
width = 70;
break;
default:
break;
}
return <col style={{ width }}/>;
})
}
</colgroup>
<thead>
{type === "actual" && <tr>
<th colSpan={columns.length + 1}>
<span>{`常州光阳摩托车有限公司${moment(salaryMonth).subtract(1, "month").format("YYYY年MM月")}发放工资明细`}</span>
</th>
</tr>}
{type === "summary" && <tr>
<th colSpan={columns.length + 1}>
<span>{`常州光阳摩托车有限公司${moment(salaryMonth).subtract(1, "month").format("YYYY年MM月")}发放工资汇总`}</span>
</th>
</tr>}
<tr>
<th><span>{getLabel(111, "序号")}</span></th>
{_.map(columns, col => (<th key={col.column}>
<span>{col.text}</span></th>))}
</tr>
</thead>
<tbody>
{_.map(dataSource, (item, index) => (<tr>
<td><span>{index + 1}</span></td>
{_.map(columns, col => (<td key={col.column}>
<span>{item[col.column]}</span></td>))}
</tr>))}
</tbody>
<tfoot>
<tr>
<td colSpan={columns.length + 1}>
<div className="print-table-bottom-info">
<p>{getLabel(111, "总经理:")}<span></span></p>
<p>{getLabel(111, "副总经理:")}<span></span></p>
<p>{getLabel(111, "管理中心:")}<span></span></p>
<p>{getLabel(111, "制表人:")}<span>{userInfo.username}</span></p>
</div>
</td>
</tr>
</tfoot>
</table>
</div>);
}
}