diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/welfareRecordList.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/welfareRecordList.js index 27409fb5..cd9dd5c7 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/welfareRecordList.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/welfareRecordList.js @@ -5,7 +5,6 @@ * Date: 2024/1/23 */ import React, { Component } from "react"; -import { inject, observer } from "mobx-react"; import { message, Modal, Spin } from "antd"; import { WeaLocaleProvider } from "ecCom"; import { getIframeParentHeight } from "../../../../util"; @@ -14,8 +13,6 @@ import { convertToUrlString } from "../../../../util/url"; const getLabel = WeaLocaleProvider.getLabel; -@inject("taxAgentStore") -@observer class WelfareRecordList extends Component { constructor(props) { super(props); @@ -126,7 +123,7 @@ class WelfareRecordList extends Component { childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*"); }; getWelfareRecordList = () => { - const { queryForm, taxAgentStore: { showOperateBtn } } = this.props; + const { queryForm } = this.props; const { pageInfo } = this.state; const payload = { ...pageInfo, ...queryForm, taxAgents: queryForm.taxAgents ? queryForm.taxAgents.split(",") : [] }; this.setState({ loading: true }); @@ -139,8 +136,7 @@ class WelfareRecordList extends Component { pageInfo: { ...pageInfo, current, pageSize, total }, dataSource, columns }, () => this.postMessageToChild({ - scrollHeight: 108, dataSource, columns, pageInfo: this.state.pageInfo, showOperateBtn, - unitTableType: "welfareRecord" + scrollHeight: 108, dataSource, columns, pageInfo: this.state.pageInfo, unitTableType: "welfareRecord" })); } }).catch(() => this.setState({ loading: false })); diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/welfareRecordQuery.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/welfareRecordQuery.js index 16dd0855..3db29a36 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/welfareRecordQuery.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/components/welfareRecordQuery.js @@ -8,8 +8,8 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { WeaFormItem, WeaLocaleProvider, WeaSearchGroup, WeaTools } from "ecCom"; import { WeaSwitch } from "comsMobx"; -import * as API from "../../../../apis/standingBook"; import { welfareRQConditions } from "../columns"; +import { postFetch } from "../../../../util/request"; import { MonthRangePicker } from "../../../reportView/components/statisticalMicroSettingsSlide"; import moment from "moment"; @@ -31,27 +31,28 @@ class WelfareRecordQuery extends Component { } componentDidMount() { - API.getAdminTaxAgentList().then(({ status, data }) => { - if (status) { - this.setState({ - conditions: _.map(welfareRQConditions, item => { - return { - ...item, - items: _.map(item.items, o => { - if (getKey(o) === "taxAgents") { - return { ...o, options: _.map(data, g => ({ key: g.id.toString(), showname: g.name })) }; - } - return o; - }) - }; - }) - }, () => { - const { standingBookStore: { welfareRQForm }, onPutAccountOptions } = this.props; - welfareRQForm.initFormFields(this.state.conditions); - onPutAccountOptions(_.map(data, g => ({ key: g.id.toString(), showname: g.name }))); - }); - } - }); + postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "QUERY_DATA" }) + .then(({ status, data }) => { + if (status) { + this.setState({ + conditions: _.map(welfareRQConditions, item => { + return { + ...item, + items: _.map(item.items, o => { + if (getKey(o) === "taxAgents") { + return { ...o, options: _.map(data, g => ({ key: String(g.id), showname: g.name })) }; + } + return o; + }) + }; + }) + }, () => { + const { standingBookStore: { welfareRQForm }, onPutAccountOptions } = this.props; + welfareRQForm.initFormFields(this.state.conditions); + onPutAccountOptions(_.map(data, g => ({ key: g.id.toString(), showname: g.name }))); + }); + } + }); } renderForm = (form, conditions) => { diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/standingBook.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/standingBook.js index f4089c44..88243286 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/standingBook.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/standingBook/standingBook.js @@ -119,7 +119,8 @@ class StandingBook extends Component { render() { const { accountDialog, queryForm, logDialogVisible, filterConditions } = this.state; - const { taxAgentStore: { showOperateBtn } } = this.props; + const { taxAgentStore: { PageAndOptAuth } } = this.props; + const showOperateBtn = PageAndOptAuth.opts.includes("admin"); const rightBtns = []; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareEditArchiveSlide/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareEditArchiveSlide/index.js index e2342e93..c4eb3b57 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareEditArchiveSlide/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareEditArchiveSlide/index.js @@ -8,10 +8,10 @@ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; import { WeaDialog, WeaLocaleProvider, WeaSlideModal, WeaTools } from "ecCom"; import * as API from "../../../../../apis/welfareArchive"; -import { getTaxAgentSelectList } from "../../../../../apis/taxAgent"; import { sysinfo } from "../../../../../apis/ruleconfig"; import { getWelfareSearchsForm, welfareConditions } from "../../config"; import { getConditionDomkeys, toDecimal_n } from "../../../../../util"; +import { postFetch } from "../../../../../util/request"; import { Button, message, Modal } from "antd"; const getKey = WeaTools.getKey; @@ -39,7 +39,9 @@ class Index extends Component { } getBaseForm = async (props) => { - const [taxAgentListData, sysInfoData] = await Promise.all([getTaxAgentSelectList(), sysinfo()]); + const [taxAgentListData, sysInfoData] = await Promise.all([ + postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" }), sysinfo() + ]); const { archivesStore: { welfareProfileForm }, socialBase, fundBase, otherBase, runStatuses, employeeId, paymentOrganization, socialBaseData, fundBaseData, othersBaseData, @@ -97,7 +99,7 @@ class Index extends Component { items: _.map(o.items, g => { return { ...g, label: getLabel(g.lanId, g.label), - options: _.map(taxAgentListData.data, j => ({ key: j.id, showname: j.content })) + options: _.map(taxAgentListData.data, j => ({ key: String(j.id), showname: j.name })) }; }) }; diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js index a9029a86..52bc2061 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/components/welfareTableList/index.js @@ -70,8 +70,8 @@ class Index extends Component { if (type === "init") { this.getWelfareList(this.props, true); } else if (type === "turn") { - const { record: { baseInfo, employeeId, paymentOrganization } = {}, interfaceParams = {} } = params; - const { runStatuses, showOperateBtn } = this.props; + const { record: { baseInfoId, opts, employeeId, paymentOrganization } = {}, interfaceParams = {} } = params; + const { runStatuses } = this.props; switch (id) { case "PAGEINFO": this.setState({ @@ -114,6 +114,7 @@ class Index extends Component { this.getPaymentForm({ ...payload, welfareTypeEnum: welfareTypeEnum["fund"], schemeId: fundSchemeId }), this.getPaymentForm({ ...payload, welfareTypeEnum: welfareTypeEnum["other"], schemeId: otherSchemeId }) ]); + const showOperateBtn = opts.includes("admin"); this.setState({ welfareEditSlide: { ...this.state.welfareEditSlide, visible: true, showOperateBtn, @@ -128,18 +129,18 @@ class Index extends Component { case "DEL-TO-DO": case "DEL-TO-DO-STAY": const module = (id === "ADD-TO-PAY" || id === "STAY-DEL-TO-STOP" || id === "CANCEL-STOP") ? - [baseInfo] : { ids: [baseInfo], ...interfaceParams }; + [baseInfoId] : { ids: [baseInfoId], ...interfaceParams }; this.handleWelfareOpts(_.camelCase(id), module); break; case "DEL-ARCHIVE": Modal.confirm({ title: getLabel(131329, "信息确认"), content: getLabel(388758, "确认要删除吗?"), - onOk: () => this.handleWelfareOpts(_.camelCase(id), [baseInfo]) + onOk: () => this.handleWelfareOpts(_.camelCase(id), [baseInfoId]) }); break; case "log": - this.props.onFilterLog(id, baseInfo); + this.props.onFilterLog(id, baseInfoId); break; default: break; @@ -156,7 +157,7 @@ class Index extends Component { }; getWelfareList = (props, init = false) => { const { pageInfo } = this.state; - const { archivesStore: { welfareForm }, runStatuses, onChangeTopTabCount, showOperateBtn } = props; + const { archivesStore: { welfareForm }, runStatuses, onChangeTopTabCount } = props; const params = { ...pageInfo, ...welfareForm.getFormParams() }; const payload = runStatuses === "ext" ? { ...params, extWelArchiveList: true } : { ...params, @@ -183,10 +184,7 @@ class Index extends Component { }, () => { const { pageInfo, selectedRowKeys, columns, dataSource } = this.state; onChangeTopTabCount(runStatuses, total, init); - this.postMessageToChild({ - dataSource, pageInfo, selectedRowKeys, runStatuses, - columns, showOperateBtn - }); + this.postMessageToChild({ dataSource, pageInfo, selectedRowKeys, runStatuses, columns }); }); } }).catch(() => this.setState({ loading: false })); diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/index.js index 4da87e27..f64404e9 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfareArchive/index.js @@ -151,7 +151,8 @@ class Index extends Component { selectedKey, topTabCount, showSearchAd, isQuery, recordDialogVisible, logDialogVisible, filterConditions, welfareImpDialog, showExtEmpsWitch } = this.state; - const { taxAgentStore: { showOperateBtn } } = this.props; + const { taxAgentStore: { PageAndOptAuth } } = this.props; + const showOperateBtn = PageAndOptAuth.opts.includes("admin"); const tipList = _.find(welfareTipList, o => o.viewcondition === selectedKey).list; const tabs = _.map(tabList, o => ({ ...o, title: getLabel(o.lanId, o.title) })); return ( diff --git a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanEditSlide/index.js b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanEditSlide/index.js index da42ac66..077d7bfc 100644 --- a/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanEditSlide/index.js +++ b/pc4mobx/hrmSalary/pages/socialSecurityBenefits/welfarePlan/components/welfarePlanEditSlide/index.js @@ -10,7 +10,7 @@ import { WeaLocaleProvider, WeaSearchGroup, WeaSlideModal, WeaTab, WeaTools } fr import PlanSetTable from "./planSetTable"; import { Button, message, Modal } from "antd"; import * as API from "../../../../../apis/welfareScheme"; -import { getTaxAgentSelectListAsAdmin } from "../../../../../apis/taxAgent"; +import { postFetch } from "../../../../../util/request"; import { getConditionDomkeys, getSearchs } from "../../../../../util"; import BaseValidateDialog from "./baseValidateDialog"; import { planConditons } from "../../config"; @@ -44,7 +44,7 @@ class Index extends Component { } getForm = async (props) => { - const { data: result } = await getTaxAgentSelectListAsAdmin(); + const { data: result } = await postFetch("/api/bs/hrmsalary/taxAgent/listAuth", { filterType: "ADMIN_DATA" }); const { id, welfareTypeEnum, programmeStore: { planForm }, showOperateBtn } = props; API.getForm(id ? _.assign({ welfareTypeEnum }, { id }) : { welfareTypeEnum }).then(({ status, data }) => { if (status) { @@ -58,7 +58,7 @@ class Index extends Component { return { ...o, hide: schemeBatch["sharedType"] === "0" || _.isNil(schemeBatch["sharedType"]), viewAttr: (schemeBatch["sharedType"] === "1" && showOperateBtn) ? 3 : showOperateBtn ? o.viewAttr : 1, - options: _.map(result, k => ({ key: k.id, showname: k.content })), + options: _.map(result, k => ({ key: String(k.id), showname: k.name })), label: getLabel(o.lanId, o.label) }; } else if (getKey(o) === "paymentType" || getKey(o) === "sharedType") {