feature/2.15.1.2407.01-权限

This commit is contained in:
黎永顺 2024-10-09 11:10:21 +08:00
parent 255e8d8760
commit b23662c09e
2 changed files with 7 additions and 61 deletions

View File

@ -157,7 +157,8 @@ class PersonalScope extends Component {
selectedKey, searchValue, rowKeys, personalAddModal,
importParams, previewDataSource, extEmpsWitch, loading
} = this.state;
const { taxAgentStore: { hideIconInTax, showSalaryItemBtn }, taxAgentId } = this.props;
const { taxAgentStore: { PageAndOptAuth }, taxAgentId } = this.props;
const showOperateBtn = PageAndOptAuth.opts.includes("admin");
const topTab = [
{
title: "管理范围",
@ -172,7 +173,7 @@ class PersonalScope extends Component {
viewcondition: "listExt"
}
];
const btns = (hideIconInTax || showSalaryItemBtn) ? [
const btns = showOperateBtn ? [
<Button
type="primary"
onClick={() => {

View File

@ -48,6 +48,7 @@ class TaxAgentSlide extends Component {
if (this.state.taxAgentId) this.getTaxAgentForm();
});
}
if (nextProps.visible !== this.props.visible && !nextProps.visible) this.props.taxAgentStore.setSalarytaxAgentForm();
}
getTaxAgentForm = () => {
@ -110,7 +111,6 @@ class TaxAgentSlide extends Component {
}
}).catch(() => this.setState({ loading: false }));
};
handleSave = () => {
const { taxAgentStore: { salarytaxAgentForm } } = this.props;
const { taxAgentId } = this.state;
@ -171,62 +171,6 @@ class TaxAgentSlide extends Component {
}
}).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;
};
handleSubmit = (selectKey) => {
const { taxFilingInfoDialofg, taxAgentId } = this.state;
const { fieldForm } = this.taxInfoRef.state;
@ -299,7 +243,7 @@ class TaxAgentSlide extends Component {
key: 2, title: getLabel(124810, "人员范围"),
createBtns: [
<Button type="ghost"
onClick={() => this.setState({ current: current - 1 })}>{getLabel(1876, "上一步")}</Button>
onClick={() => this.setState({ current: !salaryOn ? current - 2 : current - 1 })}>{getLabel(1876, "上一步")}</Button>
],
editBtns: [],
children: <PersonalScope taxAgentId={taxAgentId}/>
@ -311,7 +255,8 @@ class TaxAgentSlide extends Component {
<WeaSlideModal
className="taxAgentSlide" visible={visible} top={0} width={65} height={100} measure="%" direction="right"
title={
!taxAgentId ? <WeaTopTitle title={title} buttons={_.find(tabs, o => current === o.key).createBtns}/> :
!this.props.taxAgentId ?
<WeaTopTitle title={title} buttons={_.find(tabs, o => current === o.key).createBtns}/> :
<WeaReqTitle buttons={showOperateBtn ? _.find(tabs, o => current === o.key).editBtns : []}
tabDatas={tabs} selectedKey={String(current)} title={title}
onChange={cur => this.setState({ current: parseInt(cur) })}/>