feat: 实现团队负责人审批预约功能
This commit is contained in:
parent
d072d36c6d
commit
fb7b0f62a8
@ -1,9 +1,10 @@
|
|||||||
import { Button, Space, Table } from "antd";
|
import { Button, message, Space, Table } from "antd";
|
||||||
import Column from "antd/es/table/Column";
|
import Column from "antd/es/table/Column";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import { selectUserId } from "../../features/auth/authSlice";
|
import { selectUserId } from "../../features/auth/authSlice";
|
||||||
import axiosInstance from "../../api/axios";
|
import axiosInstance from "../../api/axios";
|
||||||
|
import { current } from "@reduxjs/toolkit";
|
||||||
|
|
||||||
export default function LeaderApproval() {
|
export default function LeaderApproval() {
|
||||||
const [reservations, setReservations] = useState([]);
|
const [reservations, setReservations] = useState([]);
|
||||||
@ -22,7 +23,6 @@ export default function LeaderApproval() {
|
|||||||
size: pagination.pageSize,
|
size: pagination.pageSize,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
console.log(data);
|
|
||||||
|
|
||||||
setReservations(data.records);
|
setReservations(data.records);
|
||||||
setPagination({
|
setPagination({
|
||||||
@ -40,8 +40,19 @@ export default function LeaderApproval() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleApproval = (reservationId, isApprove) => {
|
const handleApproval = (reservationId, isApprove) => {
|
||||||
console.log(reservationId);
|
axiosInstance.post("/approval/leader", {
|
||||||
console.log(isApprove);
|
leaderId: userId,
|
||||||
|
reservationId,
|
||||||
|
isApprove,
|
||||||
|
});
|
||||||
|
|
||||||
|
message.success("审核成功");
|
||||||
|
const newPagination = {
|
||||||
|
...pagination,
|
||||||
|
current: 1,
|
||||||
|
};
|
||||||
|
setPagination(newPagination);
|
||||||
|
fetchData(newPagination);
|
||||||
};
|
};
|
||||||
|
|
||||||
// "预约人、所属团队、联系方式、预约设备、预约时间: 设备详情、"
|
// "预约人、所属团队、联系方式、预约设备、预约时间: 设备详情、"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user