From 000f36ec0eff3449ae02677fb32b1b428c90e9be Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Mon, 28 Oct 2024 14:57:09 +0800 Subject: [PATCH] =?UTF-8?q?feature/2.15.2.2409.01=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=E7=BA=BF=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fieldManagement/components/fieldSlide.js | 25 +++++++++---------- .../fieldManagement/components/fieldTable.js | 7 +++--- .../hrmSalary/pages/fieldManagement/index.js | 5 ++-- .../salaryFileAdvanceSearchPannel/index.js | 6 ++--- 4 files changed, 22 insertions(+), 21 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldSlide.js b/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldSlide.js index 8a6533ee..047ced9c 100644 --- a/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldSlide.js +++ b/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldSlide.js @@ -22,6 +22,7 @@ import SlideModalTitle from "../../../components/slideModalTitle"; import { getSalaryFieldForm, saveSalaryField } from "../../../apis/fieldManage"; import { commonEnumList } from "../../../apis/payrollFiles"; import { dataTypeOptions, patternOptions, roundingModeOptions } from "../../salaryItem/options"; +import { postFetch } from "../../../util/request"; const getLabel = WeaLocaleProvider.getLabel; @@ -44,15 +45,17 @@ class FieldSlide extends Component { pattern: "2", sortedIndex: "", width: "", - description: "" + description: "", + taxAgentOption: [] }; } componentDidMount() { - const { taxAgentStore } = this.props; this.commonEnumList(); - const { fetchTaxAgentOption } = taxAgentStore; - fetchTaxAgentOption(); + postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" }) + .then(({ status, data }) => { + if (status) this.setState({ taxAgentOption: _.map(data, o => ({ key: String(o.id), showname: o.name })) }); + }); } componentWillReceiveProps(nextProps, nextContext) { @@ -203,13 +206,8 @@ class FieldSlide extends Component { }; render() { - const { - title, - visible, - record: { id: editId }, - taxAgentStore: { taxAgentOption, showSalaryItemBtn, showOperateBtn }, - onCancel - } = this.props; + const { title, visible, record: { id: editId }, onCancel, taxAgentStore: { PageAndOptAuth } } = this.props; + const admin = PageAndOptAuth.opts.includes("admin"); const { loading, name, @@ -224,7 +222,8 @@ class FieldSlide extends Component { pattern, sortedIndex, width, - description + description, + taxAgentOption } = this.state; return ( } diff --git a/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldTable.js b/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldTable.js index 840da963..d470705b 100644 --- a/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldTable.js +++ b/pc4mobx/hrmSalary/pages/fieldManagement/components/fieldTable.js @@ -57,7 +57,8 @@ class FieldTable extends Component { getColumns = () => { const { columns } = this.state; const { taxAgentStore, onEditLedger, onDeleteLedger } = this.props; - const { showSalaryItemBtn, showOperateBtn } = taxAgentStore; + const { PageAndOptAuth } = taxAgentStore; + const admin = PageAndOptAuth.opts.includes("admin"); return _.map([...columns, { dataIndex: "operate", display: true, @@ -72,9 +73,9 @@ class FieldTable extends Component { item.render = (text, record) => { return
onEditLedger(record)}>{(showSalaryItemBtn || showOperateBtn) ? "编辑" : "查看"} + onClick={() => onEditLedger(record)}>{admin ? "编辑" : "查看"} { - record.canDelete && (showSalaryItemBtn || showOperateBtn) && + record.canDelete && admin && onDeleteLedger(record)}>删除 } } iconBgcolor="#F14A2D" className="fieldManageWrapper" - buttons={(showSalaryItemBtn || showOperateBtn) ? btns : btns.slice(-1)} + buttons={admin ? btns : btns.slice(-1)} showDropIcon onDropMenuClick={this.onDropMenuClick} dropMenuDatas={[ { diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileAdvanceSearchPannel/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileAdvanceSearchPannel/index.js index 3f164873..bf066c7f 100644 --- a/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileAdvanceSearchPannel/index.js +++ b/pc4mobx/hrmSalary/pages/payrollFiles/components/salaryFileAdvanceSearchPannel/index.js @@ -11,7 +11,7 @@ import { inject, observer } from "mobx-react"; import { getSearchs } from "../../../../util"; import * as API from "../../../../apis/payrollFiles"; import { salaryFileSearchConditions } from "../../config"; -import { getTaxAgentSelectList } from "../../../../apis/taxAgent"; +import { postFetch } from "../../../../util/request"; const getLabel = WeaLocaleProvider.getLabel; const getKey = WeaTools.getKey; @@ -29,7 +29,7 @@ class salaryFileAdvanceSearchPannel extends Component { async componentDidMount() { const [{ data: userStatusList }, { data: taxAgentList }] = await Promise.all([ API.commonEnumList({ enumClass: "com.engine.salary.enums.UserStatusEnum" }), - getTaxAgentSelectList() + postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" }) ]); this.setState({ searchConditions: _.map(salaryFileSearchConditions, item => { @@ -44,7 +44,7 @@ class salaryFileAdvanceSearchPannel extends Component { } else if (getKey(child) === "taxAgentIds") { return { ...child, - options: _.map(taxAgentList, o => ({ key: o.id, showname: o.content })) + options: _.map(taxAgentList, o => ({ key: String(o.id), showname: o.name })) }; } return { ...child };