Merge branch 'feature/v2-字段管理页面-0120' into develop
This commit is contained in:
commit
688bc7afe4
|
|
@ -0,0 +1,20 @@
|
|||
import { WeaTools } from "ecCom";
|
||||
import { postFetch } from "../util/request";
|
||||
|
||||
//获取编辑详情
|
||||
export const getSalaryFieldForm = (params) => {
|
||||
return WeaTools.callApi("/api/bs/hrmsalary/salaryField/getSalaryForm", "GET", params);
|
||||
};
|
||||
// 字段管理查询
|
||||
export const salaryFieldList = (params) => {
|
||||
return postFetch('/api/bs/hrmsalary/salaryField/list', params);
|
||||
}
|
||||
|
||||
// 字段管理查询
|
||||
export const saveSalaryField = (params) => {
|
||||
return postFetch('/api/bs/hrmsalary/salaryField/save', params);
|
||||
}
|
||||
// 删除字段管理
|
||||
export const deleteSalaryField = (params) => {
|
||||
return postFetch('/api/bs/hrmsalary/salaryField/delete', params);
|
||||
}
|
||||
|
|
@ -31,6 +31,7 @@ import MobilePayroll from "./pages/mobilePayroll";
|
|||
import SysConfig from "./pages/sysConfig";
|
||||
import RuleConfig from "./pages/ruleConfig";
|
||||
import Appconfig from "./pages/appConfig";
|
||||
import FieldManagement from "./pages/fieldManagement";
|
||||
|
||||
import stores from "./stores";
|
||||
import "./style/index";
|
||||
|
|
@ -147,6 +148,7 @@ const Routes = (
|
|||
<Route key="sysconfig" path="sysconfig" component={SysConfig}/>
|
||||
<Route key="sysconfig-1" path="sysconfig-1" component={RuleConfig}/>
|
||||
<Route key="appconfig" path="appconfig" component={Appconfig}/>
|
||||
<Route key="fieldManagement" path="fieldManagement" component={FieldManagement}/>
|
||||
</Route>
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,263 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 编辑新增字段弹框
|
||||
* Description:
|
||||
* Date: 2023/1/19
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { WeaCheckbox, WeaFormItem, WeaHelpfulTip, WeaInput, WeaSelect, WeaSlideModal, WeaTextarea } from "ecCom";
|
||||
import { message, Modal } from "antd";
|
||||
import SlideModalTitle from "../../../components/slideModalTitle";
|
||||
import { getSalaryFieldForm, saveSalaryField } from "../../../apis/fieldManage";
|
||||
import { commonEnumList } from "../../../apis/payrollFiles";
|
||||
import { dataTypeOptions, patternOptions, roundingModeOptions } from "../../salaryItem/options";
|
||||
|
||||
@inject("taxAgentStore")
|
||||
@observer
|
||||
class FieldSlide extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false,
|
||||
name: "",
|
||||
useDefault: "",
|
||||
sharedType: "",
|
||||
shareTypeList: [],
|
||||
taxAgentIds: "",
|
||||
dataType: "number",
|
||||
roundingMode: "",
|
||||
pattern: "2",
|
||||
description: ""
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
const { taxAgentStore } = this.props;
|
||||
this.commonEnumList();
|
||||
const { getTaxAgentSelectListAsAdmin } = taxAgentStore;
|
||||
getTaxAgentSelectListAsAdmin();
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.editId !== this.props.editId && nextProps.editId) {
|
||||
this.getSalaryFieldForm(nextProps.editId);
|
||||
}
|
||||
}
|
||||
|
||||
getSalaryFieldForm = (id) => {
|
||||
getSalaryFieldForm({ id }).then(({ status, data }) => {
|
||||
if (status) {
|
||||
const { name, useDefault, dataType, description, sharedType, roundingMode, taxAgentIds, pattern } = data;
|
||||
this.setState({
|
||||
name,
|
||||
useDefault: useDefault ? useDefault.toString() : "0",
|
||||
dataType,
|
||||
description,
|
||||
sharedType: sharedType ? sharedType.toString() : "0",
|
||||
roundingMode: roundingMode ? roundingMode.toString() : "0",
|
||||
taxAgentIds,
|
||||
pattern: pattern ? pattern.toString() : "0"
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
* Author: 黎永顺
|
||||
* Description: 获取可见性列表
|
||||
* Params:
|
||||
* Date: 2023/1/28
|
||||
*/
|
||||
commonEnumList = () => {
|
||||
const payload = {
|
||||
enumClass: "com.engine.salary.enums.sicategory.SharedTypeEnum"
|
||||
};
|
||||
commonEnumList(payload).then(({ status, data }) => {
|
||||
if (status) {
|
||||
const result = _.map(data, it => ({
|
||||
key: String(it.value),
|
||||
showname: it.defaultLabel
|
||||
}));
|
||||
this.setState({
|
||||
shareTypeList: [{
|
||||
key: "",
|
||||
showname: ""
|
||||
}, ...result]
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
/*
|
||||
* Author: 黎永顺
|
||||
* Description: 保存字段信息
|
||||
* Params:
|
||||
* Date: 2022/12/12
|
||||
*/
|
||||
saveFieldInfo = () => {
|
||||
if (_.isEmpty(this.state.name)) {
|
||||
Modal.warning({
|
||||
title: "信息确认",
|
||||
content: "必要信息不完整,红色*为必填项!"
|
||||
});
|
||||
return false;
|
||||
}
|
||||
const { onRefreshList, onCancel, editId } = this.props;
|
||||
const { name, useDefault, dataType, description, sharedType, roundingMode, taxAgentIds, pattern } = this.state;
|
||||
const payload = {
|
||||
name,
|
||||
useDefault: Number(useDefault),
|
||||
dataType,
|
||||
description,
|
||||
sharedType,
|
||||
roundingMode: Number(roundingMode),
|
||||
taxAgentIds,
|
||||
pattern: Number(pattern)
|
||||
};
|
||||
this.setState({ loading: true });
|
||||
saveSalaryField({ ...payload, id: editId }).then(({ status, errormsg }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
onRefreshList();
|
||||
onCancel();
|
||||
this.handleReset();
|
||||
message.success("保存成功");
|
||||
} else {
|
||||
message.error(errormsg || "保存失败");
|
||||
}
|
||||
}).catch(() => this.setState({ loading: false }));
|
||||
};
|
||||
/*
|
||||
* Author: 黎永顺
|
||||
* Description: 字段项修改
|
||||
* Params:
|
||||
* Date: 2022/12/14
|
||||
*/
|
||||
handleChangeFields = (type, value) => {
|
||||
this.setState({ [type]: value });
|
||||
};
|
||||
handleReset = () => {
|
||||
this.setState({
|
||||
name: "",
|
||||
useDefault: "",
|
||||
sharedType: "",
|
||||
taxAgentIds: "",
|
||||
dataType: "number",
|
||||
roundingMode: "",
|
||||
pattern: "2",
|
||||
description: ""
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { title, visible, taxAgentStore: { showOperateBtn, taxAgentAdminOption }, onCancel } = this.props;
|
||||
const {
|
||||
loading,
|
||||
name,
|
||||
useDefault,
|
||||
shareTypeList,
|
||||
sharedType,
|
||||
taxAgentIds,
|
||||
dataType,
|
||||
roundingMode,
|
||||
pattern,
|
||||
description
|
||||
} = this.state;
|
||||
return (
|
||||
<WeaSlideModal
|
||||
className="slideOuterWrapper"
|
||||
visible={visible}
|
||||
top={0}
|
||||
width={55}
|
||||
height={100}
|
||||
direction="right"
|
||||
measure="%"
|
||||
title={
|
||||
<SlideModalTitle
|
||||
subtitle={title}
|
||||
tabs={[]}
|
||||
loading={loading}
|
||||
showOperateBtn={showOperateBtn}
|
||||
editable={true}
|
||||
onSave={this.saveFieldInfo}
|
||||
/>
|
||||
}
|
||||
content={
|
||||
<div className="wea-form-item-group">
|
||||
<WeaFormItem label="名称" labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
|
||||
<WeaInput viewAttr={3} value={name}
|
||||
onChange={value => this.handleChangeFields("name", value)}/>
|
||||
</WeaFormItem>
|
||||
<WeaFormItem label="默认使用" labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
|
||||
<WeaCheckbox
|
||||
value={useDefault}
|
||||
display="switch"
|
||||
onChange={value => this.handleChangeFields("useDefault", value)}
|
||||
/>
|
||||
<WeaHelpfulTip style={{ marginLeft: "10px" }} width={200}
|
||||
title="提示:开启后,每个薪资方案都有该薪资项目,可在具体薪资方案中删除"
|
||||
placement="topLeft"
|
||||
/>
|
||||
</WeaFormItem>
|
||||
<WeaFormItem label="可见性" labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
|
||||
<WeaSelect
|
||||
value={sharedType}
|
||||
options={shareTypeList}
|
||||
onChange={value => this.handleChangeFields("sharedType", value)}
|
||||
style={{ width: 200 }}
|
||||
/>
|
||||
</WeaFormItem>
|
||||
{
|
||||
sharedType === "1" &&
|
||||
<WeaFormItem label="可见性范围" labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
|
||||
<WeaSelect
|
||||
multiple
|
||||
viewAttr={3}
|
||||
style={{ width: 200 }}
|
||||
value={taxAgentIds}
|
||||
options={taxAgentAdminOption}
|
||||
onChange={value => this.handleChangeFields("taxAgentIds", value)}
|
||||
/>
|
||||
</WeaFormItem>
|
||||
}
|
||||
<WeaFormItem label="字段类型" labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
|
||||
<WeaSelect
|
||||
value={dataType}
|
||||
options={dataTypeOptions}
|
||||
onChange={value => this.handleChangeFields("dataType", value)}
|
||||
style={{ width: 200 }}
|
||||
/>
|
||||
</WeaFormItem>
|
||||
<WeaFormItem label="舍入规则" labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
|
||||
<WeaSelect
|
||||
value={roundingMode}
|
||||
options={roundingModeOptions}
|
||||
onChange={value => this.handleChangeFields("roundingMode", value)}
|
||||
/>
|
||||
</WeaFormItem>
|
||||
<WeaFormItem label="保留小数位" labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
|
||||
<WeaSelect
|
||||
value={pattern}
|
||||
options={patternOptions}
|
||||
onChange={value => this.handleChangeFields("pattern", value)}
|
||||
/>
|
||||
</WeaFormItem>
|
||||
<WeaFormItem label="备注" labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
|
||||
<WeaTextarea
|
||||
value={description}
|
||||
onChange={value => this.handleChangeFields("description", value)}
|
||||
/>
|
||||
</WeaFormItem>
|
||||
</div>
|
||||
}
|
||||
onClose={() => {
|
||||
this.handleReset();
|
||||
onCancel();
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default FieldSlide;
|
||||
|
||||
|
|
@ -0,0 +1,182 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 字段列表
|
||||
* Description:
|
||||
* Date: 2023/1/19
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { WeaTable } from "ecCom";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { message, Modal, Switch } from "antd";
|
||||
import { salaryFieldList } from "../../../apis/fieldManage";
|
||||
|
||||
@inject("taxAgentStore")
|
||||
@observer
|
||||
class FieldTable extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
loading: false,
|
||||
dataSource: [],
|
||||
columns: [],
|
||||
pageInfo: {
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
total: 0
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.salaryFieldList();
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps, nextContext) {
|
||||
if (nextProps.doSearch !== this.props.doSearch) this.salaryFieldList({ current: 1 });
|
||||
}
|
||||
|
||||
salaryFieldList = (extra = {}) => {
|
||||
const { name } = this.props;
|
||||
const { pageInfo } = this.state;
|
||||
const payload = { name, ...pageInfo, ...extra };
|
||||
this.setState({ loading: true });
|
||||
salaryFieldList(payload).then(({ status, data }) => {
|
||||
this.setState({ loading: false });
|
||||
if (status) {
|
||||
const { pageNum: current, pageSize, total, columns, list: dataSource } = data;
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current, pageSize, total },
|
||||
dataSource,
|
||||
columns
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
getColumns = () => {
|
||||
const { columns } = this.state;
|
||||
const { taxAgentStore, onEditLedger, onDeleteLedger } = this.props;
|
||||
const { showOperateBtn } = taxAgentStore;
|
||||
return _.map([...columns, {
|
||||
dataIndex: "operate",
|
||||
display: true,
|
||||
key: "operate",
|
||||
title: "操作"
|
||||
}], item => {
|
||||
const { dataIndex } = item;
|
||||
if (dataIndex === "useDefault") {
|
||||
item.render = (text) => (<Switch checked={text === 1} disabled/>);
|
||||
} else if (dataIndex === "operate") {
|
||||
item.width = 120;
|
||||
item.render = (text, record) => {
|
||||
return <div className="optWrapper">
|
||||
<a href="javascript:void(0);" className="mr10"
|
||||
onClick={() => onEditLedger(record)}>{showOperateBtn ? "编辑" : "查看"}</a>
|
||||
{
|
||||
showOperateBtn &&
|
||||
<a href="javascript:void(0);" className="mr10" onClick={() => onDeleteLedger(record)}>删除</a>
|
||||
}
|
||||
</div>;
|
||||
};
|
||||
} else {
|
||||
item.render = (text) => {
|
||||
return <span className="tdEllipsis" title={text}>{text}</span>;
|
||||
};
|
||||
}
|
||||
return { ...item };
|
||||
});
|
||||
};
|
||||
/*
|
||||
* Author: 黎永顺
|
||||
* Description: 刪除薪资账套
|
||||
* Params:
|
||||
* Date: 2022/12/8
|
||||
*/
|
||||
deleteLedger = (payload) => {
|
||||
deleteLedger(payload).then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
message.success("删除成功");
|
||||
this.salaryFieldList();
|
||||
} else {
|
||||
message.error(errormsg || "删除失败");
|
||||
}
|
||||
});
|
||||
};
|
||||
/*
|
||||
* Author: 黎永顺
|
||||
* Description: 启用/关闭账套
|
||||
* Params:
|
||||
* Date: 2022/12/8
|
||||
*/
|
||||
changeLedgerStatus = (payload) => {
|
||||
changeLedgerStatus(payload).then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
message.success("操作成功");
|
||||
this.salaryFieldList();
|
||||
} else {
|
||||
message.error(errormsg || "操作成功");
|
||||
}
|
||||
});
|
||||
};
|
||||
handleResetCopy = () => {
|
||||
const { copyLedgerModal } = this.state;
|
||||
this.setState({
|
||||
copyLedgerModal: { ...copyLedgerModal, visible: false, id: "", name: "", taxAgenyId: "" }
|
||||
});
|
||||
};
|
||||
handleMenuClick = ({ key }, record) => {
|
||||
const { copyLedgerModal } = this.state;
|
||||
const { id, name, taxAgentId } = record;
|
||||
switch (key) {
|
||||
case "copy":
|
||||
this.setState({
|
||||
copyLedgerModal: { ...copyLedgerModal, visible: true, id, name, taxAgentId }
|
||||
});
|
||||
break;
|
||||
case "delete":
|
||||
Modal.confirm({
|
||||
title: "信息确认",
|
||||
content: "确认要删除吗?",
|
||||
onOk: () => {
|
||||
this.deleteLedger([id]);
|
||||
}
|
||||
});
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { dataSource, pageInfo, loading } = this.state;
|
||||
const pagination = {
|
||||
...pageInfo,
|
||||
showTotal: total => `共 ${total} 条`,
|
||||
showQuickJumper: true,
|
||||
showSizeChanger: true,
|
||||
pageSizeOptions: ["10", "20", "50", "100"],
|
||||
onShowSizeChange: (current, pageSize) => {
|
||||
this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => {
|
||||
this.salaryFieldList();
|
||||
});
|
||||
},
|
||||
onChange: current => {
|
||||
this.setState({
|
||||
pageInfo: { ...pageInfo, current }
|
||||
}, () => {
|
||||
this.salaryFieldList();
|
||||
});
|
||||
}
|
||||
};
|
||||
return (
|
||||
<WeaTable
|
||||
rowKey="id"
|
||||
dataSource={dataSource}
|
||||
pagination={pagination}
|
||||
loading={loading}
|
||||
columns={this.getColumns()}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default FieldTable;
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
/*
|
||||
* Author: 黎永顺
|
||||
* name: 字段管理
|
||||
* Description:
|
||||
* Date: 2023/1/18
|
||||
*/
|
||||
import React, { Component } from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { Button, message, Modal } from "antd";
|
||||
import { WeaInputSearch, WeaTop } from "ecCom";
|
||||
import FieldTable from "./components/fieldTable";
|
||||
import FieldSlide from "./components/fieldSlide";
|
||||
import { deleteSalaryField } from "../../apis/fieldManage";
|
||||
import "./index.less";
|
||||
|
||||
@inject("taxAgentStore")
|
||||
@observer
|
||||
class FieldManagement extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
searchVal: "",
|
||||
doSearch: false,
|
||||
slideparams: {
|
||||
visible: false,
|
||||
title: "新建字段",
|
||||
editId: ""
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
handleEditField = (record) => {
|
||||
const { slideparams } = this.state;
|
||||
const { id } = record;
|
||||
this.setState({ slideparams: { ...slideparams, visible: true, title: "编辑字段", editId: id } });
|
||||
};
|
||||
handleDeleteField = (filedIds) => {
|
||||
Modal.confirm({
|
||||
title: "信息确认",
|
||||
content: "确认要删除吗?",
|
||||
onOk: () => {
|
||||
deleteSalaryField(filedIds).then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
message.success("删除成功");
|
||||
this.setState({ doSearch: !this.state.doSearch })
|
||||
} else {
|
||||
message.error(errormsg || "删除失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
handleResetField = () => {
|
||||
const { slideparams } = this.state;
|
||||
this.setState({
|
||||
slideparams: {
|
||||
...slideparams,
|
||||
visible: false,
|
||||
title: "新建字段",
|
||||
editId: ""
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
const { searchVal, doSearch, slideparams } = this.state;
|
||||
const { taxAgentStore } = this.props;
|
||||
const { showOperateBtn } = taxAgentStore;
|
||||
const btns = [
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={() => this.setState({ slideparams: { ...slideparams, visible: true } })}
|
||||
>新建</Button>,
|
||||
<WeaInputSearch
|
||||
value={searchVal} placeholder="请输入字段名称"
|
||||
onChange={searchVal => this.setState({ searchVal })}
|
||||
onSearch={() => this.setState({ doSearch: !doSearch })}
|
||||
/>
|
||||
];
|
||||
return (
|
||||
<WeaTop
|
||||
title="字段管理"
|
||||
icon={<i className="icon-coms-fa"/>}
|
||||
iconBgcolor="#F14A2D"
|
||||
showDropIcon={false}
|
||||
buttons={showOperateBtn ? btns : btns.slice(-1)}
|
||||
>
|
||||
<div className="fieldManageWrapper">
|
||||
<FieldTable name={searchVal} doSearch={doSearch} onEditLedger={this.handleEditField}
|
||||
onDeleteLedger={(record) => this.handleDeleteField([record.id])}/>
|
||||
<FieldSlide
|
||||
{...slideparams}
|
||||
onCancel={this.handleResetField}
|
||||
onRefreshList={() => this.setState({ doSearch: !doSearch })}
|
||||
/>
|
||||
</div>
|
||||
</WeaTop>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default FieldManagement;
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
.slideOuterWrapper {
|
||||
.wea-form-item-group{
|
||||
padding: 56px 80px;
|
||||
}
|
||||
.wea-slide-modal-title {
|
||||
height: initial;
|
||||
line-height: initial;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.rodal-close {
|
||||
z-index: 99;
|
||||
top: 10px !important;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@media (min-width: 1260px) {
|
||||
.slideOuterWrapper {
|
||||
.reqTopWrapper .wea-new-top-req-title > div:first-child > div {
|
||||
max-width: 100% !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: 1060px) and (max-width: 1260px) {
|
||||
.slideOuterWrapper {
|
||||
.reqTopWrapper .wea-new-top-req-title > div:first-child > div {
|
||||
max-width: calc(100% - 96px) !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -159,7 +159,7 @@ class LedgerBaseSetting extends Component {
|
|||
{
|
||||
_.map(baseForm, item => {
|
||||
const { key, label, type, options = [], children = [] } = item;
|
||||
taxAgentIdDisabled = key === "taxAgentId" && taxAgentId;
|
||||
taxAgentIdDisabled = key === "taxAgentId" && editId && taxAgentId;
|
||||
taxableItemsDisabled = key === "taxableItems" && editId;
|
||||
return <WeaFormItem
|
||||
key={key} label={label}
|
||||
|
|
|
|||
|
|
@ -148,6 +148,7 @@ class Index extends Component {
|
|||
const { taxAgentStore } = this.props;
|
||||
const { getTaxAgentSelectListAsAdmin } = taxAgentStore;
|
||||
getTaxAgentSelectListAsAdmin();
|
||||
this.queryTabTotal();
|
||||
this.queryList("/api/bs/hrmsalary/salaryArchive/pendingList");
|
||||
const init = this.init();
|
||||
}
|
||||
|
|
@ -194,13 +195,6 @@ class Index extends Component {
|
|||
const payload = { ...pageInfo };
|
||||
this.setState({
|
||||
loading: { ...loading, query: true },
|
||||
dataSource: [],
|
||||
tabCount: {
|
||||
SUSPEND: 0,
|
||||
STOP: 0,
|
||||
FIXED: 0,
|
||||
PENDING: 0
|
||||
}
|
||||
});
|
||||
queryList(payload, searchItemsValue, url).then(({ data, status }) => {
|
||||
this.setState({ loading: { ...loading, query: false } });
|
||||
|
|
@ -216,7 +210,6 @@ class Index extends Component {
|
|||
pageSize
|
||||
}
|
||||
});
|
||||
this.queryTabTotal();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
@ -235,6 +228,7 @@ class Index extends Component {
|
|||
if (status) {
|
||||
const { msg } = data;
|
||||
message.info(msg || "操作成功!");
|
||||
this.queryTabTotal();
|
||||
this.query();
|
||||
} else {
|
||||
message.error(errormsg || "操作失败!");
|
||||
|
|
@ -260,6 +254,7 @@ class Index extends Component {
|
|||
API.cancelStop([id]).then(({ status, errormsg }) => {
|
||||
if (status) {
|
||||
message.success("操作成功!");
|
||||
this.queryTabTotal();
|
||||
this.query();
|
||||
} else {
|
||||
message.error(errormsg || "操作失败!");
|
||||
|
|
@ -274,6 +269,7 @@ class Index extends Component {
|
|||
this.setState({
|
||||
selectedRowKeys: []
|
||||
}, () => {
|
||||
this.queryTabTotal();
|
||||
this.query();
|
||||
});
|
||||
} else {
|
||||
|
|
@ -312,6 +308,7 @@ class Index extends Component {
|
|||
this.setState({
|
||||
selectedRowKeys: []
|
||||
}, () => {
|
||||
this.queryTabTotal();
|
||||
this.query();
|
||||
});
|
||||
} else {
|
||||
|
|
@ -388,6 +385,7 @@ class Index extends Component {
|
|||
pageInfo={pageInfo}
|
||||
selectedRowKeys={selectedRowKeys}
|
||||
refreshList={() => {
|
||||
this.queryTabTotal();
|
||||
this.query();
|
||||
this.setState({ selectedRowKeys: [] });
|
||||
}}
|
||||
|
|
@ -423,6 +421,7 @@ class Index extends Component {
|
|||
<BatchSuspendsPay
|
||||
selectedRowKeys={selectedRowKeys}
|
||||
refreshList={() => {
|
||||
this.queryTabTotal();
|
||||
this.query();
|
||||
this.setState({ selectedRowKeys: [] });
|
||||
}}
|
||||
|
|
|
|||
Loading…
Reference in New Issue