Merge branch 'feature/2.15.1.2407.01-权限' into feature/2.15.2.2409.01合并业务线测试

This commit is contained in:
黎永顺 2024-09-26 17:09:42 +08:00
commit 8c19e33592
7 changed files with 45 additions and 46 deletions

View File

@ -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 }));

View File

@ -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) => {

View File

@ -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 = [<Button type="primary" onClick={() => this.setState({
accountDialog: { ...accountDialog, visible: true, title: getLabel(538780, "核算") }
})}>{getLabel(538780, "核算")}</Button>];

View File

@ -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 }))
};
})
};

View File

@ -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 }));

View File

@ -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 (

View File

@ -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") {