diff --git a/src/api/customer/customer.ts b/src/api/customer/customer.ts new file mode 100644 index 0000000..cb41f8c --- /dev/null +++ b/src/api/customer/customer.ts @@ -0,0 +1,60 @@ +/** + * 溯源供方请求接口 + */ +import request from '../index' +import type { ICustomerQuery } from '@/views/customer/customerInfo/customer_interface' +const prefix = '/meter' + +// 列表查询 +export function getCustomerList(data: ICustomerQuery) { + return request({ + url: `${prefix}/supplier/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 数据删除 +export function deleteCustomer(data: { id: string }) { + return request({ + url: `${prefix}/supplier/delete`, + method: 'post', + data, + }) +} + +// 查看详情 +export function getCustomerDetail(data: { id: string }) { + return request({ + url: `${prefix}/supplier/detail`, + method: 'post', + data, + }) +} + +// 提交数据 +export function addCustomer(data: object) { + return request({ + url: '/meter/supplier/submit', + method: 'post', + data, + }) +} +// 更新数据 +export function updateCustomer(data: object) { + return request({ + url: `${prefix}/supplier/update`, + method: 'post', + data, + }) +} + +// 导出列表 +export function exportCustomerList(data: Omit) { + return request({ + url: `${prefix}/supplier/listExport`, + method: 'post', + responseType: 'blob', + data, + }) +} diff --git a/src/api/customer/customer.ts b/src/api/customer/customer.ts new file mode 100644 index 0000000..cb41f8c --- /dev/null +++ b/src/api/customer/customer.ts @@ -0,0 +1,60 @@ +/** + * 溯源供方请求接口 + */ +import request from '../index' +import type { ICustomerQuery } from '@/views/customer/customerInfo/customer_interface' +const prefix = '/meter' + +// 列表查询 +export function getCustomerList(data: ICustomerQuery) { + return request({ + url: `${prefix}/supplier/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 数据删除 +export function deleteCustomer(data: { id: string }) { + return request({ + url: `${prefix}/supplier/delete`, + method: 'post', + data, + }) +} + +// 查看详情 +export function getCustomerDetail(data: { id: string }) { + return request({ + url: `${prefix}/supplier/detail`, + method: 'post', + data, + }) +} + +// 提交数据 +export function addCustomer(data: object) { + return request({ + url: '/meter/supplier/submit', + method: 'post', + data, + }) +} +// 更新数据 +export function updateCustomer(data: object) { + return request({ + url: `${prefix}/supplier/update`, + method: 'post', + data, + }) +} + +// 导出列表 +export function exportCustomerList(data: Omit) { + return request({ + url: `${prefix}/supplier/listExport`, + method: 'post', + responseType: 'blob', + data, + }) +} diff --git a/src/router/modules/customer.ts b/src/router/modules/customer.ts new file mode 100644 index 0000000..58dde63 --- /dev/null +++ b/src/router/modules/customer.ts @@ -0,0 +1,123 @@ +import type { Route } from '@/global' + +const Layout = () => import('@/layouts/index.vue') + +const routes: Route.recordRaw[] = [ + { + path: '/customer', + component: Layout, + redirect: '/customer/bench', + name: 'CustomerBench', + meta: { + title: '工作台', + icon: 'ep:key', + auth: '/customer/bench', + }, + children: [ + { + path: 'bench', + name: 'CustomerBenchPage', + component: () => import('@/views/measure/bench/bench.vue'), + meta: { + title: '工作台', + auth: '/customer/bench', + sidebar: false, + breadcrumb: true, + activeMenu: '/customer', + }, + }, + ], + }, + { + path: '/sample', + component: Layout, + redirect: '/sample/list', + name: 'File', + meta: { + title: '样品库', + icon: 'ep:key', + auth: '/sample', + }, + children: [ + { + path: 'list', + name: 'SampleList', + component: () => import('@/views/measure/file/quality.vue'), + meta: { + title: '样品列表', + icon: 'ep:key', + auth: '/sample/list', + }, + }, + { + path: 'overtime', + name: 'OvertimeSample', + component: () => import('@/views/measure/file/rules.vue'), + meta: { + title: '到期样品', + icon: 'ep:key', + auth: '/sample/overtime', + }, + }, + ], + }, + { + path: '/customerManage', + component: Layout, + redirect: '/customerManage/list', + name: 'MeasureSource', + meta: { + title: '客户管理', + icon: 'ep:key', + auth: '/customer/manage', + }, + children: [ + { + path: 'list', + name: 'CustomerList', + component: () => import('@/views/customer/customerInfo/customerList.vue'), + meta: { + title: '客户列表', + icon: 'ep:key', + auth: '/customer/list', + }, + }, + { + path: ':type/:id?', + name: 'CustomerDetail', + component: () => import('@/views/customer/customerInfo/customerEdit.vue'), + meta: { + title: '客户详情', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/customerManage/list', + }, + }, + { + path: 'advice', + name: 'CustomerAdvice', + component: () => import('@/views/customer/adviceList.vue'), + meta: { + title: '客户关系', + icon: 'ep:key', + auth: '/customer/advice', + }, + }, + { + path: 'advice/:type/:id?', + name: 'CustomerAdviceDetail', + component: () => import('@/views/customer/advice/adviceEdit.vue'), + meta: { + title: '客户关系详情', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/source/approve', + }, + }, + ], + }, +] + +export default routes diff --git a/src/api/customer/customer.ts b/src/api/customer/customer.ts new file mode 100644 index 0000000..cb41f8c --- /dev/null +++ b/src/api/customer/customer.ts @@ -0,0 +1,60 @@ +/** + * 溯源供方请求接口 + */ +import request from '../index' +import type { ICustomerQuery } from '@/views/customer/customerInfo/customer_interface' +const prefix = '/meter' + +// 列表查询 +export function getCustomerList(data: ICustomerQuery) { + return request({ + url: `${prefix}/supplier/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 数据删除 +export function deleteCustomer(data: { id: string }) { + return request({ + url: `${prefix}/supplier/delete`, + method: 'post', + data, + }) +} + +// 查看详情 +export function getCustomerDetail(data: { id: string }) { + return request({ + url: `${prefix}/supplier/detail`, + method: 'post', + data, + }) +} + +// 提交数据 +export function addCustomer(data: object) { + return request({ + url: '/meter/supplier/submit', + method: 'post', + data, + }) +} +// 更新数据 +export function updateCustomer(data: object) { + return request({ + url: `${prefix}/supplier/update`, + method: 'post', + data, + }) +} + +// 导出列表 +export function exportCustomerList(data: Omit) { + return request({ + url: `${prefix}/supplier/listExport`, + method: 'post', + responseType: 'blob', + data, + }) +} diff --git a/src/router/modules/customer.ts b/src/router/modules/customer.ts new file mode 100644 index 0000000..58dde63 --- /dev/null +++ b/src/router/modules/customer.ts @@ -0,0 +1,123 @@ +import type { Route } from '@/global' + +const Layout = () => import('@/layouts/index.vue') + +const routes: Route.recordRaw[] = [ + { + path: '/customer', + component: Layout, + redirect: '/customer/bench', + name: 'CustomerBench', + meta: { + title: '工作台', + icon: 'ep:key', + auth: '/customer/bench', + }, + children: [ + { + path: 'bench', + name: 'CustomerBenchPage', + component: () => import('@/views/measure/bench/bench.vue'), + meta: { + title: '工作台', + auth: '/customer/bench', + sidebar: false, + breadcrumb: true, + activeMenu: '/customer', + }, + }, + ], + }, + { + path: '/sample', + component: Layout, + redirect: '/sample/list', + name: 'File', + meta: { + title: '样品库', + icon: 'ep:key', + auth: '/sample', + }, + children: [ + { + path: 'list', + name: 'SampleList', + component: () => import('@/views/measure/file/quality.vue'), + meta: { + title: '样品列表', + icon: 'ep:key', + auth: '/sample/list', + }, + }, + { + path: 'overtime', + name: 'OvertimeSample', + component: () => import('@/views/measure/file/rules.vue'), + meta: { + title: '到期样品', + icon: 'ep:key', + auth: '/sample/overtime', + }, + }, + ], + }, + { + path: '/customerManage', + component: Layout, + redirect: '/customerManage/list', + name: 'MeasureSource', + meta: { + title: '客户管理', + icon: 'ep:key', + auth: '/customer/manage', + }, + children: [ + { + path: 'list', + name: 'CustomerList', + component: () => import('@/views/customer/customerInfo/customerList.vue'), + meta: { + title: '客户列表', + icon: 'ep:key', + auth: '/customer/list', + }, + }, + { + path: ':type/:id?', + name: 'CustomerDetail', + component: () => import('@/views/customer/customerInfo/customerEdit.vue'), + meta: { + title: '客户详情', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/customerManage/list', + }, + }, + { + path: 'advice', + name: 'CustomerAdvice', + component: () => import('@/views/customer/adviceList.vue'), + meta: { + title: '客户关系', + icon: 'ep:key', + auth: '/customer/advice', + }, + }, + { + path: 'advice/:type/:id?', + name: 'CustomerAdviceDetail', + component: () => import('@/views/customer/advice/adviceEdit.vue'), + meta: { + title: '客户关系详情', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/source/approve', + }, + }, + ], + }, +] + +export default routes diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 73a7470..855c6fa 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -4,10 +4,10 @@ const routes: Route.recordRaw[] = [ { - path: '/bench', + path: '/measure', component: Layout, - redirect: '/bench/list', - name: 'Bench', + redirect: '/measure/bench', + name: 'MeasureBench', meta: { title: '工作台', icon: 'ep:key', @@ -15,15 +15,15 @@ }, children: [ { - path: 'list', - name: 'BenchList', + path: 'bench', + name: 'MeasureBenchPage', component: () => import('@/views/measure/bench/bench.vue'), meta: { title: '工作台', auth: '/measure/bench', sidebar: false, breadcrumb: true, - activeMenu: '/bench', + activeMenu: '/measure', }, }, ], diff --git a/src/api/customer/customer.ts b/src/api/customer/customer.ts new file mode 100644 index 0000000..cb41f8c --- /dev/null +++ b/src/api/customer/customer.ts @@ -0,0 +1,60 @@ +/** + * 溯源供方请求接口 + */ +import request from '../index' +import type { ICustomerQuery } from '@/views/customer/customerInfo/customer_interface' +const prefix = '/meter' + +// 列表查询 +export function getCustomerList(data: ICustomerQuery) { + return request({ + url: `${prefix}/supplier/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 数据删除 +export function deleteCustomer(data: { id: string }) { + return request({ + url: `${prefix}/supplier/delete`, + method: 'post', + data, + }) +} + +// 查看详情 +export function getCustomerDetail(data: { id: string }) { + return request({ + url: `${prefix}/supplier/detail`, + method: 'post', + data, + }) +} + +// 提交数据 +export function addCustomer(data: object) { + return request({ + url: '/meter/supplier/submit', + method: 'post', + data, + }) +} +// 更新数据 +export function updateCustomer(data: object) { + return request({ + url: `${prefix}/supplier/update`, + method: 'post', + data, + }) +} + +// 导出列表 +export function exportCustomerList(data: Omit) { + return request({ + url: `${prefix}/supplier/listExport`, + method: 'post', + responseType: 'blob', + data, + }) +} diff --git a/src/router/modules/customer.ts b/src/router/modules/customer.ts new file mode 100644 index 0000000..58dde63 --- /dev/null +++ b/src/router/modules/customer.ts @@ -0,0 +1,123 @@ +import type { Route } from '@/global' + +const Layout = () => import('@/layouts/index.vue') + +const routes: Route.recordRaw[] = [ + { + path: '/customer', + component: Layout, + redirect: '/customer/bench', + name: 'CustomerBench', + meta: { + title: '工作台', + icon: 'ep:key', + auth: '/customer/bench', + }, + children: [ + { + path: 'bench', + name: 'CustomerBenchPage', + component: () => import('@/views/measure/bench/bench.vue'), + meta: { + title: '工作台', + auth: '/customer/bench', + sidebar: false, + breadcrumb: true, + activeMenu: '/customer', + }, + }, + ], + }, + { + path: '/sample', + component: Layout, + redirect: '/sample/list', + name: 'File', + meta: { + title: '样品库', + icon: 'ep:key', + auth: '/sample', + }, + children: [ + { + path: 'list', + name: 'SampleList', + component: () => import('@/views/measure/file/quality.vue'), + meta: { + title: '样品列表', + icon: 'ep:key', + auth: '/sample/list', + }, + }, + { + path: 'overtime', + name: 'OvertimeSample', + component: () => import('@/views/measure/file/rules.vue'), + meta: { + title: '到期样品', + icon: 'ep:key', + auth: '/sample/overtime', + }, + }, + ], + }, + { + path: '/customerManage', + component: Layout, + redirect: '/customerManage/list', + name: 'MeasureSource', + meta: { + title: '客户管理', + icon: 'ep:key', + auth: '/customer/manage', + }, + children: [ + { + path: 'list', + name: 'CustomerList', + component: () => import('@/views/customer/customerInfo/customerList.vue'), + meta: { + title: '客户列表', + icon: 'ep:key', + auth: '/customer/list', + }, + }, + { + path: ':type/:id?', + name: 'CustomerDetail', + component: () => import('@/views/customer/customerInfo/customerEdit.vue'), + meta: { + title: '客户详情', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/customerManage/list', + }, + }, + { + path: 'advice', + name: 'CustomerAdvice', + component: () => import('@/views/customer/adviceList.vue'), + meta: { + title: '客户关系', + icon: 'ep:key', + auth: '/customer/advice', + }, + }, + { + path: 'advice/:type/:id?', + name: 'CustomerAdviceDetail', + component: () => import('@/views/customer/advice/adviceEdit.vue'), + meta: { + title: '客户关系详情', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/source/approve', + }, + }, + ], + }, +] + +export default routes diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 73a7470..855c6fa 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -4,10 +4,10 @@ const routes: Route.recordRaw[] = [ { - path: '/bench', + path: '/measure', component: Layout, - redirect: '/bench/list', - name: 'Bench', + redirect: '/measure/bench', + name: 'MeasureBench', meta: { title: '工作台', icon: 'ep:key', @@ -15,15 +15,15 @@ }, children: [ { - path: 'list', - name: 'BenchList', + path: 'bench', + name: 'MeasureBenchPage', component: () => import('@/views/measure/bench/bench.vue'), meta: { title: '工作台', auth: '/measure/bench', sidebar: false, breadcrumb: true, - activeMenu: '/bench', + activeMenu: '/measure', }, }, ], diff --git a/src/router/routes.ts b/src/router/routes.ts index 4153ab5..5210ea6 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -5,6 +5,7 @@ import systemRoute from './modules/system' import measureRoute from './modules/measure' import deviceRoute from './modules/device' +import customerRoute from './modules/customer' import type { Route } from '@/global' import useSettingsStore from '@/store/modules/settings' @@ -164,12 +165,10 @@ meta: { title: '客户资源', icon: '', - // auth: 'khzy', - auth: '/well', + auth: '/customer', }, children: [ - MultilevelMenuExample, - BreadcrumbExample, + ...customerRoute, ], }, { diff --git a/src/api/customer/customer.ts b/src/api/customer/customer.ts new file mode 100644 index 0000000..cb41f8c --- /dev/null +++ b/src/api/customer/customer.ts @@ -0,0 +1,60 @@ +/** + * 溯源供方请求接口 + */ +import request from '../index' +import type { ICustomerQuery } from '@/views/customer/customerInfo/customer_interface' +const prefix = '/meter' + +// 列表查询 +export function getCustomerList(data: ICustomerQuery) { + return request({ + url: `${prefix}/supplier/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 数据删除 +export function deleteCustomer(data: { id: string }) { + return request({ + url: `${prefix}/supplier/delete`, + method: 'post', + data, + }) +} + +// 查看详情 +export function getCustomerDetail(data: { id: string }) { + return request({ + url: `${prefix}/supplier/detail`, + method: 'post', + data, + }) +} + +// 提交数据 +export function addCustomer(data: object) { + return request({ + url: '/meter/supplier/submit', + method: 'post', + data, + }) +} +// 更新数据 +export function updateCustomer(data: object) { + return request({ + url: `${prefix}/supplier/update`, + method: 'post', + data, + }) +} + +// 导出列表 +export function exportCustomerList(data: Omit) { + return request({ + url: `${prefix}/supplier/listExport`, + method: 'post', + responseType: 'blob', + data, + }) +} diff --git a/src/router/modules/customer.ts b/src/router/modules/customer.ts new file mode 100644 index 0000000..58dde63 --- /dev/null +++ b/src/router/modules/customer.ts @@ -0,0 +1,123 @@ +import type { Route } from '@/global' + +const Layout = () => import('@/layouts/index.vue') + +const routes: Route.recordRaw[] = [ + { + path: '/customer', + component: Layout, + redirect: '/customer/bench', + name: 'CustomerBench', + meta: { + title: '工作台', + icon: 'ep:key', + auth: '/customer/bench', + }, + children: [ + { + path: 'bench', + name: 'CustomerBenchPage', + component: () => import('@/views/measure/bench/bench.vue'), + meta: { + title: '工作台', + auth: '/customer/bench', + sidebar: false, + breadcrumb: true, + activeMenu: '/customer', + }, + }, + ], + }, + { + path: '/sample', + component: Layout, + redirect: '/sample/list', + name: 'File', + meta: { + title: '样品库', + icon: 'ep:key', + auth: '/sample', + }, + children: [ + { + path: 'list', + name: 'SampleList', + component: () => import('@/views/measure/file/quality.vue'), + meta: { + title: '样品列表', + icon: 'ep:key', + auth: '/sample/list', + }, + }, + { + path: 'overtime', + name: 'OvertimeSample', + component: () => import('@/views/measure/file/rules.vue'), + meta: { + title: '到期样品', + icon: 'ep:key', + auth: '/sample/overtime', + }, + }, + ], + }, + { + path: '/customerManage', + component: Layout, + redirect: '/customerManage/list', + name: 'MeasureSource', + meta: { + title: '客户管理', + icon: 'ep:key', + auth: '/customer/manage', + }, + children: [ + { + path: 'list', + name: 'CustomerList', + component: () => import('@/views/customer/customerInfo/customerList.vue'), + meta: { + title: '客户列表', + icon: 'ep:key', + auth: '/customer/list', + }, + }, + { + path: ':type/:id?', + name: 'CustomerDetail', + component: () => import('@/views/customer/customerInfo/customerEdit.vue'), + meta: { + title: '客户详情', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/customerManage/list', + }, + }, + { + path: 'advice', + name: 'CustomerAdvice', + component: () => import('@/views/customer/adviceList.vue'), + meta: { + title: '客户关系', + icon: 'ep:key', + auth: '/customer/advice', + }, + }, + { + path: 'advice/:type/:id?', + name: 'CustomerAdviceDetail', + component: () => import('@/views/customer/advice/adviceEdit.vue'), + meta: { + title: '客户关系详情', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/source/approve', + }, + }, + ], + }, +] + +export default routes diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 73a7470..855c6fa 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -4,10 +4,10 @@ const routes: Route.recordRaw[] = [ { - path: '/bench', + path: '/measure', component: Layout, - redirect: '/bench/list', - name: 'Bench', + redirect: '/measure/bench', + name: 'MeasureBench', meta: { title: '工作台', icon: 'ep:key', @@ -15,15 +15,15 @@ }, children: [ { - path: 'list', - name: 'BenchList', + path: 'bench', + name: 'MeasureBenchPage', component: () => import('@/views/measure/bench/bench.vue'), meta: { title: '工作台', auth: '/measure/bench', sidebar: false, breadcrumb: true, - activeMenu: '/bench', + activeMenu: '/measure', }, }, ], diff --git a/src/router/routes.ts b/src/router/routes.ts index 4153ab5..5210ea6 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -5,6 +5,7 @@ import systemRoute from './modules/system' import measureRoute from './modules/measure' import deviceRoute from './modules/device' +import customerRoute from './modules/customer' import type { Route } from '@/global' import useSettingsStore from '@/store/modules/settings' @@ -164,12 +165,10 @@ meta: { title: '客户资源', icon: '', - // auth: 'khzy', - auth: '/well', + auth: '/customer', }, children: [ - MultilevelMenuExample, - BreadcrumbExample, + ...customerRoute, ], }, { diff --git a/src/views/customer/advice/adviceEdit.vue b/src/views/customer/advice/adviceEdit.vue new file mode 100644 index 0000000..0dafa50 --- /dev/null +++ b/src/views/customer/advice/adviceEdit.vue @@ -0,0 +1,551 @@ + + + + + diff --git a/src/api/customer/customer.ts b/src/api/customer/customer.ts new file mode 100644 index 0000000..cb41f8c --- /dev/null +++ b/src/api/customer/customer.ts @@ -0,0 +1,60 @@ +/** + * 溯源供方请求接口 + */ +import request from '../index' +import type { ICustomerQuery } from '@/views/customer/customerInfo/customer_interface' +const prefix = '/meter' + +// 列表查询 +export function getCustomerList(data: ICustomerQuery) { + return request({ + url: `${prefix}/supplier/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 数据删除 +export function deleteCustomer(data: { id: string }) { + return request({ + url: `${prefix}/supplier/delete`, + method: 'post', + data, + }) +} + +// 查看详情 +export function getCustomerDetail(data: { id: string }) { + return request({ + url: `${prefix}/supplier/detail`, + method: 'post', + data, + }) +} + +// 提交数据 +export function addCustomer(data: object) { + return request({ + url: '/meter/supplier/submit', + method: 'post', + data, + }) +} +// 更新数据 +export function updateCustomer(data: object) { + return request({ + url: `${prefix}/supplier/update`, + method: 'post', + data, + }) +} + +// 导出列表 +export function exportCustomerList(data: Omit) { + return request({ + url: `${prefix}/supplier/listExport`, + method: 'post', + responseType: 'blob', + data, + }) +} diff --git a/src/router/modules/customer.ts b/src/router/modules/customer.ts new file mode 100644 index 0000000..58dde63 --- /dev/null +++ b/src/router/modules/customer.ts @@ -0,0 +1,123 @@ +import type { Route } from '@/global' + +const Layout = () => import('@/layouts/index.vue') + +const routes: Route.recordRaw[] = [ + { + path: '/customer', + component: Layout, + redirect: '/customer/bench', + name: 'CustomerBench', + meta: { + title: '工作台', + icon: 'ep:key', + auth: '/customer/bench', + }, + children: [ + { + path: 'bench', + name: 'CustomerBenchPage', + component: () => import('@/views/measure/bench/bench.vue'), + meta: { + title: '工作台', + auth: '/customer/bench', + sidebar: false, + breadcrumb: true, + activeMenu: '/customer', + }, + }, + ], + }, + { + path: '/sample', + component: Layout, + redirect: '/sample/list', + name: 'File', + meta: { + title: '样品库', + icon: 'ep:key', + auth: '/sample', + }, + children: [ + { + path: 'list', + name: 'SampleList', + component: () => import('@/views/measure/file/quality.vue'), + meta: { + title: '样品列表', + icon: 'ep:key', + auth: '/sample/list', + }, + }, + { + path: 'overtime', + name: 'OvertimeSample', + component: () => import('@/views/measure/file/rules.vue'), + meta: { + title: '到期样品', + icon: 'ep:key', + auth: '/sample/overtime', + }, + }, + ], + }, + { + path: '/customerManage', + component: Layout, + redirect: '/customerManage/list', + name: 'MeasureSource', + meta: { + title: '客户管理', + icon: 'ep:key', + auth: '/customer/manage', + }, + children: [ + { + path: 'list', + name: 'CustomerList', + component: () => import('@/views/customer/customerInfo/customerList.vue'), + meta: { + title: '客户列表', + icon: 'ep:key', + auth: '/customer/list', + }, + }, + { + path: ':type/:id?', + name: 'CustomerDetail', + component: () => import('@/views/customer/customerInfo/customerEdit.vue'), + meta: { + title: '客户详情', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/customerManage/list', + }, + }, + { + path: 'advice', + name: 'CustomerAdvice', + component: () => import('@/views/customer/adviceList.vue'), + meta: { + title: '客户关系', + icon: 'ep:key', + auth: '/customer/advice', + }, + }, + { + path: 'advice/:type/:id?', + name: 'CustomerAdviceDetail', + component: () => import('@/views/customer/advice/adviceEdit.vue'), + meta: { + title: '客户关系详情', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/source/approve', + }, + }, + ], + }, +] + +export default routes diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 73a7470..855c6fa 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -4,10 +4,10 @@ const routes: Route.recordRaw[] = [ { - path: '/bench', + path: '/measure', component: Layout, - redirect: '/bench/list', - name: 'Bench', + redirect: '/measure/bench', + name: 'MeasureBench', meta: { title: '工作台', icon: 'ep:key', @@ -15,15 +15,15 @@ }, children: [ { - path: 'list', - name: 'BenchList', + path: 'bench', + name: 'MeasureBenchPage', component: () => import('@/views/measure/bench/bench.vue'), meta: { title: '工作台', auth: '/measure/bench', sidebar: false, breadcrumb: true, - activeMenu: '/bench', + activeMenu: '/measure', }, }, ], diff --git a/src/router/routes.ts b/src/router/routes.ts index 4153ab5..5210ea6 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -5,6 +5,7 @@ import systemRoute from './modules/system' import measureRoute from './modules/measure' import deviceRoute from './modules/device' +import customerRoute from './modules/customer' import type { Route } from '@/global' import useSettingsStore from '@/store/modules/settings' @@ -164,12 +165,10 @@ meta: { title: '客户资源', icon: '', - // auth: 'khzy', - auth: '/well', + auth: '/customer', }, children: [ - MultilevelMenuExample, - BreadcrumbExample, + ...customerRoute, ], }, { diff --git a/src/views/customer/advice/adviceEdit.vue b/src/views/customer/advice/adviceEdit.vue new file mode 100644 index 0000000..0dafa50 --- /dev/null +++ b/src/views/customer/advice/adviceEdit.vue @@ -0,0 +1,551 @@ + + + + + diff --git a/src/views/customer/advice/adviceList.vue b/src/views/customer/advice/adviceList.vue new file mode 100644 index 0000000..e715bad --- /dev/null +++ b/src/views/customer/advice/adviceList.vue @@ -0,0 +1,278 @@ + + + + + diff --git a/src/api/customer/customer.ts b/src/api/customer/customer.ts new file mode 100644 index 0000000..cb41f8c --- /dev/null +++ b/src/api/customer/customer.ts @@ -0,0 +1,60 @@ +/** + * 溯源供方请求接口 + */ +import request from '../index' +import type { ICustomerQuery } from '@/views/customer/customerInfo/customer_interface' +const prefix = '/meter' + +// 列表查询 +export function getCustomerList(data: ICustomerQuery) { + return request({ + url: `${prefix}/supplier/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 数据删除 +export function deleteCustomer(data: { id: string }) { + return request({ + url: `${prefix}/supplier/delete`, + method: 'post', + data, + }) +} + +// 查看详情 +export function getCustomerDetail(data: { id: string }) { + return request({ + url: `${prefix}/supplier/detail`, + method: 'post', + data, + }) +} + +// 提交数据 +export function addCustomer(data: object) { + return request({ + url: '/meter/supplier/submit', + method: 'post', + data, + }) +} +// 更新数据 +export function updateCustomer(data: object) { + return request({ + url: `${prefix}/supplier/update`, + method: 'post', + data, + }) +} + +// 导出列表 +export function exportCustomerList(data: Omit) { + return request({ + url: `${prefix}/supplier/listExport`, + method: 'post', + responseType: 'blob', + data, + }) +} diff --git a/src/router/modules/customer.ts b/src/router/modules/customer.ts new file mode 100644 index 0000000..58dde63 --- /dev/null +++ b/src/router/modules/customer.ts @@ -0,0 +1,123 @@ +import type { Route } from '@/global' + +const Layout = () => import('@/layouts/index.vue') + +const routes: Route.recordRaw[] = [ + { + path: '/customer', + component: Layout, + redirect: '/customer/bench', + name: 'CustomerBench', + meta: { + title: '工作台', + icon: 'ep:key', + auth: '/customer/bench', + }, + children: [ + { + path: 'bench', + name: 'CustomerBenchPage', + component: () => import('@/views/measure/bench/bench.vue'), + meta: { + title: '工作台', + auth: '/customer/bench', + sidebar: false, + breadcrumb: true, + activeMenu: '/customer', + }, + }, + ], + }, + { + path: '/sample', + component: Layout, + redirect: '/sample/list', + name: 'File', + meta: { + title: '样品库', + icon: 'ep:key', + auth: '/sample', + }, + children: [ + { + path: 'list', + name: 'SampleList', + component: () => import('@/views/measure/file/quality.vue'), + meta: { + title: '样品列表', + icon: 'ep:key', + auth: '/sample/list', + }, + }, + { + path: 'overtime', + name: 'OvertimeSample', + component: () => import('@/views/measure/file/rules.vue'), + meta: { + title: '到期样品', + icon: 'ep:key', + auth: '/sample/overtime', + }, + }, + ], + }, + { + path: '/customerManage', + component: Layout, + redirect: '/customerManage/list', + name: 'MeasureSource', + meta: { + title: '客户管理', + icon: 'ep:key', + auth: '/customer/manage', + }, + children: [ + { + path: 'list', + name: 'CustomerList', + component: () => import('@/views/customer/customerInfo/customerList.vue'), + meta: { + title: '客户列表', + icon: 'ep:key', + auth: '/customer/list', + }, + }, + { + path: ':type/:id?', + name: 'CustomerDetail', + component: () => import('@/views/customer/customerInfo/customerEdit.vue'), + meta: { + title: '客户详情', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/customerManage/list', + }, + }, + { + path: 'advice', + name: 'CustomerAdvice', + component: () => import('@/views/customer/adviceList.vue'), + meta: { + title: '客户关系', + icon: 'ep:key', + auth: '/customer/advice', + }, + }, + { + path: 'advice/:type/:id?', + name: 'CustomerAdviceDetail', + component: () => import('@/views/customer/advice/adviceEdit.vue'), + meta: { + title: '客户关系详情', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/source/approve', + }, + }, + ], + }, +] + +export default routes diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 73a7470..855c6fa 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -4,10 +4,10 @@ const routes: Route.recordRaw[] = [ { - path: '/bench', + path: '/measure', component: Layout, - redirect: '/bench/list', - name: 'Bench', + redirect: '/measure/bench', + name: 'MeasureBench', meta: { title: '工作台', icon: 'ep:key', @@ -15,15 +15,15 @@ }, children: [ { - path: 'list', - name: 'BenchList', + path: 'bench', + name: 'MeasureBenchPage', component: () => import('@/views/measure/bench/bench.vue'), meta: { title: '工作台', auth: '/measure/bench', sidebar: false, breadcrumb: true, - activeMenu: '/bench', + activeMenu: '/measure', }, }, ], diff --git a/src/router/routes.ts b/src/router/routes.ts index 4153ab5..5210ea6 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -5,6 +5,7 @@ import systemRoute from './modules/system' import measureRoute from './modules/measure' import deviceRoute from './modules/device' +import customerRoute from './modules/customer' import type { Route } from '@/global' import useSettingsStore from '@/store/modules/settings' @@ -164,12 +165,10 @@ meta: { title: '客户资源', icon: '', - // auth: 'khzy', - auth: '/well', + auth: '/customer', }, children: [ - MultilevelMenuExample, - BreadcrumbExample, + ...customerRoute, ], }, { diff --git a/src/views/customer/advice/adviceEdit.vue b/src/views/customer/advice/adviceEdit.vue new file mode 100644 index 0000000..0dafa50 --- /dev/null +++ b/src/views/customer/advice/adviceEdit.vue @@ -0,0 +1,551 @@ + + + + + diff --git a/src/views/customer/advice/adviceList.vue b/src/views/customer/advice/adviceList.vue new file mode 100644 index 0000000..e715bad --- /dev/null +++ b/src/views/customer/advice/adviceList.vue @@ -0,0 +1,278 @@ + + + + + diff --git a/src/views/customer/advice/advice_interface.ts b/src/views/customer/advice/advice_interface.ts new file mode 100644 index 0000000..8f404c4 --- /dev/null +++ b/src/views/customer/advice/advice_interface.ts @@ -0,0 +1,74 @@ +// 列表查询条件 +export interface ICustomerQuery { + bussinessSize: string // 业务规模 + customerName: string // 公司名称 + customerNo: string // 客户编号 + grade: string // 履约评级 + offset: number + limit: number +} + +// 客户人员 +export interface customerPerson { + id: number | string // id + job: string // 职务 + department: string// 部门 + name: string// 信命 + personNo: string// 人员编号 + phone: string// 联系方式 + editable?: boolean // 是否可编辑 + [key: string]: any +} + +// 客户信息-列表 +export interface ICustomer { + businessContent: string // 业务内容 + customerName: string // 公司名称 + customerNo: string // 客户编号(列表、更新接口参数) + bankAccount: string // 银行账户名 + bankAccountNumber: string // 银行账号 + bankName: string // 银行名称 + briefName: string // 公司简称 + businessScope: string // 公司业务范围 + grade: string // 履约评级 + gradeName?: string // 履约评级 + companySize: string + companySizeName?: string + businessSize: string // 业务规模 + businessSizeName?: string // 业务规模 + evaluation: string // 整体评价 + evaluationName?: string // 整体评价 + companyAddressBref?: string // 公司地址-拼接省市 + companyAddress: string // 公司地址-详细地址 + companyArea: string // 公司地址-区 + companyCity: string // 公司地址-市 + companyCountry: string // 公司地址-国家 + companyProvince: string // 公司地址-省 + companyAreaName: string // 公司地址-区 + companyCityName: string // 公司地址-市 + companyCountryName: string // 公司地址-国家 + companyProvinceName: string // 公司地址-省 + createTime?: string // 创建时间 + director: string // 负责人 + id: string // 主键id(列表、更新接口参数) + fax: string // 传真 + invoiceAddress: string // 开票地址-详细地址 + invoiceArea: string // 开票地址-区 + invoiceCity: string // 开票地址-市 + invoiceCountry: string // 开票地址-国家 + invoiceProvince: string // 开票地址-省 + invoiceAreaName: string // 开票地址-区 + invoiceCityName: string // 开票地址-市 + invoiceCountryName: string // 开票地址-国家 + invoiceProvinceName: string // 开票地址-省 + mailbox: string // 邮箱 + minioFileName: string // 上传文件返回名称 + mobile: string // 手机 + phone: string // 电话 + postalCode: string // 邮编 + remark: string // 备注 + taxNumber: string // 税号 + website: string // 网址 + customerPersonList: customerPerson[] // 客户人员列表 +} + diff --git a/src/api/customer/customer.ts b/src/api/customer/customer.ts new file mode 100644 index 0000000..cb41f8c --- /dev/null +++ b/src/api/customer/customer.ts @@ -0,0 +1,60 @@ +/** + * 溯源供方请求接口 + */ +import request from '../index' +import type { ICustomerQuery } from '@/views/customer/customerInfo/customer_interface' +const prefix = '/meter' + +// 列表查询 +export function getCustomerList(data: ICustomerQuery) { + return request({ + url: `${prefix}/supplier/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 数据删除 +export function deleteCustomer(data: { id: string }) { + return request({ + url: `${prefix}/supplier/delete`, + method: 'post', + data, + }) +} + +// 查看详情 +export function getCustomerDetail(data: { id: string }) { + return request({ + url: `${prefix}/supplier/detail`, + method: 'post', + data, + }) +} + +// 提交数据 +export function addCustomer(data: object) { + return request({ + url: '/meter/supplier/submit', + method: 'post', + data, + }) +} +// 更新数据 +export function updateCustomer(data: object) { + return request({ + url: `${prefix}/supplier/update`, + method: 'post', + data, + }) +} + +// 导出列表 +export function exportCustomerList(data: Omit) { + return request({ + url: `${prefix}/supplier/listExport`, + method: 'post', + responseType: 'blob', + data, + }) +} diff --git a/src/router/modules/customer.ts b/src/router/modules/customer.ts new file mode 100644 index 0000000..58dde63 --- /dev/null +++ b/src/router/modules/customer.ts @@ -0,0 +1,123 @@ +import type { Route } from '@/global' + +const Layout = () => import('@/layouts/index.vue') + +const routes: Route.recordRaw[] = [ + { + path: '/customer', + component: Layout, + redirect: '/customer/bench', + name: 'CustomerBench', + meta: { + title: '工作台', + icon: 'ep:key', + auth: '/customer/bench', + }, + children: [ + { + path: 'bench', + name: 'CustomerBenchPage', + component: () => import('@/views/measure/bench/bench.vue'), + meta: { + title: '工作台', + auth: '/customer/bench', + sidebar: false, + breadcrumb: true, + activeMenu: '/customer', + }, + }, + ], + }, + { + path: '/sample', + component: Layout, + redirect: '/sample/list', + name: 'File', + meta: { + title: '样品库', + icon: 'ep:key', + auth: '/sample', + }, + children: [ + { + path: 'list', + name: 'SampleList', + component: () => import('@/views/measure/file/quality.vue'), + meta: { + title: '样品列表', + icon: 'ep:key', + auth: '/sample/list', + }, + }, + { + path: 'overtime', + name: 'OvertimeSample', + component: () => import('@/views/measure/file/rules.vue'), + meta: { + title: '到期样品', + icon: 'ep:key', + auth: '/sample/overtime', + }, + }, + ], + }, + { + path: '/customerManage', + component: Layout, + redirect: '/customerManage/list', + name: 'MeasureSource', + meta: { + title: '客户管理', + icon: 'ep:key', + auth: '/customer/manage', + }, + children: [ + { + path: 'list', + name: 'CustomerList', + component: () => import('@/views/customer/customerInfo/customerList.vue'), + meta: { + title: '客户列表', + icon: 'ep:key', + auth: '/customer/list', + }, + }, + { + path: ':type/:id?', + name: 'CustomerDetail', + component: () => import('@/views/customer/customerInfo/customerEdit.vue'), + meta: { + title: '客户详情', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/customerManage/list', + }, + }, + { + path: 'advice', + name: 'CustomerAdvice', + component: () => import('@/views/customer/adviceList.vue'), + meta: { + title: '客户关系', + icon: 'ep:key', + auth: '/customer/advice', + }, + }, + { + path: 'advice/:type/:id?', + name: 'CustomerAdviceDetail', + component: () => import('@/views/customer/advice/adviceEdit.vue'), + meta: { + title: '客户关系详情', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/source/approve', + }, + }, + ], + }, +] + +export default routes diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 73a7470..855c6fa 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -4,10 +4,10 @@ const routes: Route.recordRaw[] = [ { - path: '/bench', + path: '/measure', component: Layout, - redirect: '/bench/list', - name: 'Bench', + redirect: '/measure/bench', + name: 'MeasureBench', meta: { title: '工作台', icon: 'ep:key', @@ -15,15 +15,15 @@ }, children: [ { - path: 'list', - name: 'BenchList', + path: 'bench', + name: 'MeasureBenchPage', component: () => import('@/views/measure/bench/bench.vue'), meta: { title: '工作台', auth: '/measure/bench', sidebar: false, breadcrumb: true, - activeMenu: '/bench', + activeMenu: '/measure', }, }, ], diff --git a/src/router/routes.ts b/src/router/routes.ts index 4153ab5..5210ea6 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -5,6 +5,7 @@ import systemRoute from './modules/system' import measureRoute from './modules/measure' import deviceRoute from './modules/device' +import customerRoute from './modules/customer' import type { Route } from '@/global' import useSettingsStore from '@/store/modules/settings' @@ -164,12 +165,10 @@ meta: { title: '客户资源', icon: '', - // auth: 'khzy', - auth: '/well', + auth: '/customer', }, children: [ - MultilevelMenuExample, - BreadcrumbExample, + ...customerRoute, ], }, { diff --git a/src/views/customer/advice/adviceEdit.vue b/src/views/customer/advice/adviceEdit.vue new file mode 100644 index 0000000..0dafa50 --- /dev/null +++ b/src/views/customer/advice/adviceEdit.vue @@ -0,0 +1,551 @@ + + + + + diff --git a/src/views/customer/advice/adviceList.vue b/src/views/customer/advice/adviceList.vue new file mode 100644 index 0000000..e715bad --- /dev/null +++ b/src/views/customer/advice/adviceList.vue @@ -0,0 +1,278 @@ + + + + + diff --git a/src/views/customer/advice/advice_interface.ts b/src/views/customer/advice/advice_interface.ts new file mode 100644 index 0000000..8f404c4 --- /dev/null +++ b/src/views/customer/advice/advice_interface.ts @@ -0,0 +1,74 @@ +// 列表查询条件 +export interface ICustomerQuery { + bussinessSize: string // 业务规模 + customerName: string // 公司名称 + customerNo: string // 客户编号 + grade: string // 履约评级 + offset: number + limit: number +} + +// 客户人员 +export interface customerPerson { + id: number | string // id + job: string // 职务 + department: string// 部门 + name: string// 信命 + personNo: string// 人员编号 + phone: string// 联系方式 + editable?: boolean // 是否可编辑 + [key: string]: any +} + +// 客户信息-列表 +export interface ICustomer { + businessContent: string // 业务内容 + customerName: string // 公司名称 + customerNo: string // 客户编号(列表、更新接口参数) + bankAccount: string // 银行账户名 + bankAccountNumber: string // 银行账号 + bankName: string // 银行名称 + briefName: string // 公司简称 + businessScope: string // 公司业务范围 + grade: string // 履约评级 + gradeName?: string // 履约评级 + companySize: string + companySizeName?: string + businessSize: string // 业务规模 + businessSizeName?: string // 业务规模 + evaluation: string // 整体评价 + evaluationName?: string // 整体评价 + companyAddressBref?: string // 公司地址-拼接省市 + companyAddress: string // 公司地址-详细地址 + companyArea: string // 公司地址-区 + companyCity: string // 公司地址-市 + companyCountry: string // 公司地址-国家 + companyProvince: string // 公司地址-省 + companyAreaName: string // 公司地址-区 + companyCityName: string // 公司地址-市 + companyCountryName: string // 公司地址-国家 + companyProvinceName: string // 公司地址-省 + createTime?: string // 创建时间 + director: string // 负责人 + id: string // 主键id(列表、更新接口参数) + fax: string // 传真 + invoiceAddress: string // 开票地址-详细地址 + invoiceArea: string // 开票地址-区 + invoiceCity: string // 开票地址-市 + invoiceCountry: string // 开票地址-国家 + invoiceProvince: string // 开票地址-省 + invoiceAreaName: string // 开票地址-区 + invoiceCityName: string // 开票地址-市 + invoiceCountryName: string // 开票地址-国家 + invoiceProvinceName: string // 开票地址-省 + mailbox: string // 邮箱 + minioFileName: string // 上传文件返回名称 + mobile: string // 手机 + phone: string // 电话 + postalCode: string // 邮编 + remark: string // 备注 + taxNumber: string // 税号 + website: string // 网址 + customerPersonList: customerPerson[] // 客户人员列表 +} + diff --git a/src/views/customer/customerInfo/customerAdd.vue b/src/views/customer/customerInfo/customerAdd.vue deleted file mode 100644 index a2d1d87..0000000 --- a/src/views/customer/customerInfo/customerAdd.vue +++ /dev/null @@ -1,549 +0,0 @@ - - - - - diff --git a/src/api/customer/customer.ts b/src/api/customer/customer.ts new file mode 100644 index 0000000..cb41f8c --- /dev/null +++ b/src/api/customer/customer.ts @@ -0,0 +1,60 @@ +/** + * 溯源供方请求接口 + */ +import request from '../index' +import type { ICustomerQuery } from '@/views/customer/customerInfo/customer_interface' +const prefix = '/meter' + +// 列表查询 +export function getCustomerList(data: ICustomerQuery) { + return request({ + url: `${prefix}/supplier/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 数据删除 +export function deleteCustomer(data: { id: string }) { + return request({ + url: `${prefix}/supplier/delete`, + method: 'post', + data, + }) +} + +// 查看详情 +export function getCustomerDetail(data: { id: string }) { + return request({ + url: `${prefix}/supplier/detail`, + method: 'post', + data, + }) +} + +// 提交数据 +export function addCustomer(data: object) { + return request({ + url: '/meter/supplier/submit', + method: 'post', + data, + }) +} +// 更新数据 +export function updateCustomer(data: object) { + return request({ + url: `${prefix}/supplier/update`, + method: 'post', + data, + }) +} + +// 导出列表 +export function exportCustomerList(data: Omit) { + return request({ + url: `${prefix}/supplier/listExport`, + method: 'post', + responseType: 'blob', + data, + }) +} diff --git a/src/router/modules/customer.ts b/src/router/modules/customer.ts new file mode 100644 index 0000000..58dde63 --- /dev/null +++ b/src/router/modules/customer.ts @@ -0,0 +1,123 @@ +import type { Route } from '@/global' + +const Layout = () => import('@/layouts/index.vue') + +const routes: Route.recordRaw[] = [ + { + path: '/customer', + component: Layout, + redirect: '/customer/bench', + name: 'CustomerBench', + meta: { + title: '工作台', + icon: 'ep:key', + auth: '/customer/bench', + }, + children: [ + { + path: 'bench', + name: 'CustomerBenchPage', + component: () => import('@/views/measure/bench/bench.vue'), + meta: { + title: '工作台', + auth: '/customer/bench', + sidebar: false, + breadcrumb: true, + activeMenu: '/customer', + }, + }, + ], + }, + { + path: '/sample', + component: Layout, + redirect: '/sample/list', + name: 'File', + meta: { + title: '样品库', + icon: 'ep:key', + auth: '/sample', + }, + children: [ + { + path: 'list', + name: 'SampleList', + component: () => import('@/views/measure/file/quality.vue'), + meta: { + title: '样品列表', + icon: 'ep:key', + auth: '/sample/list', + }, + }, + { + path: 'overtime', + name: 'OvertimeSample', + component: () => import('@/views/measure/file/rules.vue'), + meta: { + title: '到期样品', + icon: 'ep:key', + auth: '/sample/overtime', + }, + }, + ], + }, + { + path: '/customerManage', + component: Layout, + redirect: '/customerManage/list', + name: 'MeasureSource', + meta: { + title: '客户管理', + icon: 'ep:key', + auth: '/customer/manage', + }, + children: [ + { + path: 'list', + name: 'CustomerList', + component: () => import('@/views/customer/customerInfo/customerList.vue'), + meta: { + title: '客户列表', + icon: 'ep:key', + auth: '/customer/list', + }, + }, + { + path: ':type/:id?', + name: 'CustomerDetail', + component: () => import('@/views/customer/customerInfo/customerEdit.vue'), + meta: { + title: '客户详情', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/customerManage/list', + }, + }, + { + path: 'advice', + name: 'CustomerAdvice', + component: () => import('@/views/customer/adviceList.vue'), + meta: { + title: '客户关系', + icon: 'ep:key', + auth: '/customer/advice', + }, + }, + { + path: 'advice/:type/:id?', + name: 'CustomerAdviceDetail', + component: () => import('@/views/customer/advice/adviceEdit.vue'), + meta: { + title: '客户关系详情', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/source/approve', + }, + }, + ], + }, +] + +export default routes diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 73a7470..855c6fa 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -4,10 +4,10 @@ const routes: Route.recordRaw[] = [ { - path: '/bench', + path: '/measure', component: Layout, - redirect: '/bench/list', - name: 'Bench', + redirect: '/measure/bench', + name: 'MeasureBench', meta: { title: '工作台', icon: 'ep:key', @@ -15,15 +15,15 @@ }, children: [ { - path: 'list', - name: 'BenchList', + path: 'bench', + name: 'MeasureBenchPage', component: () => import('@/views/measure/bench/bench.vue'), meta: { title: '工作台', auth: '/measure/bench', sidebar: false, breadcrumb: true, - activeMenu: '/bench', + activeMenu: '/measure', }, }, ], diff --git a/src/router/routes.ts b/src/router/routes.ts index 4153ab5..5210ea6 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -5,6 +5,7 @@ import systemRoute from './modules/system' import measureRoute from './modules/measure' import deviceRoute from './modules/device' +import customerRoute from './modules/customer' import type { Route } from '@/global' import useSettingsStore from '@/store/modules/settings' @@ -164,12 +165,10 @@ meta: { title: '客户资源', icon: '', - // auth: 'khzy', - auth: '/well', + auth: '/customer', }, children: [ - MultilevelMenuExample, - BreadcrumbExample, + ...customerRoute, ], }, { diff --git a/src/views/customer/advice/adviceEdit.vue b/src/views/customer/advice/adviceEdit.vue new file mode 100644 index 0000000..0dafa50 --- /dev/null +++ b/src/views/customer/advice/adviceEdit.vue @@ -0,0 +1,551 @@ + + + + + diff --git a/src/views/customer/advice/adviceList.vue b/src/views/customer/advice/adviceList.vue new file mode 100644 index 0000000..e715bad --- /dev/null +++ b/src/views/customer/advice/adviceList.vue @@ -0,0 +1,278 @@ + + + + + diff --git a/src/views/customer/advice/advice_interface.ts b/src/views/customer/advice/advice_interface.ts new file mode 100644 index 0000000..8f404c4 --- /dev/null +++ b/src/views/customer/advice/advice_interface.ts @@ -0,0 +1,74 @@ +// 列表查询条件 +export interface ICustomerQuery { + bussinessSize: string // 业务规模 + customerName: string // 公司名称 + customerNo: string // 客户编号 + grade: string // 履约评级 + offset: number + limit: number +} + +// 客户人员 +export interface customerPerson { + id: number | string // id + job: string // 职务 + department: string// 部门 + name: string// 信命 + personNo: string// 人员编号 + phone: string// 联系方式 + editable?: boolean // 是否可编辑 + [key: string]: any +} + +// 客户信息-列表 +export interface ICustomer { + businessContent: string // 业务内容 + customerName: string // 公司名称 + customerNo: string // 客户编号(列表、更新接口参数) + bankAccount: string // 银行账户名 + bankAccountNumber: string // 银行账号 + bankName: string // 银行名称 + briefName: string // 公司简称 + businessScope: string // 公司业务范围 + grade: string // 履约评级 + gradeName?: string // 履约评级 + companySize: string + companySizeName?: string + businessSize: string // 业务规模 + businessSizeName?: string // 业务规模 + evaluation: string // 整体评价 + evaluationName?: string // 整体评价 + companyAddressBref?: string // 公司地址-拼接省市 + companyAddress: string // 公司地址-详细地址 + companyArea: string // 公司地址-区 + companyCity: string // 公司地址-市 + companyCountry: string // 公司地址-国家 + companyProvince: string // 公司地址-省 + companyAreaName: string // 公司地址-区 + companyCityName: string // 公司地址-市 + companyCountryName: string // 公司地址-国家 + companyProvinceName: string // 公司地址-省 + createTime?: string // 创建时间 + director: string // 负责人 + id: string // 主键id(列表、更新接口参数) + fax: string // 传真 + invoiceAddress: string // 开票地址-详细地址 + invoiceArea: string // 开票地址-区 + invoiceCity: string // 开票地址-市 + invoiceCountry: string // 开票地址-国家 + invoiceProvince: string // 开票地址-省 + invoiceAreaName: string // 开票地址-区 + invoiceCityName: string // 开票地址-市 + invoiceCountryName: string // 开票地址-国家 + invoiceProvinceName: string // 开票地址-省 + mailbox: string // 邮箱 + minioFileName: string // 上传文件返回名称 + mobile: string // 手机 + phone: string // 电话 + postalCode: string // 邮编 + remark: string // 备注 + taxNumber: string // 税号 + website: string // 网址 + customerPersonList: customerPerson[] // 客户人员列表 +} + diff --git a/src/views/customer/customerInfo/customerAdd.vue b/src/views/customer/customerInfo/customerAdd.vue deleted file mode 100644 index a2d1d87..0000000 --- a/src/views/customer/customerInfo/customerAdd.vue +++ /dev/null @@ -1,549 +0,0 @@ - - - - - diff --git a/src/views/customer/customerInfo/customerEdit.vue b/src/views/customer/customerInfo/customerEdit.vue new file mode 100644 index 0000000..9abfc48 --- /dev/null +++ b/src/views/customer/customerInfo/customerEdit.vue @@ -0,0 +1,551 @@ + + + + + diff --git a/src/api/customer/customer.ts b/src/api/customer/customer.ts new file mode 100644 index 0000000..cb41f8c --- /dev/null +++ b/src/api/customer/customer.ts @@ -0,0 +1,60 @@ +/** + * 溯源供方请求接口 + */ +import request from '../index' +import type { ICustomerQuery } from '@/views/customer/customerInfo/customer_interface' +const prefix = '/meter' + +// 列表查询 +export function getCustomerList(data: ICustomerQuery) { + return request({ + url: `${prefix}/supplier/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 数据删除 +export function deleteCustomer(data: { id: string }) { + return request({ + url: `${prefix}/supplier/delete`, + method: 'post', + data, + }) +} + +// 查看详情 +export function getCustomerDetail(data: { id: string }) { + return request({ + url: `${prefix}/supplier/detail`, + method: 'post', + data, + }) +} + +// 提交数据 +export function addCustomer(data: object) { + return request({ + url: '/meter/supplier/submit', + method: 'post', + data, + }) +} +// 更新数据 +export function updateCustomer(data: object) { + return request({ + url: `${prefix}/supplier/update`, + method: 'post', + data, + }) +} + +// 导出列表 +export function exportCustomerList(data: Omit) { + return request({ + url: `${prefix}/supplier/listExport`, + method: 'post', + responseType: 'blob', + data, + }) +} diff --git a/src/router/modules/customer.ts b/src/router/modules/customer.ts new file mode 100644 index 0000000..58dde63 --- /dev/null +++ b/src/router/modules/customer.ts @@ -0,0 +1,123 @@ +import type { Route } from '@/global' + +const Layout = () => import('@/layouts/index.vue') + +const routes: Route.recordRaw[] = [ + { + path: '/customer', + component: Layout, + redirect: '/customer/bench', + name: 'CustomerBench', + meta: { + title: '工作台', + icon: 'ep:key', + auth: '/customer/bench', + }, + children: [ + { + path: 'bench', + name: 'CustomerBenchPage', + component: () => import('@/views/measure/bench/bench.vue'), + meta: { + title: '工作台', + auth: '/customer/bench', + sidebar: false, + breadcrumb: true, + activeMenu: '/customer', + }, + }, + ], + }, + { + path: '/sample', + component: Layout, + redirect: '/sample/list', + name: 'File', + meta: { + title: '样品库', + icon: 'ep:key', + auth: '/sample', + }, + children: [ + { + path: 'list', + name: 'SampleList', + component: () => import('@/views/measure/file/quality.vue'), + meta: { + title: '样品列表', + icon: 'ep:key', + auth: '/sample/list', + }, + }, + { + path: 'overtime', + name: 'OvertimeSample', + component: () => import('@/views/measure/file/rules.vue'), + meta: { + title: '到期样品', + icon: 'ep:key', + auth: '/sample/overtime', + }, + }, + ], + }, + { + path: '/customerManage', + component: Layout, + redirect: '/customerManage/list', + name: 'MeasureSource', + meta: { + title: '客户管理', + icon: 'ep:key', + auth: '/customer/manage', + }, + children: [ + { + path: 'list', + name: 'CustomerList', + component: () => import('@/views/customer/customerInfo/customerList.vue'), + meta: { + title: '客户列表', + icon: 'ep:key', + auth: '/customer/list', + }, + }, + { + path: ':type/:id?', + name: 'CustomerDetail', + component: () => import('@/views/customer/customerInfo/customerEdit.vue'), + meta: { + title: '客户详情', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/customerManage/list', + }, + }, + { + path: 'advice', + name: 'CustomerAdvice', + component: () => import('@/views/customer/adviceList.vue'), + meta: { + title: '客户关系', + icon: 'ep:key', + auth: '/customer/advice', + }, + }, + { + path: 'advice/:type/:id?', + name: 'CustomerAdviceDetail', + component: () => import('@/views/customer/advice/adviceEdit.vue'), + meta: { + title: '客户关系详情', + icon: 'ep:key', + sidebar: false, + breadcrumb: true, + activeMenu: '/source/approve', + }, + }, + ], + }, +] + +export default routes diff --git a/src/router/modules/measure.ts b/src/router/modules/measure.ts index 73a7470..855c6fa 100644 --- a/src/router/modules/measure.ts +++ b/src/router/modules/measure.ts @@ -4,10 +4,10 @@ const routes: Route.recordRaw[] = [ { - path: '/bench', + path: '/measure', component: Layout, - redirect: '/bench/list', - name: 'Bench', + redirect: '/measure/bench', + name: 'MeasureBench', meta: { title: '工作台', icon: 'ep:key', @@ -15,15 +15,15 @@ }, children: [ { - path: 'list', - name: 'BenchList', + path: 'bench', + name: 'MeasureBenchPage', component: () => import('@/views/measure/bench/bench.vue'), meta: { title: '工作台', auth: '/measure/bench', sidebar: false, breadcrumb: true, - activeMenu: '/bench', + activeMenu: '/measure', }, }, ], diff --git a/src/router/routes.ts b/src/router/routes.ts index 4153ab5..5210ea6 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -5,6 +5,7 @@ import systemRoute from './modules/system' import measureRoute from './modules/measure' import deviceRoute from './modules/device' +import customerRoute from './modules/customer' import type { Route } from '@/global' import useSettingsStore from '@/store/modules/settings' @@ -164,12 +165,10 @@ meta: { title: '客户资源', icon: '', - // auth: 'khzy', - auth: '/well', + auth: '/customer', }, children: [ - MultilevelMenuExample, - BreadcrumbExample, + ...customerRoute, ], }, { diff --git a/src/views/customer/advice/adviceEdit.vue b/src/views/customer/advice/adviceEdit.vue new file mode 100644 index 0000000..0dafa50 --- /dev/null +++ b/src/views/customer/advice/adviceEdit.vue @@ -0,0 +1,551 @@ + + + + + diff --git a/src/views/customer/advice/adviceList.vue b/src/views/customer/advice/adviceList.vue new file mode 100644 index 0000000..e715bad --- /dev/null +++ b/src/views/customer/advice/adviceList.vue @@ -0,0 +1,278 @@ + + + + + diff --git a/src/views/customer/advice/advice_interface.ts b/src/views/customer/advice/advice_interface.ts new file mode 100644 index 0000000..8f404c4 --- /dev/null +++ b/src/views/customer/advice/advice_interface.ts @@ -0,0 +1,74 @@ +// 列表查询条件 +export interface ICustomerQuery { + bussinessSize: string // 业务规模 + customerName: string // 公司名称 + customerNo: string // 客户编号 + grade: string // 履约评级 + offset: number + limit: number +} + +// 客户人员 +export interface customerPerson { + id: number | string // id + job: string // 职务 + department: string// 部门 + name: string// 信命 + personNo: string// 人员编号 + phone: string// 联系方式 + editable?: boolean // 是否可编辑 + [key: string]: any +} + +// 客户信息-列表 +export interface ICustomer { + businessContent: string // 业务内容 + customerName: string // 公司名称 + customerNo: string // 客户编号(列表、更新接口参数) + bankAccount: string // 银行账户名 + bankAccountNumber: string // 银行账号 + bankName: string // 银行名称 + briefName: string // 公司简称 + businessScope: string // 公司业务范围 + grade: string // 履约评级 + gradeName?: string // 履约评级 + companySize: string + companySizeName?: string + businessSize: string // 业务规模 + businessSizeName?: string // 业务规模 + evaluation: string // 整体评价 + evaluationName?: string // 整体评价 + companyAddressBref?: string // 公司地址-拼接省市 + companyAddress: string // 公司地址-详细地址 + companyArea: string // 公司地址-区 + companyCity: string // 公司地址-市 + companyCountry: string // 公司地址-国家 + companyProvince: string // 公司地址-省 + companyAreaName: string // 公司地址-区 + companyCityName: string // 公司地址-市 + companyCountryName: string // 公司地址-国家 + companyProvinceName: string // 公司地址-省 + createTime?: string // 创建时间 + director: string // 负责人 + id: string // 主键id(列表、更新接口参数) + fax: string // 传真 + invoiceAddress: string // 开票地址-详细地址 + invoiceArea: string // 开票地址-区 + invoiceCity: string // 开票地址-市 + invoiceCountry: string // 开票地址-国家 + invoiceProvince: string // 开票地址-省 + invoiceAreaName: string // 开票地址-区 + invoiceCityName: string // 开票地址-市 + invoiceCountryName: string // 开票地址-国家 + invoiceProvinceName: string // 开票地址-省 + mailbox: string // 邮箱 + minioFileName: string // 上传文件返回名称 + mobile: string // 手机 + phone: string // 电话 + postalCode: string // 邮编 + remark: string // 备注 + taxNumber: string // 税号 + website: string // 网址 + customerPersonList: customerPerson[] // 客户人员列表 +} + diff --git a/src/views/customer/customerInfo/customerAdd.vue b/src/views/customer/customerInfo/customerAdd.vue deleted file mode 100644 index a2d1d87..0000000 --- a/src/views/customer/customerInfo/customerAdd.vue +++ /dev/null @@ -1,549 +0,0 @@ - - - - - diff --git a/src/views/customer/customerInfo/customerEdit.vue b/src/views/customer/customerInfo/customerEdit.vue new file mode 100644 index 0000000..9abfc48 --- /dev/null +++ b/src/views/customer/customerInfo/customerEdit.vue @@ -0,0 +1,551 @@ + + + + + diff --git a/src/views/customer/customerInfo/customerList.vue b/src/views/customer/customerInfo/customerList.vue index 512bc24..4b8285e 100644 --- a/src/views/customer/customerInfo/customerList.vue +++ b/src/views/customer/customerInfo/customerList.vue @@ -4,9 +4,11 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import type { ICustomer, ICustomerQuery } from './customer_interface' import type { TableColumn } from '@/components/NormalTable/table_interface' -// import { exportSourceList, getSoucreList, getSoucreListDelete } from '@/api/measure/source' import { printJSON } from '@/utils/printUtils' import { exportFile } from '@/utils/exportUtils' +import { deleteCustomer, exportCustomerList, getCustomerList } from '@/api/customer/customer' +const { proxy } = getCurrentInstance() as any +const $router = useRouter() // 查询条件 const listQuery: Ref = ref({ bussinessSize: '', // 业务规模 @@ -16,109 +18,62 @@ offset: 1, limit: 20, }) -// 控制是否显示新增页面 -const show = ref(true) -// 表格数据 -const list = ref([]) -const { proxy } = getCurrentInstance() as any -// 总数 -const total = ref(0) // 表头 const columns = ref([ - { - text: '客户编号', - value: 'customerNo', - width: '160', - align: 'center', - }, - { - text: '客户名称', - value: 'customerName', - width: '120', - align: 'center', - }, - { - text: '公司规模', - value: 'businessContent', - align: 'center', - }, - { - text: '业务规模', - value: 'businessScope', - align: 'center', - }, - { - text: '履约评级', - value: 'director', - align: 'center', - }, - { - text: '整体评价', - value: 'mobile', - align: 'center', - }, - { - text: '公司地址', - value: 'briefName', - align: 'center', - }, - { - text: '创建时间', - value: 'createTime', - align: 'center', - width: '180px', - }, - { - text: '备注', - value: 'remark', - align: 'center', - }, + { text: '客户编号', value: 'customerNo', width: '160', align: 'center' }, + { text: '客户名称', value: 'customerName', width: '120', align: 'center' }, + { text: '公司规模', value: 'companySizeName', align: 'center' }, + { text: '业务规模', value: 'businessSizeName', align: 'center' }, + { text: '履约评级', value: 'gradeName', align: 'center' }, + { text: '整体评价', value: 'evaluationName', align: 'center' }, + { text: '公司地址', value: 'briefName', align: 'center' }, + { text: '创建时间', value: 'createTime', align: 'center', width: '180px' }, + { text: '备注', value: 'remark', align: 'center' }, ]) - +// 表格数据 +const list = ref([]) +// 总数 +const total = ref(0) +// 表格加载状态 +const loadingTable = ref(false) // 选中的内容 const checkoutList = ref([]) // 文件上传input const fileRef = ref() -// 点击按钮 -const buttonType = ref('') -const loadingTable = ref(false) -const fetchData = (isNowPage: boolean) => { +// 数据查询 +function fetchData(isNowPage = false) { loadingTable.value = true if (!isNowPage) { // 是否显示当前页,否则跳转第一页 listQuery.value.offset = 1 } - // getSoucreList(listQuery.value).then((response) => { - // list.value = response.data.rows.map((item: ICustomer) => { - // if (item.companyProvinceName && item.companyCityName) { - // item.briefName = `${item.companyProvinceName}/${item.companyCityName}` - // } - // else { - // item.briefName = item.companyProvinceName || item.companyCityName - // } - // return item - // }) - // total.value = parseInt(response.data.total) - // loadingTable.value = false - // }) + getCustomerList(listQuery.value).then((response) => { + // 模拟数据 + response.data.rows = [{ bankAccount: '银行账户', bankAccountNumber: '银行账号', bankName: '工商银行', briefName: '京东', businessContent: '电商', businessScope: 'test1', grade: '1', gradeName: '优质', companySize: '1', companySizeName: '优质', businessSize: '1', businessSizeName: '小微企业', evaluation: '1', evaluationName: '优质', companyAddress: '五棵松', companyAreaName: '海淀区', companyCityName: '北京市', companyCountryName: '中国', companyProvinceName: '北京', companyArea: '110007', companyCity: '110000', companyCountry: 'CN', companyProvince: '100000', createTime: '2022-11-29 21:14:50', director: '刘强东', fax: 'test1', id: '1597579843411234817', invoiceAddress: '五棵松', invoiceAreaName: '海淀区', invoiceCityName: '北京市', invoiceCountryName: '中国', invoiceProvinceName: '北京', invoiceyArea: '110007', invoiceCity: '110000', invoiceCountry: 'CN', invoiceProvince: '100000', mailbox: 'test1', minioFileName: 'test', mobile: 'test', phone: '950618', postalCode: 'test', remark: 'test', customerName: '京东集团', customerNo: 'sygf202211290001', taxNumber: 'test', updateTime: '2023-01-10 09:56:57', website: 'test' }] + list.value = response.data.rows.map((item: ICustomer) => { + if (item.companyProvinceName && item.companyCityName) { + item.briefName = `${item.companyProvinceName}/${item.companyCityName}` + } + else { + item.briefName = item.companyProvinceName || item.companyCityName + } + return item + }) + total.value = parseInt(response.data.total) + loadingTable.value = false + }) } -fetchData(true) // 多选发生改变时 -const handleSelectionChange = (e: any) => { +function handleSelectionChange(e: any) { checkoutList.value = e.map((item: { id: string }) => item.id) } -// 点击编辑id和删除row类型 -interface rowReturn { - id: string - customerName: string -} -const $router = useRouter() + // 点击编辑/详情 -const handleEdit = (row: rowReturn, pageType: 'edit' | 'detail') => { - $router.push(`/source/${pageType}/${row.id}`) +const handleEdit = (row: ICustomer, pageType: 'edit' | 'detail') => { + $router.push(`/customerManage/${pageType}/${row.id}`) } // 点击删除 -const handleDelete = (index: string, row: rowReturn) => { +const handleDelete = (index: string, row: ICustomer) => { ElMessageBox.confirm( `确认删除${row.customerName}吗?`, '提示', @@ -129,15 +84,15 @@ }, ) .then(() => { - // getSoucreListDelete({ id: row.id as string }).then((res) => { - // if (res.code === 200) { - // ElMessage({ - // type: 'success', - // message: '删除成功', - // }) - // fetchData(true) - // } - // }) + deleteCustomer({ id: row.id }).then((res) => { + if (res.code === 200) { + ElMessage({ + type: 'success', + message: '删除成功', + }) + fetchData(true) + } + }) }) } // 点击搜索 @@ -158,19 +113,20 @@ // 上传文件/批量导入 const onFileChange = (event: any) => { + // todo: 校验文件类型,调用上传接口 if (event.target.files[0].type === 'application/pdf') { if (event.target.files?.length !== 0) { // 创建formdata对象 - const fd = new FormData() - fd.append('multipartFile', event.target.files[0]) - uploadApi(fd).then((res) => { - if (res.code === 200) { - ElMessage.success('上传成功') - } - else { - ElMessage.error(res.message) - } - }) + // const fd = new FormData() + // fd.append('multipartFile', event.target.files[0]) + // uploadApi(fd).then((res) => { + // if (res.code === 200) { + // ElMessage.success('上传成功') + // } + // else { + // ElMessage.error(res.message) + // } + // }) } } else { @@ -188,15 +144,15 @@ fetchData(true) } -// 批量导入 +// 点击批量导入 const uploadAll = () => { - // todo: 批量导入 fileRef.value.click() } // 添加客户 const add = () => { - $router.push('/source/add') + $router.push('/customerManage/add') } +// 导出 const exportAll = () => { const loading = ElLoading.service({ lock: true, @@ -205,12 +161,13 @@ }) if (list.value.length > 0) { const params = { - customerNo: '', // 业务内容 - customerName: '', // 客户名称 - businessContent: '', // 客户编号 + bussinessSize: listQuery.value.bussinessSize, // 业务规模 + customerName: listQuery.value.customerName, // 公司名称 + customerNo: listQuery.value.customerNo, // 客户编号 + grade: listQuery.value.grade, // 履约评级 ids: checkoutList.value, } - exportSourceList(params).then((res) => { + exportCustomerList(params).then((res) => { const blob = new Blob([res.data]) exportFile(blob, '客户列表.xlsx') }) @@ -241,91 +198,81 @@ ElMessage.warning('无可打印内容') } } + +fetchData(true)