feature/2.15.1.2407.01-权限

This commit is contained in:
黎永顺 2024-10-08 14:08:16 +08:00
parent d73372e5c4
commit f6789a0ea8
14 changed files with 2174 additions and 1 deletions

View File

@ -28,7 +28,7 @@ import PayrollDetail from "./pages/payroll/payrollDetail/payrollDetail";
// import Declare from "./pages/declare";
import Declare from "./pages/declare/declare"; //重构的个税申报表
import TaxRate from "./pages/taxRate";
import TaxAgent from "./pages/taxAgent";
import TaxAgent from "./pages/salary/taxAgent";
import CalculateDetail from "./pages/calculateDetail";
import PlaceOnFileDetail from "./pages/calculateDetail/placeOnFileDetail";
import CompareDetail from "./pages/calculateDetail/compareDetail";

View File

@ -0,0 +1,48 @@
/*
* Author: 黎永顺
* name: 基础设置
* Description:
* Date: 2022/11/29
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { decentralizationConditions, editConditions } from "../../taxAgent/editConditions";
import { getSearchs } from "../../../util";
@inject("taxAgentStore")
@observer
class BaseSettings extends Component {
componentDidMount() {
}
render() {
const { taxAgentStore: { salarytaxAgentForm }, decentralization, isChief } = this.props;
return (
<div className="baseSettingWrapper">
{
decentralization === "0" ?
getSearchs(salarytaxAgentForm, convertConditon(decentralizationConditions, !isChief), 1, false) :
getSearchs(salarytaxAgentForm, convertConditon(editConditions, !isChief), 1, false)
}
</div>
);
}
}
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

@ -0,0 +1,42 @@
/*
* Author: 黎永顺
* name: 个税扣缴义务人小提示组件
* Description:
* Date: 2022/11/22
*/
import React, { Component } from "react";
import "./index.less";
class ComHint extends Component {
/*
* Author: 黎永顺
* Description: 提示语注释
* Params: isChief=总管理员
* Date: 2022/11/22
*/
renderTips = () => {
const { isChief = true } = this.props;
if (isChief) {
return [
<p>1个税扣缴义务人与档案中的个税扣缴义务人匹配修改个税扣缴义务人名称薪资档案的个税扣缴义务人数据同步更新</p>,
<p>2删除个税扣缴义务人需先确认档案里无人员使用该个税扣缴义务人否则不予删除</p>,
<p>3开启分权需维护个税扣缴义务人的管理员当前总管理员默认有管理员的权限</p>
];
} else {
return [];
}
};
render() {
return (
<div className="comHint">
<div className="hintHeader">小提示</div>
<div className="hintTips">
{this.renderTips()}
</div>
</div>
);
}
}
export default ComHint;

View File

@ -0,0 +1,294 @@
export const fieldList = [
{
key: "name",
label: "名称",
lanId: 33439,
type: "TEXT",
viewAttr: 1
},
{
key: "taxCode",
label: "税号",
lanId: 111,
type: "TEXT",
viewAttr: 3
},
{
key: "city",
label: "报税所属区域",
lanId: 111,
type: "SELECT",
viewAttr: 3
},
{
key: "areaCode",
label: "行政区划代码",
lanId: 111,
type: "TEXT",
viewAttr: 3
},
{
key: "passwordType",
label: "密码校验类型",
lanId: 111,
type: "RADIO",
viewAttr: 3,
options: [
{
key: "TAX_NET_PASSWORD",
showname: "个税网报密码",
lanId: 111
},
{
key: "REAL_NAME_PASSWORD",
showname: "实名账号密码",
lanId: 111
}
]
},
{
key: "account",
label: "实名账号",
lanId: 111,
type: "TEXT",
viewAttr: 3
},
{
key: "realNamePassword",
label: "实名账号密码",
lanId: 111,
type: "PASSWORD",
viewAttr: 3
},
{
key: "netPassword",
label: "个税网报密码",
lanId: 111,
type: "PASSWORD",
viewAttr: 3
},
{
key: "taxRegistrationNumber",
label: "登记序号",
type: "TEXT",
lanId: 111,
viewAttr: 1
},
{
key: "departmentCode",
label: "部门编码",
lanId: 111,
type: "TEXT",
viewAttr: 1
},
{
key: "checkStatus",
label: "报税信息验证状态",
lanId: 111,
type: "TEXT",
viewAttr: 1
}
];
export const taxFillCondition = [
{
items: [
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["taxAgentName"],
fieldcol: 14,
label: "个税扣缴义务人",
lanId: 537996,
labelcol: 6,
value: "",
viewAttr: 1
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["taxRegistrationNumber"],
fieldcol: 14,
label: "登记序号",
lanId: 545138,
labelcol: 6,
value: "",
viewAttr: 1
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["taxpayerStatus"],
fieldcol: 14,
label: "纳税人状态",
lanId: 545139,
labelcol: 6,
value: "",
viewAttr: 1
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["legalPersonName"],
fieldcol: 14,
label: "法人姓名",
lanId: 545140,
labelcol: 6,
value: "",
viewAttr: 1
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["mobile"],
fieldcol: 14,
label: "联系电话",
lanId: 545141,
labelcol: 6,
value: "",
viewAttr: 1
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["businessAddress"],
fieldcol: 14,
label: "生产经营地址",
lanId: 545142,
labelcol: 6,
value: "",
viewAttr: 1
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["industryName"],
fieldcol: 14,
label: "行业名称",
lanId: 545143,
labelcol: 6,
value: "",
viewAttr: 1
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["taxAuthorities"],
fieldcol: 14,
label: "主管税务机关",
lanId: 545144,
labelcol: 6,
value: "",
viewAttr: 1
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["taxBranch"],
fieldcol: 14,
label: "主管税务科所",
lanId: 545145,
labelcol: 6,
value: "",
viewAttr: 1
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["divideFiling"],
fieldcol: 14,
label: "是否分部门备案",
lanId: 111,
labelcol: 6,
value: "",
viewAttr: 1
}
],
defaultshow: true
}
];
export const deptFillCondition = [
{
items: [
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["departmentName"],
fieldcol: 14,
label: "部门名称",
lanId: 536641,
labelcol: 6,
value: "",
rules: "required|string",
viewAttr: 3
},
{
colSpan: 1,
conditionType: "INPUT",
domkey: ["departmentCode"],
fieldcol: 14,
label: "部门编码",
lanId: 111,
labelcol: 6,
value: "",
rules: "required|string",
viewAttr: 3
}
],
defaultshow: true
}
];
export const taxFillColumns = [
{
dataIndex: "taxCode",
title: "税号",
titleId: "",
fixed: "left"
},
{
dataIndex: "taxAgentName",
title: "个税扣缴义务人",
titleId: "537996"
},
{
dataIndex: "taxRegistrationNumber",
title: "登记序号",
titleId: "545138"
},
{
dataIndex: "taxpayerStatus",
title: "纳税人状态",
titleId: "545139"
},
{
dataIndex: "taxAuthorities",
title: "主管税务机关",
titleId: "545144"
},
{
dataIndex: "taxBranch",
title: "主管税务科所",
titleId: "545145"
},
{
dataIndex: "businessAddress",
title: "生产经营地址",
titleId: "545142"
},
{
dataIndex: "industryName",
title: "行业名称",
titleId: "545143"
},
{
dataIndex: "legalPersonName",
title: "法人姓名",
titleId: "545140"
},
{
dataIndex: "mobile",
title: "联系电话",
titleId: "545141"
}
];

View File

@ -0,0 +1,135 @@
.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;
border: 1px solid #e5e5e5;
.hintHeader {
background: #f6f6f6;
height: 40px;
border-bottom: 1px solid #e5e5e5;
padding-left: 16px;
line-height: 40px;
}
.hintTips {
width: 100%;
color: #999;
line-height: 20px;
padding: 0 16px;
display: inline-block;
p {
margin: 1rem 0;
}
}
}
.slideOuterWrapper {
.wea-slide-modal-title {
height: initial;
line-height: initial;
text-align: left;
}
.rodal-close {
z-index: 99;
top: 10px !important;
}
}
@media (min-width: 1260px) {
.slideOuterWrapper {
.reqTopWrapper .wea-new-top-req-title > div:first-child > div {
max-width: 100% !important;
}
}
}
@media screen and (min-width: 1060px) and (max-width: 1260px) {
.slideOuterWrapper {
.reqTopWrapper .wea-new-top-req-title > div:first-child > div {
max-width: calc(100% - 96px) !important;
}
}
}
//添加关联人员弹框中的下拉框样式
.personalScopeModalWrapper {
.wea-select, .ant-select-selection, .ant-select {
width: 100%;
}
.wea-select {
display: inline-block;
position: relative;
}
.ant-select-selection {
height: 30px;
border-radius: 0;
}
}
.taxfillingDialog {
.ant-modal-title {
.text-elli {
color: #111;
font-weight: 700;
}
}
.taxfillingDialogContent {
height: 100%;
padding: 16px;
background: #f6f6f6;
overflow-y: auto;
.wea-search-group {
padding: 0;
background: #FFF;
border: 1px solid #e5e5e5;
border-bottom: 0;
.ant-row, .wea-form-cell {
padding: 0;
}
.wea-form-item {
padding: 5px 16px;
border-bottom: 1px solid #e5e5e5;
}
}
.wea-new-table {
background: #FFF;
}
}
}

View File

@ -0,0 +1,272 @@
/*
* Author: 黎永顺
* name: 人员范围
* Description:
* Date: 2022/11/30
*/
import React, { Component } from "react";
import { Button, message, Modal } from "antd";
import { inject, observer } from "mobx-react";
import { WeaButtonIcon, WeaInputSearch, WeaTab } from "ecCom";
import {
taxAgentRangeDelete,
taxAgentRangeExtDelete,
taxAgentRangeExtSave,
taxAgentRangeImportData,
taxAgentRangePreview
} from "../../../apis/taxAgent";
import { sysinfo } from "../../../apis/ruleconfig";
import PersonalScopeTable from "./personalScopeTable";
import PersonalScopeModal from "./personalScopeModal";
import ImportModal from "../../../components/importModal";
import ExternalPersonModal from "../../../components/externalPersonModal";
import { importEmployColumns } from "../../taxAgent/columns";
@inject("taxAgentStore")
@observer
class PersonalScope extends Component {
constructor(props) {
super(props);
this.state = {
searchValue: "", selectedKey: "listInclude",
rowKeys: [], personalAddModal: {
visible: false, externalVisible: false,
title: "关联人员", includeType: ""
},
previewDataSource: [], importParams: {
visible: false,
step: 0,
importResult: {}
}, extEmpsWitch: "1", //非系统人员开关, 1 开启, 0关闭
loading: false
};
this.personalScopeTableRef = null;
}
componentDidMount() {
const { taxAgentStore: { hasIconInTax } } = this.props;
hasIconInTax();
this.getSysinfo();
}
/*
* Author: 黎永顺
* Description:非系统人员开关查询
* Params:
* Date: 2023/11/9
*/
getSysinfo = () => {
sysinfo().then(({ status, data }) => {
if (status) this.setState({ extEmpsWitch: data.extEmpsWitch });
});
};
/*
* Author: 黎永顺
* Description: 删除人员范围
* Params:
* Date: 2022/11/30
*/
taxAgentRangeDelete = () => {
Modal.confirm({
title: "信息确认",
content: "确认要删除吗?",
onOk: () => {
const { selectedKey } = this.state;
const API = selectedKey === "listExt" ? taxAgentRangeExtDelete : taxAgentRangeDelete;
API(this.state.rowKeys).then(({ status, errormsg }) => {
if (status) {
message.success("删除成功");
this.setState({ rowKeys: [] }, () => {
this.personalScopeTableRef.clearRowkeys();
});
} else {
message.error(errormsg || "删除失败");
}
});
}
});
};
/*
* Author: 黎永顺
* Description:新增人员范围
* Params:
* Date: 2022/11/30
*/
handleAddPersonal = () => {
const { personalAddModal, selectedKey } = this.state;
this.setState({
personalAddModal: {
...personalAddModal,
visible: selectedKey !== "listExt",
externalVisible: selectedKey === "listExt",
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
}
});
}
});
};
/*
* Author: 黎永顺
* Description: 保存非系统人员
* Params:
* Date: 2023/11/9
*/
handleSaveExtPersons = (payload = {}) => {
const { taxAgentId } = this.props;
const { personalAddModal } = this.state;
this.setState({ loading: false });
taxAgentRangeExtSave({ taxAgentId, ...payload }).then(({ status, errormsg }) => {
this.setState({ loading: false });
if (status) {
message.success("新增成功");
this.setState({
personalAddModal: {
...personalAddModal,
externalVisible: false
}
}, () => this.personalScopeTableRef.getPersonalScopeList());
} else {
message.error(errormsg);
}
}).catch(() => this.setState({ loading: false }));
};
render() {
const {
selectedKey, searchValue, rowKeys, personalAddModal,
importParams, previewDataSource, extEmpsWitch, loading
} = this.state;
const { taxAgentStore: { hideIconInTax, showSalaryItemBtn }, taxAgentId } = this.props;
const topTab = [
{
title: "管理范围",
viewcondition: "listInclude"
},
{
title: "从范围中排除",
viewcondition: "listExclude"
},
{
title: "非系统人员范围",
viewcondition: "listExt"
}
];
const btns = (hideIconInTax || showSalaryItemBtn) ? [
<Button
type="primary"
onClick={() => {
this.setState({ importParams: { ...importParams, visible: true, step: 0 } });
}}
>导入</Button>,
<WeaButtonIcon
buttonType="del"
type="primary"
disabled={_.isEmpty(rowKeys)}
onClick={this.taxAgentRangeDelete}
/>,
<WeaButtonIcon buttonType="add" type="primary" onClick={this.handleAddPersonal}/>,
<WeaInputSearch
style={{ width: 220 }}
value={searchValue}
onChange={searchValue => this.setState({ searchValue })}
placeholder="请输入对象"
onSearch={() => this.personalScopeTableRef.getPersonalScopeList()}
/>
] : [<WeaInputSearch
style={{ width: 220 }}
value={searchValue}
onChange={searchValue => this.setState({ searchValue })}
placeholder="请输入对象"
onSearch={() => this.personalScopeTableRef.getPersonalScopeList()}
/>];
(selectedKey === "listExclude" || selectedKey === "listExt") && btns.shift();
return (
<div>
<WeaTab
datas={(extEmpsWitch === "0" || !extEmpsWitch) ? topTab.slice(0, -1) : topTab}
keyParam="viewcondition" //主键
selectedKey={selectedKey}
buttons={btns}
onChange={selectedKey => this.setState({ selectedKey })}
/>
<PersonalScopeTable
ref={dom => this.personalScopeTableRef = dom}
taxAgentId={taxAgentId}
tabActive={selectedKey}
searchValue={searchValue}
onChangeSelectKey={rowKeys => this.setState({ rowKeys })}
/>
{/*非系统人员添加*/}
<ExternalPersonModal
visible={personalAddModal.externalVisible} loading={loading}
onCancel={() => this.setState({ personalAddModal: { ...personalAddModal, externalVisible: false } })}
onExternalPersonSave={this.handleSaveExtPersons}
/>
<PersonalScopeModal
{...personalAddModal}
taxAgentId={taxAgentId}
onSuccess={() => this.personalScopeTableRef.getPersonalScopeList()}
onCancel={() =>
this.setState({
personalAddModal: {
...personalAddModal,
visible: false,
includeType: ""
}
})
}
/>
{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>
);
}
}
export default PersonalScope;

View File

@ -0,0 +1,191 @@
/*
* Author: 黎永顺
* name: 新增人员范围弹框
* Description:
* Date: 2022/11/30
*/
import React, { Component } from "react";
import { WeaBrowser, WeaDialog, WeaFormItem, WeaSearchGroup, WeaSelect } from "ecCom";
import { Button, message, Modal } from "antd";
import { getTaxAgentRangeForm, taxAgentRangeSave } from "../../../apis/taxAgent";
import { SelectWithAll } from "../../socialSecurityBenefits/standingBookDetail/components/regAddEmployee";
import "./index.less";
class PersonalScopeModal extends Component {
constructor(props) {
super(props);
this.state = {
loading: false,
employeeStatus: [],
targetTypeList: [],
targetType: "EMPLOYEE",
targetTypeIds: "",
targetTypeIdsNames: "",
status: "",
statusAll: ""
};
}
componentDidMount() {
this.getTaxAgentRangeForm();
}
getTaxAgentRangeForm = () => {
getTaxAgentRangeForm().then(({ status, data }) => {
if (status) {
const { employeeStatus, targetTypeList } = data;
this.setState({
targetTypeList: _.map(targetTypeList, it => ({ key: it.id, showname: it.name })),
employeeStatus: _.map(employeeStatus, it => ({ key: it.id, showname: it.name }))
});
}
});
};
taxAgentRangeSave = () => {
const { status, targetTypeIds, targetType } = this.state;
const { includeType, taxAgentId, onSuccess, onCancel } = this.props;
if (_.isEmpty(status) || _.isEmpty(targetTypeIds)) {
Modal.warning({
title: "信息确认",
content: "必要信息不完整,红色*为必填项!"
});
return;
}
const payload = {
employeeStatus: status.split(","),
includeType,
targetParams: _.map(targetTypeIds.split(","), it => ({ targetType, targetId: it })),
taxAgentId
};
this.setState({ loading: true });
taxAgentRangeSave(payload).then(({ status, errormsg }) => {
this.setState({ loading: false });
if (status) {
message.success("保存成功");
this.handleReset();
onSuccess();
onCancel();
} else {
message.error(errormsg || "保存失败");
}
}).catch(() => this.setState({ loading: true }));
};
renderBrowser = () => {
const { targetType, targetTypeIds, targetTypeIdsNames } = this.state;
let browserType = {};
switch (targetType) {
case "EMPLOYEE":
browserType = { ...browserType, type: 17, title: "人员选择" };
break;
case "DEPT":
browserType = { ...browserType, type: 57, title: "部门选择" };
break;
case "SUBCOMPANY":
browserType = { ...browserType, type: 164, title: "分部选择" };
break;
case "POSITION":
browserType = { ...browserType, type: 278, title: "岗位选择" };
break;
default:
break;
}
return <WeaBrowser
{...browserType}
viewAttr={3}
isSingle={false}
value={targetTypeIds}
valueSpan={targetTypeIdsNames}
inputStyle={{ width: 200 }}
onChange={(targetTypeIds, targetTypeIdsNames) => {
this.setState({ targetTypeIds, targetTypeIdsNames });
}}
/>;
};
handleReset = () => {
this.setState({
targetType: "EMPLOYEE",
targetTypeIds: "",
status: "",
statusAll: ""
});
};
render() {
const { onCancel, title, visible } = this.props;
const { employeeStatus, targetTypeList, targetType, status, statusAll, loading } = this.state;
const buttons = [
<Button type="primary" onClick={this.taxAgentRangeSave} loading={loading}>确定</Button>,
<Button type="ghost" onClick={this.handleReset}>重置</Button>
];
return (
<WeaDialog
initLoadCss
className="personalScopeModalWrapper"
title={title}
visible={visible}
style={{ width: 600 }}
buttons={buttons}
onCancel={() => {
this.handleReset();
onCancel();
}}
>
<WeaSearchGroup col={1} needTigger title="" showGroup center>
<WeaFormItem
label="对象类型"
labelCol={{ span: 6 }}
wrapperCol={{ span: 18 }}
>
<div style={{ display: "flex", alignItems: "center" }}>
<WeaSelect
style={{ width: 60, marginRight: 12 }}
value={targetType}
options={targetTypeList}
onChange={(targetType) => this.setState({ targetType })}
/>
{this.renderBrowser()}
</div>
</WeaFormItem>
{
SelectWithAll({
label: "选择员工状态",
options: employeeStatus,
detailtype: 2,
valueAll: statusAll,
value: status,
onChangeAll: ({ selected }) => {
if (selected) {
this.setState({
status: _.map(employeeStatus, it => it.key).join(","),
statusAll: selected
});
} else {
this.setState({
status: "",
statusAll: selected
});
}
},
onChange: ({ selected }) => {
const bool = _.every(_.map(employeeStatus, it => it.key), item => selected.split(",").includes(item));
if (bool) {
this.setState({
status: selected,
statusAll: "0"
});
} else {
this.setState({
status: selected,
statusAll: ""
});
}
}
})
}
</WeaSearchGroup>
</WeaDialog>
);
}
}
export default PersonalScopeModal;

View File

@ -0,0 +1,137 @@
/*
* Author: 黎永顺
* name: 人员范围列表数据
* Description:
* Date: 2022/11/30
*/
import React, { Component } from "react";
import { WeaTable } from "ecCom";
import { getTaxAgentRangeListExclude, getTaxAgentRangeListInclude, taxAgentRangelistExt } from "../../../apis/taxAgent";
import "./index.less";
import { calcPageNo } from "../../../util";
const APIFox = {
listInclude: getTaxAgentRangeListInclude,
listExclude: getTaxAgentRangeListExclude,
listExt: taxAgentRangelistExt
};
class PersonalScopeTable extends Component {
constructor(props) {
super(props);
this.state = {
loading: {
query: false
},
dataSource: [],
columns: [],
selectedRowKeys: [],
pageInfo: {
current: 1,
pageSize: 10,
total: 0
}
};
}
componentDidMount() {
this.getPersonalScopeList();
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.tabActive !== this.props.tabActive) {
this.setState({ selectedRowKeys: [] }, () => {
this.getPersonalScopeList(nextProps.tabActive);
nextProps.onChangeSelectKey([]);
});
}
}
getPersonalScopeList = (tabActive = this.props.tabActive) => {
const { searchValue, taxAgentId } = this.props;
const { pageInfo, loading } = this.state;
const payload = {
taxAgentId,
targetName: searchValue,
...pageInfo
};
this.setState({ loading: { ...loading, query: true } });
APIFox[tabActive](payload).then(({ status, data }) => {
this.setState({ loading: { ...loading, query: false } });
if (status) {
const { pageNum: current, pageSize, total, columns, list: dataSource } = data;
this.setState({
pageInfo: { ...pageInfo, current, pageSize, total },
dataSource,
columns: _.map(columns, item => {
return {
...item,
render: (text) => {
return <span className="tdEllipsis" title={text}>{text}</span>;
}
};
})
});
}
}).catch(() => {
this.setState({ loading: { ...loading, query: false } });
});
};
/*
* Author: 黎永顺
* Description: 清空选中项
* Params:
* Date: 2022/11/30
*/
clearRowkeys = () => {
const { pageInfo, selectedRowKeys } = this.state;
this.setState({
selectedRowKeys: [],
pageInfo: {
...pageInfo,
current: calcPageNo(pageInfo.total, pageInfo.current, 10, selectedRowKeys.length)
}
}, () => {
this.getPersonalScopeList();
});
};
render() {
const { dataSource, columns, pageInfo, loading, selectedRowKeys } = this.state;
const { onChangeSelectKey } = this.props;
const pagination = {
...pageInfo,
showTotal: total => `${total}`,
showQuickJumper: true,
pageSizeOptions: ["10", "20", "50", "100"],
onChange: current => {
this.setState({
pageInfo: { ...pageInfo, current }
}, () => {
this.getPersonalScopeList();
});
}
};
const rowSelection = {
selectedRowKeys,
onChange: (selectedRowKeys) => {
this.setState({ selectedRowKeys }, () => {
onChangeSelectKey(this.state.selectedRowKeys);
});
}
};
return (
<WeaTable
rowKey="id"
rowSelection={rowSelection}
dataSource={dataSource}
pagination={pagination}
loading={loading.query}
columns={columns}
/>
);
}
}
export default PersonalScopeTable;

View File

@ -0,0 +1,342 @@
/*
* Author: 黎永顺
* name: 新增/编辑个税扣缴义务人
* Description:
* Date: 2022/11/29
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { Button, message, Modal } from "antd";
import { WeaLocaleProvider, WeaSlideModal, WeaSteps } from "ecCom";
import SlideModalTitle from "../../../components/slideModalTitle";
import { decentralizationConditions, editConditions } from "../../taxAgent/editConditions";
import BaseSettings, { convertConditon } from "./baseSettings";
import PersonalScope from "./personalScope";
import TaxDeclarationInfo from "./taxDeclarationInfo";
import TaxFilingInfoDialofg from "./taxFillingInfoDialog";
import * as API from "../../../apis/taxAgent";
import { registrationCheck } from "../../../apis/taxAgent";
import "./index.less";
const { getLabel } = WeaLocaleProvider;
const Step = WeaSteps.Step;
@inject("taxAgentStore")
@observer
class TaxAgentSlide extends Component {
constructor(props) {
super(props);
this.state = {
current: 0, loading: false, verifyLoading: false, taxAgentId: "",
taxFilingInfoDialofg: {
visible: false, title: "", checkPayload: {},
isEdit: false, jumpAll: false, loading: false,
taxAgentTaxReturnCheckFormDTO: null
}
};
this.taxInfoRef = null;
}
componentWillReceiveProps(nextProps, nextContext) {
if (nextProps.visible !== this.props.visible || nextProps.decentralization !== this.props.decentralization) {
const { taxAgentStore: { salarytaxAgentForm }, decentralization, isChief } = nextProps;
decentralization === "0" ?
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();
});
}
}
getTaxAgentForm = () => {
const { taxAgentId } = this.state;
const { taxAgentStore: { salarytaxAgentForm } } = this.props;
API.getTaxAgentForm({ id: taxAgentId }).then(({ status, data }) => {
if (status) {
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 }
});
}
});
};
/*
* Author: 黎永顺
* Description: 保存个税扣缴义务人
* Params:
* Date: 2022/12/1
*/
saveTaxAgent = (payload) => {
const { onOk, salaryOn } = this.props;
const { current } = this.state;
this.setState({ loading: true });
API.saveTaxAgent(payload).then(({ status, data, errormsg }) => {
this.setState({ loading: false });
if (status) {
message.success(getLabel(22619, "保存成功"));
this.setState({
current: !salaryOn ? current + 2 : current + 1,
taxAgentId: data
}, () => onOk());
} else {
message.error(errormsg || getLabel(22620, "保存失败"));
}
}).catch(() => this.setState({ loading: false }));
};
/*
* Author: 黎永顺
* Description: 编辑个税扣缴义务人
* Params:
* Date: 2022/12/1
*/
updateTaxAgent = (payload) => {
const { onCancel } = this.props;
this.setState({ loading: true });
API.updateTaxAgent(payload).then(({ status, data, errormsg }) => {
this.setState({ loading: false });
if (status) {
message.success(getLabel(31439, "更新成功"));
onCancel(true);
} else {
message.error(errormsg || getLabel(31825, "更新失败"));
}
}).catch(() => this.setState({ loading: false }));
};
handleSave = () => {
const { taxAgentStore: { salarytaxAgentForm } } = this.props;
const { taxAgentId } = this.state;
salarytaxAgentForm.validateForm().then((f) => {
if (f.isValid) {
const formData = salarytaxAgentForm.getFormParams();
const payload = {
...formData,
adminUserIds: formData.adminUserIds ? formData.adminUserIds.split(",") : []
};
taxAgentId ? this.updateTaxAgent({ ...payload, id: taxAgentId }) : this.saveTaxAgent(payload);
} else {
f.showErrors();
}
});
};
handleSaveAndVerify = (jumpAll = false) => {
const { isEdit } = this.props, { taxAgentId, taxFilingInfoDialofg } = this.state;
const { fieldForm, fieldItem } = this.taxInfoRef.state;
const { city: cityStr, cityVal = [], netPassword, realNamePassword, ...extra } = fieldForm;
const boolean = _.every(_.filter(fieldItem, item => item.viewAttr === 3), it => fieldForm[it.key]);
if (!boolean) {
Modal.warning({
title: getLabel(131329, "信息确认"),
content: getLabel(518702, "必要信息不完整,红色*为必填项!")
});
return;
}
const [nation, province, city] = cityStr ? cityStr.split("-") : [];
const proBool = _.every(cityStr ? cityStr.split("-") : [], it => it !== "undefined");
if (!proBool) {
Modal.warning({
title: getLabel(131329, "信息确认"),
content: getLabel(111, "请展开选择报税所属区域!")
});
return;
}
// requestType: 1:保存并验证 2保存
const payload = {
...extra, nation, province, city,
taxAgentId, requestType: 1, password: netPassword || realNamePassword,
cityname: !_.isEmpty(cityVal) ? _.head(cityVal).name : ""
};
this.setState({ verifyLoading: true });
API.saveAndCheck(_.omitBy(payload, val => _.isNil(val))).then(({ status, data, errormsg }) => {
this.setState({ verifyLoading: false });
if (status) {
message.success(getLabel(22619, "保存成功!"));
this.setState({
taxFilingInfoDialofg: {
...taxFilingInfoDialofg, visible: true,
isEdit, jumpAll, title: fieldForm.name, checkPayload: payload,
taxAgentTaxReturnCheckFormDTO: data.TaxAgentTaxReturnCheckFormDTO || data.table.list
}
});
} else {
message.error(errormsg || getLabel(22620, "保存失败!"));
}
}).catch(() => this.setState({ verifyLoading: false }));
};
renderChildren = () => {
const { current, taxAgentId } = this.state;
const { decentralization, isChief } = this.props;
let CurrentDom = null;
switch (current) {
case 0:
CurrentDom = <BaseSettings decentralization={decentralization} isChief={isChief}/>;
break;
case 1:
CurrentDom = <TaxDeclarationInfo ref={dom => this.taxInfoRef = dom} taxAgentId={taxAgentId} isChief={isChief}/>;
break;
case 2:
CurrentDom = <PersonalScope taxAgentId={taxAgentId}/>;
break;
default:
CurrentDom = null;
break;
}
return CurrentDom;
};
renderCustomOperate = () => {
const { isChief, isEdit, salaryOn } = this.props;
const { current, loading, verifyLoading } = this.state;
let CurrentDom = [];
//总管理员权限
if (isChief) {
switch (current) {
case 0:
CurrentDom = [
<Button type="primary" onClick={this.handleSave}
loading={loading}>{isEdit ? getLabel(537558, "保存") : getLabel(33199, "保存并进入下一步")}</Button>
];
break;
case 1:
const tmpV = [<Button type="primary" loading={verifyLoading}
onClick={() => this.handleSaveAndVerify(false)}>{getLabel(544343, "保存并验证")}</Button>];
const tmpJ = [
<Button type="ghost" loading={verifyLoading}
onClick={() => this.handleSaveAndVerify(true)}>{getLabel(543470, "完成,跳过所有步骤")}</Button>,
<Button type="ghost"
onClick={() => this.setState({ current: current + 1 })}>{getLabel(1402, "下一步")}</Button>
];
CurrentDom = isEdit ? tmpV : [...tmpV, ...tmpJ];
break;
case 2:
CurrentDom = (!isEdit && salaryOn) ?
[<Button type="ghost"
onClick={() => this.setState({ current: current - 1 })}>{getLabel(1876, "上一步")}</Button>]
: [];
break;
default:
break;
}
}
return CurrentDom;
};
handleChangeSlideTab = (current) => {
this.setState({ current: Number(current) });
};
handleSubmit = (selectKey) => {
const { taxFilingInfoDialofg, taxAgentId } = this.state;
const { fieldForm } = this.taxInfoRef.state;
const { city: cityStr, cityVal = [], netPassword, realNamePassword, ...extra } = fieldForm;
const [nation, province, city] = cityStr ? cityStr.split("-") : [];
const { taxAgentTaxReturnCheckFormDTO } = taxFilingInfoDialofg;
this.setState({
taxFilingInfoDialofg: { ...taxFilingInfoDialofg, loading: true }
});
registrationCheck({
...extra, nation, province, city,
taxAgentId, password: netPassword || realNamePassword,
cityname: !_.isEmpty(cityVal) ? _.head(cityVal).name : "",
..._.find(taxAgentTaxReturnCheckFormDTO, it => it.index === selectKey)
}).then(({ status, data, errormsg }) => {
this.setState({
taxFilingInfoDialofg: { ...taxFilingInfoDialofg, loading: false }
});
if (status) {
message.success(getLabel(22619, "保存成功!"));
this.setState({
taxFilingInfoDialofg: {
...taxFilingInfoDialofg,
taxAgentTaxReturnCheckFormDTO: data.TaxAgentTaxReturnCheckFormDTO
}
});
} else {
message.error(errormsg || getLabel(22620, "保存失败!"));
}
}).catch(() => {
this.setState({
taxFilingInfoDialofg: { ...taxFilingInfoDialofg, loading: false }
});
});
};
render() {
const tabs = [
{ key: 0, title: getLabel(82751, "基础设置") },
{ key: 1, title: getLabel(544342, "报税信息") },
{ key: 2, title: getLabel(124810, "人员范围") }
];
const { isEdit, title, visible, onCancel, salaryOn, taxAgentStore: { showOperateBtn } } = this.props;
const { current, taxAgentId, taxFilingInfoDialofg } = this.state;
const tabData = !salaryOn ? _.filter(tabs, it => it.key !== 1) : tabs;
return (
<WeaSlideModal
className="slideOuterWrapper"
visible={visible}
top={0}
width={65}
height={100}
direction="right"
measure="%"
title={
<SlideModalTitle
subtitle={title}
tabs={isEdit ? tabData : []}
loading={false}
showOperateBtn={showOperateBtn}
editable={false}
onSave={() => {
}}
selectedTab={current}
customOperate={this.renderCustomOperate()}
subItemChange={this.handleChangeSlideTab}
/>
}
content={
<div className="taxAgentSlideContent">
{
!isEdit &&
<WeaSteps current={current} style={{ margin: "20px 0" }}>
{
_.map(tabData, item => {
const { key, title } = item;
return <Step description={title} key={key}/>;
})
}
</WeaSteps>
}
{
this.renderChildren()
}
<TaxFilingInfoDialofg
{...taxFilingInfoDialofg}
onSubmit={this.handleSubmit}
onCancel={(isRefresh) => {
const { jumpAll } = taxFilingInfoDialofg;
this.setState({
current: jumpAll ? this.state.current + 1 : this.state.current,
taxFilingInfoDialofg: {
...taxFilingInfoDialofg, visible: false,
taxAgentTaxReturnCheckFormDTO: null
}
}, () => {
isRefresh && this.taxInfoRef.taxReturnGetForm();
jumpAll && this.props.onCancel(true);
});
}}
/>
</div>
}
onClose={() => onCancel()}
/>
);
}
}
export default TaxAgentSlide;

View File

@ -0,0 +1,137 @@
/*
* Author: 黎永顺
* name: 个税扣缴义务人列表
* Description:
* Date: 2022/11/29
*/
import React, { Component } from "react";
import { WeaLocaleProvider, WeaTable } from "ecCom";
import { Dropdown, Menu } from "antd";
import * as API from "../../../apis/taxAgent";
import "./index.less";
const { getLabel } = WeaLocaleProvider;
class TaxAgentTable extends Component {
constructor(props) {
super(props);
this.state = {
loading: {
query: false
},
dataSource: [],
columns: [],
pageInfo: {
current: 1,
pageSize: 10,
total: 0
}
};
}
componentDidMount() {
this.getTaxAgentList();
}
getTaxAgentList = () => {
const { pageInfo, loading } = this.state;
const { searchValue, onOperate } = this.props;
const payload = {
name: searchValue,
...pageInfo
};
this.setState({ loading: { ...loading, query: true } });
API.getTaxAgentList(payload).then(({ status, data }) => {
this.setState({ loading: { ...loading, query: false } });
if (status) {
const { pageNum: current, pageSize, total, columns, list: dataSource } = data;
this.setState({
pageInfo: { ...pageInfo, current, pageSize, total },
dataSource,
columns: _.map(columns, item => {
if (item.dataIndex === "employeeRange") {
return {
...item,
render: (text, record) => {
return <a href="javaScript:void(0);" onClick={() => onOperate("edit", record.id, 2)}>{text}</a>;
}
};
}
return {
...item,
render: (text) => {
return <span className="tdEllipsis" title={text}>{text}</span>;
}
};
})
});
}
}).catch(() => {
this.setState({ loading: { ...loading, query: false } });
});
};
render() {
const { dataSource, columns, pageInfo, loading } = this.state;
const { onOperate, isChief } = this.props;
const pagination = {
...pageInfo,
showTotal: total => `${getLabel(18609, "共")} ${total} ${getLabel(18256, "条")}`,
showSizeChanger: true,
showQuickJumper: true,
pageSizeOptions: ["10", "20", "50", "100"],
onShowSizeChange: (current, pageSize) => {
this.setState({
pageInfo: { ...pageInfo, current, pageSize }
}, () => {
this.getTaxAgentList();
});
},
onChange: current => {
this.setState({
pageInfo: { ...pageInfo, current }
}, () => {
this.getTaxAgentList();
});
}
};
return (
<WeaTable
dataSource={dataSource}
pagination={pagination}
loading={loading.query}
columns={[
...columns,
{
title: getLabel(30585, "操作"),
key: "operation",
width: 120,
render: (text, record) =>
<div className="operationWapper">
<a href="javaScript:void(0);"
onClick={() => onOperate("edit", record.id)}>{getLabel(501169, "编辑")}</a>
{
isChief &&
<a href="javaScript:void(0);" style={{ marginLeft: 10 }}
onClick={() => onOperate("delete", record.id)}>{getLabel(535052, "删除")}</a>
}
<Dropdown
overlay={
<Menu>
<Menu.Item>
<a href="javascript:void(0)" style={{ marginLeft: 10 }}
onClick={() => onOperate("log", record.id)}>{getLabel(545781, "操作日志")}</a>
</Menu.Item>
</Menu>
}>
<a href="javascript:void(0)"><i className="icon-coms-more"/></a>
</Dropdown>
</div>
}
]}
/>
);
}
}
export default TaxAgentTable;

View File

@ -0,0 +1,146 @@
/*
* Author: 黎永顺
* name: 报税信息
* Description:
* Date: 2022/12/1
*/
import React, { Component } from "react";
import { WeaBrowser, WeaFormItem, WeaInput, WeaLocaleProvider, WeaSearchGroup, WeaSelect } from "ecCom";
import { fieldList } from "./constants";
import { taxReturnGetForm } from "../../../apis/taxAgent";
const { getLabel } = WeaLocaleProvider;
class TaxDeclarationInfo extends Component {
constructor(props) {
super(props);
this.state = {
fieldForm: {
name: "",
taxCode: "",
city: "",
cityVal: [],
areaCode: null,
passwordType: "TAX_NET_PASSWORD",
account: "",
realNamePassword: "",
netPassword: null,
taxRegistrationNumber: "",
departmentCode: "",
checkStatus: ""
},
fieldItem: []
};
}
componentDidMount() {
this.setState({
fieldItem: _.filter(_.map(fieldList, item => ({
...item,
label: getLabel(item.lanId, item.label),
viewAttr: this.props.isChief ? item.viewAttr : 1
})), it => it.key !== "account" && it.key !== "realNamePassword")
}, () => {
this.taxReturnGetForm();
});
}
taxReturnGetForm = () => {
const { taxAgentId } = this.props;
taxReturnGetForm({ taxAgentId }).then(({ status, data }) => {
if (status) {
const { fieldForm } = this.state;
this.setState({
fieldForm: {
...fieldForm,
..._.reduce(_.keys(fieldForm), (pre, cur) => {
if (cur !== "city") {
if (cur === "checkStatus") {
const checkStatusMap = {
"NOT_COMMIT": getLabel(111, "未验证"),
"SUCCESS": getLabel(111, "成功"),
"FAIL": getLabel(111, "失败")
};
return { ...pre, [cur]: checkStatusMap[data[cur]] };
}
return { ...pre, [cur]: data[cur] };
}
return {
...pre,
[cur]: `${data["nation"]}-${data["province"]}-${data[cur]}`
};
}, {}),
cityVal: (data["city"] && data["cityName"]) ? [{ id: data["city"], name: data["cityName"] }] : []
}
});
}
});
};
handleChangeValue = (key, value, cityVal = []) => {
const { fieldForm } = this.state;
this.setState({
fieldForm: !_.isEmpty(cityVal) ? {
...fieldForm, [key]: value, cityVal
} : { ...fieldForm, [key]: value }
}, () => {
if (key === "passwordType" && this.state.fieldForm.passwordType === "REAL_NAME_PASSWORD") {
this.setState({
fieldItem: _.filter(fieldList, it => it.key !== "netPassword"),
fieldForm: { ...this.state.fieldForm, account: null, realNamePassword: null, netPassword: null }
});
} else if (key === "passwordType" && this.state.fieldForm.passwordType === "TAX_NET_PASSWORD") {
this.setState({
fieldItem: _.filter(fieldList, it => it.key !== "account" && it.key !== "realNamePassword"),
fieldForm: { ...this.state.fieldForm, netPassword: null, account: null, realNamePassword: null }
});
}
});
};
render() {
const { fieldItem, fieldForm } = this.state;
return (
<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: 14 }} key={key}>
{
(type === "TEXT" || type === "PASSWORD") &&
<WeaInput autocomplete="off" value={fieldForm[key]} type={_.lowerCase(type)} viewAttr={viewAttr}
onChange={(v) => this.handleChangeValue(key, v)}/>
}
{
type === "SELECT" &&
<WeaBrowser replaceDatas={fieldForm["cityVal"]} type={58} viewAttr={viewAttr}
helpfulTip={getLabel(111, "请展开选择报税所属区域")}
onChange={(__, ___, datas) => {
if (!_.isEmpty(datas)) {
this.handleChangeValue(key, `1-${datas[0].pid}-${datas[0].id}`, _.map(datas, it => ({
id: it.id,
name: it.name
})));
} else {
this.handleChangeValue(key, "", []);
}
}}
/>
}
{
type === "RADIO" &&
<WeaSelect detailtype={3} value={fieldForm[key]}
options={_.map(options, it => ({ ...it, showname: getLabel(it.lanId, it.showname) }))}
viewAttr={viewAttr}
onChange={(v) => this.handleChangeValue(key, v)}/>
}
</WeaFormItem>;
})
}
</WeaSearchGroup>
</div>
);
}
}
export default TaxDeclarationInfo;

View File

@ -0,0 +1,132 @@
/*
* Author: 黎永顺
* name: 个税申报-异常失败详情
* Description:
* Date: 2023/8/18
*/
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { WeaDialog, WeaLocaleProvider, WeaTable } from "ecCom";
import { Button, message } from "antd";
import { deptFillCondition, taxFillColumns, taxFillCondition } from "./constants";
import { getSearchs } from "../../../util";
import { saveDepartmentCodeAndCheck } from "../../../apis/taxAgent";
const { getLabel } = WeaLocaleProvider;
@inject("taxAgentStore")
@observer
class TaxFilingInfoDialofg extends Component {
constructor(props) {
super(props);
this.state = {
selectedRowKeys: [], checkLoading: false
};
}
componentWillReceiveProps(nextProps, nextContext) {
if (!_.isEmpty(nextProps.taxAgentTaxReturnCheckFormDTO) &&
Object.prototype.toString.call(nextProps.taxAgentTaxReturnCheckFormDTO) === "[object Object]"
) {
const { taxAgentTaxReturnCheckFormDTO, taxAgentStore: { taxfillInfoForm, deptfillInfoForm } } = nextProps;
taxfillInfoForm.initFormFields(taxFillCondition);
deptfillInfoForm.initFormFields(deptFillCondition);
const fields = _.map(taxFillCondition[0].items, it => {
return it.domkey[0];
});
fields.map(item => {
taxfillInfoForm.updateFields({
[item]: item !== "divideFiling" ? (taxAgentTaxReturnCheckFormDTO[item] || "") : (taxAgentTaxReturnCheckFormDTO[item] === "ON" ? getLabel(538048, "是") : getLabel(30587, "否"))
});
});
}
if (nextProps.visible !== this.props.visible && !nextProps.visible) {
const { taxAgentStore: { setTaxfillInfoForm, initDeptfillInfoForm } } = nextProps;
setTaxfillInfoForm();
initDeptfillInfoForm();
}
}
handleSaveOrKnow = () => {
const { taxAgentStore: { taxfillInfoForm, deptfillInfoForm }, checkPayload } = this.props;
if (taxfillInfoForm.getFormParams().divideFiling === getLabel(538048, "是")) {
deptfillInfoForm.validateForm().then(f => {
if (f.isValid) {
this.setState({ checkLoading: true });
saveDepartmentCodeAndCheck(_.omitBy({ ...checkPayload, ...deptfillInfoForm.getFormParams() }, val => _.isNil(val)))
.then(({ status, errormsg }) => {
this.setState({ checkLoading: false });
if (status) {
message.success(getLabel(30700, "操作成功!"));
this.props.onCancel(true);
} else {
message.error(errormsg);
}
}).catch(() => this.setState({ checkLoading: false }));
} else {
f.showErrors();
}
});
} else {
this.props.onCancel();
}
};
render() {
const { selectedRowKeys, checkLoading } = this.state;
const { taxAgentStore: { taxfillInfoForm, deptfillInfoForm }, taxAgentTaxReturnCheckFormDTO, loading } = this.props;
const rowSelection = {
type: "radio",
selectedRowKeys,
onChange: selectedRowKeys => this.setState({ selectedRowKeys })
};
return (
<WeaDialog
{...this.props}
hasScroll className="taxfillingDialog" initLoadCss
buttons={
Object.prototype.toString.call(taxAgentTaxReturnCheckFormDTO) === "[object Object]" ?
[
<Button type="primary" onClick={this.handleSaveOrKnow} loading={checkLoading}>
{taxfillInfoForm.getFormParams().divideFiling === getLabel(538048, "是") ? getLabel(537558, "保存") : getLabel(545147, "知道了")}
</Button>
] : [
<Button loading={loading} type="primary"
onClick={() => !_.isEmpty(selectedRowKeys) && this.props.onSubmit(selectedRowKeys[0])}>{getLabel(725, "提交")}</Button>
]
}
style={{
width: 850,
height: 480,
minHeight: 200,
minWidth: 380,
maxHeight: "50%",
maxWidth: "50%",
overflow: "hidden",
transform: "translate(0px, 0px)"
}}
>
<div className="taxfillingDialogContent">
{
Object.prototype.toString.call(taxAgentTaxReturnCheckFormDTO) === "[object Object]" ?
<React.Fragment>
{getSearchs(taxfillInfoForm, taxFillCondition, 1)}
{taxfillInfoForm.getFormParams().divideFiling === getLabel(538048, "是") && getSearchs(deptfillInfoForm, deptFillCondition, 1)}
</React.Fragment> :
<WeaTable
rowKey="index" dataSource={taxAgentTaxReturnCheckFormDTO}
columns={_.map(taxFillColumns, o => ({
dataIndex: o.dataIndex,
width: 200,
title: getLabel(o.titleId, o.title)
}))}
scroll={{ x: 1200 }} rowSelection={rowSelection}
/>
}
</div>
</WeaDialog>
);
}
}
export default TaxFilingInfoDialofg;

View File

@ -0,0 +1,43 @@
.salaryAgentWrapper {
.comContent {
.customTitleWrapper {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
.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;
}
}
.tdEllipsis {
display: inline-block;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.ant-col-10 {
span:nth-child(2) {
//margin-top: -6px;
}
}
}

View File

@ -0,0 +1,254 @@
import React, { Component } from "react";
import { inject, observer } from "mobx-react";
import { Button, message, Modal } from "antd";
import { WeaCheckbox, WeaFormItem, WeaInputSearch, WeaLocaleProvider, WeaSearchGroup, WeaTop } from "ecCom";
import { apiflowBillingConfigStatus } from "../../apis/intelligentCalculateSalarySettings";
import ComHint from "./components/comHint";
import TaxAgentTable from "./components/taxAgentTable";
import TaxAgentSlide from "./components/taxAgentSlide";
import * as API from "../../apis/taxAgent";
import LogDialog from "../../components/logViewModal";
import "./index.less";
const { getLabel } = WeaLocaleProvider;
@inject("taxAgentStore")
@observer
class TaxAgent extends Component {
constructor(props) {
super(props);
this.state = {
syncLoading: false, //同步人员范围loading
searchValue: "",
decentralization: "0", //启用分权
permission: {},
taxAgentSlideProps: {
isEdit: false, visible: false, title: getLabel(543629, "新增个税扣缴义务人"),
taxAgentId: "", current: 0, salaryOn: true
},
logDialogVisible: false,
filterConditions: "[]"
};
this.taxAgentTableRef = null;
}
componentDidMount() {
this.getTaxAgentBaseForm();
this.getPermission();
this.apiflowBillingConfigStatus();
}
getTaxAgentBaseForm = () => {
API.getTaxAgentBaseForm().then(({ status, data }) => {
if (status) {
const { devolutionStatus } = data;
this.setState({ decentralization: String(devolutionStatus || 0) });
}
});
};
getPermission = () => {
const { taxAgentStore: { getPermission } } = this.props;
getPermission().then(({ status, data }) => {
if (status) {
this.setState({ permission: data });
}
});
};
apiflowBillingConfigStatus = () => {
const { taxAgentSlideProps } = this.state;
apiflowBillingConfigStatus().then(({ status, data }) => {
if (status) this.setState({ taxAgentSlideProps: { ...taxAgentSlideProps, salaryOn: data } });
});
};
/*
* Author: 黎永顺
* Description:开启关闭个税扣缴义务人开关
* Params:
* Date: 2022/11/29
*/
taxAgentBaseSave = devolutionStatus => {
this.setState({ decentralization: this.state.decentralization }, () => {
Modal.confirm({
title: getLabel(131329, "信息确认"),
content: `${getLabel(33703, "确认")}${devolutionStatus === "0" ? getLabel(26471, "停用") : getLabel(26472, "启用")}${getLabel(524044, "分权")}?`,
onOk: () => {
const paylaod = { devolutionStatus };
const { taxAgentStore } = this.props;
const { taxAgentBaseSave, setSalarytaxAgentForm } = taxAgentStore;
taxAgentBaseSave(paylaod).then(({ status, errormsg }) => {
if (status) {
message.success(`${devolutionStatus === "0" ? "停用" : "启用"}分权成功`);
this.getTaxAgentBaseForm();
this.getPermission();
this.taxAgentTableRef.getTaxAgentList();
setSalarytaxAgentForm();
} else {
message.error(errormsg || `${devolutionStatus === "0" ? "停用" : "启用"}分权失败`);
}
});
}
});
});
};
/*
* Author: 黎永顺
* Description:
* Params:添加个税扣缴义务人
* Date: 2022/11/29
*/
handleAddTaxAgent = () => {
this.setState({
taxAgentSlideProps: {
...this.state.taxAgentSlideProps,
visible: true, current: 0
}
});
};
/*
* Author: 黎永顺
* Description:启用分权
* Params:
* Date: 2022/12/1
*/
taxAgentRangeSync = () => {
const { taxAgentStore } = this.props;
const { taxAgentRangeSync } = taxAgentStore;
this.setState({ syncLoading: true });
taxAgentRangeSync({}).then(({ status, data, errormsg }) => {
this.setState({ syncLoading: false });
if (status) {
message.success(data || getLabel(30700, "操作成功"));
this.taxAgentTableRef.getTaxAgentList();
} else {
message.error(data || errormsg || getLabel(30651, "操作失败"));
}
});
};
handelResetSlide = (isUpdate = false) => {
const { taxAgentStore } = this.props;
const { salarytaxAgentForm } = taxAgentStore;
this.setState({
taxAgentSlideProps: {
...this.state.taxAgentSlideProps,
isEdit: false,
visible: false,
title: getLabel(543629, "新增个税扣缴义务人"),
taxAgentId: "",
current: 0
}
}, () => {
isUpdate && this.taxAgentTableRef.getTaxAgentList();
salarytaxAgentForm.resetForm();
});
};
handleOperate = (type, itemId, current = 0) => {
switch (type) {
case "edit":
this.setState({
taxAgentSlideProps: {
...this.state.taxAgentSlideProps,
visible: true, title: getLabel(543632, "编辑个税扣缴义务人"),
taxAgentId: itemId, current, isEdit: true
}
});
break;
case "delete":
Modal.confirm({
title: getLabel(131329, "信息确认"),
content: getLabel(388758, "确认要删除吗?"),
onOk: () => {
API.deleteTaxAgent([itemId]).then(({ status, errormsg }) => {
if (status) {
message.success(getLabel(502230, "删除成功"));
this.taxAgentTableRef.getTaxAgentList();
} else {
message.error(errormsg || getLabel(20462, "删除失败"));
}
});
}
});
break;
case "log":
this.setState({
logDialogVisible: true,
filterConditions: itemId ? `[{\"connectCondition\":\"AND\",\"columIndex\":\"targetid\",\"type\":\"=\",\"value\":\"${itemId}\"}]` : "[]"
});
break;
default:
break;
}
};
render() {
const {
searchValue, decentralization, taxAgentSlideProps,
permission, syncLoading, logDialogVisible, filterConditions
} = this.state;
const btns = [
<Button type="primary" onClick={this.taxAgentRangeSync}
loading={syncLoading}>{getLabel(543633, "同步人员范围")}</Button>,
<WeaInputSearch
style={{ width: 220 }}
value={searchValue}
onChange={searchValue => this.setState({ searchValue })}
placeholder={getLabel(543634, "请输入个税扣缴义务人名称")}
onSearch={() => this.taxAgentTableRef.getTaxAgentList()}
/>
];
const customTitle = <div className="customTitleWrapper">
<span>{getLabel(537996, "个税扣缴义务人")}</span>
{
permission.isChief &&
<Button type="primary" size="small" onClick={this.handleAddTaxAgent}>
<span className="icon-coms-Add-to-hot" title={getLabel(384113, "添加")}></span>
</Button>
}
</div>;
return (
<div className="salaryAgentWrapper">
<WeaTop
title={getLabel(537996, "个税扣缴义务人")}
icon={<i className="icon-coms-fa"/>}
iconBgcolor="#F14A2D"
buttons={btns}
showDropIcon onDropMenuClick={key => this.handleOperate(key)}
dropMenuDatas={[
{
key: "log", icon: <i className="iconfont icon-caozuorizhi32"/>,
content: getLabel(545781, "操作日志")
}
]}
>
<div className="comContent">
{
permission.isChief &&
<WeaSearchGroup title={getLabel(82743, "基础信息")} showGroup>
<WeaFormItem label={getLabel(543639, "启用分权")} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
<WeaCheckbox value={decentralization} display="switch" onChange={this.taxAgentBaseSave}/>
</WeaFormItem>
</WeaSearchGroup>
}
<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- 是否是总管理员
decentralization={decentralization} //是否开启分权 0否 1是 ;开启分权才有管理员的添加
onOk={() => this.taxAgentTableRef.getTaxAgentList()}
onCancel={(isUpdate = false) => this.handelResetSlide(isUpdate)}
/>
{/*操作日志*/}
<LogDialog visible={logDialogVisible} logFunction="taxagent" filterConditions={filterConditions}
onCancel={() => this.setState({ logDialogVisible: false })}/>
</WeaTop>
</div>
);
}
}
export default TaxAgent;