From 2837efee9764f59ad24087fbb84232ff9da3e231 Mon Sep 17 00:00:00 2001 From: yangchunlong <292345300@qq.com> Date: Sun, 28 Sep 2025 16:11:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=9A=80=20=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=8E=AF=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.test | 2 +- src/api/modules/foundationMaterial.ts | 3 ++ src/api/modules/warehousing.ts | 3 ++ src/components.d.ts | 6 +-- src/views/export/list/index.vue | 2 +- src/views/foundation/set/material/index.vue | 7 +++- .../foundation/set/material/init/btnClick.ts | 41 ++++++------------- .../warehousing/constant/list/button.ts | 2 +- .../subscribe/warehousing/index.vue | 6 ++- .../subscribe/warehousing/init/btnClick.ts | 33 ++++----------- 10 files changed, 43 insertions(+), 62 deletions(-) diff --git a/.env.test b/.env.test index 16ceb60..a7a1f50 100644 --- a/.env.test +++ b/.env.test @@ -1,6 +1,6 @@ ENV = 'test' VITE_APP_API_VERSION ="" -VITE_APP_API_BASEURL = https://dev.wms.api.v2.f2b211.com/admapi/ +VITE_APP_API_BASEURL = https://dev.wms.api.v2.f2b211.com/v1/admapi/ VITE_APP_SSO_LOGINURL = http://dev.uc.v3.f2b211.com/uc/login # http://dev.uc.f2b211.com/index.php/uc/user/login.html VITE_APP_SSO_APPID = 101341644040699904 diff --git a/src/api/modules/foundationMaterial.ts b/src/api/modules/foundationMaterial.ts index 71c1a51..a1dc6ab 100644 --- a/src/api/modules/foundationMaterial.ts +++ b/src/api/modules/foundationMaterial.ts @@ -12,3 +12,6 @@ export const getMaterialListApi = (params: any) => { export const getMaterialListReloadApi = (params: any) => { return http.get(`material/reload`, params); }; +export const getMaterialListExportApi = (params: any) => { + return http.get(`material/export`, params); +}; diff --git a/src/api/modules/warehousing.ts b/src/api/modules/warehousing.ts index 69fd3a7..1f60c7c 100644 --- a/src/api/modules/warehousing.ts +++ b/src/api/modules/warehousing.ts @@ -8,3 +8,6 @@ export const getSubscribeWrrListApi = (params: any) => { export const getSubscribeResetListApi = (params: any) => { return http.get(`subscribe/wrr/reload`, params); }; +export const getSubscribeResetListExportApi = (params: any) => { + return http.get(`subscribe/wrr/export`, params); +}; diff --git a/src/components.d.ts b/src/components.d.ts index 3bc6cb4..d6cc73b 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -13,13 +13,12 @@ declare module "vue" { ColSetting: typeof import("./components/ProTable/components/ColSetting.vue")["default"]; DetailsSearch: typeof import("./components/DetailsSearch/index.vue")["default"]; ElAside: typeof import("element-plus/es")["ElAside"]; - ElAutocomplete: typeof import("element-plus/es")["ElAutocomplete"]; ElBreadcrumb: typeof import("element-plus/es")["ElBreadcrumb"]; ElBreadcrumbItem: typeof import("element-plus/es")["ElBreadcrumbItem"]; ElButton: typeof import("element-plus/es")["ElButton"]; + ElCheckbox: typeof import("element-plus/es")["ElCheckbox"]; ElContainer: typeof import("element-plus/es")["ElContainer"]; ElDatePicker: typeof import("element-plus/es")["ElDatePicker"]; - ElDialog: typeof import("element-plus/es")["ElDialog"]; ElDrawer: typeof import("element-plus/es")["ElDrawer"]; ElDropdown: typeof import("element-plus/es")["ElDropdown"]; ElDropdownItem: typeof import("element-plus/es")["ElDropdownItem"]; @@ -29,6 +28,7 @@ declare module "vue" { ElHeader: typeof import("element-plus/es")["ElHeader"]; ElIcon: typeof import("element-plus/es")["ElIcon"]; ElInput: typeof import("element-plus/es")["ElInput"]; + ElInputNumber: typeof import("element-plus/es")["ElInputNumber"]; ElMain: typeof import("element-plus/es")["ElMain"]; ElMenu: typeof import("element-plus/es")["ElMenu"]; ElMenuItem: typeof import("element-plus/es")["ElMenuItem"]; @@ -43,6 +43,7 @@ declare module "vue" { ElTabPane: typeof import("element-plus/es")["ElTabPane"]; ElTabs: typeof import("element-plus/es")["ElTabs"]; ElTag: typeof import("element-plus/es")["ElTag"]; + ElTooltip: typeof import("element-plus/es")["ElTooltip"]; Empty: typeof import("./components/ProTable/components/Empty.vue")["default"]; Form: typeof import("./components/Form/index.vue")["default"]; FormItem: typeof import("./components/Form/components/FormItem.vue")["default"]; @@ -55,7 +56,6 @@ declare module "vue" { IEpFullScreen: typeof import("~icons/ep/full-screen")["default"]; IEpRefresh: typeof import("~icons/ep/refresh")["default"]; IEpRemove: typeof import("~icons/ep/remove")["default"]; - IEpSearch: typeof import("~icons/ep/search")["default"]; IEpSwitchButton: typeof import("~icons/ep/switch-button")["default"]; ImportExcel: typeof import("./components/ImportExcel/index.vue")["default"]; Loading: typeof import("./components/Loading/index.vue")["default"]; diff --git a/src/views/export/list/index.vue b/src/views/export/list/index.vue index fad9b30..893f516 100644 --- a/src/views/export/list/index.vue +++ b/src/views/export/list/index.vue @@ -30,7 +30,7 @@ :href="scope.row.download_url" v-if=" scope.row.status == 1 && - Math.abs((new Date(scope.row.date).getTime() - new Date().getTime()) / (24 * 60 * 60 * 1000)) <= 7 + Math.abs((new Date(scope.row.created_at).getTime() - new Date().getTime()) / (24 * 60 * 60 * 1000)) <= 7 " >下载 diff --git a/src/views/foundation/set/material/index.vue b/src/views/foundation/set/material/index.vue index 39707da..50c8d63 100644 --- a/src/views/foundation/set/material/index.vue +++ b/src/views/foundation/set/material/index.vue @@ -66,7 +66,12 @@ const selectionChange = (selection: any) => { }; const handleButtonClickCallback = (item: any) => { const { type } = item; - btnClick[type](item, dataStore.selectionList, proTableRef); + // dataStore.selectionList, proTableRef + btnClick[type]({ + selectionList: dataStore.selectionList, + proTableRef, + initParam: dataStore.initParam + }); }; //搜索 diff --git a/src/views/foundation/set/material/init/btnClick.ts b/src/views/foundation/set/material/init/btnClick.ts index 177c470..bbd1a82 100644 --- a/src/views/foundation/set/material/init/btnClick.ts +++ b/src/views/foundation/set/material/init/btnClick.ts @@ -1,38 +1,21 @@ -import { getMaterialListReloadApi } from "@/api/modules/foundationMaterial"; +import { getMaterialListReloadApi, getMaterialListExportApi } from "@/api/modules/foundationMaterial"; import { useMsg } from "@/hooks/useMsg"; -//getMaterialListResetApi -// 直接导出函数,无需额外包装对象 -export const handleExport = (item: any, selectionList: any[], proTable: any) => { - console.log("导出操作", item); - console.log(selectionList, "=selectionList="); - let length = selectionList.length; - if (!length) { - useMsg("warning", "请选择需要删除的数据!"); - return; + +// 导出 +export const handleExport = async (params: any) => { + const { initParam } = params; + const result = await getMaterialListExportApi(initParam); + if (result?.code === 0) { + useMsg("success", "导出成功 !"); } - ElMessageBox.confirm("您确定进行删除操作吗?", "温馨提示", { - confirmButtonText: "确定", - cancelButtonText: "取消", - type: "warning" - }) - .then(async () => { - proTable.value!.getTableList(); - // const result = await commitListApi(); - // if (result.status === 200) { - // useMsg("success", "删除成功 !"); - // } else { - // useMsg("error", result.message); - // } - }) - .catch(() => {}); }; -// proTable: any getMaterialListReloadApi -export const handleReload = async (item: any, selectionList: any[], proTable: any) => { - console.log("刷新操作", item); +//刷新 +export const handleReload = async (params: any) => { + const { selectionList, proTable } = params; let length = selectionList.length; let ids: any = []; if (length && length > 100) { - useMsg("warning", "选中刷新数据最大100条!"); + useMsg("warning", "选中刷新数据最大100条 !"); return; } selectionList.forEach((item: any) => { diff --git a/src/views/foundation/subscribe/warehousing/constant/list/button.ts b/src/views/foundation/subscribe/warehousing/constant/list/button.ts index 02bdc81..4d10ecf 100644 --- a/src/views/foundation/subscribe/warehousing/constant/list/button.ts +++ b/src/views/foundation/subscribe/warehousing/constant/list/button.ts @@ -2,7 +2,7 @@ export const BUTTON = [ { text: "导出", permission: "foundationSubscribeWarehousingBtnExport", - type: "add", + type: "export", props: { type: "primary" } diff --git a/src/views/foundation/subscribe/warehousing/index.vue b/src/views/foundation/subscribe/warehousing/index.vue index 35c08d2..ab9f246 100644 --- a/src/views/foundation/subscribe/warehousing/index.vue +++ b/src/views/foundation/subscribe/warehousing/index.vue @@ -73,7 +73,11 @@ const selectionChange = (selection: any) => { }; const handleButtonClickCallback = (item: any) => { const { type } = item; - btnClick[type](item, dataStore.selectionList, proTable); + btnClick[type]({ + selectionList: dataStore.selectionList, + proTable, + initParam: dataStore.initParam + }); }; //搜索 const handleSearch = async (params: any) => { diff --git a/src/views/foundation/subscribe/warehousing/init/btnClick.ts b/src/views/foundation/subscribe/warehousing/init/btnClick.ts index 0eba86d..0f47ca9 100644 --- a/src/views/foundation/subscribe/warehousing/init/btnClick.ts +++ b/src/views/foundation/subscribe/warehousing/init/btnClick.ts @@ -1,29 +1,12 @@ import { useMsg } from "@/hooks/useMsg"; -import { getSubscribeResetListApi } from "@/api/modules/warehousing"; -// 直接导出函数,无需额外包装对象 -export const handleDel = (item: any, selectionList: any[], proTable: any) => { - console.log("导出操作", item); - console.log(selectionList, "=selectionList="); - let length = selectionList.length; - if (!length) { - useMsg("warning", "请选择需要删除的数据!"); - return; +import { getSubscribeResetListApi, getSubscribeResetListExportApi } from "@/api/modules/warehousing"; +// 导出 +export const handleExport = async (params: any) => { + const { initParam } = params; + const result = await getSubscribeResetListExportApi(initParam); + if (result?.code === 0) { + useMsg("success", "导出成功 !"); } - ElMessageBox.confirm("您确定进行删除操作吗?", "温馨提示", { - confirmButtonText: "确定", - cancelButtonText: "取消", - type: "warning" - }) - .then(async () => { - proTable.value!.getTableList(); - // const result = await commitListApi(); - // if (result.status === 200) { - // useMsg("success", "删除成功 !"); - // } else { - // useMsg("error", result.message); - // } - }) - .catch(() => {}); }; // proTable: any export const handleReSet = async (item: any, selectionList: any[], proTable: any) => { @@ -47,6 +30,6 @@ export const handleReSet = async (item: any, selectionList: any[], proTable: any }; export const btnClick: any = { - del: handleDel, + export: handleExport, reset: handleReSet };