diff --git a/src/assets/api.js b/src/assets/api.js index abbb288f..af4f1c5d 100644 --- a/src/assets/api.js +++ b/src/assets/api.js @@ -1113,11 +1113,16 @@ export const bmExportTaskList = (params) => { return req("get", baseurl + "/mks/admin/v1/settlement_order/export_record/list", params) } -// 下载excel +// 下载 包码 excel task export const bmDownExcel = (id) => { return req("get", baseurl + "/mks/admin/v1/settlement_order/export_record/download/" + id) } +// 删除 包码 下载内容 +export const deleteBMDownloadTask = (id) => { + return req("delete", baseurl + "/mks/admin/v1/settlement_order/export_record/delete/" + id) +} + // 获取自定义按钮列表 export const getDefineButtons = (id) => { return req("get", baseurl + "/plan/getButtonConf/" + id) diff --git a/src/pages/order/bmDownloadList/index.jsx b/src/pages/order/bmDownloadList/index.jsx index a3fcce68..2a3d72ee 100644 --- a/src/pages/order/bmDownloadList/index.jsx +++ b/src/pages/order/bmDownloadList/index.jsx @@ -1,9 +1,9 @@ import Grid from "@/components/gird/main.js" import TabPage from "@/components/tabPage/main.js" import { useSetState, useUpdateEffect } from "ahooks" -import React, { useEffect, useRef } from "react" -import { BlockLoading, Notify } from "zent" -import { bmExportTaskList, handelResponse, bmDownExcel } from "@/assets/api" +import React, { useEffect } from "react" +import { BlockLoading, Notify, Sweetalert } from "zent" +import { bmExportTaskList, handelResponse, bmDownExcel, deleteBMDownloadTask } from "@/assets/api" const tableColumn = [ { @@ -114,7 +114,35 @@ const BmDownload = () => { } ) } - // 昨天调试完招行项目 + + // 删除下载任务 + const deleteDownLoadTask = (id) => { + Sweetalert.confirm({ + title: "确认信息", + content:

确认删除该数据?

, + onConfirm: async () => { + deleteBMDownloadTask(id).then((res) => { + handelResponse( + res, + (response, msg) => { + if (res.code === 200) { + Notify.clear() + Notify.success(msg) + setState({ isQuery: !state.isQuery }) + } else { + Notify.error(msg) + } + }, + (err) => { + Notify.error(err) + } + ) + }) + }, + onCancel: () => {}, + parentComponent: this + }) + } return (
@@ -152,6 +180,14 @@ const BmDownload = () => { 下载 )} + + deleteDownLoadTask(rowData.id)} + > + 删除 + ) }