diff --git a/src/api/customer/advice.ts b/src/api/customer/advice.ts index 738dac3..c581a4e 100644 --- a/src/api/customer/advice.ts +++ b/src/api/customer/advice.ts @@ -3,12 +3,11 @@ */ import request from '../index' import type { IAdviceQuery } from '@/views/customer/advice/advice_interface' -const prefix = '/meter' // 列表查询 export function getAdviceList(data: IAdviceQuery) { return request({ - url: `${prefix}/supplier/listPage?offset=${data.offset}&limit=${data.limit}`, + url: `/customer/advice/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', data, }) @@ -17,7 +16,7 @@ // 数据删除 export function deleteAdvice(data: { id: string }) { return request({ - url: `${prefix}/supplier/delete`, + url: '/customer/advice/delete', method: 'post', data, }) @@ -26,7 +25,7 @@ // 查看详情 export function getAdviceDetail(data: { id: string }) { return request({ - url: `${prefix}/supplier/detail`, + url: '/customer/advice/detail', method: 'post', data, }) @@ -35,7 +34,7 @@ // 新增数据 export function addAdvice(data: object) { return request({ - url: '/meter/supplier/submit', + url: '/customer/advice/add', method: 'post', data, }) @@ -43,7 +42,7 @@ // 编辑数据 export function updateAdvice(data: object) { return request({ - url: `${prefix}/supplier/update`, + url: '/customer/advice/update', method: 'post', data, }) @@ -52,7 +51,7 @@ // 导出列表 export function exportAdviceList(data: Omit) { return request({ - url: `${prefix}/supplier/listExport`, + url: '/customer/advice/export', method: 'post', responseType: 'blob', data, diff --git a/src/api/customer/advice.ts b/src/api/customer/advice.ts index 738dac3..c581a4e 100644 --- a/src/api/customer/advice.ts +++ b/src/api/customer/advice.ts @@ -3,12 +3,11 @@ */ import request from '../index' import type { IAdviceQuery } from '@/views/customer/advice/advice_interface' -const prefix = '/meter' // 列表查询 export function getAdviceList(data: IAdviceQuery) { return request({ - url: `${prefix}/supplier/listPage?offset=${data.offset}&limit=${data.limit}`, + url: `/customer/advice/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', data, }) @@ -17,7 +16,7 @@ // 数据删除 export function deleteAdvice(data: { id: string }) { return request({ - url: `${prefix}/supplier/delete`, + url: '/customer/advice/delete', method: 'post', data, }) @@ -26,7 +25,7 @@ // 查看详情 export function getAdviceDetail(data: { id: string }) { return request({ - url: `${prefix}/supplier/detail`, + url: '/customer/advice/detail', method: 'post', data, }) @@ -35,7 +34,7 @@ // 新增数据 export function addAdvice(data: object) { return request({ - url: '/meter/supplier/submit', + url: '/customer/advice/add', method: 'post', data, }) @@ -43,7 +42,7 @@ // 编辑数据 export function updateAdvice(data: object) { return request({ - url: `${prefix}/supplier/update`, + url: '/customer/advice/update', method: 'post', data, }) @@ -52,7 +51,7 @@ // 导出列表 export function exportAdviceList(data: Omit) { return request({ - url: `${prefix}/supplier/listExport`, + url: '/customer/advice/export', method: 'post', responseType: 'blob', data, diff --git a/src/api/customer/customer.ts b/src/api/customer/customer.ts index ebdebe6..724da6e 100644 --- a/src/api/customer/customer.ts +++ b/src/api/customer/customer.ts @@ -3,12 +3,20 @@ */ 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}`, + url: `/customer/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 列表查询 +export function getCustomerListSimple(data: ICustomerQuery) { + return request({ + url: '/customer/listPage', method: 'post', data, }) @@ -17,7 +25,7 @@ // 数据删除 export function deleteCustomer(data: { id: string }) { return request({ - url: `${prefix}/supplier/delete`, + url: '/customer/delete', method: 'post', data, }) @@ -26,7 +34,7 @@ // 查看详情 export function getCustomerDetail(data: { id: string }) { return request({ - url: `${prefix}/supplier/detail`, + url: '/customer/detail', method: 'post', data, }) @@ -35,7 +43,7 @@ // 新增数据 export function addCustomer(data: object) { return request({ - url: '/meter/supplier/submit', + url: '/customer/add', method: 'post', data, }) @@ -43,7 +51,7 @@ // 编辑数据 export function updateCustomer(data: object) { return request({ - url: `${prefix}/supplier/update`, + url: '/customer/update', method: 'post', data, }) @@ -52,10 +60,44 @@ // 导出列表 export function exportCustomerList(data: Omit) { return request({ - url: `${prefix}/supplier/listExport`, + url: '/customer/export', method: 'post', responseType: 'blob', data, }) } +// 根据客户查样品id +export function getSampleByCustomer(data: { id: string; offset: number; limit: number }) { + return request({ + url: `/customer/certificateRecords?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 根据客户查合同记录 +export function getContractByCustomer(data: { id: string; offset: number; limit: number }) { + return request({ + url: `/customer/certificateRecords?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 根据客户查检定记录 +export function getOrderByCustomer(data: { id: string; offset: number; limit: number }) { + return request({ + url: `/customer/contractRecords?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} +// 根据客户查检定记录 +export function getCertificationByCustomer(data: { id: string; offset: number; limit: number }) { + return request({ + url: `/customer/certificateRecords?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} diff --git a/src/api/customer/advice.ts b/src/api/customer/advice.ts index 738dac3..c581a4e 100644 --- a/src/api/customer/advice.ts +++ b/src/api/customer/advice.ts @@ -3,12 +3,11 @@ */ import request from '../index' import type { IAdviceQuery } from '@/views/customer/advice/advice_interface' -const prefix = '/meter' // 列表查询 export function getAdviceList(data: IAdviceQuery) { return request({ - url: `${prefix}/supplier/listPage?offset=${data.offset}&limit=${data.limit}`, + url: `/customer/advice/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', data, }) @@ -17,7 +16,7 @@ // 数据删除 export function deleteAdvice(data: { id: string }) { return request({ - url: `${prefix}/supplier/delete`, + url: '/customer/advice/delete', method: 'post', data, }) @@ -26,7 +25,7 @@ // 查看详情 export function getAdviceDetail(data: { id: string }) { return request({ - url: `${prefix}/supplier/detail`, + url: '/customer/advice/detail', method: 'post', data, }) @@ -35,7 +34,7 @@ // 新增数据 export function addAdvice(data: object) { return request({ - url: '/meter/supplier/submit', + url: '/customer/advice/add', method: 'post', data, }) @@ -43,7 +42,7 @@ // 编辑数据 export function updateAdvice(data: object) { return request({ - url: `${prefix}/supplier/update`, + url: '/customer/advice/update', method: 'post', data, }) @@ -52,7 +51,7 @@ // 导出列表 export function exportAdviceList(data: Omit) { return request({ - url: `${prefix}/supplier/listExport`, + url: '/customer/advice/export', method: 'post', responseType: 'blob', data, diff --git a/src/api/customer/customer.ts b/src/api/customer/customer.ts index ebdebe6..724da6e 100644 --- a/src/api/customer/customer.ts +++ b/src/api/customer/customer.ts @@ -3,12 +3,20 @@ */ 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}`, + url: `/customer/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 列表查询 +export function getCustomerListSimple(data: ICustomerQuery) { + return request({ + url: '/customer/listPage', method: 'post', data, }) @@ -17,7 +25,7 @@ // 数据删除 export function deleteCustomer(data: { id: string }) { return request({ - url: `${prefix}/supplier/delete`, + url: '/customer/delete', method: 'post', data, }) @@ -26,7 +34,7 @@ // 查看详情 export function getCustomerDetail(data: { id: string }) { return request({ - url: `${prefix}/supplier/detail`, + url: '/customer/detail', method: 'post', data, }) @@ -35,7 +43,7 @@ // 新增数据 export function addCustomer(data: object) { return request({ - url: '/meter/supplier/submit', + url: '/customer/add', method: 'post', data, }) @@ -43,7 +51,7 @@ // 编辑数据 export function updateCustomer(data: object) { return request({ - url: `${prefix}/supplier/update`, + url: '/customer/update', method: 'post', data, }) @@ -52,10 +60,44 @@ // 导出列表 export function exportCustomerList(data: Omit) { return request({ - url: `${prefix}/supplier/listExport`, + url: '/customer/export', method: 'post', responseType: 'blob', data, }) } +// 根据客户查样品id +export function getSampleByCustomer(data: { id: string; offset: number; limit: number }) { + return request({ + url: `/customer/certificateRecords?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 根据客户查合同记录 +export function getContractByCustomer(data: { id: string; offset: number; limit: number }) { + return request({ + url: `/customer/certificateRecords?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 根据客户查检定记录 +export function getOrderByCustomer(data: { id: string; offset: number; limit: number }) { + return request({ + url: `/customer/contractRecords?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} +// 根据客户查检定记录 +export function getCertificationByCustomer(data: { id: string; offset: number; limit: number }) { + return request({ + url: `/customer/certificateRecords?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} diff --git a/src/components/AddressSelect/AddressSelect.vue b/src/components/AddressSelect/AddressSelect.vue index 60aa04c..9cbd57f 100644 --- a/src/components/AddressSelect/AddressSelect.vue +++ b/src/components/AddressSelect/AddressSelect.vue @@ -172,7 +172,7 @@ /> ) { return request({ - url: `${prefix}/supplier/listExport`, + url: '/customer/advice/export', method: 'post', responseType: 'blob', data, diff --git a/src/api/customer/customer.ts b/src/api/customer/customer.ts index ebdebe6..724da6e 100644 --- a/src/api/customer/customer.ts +++ b/src/api/customer/customer.ts @@ -3,12 +3,20 @@ */ 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}`, + url: `/customer/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 列表查询 +export function getCustomerListSimple(data: ICustomerQuery) { + return request({ + url: '/customer/listPage', method: 'post', data, }) @@ -17,7 +25,7 @@ // 数据删除 export function deleteCustomer(data: { id: string }) { return request({ - url: `${prefix}/supplier/delete`, + url: '/customer/delete', method: 'post', data, }) @@ -26,7 +34,7 @@ // 查看详情 export function getCustomerDetail(data: { id: string }) { return request({ - url: `${prefix}/supplier/detail`, + url: '/customer/detail', method: 'post', data, }) @@ -35,7 +43,7 @@ // 新增数据 export function addCustomer(data: object) { return request({ - url: '/meter/supplier/submit', + url: '/customer/add', method: 'post', data, }) @@ -43,7 +51,7 @@ // 编辑数据 export function updateCustomer(data: object) { return request({ - url: `${prefix}/supplier/update`, + url: '/customer/update', method: 'post', data, }) @@ -52,10 +60,44 @@ // 导出列表 export function exportCustomerList(data: Omit) { return request({ - url: `${prefix}/supplier/listExport`, + url: '/customer/export', method: 'post', responseType: 'blob', data, }) } +// 根据客户查样品id +export function getSampleByCustomer(data: { id: string; offset: number; limit: number }) { + return request({ + url: `/customer/certificateRecords?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 根据客户查合同记录 +export function getContractByCustomer(data: { id: string; offset: number; limit: number }) { + return request({ + url: `/customer/certificateRecords?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 根据客户查检定记录 +export function getOrderByCustomer(data: { id: string; offset: number; limit: number }) { + return request({ + url: `/customer/contractRecords?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} +// 根据客户查检定记录 +export function getCertificationByCustomer(data: { id: string; offset: number; limit: number }) { + return request({ + url: `/customer/certificateRecords?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} diff --git a/src/components/AddressSelect/AddressSelect.vue b/src/components/AddressSelect/AddressSelect.vue index 60aa04c..9cbd57f 100644 --- a/src/components/AddressSelect/AddressSelect.vue +++ b/src/components/AddressSelect/AddressSelect.vue @@ -172,7 +172,7 @@ /> { - // getSampleDetail({ id: infoId.value }).then((res) => { + // getSapmleDetail({ id: infoId.value }).then((res) => { dataForm.value = { orderId: '123', ABC: 'A', diff --git a/src/api/customer/advice.ts b/src/api/customer/advice.ts index 738dac3..c581a4e 100644 --- a/src/api/customer/advice.ts +++ b/src/api/customer/advice.ts @@ -3,12 +3,11 @@ */ import request from '../index' import type { IAdviceQuery } from '@/views/customer/advice/advice_interface' -const prefix = '/meter' // 列表查询 export function getAdviceList(data: IAdviceQuery) { return request({ - url: `${prefix}/supplier/listPage?offset=${data.offset}&limit=${data.limit}`, + url: `/customer/advice/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', data, }) @@ -17,7 +16,7 @@ // 数据删除 export function deleteAdvice(data: { id: string }) { return request({ - url: `${prefix}/supplier/delete`, + url: '/customer/advice/delete', method: 'post', data, }) @@ -26,7 +25,7 @@ // 查看详情 export function getAdviceDetail(data: { id: string }) { return request({ - url: `${prefix}/supplier/detail`, + url: '/customer/advice/detail', method: 'post', data, }) @@ -35,7 +34,7 @@ // 新增数据 export function addAdvice(data: object) { return request({ - url: '/meter/supplier/submit', + url: '/customer/advice/add', method: 'post', data, }) @@ -43,7 +42,7 @@ // 编辑数据 export function updateAdvice(data: object) { return request({ - url: `${prefix}/supplier/update`, + url: '/customer/advice/update', method: 'post', data, }) @@ -52,7 +51,7 @@ // 导出列表 export function exportAdviceList(data: Omit) { return request({ - url: `${prefix}/supplier/listExport`, + url: '/customer/advice/export', method: 'post', responseType: 'blob', data, diff --git a/src/api/customer/customer.ts b/src/api/customer/customer.ts index ebdebe6..724da6e 100644 --- a/src/api/customer/customer.ts +++ b/src/api/customer/customer.ts @@ -3,12 +3,20 @@ */ 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}`, + url: `/customer/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 列表查询 +export function getCustomerListSimple(data: ICustomerQuery) { + return request({ + url: '/customer/listPage', method: 'post', data, }) @@ -17,7 +25,7 @@ // 数据删除 export function deleteCustomer(data: { id: string }) { return request({ - url: `${prefix}/supplier/delete`, + url: '/customer/delete', method: 'post', data, }) @@ -26,7 +34,7 @@ // 查看详情 export function getCustomerDetail(data: { id: string }) { return request({ - url: `${prefix}/supplier/detail`, + url: '/customer/detail', method: 'post', data, }) @@ -35,7 +43,7 @@ // 新增数据 export function addCustomer(data: object) { return request({ - url: '/meter/supplier/submit', + url: '/customer/add', method: 'post', data, }) @@ -43,7 +51,7 @@ // 编辑数据 export function updateCustomer(data: object) { return request({ - url: `${prefix}/supplier/update`, + url: '/customer/update', method: 'post', data, }) @@ -52,10 +60,44 @@ // 导出列表 export function exportCustomerList(data: Omit) { return request({ - url: `${prefix}/supplier/listExport`, + url: '/customer/export', method: 'post', responseType: 'blob', data, }) } +// 根据客户查样品id +export function getSampleByCustomer(data: { id: string; offset: number; limit: number }) { + return request({ + url: `/customer/certificateRecords?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 根据客户查合同记录 +export function getContractByCustomer(data: { id: string; offset: number; limit: number }) { + return request({ + url: `/customer/certificateRecords?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 根据客户查检定记录 +export function getOrderByCustomer(data: { id: string; offset: number; limit: number }) { + return request({ + url: `/customer/contractRecords?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} +// 根据客户查检定记录 +export function getCertificationByCustomer(data: { id: string; offset: number; limit: number }) { + return request({ + url: `/customer/certificateRecords?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} diff --git a/src/components/AddressSelect/AddressSelect.vue b/src/components/AddressSelect/AddressSelect.vue index 60aa04c..9cbd57f 100644 --- a/src/components/AddressSelect/AddressSelect.vue +++ b/src/components/AddressSelect/AddressSelect.vue @@ -172,7 +172,7 @@ /> { - // getSampleDetail({ id: infoId.value }).then((res) => { + // getSapmleDetail({ id: infoId.value }).then((res) => { dataForm.value = { orderId: '123', ABC: 'A', diff --git a/src/views/customer/advice/adviceEdit.vue b/src/views/customer/advice/adviceEdit.vue index a5411c1..629b33c 100644 --- a/src/views/customer/advice/adviceEdit.vue +++ b/src/views/customer/advice/adviceEdit.vue @@ -9,6 +9,7 @@ import type { IAdvice, SimpleCompany } from './advice_interface' import { addAdvice, getAdviceDetail, updateAdvice } from '@/api/customer/advice' import { getDictByCode } from '@/api/system/dict' +import { getCustomerListSimple } from '@/api/customer/customer' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add, edit, detail @@ -93,42 +94,29 @@ const getInfo = () => { loading.value = true getAdviceDetail({ id: infoId.value }).then((res) => { - res.data = { - id: '1597579843411234817', - adviceNo: 'ts202201022131', // 投诉编号 - adviceClass: '0', // 投诉类型 - adviceType: '1', // 投诉类别 - advicePerson: '张三', // 投诉人-名称 - personPhone: '87447', // 投诉人联系方式 - customerName: '特别大公司', // 公司名称 - adviceTime: '2022-12-25 23:58:00', - customerNo: '', // 客户编号 - customerId: '', // 客户id - content: '没人接电话', // 投诉内容 - handleStatus: '0', // 处置状态-0未处置,1已处置 - handleMessage: '', // 处置意见 - } dataForm.value = res.data loading.value = false }) } -const tempCompanyList = ref([ - { customerId: '111', customerNo: '12312456', customerName: '京东', businessSizeName: '0~10万', companySizeName: '小微企业', gradeName: '优质', evaluationName: '重点客户' }, - { customerId: '112', customerNo: '12312451', customerName: '阿里', businessSizeName: '0~10万', companySizeName: '大企业', gradeName: '一般', evaluationName: '重点客户' }, - { customerId: '113', customerNo: '12312452', customerName: '淘宝', businessSizeName: '0~10万', companySizeName: '小微企业', gradeName: '优质', evaluationName: '重点客户' }, - { customerId: '114', customerNo: '12312453', customerName: '天猫', businessSizeName: '0~10万', companySizeName: '小微企业', gradeName: '优质', evaluationName: '重点客户' }, - { customerId: '115', customerNo: '12312454', customerName: '203d', businessSizeName: '0~10万', companySizeName: '小微企业', gradeName: '优质', evaluationName: '重点客户' }, - { customerId: '116', customerNo: '12312456', customerName: '万达', businessSizeName: '0~10万', companySizeName: '小微企业', gradeName: '优质', evaluationName: '重点客户' }, -]) // 查询公司列表 const queryCompany = (queryString: string, cb: any) => { - // TODO: 远程查询符合要求的公司列表 - const results = queryString ? tempCompanyList.value.filter((item) => { item.customerName.includes(queryString) }) : tempCompanyList.value - cb(results) + const params = { + businessSize: '', // 业务规模 + customerName: queryString, // 公司名称 + customerNo: '', // 客户编号 + grade: '', // 履约评级 + offset: 1, + limit: 20, + } + // 远程查询符合要求的公司列表 + getCustomerListSimple(params).then((res) => { + const result = res.data.rows + cb(result) + }) } -// 选中 +// 选中客户 const handleCompanySelect = (select: Record) => { const item = select as SimpleCompany companyInfo.customerName = item.customerName @@ -138,12 +126,12 @@ companyInfo.companySizeName = item.companySizeName companyInfo.businessSizeName = item.businessSizeName companyInfo.evaluationName = item.evaluationName + dataForm.value.customerNo = item.customerNo } // 打印表单 const printObj = ref({ id: 'form', // 需要打印元素的id popTitle: '投诉/建议详情', // 打印配置页上方的标题 - // extraHead: '

投诉/建议详情

', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 preview: false, // 是否启动预览模式,默认是false standard: '', extarCss: '', @@ -294,7 +282,7 @@ ) { return request({ - url: `${prefix}/supplier/listExport`, + url: '/customer/advice/export', method: 'post', responseType: 'blob', data, diff --git a/src/api/customer/customer.ts b/src/api/customer/customer.ts index ebdebe6..724da6e 100644 --- a/src/api/customer/customer.ts +++ b/src/api/customer/customer.ts @@ -3,12 +3,20 @@ */ 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}`, + url: `/customer/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 列表查询 +export function getCustomerListSimple(data: ICustomerQuery) { + return request({ + url: '/customer/listPage', method: 'post', data, }) @@ -17,7 +25,7 @@ // 数据删除 export function deleteCustomer(data: { id: string }) { return request({ - url: `${prefix}/supplier/delete`, + url: '/customer/delete', method: 'post', data, }) @@ -26,7 +34,7 @@ // 查看详情 export function getCustomerDetail(data: { id: string }) { return request({ - url: `${prefix}/supplier/detail`, + url: '/customer/detail', method: 'post', data, }) @@ -35,7 +43,7 @@ // 新增数据 export function addCustomer(data: object) { return request({ - url: '/meter/supplier/submit', + url: '/customer/add', method: 'post', data, }) @@ -43,7 +51,7 @@ // 编辑数据 export function updateCustomer(data: object) { return request({ - url: `${prefix}/supplier/update`, + url: '/customer/update', method: 'post', data, }) @@ -52,10 +60,44 @@ // 导出列表 export function exportCustomerList(data: Omit) { return request({ - url: `${prefix}/supplier/listExport`, + url: '/customer/export', method: 'post', responseType: 'blob', data, }) } +// 根据客户查样品id +export function getSampleByCustomer(data: { id: string; offset: number; limit: number }) { + return request({ + url: `/customer/certificateRecords?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 根据客户查合同记录 +export function getContractByCustomer(data: { id: string; offset: number; limit: number }) { + return request({ + url: `/customer/certificateRecords?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 根据客户查检定记录 +export function getOrderByCustomer(data: { id: string; offset: number; limit: number }) { + return request({ + url: `/customer/contractRecords?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} +// 根据客户查检定记录 +export function getCertificationByCustomer(data: { id: string; offset: number; limit: number }) { + return request({ + url: `/customer/certificateRecords?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} diff --git a/src/components/AddressSelect/AddressSelect.vue b/src/components/AddressSelect/AddressSelect.vue index 60aa04c..9cbd57f 100644 --- a/src/components/AddressSelect/AddressSelect.vue +++ b/src/components/AddressSelect/AddressSelect.vue @@ -172,7 +172,7 @@ /> { - // getSampleDetail({ id: infoId.value }).then((res) => { + // getSapmleDetail({ id: infoId.value }).then((res) => { dataForm.value = { orderId: '123', ABC: 'A', diff --git a/src/views/customer/advice/adviceEdit.vue b/src/views/customer/advice/adviceEdit.vue index a5411c1..629b33c 100644 --- a/src/views/customer/advice/adviceEdit.vue +++ b/src/views/customer/advice/adviceEdit.vue @@ -9,6 +9,7 @@ import type { IAdvice, SimpleCompany } from './advice_interface' import { addAdvice, getAdviceDetail, updateAdvice } from '@/api/customer/advice' import { getDictByCode } from '@/api/system/dict' +import { getCustomerListSimple } from '@/api/customer/customer' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add, edit, detail @@ -93,42 +94,29 @@ const getInfo = () => { loading.value = true getAdviceDetail({ id: infoId.value }).then((res) => { - res.data = { - id: '1597579843411234817', - adviceNo: 'ts202201022131', // 投诉编号 - adviceClass: '0', // 投诉类型 - adviceType: '1', // 投诉类别 - advicePerson: '张三', // 投诉人-名称 - personPhone: '87447', // 投诉人联系方式 - customerName: '特别大公司', // 公司名称 - adviceTime: '2022-12-25 23:58:00', - customerNo: '', // 客户编号 - customerId: '', // 客户id - content: '没人接电话', // 投诉内容 - handleStatus: '0', // 处置状态-0未处置,1已处置 - handleMessage: '', // 处置意见 - } dataForm.value = res.data loading.value = false }) } -const tempCompanyList = ref([ - { customerId: '111', customerNo: '12312456', customerName: '京东', businessSizeName: '0~10万', companySizeName: '小微企业', gradeName: '优质', evaluationName: '重点客户' }, - { customerId: '112', customerNo: '12312451', customerName: '阿里', businessSizeName: '0~10万', companySizeName: '大企业', gradeName: '一般', evaluationName: '重点客户' }, - { customerId: '113', customerNo: '12312452', customerName: '淘宝', businessSizeName: '0~10万', companySizeName: '小微企业', gradeName: '优质', evaluationName: '重点客户' }, - { customerId: '114', customerNo: '12312453', customerName: '天猫', businessSizeName: '0~10万', companySizeName: '小微企业', gradeName: '优质', evaluationName: '重点客户' }, - { customerId: '115', customerNo: '12312454', customerName: '203d', businessSizeName: '0~10万', companySizeName: '小微企业', gradeName: '优质', evaluationName: '重点客户' }, - { customerId: '116', customerNo: '12312456', customerName: '万达', businessSizeName: '0~10万', companySizeName: '小微企业', gradeName: '优质', evaluationName: '重点客户' }, -]) // 查询公司列表 const queryCompany = (queryString: string, cb: any) => { - // TODO: 远程查询符合要求的公司列表 - const results = queryString ? tempCompanyList.value.filter((item) => { item.customerName.includes(queryString) }) : tempCompanyList.value - cb(results) + const params = { + businessSize: '', // 业务规模 + customerName: queryString, // 公司名称 + customerNo: '', // 客户编号 + grade: '', // 履约评级 + offset: 1, + limit: 20, + } + // 远程查询符合要求的公司列表 + getCustomerListSimple(params).then((res) => { + const result = res.data.rows + cb(result) + }) } -// 选中 +// 选中客户 const handleCompanySelect = (select: Record) => { const item = select as SimpleCompany companyInfo.customerName = item.customerName @@ -138,12 +126,12 @@ companyInfo.companySizeName = item.companySizeName companyInfo.businessSizeName = item.businessSizeName companyInfo.evaluationName = item.evaluationName + dataForm.value.customerNo = item.customerNo } // 打印表单 const printObj = ref({ id: 'form', // 需要打印元素的id popTitle: '投诉/建议详情', // 打印配置页上方的标题 - // extraHead: '

投诉/建议详情

', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 preview: false, // 是否启动预览模式,默认是false standard: '', extarCss: '', @@ -294,7 +282,7 @@ (['', '']) // 表头 const columns = ref([ - { text: '投诉建议编号', value: 'adviceNo', width: '160', align: 'center' }, - { text: '客户编号', value: 'customerNo', width: '120', align: 'center' }, - { text: '客户名称', value: 'customerName', align: 'center' }, - { text: '整体评价', value: 'evaluationName', align: 'center' }, + { text: '投诉建议编号', value: 'adviceNo', width: '155', align: 'center' }, + { text: '客户编号', value: 'customerNo', width: '155', align: 'center' }, + { text: '客户名称', value: 'customerName', align: 'center', width: '180' }, + { text: '整体评价', value: 'evaluationName', align: 'center', width: '90' }, { text: '投诉/建议内容', value: 'content', align: 'center' }, - { text: '投诉人', value: 'advicePerson', align: 'center' }, - { text: '联系方式', value: 'personPhone', align: 'center' }, - { text: '投诉时间', value: 'createTime', align: 'center', width: '180px' }, + { text: '投诉人', value: 'advicePerson', align: 'center', width: '90' }, + { text: '联系方式', value: 'personPhone', align: 'center', width: '120' }, + { text: '投诉时间', value: 'createTime', align: 'center', width: '165px' }, ]) // 表格数据 const list = ref([]) @@ -54,7 +53,7 @@ listQuery.value.endTime = timeRange.value[1] as string || '' getAdviceList(listQuery.value).then((response) => { // 模拟数据 - response.data.rows = [{ id: '1597579843411234817', advicePerson: '张三', personPhone: '87447', createTime: '2023-01-02 08:25:35', adviceNo: '111111', content: '服务态度不好', businessScope: 'test1', evaluation: '1', evaluationName: '优质', customerName: '京东集团', customerNo: 'sygf202211290001', updateTime: '2023-01-10 09:56:57' }] + // response.data.rows = [{ id: '1597579843411234817', advicePerson: '张三', personPhone: '87447', createTime: '2023-01-02 08:25:35', adviceNo: '111111', content: '服务态度不好', businessScope: 'test1', evaluation: '1', evaluationName: '优质', customerName: '京东集团', customerNo: 'sygf202211290001', updateTime: '2023-01-10 09:56:57' }] list.value = response.data.rows total.value = parseInt(response.data.total) loadingTable.value = false diff --git a/src/api/customer/advice.ts b/src/api/customer/advice.ts index 738dac3..c581a4e 100644 --- a/src/api/customer/advice.ts +++ b/src/api/customer/advice.ts @@ -3,12 +3,11 @@ */ import request from '../index' import type { IAdviceQuery } from '@/views/customer/advice/advice_interface' -const prefix = '/meter' // 列表查询 export function getAdviceList(data: IAdviceQuery) { return request({ - url: `${prefix}/supplier/listPage?offset=${data.offset}&limit=${data.limit}`, + url: `/customer/advice/listPage?offset=${data.offset}&limit=${data.limit}`, method: 'post', data, }) @@ -17,7 +16,7 @@ // 数据删除 export function deleteAdvice(data: { id: string }) { return request({ - url: `${prefix}/supplier/delete`, + url: '/customer/advice/delete', method: 'post', data, }) @@ -26,7 +25,7 @@ // 查看详情 export function getAdviceDetail(data: { id: string }) { return request({ - url: `${prefix}/supplier/detail`, + url: '/customer/advice/detail', method: 'post', data, }) @@ -35,7 +34,7 @@ // 新增数据 export function addAdvice(data: object) { return request({ - url: '/meter/supplier/submit', + url: '/customer/advice/add', method: 'post', data, }) @@ -43,7 +42,7 @@ // 编辑数据 export function updateAdvice(data: object) { return request({ - url: `${prefix}/supplier/update`, + url: '/customer/advice/update', method: 'post', data, }) @@ -52,7 +51,7 @@ // 导出列表 export function exportAdviceList(data: Omit) { return request({ - url: `${prefix}/supplier/listExport`, + url: '/customer/advice/export', method: 'post', responseType: 'blob', data, diff --git a/src/api/customer/customer.ts b/src/api/customer/customer.ts index ebdebe6..724da6e 100644 --- a/src/api/customer/customer.ts +++ b/src/api/customer/customer.ts @@ -3,12 +3,20 @@ */ 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}`, + url: `/customer/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 列表查询 +export function getCustomerListSimple(data: ICustomerQuery) { + return request({ + url: '/customer/listPage', method: 'post', data, }) @@ -17,7 +25,7 @@ // 数据删除 export function deleteCustomer(data: { id: string }) { return request({ - url: `${prefix}/supplier/delete`, + url: '/customer/delete', method: 'post', data, }) @@ -26,7 +34,7 @@ // 查看详情 export function getCustomerDetail(data: { id: string }) { return request({ - url: `${prefix}/supplier/detail`, + url: '/customer/detail', method: 'post', data, }) @@ -35,7 +43,7 @@ // 新增数据 export function addCustomer(data: object) { return request({ - url: '/meter/supplier/submit', + url: '/customer/add', method: 'post', data, }) @@ -43,7 +51,7 @@ // 编辑数据 export function updateCustomer(data: object) { return request({ - url: `${prefix}/supplier/update`, + url: '/customer/update', method: 'post', data, }) @@ -52,10 +60,44 @@ // 导出列表 export function exportCustomerList(data: Omit) { return request({ - url: `${prefix}/supplier/listExport`, + url: '/customer/export', method: 'post', responseType: 'blob', data, }) } +// 根据客户查样品id +export function getSampleByCustomer(data: { id: string; offset: number; limit: number }) { + return request({ + url: `/customer/certificateRecords?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 根据客户查合同记录 +export function getContractByCustomer(data: { id: string; offset: number; limit: number }) { + return request({ + url: `/customer/certificateRecords?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 根据客户查检定记录 +export function getOrderByCustomer(data: { id: string; offset: number; limit: number }) { + return request({ + url: `/customer/contractRecords?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} +// 根据客户查检定记录 +export function getCertificationByCustomer(data: { id: string; offset: number; limit: number }) { + return request({ + url: `/customer/certificateRecords?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} diff --git a/src/components/AddressSelect/AddressSelect.vue b/src/components/AddressSelect/AddressSelect.vue index 60aa04c..9cbd57f 100644 --- a/src/components/AddressSelect/AddressSelect.vue +++ b/src/components/AddressSelect/AddressSelect.vue @@ -172,7 +172,7 @@ /> { - // getSampleDetail({ id: infoId.value }).then((res) => { + // getSapmleDetail({ id: infoId.value }).then((res) => { dataForm.value = { orderId: '123', ABC: 'A', diff --git a/src/views/customer/advice/adviceEdit.vue b/src/views/customer/advice/adviceEdit.vue index a5411c1..629b33c 100644 --- a/src/views/customer/advice/adviceEdit.vue +++ b/src/views/customer/advice/adviceEdit.vue @@ -9,6 +9,7 @@ import type { IAdvice, SimpleCompany } from './advice_interface' import { addAdvice, getAdviceDetail, updateAdvice } from '@/api/customer/advice' import { getDictByCode } from '@/api/system/dict' +import { getCustomerListSimple } from '@/api/customer/customer' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const pageType = ref('add') // 页面类型: add, edit, detail @@ -93,42 +94,29 @@ const getInfo = () => { loading.value = true getAdviceDetail({ id: infoId.value }).then((res) => { - res.data = { - id: '1597579843411234817', - adviceNo: 'ts202201022131', // 投诉编号 - adviceClass: '0', // 投诉类型 - adviceType: '1', // 投诉类别 - advicePerson: '张三', // 投诉人-名称 - personPhone: '87447', // 投诉人联系方式 - customerName: '特别大公司', // 公司名称 - adviceTime: '2022-12-25 23:58:00', - customerNo: '', // 客户编号 - customerId: '', // 客户id - content: '没人接电话', // 投诉内容 - handleStatus: '0', // 处置状态-0未处置,1已处置 - handleMessage: '', // 处置意见 - } dataForm.value = res.data loading.value = false }) } -const tempCompanyList = ref([ - { customerId: '111', customerNo: '12312456', customerName: '京东', businessSizeName: '0~10万', companySizeName: '小微企业', gradeName: '优质', evaluationName: '重点客户' }, - { customerId: '112', customerNo: '12312451', customerName: '阿里', businessSizeName: '0~10万', companySizeName: '大企业', gradeName: '一般', evaluationName: '重点客户' }, - { customerId: '113', customerNo: '12312452', customerName: '淘宝', businessSizeName: '0~10万', companySizeName: '小微企业', gradeName: '优质', evaluationName: '重点客户' }, - { customerId: '114', customerNo: '12312453', customerName: '天猫', businessSizeName: '0~10万', companySizeName: '小微企业', gradeName: '优质', evaluationName: '重点客户' }, - { customerId: '115', customerNo: '12312454', customerName: '203d', businessSizeName: '0~10万', companySizeName: '小微企业', gradeName: '优质', evaluationName: '重点客户' }, - { customerId: '116', customerNo: '12312456', customerName: '万达', businessSizeName: '0~10万', companySizeName: '小微企业', gradeName: '优质', evaluationName: '重点客户' }, -]) // 查询公司列表 const queryCompany = (queryString: string, cb: any) => { - // TODO: 远程查询符合要求的公司列表 - const results = queryString ? tempCompanyList.value.filter((item) => { item.customerName.includes(queryString) }) : tempCompanyList.value - cb(results) + const params = { + businessSize: '', // 业务规模 + customerName: queryString, // 公司名称 + customerNo: '', // 客户编号 + grade: '', // 履约评级 + offset: 1, + limit: 20, + } + // 远程查询符合要求的公司列表 + getCustomerListSimple(params).then((res) => { + const result = res.data.rows + cb(result) + }) } -// 选中 +// 选中客户 const handleCompanySelect = (select: Record) => { const item = select as SimpleCompany companyInfo.customerName = item.customerName @@ -138,12 +126,12 @@ companyInfo.companySizeName = item.companySizeName companyInfo.businessSizeName = item.businessSizeName companyInfo.evaluationName = item.evaluationName + dataForm.value.customerNo = item.customerNo } // 打印表单 const printObj = ref({ id: 'form', // 需要打印元素的id popTitle: '投诉/建议详情', // 打印配置页上方的标题 - // extraHead: '

投诉/建议详情

', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 preview: false, // 是否启动预览模式,默认是false standard: '', extarCss: '', @@ -294,7 +282,7 @@ (['', '']) // 表头 const columns = ref([ - { text: '投诉建议编号', value: 'adviceNo', width: '160', align: 'center' }, - { text: '客户编号', value: 'customerNo', width: '120', align: 'center' }, - { text: '客户名称', value: 'customerName', align: 'center' }, - { text: '整体评价', value: 'evaluationName', align: 'center' }, + { text: '投诉建议编号', value: 'adviceNo', width: '155', align: 'center' }, + { text: '客户编号', value: 'customerNo', width: '155', align: 'center' }, + { text: '客户名称', value: 'customerName', align: 'center', width: '180' }, + { text: '整体评价', value: 'evaluationName', align: 'center', width: '90' }, { text: '投诉/建议内容', value: 'content', align: 'center' }, - { text: '投诉人', value: 'advicePerson', align: 'center' }, - { text: '联系方式', value: 'personPhone', align: 'center' }, - { text: '投诉时间', value: 'createTime', align: 'center', width: '180px' }, + { text: '投诉人', value: 'advicePerson', align: 'center', width: '90' }, + { text: '联系方式', value: 'personPhone', align: 'center', width: '120' }, + { text: '投诉时间', value: 'createTime', align: 'center', width: '165px' }, ]) // 表格数据 const list = ref([]) @@ -54,7 +53,7 @@ listQuery.value.endTime = timeRange.value[1] as string || '' getAdviceList(listQuery.value).then((response) => { // 模拟数据 - response.data.rows = [{ id: '1597579843411234817', advicePerson: '张三', personPhone: '87447', createTime: '2023-01-02 08:25:35', adviceNo: '111111', content: '服务态度不好', businessScope: 'test1', evaluation: '1', evaluationName: '优质', customerName: '京东集团', customerNo: 'sygf202211290001', updateTime: '2023-01-10 09:56:57' }] + // response.data.rows = [{ id: '1597579843411234817', advicePerson: '张三', personPhone: '87447', createTime: '2023-01-02 08:25:35', adviceNo: '111111', content: '服务态度不好', businessScope: 'test1', evaluation: '1', evaluationName: '优质', customerName: '京东集团', customerNo: 'sygf202211290001', updateTime: '2023-01-10 09:56:57' }] list.value = response.data.rows total.value = parseInt(response.data.total) loadingTable.value = false diff --git a/src/views/customer/customerInfo/customerEdit.vue b/src/views/customer/customerInfo/customerEdit.vue index 23c294a..5e9b72c 100644 --- a/src/views/customer/customerInfo/customerEdit.vue +++ b/src/views/customer/customerInfo/customerEdit.vue @@ -1,17 +1,16 @@ -