From ff6f05df84c223f6df7676f1ffd2a5da09813c18 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?ZanGe=E4=B8=B6?= <385454831@qq.com>
Date: Sat, 4 Nov 2023 18:28:59 +0800
Subject: [PATCH] =?UTF-8?q?=E3=80=90crm:=E4=BA=A7=E5=93=81=E5=8F=8A?=
=?UTF-8?q?=E4=BA=A7=E5=93=81=E5=88=86=E7=B1=BB=E3=80=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/crm/product/index.ts | 43 +++
src/api/crm/productCategory/index.ts | 32 +++
src/utils/dict.ts | 3 +-
src/views/crm/product/ProductDetail.vue | 70 +++++
src/views/crm/product/ProductForm.vue | 184 ++++++++++++
src/views/crm/product/index.vue | 269 ++++++++++++++++++
.../productCategory/ProductCategoryForm.vue | 110 +++++++
src/views/crm/productCategory/index.vue | 137 +++++++++
8 files changed, 847 insertions(+), 1 deletion(-)
create mode 100644 src/api/crm/product/index.ts
create mode 100644 src/api/crm/productCategory/index.ts
create mode 100644 src/views/crm/product/ProductDetail.vue
create mode 100644 src/views/crm/product/ProductForm.vue
create mode 100644 src/views/crm/product/index.vue
create mode 100644 src/views/crm/productCategory/ProductCategoryForm.vue
create mode 100644 src/views/crm/productCategory/index.vue
diff --git a/src/api/crm/product/index.ts b/src/api/crm/product/index.ts
new file mode 100644
index 00000000..cb1ddcda
--- /dev/null
+++ b/src/api/crm/product/index.ts
@@ -0,0 +1,43 @@
+import request from '@/config/axios'
+
+export interface ProductVO {
+ id: number
+ name: string
+ no: string
+ unit: string
+ price: number
+ status: number
+ categoryId: number
+ description: string
+ ownerUserId: number
+}
+
+// 查询产品列表
+export const getProductPage = async (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 })
+}
+
+// 新增产品
+export const createProduct = async (data: ProductVO) => {
+ return await request.post({ url: `/crm/product/create`, data })
+}
+
+// 修改产品
+export const updateProduct = async (data: ProductVO) => {
+ 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 })
+}
+
+// 导出产品 Excel
+export const exportProduct = async (params) => {
+ return await request.download({ url: `/crm/product/export-excel`, params })
+}
diff --git a/src/api/crm/productCategory/index.ts b/src/api/crm/productCategory/index.ts
new file mode 100644
index 00000000..cdf8a966
--- /dev/null
+++ b/src/api/crm/productCategory/index.ts
@@ -0,0 +1,32 @@
+import request from '@/config/axios'
+
+export interface ProductCategoryVO {
+ id: number
+ name: string
+ parentId: number
+}
+
+// 查询产品分类详情
+export const getProductCategory = async (id: number) => {
+ return await request.get({ url: `/crm/product-category/get?id=` + id })
+}
+
+// 新增产品分类
+export const createProductCategory = async (data: ProductCategoryVO) => {
+ return await request.post({ url: `/crm/product-category/create`, data })
+}
+
+// 修改产品分类
+export const updateProductCategory = async (data: ProductCategoryVO) => {
+ return await request.put({ url: `/crm/product-category/update`, data })
+}
+
+// 删除产品分类
+export const deleteProductCategory = async (id: number) => {
+ return await request.delete({ url: `/crm/product-category/delete?id=` + id })
+}
+
+// 产品分类列表
+export const getProductCategoryList = async (params) => {
+ return await request.get({ url: `/crm/product-category/list`, params })
+}
diff --git a/src/utils/dict.ts b/src/utils/dict.ts
index 85e08e67..c059612a 100644
--- a/src/utils/dict.ts
+++ b/src/utils/dict.ts
@@ -191,5 +191,6 @@ export enum DICT_TYPE {
CRM_RETURN_TYPE = 'crm_return_type',
CRM_CUSTOMER_INDUSTRY = 'crm_customer_industry',
CRM_CUSTOMER_LEVEL = 'crm_customer_level',
- CRM_CUSTOMER_SOURCE = 'crm_customer_source'
+ CRM_CUSTOMER_SOURCE = 'crm_customer_source',
+ CRM_PRODUCT_STATUS = 'crm_product_status'
}
diff --git a/src/views/crm/product/ProductDetail.vue b/src/views/crm/product/ProductDetail.vue
new file mode 100644
index 00000000..f14e571a
--- /dev/null
+++ b/src/views/crm/product/ProductDetail.vue
@@ -0,0 +1,70 @@
+
+
+
+
diff --git a/src/views/crm/product/ProductForm.vue b/src/views/crm/product/ProductForm.vue
new file mode 100644
index 00000000..78d2a7c1
--- /dev/null
+++ b/src/views/crm/product/ProductForm.vue
@@ -0,0 +1,184 @@
+
+
+
+
diff --git a/src/views/crm/product/index.vue b/src/views/crm/product/index.vue
new file mode 100644
index 00000000..122f964d
--- /dev/null
+++ b/src/views/crm/product/index.vue
@@ -0,0 +1,269 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+ 重置
+
+ 新增
+
+
+ 导出
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ fenToYuan(row.price) }}
+
+
+
+
+
+
+
+
+
+ {{ productCategoryList?.find((c) => c.id === row.categoryId)?.name }}
+
+
+
+
+
+ {{ userList?.find((c) => c.id === row.ownerUserId)?.nickname }}
+
+
+
+
+
+
+ 详情
+
+
+ 编辑
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/crm/productCategory/ProductCategoryForm.vue b/src/views/crm/productCategory/ProductCategoryForm.vue
new file mode 100644
index 00000000..22cd09a8
--- /dev/null
+++ b/src/views/crm/productCategory/ProductCategoryForm.vue
@@ -0,0 +1,110 @@
+
+
+
+
diff --git a/src/views/crm/productCategory/index.vue b/src/views/crm/productCategory/index.vue
new file mode 100644
index 00000000..3cf7c5f0
--- /dev/null
+++ b/src/views/crm/productCategory/index.vue
@@ -0,0 +1,137 @@
+
+
+
+
+
+
+
+
+ 搜索
+ 重置
+
+ 新增
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 编辑
+
+
+ 删除
+
+
+
+
+
+
+
+
+
+
+