salary-management-front/pc4mobx/hrmSalary/pages/declare/generateDeclarationDetail.js

75 lines
2.4 KiB
JavaScript
Raw Normal View History

2022-03-18 10:38:43 +08:00
import React from 'react'
import CustomTab from '../../components/customTab'
import { Button, Table } from "antd"
2022-04-20 15:28:40 +08:00
import { WeaTable } from 'ecCom'
2022-03-18 10:38:43 +08:00
import { declarationColumns, dataSource} from './columns'
import "./index.less"
2022-04-20 15:28:40 +08:00
import { inject, observer } from 'mobx-react';
import { getQueryString } from '../../util/url'
2022-03-18 10:38:43 +08:00
2022-04-20 15:28:40 +08:00
@inject('declareStore')
@observer
2022-03-18 10:38:43 +08:00
export default class GenerateDeclarationDetail extends React.Component {
2022-04-20 15:28:40 +08:00
constructor(props) {
super(props)
this.id = getQueryString("id")
}
componentWillMount() {
const { declareStore: { getDetailList, getDeclareInfo }} = this.props;
getDetailList(this.id)
getDeclareInfo(this.id)
}
// 导出
handleExport() {
const { declareStore: {exportSalaryArchive}} = this.props;
exportSalaryArchive(this.id)
}
getColumns() {
const { declareStore: {datailColumns}} = this.props;
let columns = [...datailColumns]
return columns.map(item => {
item = {...item}
item.width = "150px"
return item;
})
}
2022-03-18 10:38:43 +08:00
render() {
2022-04-20 15:28:40 +08:00
const { declareStore: { detailDataSource, detailTableStore, declareInfo, datailColumns }} = this.props;
2022-03-18 10:38:43 +08:00
const renderRightOperation = () => {
return (
<div style={{display: "inline-block"}}>
2022-04-20 15:28:40 +08:00
<Button type="primary" onClick={() => {this.handleExport()}}>导出</Button>
2022-03-18 10:38:43 +08:00
</div>
)
}
const renderLeftOperation = () => {
return (
<div style={{display: "inline-block", lineHeight: '47px'}}>
2022-04-20 15:28:40 +08:00
<span>薪资所属月{declareInfo.salaryMonth && declareInfo.salaryMonth.year} - {declareInfo.salaryMonth && declareInfo.salaryMonth.monthValue}</span>
<span style={{marginLeft: "10px"}}>个税扣缴义务人{declareInfo.taxAgentName}</span>
2022-03-18 10:38:43 +08:00
</div>
)
}
return (
<div className="generateDeclarationDetail">
<CustomTab
searchOperationItem={
renderRightOperation()
}
leftOperation={
renderLeftOperation()
}
/>
<div>
2022-04-20 15:28:40 +08:00
<WeaTable dataSource={detailDataSource} columns={this.getColumns()} scroll={{x: 2300}}/>
2022-03-18 10:38:43 +08:00
</div>
</div>
)
}
}