产品个税对接-个税扣缴义务人设置

This commit is contained in:
黎永顺 2023-07-18 14:24:52 +08:00
parent 37cb0f050a
commit 64797acaea
9 changed files with 183 additions and 53 deletions

View File

@ -21,7 +21,7 @@ import PayrollGrant from "./pages/payroll/payrollGrant";
import PayrollDetail from "./pages/payroll/payrollDetail";
import Declare from "./pages/declare";
import TaxRate from "./pages/taxRate";
// import TaxAgent from "./pages/taxAgent";
import TaxAgents from "./pages/taxAgent";
import TaxAgent from "./pages/salary/taxAgent";
import CalculateDetail from "./pages/calculateDetail";
import PlaceOnFileDetail from "./pages/calculateDetail/placeOnFileDetail";
@ -156,6 +156,7 @@ const Routes = (
/>
<Route key="taxRate" path="taxRate" component={TaxRate}/>
<Route key="taxAgent" path="taxAgent" component={TaxAgent}/>
<Route key="taxAgents" path="taxAgents" component={TaxAgents}/>
<Route key="mobilepayroll" path="mobilepayroll" component={MobilePayroll}/>
<Route key="sysconfig" path="sysconfig" component={SysConfig}/>
<Route key="sysconfig-1" path="sysconfig-1" component={RuleConfig}/>

View File

@ -18,13 +18,13 @@ class BaseSettings extends Component {
}
render() {
const { taxAgentStore: { salarytaxAgentForm }, decentralization } = this.props;
const { taxAgentStore: { salarytaxAgentForm }, decentralization, isChief } = this.props;
return (
<div className="baseSettingWrapper">
{
decentralization === "0" ?
getSearchs(salarytaxAgentForm, decentralizationConditions, 1, true) :
getSearchs(salarytaxAgentForm, editConditions, 1, true)
getSearchs(salarytaxAgentForm, convertConditon(decentralizationConditions, !isChief), 1, false) :
getSearchs(salarytaxAgentForm, convertConditon(editConditions, !isChief), 1, false)
}
</div>
);
@ -32,3 +32,17 @@ class BaseSettings extends Component {
}
export default BaseSettings;
export const convertConditon = (condition, bool) => {
return _.map(condition, item => {
return {
...item,
items: _.map(item.items, child => {
return {
...child,
viewAttr: bool ? 1 : child.viewAttr
};
})
};
});
};

View File

@ -1,3 +1,29 @@
.taxAgentSlideContent {
.baseSettingWrapper, .taxDeclarationInfoWrapper {
padding: 12px 12px 12px 20px;
.wea-search-group {
padding: 0;
border: 1px solid #e5e5e5;
border-bottom: none;
.wea-content {
padding: 0;
.wea-form-cell, .wea-form-item {
border-bottom: 1px solid #e5e5e5;
padding: 5px 10px 5px 30px;
.wea-form-item {
padding: 0 !important;
border-bottom: none !important;
}
}
}
}
}
}
.comHint {
width: 100%;
margin: 16px 0;
@ -55,15 +81,17 @@
}
//添加关联人员弹框中的下拉框样式
.personalScopeModalWrapper{
.wea-select,.ant-select-selection,.ant-select{
.personalScopeModalWrapper {
.wea-select, .ant-select-selection, .ant-select {
width: 100%;
}
.wea-select{
.wea-select {
display: inline-block;
position: relative;
}
.ant-select-selection{
.ant-select-selection {
height: 30px;
border-radius: 0;
}

View File

@ -5,12 +5,14 @@
* Date: 2022/11/30
*/
import React, { Component } from "react";
import { message, Modal } from "antd";
import { Button, message, Modal } from "antd";
import { inject, observer } from "mobx-react";
import { WeaButtonIcon, WeaInputSearch, WeaTab } from "ecCom";
import { taxAgentRangeDelete } from "../../../apis/taxAgent";
import { taxAgentRangeDelete, taxAgentRangeImportData, taxAgentRangePreview } from "../../../apis/taxAgent";
import PersonalScopeTable from "./personalScopeTable";
import PersonalScopeModal from "./personalScopeModal";
import ImportModal from "../../../components/importModal";
import { importEmployColumns } from "../../taxAgent/columns";
@inject("taxAgentStore")
@ -25,7 +27,13 @@ class PersonalScope extends Component {
personalAddModal: {
visible: false,
title: "关联人员",
includeType: "",
includeType: ""
},
previewDataSource: [],
importParams: {
visible: false,
step: 0,
importResult: {}
}
};
this.personalScopeTableRef = null;
@ -74,13 +82,36 @@ class PersonalScope extends Component {
personalAddModal: {
...personalAddModal,
visible: true,
includeType: selectedKey === "listInclude" ? 1 : 0,
includeType: selectedKey === "listInclude" ? 1 : 0
}
});
};
salaryArchivePreview = (params) => {
taxAgentRangePreview(params).then(({ status, data }) => {
if (status) {
const { preview } = data;
this.setState({
previewDataSource: preview
});
}
});
};
handleImportFile = (params) => {
const { taxAgentId } = this.props;
taxAgentRangeImportData({ ...params, taxAgentId }).then(({ status, data }) => {
if (status) {
this.setState({
importParams: {
...this.state.importParams,
importResult: data
}
});
}
});
};
render() {
const { selectedKey, searchValue, rowKeys, personalAddModal } = this.state;
const { selectedKey, searchValue, rowKeys, personalAddModal, importParams, previewDataSource } = this.state;
const { taxAgentStore: { hideIconInTax, showSalaryItemBtn }, taxAgentId } = this.props;
const topTab = [
{
@ -93,6 +124,12 @@ class PersonalScope extends Component {
}
];
const btns = (hideIconInTax || showSalaryItemBtn) ? [
<Button
type="primary"
onClick={() => {
this.setState({ importParams: { ...importParams, visible: true, step: 0 } });
}}
>导入</Button>,
<WeaButtonIcon
buttonType="del"
type="primary"
@ -114,6 +151,7 @@ class PersonalScope extends Component {
placeholder="请输入对象"
onSearch={() => this.personalScopeTableRef.getPersonalScopeList()}
/>];
selectedKey === "listExclude" && btns.shift();
return (
<div>
<WeaTab
@ -144,6 +182,33 @@ class PersonalScope extends Component {
})
}
/>
{importParams.visible && (
<ImportModal
isInit={false}
columns={importEmployColumns}
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
}
}, () => this.personalScopeTableRef.getPersonalScopeList());
}}
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>
);
}

View File

@ -10,7 +10,7 @@ import { Button, message } from "antd";
import { WeaSlideModal, WeaSteps } from "ecCom";
import SlideModalTitle from "../../../components/slideModalTitle";
import { decentralizationConditions, editConditions } from "../../taxAgent/editConditions";
import BaseSettings from "./baseSettings";
import BaseSettings, { convertConditon } from "./baseSettings";
import PersonalScope from "./personalScope";
import TaxDeclarationInfo from "./taxDeclarationInfo";
import * as API from "../../../apis/taxAgent";
@ -38,10 +38,10 @@ class TaxAgentSlide extends Component {
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible || nextProps.decentralization !== this.props.decentralization) {
const { taxAgentStore: { salarytaxAgentForm }, decentralization } = nextProps;
const { taxAgentStore: { salarytaxAgentForm }, decentralization, isChief } = nextProps;
decentralization === "0" ?
salarytaxAgentForm.setCondition(decentralizationConditions, true) :
salarytaxAgentForm.setCondition(editConditions, true);
salarytaxAgentForm.setCondition(convertConditon(decentralizationConditions, !isChief), true) :
salarytaxAgentForm.setCondition(convertConditon(editConditions, !isChief), true);
this.setState({ current: nextProps.current, taxAgentId: nextProps.taxAgentId }, () => {
if (this.state.taxAgentId) this.getTaxAgentForm();
});
@ -53,13 +53,14 @@ class TaxAgentSlide extends Component {
const { taxAgentStore: { salarytaxAgentForm } } = this.props;
API.getTaxAgentForm({ id: taxAgentId }).then(({ status, data }) => {
if (status) {
const { name, description, adminUserIds } = data;
const { name, description, adminUserIds, sortedIndex } = data;
salarytaxAgentForm.updateFields({
name: { value: name },
adminUserIds: {
value: _.map(adminUserIds, it => it.id.toString()).join(","),
valueSpan: _.map(adminUserIds, it => it.content).join(",")
},
sortedIndex: { value: sortedIndex },
description: { value: description }
});
}
@ -128,13 +129,12 @@ class TaxAgentSlide extends Component {
console.log(this.taxInfoRef);
};
renderChildren = () => {
const { current } = this.state;
const { decentralization } = this.props;
const { taxAgentId } = this.state;
const { current, taxAgentId } = this.state;
const { decentralization, isChief } = this.props;
let CurrentDom = null;
switch (current) {
case 0:
CurrentDom = <BaseSettings decentralization={decentralization}/>;
CurrentDom = <BaseSettings decentralization={decentralization} isChief={isChief}/>;
break;
case 1:
CurrentDom = <TaxDeclarationInfo ref={dom => this.taxInfoRef = dom} taxAgentId={taxAgentId}/>;
@ -192,7 +192,7 @@ class TaxAgentSlide extends Component {
className="slideOuterWrapper"
visible={visible}
top={0}
width={50}
width={65}
height={100}
direction="right"
measure="%"
@ -228,7 +228,7 @@ class TaxAgentSlide extends Component {
}
</div>
}
onClose={onCancel}
onClose={() => onCancel()}
/>
);
}

View File

@ -70,7 +70,7 @@ class TaxAgentTable extends Component {
render() {
const { dataSource, columns, pageInfo, loading } = this.state;
const { onOperate } = this.props;
const { onOperate, isChief } = this.props;
const pagination = {
...pageInfo,
showTotal: total => `${total}`,
@ -102,9 +102,15 @@ class TaxAgentTable extends Component {
{
title: "操作",
key: "operation",
width: 120,
render: (text, record) =>
<div className="operationWapper">
<a href="javaScript:void(0);" onClick={() => onOperate("edit", record.id)}> 编辑 </a>
{
isChief &&
<a href="javaScript:void(0);" style={{ marginLeft: 10 }}
onClick={() => onOperate("delete", record.id)}> 删除 </a>
}
</div>
}
]}

View File

@ -69,11 +69,12 @@ class TaxDeclarationInfo extends Component {
render() {
const { fieldItem, fieldForm } = this.state;
return (
<WeaSearchGroup col={1} needTigger showGroup center>
<div className="taxDeclarationInfoWrapper">
<WeaSearchGroup col={1} needTigger showGroup>
{
_.map(fieldItem, item => {
const { key, label, type, viewAttr, options = [] } = item;
return <WeaFormItem label={label} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }} underline key={key}>
return <WeaFormItem label={label} labelCol={{ span: 6 }} wrapperCol={{ span: 14 }} key={key}>
{
(type === "TEXT" || type === "PASSWORD") &&
<WeaInput autocomplete="off" value={fieldForm[key]} type={_.lowerCase(type)} viewAttr={viewAttr}
@ -93,6 +94,7 @@ class TaxDeclarationInfo extends Component {
})
}
</WeaSearchGroup>
</div>
);
}
}

View File

@ -1,8 +1,5 @@
.salaryAgentWrapper {
.comContent {
.wea-search-group {
padding: 0;
}
.customTitleWrapper {
width: 100%;

View File

@ -144,6 +144,22 @@ class TaxAgent extends Component {
}
});
break;
case "delete":
Modal.confirm({
title: "信息确认",
content: `确认要删除吗?`,
onOk: () => {
API.deleteTaxAgent([itemId]).then(({ status, errormsg }) => {
if (status) {
message.success("删除成功");
this.taxAgentTableRef.getTaxAgentList();
} else {
message.error(errormsg || "删除失败");
}
});
}
});
break;
default:
break;
}
@ -184,7 +200,7 @@ class TaxAgent extends Component {
<div className="comContent">
{
permission.isChief &&
<WeaSearchGroup title="基础信息" showGroup center>
<WeaSearchGroup title="基础信息" showGroup>
<WeaFormItem label="启用分权" labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
<WeaCheckbox value={decentralization} display="switch" onChange={this.taxAgentBaseSave}/>
</WeaFormItem>
@ -192,13 +208,14 @@ class TaxAgent extends Component {
}
<WeaSearchGroup title={customTitle} showGroup>
<TaxAgentTable searchValue={searchValue} onOperate={this.handleOperate}
isChief={permission.isChief} //isChief- 是否是总管理员
ref={dom => this.taxAgentTableRef = dom}/>
</WeaSearchGroup>
</div>
<ComHint/>
<TaxAgentSlide
{...taxAgentSlideProps}
isChief={permission.isChief}
isChief={permission.isChief} //isChief- 是否是总管理员
decentralization={decentralization} //是否开启分权 0否 1是 ;开启分权才有管理员的添加
onOk={() => this.taxAgentTableRef.getTaxAgentList()}
onCancel={(isUpdate = false) => this.handelResetSlide(isUpdate)}