导出主表明细
This commit is contained in:
parent
59f1ca0975
commit
7491713ffc
|
|
@ -18,8 +18,8 @@ export const getCumDeductSaCondition = params => {
|
|||
}
|
||||
|
||||
//数据采集-累计专项附加扣除-导出
|
||||
export const exportCumDeductList = params => {
|
||||
fetch('/api/bs/hrmsalary/addUpDeduction/export').then(res => res.blob().then(blob => {
|
||||
export const exportCumDeductList = (ids = "") => {
|
||||
fetch('/api/bs/hrmsalary/addUpDeduction/export?ids=' + ids).then(res => res.blob().then(blob => {
|
||||
var filename=`累计专项附加扣除.xlsx`
|
||||
var a = document.createElement('a');
|
||||
var url = window.URL.createObjectURL(blob);
|
||||
|
|
@ -37,7 +37,14 @@ export const getImportCumDeductParam = params => {
|
|||
|
||||
//数据采集-获取累计专项附加扣除记录
|
||||
export const getCumDeductDetailList = params => {
|
||||
return WeaTools.callApi('/api/bs/hrmsalary/addUpDeduction/getDetailList', 'get', params);
|
||||
return fetch('/api/bs/hrmsalary/addUpDeduction/getDetailList', {
|
||||
method: 'POST',
|
||||
mode: 'cors',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(params)
|
||||
}).then(res => res.json())
|
||||
}
|
||||
|
||||
//数据采集-累计专项附加扣除-导出明细
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ import { inject, observer } from 'mobx-react';
|
|||
import { WeaInput, WeaTextarea, WeaSearchGroup, WeaSelect } from "ecCom";
|
||||
import { slideColumns} from './columns';
|
||||
import "./editSlideContent.less"
|
||||
import { WeaTableNew } from "comsMobx"
|
||||
const WeaTable = WeaTableNew.WeaTable;
|
||||
|
||||
const { MonthPicker } = DatePicker;
|
||||
|
||||
|
|
@ -54,7 +56,9 @@ export default class EditSlideContent extends React.Component {
|
|||
|
||||
render() {
|
||||
const { taxAgentStore: {taxAgentOption}} = this.props;
|
||||
const { cumDeductStore } = this.props;
|
||||
const { taxAgentId} = this.state;
|
||||
const { slideTableStore } = cumDeductStore;
|
||||
return (
|
||||
<div className="cumDeductSlide">
|
||||
<Row className="topLabelBar">
|
||||
|
|
@ -89,6 +93,14 @@ export default class EditSlideContent extends React.Component {
|
|||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<div>
|
||||
<WeaTable // table内部做了loading加载处理,页面就不需要再加了
|
||||
comsWeaTableStore={slideTableStore} // table store
|
||||
hasOrder={true} // 是否启用排序
|
||||
needScroll={true} // 是否启用table内部列表滚动,将自适应到父级高度
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import React from 'react';
|
|||
import { inject, observer } from 'mobx-react';
|
||||
import { toJS } from 'mobx';
|
||||
|
||||
import { Button, Table, DatePicker, Dropdown, Menu, Modal } from 'antd';
|
||||
import { Button, Table, DatePicker, Dropdown, Menu, Modal, message } from 'antd';
|
||||
|
||||
import { WeaTop, WeaTab, WeaRightMenu, WeaRangePicker, WeaDatePicker, WeaSelect, WeaHelpfulTip, WeaSlideModal } from 'ecCom';
|
||||
import { WeaTableNew } from "comsMobx"
|
||||
|
|
@ -88,8 +88,9 @@ export default class CumDeduct extends React.Component {
|
|||
}
|
||||
|
||||
onEdit = (record) => {
|
||||
const { cumDeductStore: { slideVisiable, setSlideVisiable } } = this.props;
|
||||
const { cumDeductStore: { slideVisiable, setSlideVisiable, getCumDeductDetailList } } = this.props;
|
||||
setSlideVisiable(true)
|
||||
getCumDeductDetailList(record.id)
|
||||
}
|
||||
|
||||
// 增加编辑功能,重写columns绑定事件
|
||||
|
|
@ -125,7 +126,7 @@ export default class CumDeduct extends React.Component {
|
|||
const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd } = cumDeductStore;
|
||||
const { taxAgentOption, step } = taxAgentStore
|
||||
const { slideVisiable, setSlideVisiable, modalVisiable, setModalVisiable } = cumDeductStore
|
||||
|
||||
const selectedRowKeys = toJS(tableStore.selectedRowKeys) || [];
|
||||
if (!hasRight && !loading) { // 无权限处理
|
||||
return renderNoright();
|
||||
}
|
||||
|
|
@ -164,7 +165,12 @@ export default class CumDeduct extends React.Component {
|
|||
}
|
||||
|
||||
const handleMenuClick = () => {
|
||||
|
||||
if(selectedRowKeys.length == 0) {
|
||||
message.warning("未选择条目")
|
||||
return
|
||||
}
|
||||
const { cumDeductStore: { exportCumDeductList } } = this.props;
|
||||
exportCumDeductList(selectedRowKeys.join(","))
|
||||
}
|
||||
|
||||
const handleBtnImport = () => {
|
||||
|
|
@ -173,23 +179,24 @@ export default class CumDeduct extends React.Component {
|
|||
setModalVisiable(true)
|
||||
}
|
||||
|
||||
|
||||
const menu = (
|
||||
<Menu onClick={handleMenuClick}>
|
||||
<Menu.Item key="1">导出选中</Menu.Item>
|
||||
</Menu>
|
||||
);
|
||||
|
||||
const btns = [
|
||||
<Button type="primary" onClick={() => { handleBtnImport() }}>导入</Button>,
|
||||
<Dropdown.Button onClick={handleButtonClick} overlay={menu} type="ghost">
|
||||
<Dropdown.Button onClick={handleButtonClick} overlay={
|
||||
<Menu onClick={handleMenuClick}>
|
||||
<Menu.Item key="1">导出选中</Menu.Item>
|
||||
</Menu>
|
||||
} type="ghost">
|
||||
导出全部
|
||||
</Dropdown.Button>
|
||||
]
|
||||
|
||||
const renderBtns = () => {
|
||||
return (
|
||||
<Dropdown.Button onClick={handleButtonClick} overlay={menu} type="ghost">
|
||||
<Dropdown.Button onClick={handleButtonClick} overlay={
|
||||
<Menu onClick={handleMenuClick}>
|
||||
<Menu.Item key="1">导出选中</Menu.Item>
|
||||
</Menu>
|
||||
} type="ghost">
|
||||
导出全部
|
||||
</Dropdown.Button>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ const { TableStore } = WeaTableNew;
|
|||
|
||||
export class CumDeductStore {
|
||||
@observable tableStore = new TableStore(); // new table
|
||||
@observable slideTableStore = new TableStore();
|
||||
@observable form = new WeaForm(); // nrew 一个form
|
||||
@observable condition = []; // 存储后台得到的form数据
|
||||
@observable hasRight = true; // 判断用户是有权限查看当前页面: 没有权限渲染无权限页面,有权限渲染数据
|
||||
|
|
@ -31,6 +32,7 @@ export class CumDeductStore {
|
|||
@action
|
||||
setSlideVisiable = slideVisiable => this.slideVisiable = slideVisiable;
|
||||
|
||||
|
||||
// 初始化操作
|
||||
@action
|
||||
doInit = () => {
|
||||
|
|
@ -96,10 +98,20 @@ export class CumDeductStore {
|
|||
}
|
||||
|
||||
// 导出
|
||||
@action exportCumDeductList = (params ={}) => {
|
||||
API.exportCumDeductList(params).then(action(res => {
|
||||
|
||||
}))
|
||||
@action exportCumDeductList = (ids = "") => {
|
||||
API.exportCumDeductList(ids)
|
||||
}
|
||||
|
||||
// 查询明细
|
||||
@action getCumDeductDetailList = (id) => {
|
||||
API.getCumDeductDetailList({"accumulatedSpecialAdditionalDeductionId": id}).then(res => {
|
||||
if(res.status) {
|
||||
if (res.status) { // 接口请求成功/失败处理
|
||||
this.slideTableStore.getDatas(res.data.datas); // table 请求数据
|
||||
} else {
|
||||
message.error(res.msg || '接口调用失败!')
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue