数据采集页面重构
This commit is contained in:
parent
ccb9297e6c
commit
a77c800995
|
|
@ -47,6 +47,7 @@ class Index extends Component {
|
|||
},
|
||||
importFormComponent: null,
|
||||
step: 0,
|
||||
templateLink: "/api/bs/hrmsalary/addUpDeduction/downloadTemplate",
|
||||
importResult: {},
|
||||
slideDataSource: []
|
||||
},
|
||||
|
|
@ -435,13 +436,13 @@ class Index extends Component {
|
|||
message.warning("请选择需要导出的数据");
|
||||
return;
|
||||
}
|
||||
const exportParams = _.reduce(_.keys(_.omitBy(recordPayload, it => !it)), (pre, cur) => pre + `&${cur}=${recordPayload[cur]}`, "");
|
||||
const exportParams = _.reduce(_.keys(_.omitBy(recordPayload, it => !it)), (pre, cur) => pre + `${pre && "&"}${cur}=${recordPayload[cur]}`, "");
|
||||
const payload = `?${exportParams}&ids=${ids.join(",")}`;
|
||||
this.handleExportDetail(payload);
|
||||
};
|
||||
handleExportAllDetail = () => {
|
||||
const { recordPayload } = this.tableRecordRef.state;
|
||||
const exportParams = _.reduce(_.keys(_.omitBy(recordPayload, it => !it)), (pre, cur) => pre + `&${cur}=${recordPayload[cur]}`, "");
|
||||
const exportParams = _.reduce(_.keys(_.omitBy(recordPayload, it => !it)), (pre, cur) => pre + `${pre && "&"}${cur}=${recordPayload[cur]}`, "");
|
||||
const payload = `?${exportParams}&ids=`;
|
||||
this.handleExportDetail(payload);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ class Index extends Component {
|
|||
},
|
||||
importFormComponent: null,
|
||||
step: 0,
|
||||
templateLink: "/api/bs/hrmsalary/addUpSituation/downloadTemplate",
|
||||
importResult: {},
|
||||
slideDataSource: []
|
||||
},
|
||||
|
|
@ -488,13 +489,13 @@ class Index extends Component {
|
|||
message.warning("请选择需要导出的数据");
|
||||
return;
|
||||
}
|
||||
const exportParams = _.reduce(_.keys(_.omitBy(recordPayload, it => !it)), (pre, cur) => pre + `&${cur}=${recordPayload[cur]}`, "");
|
||||
const exportParams = _.reduce(_.keys(_.omitBy(recordPayload, it => !it)), (pre, cur) => pre + `${pre && "&"}${cur}=${recordPayload[cur]}`, "");
|
||||
const payload = `?${exportParams}&ids=${ids.join(",")}`;
|
||||
this.handleExportDetail(payload);
|
||||
};
|
||||
handleExportAllDetail = () => {
|
||||
const { recordPayload } = this.tableRecordRef.state;
|
||||
const exportParams = _.reduce(_.keys(_.omitBy(recordPayload, it => !it)), (pre, cur) => pre + `&${cur}=${recordPayload[cur]}`, "");
|
||||
const exportParams = _.reduce(_.keys(_.omitBy(recordPayload, it => !it)), (pre, cur) => pre + `${pre && "&"}${cur}=${recordPayload[cur]}`, "");
|
||||
const payload = `?${exportParams}&ids=`;
|
||||
this.handleExportDetail(payload);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ class DataTables extends Component {
|
|||
|
||||
render() {
|
||||
const { columns, dataSource, loading, selectedRowKeys, pageInfo } = this.state;
|
||||
const { showOperateBtn, onTableOperate, onViewDetails } = this.props;
|
||||
const { showOperateBtn, onTableOperate, onViewDetails, isSpecial = false } = this.props;
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: (selectedRowKeys) => this.setState({ selectedRowKeys })
|
||||
|
|
@ -106,18 +106,37 @@ class DataTables extends Component {
|
|||
...item,
|
||||
render: (text, record) => (
|
||||
<div className="linkWapper">
|
||||
<a href="javaScript:void(0);" onClick={() => onViewDetails(record)}>查看明细</a>
|
||||
{
|
||||
showOperateBtn &&
|
||||
<Popover
|
||||
overlayClassName="moreIconWrapper"
|
||||
placement="bottomRight"
|
||||
content={<Menu onClick={(e) => onTableOperate(e, record)}>
|
||||
<Menu.Item key="handleAddData">编辑</Menu.Item>
|
||||
<Menu.Item key="deleteSelectAddUpDeduction">删除</Menu.Item>
|
||||
</Menu>} title="">
|
||||
<i className="icon-coms-more"/>
|
||||
</Popover>
|
||||
!isSpecial &&
|
||||
<React.Fragment>
|
||||
<a href="javaScript:void(0);" onClick={() => onViewDetails(record)}>查看明细</a>
|
||||
{
|
||||
showOperateBtn &&
|
||||
<Popover
|
||||
overlayClassName="moreIconWrapper"
|
||||
placement="bottomRight"
|
||||
content={<Menu onClick={(e) => onTableOperate(e, record)}>
|
||||
<Menu.Item key="handleAddData">编辑</Menu.Item>
|
||||
<Menu.Item key="deleteSelectAddUpDeduction">删除</Menu.Item>
|
||||
</Menu>} title="">
|
||||
<i className="icon-coms-more"/>
|
||||
</Popover>
|
||||
}
|
||||
</React.Fragment>
|
||||
}
|
||||
{
|
||||
isSpecial &&
|
||||
<React.Fragment>
|
||||
{
|
||||
showOperateBtn &&
|
||||
<React.Fragment>
|
||||
<a href="javaScript:void(0);"
|
||||
onClick={() => onTableOperate({ key: "handleAddData" }, record)}>编辑</a>
|
||||
<a href="javaScript:void(0);"
|
||||
onClick={() => onTableOperate({ key: "deleteSelectAddUpDeduction" }, record)}>删除</a>
|
||||
</React.Fragment>
|
||||
}
|
||||
</React.Fragment>
|
||||
}
|
||||
</div>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ class Index extends Component {
|
|||
},
|
||||
importFormComponent: null,
|
||||
step: 0,
|
||||
templateLink: "/api/bs/hrmsalary/otherDeduction/downloadTemplate",
|
||||
importResult: {},
|
||||
slideDataSource: []
|
||||
},
|
||||
|
|
@ -486,13 +487,13 @@ class Index extends Component {
|
|||
message.warning("请选择需要导出的数据");
|
||||
return;
|
||||
}
|
||||
const exportParams = _.reduce(_.keys(_.omitBy(recordPayload, it => !it)), (pre, cur) => pre + `&${cur}=${recordPayload[cur]}`, "");
|
||||
const exportParams = _.reduce(_.keys(_.omitBy(recordPayload, it => !it)), (pre, cur) => pre + `${pre && "&"}${cur}=${recordPayload[cur]}`, "");
|
||||
const payload = `?${exportParams}&ids=${ids.join(",")}`;
|
||||
this.handleExportDetail(payload);
|
||||
};
|
||||
handleExportAllDetail = () => {
|
||||
const { recordPayload } = this.tableRecordRef.state;
|
||||
const exportParams = _.reduce(_.keys(_.omitBy(recordPayload, it => !it)), (pre, cur) => pre + `&${cur}=${recordPayload[cur]}`, "");
|
||||
const exportParams = _.reduce(_.keys(_.omitBy(recordPayload, it => !it)), (pre, cur) => pre + `${pre && "&"}${cur}=${recordPayload[cur]}`, "");
|
||||
const payload = `?${exportParams}&ids=`;
|
||||
this.handleExportDetail(payload);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ class Index extends Component {
|
|||
},
|
||||
importFormComponent: null,
|
||||
step: 0,
|
||||
templateLink: "/api/bs/hrmsalary/specialAddDeduction/downloadTemplate",
|
||||
importResult: {},
|
||||
slideDataSource: []
|
||||
},
|
||||
|
|
@ -407,55 +408,11 @@ class Index extends Component {
|
|||
importPayload: { ...importPayload, step }
|
||||
});
|
||||
};
|
||||
/*
|
||||
* Author: 黎永顺
|
||||
* Description:详情页面相关-操作按钮
|
||||
* Params:
|
||||
* Date: 2023/2/20
|
||||
*/
|
||||
getDetailOptBtns = () => {
|
||||
return [
|
||||
<Dropdown.Button onClick={this.handleExportAllDetail}
|
||||
overlay={<Menu
|
||||
onClick={this.handleExportSelectDetail}>
|
||||
<Menu.Item key="1">导出选中</Menu.Item>
|
||||
</Menu>}
|
||||
type="primary">
|
||||
导出全部
|
||||
</Dropdown.Button>
|
||||
];
|
||||
};
|
||||
handleExportDetail = (url) => {
|
||||
if (!this.handleDebounce) {
|
||||
this.handleDebounce = _.debounce(() => {
|
||||
window.open(`${window.location.origin}/api/bs/hrmsalary/specialAddDeduction/export${url}`, "_self");
|
||||
this.handleDebounce = null;
|
||||
}, 500);
|
||||
}
|
||||
this.handleDebounce();
|
||||
};
|
||||
handleExportSelectDetail = () => {
|
||||
const { selectedRowKeys: ids, recordPayload } = this.tableRecordRef.state;
|
||||
if (ids.length === 0) {
|
||||
message.warning("请选择需要导出的数据");
|
||||
return;
|
||||
}
|
||||
const exportParams = _.reduce(_.keys(_.omitBy(recordPayload, it => !it)), (pre, cur) => pre + `&${cur}=${recordPayload[cur]}`, "");
|
||||
const payload = `?${exportParams}&ids=${ids.join(",")}`;
|
||||
this.handleExportDetail(payload);
|
||||
};
|
||||
handleExportAllDetail = () => {
|
||||
const { recordPayload } = this.tableRecordRef.state;
|
||||
const exportParams = _.reduce(_.keys(_.omitBy(recordPayload, it => !it)), (pre, cur) => pre + `&${cur}=${recordPayload[cur]}`, "");
|
||||
const payload = `?${exportParams}&ids=`;
|
||||
this.handleExportDetail(payload);
|
||||
};
|
||||
|
||||
render() {
|
||||
const { taxAgentStore: { showOperateBtn }, specialAddStore: { advanceForm } } = this.props;
|
||||
const {
|
||||
declareMonth, taxAgentId, slidePayload, saveLoading, exportPayloadUrl, advanceCondition,
|
||||
importPayload
|
||||
taxAgentId, slidePayload, saveLoading, exportPayloadUrl, advanceCondition, importPayload
|
||||
} = this.state;
|
||||
const tablePayload = { taxAgentId };
|
||||
return (
|
||||
|
|
@ -466,12 +423,13 @@ class Index extends Component {
|
|||
form={advanceForm} condition={advanceCondition} onAdSearch={this.handleAdSearch}
|
||||
onImportSetStep={this.handleImportSetStep} onCancel={this.handleCloseImport}
|
||||
importPayload={importPayload} onImportFile={this.handleImportFile}
|
||||
onPreviewImport={this.handlePreviewImport} detailOptBtns={this.getDetailOptBtns()}
|
||||
onPreviewImport={this.handlePreviewImport} detailOptBtns={[]}
|
||||
>
|
||||
<DataTables
|
||||
ref={dom => this.tableRef = dom}
|
||||
url="/api/bs/hrmsalary/specialAddDeduction/list"
|
||||
payload={tablePayload}
|
||||
isSpecial
|
||||
showOperateBtn={showOperateBtn}
|
||||
onTableOperate={this.handleTableOperate}
|
||||
onViewDetails={(record) => this.handleAddData("专项附加扣除记录", record)}
|
||||
|
|
|
|||
Loading…
Reference in New Issue