薪资项目管理按钮权限的修改

This commit is contained in:
黎永顺 2023-02-27 13:23:41 +08:00
parent 7539c60af5
commit de7180882d
3 changed files with 12 additions and 12 deletions

View File

@ -55,7 +55,7 @@ class FieldTable extends Component {
getColumns = () => {
const { columns } = this.state;
const { taxAgentStore, onEditLedger, onDeleteLedger } = this.props;
const { showSalaryItemBtn } = taxAgentStore;
const { showSalaryItemBtn, showOperateBtn } = taxAgentStore;
return _.map([...columns, {
dataIndex: "operate",
display: true,
@ -70,9 +70,9 @@ class FieldTable extends Component {
item.render = (text, record) => {
return <div className="optWrapper">
<a href="javascript:void(0);" className="mr10"
onClick={() => onEditLedger(record)}>{showSalaryItemBtn ? "编辑" : "查看"}</a>
onClick={() => onEditLedger(record)}>{(showSalaryItemBtn || showOperateBtn) ? "编辑" : "查看"}</a>
{
record.canDelete && showSalaryItemBtn &&
record.canDelete && (showSalaryItemBtn || showOperateBtn) &&
<a href="javascript:void(0);" className="mr10" onClick={() => onDeleteLedger(record)}>删除</a>
}
</div>;

View File

@ -71,7 +71,7 @@ class FieldManagement extends Component {
render() {
const { searchVal, doSearch, slideparams } = this.state;
const { taxAgentStore } = this.props;
const { showSalaryItemBtn } = taxAgentStore;
const { showSalaryItemBtn, showOperateBtn } = taxAgentStore;
const btns = [
<Button
type="primary"
@ -89,7 +89,7 @@ class FieldManagement extends Component {
icon={<i className="icon-coms-fa"/>}
iconBgcolor="#F14A2D"
showDropIcon={false}
buttons={showSalaryItemBtn ? btns : btns.slice(-1)}
buttons={(showSalaryItemBtn || showOperateBtn) ? btns : btns.slice(-1)}
>
<div className="fieldManageWrapper">
<FieldTable name={searchVal} doSearch={doSearch} onEditLedger={this.handleEditField}

View File

@ -100,7 +100,7 @@ export default class SalaryItem extends React.Component {
}
getColumns = () => {
const { salaryItemStore, taxAgentStore: { showSalaryItemBtn } } = this.props;
const { salaryItemStore, taxAgentStore: { showSalaryItemBtn, showOperateBtn } } = this.props;
const { tableColumns } = salaryItemStore;
let columns = tableColumns.map(column => {
let newColumn = column;
@ -128,7 +128,7 @@ export default class SalaryItem extends React.Component {
return (
<a onClick={() => {
this.onEditItem(record, true);
}}>{showSalaryItemBtn ? "编辑" : "查看"}</a>
}}>{(showSalaryItemBtn || showOperateBtn) ? "编辑" : "查看"}</a>
);
}
});
@ -137,7 +137,7 @@ export default class SalaryItem extends React.Component {
key: "moreOperate",
dataIndex: "moreOperate",
render: (text, record) => {
if (record.canDelete && showSalaryItemBtn) {
if (record.canDelete && (showSalaryItemBtn || showOperateBtn)) {
return (
<Dropdown overlay={<Menu>
<Menu.Item>
@ -245,11 +245,11 @@ export default class SalaryItem extends React.Component {
const renderRightOperation = () => {
return (<div style={{ display: "inline-block" }}>
{
showSalaryItemBtn &&
(showOperateBtn || showSalaryItemBtn) &&
<Dropdown.Button overlay={menu} type="primary" style={{ marginRight: "10px" }}>新增</Dropdown.Button>
}
{
showSalaryItemBtn &&
(showOperateBtn || showSalaryItemBtn) &&
<Button
type="primary"
style={{ marginRight: "10px" }}
@ -401,8 +401,8 @@ export default class SalaryItem extends React.Component {
<SlideModalTitle
subtitle={(this.state.isAdd ? "新建" : "修改") + "自定义薪资项目"}
editable={false}
showOperateBtn={showSalaryItemBtn}
customOperate={showSalaryItemBtn ? renderCustomOperate() : []}
showOperateBtn={(showSalaryItemBtn || showOperateBtn)}
customOperate={(showSalaryItemBtn || showOperateBtn) ? renderCustomOperate() : []}
/>
}
content={