From 239ffda293ed6b3b37342f946564e7b4f176f85b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Wed, 31 May 2023 17:28:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A7=E5=93=81-=E8=96=AA=E8=B5=84=E6=A0=B8?= =?UTF-8?q?=E7=AE=97=E9=A1=B5=E9=9D=A2=E6=B7=BB=E5=8A=A0=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hrmSalary/pages/calculateDetail/index.js | 105 +++++++++--------- pc4mobx/hrmSalary/stores/taxAgent.js | 3 + 2 files changed, 58 insertions(+), 50 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/calculateDetail/index.js b/pc4mobx/hrmSalary/pages/calculateDetail/index.js index d5342d86..bd5f39fa 100644 --- a/pc4mobx/hrmSalary/pages/calculateDetail/index.js +++ b/pc4mobx/hrmSalary/pages/calculateDetail/index.js @@ -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 = ( 导入 @@ -339,56 +341,59 @@ export default class CalculateDetail extends React.Component { }; return ( -
- 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 && } - {selectedKey == 1 && this.setState({ accountIds: ids })} - employeeName={this.state.searchValue}/>} - {acctResultImportVisiable && - { - this.handleAcctModalAdd(fieldData); - }} - onCancel={() => + +
+ 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 && - { - this.setState({ progressVisible: false, progress: 0 }); - }} - progress={this.state.progress} - />} -
+ searchItemsValue: { + ...this.state.searchItemsValue, + employeeName: v + } + }) + } // 在搜索框中输入的文字改变时的回调: 这里需要同步高级搜索和外部搜索框的值form.updateFields({ username: v }) + searchsBaseValue={this.state.searchItemsValue.employeeName} // 外部input搜索值受控: 这里和高级搜索的requestname同步form.getFormParams().username + /> + {selectedKey == 0 && } + {selectedKey == 1 && this.setState({ accountIds: ids })} + employeeName={this.state.searchValue}/>} + {acctResultImportVisiable && + { + this.handleAcctModalAdd(fieldData); + }} + onCancel={() => + this.setState({ + acctResultImportVisiable: false, + fieldData: {} + })} + id={this.id} + />} + {this.state.progressVisible && + { + this.setState({ progressVisible: false, progress: 0 }); + }} + progress={this.state.progress} + />} +
+ ); } } diff --git a/pc4mobx/hrmSalary/stores/taxAgent.js b/pc4mobx/hrmSalary/stores/taxAgent.js index db2e38dd..d197db2e 100644 --- a/pc4mobx/hrmSalary/stores/taxAgent.js +++ b/pc4mobx/hrmSalary/stores/taxAgent.js @@ -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();