Merge branch 'feature/v2-个税扣缴义务人人员范围添加导入功能' into develop
This commit is contained in:
commit
b9a864a30e
|
|
@ -86,6 +86,14 @@ export const getTaxAgentRangeListExclude = (params) => {
|
|||
export const getTaxAgentRangeForm = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/taxAgent/range/getForm", params);
|
||||
};
|
||||
//预览个税扣缴义务人中人员范围
|
||||
export const taxAgentRangePreview = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/taxAgent/range/preview", params);
|
||||
};
|
||||
//导入个税扣缴义务人中人员范围
|
||||
export const taxAgentRangeImportData = (params) => {
|
||||
return postFetch("/api/bs/hrmsalary/taxAgent/range/importData", params);
|
||||
};
|
||||
|
||||
//个税扣缴义务人下拉列表
|
||||
export const getTaxAgentSelectList = (params) => {
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ export default class EditModal extends React.Component {
|
|||
labelCol={{ span: `${field.labelcol}` }}
|
||||
error={devolutionStatus === 1 ? form.getError(field) : formDecentralization.getError(field)}
|
||||
tipPosition="bottom"
|
||||
underline
|
||||
wrapperCol={{ span: `${field.fieldcol}` }}>
|
||||
<WeaSwitch
|
||||
ecId={`tasAgent_WeaSwitch@r2lhga@${index}@${idx}`}
|
||||
|
|
|
|||
|
|
@ -82,20 +82,26 @@
|
|||
|
||||
.slideWrapper{
|
||||
.slideRefereUser{
|
||||
.ant-btn{
|
||||
margin-left: 10px;
|
||||
border-radius: 0;
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
border: none;
|
||||
font-size: 20px;
|
||||
line-height: 20px;
|
||||
}
|
||||
.ant-btn.ant-btn-primary[disabled]{
|
||||
color: #d8d8d8;
|
||||
}
|
||||
.ant-btn.ant-btn-primary{
|
||||
color: #55a1f8;
|
||||
.operateBtn{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.addOrDelBtn{
|
||||
.ant-btn{
|
||||
margin-left: 10px;
|
||||
border-radius: 0;
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
border: none;
|
||||
font-size: 20px;
|
||||
line-height: 20px;
|
||||
}
|
||||
.ant-btn.ant-btn-primary[disabled]{
|
||||
color: #d8d8d8;
|
||||
}
|
||||
.ant-btn.ant-btn-primary{
|
||||
color: #55a1f8;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -174,6 +174,7 @@ export default class PersonalScope extends Component {
|
|||
<div style={personScopeWarrper} className="slideWrapper">
|
||||
<SlideTaxagentUser
|
||||
ref={(dom) => (this.tagAgentRef = dom)}
|
||||
{...this.props}
|
||||
dataSource={dataSource}
|
||||
columns={columns}
|
||||
pageObj={pageObj}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ import React from "react";
|
|||
import { Button, message } from "antd";
|
||||
import { WeaInputSearch, WeaTable } from "ecCom";
|
||||
import AddTaxAgentModal from "./addTaxAgentModal";
|
||||
import ImportModal from "../../components/importModal";
|
||||
import { taxAgentRangeImportData, taxAgentRangePreview } from "../../apis/taxAgent";
|
||||
|
||||
export default class SlideTaxagentUser extends React.Component {
|
||||
constructor(props) {
|
||||
|
|
@ -10,7 +12,14 @@ export default class SlideTaxagentUser extends React.Component {
|
|||
addTaxagentModalVisible: false,
|
||||
includeType: 1,
|
||||
selectedRowKeys: [],
|
||||
searchValue: ""
|
||||
searchValue: "",
|
||||
previewColumns: [],
|
||||
previewDataSource: [],
|
||||
importParams: {
|
||||
visible: false,
|
||||
step: 0,
|
||||
importResult: {}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -56,13 +65,64 @@ export default class SlideTaxagentUser extends React.Component {
|
|||
this.addTaxRef.handleReset();
|
||||
});
|
||||
};
|
||||
handleInitModal = () => {
|
||||
// 清空导入弹框列表数据
|
||||
this.setState({
|
||||
previewDataSource: [],
|
||||
importParams: {
|
||||
...this.state.importParams,
|
||||
importResult: {}
|
||||
}
|
||||
});
|
||||
};
|
||||
// 导入档案
|
||||
handleImportFile = (params) => {
|
||||
const { taxAgentId } = this.props;
|
||||
taxAgentRangeImportData({ ...params, taxAgentId }).then(({ status, data }) => {
|
||||
if (status) {
|
||||
data.errorData = data.errorNotice;
|
||||
this.setState({
|
||||
importParams: {
|
||||
...this.state.importParams,
|
||||
importResult: data
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
salaryArchivePreview = (params) => {
|
||||
taxAgentRangePreview(params).then(({ status, data }) => {
|
||||
if (status) {
|
||||
const { headers, list } = data;
|
||||
this.setState({
|
||||
previewColumns: headers.map((item, index) => {
|
||||
return {
|
||||
key: index,
|
||||
title: item,
|
||||
dataIndex: index
|
||||
};
|
||||
}),
|
||||
previewDataSource: list.map(item => {
|
||||
let result = {};
|
||||
item.map((i, index) => {
|
||||
result[index] = i;
|
||||
});
|
||||
return result;
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const {
|
||||
includeType,
|
||||
selectedRowKeys,
|
||||
searchValue,
|
||||
addTaxagentModalVisible
|
||||
addTaxagentModalVisible,
|
||||
importParams,
|
||||
previewColumns,
|
||||
previewDataSource
|
||||
} = this.state;
|
||||
const {
|
||||
submitLoading,
|
||||
|
|
@ -75,7 +135,9 @@ export default class SlideTaxagentUser extends React.Component {
|
|||
targetTypeList,
|
||||
onTaxAgentSave,
|
||||
hideIconInTax,
|
||||
showSalaryItemBtn
|
||||
showSalaryItemBtn,
|
||||
onTaxAngetSearch,
|
||||
taxAgentId
|
||||
} = this.props;
|
||||
|
||||
const rowSelection = {
|
||||
|
|
@ -149,19 +211,30 @@ export default class SlideTaxagentUser extends React.Component {
|
|||
float: "left"
|
||||
}}>
|
||||
{
|
||||
(hideIconInTax || showSalaryItemBtn) && <React.Fragment>
|
||||
<Button type="primary"
|
||||
size="small"
|
||||
onClick={() => {
|
||||
this.handleTabDelete();
|
||||
}}
|
||||
><span className="icon-coms-form-delete-hot" title="删除"></span></Button>
|
||||
<Button type="primary"
|
||||
size="small"
|
||||
style={{ marginRight: 10 }}
|
||||
onClick={() => this.setState({ addTaxagentModalVisible: true })}
|
||||
><span className="icon-coms-Add-to-hot" title="添加"></span></Button>
|
||||
</React.Fragment>
|
||||
(hideIconInTax || showSalaryItemBtn) && <div className="operateBtn">
|
||||
{
|
||||
includeType == "1" &&
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
this.setState({ importParams: { ...importParams, visible: true, step: 0 } });
|
||||
}}
|
||||
>导入</Button>
|
||||
}
|
||||
<div className="addOrDelBtn">
|
||||
<Button type="primary"
|
||||
size="small"
|
||||
onClick={() => {
|
||||
this.handleTabDelete();
|
||||
}}
|
||||
><span className="icon-coms-form-delete-hot" title="删除"></span></Button>
|
||||
<Button type="primary"
|
||||
size="small"
|
||||
style={{ marginRight: 10 }}
|
||||
onClick={() => this.setState({ addTaxagentModalVisible: true })}
|
||||
><span className="icon-coms-Add-to-hot" title="添加"></span></Button>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<WeaInputSearch
|
||||
|
|
@ -200,6 +273,41 @@ export default class SlideTaxagentUser extends React.Component {
|
|||
this.setState({ addTaxagentModalVisible: false });
|
||||
}}
|
||||
/>
|
||||
{importParams.visible && (
|
||||
<ImportModal
|
||||
init={() => {
|
||||
this.handleInitModal();
|
||||
}}
|
||||
isInit={false}
|
||||
columns={previewColumns}
|
||||
slideDataSource={previewDataSource}
|
||||
step={importParams.step}
|
||||
setStep={(step) => {
|
||||
this.setState({ importParams: { ...this.state.importParams, step } });
|
||||
}}
|
||||
importResult={importParams.importResult}
|
||||
onFinish={() => {
|
||||
this.setState({
|
||||
importParams: {
|
||||
...this.state.importParams,
|
||||
visible: false
|
||||
}
|
||||
}, () => {
|
||||
onTaxAngetSearch({
|
||||
tab: includeType,
|
||||
targetName: searchValue
|
||||
});
|
||||
});
|
||||
}}
|
||||
previewImport={(params) => this.salaryArchivePreview(params)}
|
||||
importFile={(params) => this.handleImportFile(params)}
|
||||
templateLink={`/api/bs/hrmsalary/taxAgent/range/downloadTemplate?taxAgentId=${taxAgentId}`}
|
||||
visiable={importParams.visible}
|
||||
onCancel={() => {
|
||||
this.setState({ importParams: { ...this.state.importParams, visible: false } });
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue