diff --git a/pc4mobx/hrmSalary/apis/calculate.js b/pc4mobx/hrmSalary/apis/calculate.js index bd42edd9..663d5087 100644 --- a/pc4mobx/hrmSalary/apis/calculate.js +++ b/pc4mobx/hrmSalary/apis/calculate.js @@ -398,8 +398,8 @@ export const importAcctResult = (params) => { // 核算结果-导出全部 -export const exportAcctResult = (salaryAcctRecordId) => { - fetch('/api/bs/hrmsalary/salaryacct/acctresult/export?salaryAcctRecordId=' + salaryAcctRecordId ).then(res => res.blob().then(blob => { +export const exportAcctResult = (salaryAcctRecordId, ids) => { + fetch('/api/bs/hrmsalary/salaryacct/acctresult/export?salaryAcctRecordId=' + salaryAcctRecordId +"&ids=" + ids ).then(res => res.blob().then(blob => { var filename=`薪资核算.xlsx` var a = document.createElement('a'); var url = window.URL.createObjectURL(blob); diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/compareDetail.js b/pc4mobx/hrmSalary/pages/calculateDetail/compareDetail.js index 946329e6..ce220c6d 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/compareDetail.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/compareDetail.js @@ -52,7 +52,6 @@ export default class CompareDetail extends React.Component { getColumns(columns) { let newColumns = [...columns] - newColumns = newColumns.filter(item => item.hide == "false") newColumns.map(item => { let n = Number(item.dataIndex) if (!isNaN(n)) { // 数字 @@ -151,7 +150,7 @@ export default class CompareDetail extends React.Component { } render() { - const { calculateStore: {comparisonResultPageInfo, comparisonResultTableStore, loading}} = this.props; + const { calculateStore: {comparisonResultPageInfo, comparisonResultTableStore, loading, comparisonResultColumns}} = this.props; const { importModalVisible, searchValue } = this.state; const renderRightOperation = () => { return ( @@ -202,7 +201,8 @@ export default class CompareDetail extends React.Component { {this.handleDataPageChange(value)}, total: comparisonResultPageInfo.total, diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/index.less b/pc4mobx/hrmSalary/pages/calculateDetail/index.less index 2c17a031..8396786c 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/index.less +++ b/pc4mobx/hrmSalary/pages/calculateDetail/index.less @@ -81,6 +81,8 @@ .placeOnFileDetail { padding: 20px; + height: 100%; + overflow-y: scroll; .tabWrapper { height: 47px; line-height: 47px; @@ -119,6 +121,8 @@ } .compareDetail { + overflow-y: scroll; + height: 100%; padding: 20px; .titleBarWrapper { height: 47px; diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/placeOnFileDetail.js b/pc4mobx/hrmSalary/pages/calculateDetail/placeOnFileDetail.js index b7f417c9..e1581d95 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/placeOnFileDetail.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/placeOnFileDetail.js @@ -22,11 +22,14 @@ export default class PlaceOnFileDetail extends React.Component { }) this.state = { slideVisiable: false, + selectedRowKeys: [] } + this.id = ""; } componentWillMount() { let id = getQueryString("id"); + this.id = id; const { calculateStore: { getSalarySobCycle, acctResultList } } = this.props; getSalarySobCycle(id) acctResultList(id) @@ -71,13 +74,40 @@ export default class PlaceOnFileDetail extends React.Component { acctResultList(this.id, this.props.employeeName, value) } + handleMenuClick() { + const {calculateStore: {exportAll}} = this.props; + const { selectedRowKeys } = this.state; + if(selectedRowKeys.length == 0) { + message.warning("未选择条目") + return + } + exportAll(this.id, selectedRowKeys.join(",")) + } + + handleExportAll() { + const {calculateStore: {exportAll}} = this.props; + exportAll(this.id) + } + + onSelectChange = selectedRowKeys => { + this.setState({ selectedRowKeys }); + } + + + render() { const { calculateStore } = this.props; const { baseSalarySobCycle, acctResultListDateSource, acctResultListColumns, acctResultListPageInfo } = calculateStore + const { selectedRowKeys } = this.state; + + const rowSelection = { + selectedRowKeys, + onChange: this.onSelectChange, + }; const menu = ( - + this.handleMenuClick(e)}> 导出所选 ); @@ -85,7 +115,7 @@ export default class PlaceOnFileDetail extends React.Component { const renderRightOperation = () => { return (
- 导出全部 + {this.handleExportAll()}} overlay={menu}>导出全部
) @@ -118,8 +148,9 @@ export default class PlaceOnFileDetail extends React.Component {
{this.handleDataPageChange(value)}, total: acctResultListPageInfo.total, diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js b/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js index 3f321af3..97556ff7 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/salaryDetail.js @@ -156,7 +156,7 @@ export default class SalaryDetail extends React.Component { { slideVisiable && { handleOnSave(); diff --git a/pc4mobx/hrmSalary/stores/calculate.js b/pc4mobx/hrmSalary/stores/calculate.js index 302a6dff..7011635a 100644 --- a/pc4mobx/hrmSalary/stores/calculate.js +++ b/pc4mobx/hrmSalary/stores/calculate.js @@ -54,6 +54,7 @@ export class calculateStore { @observable comparisonPreviewColumns = []; // 线下对比预览列表 @observable comparisonPreviewDataSource = []; // 线下对比列表数据 @observable comparisonImportAcctResult = {}; // 导入结果 + @observable comparisonResultColumns = []; // 表头 // ** 核算进度 ** @observable calculateProgress = 0; @@ -295,7 +296,12 @@ export class calculateStore { API.acctResultList({salaryAcctRecordId, employeeName, current}).then(res => { if(res.status) { // this.acctResultListTableStore.getDatas(res.data.dataKey.datas) - this.acctResultListDateSource = res.data.pageInfo.list ? res.data.pageInfo.list: []; + + let list = res.data.pageInfo.list ? res.data.pageInfo.list: []; + list.map(item => { + item.key = item.id + }) + this.acctResultListDateSource = list; this.acctResultListPageInfo = res.data.pageInfo this.acctResultListColumns = res.data.columns; } else { @@ -512,8 +518,8 @@ export class calculateStore { // 核算结果-导出全部 @action - exportAll = (salaryAcctRecordId) => { - API.exportAcctResult(salaryAcctRecordId) + exportAll = (salaryAcctRecordId, ids = "") => { + API.exportAcctResult(salaryAcctRecordId, ids) } // 线下对比-列表 @@ -522,8 +528,9 @@ export class calculateStore { this.loading = true API.comparisonResultList(params).then(res => { if(res.status) { - this.comparisonResultPageInfo = res.data.pageInfo - this.comparisonResultTableStore.getDatas(res.data.dataKey.datas) + this.comparisonResultPageInfo = res.data + this.comparisonResultColumns = res.data.columns + // this.comparisonResultTableStore.getDatas(res.data.dataKey.datas) } else { message.error(res.errormsg || "获取失败") } diff --git a/pc4mobx/hrmSalary/stores/cumSituation.js b/pc4mobx/hrmSalary/stores/cumSituation.js index 39229018..500ad050 100644 --- a/pc4mobx/hrmSalary/stores/cumSituation.js +++ b/pc4mobx/hrmSalary/stores/cumSituation.js @@ -125,6 +125,7 @@ export class CumSituationStore { // 查询明细 @action getCumDeductDetailList = (id, param = {}) => { + let requestParams = {"accumulatedSituationId": id}; requestParams = {...requestParams, ...param} API.getCumSituationDetailList(requestParams).then(res => { if(res.status) { diff --git a/pc4mobx/hrmSalary/stores/otherDeduct.js b/pc4mobx/hrmSalary/stores/otherDeduct.js index c2af08f1..e85429b9 100644 --- a/pc4mobx/hrmSalary/stores/otherDeduct.js +++ b/pc4mobx/hrmSalary/stores/otherDeduct.js @@ -126,6 +126,7 @@ export class OtherDeductStore { // 查询明细 @action getOtherDeductDetailList = (id, param = {}) => { + let requestParams = {"otherTaxExemptDeductionId": id}; requestParams = {...requestParams, ...param} API.getOtherDeductDetailList(requestParams).then(res => { if(res.status) {