From 711d323e462e198fb0859f7b98396819330b297c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=B7=BB=E7=A0=96-JAVA=5CAdministrator?= <591141169@qq.com>
Date: Thu, 9 May 2024 13:10:27 +0800
Subject: [PATCH] =?UTF-8?q?BUG=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/eam/basic/item/index.ts | 5 +++
src/api/eam/basic/location/index.ts | 5 +++
src/api/eam/basic/locationArea/index.ts | 5 +++
src/views/eam/basic/item/index.vue | 37 +++++++++++++++++----
src/views/eam/basic/location/index.vue | 23 +++++++++++++
src/views/eam/basic/locationArea/index.vue | 38 +++++++++++++---------
6 files changed, 92 insertions(+), 21 deletions(-)
diff --git a/src/api/eam/basic/item/index.ts b/src/api/eam/basic/item/index.ts
index 35d3e10..122c879 100644
--- a/src/api/eam/basic/item/index.ts
+++ b/src/api/eam/basic/item/index.ts
@@ -78,3 +78,8 @@ export const getItemList = async (params) => {
export const getItemNoPage = async (params) => {
return await request.get({ url: `/eam/item/noPage`, params })
}
+
+// 下载用户导入模板
+export const importTemplate = () => {
+ return request.download({ url: '/eam/item/get-import-template' })
+}
diff --git a/src/api/eam/basic/location/index.ts b/src/api/eam/basic/location/index.ts
index 1ef6513..9fd7bf0 100644
--- a/src/api/eam/basic/location/index.ts
+++ b/src/api/eam/basic/location/index.ts
@@ -52,3 +52,8 @@ export const exportLocation = async (params) => {
export const getLocationNoPage = async (params) => {
return await request.get({ url: `/eam/location/noPage`, params })
}
+
+// 下载用户导入模板
+export const importTemplate = () => {
+ return request.download({ url: '/eam/location/get-import-template' })
+}
diff --git a/src/api/eam/basic/locationArea/index.ts b/src/api/eam/basic/locationArea/index.ts
index e1dd72e..124b0d9 100644
--- a/src/api/eam/basic/locationArea/index.ts
+++ b/src/api/eam/basic/locationArea/index.ts
@@ -46,3 +46,8 @@ export const exportLocationArea = async (params) => {
return await request.download({ url: `/eam/location-area/export-excel`, params })
}
+// 下载用户导入模板
+export const importTemplate = () => {
+ return request.download({ url: '/eam/location-area/get-import-template' })
+}
+
diff --git a/src/views/eam/basic/item/index.vue b/src/views/eam/basic/item/index.vue
index d5b29eb..afddda8 100644
--- a/src/views/eam/basic/item/index.vue
+++ b/src/views/eam/basic/item/index.vue
@@ -34,6 +34,9 @@
+
+
+
@@ -59,6 +62,7 @@
routeName.value = route.name
const itemNumber = ref();
const tableColumns = ref(Item.allSchemas.tableColumns)
+ const importFormRef = ref()
// 查询页面返回
const searchTableSuccess = (formField, searchField, val, formRef) => {
@@ -83,8 +87,9 @@
// 列表头部按钮
const HeadButttondata = [
- defaultButtons.defaultAddBtn({hasPermi:'basic:item:create'}), // 新增
- defaultButtons.defaultExportBtn({hasPermi:'basic:item:export'}), // 导出
+ defaultButtons.defaultAddBtn({ hasPermi: 'basic:item:create' }), // 新增
+ defaultButtons.defaultImportBtn(null), // 导入
+ defaultButtons.defaultExportBtn({ hasPermi: 'basic:item:export' }), // 导出
defaultButtons.defaultFreshBtn(null), // 刷新
defaultButtons.defaultFilterBtn(null), // 筛选
defaultButtons.defaultSetBtn(null), // 设置
@@ -94,6 +99,8 @@
const buttonBaseClick = (val, item) => {
if (val == 'add') { // 新增
openForm('create')
+ }else if (val == 'import') { // 导入
+ handleImport()
} else if (val == 'export') { // 导出
handleExport()
} else if (val == 'refresh') { // 刷新
@@ -106,9 +113,8 @@
// 列表-操作按钮
const butttondata = [
- defaultButtons.mainListEditBtn({hasPermi:'basic:item:update'}), // 编辑
- defaultButtons.chooseDeviceBtn({hasPermi:'basic:item:choose'}),//备件
- defaultButtons.mainListDeleteBtn({hasPermi:'basic:item:delete'}), // 删除
+ defaultButtons.mainListEditBtn({ hasPermi: 'basic:item:update' }), // 编辑
+ defaultButtons.mainListDeleteBtn({ hasPermi: 'basic:item:delete' }), // 删除
]
// 列表-操作按钮事件
@@ -233,7 +239,26 @@
exportLoading.value = false
}
}
-
+
+ onMounted(async () => {
+ importTemplateData.templateUrl = await ItemApi.importTemplate()
+ })
+
+ const handleImport = () => {
+ importFormRef.value.open()
+ }
+
+ // 导入附件弹窗所需的参数
+ const importTemplateData = reactive({
+ templateUrl: '',
+ templateTitle: '物料导入模版.xlsx'
+ })
+
+ // 导入成功之后
+ const importSuccess = () => {
+ getList()
+ }
+
// 筛选提交
const searchFormClick = (searchData) => {
tableObject.params = {
diff --git a/src/views/eam/basic/location/index.vue b/src/views/eam/basic/location/index.vue
index df9c4b3..13ab787 100644
--- a/src/views/eam/basic/location/index.vue
+++ b/src/views/eam/basic/location/index.vue
@@ -56,6 +56,7 @@
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(Location.allSchemas.tableColumns)
+ const importFormRef = ref()
// 查询页面返回
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
@@ -89,6 +90,7 @@
// 列表头部按钮
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'basic:location:create'}), // 新增
+ defaultButtons.defaultImportBtn(null), // 导入
defaultButtons.defaultExportBtn({hasPermi:'basic:location:update'}), // 导出
defaultButtons.defaultFreshBtn(null), // 刷新
defaultButtons.defaultFilterBtn(null), // 筛选
@@ -107,6 +109,8 @@
const buttonBaseClick = (val, item) => {
if (val == 'add') { // 新增
openForm('create')
+ }else if (val == 'import') { // 导入
+ handleImport()
} else if (val == 'export') { // 导出
handleExport()
} else if (val == 'refresh') { // 刷新
@@ -200,6 +204,25 @@
exportLoading.value = false
}
}
+
+ onMounted(async () => {
+ importTemplateData.templateUrl = await LocationApi.importTemplate()
+ })
+
+ const handleImport = () => {
+ importFormRef.value.open()
+ }
+
+ // 导入附件弹窗所需的参数
+ const importTemplateData = reactive({
+ templateUrl: '',
+ templateTitle: '库位导入模版.xlsx'
+ })
+
+ // 导入成功之后
+ const importSuccess = () => {
+ getList()
+ }
// 筛选提交
const searchFormClick = (searchData) => {
diff --git a/src/views/eam/basic/locationArea/index.vue b/src/views/eam/basic/locationArea/index.vue
index 8f40c3c..d534733 100644
--- a/src/views/eam/basic/locationArea/index.vue
+++ b/src/views/eam/basic/locationArea/index.vue
@@ -35,7 +35,7 @@
-
+
@@ -57,6 +57,7 @@
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(LocationArea.allSchemas.tableColumns)
+ const importFormRef = ref()
// 字段设置 更新主列表字段
const updataTableColumns = (val) => {
@@ -83,6 +84,7 @@
// 列表头部按钮
const HeadButttondata = [
defaultButtons.defaultAddBtn({hasPermi:'basic:locationArea:create'}), // 新增
+ defaultButtons.defaultImportBtn(null), // 导入
defaultButtons.defaultExportBtn({hasPermi:'basic:locationArea:export'}), // 导出
defaultButtons.defaultFreshBtn(null), // 刷新
defaultButtons.defaultFilterBtn(null), // 筛选
@@ -101,6 +103,8 @@
const buttonBaseClick = (val, item) => {
if (val == 'add') { // 新增
openForm('create')
+ }else if (val == 'import') { // 导入
+ handleImport()
} else if (val == 'export') { // 导出
handleExport()
} else if (val == 'refresh') { // 刷新
@@ -206,20 +210,24 @@
}
}
- /** 导入 */
- const importFormRef = ref()
- const handleImport = () => {
- importFormRef.value.open()
- }
- // 导入附件弹窗所需的参数
- const importTemplateData = reactive({
- templateUrl: '',
- templateTitle: '库区导入模版.xlsx'
- })
- // 导入成功之后
- const importSuccess = () => {
- getList()
- }
+ onMounted(async () => {
+ importTemplateData.templateUrl = await LocationAreaApi.importTemplate()
+ })
+
+ const handleImport = () => {
+ importFormRef.value.open()
+ }
+
+ // 导入附件弹窗所需的参数
+ const importTemplateData = reactive({
+ templateUrl: '',
+ templateTitle: '库区导入模版.xlsx'
+ })
+
+ // 导入成功之后
+ const importSuccess = () => {
+ getList()
+ }
// 筛选提交
const searchFormClick = (searchData) => {