From 42c6e91d2fdf627f7b34314cb8af11dc2e481b78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Tue, 26 Sep 2023 13:18:05 +0800 Subject: [PATCH] =?UTF-8?q?custom-=E8=89=BE=E5=BF=97=E5=B7=A5=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/payrollFiles/index.js | 30 +++++++++---------- .../socialSecurityBenefits/archives/index.js | 26 ++++++++-------- pc4mobx/hrmSalary/stores/taxAgent.js | 6 +++- 3 files changed, 33 insertions(+), 29 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/index.js index db623a70..f93c17a6 100644 --- a/pc4mobx/hrmSalary/pages/payrollFiles/index.js +++ b/pc4mobx/hrmSalary/pages/payrollFiles/index.js @@ -181,7 +181,7 @@ class Index extends Component { }; handleReceive = ({ data }) => { - const { payrollFilesStore: { tableStore }, taxAgentStore: { showOperateBtn } } = this.props; + const { payrollFilesStore: { tableStore }, taxAgentStore: { showOperateBtn, isDepAuth } } = this.props; const columns = _.map(_.filter(toJS(tableStore.columns), (item) => item.display === "true"), (it, idx) => ({ dataIndex: it.dataIndex, width: (it.dataIndex === "username" || it.dataIndex === "operate") ? 150 : it.dataIndex === "taxAgentName" ? 176 : 150, @@ -193,8 +193,8 @@ class Index extends Component { const { dataSource, pageInfo, selectedKey, selectedRowKeys } = this.state; if (type === "init") { this.postMessageToChild({ - columns, dataSource, showOperateBtn, selectedKey, - showSum: false, pageInfo, selectedRowKeys + columns, dataSource, showOperateBtn: isDepAuth || showOperateBtn, + selectedKey, showSum: false, pageInfo, selectedRowKeys }); } else if (type === "turn") { if (id === "PAGEINFO") { @@ -261,7 +261,7 @@ class Index extends Component { }; queryList = (url) => { const { loading, pageInfo, searchItemsValue, selectedKey } = this.state; - const { payrollFilesStore: { tableStore, queryList }, taxAgentStore: { showOperateBtn } } = this.props; + const { payrollFilesStore: { tableStore, queryList }, taxAgentStore: { showOperateBtn, isDepAuth } } = this.props; const payload = { ...pageInfo }; this.setState({ loading: { ...loading, query: true } @@ -397,8 +397,8 @@ class Index extends Component { }; getRightOptionBtns = () => { const { selectedKey, importType, selectedRowKeys, searchItemsValue, pageInfo } = this.state; - const { taxAgentStore: { showOperateBtn } } = this.props; - if (selectedKey === "pending" && showOperateBtn) { + const { taxAgentStore: { showOperateBtn, isDepAuth } } = this.props; + if (selectedKey === "pending" && (isDepAuth || showOperateBtn)) { return [ ]; - } else if (selectedKey === "fixed" && showOperateBtn) { + } else if (selectedKey === "fixed" && (isDepAuth || showOperateBtn)) { return [ ]; - } else if (selectedKey === "suspend" && showOperateBtn) { + } else if (selectedKey === "suspend" && (isDepAuth || showOperateBtn)) { return [ ]; - } else if (selectedKey === "stop" && showOperateBtn) { + } else if (selectedKey === "stop" && (isDepAuth || showOperateBtn)) { return [ ]; - } else if (selectedKey === "ext" && showOperateBtn) { + } else if (selectedKey === "ext" && (isDepAuth || showOperateBtn)) { return [ { - const { payrollFilesStore: { tableStore }, taxAgentStore: { showOperateBtn } } = this.props; + const { payrollFilesStore: { tableStore }, taxAgentStore: { showOperateBtn, isDepAuth } } = this.props; const columns = _.map(_.filter(toJS(tableStore.columns), (item) => item.display === "true"), (it, idx) => ({ dataIndex: it.dataIndex, width: (it.dataIndex === "username" || it.dataIndex === "operate") ? 150 : it.dataIndex === "taxAgentName" ? 176 : 150, @@ -551,7 +551,7 @@ class Index extends Component { ellipsis: true })); this.postMessageToChild({ - columns, showOperateBtn, selectedKey: this.state.selectedKey, + columns, showOperateBtn: isDepAuth || showOperateBtn, selectedKey: this.state.selectedKey, dataSource: this.state.dataSource, selectedRowKeys: this.state.selectedRowKeys, showSum: false, pageInfo: this.state.pageInfo }); @@ -614,17 +614,17 @@ class Index extends Component { }; // 查看 Slide 头部操作按钮 renderEditSlideOperate = () => { - const { taxAgentStore: { showOperateBtn } } = this.props; + const { taxAgentStore: { showOperateBtn, isDepAuth } } = this.props; const { slideParams: { id }, salaryAdjustmentInfo, selectedKey } = this.state; const { isShow, url } = salaryAdjustmentInfo; let arrList = []; - if (showOperateBtn && isShow === "true" && selectedKey === "fixed") { + if ((isDepAuth || showOperateBtn) && isShow === "true" && selectedKey === "fixed") { arrList.push(); } - if (showOperateBtn && (selectedKey === "fixed" || selectedKey === "ext")) { + if ((isDepAuth || showOperateBtn) && (selectedKey === "fixed" || selectedKey === "ext")) { arrList.push(] : [] } subItemChange={selectedTab => this.setState({ selectedTab })} diff --git a/pc4mobx/hrmSalary/stores/taxAgent.js b/pc4mobx/hrmSalary/stores/taxAgent.js index 2f555120..4d6175e8 100644 --- a/pc4mobx/hrmSalary/stores/taxAgent.js +++ b/pc4mobx/hrmSalary/stores/taxAgent.js @@ -19,6 +19,7 @@ export class TaxAgentStore { @observable showSalaryItemBtn = false; // 薪资项目管理页面操作按钮显示权限 @observable statisticsReportBtn = false; // 薪酬统计报表页面操作按钮显示权限 @observable payrollPermission = false; // 薪资核算显示权限 + @observable isDepAuth = false; // 艾志薪资档案以及社保福利档案权限 @observable loading = false; // 数据加载状态 @observable modalVisiable = false; // EditModal 模态框 @observable columns = []; @@ -42,6 +43,7 @@ export class TaxAgentStore { @action setSalaryItemBtn = bool => (this.showSalaryItemBtn = bool);//薪资项目权限 @action setStatisticsReportBtn = bool => (this.statisticsReportBtn = bool);//薪酬统计报表权限 @action setPayrollPermission = bool => (this.payrollPermission = bool);// 薪资核算页面权限 + @action setIsDepAuth = bool => (this.isDepAuth = bool);// 艾志薪资档案以及社保福利档案权限 // 初始化操作 @action @@ -141,7 +143,7 @@ export class TaxAgentStore { return new Promise((resolve, reject) => { API.getPermission(params).then(({ status, data }) => { if (status) { - const { isAdminEnable, isChief, isOpenDevolution } = data; + const { isAdminEnable, isChief, isOpenDevolution, isDepAuth } = data; this.setShowOperateBtn( !isOpenDevolution ? true : isAdminEnable ? true : false ); @@ -150,6 +152,8 @@ export class TaxAgentStore { this.setStatisticsReportBtn(!isOpenDevolution ? true : !!(isAdminEnable || isChief)); //薪资核算详情页面查看权限 this.setPayrollPermission(isAdminEnable && isOpenDevolution || !isOpenDevolution); + //艾志薪资档案以及社保福利档案权限 + this.setIsDepAuth(isDepAuth); resolve({ status, data }); } else { reject();