薪资档案页面添加导入的功能
This commit is contained in:
parent
7384d124b2
commit
0305c24556
|
|
@ -21,7 +21,12 @@ class ImportMenu extends Component {
|
|||
}
|
||||
|
||||
salaryArchivePreview = (params) => {
|
||||
params.importType = this.state.importParams.importType;
|
||||
if (this.state.importParams.importType === "init" || this.state.importParams.importType === "salaryItemAdjust") {
|
||||
params.importType = this.state.importParams.importType;
|
||||
params.listType = "FIXED";
|
||||
} else {
|
||||
params.listType = this.state.importParams.importType;
|
||||
}
|
||||
API.salaryArchivePreview(params).then(({ status, data }) => {
|
||||
if (status) {
|
||||
const { headers, list } = data;
|
||||
|
|
@ -77,16 +82,21 @@ class ImportMenu extends Component {
|
|||
handleInitModal = () => {
|
||||
// 清空列表数据
|
||||
this.setState({
|
||||
previewDataSource:[],
|
||||
previewDataSource: [],
|
||||
importParams: {
|
||||
...this.state.importParams,
|
||||
importResult:{},
|
||||
importResult: {}
|
||||
}
|
||||
});
|
||||
};
|
||||
// 导入档案
|
||||
handleImportFile = (params) => {
|
||||
params.importType = this.state.importParams.importType;
|
||||
if (this.state.importParams.importType === "init" || this.state.importParams.importType === "salaryItemAdjust") {
|
||||
params.importType = this.state.importParams.importType;
|
||||
params.listType = "FIXED";
|
||||
} else {
|
||||
params.listType = this.state.importParams.importType;
|
||||
}
|
||||
API.importSalaryArchive(params).then(({ status, data }) => {
|
||||
if (status) {
|
||||
data.errorData = data.errorNotice;
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ class Index extends Component {
|
|||
onOk: () => {
|
||||
API.allGotoFixed({}).then(({ status, data, errormsg }) => {
|
||||
if (status) {
|
||||
const { msg }= data;
|
||||
const { msg } = data;
|
||||
message.info(msg || "操作成功!");
|
||||
this.query();
|
||||
} else {
|
||||
|
|
@ -293,20 +293,12 @@ class Index extends Component {
|
|||
const { taxAgentStore: { showOperateBtn } } = this.props;
|
||||
if (selectedKey === "pending" && showOperateBtn) {
|
||||
return [
|
||||
<Dropdown overlay={
|
||||
<ImportMenu
|
||||
importType={_.filter(importType, it => it.id !== "salaryItemAdjust")}
|
||||
refreshList={() => {
|
||||
this.query();
|
||||
this.setState({ selectedRowKeys: [] });
|
||||
}}/>}>
|
||||
<Button type="primary" style={{ marginLeft: 8 }}>导入<i className="icon-coms-down2" style={{
|
||||
marginLeft: 8,
|
||||
verticalAlign: "middle"
|
||||
}}/></Button>
|
||||
</Dropdown>,
|
||||
<Dropdown overlay={<ExportMenu selectedKey={selectedKey} selectedRowKeys={selectedRowKeys} searchItemsValue={searchItemsValue}/>}>
|
||||
<Button type="primary" style={{ marginLeft: 8 }}>导出<i className="icon-coms-down2" style={{
|
||||
<Button type="primary" onClick={() => {
|
||||
this.importRef.handleMenuClick({ key: "PENDING" });
|
||||
}}>导入</Button>,
|
||||
<Dropdown overlay={<ExportMenu selectedKey={selectedKey} selectedRowKeys={selectedRowKeys}
|
||||
searchItemsValue={searchItemsValue}/>}>
|
||||
<Button type="primary">导出<i className="icon-coms-down2" style={{
|
||||
marginLeft: 8,
|
||||
verticalAlign: "middle"
|
||||
}}/></Button>
|
||||
|
|
@ -328,13 +320,14 @@ class Index extends Component {
|
|||
this.setState({ selectedRowKeys: [] });
|
||||
}}/>
|
||||
}>
|
||||
<Button type="primary" style={{ marginLeft: 8 }}>导入<i className="icon-coms-down2" style={{
|
||||
<Button type="primary">导入<i className="icon-coms-down2" style={{
|
||||
marginLeft: 8,
|
||||
verticalAlign: "middle"
|
||||
}}/></Button>
|
||||
</Dropdown>,
|
||||
<Dropdown overlay={<ExportMenu selectedKey={selectedKey} selectedRowKeys={selectedRowKeys} searchItemsValue={searchItemsValue}/>}>
|
||||
<Button type="primary" style={{ marginLeft: 8 }}>导出<i className="icon-coms-down2" style={{
|
||||
<Dropdown overlay={<ExportMenu selectedKey={selectedKey} selectedRowKeys={selectedRowKeys}
|
||||
searchItemsValue={searchItemsValue}/>}>
|
||||
<Button type="primary">导出<i className="icon-coms-down2" style={{
|
||||
marginLeft: 8,
|
||||
verticalAlign: "middle"
|
||||
}}/></Button>
|
||||
|
|
@ -365,20 +358,11 @@ class Index extends Component {
|
|||
}
|
||||
this.deleteSuspendTodo(selectedRowKeys);
|
||||
}}>批量删除待办</Button>,
|
||||
<Dropdown overlay={
|
||||
<ImportMenu
|
||||
importType={_.filter(importType, it => it.id !== "salaryItemAdjust")}
|
||||
refreshList={() => {
|
||||
this.query();
|
||||
this.setState({ selectedRowKeys: [] });
|
||||
}}/>
|
||||
}>
|
||||
<Button type="primary" style={{ marginLeft: 8 }}>导入<i className="icon-coms-down2" style={{
|
||||
marginLeft: 8,
|
||||
verticalAlign: "middle"
|
||||
}}/></Button>
|
||||
</Dropdown>,
|
||||
<Dropdown overlay={<ExportMenu selectedKey={selectedKey} selectedRowKeys={selectedRowKeys} searchItemsValue={searchItemsValue}/>}>
|
||||
<Button type="primary" onClick={() => {
|
||||
this.importRef.handleMenuClick({ key: "SUSPEND" });
|
||||
}}>导入</Button>,
|
||||
<Dropdown overlay={<ExportMenu selectedKey={selectedKey} selectedRowKeys={selectedRowKeys}
|
||||
searchItemsValue={searchItemsValue}/>}>
|
||||
<Button type="primary" style={{ marginLeft: 8 }}>导出<i className="icon-coms-down2" style={{
|
||||
marginLeft: 8,
|
||||
verticalAlign: "middle"
|
||||
|
|
@ -401,7 +385,8 @@ class Index extends Component {
|
|||
verticalAlign: "middle"
|
||||
}}/></Button>
|
||||
</Dropdown>,
|
||||
<Dropdown overlay={<ExportMenu selectedKey={selectedKey} selectedRowKeys={selectedRowKeys} searchItemsValue={searchItemsValue}/>}>
|
||||
<Dropdown overlay={<ExportMenu selectedKey={selectedKey} selectedRowKeys={selectedRowKeys}
|
||||
searchItemsValue={searchItemsValue}/>}>
|
||||
<Button type="primary" style={{ marginLeft: 8 }}>导出<i className="icon-coms-down2" style={{
|
||||
marginLeft: 8,
|
||||
verticalAlign: "middle"
|
||||
|
|
@ -433,11 +418,11 @@ class Index extends Component {
|
|||
...item, fixed: "right",
|
||||
width: 150,
|
||||
render: (text, record) => {
|
||||
if(!showOperateBtn){
|
||||
if (!showOperateBtn) {
|
||||
return <div className="optWrapper">
|
||||
<a href="javascript:void(0);" onClick={() => this.handleEdit(record)}>查看</a>
|
||||
</div>;
|
||||
}else{
|
||||
} else {
|
||||
if (selectedKey === "pending") {
|
||||
return <div className="optWrapper">
|
||||
<a href="javascript:void(0);" className="mr10" onClick={() => this.handleEdit(record)}>编辑</a>
|
||||
|
|
@ -742,6 +727,14 @@ class Index extends Component {
|
|||
needScroll={true}
|
||||
/>
|
||||
</WeaTop>
|
||||
<div style={{ display: "none" }}>
|
||||
<ImportMenu
|
||||
ref={(dom) => this.importRef = dom}
|
||||
refreshList={() => {
|
||||
this.query();
|
||||
this.setState({ selectedRowKeys: [] });
|
||||
}}/>
|
||||
</div>
|
||||
{slideParams.visible && (
|
||||
<WeaSlideModal
|
||||
className="slideOuterWrapper"
|
||||
|
|
|
|||
Loading…
Reference in New Issue