From 2a8aac2068f6eb6d9bcde59d9ee074f351fe6a39 Mon Sep 17 00:00:00 2001 From: liyongshun <971387674@qq.com> Date: Tue, 21 Jun 2022 11:33:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A1=B5=E9=9D=A2=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E6=8C=89=E9=92=AE=E6=93=8D=E4=BD=9C=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/slideModalTitle/index.js | 2 +- .../pages/dataAcquisition/attendance/index.js | 22 +++-- .../pages/dataAcquisition/cumDeduct/index.js | 7 +- .../dataAcquisition/cumSituation/index.js | 7 +- .../dataAcquisition/otherDeduct/index.js | 7 +- pc4mobx/hrmSalary/pages/mySalary/index.js | 9 +- pc4mobx/hrmSalary/pages/salaryFile/index.js | 90 ++++++++++--------- pc4mobx/hrmSalary/pages/salaryItem/index.js | 16 ++-- .../socialSecurityBenefits/archives/index.js | 13 ++- .../socialSecurityBenefits/programme/index.js | 30 ++++--- pc4mobx/hrmSalary/pages/taxAgent/index.js | 1 - pc4mobx/hrmSalary/single.js | 3 +- pc4mobx/hrmSalary/stores/taxAgent.js | 7 ++ 13 files changed, 126 insertions(+), 88 deletions(-) diff --git a/pc4mobx/hrmSalary/components/slideModalTitle/index.js b/pc4mobx/hrmSalary/components/slideModalTitle/index.js index c4b6f7dd..aca9a78e 100644 --- a/pc4mobx/hrmSalary/components/slideModalTitle/index.js +++ b/pc4mobx/hrmSalary/components/slideModalTitle/index.js @@ -38,7 +38,7 @@ export default class SlideModalTitle extends React.Component {
{this.props.btns} { - this.state.editable && + this.props.showOperateBtn && this.state.editable && } {this.props.customOperate}
diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js index 2253f5d8..e6e3927b 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/attendance/index.js @@ -30,7 +30,7 @@ const { RangePicker } = DatePicker; const { Option } = Select -@inject('attendanceStore') +@inject('attendanceStore', 'taxAgentStore') @observer export default class Attendance extends React.Component { constructor(props) { @@ -224,7 +224,7 @@ export default class Attendance extends React.Component { } render() { - const { attendanceStore } = this.props; + const { attendanceStore, taxAgentStore: {showOperateBtn} } = this.props; const { modalParam } = this.state; const { loading, hasRight, form, condition, tableStore, showSearchAd, getTableDatas, doSearch, setShowSearchAd } = attendanceStore; const { step, setStep, setSlideVisiable, slideVisiable, doBatchDelete, attendTableStore, fieldSettingAttendList, fieldSettingCustomList, setFieldSettingAttendList, setFieldSettingCustomList, searchFieldSettingList } = attendanceStore; @@ -274,10 +274,11 @@ export default class Attendance extends React.Component { }]; const renderSearchOperationItem = () => { - return
+ const { taxAgentStore: { showOperateBtn } } = this.props; + return showOperateBtn ?
-
+
: null } @@ -351,7 +352,10 @@ export default class Attendance extends React.Component { const renderCustomOperate = () => { return (
- 导出 + { + showOperateBtn && + 导出 + } {this.setState({searchValue: v})}} @@ -376,7 +380,10 @@ export default class Attendance extends React.Component { const renderRightOperation = () => { return (
- + { + showOperateBtn && + + } {this.setState({fieldName: value})}} onSearch={(value) => { this.setState({fieldSettingSearchValue: value}) handleItemSearch(value) @@ -431,7 +438,7 @@ export default class Attendance extends React.Component { return {this.onItemEdit(record)}} dangerouslySetInnerHTML={{ __html: valueSpan }} /> case "enableStatus": - return {handleSwitchItemChange(record, value)}}/> + return {handleSwitchItemChange(record, value)}}/> default: return
} @@ -663,6 +670,7 @@ export default class Attendance extends React.Component { + buttons={showOperateBtn ? btns : []}>
} content={ diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js index 944f47f0..eb72bc5b 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/cumSituation/index.js @@ -293,7 +293,7 @@ export default class CumSituation extends React.Component { previewImport, importFile, } = cumSituationStore; - const { taxAgentOption } = taxAgentStore; + const { taxAgentOption, showOperateBtn } = taxAgentStore; const { slideVisiable, setSlideVisiable, @@ -509,7 +509,7 @@ export default class CumSituation extends React.Component { showDropIcon={true} // 是否显示下拉按钮 dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同) dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能 - buttons={btns}> + buttons={showOperateBtn ? btns : []}>
} content={ diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js index 756e9389..f52dc468 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/otherDeduct/index.js @@ -284,7 +284,7 @@ export default class OtherDeduct extends React.Component { previewImport, importFile, } = otherDeductStore; - const { taxAgentOption } = taxAgentStore; + const { taxAgentOption, showOperateBtn } = taxAgentStore; const { slideVisiable, setSlideVisiable, @@ -502,7 +502,7 @@ export default class OtherDeduct extends React.Component { showDropIcon={true} // 是否显示下拉按钮 dropMenuDatas={rightMenu} // 下拉菜单(和页面的右键菜单相同) dropMenuProps={{ collectParams }} // 收藏功能: 配置之后显示 收藏、帮助、显示页面地址 这3个功能 - buttons={btns}> + buttons={showOperateBtn ? btns : []}>
} content={ diff --git a/pc4mobx/hrmSalary/pages/mySalary/index.js b/pc4mobx/hrmSalary/pages/mySalary/index.js index 2fc76f76..ed4d1c6f 100644 --- a/pc4mobx/hrmSalary/pages/mySalary/index.js +++ b/pc4mobx/hrmSalary/pages/mySalary/index.js @@ -81,8 +81,13 @@ export default class MySalary extends React.Component { // 区间改变事件 handleSalaryRangePickerChange(range) { const { mySalaryStore : {mySalaryBillList}} = this.props; - this.range = range.map(item => moment(item).format("YYYY-MM")) - mySalaryBillList(this.range, this.pageInfo) + const isNull= _.every(range, it=> !!it) + if(!_.isEmpty(range) && isNull){ + this.range = range.map(item => moment(item).format("YYYY-MM")) + mySalaryBillList(this.range, this.pageInfo) + }else{ + mySalaryBillList([], this.pageInfo) + } } diff --git a/pc4mobx/hrmSalary/pages/salaryFile/index.js b/pc4mobx/hrmSalary/pages/salaryFile/index.js index 5c5644cc..e653b3ed 100644 --- a/pc4mobx/hrmSalary/pages/salaryFile/index.js +++ b/pc4mobx/hrmSalary/pages/salaryFile/index.js @@ -1,4 +1,4 @@ -import React from "react"; +import React, { Fragment } from "react"; import { inject, observer } from "mobx-react"; import { toJS } from "mobx"; import { WeaTableNew } from "comsMobx"; @@ -47,7 +47,7 @@ const { MonthPicker } = DatePicker; import "./index.less"; import CustomTable from "../../components/customTable"; -@inject("salaryFileStore") +@inject("salaryFileStore", "taxAgentStore") @observer export default class SalaryFile extends React.Component { constructor(props) { @@ -174,20 +174,24 @@ export default class SalaryFile extends React.Component { // 查看 Slide 头部操作按钮 renderEditSlideOperate() { + const { taxAgentStore: { showOperateBtn } } = this.props; return (
- - 调整个税扣缴义务人 - - } - onClick={() => { - this.setState({ changeSalaryVisible: true }); - }}> - 调薪 - + { + showOperateBtn && + + 调整个税扣缴义务人 + + } + onClick={() => { + this.setState({ changeSalaryVisible: true }); + }}> + 调薪 + + }
); } @@ -351,36 +355,42 @@ export default class SalaryFile extends React.Component { ); const renderRightOperation = () => { + const { taxAgentStore: { showOperateBtn } } = this.props; return (
- - - 导入 - - { - this.handleExportAll(); - }}> - 导出全部 - + { + showOperateBtn && + + + + 导入 + + { + this.handleExportAll(); + }}> + 导出全部 + + + } + showOperateBtn && selectedTab != 0 && }
} diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js index 8b6c7935..4834cf53 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/programme/index.js @@ -53,7 +53,7 @@ const { MonthPicker } = DatePicker; import TwoColContent from "../../../components/twoColContent"; import CopySchemaModal from "./copySchemaModal"; -@inject("programmeStore") +@inject("programmeStore", "taxAgentStore") @observer export default class Programme extends React.Component { constructor(props) { @@ -257,7 +257,7 @@ export default class Programme extends React.Component { } render() { - const { programmeStore } = this.props; + const { programmeStore, taxAgentStore: { showOperateBtn } } = this.props; const { loading, hasRight, @@ -456,18 +456,20 @@ export default class Programme extends React.Component { topTab={topTab} searchOperationItem={
- + {/* 操作按钮权限 */} + {showOperateBtn && + } {selectedKey == "custom" && } // 左侧图标 iconBgcolor="#F14A2D" // 左侧图标背景色 showDropIcon={true}> - {" "}// 是否显示下拉按钮 diff --git a/pc4mobx/hrmSalary/single.js b/pc4mobx/hrmSalary/single.js index 06f68823..396ff1e7 100644 --- a/pc4mobx/hrmSalary/single.js +++ b/pc4mobx/hrmSalary/single.js @@ -29,7 +29,8 @@ const Home = props => props.children; class Root extends React.Component { componentWillMount() { - top.$(".ant-message").remove() + top.$(".ant-message").remove(); + allStore.taxAgentStore.getPermission(); } render() { return ( diff --git a/pc4mobx/hrmSalary/stores/taxAgent.js b/pc4mobx/hrmSalary/stores/taxAgent.js index abe89476..b1c23142 100644 --- a/pc4mobx/hrmSalary/stores/taxAgent.js +++ b/pc4mobx/hrmSalary/stores/taxAgent.js @@ -16,6 +16,7 @@ export class TaxAgentStore { @observable condition = []; // 存储后台得到的form数据 @observable hasRight = true; // 判断用户是有权限查看当前页面: 没有权限渲染无权限页面,有权限渲染数据 @observable showSearchAd = false; // 高级搜索面板显示 + @observable showOperateBtn = false; // 页面操作按钮显示权限 @observable loading = false; // 数据加载状态 @observable modalVisiable = false; // EditModal 模态框 @observable columns = []; @@ -31,6 +32,8 @@ export class TaxAgentStore { @action setDataSource = dataSource => (this.dataSource = dataSource); + @action setShowOperateBtn = bool => (this.showOperateBtn = bool); + // 初始化操作 @action doInit = params => { @@ -118,6 +121,10 @@ export class TaxAgentStore { return new Promise((resolve, reject) => { API.getPermission(params).then(({ status, data }) => { if (status) { + const { isAdminEnable, isOpenDevolution } = data; + this.setShowOperateBtn( + !isOpenDevolution ? true : isAdminEnable ? true : false + ); resolve({ status, data }); } else { reject();