release/2.18.2.2412.02-个税
This commit is contained in:
parent
bafd4e7538
commit
64d1b61f15
|
|
@ -20,7 +20,7 @@ class BaseSettings extends Component {
|
||||||
render() {
|
render() {
|
||||||
const { taxAgentStore: { salarytaxAgentForm }, decentralization, isChief } = this.props;
|
const { taxAgentStore: { salarytaxAgentForm }, decentralization, isChief } = this.props;
|
||||||
return (
|
return (
|
||||||
<div className="baseSettingWrapper">
|
<div className="baseSettingWrapper form-dialog-layout">
|
||||||
{
|
{
|
||||||
decentralization === "0" ?
|
decentralization === "0" ?
|
||||||
getSearchs(salarytaxAgentForm, convertConditon(decentralizationConditions, !isChief), 1, false) :
|
getSearchs(salarytaxAgentForm, convertConditon(decentralizationConditions, !isChief), 1, false) :
|
||||||
|
|
|
||||||
|
|
@ -238,7 +238,6 @@ export const deptFillCondition = [
|
||||||
defaultshow: true
|
defaultshow: true
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
export const taxFillColumns = [
|
export const taxFillColumns = [
|
||||||
{
|
{
|
||||||
dataIndex: "taxCode",
|
dataIndex: "taxCode",
|
||||||
|
|
@ -292,3 +291,150 @@ export const taxFillColumns = [
|
||||||
titleId: "545141"
|
titleId: "545141"
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
export const personScopeConditions = [
|
||||||
|
{
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
conditionType: "SELECT_LINKAGE",
|
||||||
|
domkey: ["targetType"],
|
||||||
|
fieldcol: 18,
|
||||||
|
label: "对象类型",
|
||||||
|
lanId: 111,
|
||||||
|
labelcol: 6,
|
||||||
|
options: [],
|
||||||
|
viewAttr: 3,
|
||||||
|
rules: "selectLinkageRequired",
|
||||||
|
selectLinkageDatas: {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
conditionType: "SELECT",
|
||||||
|
domkey: ["employeeStatus"],
|
||||||
|
fieldcol: 18,
|
||||||
|
label: "选择员工状态",
|
||||||
|
lanId: 111,
|
||||||
|
labelcol: 6,
|
||||||
|
value: "",
|
||||||
|
detailtype: "2",
|
||||||
|
rules: "required",
|
||||||
|
viewAttr: 3
|
||||||
|
},
|
||||||
|
],
|
||||||
|
defaultshow: true
|
||||||
|
}
|
||||||
|
];
|
||||||
|
export const scopeSelectLinkageDatas = {
|
||||||
|
EMPLOYEE:{
|
||||||
|
browserConditionParam: {
|
||||||
|
completeParams: {},
|
||||||
|
dataParams: {},
|
||||||
|
hasAddBtn: false,
|
||||||
|
hasAdvanceSerach: true,
|
||||||
|
isAutoComplete: 1,
|
||||||
|
isDetail: 0,
|
||||||
|
isMultCheckbox: false,
|
||||||
|
isSingle: false,
|
||||||
|
pageSize: 10,
|
||||||
|
linkUrl: "",
|
||||||
|
type: "17",
|
||||||
|
viewAttr: 3,
|
||||||
|
rules:'required',
|
||||||
|
title: ""
|
||||||
|
},
|
||||||
|
conditionType: "BROWSER",
|
||||||
|
domkey: ["target"],
|
||||||
|
fieldcol: 24,
|
||||||
|
label: "",
|
||||||
|
labelcol: 0,
|
||||||
|
value: "",
|
||||||
|
rules: "required",
|
||||||
|
viewAttr: 3
|
||||||
|
},
|
||||||
|
DEPT:{
|
||||||
|
browserConditionParam: {
|
||||||
|
completeParams: {},
|
||||||
|
dataParams: {},
|
||||||
|
hasAddBtn: false,
|
||||||
|
hasAdvanceSerach: true,
|
||||||
|
isAutoComplete: 1,
|
||||||
|
isDetail: 0,
|
||||||
|
isMultCheckbox: false,
|
||||||
|
isSingle: false,
|
||||||
|
pageSize: 10,
|
||||||
|
linkUrl: "",
|
||||||
|
type: "57",
|
||||||
|
viewAttr: 3,
|
||||||
|
rules:'required',
|
||||||
|
title: ""
|
||||||
|
},
|
||||||
|
conditionType: "BROWSER",
|
||||||
|
domkey: ["target"],
|
||||||
|
fieldcol: 24,
|
||||||
|
label: "",
|
||||||
|
labelcol: 0,
|
||||||
|
value: "",
|
||||||
|
rules: "required",
|
||||||
|
viewAttr: 3
|
||||||
|
},
|
||||||
|
SUBCOMPANY:{
|
||||||
|
browserConditionParam: {
|
||||||
|
completeParams: {},
|
||||||
|
dataParams: {},
|
||||||
|
hasAddBtn: false,
|
||||||
|
hasAdvanceSerach: true,
|
||||||
|
isAutoComplete: 1,
|
||||||
|
isDetail: 0,
|
||||||
|
isMultCheckbox: false,
|
||||||
|
isSingle: false,
|
||||||
|
pageSize: 10,
|
||||||
|
linkUrl: "",
|
||||||
|
type: "164",
|
||||||
|
viewAttr: 3,
|
||||||
|
rules:'required',
|
||||||
|
title: ""
|
||||||
|
},
|
||||||
|
conditionType: "BROWSER",
|
||||||
|
domkey: ["target"],
|
||||||
|
fieldcol: 24,
|
||||||
|
label: "",
|
||||||
|
labelcol: 0,
|
||||||
|
value: "",
|
||||||
|
rules: "required",
|
||||||
|
viewAttr: 3
|
||||||
|
},
|
||||||
|
POSITION:{
|
||||||
|
browserConditionParam: {
|
||||||
|
completeParams: {},
|
||||||
|
dataParams: {},
|
||||||
|
hasAddBtn: false,
|
||||||
|
hasAdvanceSerach: true,
|
||||||
|
isAutoComplete: 1,
|
||||||
|
isDetail: 0,
|
||||||
|
isMultCheckbox: false,
|
||||||
|
isSingle: false,
|
||||||
|
pageSize: 10,
|
||||||
|
linkUrl: "",
|
||||||
|
type: "278",
|
||||||
|
viewAttr: 3,
|
||||||
|
rules:'required',
|
||||||
|
title: ""
|
||||||
|
},
|
||||||
|
conditionType: "BROWSER",
|
||||||
|
domkey: ["target"],
|
||||||
|
fieldcol: 24,
|
||||||
|
label: "",
|
||||||
|
labelcol: 0,
|
||||||
|
value: "",
|
||||||
|
rules: "required",
|
||||||
|
viewAttr: 3
|
||||||
|
},
|
||||||
|
SQL: {
|
||||||
|
conditionType: "TEXTAREA",
|
||||||
|
domkey: ["target"],
|
||||||
|
fieldcol: 24,
|
||||||
|
label: "",
|
||||||
|
labelcol: 0,
|
||||||
|
value: "",
|
||||||
|
rules: "required",
|
||||||
|
viewAttr: 3
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,35 @@
|
||||||
.taxAgentSlideContent {
|
.taxAgentSlideContent {
|
||||||
|
height: 100%;
|
||||||
|
background: #F6F6F6;
|
||||||
|
|
||||||
|
.ant-steps {
|
||||||
|
margin: 0 0 20px 0 !important;
|
||||||
|
padding-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.personal-scope {
|
||||||
|
padding: 8px 16px;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.wea-tab, .wea-new-table {
|
||||||
|
background: #FFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon-refresh {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
color: #fff;
|
||||||
|
background: #55a1f8;
|
||||||
|
cursor: pointer;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.baseSettingWrapper, .taxDeclarationInfoWrapper {
|
.baseSettingWrapper, .taxDeclarationInfoWrapper {
|
||||||
padding: 12px 12px 12px 20px;
|
padding: 8px 16px;
|
||||||
|
|
||||||
.wea-search-group {
|
.wea-search-group {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
@ -28,6 +57,7 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 16px 0;
|
margin: 16px 0;
|
||||||
border: 1px solid #e5e5e5;
|
border: 1px solid #e5e5e5;
|
||||||
|
background: #FFF;
|
||||||
|
|
||||||
.hintHeader {
|
.hintHeader {
|
||||||
background: #f6f6f6;
|
background: #f6f6f6;
|
||||||
|
|
|
||||||
|
|
@ -5,22 +5,22 @@
|
||||||
* Date: 2022/11/30
|
* Date: 2022/11/30
|
||||||
*/
|
*/
|
||||||
import React, { Component } from "react";
|
import React, { Component } from "react";
|
||||||
import { Button, message, Modal } from "antd";
|
import { message, Modal } from "antd";
|
||||||
import { inject, observer } from "mobx-react";
|
import { inject, observer } from "mobx-react";
|
||||||
import { WeaButtonIcon, WeaInputSearch, WeaTab } from "ecCom";
|
import { WeaButtonIcon, WeaInputSearch, WeaLocaleProvider, WeaTab } from "ecCom";
|
||||||
import {
|
import {
|
||||||
taxAgentRangeDelete,
|
taxAgentRangeDelete,
|
||||||
taxAgentRangeExtDelete,
|
taxAgentRangeExtDelete,
|
||||||
taxAgentRangeExtSave,
|
taxAgentRangeExtSave,
|
||||||
taxAgentRangeImportData,
|
taxAgentRangeImportData
|
||||||
taxAgentRangePreview
|
|
||||||
} from "../../../apis/taxAgent";
|
} from "../../../apis/taxAgent";
|
||||||
import { sysinfo } from "../../../apis/ruleconfig";
|
import { sysinfo } from "../../../apis/ruleconfig";
|
||||||
import PersonalScopeTable from "./personalScopeTable";
|
import PersonalScopeTable from "./personalScopeTable";
|
||||||
import PersonalScopeModal from "./personalScopeModal";
|
import PersonalScopeModal from "./personalScopeModal";
|
||||||
import ImportModal from "../../../components/importModal";
|
import ImportDialog from "../../../components/importDialog";
|
||||||
import ExternalPersonModal from "../../../components/externalPersonModal";
|
import ExternalPersonModal from "../../../components/externalPersonModal";
|
||||||
import { importEmployColumns } from "../../taxAgent/columns";
|
|
||||||
|
const getLabel = WeaLocaleProvider.getLabel;
|
||||||
|
|
||||||
@inject("taxAgentStore")
|
@inject("taxAgentStore")
|
||||||
@observer
|
@observer
|
||||||
|
|
@ -28,17 +28,16 @@ class PersonalScope extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
searchValue: "", selectedKey: "listInclude",
|
searchValue: "", selectedKey: "listInclude", rowKeys: [], loading: false,
|
||||||
rowKeys: [], personalAddModal: {
|
extEmpsWitch: "1", //非系统人员开关, 1: 开启, 0:关闭
|
||||||
visible: false, externalVisible: false,
|
personalAddModal: {
|
||||||
title: "关联人员", includeType: ""
|
visible: false, externalVisible: false, title: getLabel(111, "关联人员"), includeType: "", record: {}
|
||||||
},
|
},
|
||||||
previewDataSource: [], importParams: {
|
importParams: {
|
||||||
visible: false,
|
visible: false, title: getLabel(111, "数据导入"), nextloading: false, importResult: {}, imageId: "",
|
||||||
step: 0,
|
link: `/api/bs/hrmsalary/taxAgent/range/downloadTemplate?taxAgentId=${props.taxAgentId}`,
|
||||||
importResult: {}
|
previewUrl: "/api/bs/hrmsalary/taxAgent/range/preview"
|
||||||
}, extEmpsWitch: "1", //非系统人员开关, 1: 开启, 0:关闭
|
}
|
||||||
loading: false
|
|
||||||
};
|
};
|
||||||
this.personalScopeTableRef = null;
|
this.personalScopeTableRef = null;
|
||||||
}
|
}
|
||||||
|
|
@ -92,37 +91,26 @@ class PersonalScope extends Component {
|
||||||
* Params:
|
* Params:
|
||||||
* Date: 2022/11/30
|
* Date: 2022/11/30
|
||||||
*/
|
*/
|
||||||
handleAddPersonal = () => {
|
handleAddPersonal = (record = {}) => {
|
||||||
const { personalAddModal, selectedKey } = this.state;
|
const { personalAddModal, selectedKey } = this.state;
|
||||||
this.setState({
|
this.setState({
|
||||||
personalAddModal: {
|
personalAddModal: {
|
||||||
...personalAddModal,
|
...personalAddModal, record,
|
||||||
visible: selectedKey !== "listExt",
|
visible: selectedKey !== "listExt",
|
||||||
externalVisible: selectedKey === "listExt",
|
externalVisible: selectedKey === "listExt",
|
||||||
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) => {
|
handleImportFile = (params) => {
|
||||||
const { taxAgentId } = this.props;
|
const { taxAgentId } = this.props, { importParams } = this.state;
|
||||||
taxAgentRangeImportData({ ...params, taxAgentId }).then(({ status, data }) => {
|
this.setState({ importParams: { ...importParams, nextloading: true } });
|
||||||
|
taxAgentRangeImportData({ ...params, taxAgentId }).then(({ status, errormsg, data }) => {
|
||||||
|
this.setState({ importParams: { ...importParams, nextloading: false } });
|
||||||
if (status) {
|
if (status) {
|
||||||
this.setState({
|
this.setState({ importParams: { ...importParams, importResult: data } });
|
||||||
importParams: {
|
} else {
|
||||||
...this.state.importParams,
|
message.warning(errormsg);
|
||||||
importResult: data
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
@ -153,10 +141,7 @@ class PersonalScope extends Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const { selectedKey, searchValue, rowKeys, personalAddModal, importParams, extEmpsWitch, loading } = this.state;
|
||||||
selectedKey, searchValue, rowKeys, personalAddModal,
|
|
||||||
importParams, previewDataSource, extEmpsWitch, loading
|
|
||||||
} = this.state;
|
|
||||||
const { taxAgentStore: { hideIconInTax, showSalaryItemBtn }, taxAgentId } = this.props;
|
const { taxAgentStore: { hideIconInTax, showSalaryItemBtn }, taxAgentId } = this.props;
|
||||||
const topTab = [
|
const topTab = [
|
||||||
{
|
{
|
||||||
|
|
@ -173,36 +158,33 @@ class PersonalScope extends Component {
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
const btns = (hideIconInTax || showSalaryItemBtn) ? [
|
const btns = (hideIconInTax || showSalaryItemBtn) ? [
|
||||||
<Button
|
<span className="icon-refresh" title={getLabel(111, "导入")} onClick={() => {
|
||||||
type="primary"
|
this.setState({ importParams: { ...importParams, visible: true } });
|
||||||
onClick={() => {
|
}}><i className="icon-coms-leading-in"/></span>,
|
||||||
this.setState({ importParams: { ...importParams, visible: true, step: 0 } });
|
|
||||||
}}
|
|
||||||
>导入</Button>,
|
|
||||||
<WeaButtonIcon
|
<WeaButtonIcon
|
||||||
buttonType="del"
|
buttonType="del"
|
||||||
type="primary"
|
type="primary"
|
||||||
disabled={_.isEmpty(rowKeys)}
|
disabled={_.isEmpty(rowKeys)}
|
||||||
onClick={this.taxAgentRangeDelete}
|
onClick={this.taxAgentRangeDelete}
|
||||||
/>,
|
/>,
|
||||||
<WeaButtonIcon buttonType="add" type="primary" onClick={this.handleAddPersonal}/>,
|
<WeaButtonIcon buttonType="add" type="primary" onClick={() => this.handleAddPersonal()}/>,
|
||||||
<WeaInputSearch
|
<WeaInputSearch
|
||||||
style={{ width: 220 }}
|
style={{ width: 220 }}
|
||||||
value={searchValue}
|
value={searchValue}
|
||||||
onChange={searchValue => this.setState({ searchValue })}
|
onChange={searchValue => this.setState({ searchValue })}
|
||||||
placeholder="请输入对象"
|
placeholder="请输入对象"
|
||||||
onSearch={() => this.personalScopeTableRef.getPersonalScopeList()}
|
onSearch={() => this.personalScopeTableRef.getPersonalScopeList(selectedKey, 1)}
|
||||||
/>
|
/>
|
||||||
] : [<WeaInputSearch
|
] : [<WeaInputSearch
|
||||||
style={{ width: 220 }}
|
style={{ width: 220 }}
|
||||||
value={searchValue}
|
value={searchValue}
|
||||||
onChange={searchValue => this.setState({ searchValue })}
|
onChange={searchValue => this.setState({ searchValue })}
|
||||||
placeholder="请输入对象"
|
placeholder="请输入对象"
|
||||||
onSearch={() => this.personalScopeTableRef.getPersonalScopeList()}
|
onSearch={() => this.personalScopeTableRef.getPersonalScopeList(selectedKey, 1)}
|
||||||
/>];
|
/>];
|
||||||
(selectedKey === "listExclude" || selectedKey === "listExt") && btns.shift();
|
(selectedKey === "listExclude" || selectedKey === "listExt") && btns.shift();
|
||||||
return (
|
return (
|
||||||
<div>
|
<div className="personal-scope">
|
||||||
<WeaTab
|
<WeaTab
|
||||||
datas={(extEmpsWitch === "0" || !extEmpsWitch) ? topTab.slice(0, -1) : topTab}
|
datas={(extEmpsWitch === "0" || !extEmpsWitch) ? topTab.slice(0, -1) : topTab}
|
||||||
keyParam="viewcondition" //主键
|
keyParam="viewcondition" //主键
|
||||||
|
|
@ -216,6 +198,7 @@ class PersonalScope extends Component {
|
||||||
tabActive={selectedKey}
|
tabActive={selectedKey}
|
||||||
searchValue={searchValue}
|
searchValue={searchValue}
|
||||||
onChangeSelectKey={rowKeys => this.setState({ rowKeys })}
|
onChangeSelectKey={rowKeys => this.setState({ rowKeys })}
|
||||||
|
onEditScope={this.handleAddPersonal}
|
||||||
/>
|
/>
|
||||||
{/*非系统人员添加*/}
|
{/*非系统人员添加*/}
|
||||||
<ExternalPersonModal
|
<ExternalPersonModal
|
||||||
|
|
@ -227,43 +210,21 @@ class PersonalScope extends Component {
|
||||||
{...personalAddModal}
|
{...personalAddModal}
|
||||||
taxAgentId={taxAgentId}
|
taxAgentId={taxAgentId}
|
||||||
onSuccess={() => this.personalScopeTableRef.getPersonalScopeList()}
|
onSuccess={() => this.personalScopeTableRef.getPersonalScopeList()}
|
||||||
onCancel={() =>
|
onCancel={(callback) =>
|
||||||
this.setState({
|
this.setState({
|
||||||
personalAddModal: {
|
personalAddModal: { ...personalAddModal, visible: false, includeType: "", record: {} }
|
||||||
...personalAddModal,
|
}, () => callback && callback())
|
||||||
visible: false,
|
|
||||||
includeType: ""
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
{importParams.visible && (
|
<ImportDialog {...importParams}
|
||||||
<ImportModal
|
nextCallback={imageId => this.setState({ importParams: { ...importParams, imageId } })}
|
||||||
isInit={false}
|
nextUplaodCallback={imageId => this.handleImportFile({ imageId })}
|
||||||
columns={importEmployColumns}
|
onResetImportResult={() => this.setState(({
|
||||||
slideDataSource={previewDataSource}
|
importParams: { ...importParams, importResult: {}, imageId: "" }
|
||||||
step={importParams.step}
|
}))}
|
||||||
setStep={(step) => {
|
onCancel={(callback) => this.setState({
|
||||||
this.setState({ importParams: { ...this.state.importParams, step } });
|
importParams: { ...importParams, visible: false }
|
||||||
}}
|
}, () => callback && this.personalScopeTableRef.getPersonalScopeList(selectedKey, 1))}/>
|
||||||
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>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,184 +5,153 @@
|
||||||
* Date: 2022/11/30
|
* Date: 2022/11/30
|
||||||
*/
|
*/
|
||||||
import React, { Component } from "react";
|
import React, { Component } from "react";
|
||||||
import { WeaBrowser, WeaDialog, WeaFormItem, WeaSearchGroup, WeaSelect } from "ecCom";
|
import { inject, observer } from "mobx-react";
|
||||||
import { Button, message, Modal } from "antd";
|
import { WeaSwitch } from "comsMobx";
|
||||||
import { getTaxAgentRangeForm, taxAgentRangeSave } from "../../../apis/taxAgent";
|
import { WeaCheckbox, WeaDialog, WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom";
|
||||||
import { SelectWithAll } from "../../socialSecurityBenefits/standingBookDetail/components/regAddEmployee";
|
import { Button, message } from "antd";
|
||||||
import "./index.less";
|
import { getTaxAgentRangeForm, taxAgentRangeEdit, taxAgentRangeSave } from "../../../apis/taxAgent";
|
||||||
|
import { personScopeConditions, scopeSelectLinkageDatas } from "./constants";
|
||||||
|
|
||||||
|
const getKey = WeaTools.getKey;
|
||||||
|
const getLabel = WeaLocaleProvider.getLabel;
|
||||||
|
|
||||||
|
@inject("taxAgentStore")
|
||||||
|
@observer
|
||||||
class PersonalScopeModal extends Component {
|
class PersonalScopeModal extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
loading: false,
|
loading: false, conditions: [], employeeStatus: []
|
||||||
employeeStatus: [],
|
|
||||||
targetTypeList: [],
|
|
||||||
targetType: "EMPLOYEE",
|
|
||||||
targetTypeIds: "",
|
|
||||||
targetTypeIdsNames: "",
|
|
||||||
status: "",
|
|
||||||
statusAll: ""
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentWillReceiveProps(nextProps, nextContext) {
|
||||||
this.getTaxAgentRangeForm();
|
if (nextProps.visible !== this.props.visible && nextProps.visible) this.getTaxAgentRangeForm(nextProps);
|
||||||
|
if (nextProps.visible !== this.props.visible && !nextProps.visible) this.props.taxAgentStore.initPersonScopeForm();
|
||||||
}
|
}
|
||||||
|
|
||||||
getTaxAgentRangeForm = () => {
|
getTaxAgentRangeForm = (props) => {
|
||||||
|
const { record } = props;
|
||||||
getTaxAgentRangeForm().then(({ status, data }) => {
|
getTaxAgentRangeForm().then(({ status, data }) => {
|
||||||
if (status) {
|
if (status) {
|
||||||
const { employeeStatus, targetTypeList } = data;
|
const { employeeStatus, targetTypeList } = data;
|
||||||
this.setState({
|
this.setState({
|
||||||
targetTypeList: _.map(targetTypeList, it => ({ key: it.id, showname: it.name })),
|
employeeStatus, conditions: _.map(personScopeConditions, item => ({
|
||||||
employeeStatus: _.map(employeeStatus, it => ({ key: it.id, showname: it.name }))
|
...item, items: _.map(item.items, o => {
|
||||||
});
|
if (getKey(o) === "employeeStatus") {
|
||||||
|
return {
|
||||||
|
...o, label: getLabel(o.lanId, o.label), value: !_.isEmpty(record) ? record.status : "",
|
||||||
|
options: _.map(employeeStatus, it => ({ key: it.id, showname: it.name }))
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
...o, label: getLabel(o.lanId, o.label), viewAttr: !_.isEmpty(record) ? 1 : 3,
|
||||||
|
options: _.map(targetTypeList, it => ({
|
||||||
|
key: it.id, showname: it.name,
|
||||||
|
selected: !_.isEmpty(record) ? it.id === record.targetType : it.id === "EMPLOYEE"
|
||||||
|
})),
|
||||||
|
selectLinkageDatas: {
|
||||||
|
..._.reduce(_.keys(scopeSelectLinkageDatas), (pre, cur) => {
|
||||||
|
if (cur !== "SQL") {
|
||||||
|
return {
|
||||||
|
...pre,
|
||||||
|
[cur]: {
|
||||||
|
...scopeSelectLinkageDatas[cur],
|
||||||
|
browserConditionParam: {
|
||||||
|
...scopeSelectLinkageDatas[cur].browserConditionParam,
|
||||||
|
isSingle: true,
|
||||||
|
replaceDatas: !_.isEmpty(record) ? [{
|
||||||
|
id: String(record.targetId),
|
||||||
|
name: record.targetName
|
||||||
|
}] : []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
...pre, [cur]: { ...scopeSelectLinkageDatas[cur], value: !_.isEmpty(record) ? record.target : "" }
|
||||||
|
};
|
||||||
|
}, {})
|
||||||
|
}
|
||||||
|
};
|
||||||
|
})
|
||||||
|
}))
|
||||||
|
}, () => this.props.taxAgentStore.personScopeForm.initFormFields(this.state.conditions));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
taxAgentRangeSave = () => {
|
taxAgentRangeSave = () => {
|
||||||
const { status, targetTypeIds, targetType } = this.state;
|
const { taxAgentStore: { personScopeForm }, record = {} } = this.props;
|
||||||
const { includeType, taxAgentId, onSuccess, onCancel } = this.props;
|
personScopeForm.validateForm().then(f => {
|
||||||
if (_.isEmpty(status) || _.isEmpty(targetTypeIds)) {
|
if (f.isValid) {
|
||||||
Modal.warning({
|
const { employeeStatus, targetType, target } = personScopeForm.getFormParams();
|
||||||
title: "信息确认",
|
const { includeType, taxAgentId } = this.props;
|
||||||
content: "必要信息不完整,红色*为必填项!"
|
const payload = {
|
||||||
});
|
includeType, taxAgentId, employeeStatus: employeeStatus.split(","), id: record.id,
|
||||||
return;
|
targetParams: _.map(target.split(","), it => ({
|
||||||
}
|
targetType, targetId: targetType === "SQL" ? "0" : it,
|
||||||
const payload = {
|
target: targetType === "SQL" ? target : ""
|
||||||
employeeStatus: status.split(","),
|
}))
|
||||||
includeType,
|
};
|
||||||
targetParams: _.map(targetTypeIds.split(","), it => ({ targetType, targetId: it })),
|
this.setState({ loading: true });
|
||||||
taxAgentId
|
const API = !_.isEmpty(record) ? taxAgentRangeEdit : taxAgentRangeSave;
|
||||||
};
|
API(payload).then(({ status, errormsg }) => {
|
||||||
this.setState({ loading: true });
|
this.setState({ loading: false });
|
||||||
taxAgentRangeSave(payload).then(({ status, errormsg }) => {
|
if (status) {
|
||||||
this.setState({ loading: false });
|
message.success(getLabel(111, "操作成功!"));
|
||||||
if (status) {
|
this.props.onCancel(this.props.onSuccess);
|
||||||
message.success("保存成功");
|
} else {
|
||||||
this.handleReset();
|
message.error(errormsg);
|
||||||
onSuccess();
|
}
|
||||||
onCancel();
|
}).catch(() => this.setState({ loading: true }));
|
||||||
} else {
|
} else {
|
||||||
message.error(errormsg || "保存失败");
|
f.showErrors();
|
||||||
}
|
}
|
||||||
}).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: ""
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
renderForm = () => {
|
||||||
|
const { taxAgentStore: { personScopeForm } } = this.props;
|
||||||
|
const { conditions, employeeStatus } = this.state, { isFormInit } = personScopeForm,
|
||||||
|
formParams = personScopeForm.getFormParams();
|
||||||
|
const checked = formParams.employeeStatus && _.every(_.map(employeeStatus, o => o.id), k => formParams.employeeStatus.indexOf(k) !== -1);
|
||||||
|
let group = [];
|
||||||
|
isFormInit && conditions.map(c => {
|
||||||
|
let items = [];
|
||||||
|
c.items.map(fields => {
|
||||||
|
items.push({
|
||||||
|
com: (
|
||||||
|
<WeaFormItem label={`${fields.label}`} labelCol={{ span: `${fields.labelcol}` }}
|
||||||
|
wrapperCol={{ span: `${fields.fieldcol}` }} error={personScopeForm.getError(fields)}
|
||||||
|
tipPosition="bottom">
|
||||||
|
{
|
||||||
|
getKey(fields) === "employeeStatus" &&
|
||||||
|
<WeaCheckbox value={checked ? "1" : "0"} content={getLabel(111, "全选")}
|
||||||
|
onChange={this.handleChangeAll}/>
|
||||||
|
}
|
||||||
|
<WeaSwitch fieldConfig={fields} form={personScopeForm} formParams={formParams}/>
|
||||||
|
</WeaFormItem>),
|
||||||
|
hide: fields.hide
|
||||||
|
});
|
||||||
|
});
|
||||||
|
group.push(<WeaSearchGroup col={1} needTigger showGroup={c.defaultshow} items={items}/>);
|
||||||
|
});
|
||||||
|
return group;
|
||||||
|
};
|
||||||
|
handleChangeAll = (val) => {
|
||||||
|
const { taxAgentStore: { personScopeForm } } = this.props, { employeeStatus } = this.state;
|
||||||
|
val === "1" ? personScopeForm.updateFields({ employeeStatus: { value: _.map(employeeStatus, o => o.id).join(",") } }) :
|
||||||
|
personScopeForm.updateFields({ employeeStatus: { value: "" } });
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { onCancel, title, visible } = this.props;
|
const { title, taxAgentStore: { personScopeForm } } = this.props, { loading } = this.state;
|
||||||
const { employeeStatus, targetTypeList, targetType, status, statusAll, loading } = this.state;
|
|
||||||
const buttons = [
|
const buttons = [
|
||||||
<Button type="primary" onClick={this.taxAgentRangeSave} loading={loading}>确定</Button>,
|
<Button type="primary" onClick={this.taxAgentRangeSave} loading={loading}>{getLabel(111, "确定")}</Button>,
|
||||||
<Button type="ghost" onClick={this.handleReset}>重置</Button>
|
<Button type="ghost" onClick={() => personScopeForm.resetForm()}>{getLabel(111, "重置")}</Button>
|
||||||
];
|
];
|
||||||
return (
|
return (
|
||||||
<WeaDialog
|
<WeaDialog {...this.props} initLoadCss title={title} style={{ width: 600 }} buttons={buttons}>
|
||||||
initLoadCss
|
<div className="form-dialog-layout">{this.renderForm()}</div>
|
||||||
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>
|
</WeaDialog>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,13 +47,11 @@ class PersonalScopeTable extends Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getPersonalScopeList = (tabActive = this.props.tabActive) => {
|
getPersonalScopeList = (tabActive = this.props.tabActive, current) => {
|
||||||
const { searchValue, taxAgentId } = this.props;
|
const { searchValue, taxAgentId } = this.props;
|
||||||
const { pageInfo, loading } = this.state;
|
const { pageInfo, loading } = this.state;
|
||||||
const payload = {
|
const payload = {
|
||||||
taxAgentId,
|
taxAgentId, targetName: searchValue, ...pageInfo, current: current || pageInfo.current
|
||||||
targetName: searchValue,
|
|
||||||
...pageInfo
|
|
||||||
};
|
};
|
||||||
this.setState({ loading: { ...loading, query: true } });
|
this.setState({ loading: { ...loading, query: true } });
|
||||||
APIFox[tabActive](payload).then(({ status, data }) => {
|
APIFox[tabActive](payload).then(({ status, data }) => {
|
||||||
|
|
@ -66,7 +64,10 @@ class PersonalScopeTable extends Component {
|
||||||
columns: _.map(columns, item => {
|
columns: _.map(columns, item => {
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
render: (text) => {
|
render: (text, record) => {
|
||||||
|
if (item.dataIndex === "targetName") {
|
||||||
|
return <a href="javascript:void(0);" onClick={() => this.props.onEditScope(record)}>{text}</a>;
|
||||||
|
}
|
||||||
return <span className="tdEllipsis" title={text}>{text}</span>;
|
return <span className="tdEllipsis" title={text}>{text}</span>;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -129,6 +130,7 @@ class PersonalScopeTable extends Component {
|
||||||
pagination={pagination}
|
pagination={pagination}
|
||||||
loading={loading.query}
|
loading={loading.query}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
|
scroll={{ y: `calc(100vh - 230px)` }}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ class TaxDeclarationInfo extends Component {
|
||||||
render() {
|
render() {
|
||||||
const { fieldItem, fieldForm } = this.state;
|
const { fieldItem, fieldForm } = this.state;
|
||||||
return (
|
return (
|
||||||
<div className="taxDeclarationInfoWrapper">
|
<div className="taxDeclarationInfoWrapper form-dialog-layout">
|
||||||
<WeaSearchGroup col={1} needTigger showGroup>
|
<WeaSearchGroup col={1} needTigger showGroup>
|
||||||
{
|
{
|
||||||
_.map(fieldItem, item => {
|
_.map(fieldItem, item => {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,37 @@
|
||||||
.salaryAgentWrapper {
|
.salaryAgentWrapper {
|
||||||
|
.wea-new-top-content {
|
||||||
|
background: #f6f6f6;
|
||||||
|
padding: 8px 16px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wea-new-top {
|
||||||
|
.wea-input-focus {
|
||||||
|
height: 31.36px;
|
||||||
|
line-height: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.comContent {
|
.comContent {
|
||||||
|
.wea-search-group:first-child {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wea-search-group {
|
||||||
|
padding: 0;
|
||||||
|
background: #fff;
|
||||||
|
|
||||||
|
.wea-title {
|
||||||
|
padding: 0 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wea-content {
|
||||||
|
padding: 0;
|
||||||
|
|
||||||
|
.wea-form-item {
|
||||||
|
padding-left: 18px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.customTitleWrapper {
|
.customTitleWrapper {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
@ -40,4 +72,30 @@
|
||||||
//margin-top: -6px;
|
//margin-top: -6px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.taxAgentSlide {
|
||||||
|
.wea-slide-modal-title {
|
||||||
|
height: auto;
|
||||||
|
line-height: normal;
|
||||||
|
text-align: left;
|
||||||
|
background: #FFF;
|
||||||
|
|
||||||
|
.wea-new-top .ant-col-10 {
|
||||||
|
padding-right: 45px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.rodal-close {
|
||||||
|
z-index: 99;
|
||||||
|
top: 10px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wea-new-top-req-wapper .wea-new-top-req-title > div:last-child {
|
||||||
|
right: 45px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wea-slide-modal-content {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,10 @@ export class TaxAgentStore {
|
||||||
@observable salarytaxAgentForm = new WeaForm(); //新版个税扣缴义务人表单实体
|
@observable salarytaxAgentForm = new WeaForm(); //新版个税扣缴义务人表单实体
|
||||||
@observable taxfillInfoForm = new WeaForm(); //报税信息查看form
|
@observable taxfillInfoForm = new WeaForm(); //报税信息查看form
|
||||||
@action setTaxfillInfoForm = () => this.taxfillInfoForm = new WeaForm(); //报税信息form初始化
|
@action setTaxfillInfoForm = () => this.taxfillInfoForm = new WeaForm(); //报税信息form初始化
|
||||||
|
@observable personScopeForm = new WeaForm(); //个税扣缴义务人新增人员form
|
||||||
|
@action initPersonScopeForm = () => this.personScopeForm = new WeaForm(); //个税扣缴义务人新增人员form初始化
|
||||||
@observable deptfillInfoForm = new WeaForm(); //报税信息部门备案form
|
@observable deptfillInfoForm = new WeaForm(); //报税信息部门备案form
|
||||||
@action initDeptfillInfoForm = () => this.deptfillInfoForm = new WeaForm(); //报税信息部门备案form初始化
|
@action initDeptfillInfoForm = () => this.deptfillInfoForm = new WeaForm(); //报税信息部门备案form初始化
|
||||||
|
|
||||||
@observable advanceForm = new WeaForm(); //权限-角色高级搜索form表单
|
@observable advanceForm = new WeaForm(); //权限-角色高级搜索form表单
|
||||||
@observable roleForm = new WeaForm(); //权限-角色form表单
|
@observable roleForm = new WeaForm(); //权限-角色form表单
|
||||||
@action initRoleForm = () => this.roleForm = new WeaForm();
|
@action initRoleForm = () => this.roleForm = new WeaForm();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue