产品-薪资核算页面添加查看权限

This commit is contained in:
黎永顺 2023-05-31 17:28:31 +08:00
parent 92499ee72c
commit 239ffda293
2 changed files with 58 additions and 50 deletions

View File

@ -7,10 +7,11 @@ import { WeaBrowser, WeaCheckbox, WeaDropdown, WeaFormItem, WeaInput, WeaSearchG
import { convertToUrlString, getQueryString } from "../../util/url";
import AcctResultImportModal from "./acctResult/importModal/acctResultImportModal";
import ProgressModal from "../../components/progressModal";
import Authority from "../mySalary/authority";
const { ButtonSelect } = WeaDropdown;
@inject("calculateStore", "salaryFileStore")
@inject("calculateStore", "salaryFileStore", "taxAgentStore")
@observer
export default class CalculateDetail extends React.Component {
constructor(props) {
@ -261,6 +262,7 @@ export default class CalculateDetail extends React.Component {
render() {
const { selectedKey, acctResultImportVisiable, showSearchAd } = this.state;
const { taxAgentStore: { payrollPermission } } = this.props;
const menu = (
<Menu onClick={this.handleMenuClick.bind(this)}>
<Menu.Item key="1">导入</Menu.Item>
@ -339,56 +341,59 @@ export default class CalculateDetail extends React.Component {
};
return (
<div style={{ overflowY: "hidden", height: "100%" }}>
<WeaTab
datas={topTab}
selectedKey={selectedKey}
keyParam="viewcondition"
onChange={v => this.setState({ selectedKey: v })}
searchType={selectedKey == 1 ? ["base", "advanced"] : []} // base基础搜索框 advanced显示高级搜索按钮
showSearchAd={showSearchAd} // 是否展开高级搜索面板
setShowSearchAd={(bool) => this.setState({ showSearchAd: bool })} //高级搜索面板受控
searchsAd={renderSearch()} // 高级搜索内部数据getSearchs(form, toJS(condition), 2)
buttonsAd={adBtn} // 高级搜索内部按钮
onSearch={() => this.handleSearch(this.state.searchItemsValue)} // 点搜索按钮时的回调
buttons={selectedKey == 1 ? renderRightOperation() : []}
searchsBasePlaceHolder={"请输入姓名"}
onSearchChange={(v) =>
this.setState({
searchItemsValue: {
...this.state.searchItemsValue,
employeeName: v
}
})
} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值form.updateFields({ username: v })
searchsBaseValue={this.state.searchItemsValue.employeeName} // 外部input搜索值受控: 这里和高级搜索的requestname同步form.getFormParams().username
/>
{selectedKey == 0 && <UserSure/>}
{selectedKey == 1 && <SalaryDetail onChangeAccountIds={(ids) => this.setState({ accountIds: ids })}
employeeName={this.state.searchValue}/>}
{acctResultImportVisiable &&
<AcctResultImportModal
visiable={acctResultImportVisiable}
fieldData={this.state.fieldData}
onAdd={fieldData => {
this.handleAcctModalAdd(fieldData);
}}
onCancel={() =>
<Authority ecId={`${this && this.props && this.props.ecId || ""}_Authority@lulowc`}
store={{ loading: false, hasRight: payrollPermission }}>
<div style={{ overflowY: "hidden", height: "100%" }}>
<WeaTab
datas={topTab}
selectedKey={selectedKey}
keyParam="viewcondition"
onChange={v => this.setState({ selectedKey: v })}
searchType={selectedKey == 1 ? ["base", "advanced"] : []} // base基础搜索框 advanced显示高级搜索按钮
showSearchAd={showSearchAd} // 是否展开高级搜索面板
setShowSearchAd={(bool) => this.setState({ showSearchAd: bool })} //高级搜索面板受控
searchsAd={renderSearch()} // 高级搜索内部数据getSearchs(form, toJS(condition), 2)
buttonsAd={adBtn} // 高级搜索内部按钮
onSearch={() => this.handleSearch(this.state.searchItemsValue)} // 点搜索按钮时的回调
buttons={selectedKey == 1 ? renderRightOperation() : []}
searchsBasePlaceHolder={"请输入姓名"}
onSearchChange={(v) =>
this.setState({
acctResultImportVisiable: false,
fieldData: {}
})}
id={this.id}
/>}
{this.state.progressVisible &&
<ProgressModal
visible={this.state.progressVisible}
onCancel={() => {
this.setState({ progressVisible: false, progress: 0 });
}}
progress={this.state.progress}
/>}
</div>
searchItemsValue: {
...this.state.searchItemsValue,
employeeName: v
}
})
} // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值form.updateFields({ username: v })
searchsBaseValue={this.state.searchItemsValue.employeeName} // 外部input搜索值受控: 这里和高级搜索的requestname同步form.getFormParams().username
/>
{selectedKey == 0 && <UserSure/>}
{selectedKey == 1 && <SalaryDetail onChangeAccountIds={(ids) => this.setState({ accountIds: ids })}
employeeName={this.state.searchValue}/>}
{acctResultImportVisiable &&
<AcctResultImportModal
visiable={acctResultImportVisiable}
fieldData={this.state.fieldData}
onAdd={fieldData => {
this.handleAcctModalAdd(fieldData);
}}
onCancel={() =>
this.setState({
acctResultImportVisiable: false,
fieldData: {}
})}
id={this.id}
/>}
{this.state.progressVisible &&
<ProgressModal
visible={this.state.progressVisible}
onCancel={() => {
this.setState({ progressVisible: false, progress: 0 });
}}
progress={this.state.progress}
/>}
</div>
</Authority>
);
}
}

View File

@ -17,6 +17,7 @@ export class TaxAgentStore {
@observable showOperateBtn = false; // 页面操作按钮显示权限
@observable showSalaryItemBtn = false; // 薪资项目管理页面操作按钮显示权限
@observable statisticsReportBtn = false; // 薪酬统计报表页面操作按钮显示权限
@observable payrollPermission = false; // 薪资核算显示权限
@observable loading = false; // 数据加载状态
@observable modalVisiable = false; // EditModal 模态框
@observable columns = [];
@ -39,6 +40,7 @@ export class TaxAgentStore {
@action setSalaryItemBtn = bool => (this.showSalaryItemBtn = bool);//薪资项目权限
@action setStatisticsReportBtn = bool => (this.statisticsReportBtn = bool);//薪酬统计报表权限
@action setPayrollPermission = bool => (this.payrollPermission = bool);// 薪资核算页面权限
// 初始化操作
@action
@ -145,6 +147,7 @@ export class TaxAgentStore {
this.setSalaryItemBtn((isOpenDevolution && (isChief || isAdminEnable)));
//薪酬统计报表权限
this.setStatisticsReportBtn(!isOpenDevolution ? true : !!(isAdminEnable || isChief));
this.setPayrollPermission(isAdminEnable && isOpenDevolution);
resolve({ status, data });
} else {
reject();