feature/2.15.2.2409.01合并业务线测试

This commit is contained in:
lys 2024-10-28 14:57:09 +08:00
parent ef86c4faef
commit 000f36ec0e
4 changed files with 22 additions and 21 deletions

View File

@ -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 (
<WeaSlideModal
@ -241,7 +240,7 @@ class FieldSlide extends Component {
tabs={[]}
loading={loading}
showOperateBtn={true}
editable={(showSalaryItemBtn || showOperateBtn)}
editable={admin}
onSave={this.saveFieldInfo}
/>
}

View File

@ -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 <div className="optWrapper">
<a href="javascript:void(0);" className="mr10"
onClick={() => onEditLedger(record)}>{(showSalaryItemBtn || showOperateBtn) ? "编辑" : "查看"}</a>
onClick={() => onEditLedger(record)}>{admin ? "编辑" : "查看"}</a>
{
record.canDelete && (showSalaryItemBtn || showOperateBtn) &&
record.canDelete && admin &&
<a href="javascript:void(0);" className="mr10" onClick={() => onDeleteLedger(record)}>删除</a>
}
<Dropdown

View File

@ -85,7 +85,8 @@ class FieldManagement extends Component {
render() {
const { searchVal, doSearch, slideparams, logDialogVisible, filterConditions } = this.state;
const { taxAgentStore } = this.props;
const { showSalaryItemBtn, showOperateBtn } = taxAgentStore;
const { PageAndOptAuth } = taxAgentStore;
const admin = PageAndOptAuth.opts.includes("admin");
const btns = [
<Button
type="primary"
@ -100,7 +101,7 @@ class FieldManagement extends Component {
return (
<WeaTop
title="字段管理" icon={<i className="icon-coms-fa"/>} iconBgcolor="#F14A2D" className="fieldManageWrapper"
buttons={(showSalaryItemBtn || showOperateBtn) ? btns : btns.slice(-1)}
buttons={admin ? btns : btns.slice(-1)}
showDropIcon onDropMenuClick={this.onDropMenuClick}
dropMenuDatas={[
{

View File

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