diff --git a/src/api/customer/customer.ts b/src/api/customer/customer.ts index ebdebe6..e650737 100644 --- a/src/api/customer/customer.ts +++ b/src/api/customer/customer.ts @@ -3,12 +3,11 @@ */ 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, }) @@ -17,7 +16,7 @@ // 数据删除 export function deleteCustomer(data: { id: string }) { return request({ - url: `${prefix}/supplier/delete`, + url: '/customer/delete', method: 'post', data, }) @@ -26,7 +25,7 @@ // 查看详情 export function getCustomerDetail(data: { id: string }) { return request({ - url: `${prefix}/supplier/detail`, + url: '/customer/detail', method: 'post', data, }) @@ -35,7 +34,7 @@ // 新增数据 export function addCustomer(data: object) { return request({ - url: '/meter/supplier/submit', + url: '/customer/add', method: 'post', data, }) @@ -43,7 +42,7 @@ // 编辑数据 export function updateCustomer(data: object) { return request({ - url: `${prefix}/supplier/update`, + url: '/customer/update', method: 'post', data, }) @@ -52,7 +51,7 @@ // 导出列表 export function exportCustomerList(data: Omit) { return request({ - url: `${prefix}/supplier/listExport`, + url: '/customer/export', method: 'post', responseType: 'blob', data, diff --git a/src/api/customer/customer.ts b/src/api/customer/customer.ts index ebdebe6..e650737 100644 --- a/src/api/customer/customer.ts +++ b/src/api/customer/customer.ts @@ -3,12 +3,11 @@ */ 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, }) @@ -17,7 +16,7 @@ // 数据删除 export function deleteCustomer(data: { id: string }) { return request({ - url: `${prefix}/supplier/delete`, + url: '/customer/delete', method: 'post', data, }) @@ -26,7 +25,7 @@ // 查看详情 export function getCustomerDetail(data: { id: string }) { return request({ - url: `${prefix}/supplier/detail`, + url: '/customer/detail', method: 'post', data, }) @@ -35,7 +34,7 @@ // 新增数据 export function addCustomer(data: object) { return request({ - url: '/meter/supplier/submit', + url: '/customer/add', method: 'post', data, }) @@ -43,7 +42,7 @@ // 编辑数据 export function updateCustomer(data: object) { return request({ - url: `${prefix}/supplier/update`, + url: '/customer/update', method: 'post', data, }) @@ -52,7 +51,7 @@ // 导出列表 export function exportCustomerList(data: Omit) { return request({ - url: `${prefix}/supplier/listExport`, + url: '/customer/export', method: 'post', responseType: 'blob', data, diff --git a/src/views/business/schedule/task/taskEdit.vue b/src/views/business/schedule/task/taskEdit.vue index fbe670d..465b2e7 100644 --- a/src/views/business/schedule/task/taskEdit.vue +++ b/src/views/business/schedule/task/taskEdit.vue @@ -10,7 +10,7 @@ import showPhoto from '@/views/system/tool/showPhoto.vue' import { SCHEDULE } from '@/utils/scheduleDict' import TemplateTable from '@/views/customer/customerInfo/templateTable.vue' -import { getSampleDetail, updateSample } from '@/api/customer/sampleList' +import { getSapmleDetail, updateSample } from '@/api/customer/sampleList' import countries from '@/components/AddressSelect/country-code.json' import type { TableColumn } from '@/components/NormalTable/table_interface' import { getDictByCode } from '@/api/system/dict' @@ -198,7 +198,7 @@ // 获取样品详情 const getInfo = () => { - // getSampleDetail({ id: infoId.value }).then((res) => { + // getSapmleDetail({ id: infoId.value }).then((res) => { dataForm.value = { orderId: '123', ABC: 'A', diff --git a/src/api/customer/customer.ts b/src/api/customer/customer.ts index ebdebe6..e650737 100644 --- a/src/api/customer/customer.ts +++ b/src/api/customer/customer.ts @@ -3,12 +3,11 @@ */ 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, }) @@ -17,7 +16,7 @@ // 数据删除 export function deleteCustomer(data: { id: string }) { return request({ - url: `${prefix}/supplier/delete`, + url: '/customer/delete', method: 'post', data, }) @@ -26,7 +25,7 @@ // 查看详情 export function getCustomerDetail(data: { id: string }) { return request({ - url: `${prefix}/supplier/detail`, + url: '/customer/detail', method: 'post', data, }) @@ -35,7 +34,7 @@ // 新增数据 export function addCustomer(data: object) { return request({ - url: '/meter/supplier/submit', + url: '/customer/add', method: 'post', data, }) @@ -43,7 +42,7 @@ // 编辑数据 export function updateCustomer(data: object) { return request({ - url: `${prefix}/supplier/update`, + url: '/customer/update', method: 'post', data, }) @@ -52,7 +51,7 @@ // 导出列表 export function exportCustomerList(data: Omit) { return request({ - url: `${prefix}/supplier/listExport`, + url: '/customer/export', method: 'post', responseType: 'blob', data, diff --git a/src/views/business/schedule/task/taskEdit.vue b/src/views/business/schedule/task/taskEdit.vue index fbe670d..465b2e7 100644 --- a/src/views/business/schedule/task/taskEdit.vue +++ b/src/views/business/schedule/task/taskEdit.vue @@ -10,7 +10,7 @@ import showPhoto from '@/views/system/tool/showPhoto.vue' import { SCHEDULE } from '@/utils/scheduleDict' import TemplateTable from '@/views/customer/customerInfo/templateTable.vue' -import { getSampleDetail, updateSample } from '@/api/customer/sampleList' +import { getSapmleDetail, updateSample } from '@/api/customer/sampleList' import countries from '@/components/AddressSelect/country-code.json' import type { TableColumn } from '@/components/NormalTable/table_interface' import { getDictByCode } from '@/api/system/dict' @@ -198,7 +198,7 @@ // 获取样品详情 const getInfo = () => { - // getSampleDetail({ id: infoId.value }).then((res) => { + // getSapmleDetail({ id: infoId.value }).then((res) => { dataForm.value = { orderId: '123', ABC: 'A', diff --git a/src/views/customer/customerInfo/customerEdit.vue b/src/views/customer/customerInfo/customerEdit.vue index 23c294a..cc987da 100644 --- a/src/views/customer/customerInfo/customerEdit.vue +++ b/src/views/customer/customerInfo/customerEdit.vue @@ -51,18 +51,18 @@ companySize: '', // 公司规模 businessSize: '', // 业务规模 evaluation: '', // 整体评价 - companyAddress: '', - companyArea: '', - companyCity: '', - companyCountry: '', - companyProvince: '', - companyAreaName: '', - companyCityName: '', - companyCountryName: '', - companyProvinceName: '', + fullAddress: '', + addressArea: '', + addressCity: '', + addressCountry: '', + addressProvince: '', + addressAreaName: '', + addressCityName: '', + addressCountryName: '', + addressProvinceName: '', director: '', fax: '', - invoiceAddress: '', + invoiceFullAddress: '', invoiceArea: '', invoiceCity: '', invoiceCountry: '', @@ -79,11 +79,11 @@ remark: '', taxNumber: '', website: '', - customerPersonList: [], + customerUserList: [], }) -const companyAddress = ref([]) // 公司地址 -const invoiceAddress = ref([]) // 开票地址 -const CustomerPersonList: Ref = ref([]) // 人员列表 +const fullAddress = ref([]) // 公司地址 +const invoiceFullAddress = ref([]) // 开票地址 +const customerPersonList: Ref = ref([]) // 人员列表 const columns = ref([ { text: '姓名', value: 'name', required: true }, { text: '工作部门', value: 'department', required: false }, @@ -100,10 +100,10 @@ certificationRecords: [] as SimpleCertification[], }) // 获取人员列表 -const fetchPerson = function (query = null) { - dataList.value.personList = dataForm.value.customerPersonList - dataList.value.personList = [{ name: '张三', department: '', job: '总经理', phone: '68387447' }, { name: '李四', department: '营销', job: '销售', phone: '68387447' }] -} +// const fetchPerson = function (query = null) { +// dataList.value.personList = dataForm.value.customerUserList +// // dataList.value.personList = [{ name: '张三', department: '', job: '总经理', phone: '68387447' }, { name: '李四', department: '营销', job: '销售', phone: '68387447' }] +// } // 获取样品列表 const fetchSampleList = function (query = null) { dataList.value.sampleRecords = [{ sampleCode: 'abc123', sampleName: '血压计', sampleModel: 'xxxx', manufacturingNo: '111', mesureTime: '2022-12-25 00:00:00', mesurePeriod: '6个月' }] @@ -125,7 +125,7 @@ columns: TableColumn[] pagination: boolean list: 'personList' | 'sampleRecords' | 'contractRecords' | 'measureRecords' | 'certificationRecords' - searchFunc: Function + searchFunc: Function | null } // 菜单 const menu: Menu[] = [ @@ -139,7 +139,7 @@ ], pagination: false, list: 'personList', - searchFunc: fetchPerson, + searchFunc: null, }, { name: '样品记录', @@ -251,19 +251,20 @@ const getInfo = () => { getCustomerDetail({ id: infoId.value }).then((res) => { - res.data = { 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: '110107', companyCity: '110100', companyCountry: 'CN', companyProvince: '110000', createTime: '2022-11-29 21:14:50', director: '刘强东', fax: 'test1', id: '1597579843411234817', invoiceAddress: '五棵松', invoiceAreaName: '海淀区', invoiceCityName: '北京市', invoiceCountryName: '中国', invoiceProvinceName: '北京', invoiceyArea: '110107', invoiceCity: '110100', invoiceCountry: 'CN', invoiceProvince: '110000', 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' } + // res.data = { bankAccount: '银行账户', bankAccountNumber: '银行账号', bankName: '工商银行', briefName: '京东', businessContent: '电商', businessScope: 'test1', grade: '1', gradeName: '优质', companySize: '1', companySizeName: '优质', businessSize: '1', businessSizeName: '小微企业', evaluation: '1', evaluationName: '优质', fullAddress: '五棵松', addressAreaName: '海淀区', addressCityName: '北京市', addressCountryName: '中国', addressProvinceName: '北京', addressArea: '110107', addressCity: '110100', addressCountry: 'CN', addressProvince: '110000', createTime: '2022-11-29 21:14:50', director: '刘强东', fax: 'test1', id: '1597579843411234817', invoiceFullAddress: '五棵松', invoiceAreaName: '海淀区', invoiceCityName: '北京市', invoiceCountryName: '中国', invoiceProvinceName: '北京', invoiceyArea: '110107', invoiceCity: '110100', invoiceCountry: 'CN', invoiceProvince: '110000', 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' } dataForm.value = res.data if (pageType.value == 'detail') { - companyAddress.value = [dataForm.value.companyCountryName, dataForm.value.companyProvinceName, dataForm.value.companyCityName, dataForm.value.companyAreaName, dataForm.value.companyAddress] - invoiceAddress.value = [dataForm.value.invoiceCountryName, dataForm.value.invoiceProvinceName, dataForm.value.invoiceCityName, dataForm.value.invoiceAreaName, dataForm.value.invoiceAddress] + fullAddress.value = [dataForm.value.addressCountryName, dataForm.value.addressProvinceName, dataForm.value.addressCityName, dataForm.value.addressAreaName, dataForm.value.fullAddress] + invoiceFullAddress.value = [dataForm.value.invoiceCountryName, dataForm.value.invoiceProvinceName, dataForm.value.invoiceCityName, dataForm.value.invoiceAreaName, dataForm.value.invoiceFullAddress] for (const item of menu) { - item.searchFunc() + if (item.searchFunc) { item.searchFunc() } } } else { - companyAddress.value = [dataForm.value.companyCountry, dataForm.value.companyProvince, dataForm.value.companyCity, dataForm.value.companyArea, dataForm.value.companyAddress] - invoiceAddress.value = [dataForm.value.invoiceCountry, dataForm.value.invoiceProvince, dataForm.value.invoiceCity, dataForm.value.invoiceArea, dataForm.value.invoiceAddress] + fullAddress.value = [dataForm.value.addressCountry, dataForm.value.addressProvince, dataForm.value.addressCity, dataForm.value.addressArea, dataForm.value.fullAddress] + invoiceFullAddress.value = [dataForm.value.invoiceCountry, dataForm.value.invoiceProvince, dataForm.value.invoiceCity, dataForm.value.invoiceArea, dataForm.value.invoiceFullAddress] } + customerPersonList.value = res.data.customerUserList }) } @@ -273,24 +274,24 @@ } // 公司地址变化后给对象赋值 -function companyAddressChange(addressObj: IAddress) { - dataForm.value.companyCountry = addressObj.country - dataForm.value.companyProvince = addressObj.province - dataForm.value.companyCity = addressObj.city - dataForm.value.companyArea = addressObj.area - dataForm.value.companyAddress = addressObj.address - dataForm.value.companyCountryName = addressObj.countryName - dataForm.value.companyProvinceName = addressObj.provinceName - dataForm.value.companyCityName = addressObj.cityName - dataForm.value.companyAreaName = addressObj.areaName +function fullAddressChange(addressObj: IAddress) { + dataForm.value.addressCountry = addressObj.country + dataForm.value.addressProvince = addressObj.province + dataForm.value.addressCity = addressObj.city + dataForm.value.addressArea = addressObj.area + dataForm.value.fullAddress = addressObj.address + dataForm.value.addressCountryName = addressObj.countryName + dataForm.value.addressProvinceName = addressObj.provinceName + dataForm.value.addressCityName = addressObj.cityName + dataForm.value.addressAreaName = addressObj.areaName } - -function invoiceAddressChange(addressObj: IAddress) { +// 开票地址发生变化 +function invoiceFullAddressChange(addressObj: IAddress) { dataForm.value.invoiceCountry = addressObj.country dataForm.value.invoiceProvince = addressObj.province dataForm.value.invoiceCity = addressObj.city dataForm.value.invoiceArea = addressObj.area - dataForm.value.invoiceAddress = addressObj.address + dataForm.value.invoiceFullAddress = addressObj.address dataForm.value.invoiceCountryName = addressObj.countryName dataForm.value.invoiceProvinceName = addressObj.provinceName dataForm.value.invoiceCityName = addressObj.cityName @@ -301,13 +302,13 @@ // 检查上一行必填项 if (checkPersonList()) { setAllRowReadable() - CustomerPersonList.value.push({ ...addPersonObj }) + customerPersonList.value.push({ ...addPersonObj }) } } // 检查人员列表 function checkPersonList() { - for (let index = 0; index < CustomerPersonList.value.length; index++) { - const item = CustomerPersonList.value[index] + for (let index = 0; index < customerPersonList.value.length; index++) { + const item = customerPersonList.value[index] for (const prop of columns.value) { // 检查必填 if (prop.required && !item[prop.value]) { @@ -328,7 +329,7 @@ // 删除行 const deleteList = () => { - CustomerPersonList.value = CustomerPersonList.value.filter((item: CustomerPerson) => { + customerPersonList.value = customerPersonList.value.filter((item: CustomerPerson) => { return !SelectionList.value.includes(item) }) } @@ -359,8 +360,6 @@ if (dataForm.value.id) { updateCustomer(dataForm.value).then((res) => { if (res.code === 200) { - dataForm.value.id = res.data.id - dataForm.value.customerNo = res.data.customerNo ElMessage.success('已保存') $router.go(-1) } @@ -369,8 +368,8 @@ else { addCustomer(dataForm.value).then((res) => { if (res.code === 200) { - dataForm.value.id = res.data.id - dataForm.value.customerNo = res.data.customerNo + // dataForm.value.id = res.data.id + // dataForm.value.customerNo = res.data.customerNo ElMessage.success('已保存') $router.go(-1) } @@ -415,7 +414,7 @@ } // 将所有人员信息列表置为不可编辑状态 function setAllRowReadable() { - for (const item of CustomerPersonList.value) { + for (const item of customerPersonList.value) { item.editable = false } } @@ -628,12 +627,12 @@ - + - + @@ -685,7 +684,7 @@ ) { return request({ - url: `${prefix}/supplier/listExport`, + url: '/customer/export', method: 'post', responseType: 'blob', data, diff --git a/src/views/business/schedule/task/taskEdit.vue b/src/views/business/schedule/task/taskEdit.vue index fbe670d..465b2e7 100644 --- a/src/views/business/schedule/task/taskEdit.vue +++ b/src/views/business/schedule/task/taskEdit.vue @@ -10,7 +10,7 @@ import showPhoto from '@/views/system/tool/showPhoto.vue' import { SCHEDULE } from '@/utils/scheduleDict' import TemplateTable from '@/views/customer/customerInfo/templateTable.vue' -import { getSampleDetail, updateSample } from '@/api/customer/sampleList' +import { getSapmleDetail, updateSample } from '@/api/customer/sampleList' import countries from '@/components/AddressSelect/country-code.json' import type { TableColumn } from '@/components/NormalTable/table_interface' import { getDictByCode } from '@/api/system/dict' @@ -198,7 +198,7 @@ // 获取样品详情 const getInfo = () => { - // getSampleDetail({ id: infoId.value }).then((res) => { + // getSapmleDetail({ id: infoId.value }).then((res) => { dataForm.value = { orderId: '123', ABC: 'A', diff --git a/src/views/customer/customerInfo/customerEdit.vue b/src/views/customer/customerInfo/customerEdit.vue index 23c294a..cc987da 100644 --- a/src/views/customer/customerInfo/customerEdit.vue +++ b/src/views/customer/customerInfo/customerEdit.vue @@ -51,18 +51,18 @@ companySize: '', // 公司规模 businessSize: '', // 业务规模 evaluation: '', // 整体评价 - companyAddress: '', - companyArea: '', - companyCity: '', - companyCountry: '', - companyProvince: '', - companyAreaName: '', - companyCityName: '', - companyCountryName: '', - companyProvinceName: '', + fullAddress: '', + addressArea: '', + addressCity: '', + addressCountry: '', + addressProvince: '', + addressAreaName: '', + addressCityName: '', + addressCountryName: '', + addressProvinceName: '', director: '', fax: '', - invoiceAddress: '', + invoiceFullAddress: '', invoiceArea: '', invoiceCity: '', invoiceCountry: '', @@ -79,11 +79,11 @@ remark: '', taxNumber: '', website: '', - customerPersonList: [], + customerUserList: [], }) -const companyAddress = ref([]) // 公司地址 -const invoiceAddress = ref([]) // 开票地址 -const CustomerPersonList: Ref = ref([]) // 人员列表 +const fullAddress = ref([]) // 公司地址 +const invoiceFullAddress = ref([]) // 开票地址 +const customerPersonList: Ref = ref([]) // 人员列表 const columns = ref([ { text: '姓名', value: 'name', required: true }, { text: '工作部门', value: 'department', required: false }, @@ -100,10 +100,10 @@ certificationRecords: [] as SimpleCertification[], }) // 获取人员列表 -const fetchPerson = function (query = null) { - dataList.value.personList = dataForm.value.customerPersonList - dataList.value.personList = [{ name: '张三', department: '', job: '总经理', phone: '68387447' }, { name: '李四', department: '营销', job: '销售', phone: '68387447' }] -} +// const fetchPerson = function (query = null) { +// dataList.value.personList = dataForm.value.customerUserList +// // dataList.value.personList = [{ name: '张三', department: '', job: '总经理', phone: '68387447' }, { name: '李四', department: '营销', job: '销售', phone: '68387447' }] +// } // 获取样品列表 const fetchSampleList = function (query = null) { dataList.value.sampleRecords = [{ sampleCode: 'abc123', sampleName: '血压计', sampleModel: 'xxxx', manufacturingNo: '111', mesureTime: '2022-12-25 00:00:00', mesurePeriod: '6个月' }] @@ -125,7 +125,7 @@ columns: TableColumn[] pagination: boolean list: 'personList' | 'sampleRecords' | 'contractRecords' | 'measureRecords' | 'certificationRecords' - searchFunc: Function + searchFunc: Function | null } // 菜单 const menu: Menu[] = [ @@ -139,7 +139,7 @@ ], pagination: false, list: 'personList', - searchFunc: fetchPerson, + searchFunc: null, }, { name: '样品记录', @@ -251,19 +251,20 @@ const getInfo = () => { getCustomerDetail({ id: infoId.value }).then((res) => { - res.data = { 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: '110107', companyCity: '110100', companyCountry: 'CN', companyProvince: '110000', createTime: '2022-11-29 21:14:50', director: '刘强东', fax: 'test1', id: '1597579843411234817', invoiceAddress: '五棵松', invoiceAreaName: '海淀区', invoiceCityName: '北京市', invoiceCountryName: '中国', invoiceProvinceName: '北京', invoiceyArea: '110107', invoiceCity: '110100', invoiceCountry: 'CN', invoiceProvince: '110000', 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' } + // res.data = { bankAccount: '银行账户', bankAccountNumber: '银行账号', bankName: '工商银行', briefName: '京东', businessContent: '电商', businessScope: 'test1', grade: '1', gradeName: '优质', companySize: '1', companySizeName: '优质', businessSize: '1', businessSizeName: '小微企业', evaluation: '1', evaluationName: '优质', fullAddress: '五棵松', addressAreaName: '海淀区', addressCityName: '北京市', addressCountryName: '中国', addressProvinceName: '北京', addressArea: '110107', addressCity: '110100', addressCountry: 'CN', addressProvince: '110000', createTime: '2022-11-29 21:14:50', director: '刘强东', fax: 'test1', id: '1597579843411234817', invoiceFullAddress: '五棵松', invoiceAreaName: '海淀区', invoiceCityName: '北京市', invoiceCountryName: '中国', invoiceProvinceName: '北京', invoiceyArea: '110107', invoiceCity: '110100', invoiceCountry: 'CN', invoiceProvince: '110000', 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' } dataForm.value = res.data if (pageType.value == 'detail') { - companyAddress.value = [dataForm.value.companyCountryName, dataForm.value.companyProvinceName, dataForm.value.companyCityName, dataForm.value.companyAreaName, dataForm.value.companyAddress] - invoiceAddress.value = [dataForm.value.invoiceCountryName, dataForm.value.invoiceProvinceName, dataForm.value.invoiceCityName, dataForm.value.invoiceAreaName, dataForm.value.invoiceAddress] + fullAddress.value = [dataForm.value.addressCountryName, dataForm.value.addressProvinceName, dataForm.value.addressCityName, dataForm.value.addressAreaName, dataForm.value.fullAddress] + invoiceFullAddress.value = [dataForm.value.invoiceCountryName, dataForm.value.invoiceProvinceName, dataForm.value.invoiceCityName, dataForm.value.invoiceAreaName, dataForm.value.invoiceFullAddress] for (const item of menu) { - item.searchFunc() + if (item.searchFunc) { item.searchFunc() } } } else { - companyAddress.value = [dataForm.value.companyCountry, dataForm.value.companyProvince, dataForm.value.companyCity, dataForm.value.companyArea, dataForm.value.companyAddress] - invoiceAddress.value = [dataForm.value.invoiceCountry, dataForm.value.invoiceProvince, dataForm.value.invoiceCity, dataForm.value.invoiceArea, dataForm.value.invoiceAddress] + fullAddress.value = [dataForm.value.addressCountry, dataForm.value.addressProvince, dataForm.value.addressCity, dataForm.value.addressArea, dataForm.value.fullAddress] + invoiceFullAddress.value = [dataForm.value.invoiceCountry, dataForm.value.invoiceProvince, dataForm.value.invoiceCity, dataForm.value.invoiceArea, dataForm.value.invoiceFullAddress] } + customerPersonList.value = res.data.customerUserList }) } @@ -273,24 +274,24 @@ } // 公司地址变化后给对象赋值 -function companyAddressChange(addressObj: IAddress) { - dataForm.value.companyCountry = addressObj.country - dataForm.value.companyProvince = addressObj.province - dataForm.value.companyCity = addressObj.city - dataForm.value.companyArea = addressObj.area - dataForm.value.companyAddress = addressObj.address - dataForm.value.companyCountryName = addressObj.countryName - dataForm.value.companyProvinceName = addressObj.provinceName - dataForm.value.companyCityName = addressObj.cityName - dataForm.value.companyAreaName = addressObj.areaName +function fullAddressChange(addressObj: IAddress) { + dataForm.value.addressCountry = addressObj.country + dataForm.value.addressProvince = addressObj.province + dataForm.value.addressCity = addressObj.city + dataForm.value.addressArea = addressObj.area + dataForm.value.fullAddress = addressObj.address + dataForm.value.addressCountryName = addressObj.countryName + dataForm.value.addressProvinceName = addressObj.provinceName + dataForm.value.addressCityName = addressObj.cityName + dataForm.value.addressAreaName = addressObj.areaName } - -function invoiceAddressChange(addressObj: IAddress) { +// 开票地址发生变化 +function invoiceFullAddressChange(addressObj: IAddress) { dataForm.value.invoiceCountry = addressObj.country dataForm.value.invoiceProvince = addressObj.province dataForm.value.invoiceCity = addressObj.city dataForm.value.invoiceArea = addressObj.area - dataForm.value.invoiceAddress = addressObj.address + dataForm.value.invoiceFullAddress = addressObj.address dataForm.value.invoiceCountryName = addressObj.countryName dataForm.value.invoiceProvinceName = addressObj.provinceName dataForm.value.invoiceCityName = addressObj.cityName @@ -301,13 +302,13 @@ // 检查上一行必填项 if (checkPersonList()) { setAllRowReadable() - CustomerPersonList.value.push({ ...addPersonObj }) + customerPersonList.value.push({ ...addPersonObj }) } } // 检查人员列表 function checkPersonList() { - for (let index = 0; index < CustomerPersonList.value.length; index++) { - const item = CustomerPersonList.value[index] + for (let index = 0; index < customerPersonList.value.length; index++) { + const item = customerPersonList.value[index] for (const prop of columns.value) { // 检查必填 if (prop.required && !item[prop.value]) { @@ -328,7 +329,7 @@ // 删除行 const deleteList = () => { - CustomerPersonList.value = CustomerPersonList.value.filter((item: CustomerPerson) => { + customerPersonList.value = customerPersonList.value.filter((item: CustomerPerson) => { return !SelectionList.value.includes(item) }) } @@ -359,8 +360,6 @@ if (dataForm.value.id) { updateCustomer(dataForm.value).then((res) => { if (res.code === 200) { - dataForm.value.id = res.data.id - dataForm.value.customerNo = res.data.customerNo ElMessage.success('已保存') $router.go(-1) } @@ -369,8 +368,8 @@ else { addCustomer(dataForm.value).then((res) => { if (res.code === 200) { - dataForm.value.id = res.data.id - dataForm.value.customerNo = res.data.customerNo + // dataForm.value.id = res.data.id + // dataForm.value.customerNo = res.data.customerNo ElMessage.success('已保存') $router.go(-1) } @@ -415,7 +414,7 @@ } // 将所有人员信息列表置为不可编辑状态 function setAllRowReadable() { - for (const item of CustomerPersonList.value) { + for (const item of customerPersonList.value) { item.editable = false } } @@ -628,12 +627,12 @@ - + - + @@ -685,7 +684,7 @@ { // 模拟数据 - response.data.rows = [{ bankAccount: '银行账户', bankAccountNumber: '银行账号', bankName: '工商银行', briefName: '京东', businessContent: '电商', businessScope: 'test1', grade: '1', gradeName: 'A', companySize: '1', companySizeName: '小微企业', businessSize: '1', businessSizeName: '0-10万', 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' }] + // response.data.rows = [{ bankAccount: '银行账户', bankAccountNumber: '银行账号', bankName: '工商银行', briefName: '京东', businessContent: '电商', businessScope: 'test1', grade: '1', gradeName: 'A', companySize: '1', companySizeName: '小微企业', businessSize: '1', businessSizeName: '0-10万', 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}` + if (item.addressProvinceName && item.addressCityName) { + item.briefName = `${item.addressProvinceName}/${item.addressCityName}` } else { - item.briefName = item.companyProvinceName || item.companyCityName + item.briefName = item.addressProvinceName || item.addressCityName } return item }) - total.value = parseInt(response.data.total) + total.value = response.data.total loadingTable.value = false }) } @@ -253,12 +253,12 @@ /> - + - + @@ -274,7 +274,7 @@ { // 模拟数据 - response.data.rows = [{ bankAccount: '银行账户', bankAccountNumber: '银行账号', bankName: '工商银行', briefName: '京东', businessContent: '电商', businessScope: 'test1', grade: '1', gradeName: 'A', companySize: '1', companySizeName: '小微企业', businessSize: '1', businessSizeName: '0-10万', 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' }] + // response.data.rows = [{ bankAccount: '银行账户', bankAccountNumber: '银行账号', bankName: '工商银行', briefName: '京东', businessContent: '电商', businessScope: 'test1', grade: '1', gradeName: 'A', companySize: '1', companySizeName: '小微企业', businessSize: '1', businessSizeName: '0-10万', 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}` + if (item.addressProvinceName && item.addressCityName) { + item.briefName = `${item.addressProvinceName}/${item.addressCityName}` } else { - item.briefName = item.companyProvinceName || item.companyCityName + item.briefName = item.addressProvinceName || item.addressCityName } return item }) - total.value = parseInt(response.data.total) + total.value = response.data.total loadingTable.value = false }) } @@ -253,12 +253,12 @@ /> - + - + @@ -274,7 +274,7 @@