From 4f89eb6ba9d832ad616c98c36b74c982f1a31787 Mon Sep 17 00:00:00 2001
From: anhaohao <1036606149@qq.com>
Date: Thu, 11 Jan 2024 17:51:45 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E4=BA=A7=E5=93=81?=
=?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/crm/product/index.ts | 17 ++--
src/router/modules/remaining.ts | 10 +++
src/views/crm/product/ProductDetail.vue | 71 ----------------
src/views/crm/product/ProductForm.vue | 36 ++++----
.../product/detail/ProductDetailsHeader.vue | 56 ++++++++++++
.../crm/product/detail/ProductDetailsInfo.vue | 45 ++++++++++
src/views/crm/product/detail/index.vue | 64 ++++++++++++++
src/views/crm/product/index.vue | 85 +++++++++++--------
8 files changed, 253 insertions(+), 131 deletions(-)
delete mode 100644 src/views/crm/product/ProductDetail.vue
create mode 100644 src/views/crm/product/detail/ProductDetailsHeader.vue
create mode 100644 src/views/crm/product/detail/ProductDetailsInfo.vue
create mode 100644 src/views/crm/product/detail/index.vue
diff --git a/src/api/crm/product/index.ts b/src/api/crm/product/index.ts
index c6d5dfdb..a89d6e81 100644
--- a/src/api/crm/product/index.ts
+++ b/src/api/crm/product/index.ts
@@ -14,30 +14,35 @@ export interface ProductVO {
// 查询产品列表
export const getProductPage = async (params) => {
- return await request.get({ url: `/crm/product/page`, params })
+ return await request.get({url: `/crm/product/page`, params})
}
// 查询产品详情
export const getProduct = async (id: number) => {
- return await request.get({ url: `/crm/product/get?id=` + id })
+ return await request.get({url: `/crm/product/get?id=` + id})
}
// 新增产品
export const createProduct = async (data: ProductVO) => {
- return await request.post({ url: `/crm/product/create`, data })
+ return await request.post({url: `/crm/product/create`, data})
}
// 修改产品
export const updateProduct = async (data: ProductVO) => {
- return await request.put({ url: `/crm/product/update`, data })
+ return await request.put({url: `/crm/product/update`, data})
}
// 删除产品
export const deleteProduct = async (id: number) => {
- return await request.delete({ url: `/crm/product/delete?id=` + id })
+ return await request.delete({url: `/crm/product/delete?id=` + id})
}
// 导出产品 Excel
export const exportProduct = async (params) => {
- return await request.download({ url: `/crm/product/export-excel`, params })
+ return await request.download({url: `/crm/product/export-excel`, params})
+}
+
+// 查询产品操作日志
+export const getOperateLogPage = async (params: any) => {
+ return await request.get({url: '/crm/product/operate-log-page', params})
}
diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts
index a562ea85..639fae36 100644
--- a/src/router/modules/remaining.ts
+++ b/src/router/modules/remaining.ts
@@ -517,6 +517,16 @@ const remainingRouter: AppRouteRecordRaw[] = [
hidden: true
},
component: () => import('@/views/crm/contact/detail/index.vue')
+ },
+ {
+ path: 'product/detail/:id',
+ name: 'CrmProductDetail',
+ meta: {
+ title: '产品详情',
+ noCache: true,
+ hidden: true
+ },
+ component: () => import('@/views/crm/product/detail/index.vue')
}
]
}
diff --git a/src/views/crm/product/ProductDetail.vue b/src/views/crm/product/ProductDetail.vue
deleted file mode 100644
index f2638df0..00000000
--- a/src/views/crm/product/ProductDetail.vue
+++ /dev/null
@@ -1,71 +0,0 @@
-
-
-
-
diff --git a/src/views/crm/product/ProductForm.vue b/src/views/crm/product/ProductForm.vue
index 0864c8d8..74dc7662 100644
--- a/src/views/crm/product/ProductForm.vue
+++ b/src/views/crm/product/ProductForm.vue
@@ -10,7 +10,7 @@
-
+
@@ -57,7 +57,7 @@
-
+
@@ -74,7 +74,7 @@
-
+
@@ -98,17 +98,17 @@
diff --git a/src/views/crm/product/detail/ProductDetailsInfo.vue b/src/views/crm/product/detail/ProductDetailsInfo.vue
new file mode 100644
index 00000000..85046b85
--- /dev/null
+++ b/src/views/crm/product/detail/ProductDetailsInfo.vue
@@ -0,0 +1,45 @@
+
+
+
+
+
+ 基本信息
+
+
+ {{ product.name }}
+ {{ product.no }}
+ {{ fenToYuan(product.price) }}元
+ {{ product.description }}
+
+ {{ productCategoryList?.find((c) => c.id === product.categoryId)?.name }}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/crm/product/detail/index.vue b/src/views/crm/product/detail/index.vue
new file mode 100644
index 00000000..9e84d2e5
--- /dev/null
+++ b/src/views/crm/product/detail/index.vue
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/crm/product/index.vue b/src/views/crm/product/index.vue
index 3f01455c..aa517c17 100644
--- a/src/views/crm/product/index.vue
+++ b/src/views/crm/product/index.vue
@@ -28,10 +28,17 @@
- 搜索
- 重置
+
+
+ 搜索
+
+
+
+ 重置
+
- 新增
+
+ 新增
- 导出
+
+ 导出
@@ -49,27 +57,33 @@
-
-
-
+
-
+
+ {{ scope.row.name }}
+
-
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
- 详情
-
-
-
-
+