custom/陕西万众

This commit is contained in:
lys 2025-02-27 09:13:44 +08:00
parent 0af1148d03
commit 65b0020ea1
2 changed files with 40 additions and 6 deletions

View File

@ -4,6 +4,7 @@ import { getDHSalaryReportList } from "../../../../apis/custom-apis/wz_api";
import { Button } from "antd";
import moment from "moment";
import "./index.less";
import { convertToUrlString } from "../../../../util/url";
const getLabel = WeaLocaleProvider.getLabel;
@ -11,7 +12,7 @@ class Index extends Component {
constructor(props) {
super(props);
this.state = {
startMonthStr: moment().format("YYYY-MM"), dataSource: [], columns: []
startMonthStr: moment().format("YYYY-MM"), dataSource: [], columns: [], loading: false
};
}
@ -20,29 +21,57 @@ class Index extends Component {
}
getDHSalaryReportList = () => {
this.setState({ loading: true });
getDHSalaryReportList({ startMonthStr: this.state.startMonthStr }).then(({ status, data }) => {
this.setState({ loading: false });
if (status) {
const { data: dataSource, column } = data;
this.setState({
dataSource, columns: _.map(column, o => ({ dataIndex: o.column, title: o.text, width: o.width }))
dataSource, columns: _.map(column, it => {
const { column } = it;
if (column !== "rylx") {
return { dataIndex: column, title: it.text, width: it.width };
} else {
return {
dataIndex: column, title: it.text, width: it.width,
render: (value, row, index) => {
const obj = {
children: value,
props: {}
};
const mergeList = _.filter(dataSource, o => o.rylx === row.rylx);
if (index === 0 || dataSource[index - 1].rylx !== row.rylx) {
obj.props.rowSpan = mergeList.length;
} else {
obj.props.rowSpan = 0;
}
return obj;
}
};
}
})
});
}
});
};
handleExportSalaryReport = () => {
window.open(`/api/bs/hrmsalary/salaryacct/dhSalaryReport/export?${convertToUrlString({ startMonthStr: this.state.startMonthStr })}`, "_blank");
};
render() {
const { startMonthStr, dataSource, columns } = this.state;
const { startMonthStr, dataSource, columns, loading } = this.state;
return (<WeaTop
title={getLabel(111, "月度工资计提表-财务使用")} buttonSpace={10} className="provisionReport_wz"
icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D"
buttons={[
<WeaDatePicker value={startMonthStr} format="YYYY-MM"
onChange={val => this.setState({ startMonthStr: val }, () => this.getDHSalaryReportList())}/>,
<Button type="primary">{getLabel(111, "导出")}</Button>
<Button type="primary" onClick={this.handleExportSalaryReport}>{getLabel(111, "导出")}</Button>
]}>
<div className="provisionReport_wz_content">
<WeaTable dataSource={dataSource} columns={columns} pagination={false}/>
<WeaTable dataSource={dataSource} columns={columns} pagination={false} bordered loading={loading}
scroll={{ y: `calc(100vh - 100px)` }}/>
</div>
</WeaTop>);
}

View File

@ -3,9 +3,14 @@
width: 100%;
height: 100%;
background: #f6f6f6;
padding: 8px 16px 0 16px;
.wea-table {
.wea-new-table {
background: #FFF;
table td {
padding-left: 8px !important;
}
}
}
}