新增商品导出
This commit is contained in:
@@ -174,7 +174,7 @@ import UserAPI from "@/api/product/index";
|
||||
import { useRouter } from "vue-router";
|
||||
import type { IObject, IOperatData } from "@/components/CURD/types";
|
||||
import usePage from "@/components/CURD/usePage";
|
||||
import { isSyncStatus } from "@/utils/index";
|
||||
import { isSyncStatus, downloadFile } from "@/utils/index";
|
||||
import addModalConfig from "./indexconfig/add";
|
||||
import contentConfig from "./indexconfig/content";
|
||||
import MultiImageUpload from "@/components/Upload/MultiImageUpload.vue";
|
||||
@@ -193,7 +193,7 @@ const {
|
||||
handleResetClick,
|
||||
// handleEditClick,
|
||||
handleSubmitClick,
|
||||
handleExportClick,
|
||||
// handleExportClick,
|
||||
handleSearchClick,
|
||||
handleFilterChange,
|
||||
} = usePage();
|
||||
@@ -302,6 +302,17 @@ function getTongji(params: IObject | undefined) {
|
||||
});
|
||||
}
|
||||
|
||||
// 导出商品
|
||||
async function handleExportClick() {
|
||||
try {
|
||||
const filterParams = searchRef.value?.getQueryParams();
|
||||
const file = await UserAPI.exportProducts(filterParams);
|
||||
downloadFile(file, "商品列表", "xlsx");
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
||||
// 新增
|
||||
async function handleAddClick() {
|
||||
router.push({ name: "addgoods" });
|
||||
|
||||
Reference in New Issue
Block a user