diff --git a/pc4mobx/hrmSalary/pages/declare/declare.js b/pc4mobx/hrmSalary/pages/declare/declare.js index e0c852e2..4e22645d 100644 --- a/pc4mobx/hrmSalary/pages/declare/declare.js +++ b/pc4mobx/hrmSalary/pages/declare/declare.js @@ -38,6 +38,7 @@ class Calculate extends Component { } renderCalculateOpts = () => { + const { taxAgentStore: { showOperateBtn, isTaxDeclareAdmin } } = this.props; const { queryParams, isRefresh, azOperate } = this.state; let calculateOpts = [ this.setState({ @@ -57,7 +58,8 @@ class Calculate extends Component { queryParams: { ...queryParams, ...v } })} onSearch={() => this.setState({ isRefresh: !isRefresh })}/> ]; - return !azOperate ? calculateOpts.slice(1) : calculateOpts; + return (showOperateBtn || isTaxDeclareAdmin) ? calculateOpts : calculateOpts.slice(1); + // return !azOperate ? calculateOpts.slice(1) : calculateOpts; }; onDropMenuClick = (key, targetid = "") => { switch (key) { diff --git a/pc4mobx/hrmSalary/pages/declareDetail/index.js b/pc4mobx/hrmSalary/pages/declareDetail/index.js index 0be6acbf..bddeb16c 100644 --- a/pc4mobx/hrmSalary/pages/declareDetail/index.js +++ b/pc4mobx/hrmSalary/pages/declareDetail/index.js @@ -5,6 +5,7 @@ * Date: 2023/8/18 */ import React, { Component } from "react"; +import { inject, observer } from "mobx-react"; import { WeaLeftRightLayout, WeaLocaleProvider, WeaTab } from "ecCom"; import { Button, message, Modal, Spin } from "antd"; import TaxDeclarationInfo from "./components/taxDeclarationInfo"; @@ -46,6 +47,8 @@ const APIFox = { cancelFeedback: taxdeclaratioGetCancelFeedback//作废反馈 }; +@inject("taxAgentStore") +@observer class Index extends Component { constructor(props) { super(props); @@ -347,6 +350,7 @@ class Index extends Component { }; render() { + const { taxAgentStore: { showOperateBtn, isTaxDeclareAdmin } } = this.props; const { tabs, selectedKey, loading, declareInfo, intelCalcSalaryStatus, taxDecPersonSlide, editTabVisible, reportType, showLeft, azOperate @@ -390,7 +394,7 @@ class Index extends Component { onClick={() => confirmDialog("correct", () => this.handleOperateDeclare("correct", { reportType }))}>{getLabel(111, "更正申报")}, confirmDialog("cancel", () => this.handleOperateDeclare("cancel", { reportType }))}>{getLabel(111, "作废申报")}, + onClick={() => confirmDialog("cancel", () => this.handleOperateDeclare("cancel", { reportType }))}>{getLabel(111, "作废申报")} //艾志项目-去掉刷新缴款状态 // this.setState({ showLeft })}/>} onCollapse={showLeft => this.setState({ showLeft })}> - this[fun]()} azOperate={azOperate}/> + this[fun]()} + azOperate={showOperateBtn || isTaxDeclareAdmin}/> this.setState({ selectedKey: v }, () => this.getDetailList())} searchType={["base"]} searchsBasePlaceHolder={getLabel(26919, "请输入姓名")} onSearchChange={keyword => this.setState({ keyword })} - onSearch={this.getDetailList} datas={_.map(tabs, o => ({ ...o, editable: azOperate }))} - buttons={azOperate ? btns : _.filter(btns, o=> o.props.children === getLabel(111, "导出"))} + onSearch={this.getDetailList} datas={_.map(tabs, o => ({ ...o, editable: showOperateBtn || isTaxDeclareAdmin }))} + buttons={(showOperateBtn || isTaxDeclareAdmin) ? btns : _.filter(btns, o => o.props.children === getLabel(111, "导出"))} /> {/*个税申报表-新增编辑框*/} { - const { employeeDeclareStore: { advanceForm: form } } = this.props; + const { + employeeDeclareStore: { advanceForm: form }, + taxAgentStore: { showOperateBtn, isTaxDeclareAdmin } + } = this.props; const { pageInfo, declareStatus, taxCycle, selectedKey, selectedRowKeys } = this.state; const { departmentIds, positionIds, ...formParams } = form.getFormParams(); const payload = { @@ -199,7 +203,7 @@ class Index extends Component { }) }; this.postMessageToChild(payload); - if (!this.state.azOperate) { + if (!showOperateBtn && !isTaxDeclareAdmin) { const style = document.createElement("style"); // 设置style内容,例如添加CSS规则 style.innerHTML = ` @@ -458,7 +462,9 @@ class Index extends Component { selectedKey, showSearchAd, declareStatus, declareStatusList, taxCycle, declareEditDialog, loading, pageInfo, adConditons, employmentTypeList, employmentStatusList, azOperate } = this.state; - const { taxAgentStore: { showOperateBtn }, employeeDeclareStore: { advanceForm: form, declareForm } } = this.props; + const { + taxAgentStore: { showOperateBtn, isTaxDeclareAdmin }, employeeDeclareStore: { advanceForm: form, declareForm } + } = this.props; const menu = ( {getLabel(32136, "批量删除")} @@ -530,13 +536,13 @@ class Index extends Component { /> ]; // !showOperateBtn && tabBtns.shift(); - (selectedKey !== "list" || !azOperate) && tabBtns.shift(); + (selectedKey !== "list" || (!showOperateBtn && !isTaxDeclareAdmin)) && tabBtns.shift(); selectedKey !== "list" && tabBtns.shift(); return ( } className="declareWrapper" - buttons={azOperate ? buttons : buttons.slice(0, 1)} + buttons={(showOperateBtn || isTaxDeclareAdmin) ? buttons : buttons.slice(0, 1)} // buttons={showOperateBtn ? buttons : []} > diff --git a/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js b/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js index 97ebff1e..9ac44b52 100644 --- a/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js +++ b/pc4mobx/hrmSalary/pages/salary/components/taxAgentSlide.js @@ -54,13 +54,17 @@ class TaxAgentSlide extends Component { const { taxAgentStore: { salarytaxAgentForm } } = this.props; API.getTaxAgentForm({ id: taxAgentId }).then(({ status, data }) => { if (status) { - const { name, description, adminUserIds, sortedIndex } = data; + const { name, description, adminUserIds, azTaxDeclareAdminUserIds, sortedIndex } = data; salarytaxAgentForm.updateFields({ name: { value: name }, adminUserIds: { value: _.map(adminUserIds, it => it.id.toString()).join(","), valueSpan: _.map(adminUserIds, it => it.content).join(",") }, + azTaxDeclareAdminUserIds: { + value: _.map(azTaxDeclareAdminUserIds, it => it.id.toString()).join(","), + valueSpan: _.map(azTaxDeclareAdminUserIds, it => it.content).join(",") + }, sortedIndex: { value: sortedIndex }, description: { value: description } }); @@ -118,7 +122,8 @@ class TaxAgentSlide extends Component { const formData = salarytaxAgentForm.getFormParams(); const payload = { ...formData, - adminUserIds: formData.adminUserIds ? formData.adminUserIds.split(",") : [] + adminUserIds: formData.adminUserIds ? formData.adminUserIds.split(",") : [], + azTaxDeclareAdminUserIds: formData.azTaxDeclareAdminUserIds ? formData.azTaxDeclareAdminUserIds.split(",") : [] }; taxAgentId ? this.updateTaxAgent({ ...payload, id: taxAgentId }) : this.saveTaxAgent(payload); } else { diff --git a/pc4mobx/hrmSalary/stores/taxAgent.js b/pc4mobx/hrmSalary/stores/taxAgent.js index fb47aad6..a925abcb 100644 --- a/pc4mobx/hrmSalary/stores/taxAgent.js +++ b/pc4mobx/hrmSalary/stores/taxAgent.js @@ -26,6 +26,7 @@ export class TaxAgentStore { @observable statisticsReportBtn = false; // 薪酬统计报表页面操作按钮显示权限 @observable payrollPermission = false; // 薪资核算显示权限 @observable isDepAuth = false; // 艾志薪资档案以及社保福利档案权限 + @observable isTaxDeclareAdmin = false; // 艾志是否是个税申报管理员 @observable loading = false; // 数据加载状态 @observable modalVisiable = false; // EditModal 模态框 @observable columns = []; @@ -50,6 +51,7 @@ export class TaxAgentStore { @action setStatisticsReportBtn = bool => (this.statisticsReportBtn = bool);//薪酬统计报表权限 @action setPayrollPermission = bool => (this.payrollPermission = bool);// 薪资核算页面权限 @action setIsDepAuth = bool => (this.isDepAuth = bool);// 艾志薪资档案以及社保福利档案权限 + @action setIsTaxDeclareAdmin = bool => (this.isTaxDeclareAdmin = bool);// 艾志是否是个税申报管理员设置 @action setSalarytaxAgentForm = () => (this.salarytaxAgentForm = new WeaForm());//薪资项目权限 @@ -151,7 +153,7 @@ export class TaxAgentStore { return new Promise((resolve, reject) => { API.getPermission(params).then(({ status, data }) => { if (status) { - const { isAdminEnable, isChief, isOpenDevolution, isDepAuth } = data; + const { isAdminEnable, isChief, isOpenDevolution, isDepAuth, isTaxDeclareAdmin } = data; this.setShowOperateBtn( !isOpenDevolution ? true : isAdminEnable ? true : false ); @@ -162,6 +164,8 @@ export class TaxAgentStore { this.setPayrollPermission((isOpenDevolution && isAdminEnable) || !isOpenDevolution); //艾志薪资档案以及社保福利档案权限---权限调整去掉这个逻辑 // this.setIsDepAuth(isDepAuth); + //艾志是否是个税申报管理员设置 + this.setIsTaxDeclareAdmin(isTaxDeclareAdmin); resolve({ status, data }); } else { reject();