feature/2.19.1.2501.01-考勤数据编辑

This commit is contained in:
lys 2025-06-12 16:56:24 +08:00
parent fb46f0b336
commit ce19b4b888
1 changed files with 22 additions and 12 deletions

View File

@ -8,7 +8,7 @@ import React, { Component } from "react";
import { WeaInputSearch, WeaLocaleProvider, WeaSlideModal, WeaTop } from "ecCom";
import { batchDeleteData, viewAttendQuote } from "../../../../apis/attendance";
import AttendanceDataEditSlide from "./attendanceDataEditSlide";
import { Button, message, Spin } from "antd";
import { Button, message, Modal, Spin } from "antd";
import "./index.less";
import { calcPageNo } from "../../../../util";
@ -18,7 +18,7 @@ class AttendanceDataViewSlide extends Component {
constructor(props) {
super(props);
this.state = {
loading: { query: false }, keyword: "", dataSource: [], selectedRowKeys: [],
loading: { query: false, del: false }, keyword: "", dataSource: [], selectedRowKeys: [],
pageInfo: { current: 1, pageSize: 10, total: 0 }, attendanceSlide: { visible: false, record: {} }
};
}
@ -104,16 +104,26 @@ class AttendanceDataViewSlide extends Component {
this.handleDebounce();
};
batchDeleteData = () => {
const { selectedRowKeys, pageInfo } = this.state;
batchDeleteData({ attendQuoteDataIds: selectedRowKeys }).then(({ status, errormsg }) => {
if (status) {
message.success(getLabel(111, "操作成功!"));
this.setState({
selectedRowKeys: [],
pageInfo: { ...pageInfo, current: calcPageNo(pageInfo.total, pageInfo.current, 10, selectedRowKeys.length) }
}, () => this.viewAttendQuote());
} else {
message.error(errormsg);
Modal.confirm({
title: getLabel(111, "信息确认"),
content: getLabel(111, "确认要删除吗?"),
onOk: () => {
const { selectedRowKeys, pageInfo, loading } = this.state;
this.setState({ loading: { ...loading, del: true } });
batchDeleteData({ attendQuoteDataIds: selectedRowKeys }).then(({ status, errormsg }) => {
if (status) {
message.success(getLabel(111, "操作成功!"));
this.setState({
selectedRowKeys: [], loading: { ...loading, del: false },
pageInfo: {
...pageInfo,
current: calcPageNo(pageInfo.total, pageInfo.current, 10, selectedRowKeys.length)
}
}, () => this.viewAttendQuote());
} else {
message.error(errormsg);
}
});
}
});
};