diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/config.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/config.js index 911e5913..5548c79d 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/config.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/config.js @@ -54,11 +54,11 @@ export const optTypeEnum = [ } ]; export const tabList = [ - { viewcondition: "1", lanId: 542711, title: "待增员", showcount: true, groupid: "stayAdd" }, - { viewcondition: "2,3", lanId: 542504, title: "在缴员工", showcount: true, groupid: "paying" }, - { viewcondition: "3", lanId: 542713, title: "待减员", showcount: true, groupid: "stayDel" }, - { viewcondition: "4,5", lanId: 542505, title: "停缴员工", showcount: true, groupid: "stopPay" }, - { viewcondition: "ext", lanId: 542679, title: "非系统人员", showcount: true, groupid: "ext" } + { viewcondition: "1", title: getLabel(542711, "待增员"), showcount: true, groupid: "stayAdd" }, + { viewcondition: "2,3", title: getLabel(542504, "在缴员工"), showcount: true, groupid: "paying" }, + { viewcondition: "3", title: getLabel(542713, "待减员"), showcount: true, groupid: "stayDel" }, + { viewcondition: "4,5", title: getLabel(542505, "停缴员工"), showcount: true, groupid: "stopPay" }, + { viewcondition: "ext", title: getLabel(542679, "非系统人员"), showcount: true, groupid: "ext" } ]; export const welfareTipList = [ { @@ -138,145 +138,149 @@ export const welfareTipList = [ list: [] } ]; -export const renderDropMenuDatas = (selectedKey, getLabel) => { +export const renderDropMenuDatas = (selectedKey, getLabel, showOperateBtn) => { let menus = [{ key: "log", icon: , content: getLabel(111, "操作日志") }]; - switch (selectedKey) { - case "1": - menus = [ - { - key: "fullStaffIncrease", - icon: , - content: getLabel(543185, "全量增员") - }, - { - key: "batchStaffIncrease", - icon: , - content: getLabel(543187, "批量增员") - }, - { - key: "batchDeleteTodolist", - icon: , - content: getLabel(543186, "批量删除待办") - }, - { - key: "exportAll", - icon: , - content: getLabel(81272, "导出全部") - }, - { - key: "exportSelected", - icon: , - content: getLabel(512938, "导出选中") - }, - ...menus - ]; - break; - case "2,3": - menus = [ - { - key: "exportAll", - icon: , - content: getLabel(81272, "导出全部") - }, - { - key: "exportSelected", - icon: , - content: getLabel(512938, "导出选中") - }, - ...menus - ]; - break; - case "3": - menus = [ - { - key: "fullReduction", - icon: , - content: getLabel(543189, "全量减员") - }, - { - key: "batchReduction", - icon: , - content: getLabel(543188, "批量减员") - }, - { - key: "batchDeleteTodolistStayDel", - icon: , - content: getLabel(543186, "批量删除待办") - }, - { - key: "exportAll", - icon: , - content: getLabel(81272, "导出全部") - }, - { - key: "exportSelected", - icon: , - content: getLabel(512938, "导出选中") - }, - ...menus - ]; - break; - case "4,5": - menus = [ - { - key: "batchCancellationOfSuspended", - icon: , - content: getLabel(543190, "批量取消停缴") - }, - { - key: "exportAll", - icon: , - content: getLabel(81272, "导出全部") - }, - { - key: "exportSelected", - icon: , - content: getLabel(512938, "导出选中") - }, - ...menus - ]; - break; - default: - break; + if (showOperateBtn) { + switch (selectedKey) { + case "1": + menus = [ + { + key: "fullStaffIncrease", + icon: , + content: getLabel(543185, "全量增员") + }, + { + key: "batchStaffIncrease", + icon: , + content: getLabel(543187, "批量增员") + }, + { + key: "batchDeleteTodolist", + icon: , + content: getLabel(543186, "批量删除待办") + }, + { + key: "exportAll", + icon: , + content: getLabel(81272, "导出全部") + }, + { + key: "exportSelected", + icon: , + content: getLabel(512938, "导出选中") + }, + ...menus + ]; + break; + case "2,3": + menus = [ + { + key: "exportAll", + icon: , + content: getLabel(81272, "导出全部") + }, + { + key: "exportSelected", + icon: , + content: getLabel(512938, "导出选中") + }, + ...menus + ]; + break; + case "3": + menus = [ + { + key: "fullReduction", + icon: , + content: getLabel(543189, "全量减员") + }, + { + key: "batchReduction", + icon: , + content: getLabel(543188, "批量减员") + }, + { + key: "batchDeleteTodolistStayDel", + icon: , + content: getLabel(543186, "批量删除待办") + }, + { + key: "exportAll", + icon: , + content: getLabel(81272, "导出全部") + }, + { + key: "exportSelected", + icon: , + content: getLabel(512938, "导出选中") + }, + ...menus + ]; + break; + case "4,5": + menus = [ + { + key: "batchCancellationOfSuspended", + icon: , + content: getLabel(543190, "批量取消停缴") + }, + { + key: "exportAll", + icon: , + content: getLabel(81272, "导出全部") + }, + { + key: "exportSelected", + icon: , + content: getLabel(512938, "导出选中") + }, + ...menus + ]; + break; + default: + break; + } } return menus; }; -export const renderReqBtns = (selectedKey, getLabel, onOpenAdvanceSearch, onAdvanceSearch, onImport) => { - let reqBtns = [ +export const renderReqBtns = (selectedKey, getLabel, onOpenAdvanceSearch, onAdvanceSearch, onImport, showOperateBtn) => { + let reqBtns = showOperateBtn ? [ , - ]; - switch (selectedKey) { - case "1": - reqBtns.unshift( - {getLabel(544348, "提示:缴纳月份区间包含起始缴纳月,不包含最后缴纳月; 若员工离职时还未增员进入在缴员工,则数据会自动清除,因此若确认缴纳,请及时维护档案数据并增员操作。若清除后还需缴纳,需先在个税扣缴义务人菜单将员工按离职状态添加回来,会重新出现在待增员。")} - - } - />); - break; - case "3": - reqBtns.shift(); - reqBtns.unshift(); - break; - case "4,5": - reqBtns.shift(); - reqBtns.unshift(); - break; - default: - break; + ] : []; + if (showOperateBtn) { + switch (selectedKey) { + case "1": + reqBtns.unshift( + {getLabel(544348, "提示:缴纳月份区间包含起始缴纳月,不包含最后缴纳月; 若员工离职时还未增员进入在缴员工,则数据会自动清除,因此若确认缴纳,请及时维护档案数据并增员操作。若清除后还需缴纳,需先在个税扣缴义务人菜单将员工按离职状态添加回来,会重新出现在待增员。")} + + } + />); + break; + case "3": + reqBtns.shift(); + reqBtns.unshift(); + break; + case "4,5": + reqBtns.shift(); + reqBtns.unshift(); + break; + default: + break; + } } return reqBtns; }; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/index.js index 01d89e48..f0b9ba9f 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/index.js @@ -14,6 +14,7 @@ import WelfareArchivesImportDialog from "./components/welfareArchivesImportDialo import WelfareTip from "./components/welfareTip"; import LogDialog from "./components/logDialog"; import * as API from "../../../apis/welfareArchive"; +import { sysinfo } from "../../../apis/ruleconfig"; import { optTypeEnum, renderDropMenuDatas, renderReqBtns, tabList, welfareTipList } from "./config"; import { convertToUrlString } from "../../../util/url"; import cs from "classnames"; @@ -33,10 +34,17 @@ class Index extends Component { this.state = { selectedKey: "1", showSearchAd: false, isQuery: false, logDialogVisible: false, topTabCount: { stayAdd: 0, paying: 0, stayDel: 0, stopPay: 0, ext: 0 }, - welfareImpDialog: { visible: false, title: getLabel(24023, "数据导入"), runStatuses: "" } + welfareImpDialog: { visible: false, title: getLabel(24023, "数据导入"), runStatuses: "" }, + showExtEmpsWitch: false }; } + async componentDidMount() { + // extEmpsWitch //非系统人员开关, 1: 开启, 0:关闭 + const [{ data: { extEmpsWitch } }] = await Promise.all([sysinfo()]); + this.setState({ showExtEmpsWitch: extEmpsWitch === "1" }); + } + queryInsuranceTabTotal = (active, total) => { API.queryInsuranceTabTotal().then(({ status, data }) => { if (status) { @@ -118,7 +126,10 @@ class Index extends Component { }; render() { - const { selectedKey, topTabCount, showSearchAd, isQuery, logDialogVisible, welfareImpDialog } = this.state; + const { + selectedKey, topTabCount, showSearchAd, isQuery, + logDialogVisible, welfareImpDialog, showExtEmpsWitch + } = this.state; const { taxAgentStore: { showOperateBtn } } = this.props; const tipList = _.find(welfareTipList, o => o.viewcondition === selectedKey).list; return ( @@ -126,11 +137,11 @@ class Index extends Component { } iconBgcolor="#F14A2D" showDropIcon onDropMenuClick={this.onDropMenuClick} - dropMenuDatas={renderDropMenuDatas(selectedKey, getLabel)} - buttons={renderReqBtns(selectedKey, getLabel, this.handleOpenAdvanceSearch, this.handleAdvanceSearch, this.handleImport)} + dropMenuDatas={renderDropMenuDatas(selectedKey, getLabel, showOperateBtn)} + buttons={renderReqBtns(selectedKey, getLabel, this.handleOpenAdvanceSearch, this.handleAdvanceSearch, this.handleImport, showOperateBtn)} replaceTab={ ({ ...o, title: getLabel(o.lanId, o.title) }))} autoCalculateWidth + datas={!showExtEmpsWitch ? _.dropRight(tabList) : tabList} autoCalculateWidth keyParam="viewcondition" selectedKey={selectedKey} counts={topTabCount} countParam="groupid" onChange={key => this.setState({ selectedKey: key })} />