diff --git a/src/views/customer/sample/list/edit.vue b/src/views/customer/sample/list/edit.vue index 72dd903..153b66e 100644 --- a/src/views/customer/sample/list/edit.vue +++ b/src/views/customer/sample/list/edit.vue @@ -5,7 +5,7 @@ import type { FormInstance, UploadUserFile } from 'element-plus' import { ref } from 'vue' import { Calendar, Search } from '@element-plus/icons-vue' -import type { ISampleEdit, SimpleCertification, SimpleMeasureRecord } from './sample_list_interface' +import type { ISampleEdit, Menu, SimpleCertification, SimpleMeasureRecord } from './sample_list_interface' import sampleDialog from './sampleDialog.vue' import showPhoto from '@/views/system/tool/showPhoto.vue' import { SCHEDULE } from '@/utils/scheduleDict' @@ -14,6 +14,7 @@ import countries from '@/components/AddressSelect/country-code.json' import { UploadFile } from '@/api/measure/file' import type { TableColumn } from '@/components/NormalTable/table_interface' +import type { ICustomer } from '@/views/customer/customerInfo/customer_interface' const textMap: { [key: string]: string } = { edit: '编辑', @@ -177,13 +178,7 @@ const fetchCertifications = function (query = null) { dataList.value.certificationRecords = [] } -interface Menu { - name: string - columns: TableColumn[] - pagination: boolean - list: 'measureRecords' | 'certificationRecords' - searchFunc: Function -} + // 菜单 const menu: Menu[] = [ { @@ -275,12 +270,15 @@ } // 选好委托方 -const confirmCheckout = (val: any) => { - dataForm.value.customerNo = val[0].customerNo - dataForm.value.customerName = val[0].customerName - dataForm.value.phone = val[0].phone - dataForm.value.postalCode = val[0].postalCode - dataForm.value.companyAddress = val[0].briefName +const confirmCheckout = (val: Array) => { + if (val && val.length) { + const getValue = val[0] + dataForm.value.customerNo = getValue.customerNo + dataForm.value.customerName = getValue.customerName + dataForm.value.phone = getValue.phone + dataForm.value.postalCode = getValue.postalCode + dataForm.value.companyAddress = getValue.briefName + } } // 控制选择委托方对话框显隐 @@ -346,35 +344,35 @@ const getInfo = () => { getSapmleDetail({ id: infoId.value }).then((res) => { - // res.data = { - // ABC: 'A', - // companyAddress: '北京/北京市', - // customerName: '京东集团', - // customerNo: 'sygf202211290001', - // id: '', - // labelBind: '11222', - // manufacturer: '北京某厂家', - // manufacturerCountry: 'CN', - // manufacturingDate: '2023-03', - // manufacturingNo: '123121', - // mesureCategory: 'jd', - // mesureContent: '项目1', - // mesurePeriod: '1', - // mesureType: 'zj', - // minioFileName: '小程序工期表-1117_1674961769128.xlsx', - // phone: '950618', - // postalCode: 'test', - // remark: '无备注', - // sampleModel: '型号1', - // sampleName: '样品1', - // sampleNo: '', - // measureResultCode: 'bhg', - // } - dataForm.value = res.data - dataForm.value.measureResult = mesureResultMap[dataForm.value.measureResultCode] - for (const item of menu) { - item.searchFunc() + res.data = { + ABC: 'A', + companyAddress: '北京/北京市', + customerName: '京东集团', + customerNo: 'sygf202211290001', + id: '', + labelBind: '11222', + manufacturer: '北京某厂家', + manufacturerCountry: 'CN', + manufacturingDate: '2023-03', + manufacturingNo: '123121', + mesureCategory: 'jd', + mesureContent: '项目1', + mesurePeriod: '1', + mesureType: 'zj', + minioFileName: '小程序工期表-1117_1674961769128.xlsx', + phone: '950618', + postalCode: 'test', + remark: '无备注', + sampleModel: '型号1', + sampleName: '样品1', + sampleNo: '', + measureResultCode: 'bhg', } + // dataForm.value = res.data + // dataForm.value.measureResult = mesureResultMap[dataForm.value.measureResultCode] + // for (const item of menu) { + // item.searchFunc() + // } }) } diff --git a/src/views/customer/sample/list/edit.vue b/src/views/customer/sample/list/edit.vue index 72dd903..153b66e 100644 --- a/src/views/customer/sample/list/edit.vue +++ b/src/views/customer/sample/list/edit.vue @@ -5,7 +5,7 @@ import type { FormInstance, UploadUserFile } from 'element-plus' import { ref } from 'vue' import { Calendar, Search } from '@element-plus/icons-vue' -import type { ISampleEdit, SimpleCertification, SimpleMeasureRecord } from './sample_list_interface' +import type { ISampleEdit, Menu, SimpleCertification, SimpleMeasureRecord } from './sample_list_interface' import sampleDialog from './sampleDialog.vue' import showPhoto from '@/views/system/tool/showPhoto.vue' import { SCHEDULE } from '@/utils/scheduleDict' @@ -14,6 +14,7 @@ import countries from '@/components/AddressSelect/country-code.json' import { UploadFile } from '@/api/measure/file' import type { TableColumn } from '@/components/NormalTable/table_interface' +import type { ICustomer } from '@/views/customer/customerInfo/customer_interface' const textMap: { [key: string]: string } = { edit: '编辑', @@ -177,13 +178,7 @@ const fetchCertifications = function (query = null) { dataList.value.certificationRecords = [] } -interface Menu { - name: string - columns: TableColumn[] - pagination: boolean - list: 'measureRecords' | 'certificationRecords' - searchFunc: Function -} + // 菜单 const menu: Menu[] = [ { @@ -275,12 +270,15 @@ } // 选好委托方 -const confirmCheckout = (val: any) => { - dataForm.value.customerNo = val[0].customerNo - dataForm.value.customerName = val[0].customerName - dataForm.value.phone = val[0].phone - dataForm.value.postalCode = val[0].postalCode - dataForm.value.companyAddress = val[0].briefName +const confirmCheckout = (val: Array) => { + if (val && val.length) { + const getValue = val[0] + dataForm.value.customerNo = getValue.customerNo + dataForm.value.customerName = getValue.customerName + dataForm.value.phone = getValue.phone + dataForm.value.postalCode = getValue.postalCode + dataForm.value.companyAddress = getValue.briefName + } } // 控制选择委托方对话框显隐 @@ -346,35 +344,35 @@ const getInfo = () => { getSapmleDetail({ id: infoId.value }).then((res) => { - // res.data = { - // ABC: 'A', - // companyAddress: '北京/北京市', - // customerName: '京东集团', - // customerNo: 'sygf202211290001', - // id: '', - // labelBind: '11222', - // manufacturer: '北京某厂家', - // manufacturerCountry: 'CN', - // manufacturingDate: '2023-03', - // manufacturingNo: '123121', - // mesureCategory: 'jd', - // mesureContent: '项目1', - // mesurePeriod: '1', - // mesureType: 'zj', - // minioFileName: '小程序工期表-1117_1674961769128.xlsx', - // phone: '950618', - // postalCode: 'test', - // remark: '无备注', - // sampleModel: '型号1', - // sampleName: '样品1', - // sampleNo: '', - // measureResultCode: 'bhg', - // } - dataForm.value = res.data - dataForm.value.measureResult = mesureResultMap[dataForm.value.measureResultCode] - for (const item of menu) { - item.searchFunc() + res.data = { + ABC: 'A', + companyAddress: '北京/北京市', + customerName: '京东集团', + customerNo: 'sygf202211290001', + id: '', + labelBind: '11222', + manufacturer: '北京某厂家', + manufacturerCountry: 'CN', + manufacturingDate: '2023-03', + manufacturingNo: '123121', + mesureCategory: 'jd', + mesureContent: '项目1', + mesurePeriod: '1', + mesureType: 'zj', + minioFileName: '小程序工期表-1117_1674961769128.xlsx', + phone: '950618', + postalCode: 'test', + remark: '无备注', + sampleModel: '型号1', + sampleName: '样品1', + sampleNo: '', + measureResultCode: 'bhg', } + // dataForm.value = res.data + // dataForm.value.measureResult = mesureResultMap[dataForm.value.measureResultCode] + // for (const item of menu) { + // item.searchFunc() + // } }) } diff --git a/src/views/customer/sample/list/list.vue b/src/views/customer/sample/list/list.vue index 5a26dc7..4086b48 100644 --- a/src/views/customer/sample/list/list.vue +++ b/src/views/customer/sample/list/list.vue @@ -226,7 +226,7 @@ printJSON(list.value, properties, '样品列表') } else if (checkoutList.value.length > 0) { - const printList = list.value.filter((item: any) => checkoutList.value.includes(item.id)) + const printList = list.value.filter((item: ISampleList) => checkoutList.value.includes(item.id)) printJSON(printList, properties, '样品列表') } else { diff --git a/src/views/customer/sample/list/edit.vue b/src/views/customer/sample/list/edit.vue index 72dd903..153b66e 100644 --- a/src/views/customer/sample/list/edit.vue +++ b/src/views/customer/sample/list/edit.vue @@ -5,7 +5,7 @@ import type { FormInstance, UploadUserFile } from 'element-plus' import { ref } from 'vue' import { Calendar, Search } from '@element-plus/icons-vue' -import type { ISampleEdit, SimpleCertification, SimpleMeasureRecord } from './sample_list_interface' +import type { ISampleEdit, Menu, SimpleCertification, SimpleMeasureRecord } from './sample_list_interface' import sampleDialog from './sampleDialog.vue' import showPhoto from '@/views/system/tool/showPhoto.vue' import { SCHEDULE } from '@/utils/scheduleDict' @@ -14,6 +14,7 @@ import countries from '@/components/AddressSelect/country-code.json' import { UploadFile } from '@/api/measure/file' import type { TableColumn } from '@/components/NormalTable/table_interface' +import type { ICustomer } from '@/views/customer/customerInfo/customer_interface' const textMap: { [key: string]: string } = { edit: '编辑', @@ -177,13 +178,7 @@ const fetchCertifications = function (query = null) { dataList.value.certificationRecords = [] } -interface Menu { - name: string - columns: TableColumn[] - pagination: boolean - list: 'measureRecords' | 'certificationRecords' - searchFunc: Function -} + // 菜单 const menu: Menu[] = [ { @@ -275,12 +270,15 @@ } // 选好委托方 -const confirmCheckout = (val: any) => { - dataForm.value.customerNo = val[0].customerNo - dataForm.value.customerName = val[0].customerName - dataForm.value.phone = val[0].phone - dataForm.value.postalCode = val[0].postalCode - dataForm.value.companyAddress = val[0].briefName +const confirmCheckout = (val: Array) => { + if (val && val.length) { + const getValue = val[0] + dataForm.value.customerNo = getValue.customerNo + dataForm.value.customerName = getValue.customerName + dataForm.value.phone = getValue.phone + dataForm.value.postalCode = getValue.postalCode + dataForm.value.companyAddress = getValue.briefName + } } // 控制选择委托方对话框显隐 @@ -346,35 +344,35 @@ const getInfo = () => { getSapmleDetail({ id: infoId.value }).then((res) => { - // res.data = { - // ABC: 'A', - // companyAddress: '北京/北京市', - // customerName: '京东集团', - // customerNo: 'sygf202211290001', - // id: '', - // labelBind: '11222', - // manufacturer: '北京某厂家', - // manufacturerCountry: 'CN', - // manufacturingDate: '2023-03', - // manufacturingNo: '123121', - // mesureCategory: 'jd', - // mesureContent: '项目1', - // mesurePeriod: '1', - // mesureType: 'zj', - // minioFileName: '小程序工期表-1117_1674961769128.xlsx', - // phone: '950618', - // postalCode: 'test', - // remark: '无备注', - // sampleModel: '型号1', - // sampleName: '样品1', - // sampleNo: '', - // measureResultCode: 'bhg', - // } - dataForm.value = res.data - dataForm.value.measureResult = mesureResultMap[dataForm.value.measureResultCode] - for (const item of menu) { - item.searchFunc() + res.data = { + ABC: 'A', + companyAddress: '北京/北京市', + customerName: '京东集团', + customerNo: 'sygf202211290001', + id: '', + labelBind: '11222', + manufacturer: '北京某厂家', + manufacturerCountry: 'CN', + manufacturingDate: '2023-03', + manufacturingNo: '123121', + mesureCategory: 'jd', + mesureContent: '项目1', + mesurePeriod: '1', + mesureType: 'zj', + minioFileName: '小程序工期表-1117_1674961769128.xlsx', + phone: '950618', + postalCode: 'test', + remark: '无备注', + sampleModel: '型号1', + sampleName: '样品1', + sampleNo: '', + measureResultCode: 'bhg', } + // dataForm.value = res.data + // dataForm.value.measureResult = mesureResultMap[dataForm.value.measureResultCode] + // for (const item of menu) { + // item.searchFunc() + // } }) } diff --git a/src/views/customer/sample/list/list.vue b/src/views/customer/sample/list/list.vue index 5a26dc7..4086b48 100644 --- a/src/views/customer/sample/list/list.vue +++ b/src/views/customer/sample/list/list.vue @@ -226,7 +226,7 @@ printJSON(list.value, properties, '样品列表') } else if (checkoutList.value.length > 0) { - const printList = list.value.filter((item: any) => checkoutList.value.includes(item.id)) + const printList = list.value.filter((item: ISampleList) => checkoutList.value.includes(item.id)) printJSON(printList, properties, '样品列表') } else { diff --git a/src/views/customer/sample/list/sampleDialog.vue b/src/views/customer/sample/list/sampleDialog.vue index ea2d652..a5a371b 100644 --- a/src/views/customer/sample/list/sampleDialog.vue +++ b/src/views/customer/sample/list/sampleDialog.vue @@ -88,37 +88,37 @@ // 是否显示当前页,否则跳转第一页 listQuery.value.offset = 1 } - // getCustomerList(listQuery.value).then((response) => { - // // 模拟数据 - // 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}` - // } - // 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: '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}` + } + else { + item.briefName = item.companyProvinceName || item.companyCityName + } + return item + }) + total.value = parseInt(response.data.total) + loadingTable.value = false + }) // 模拟数据 - const response = [{ 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' }, - { 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: '2集团', customerNo: 'sygf202211290001', taxNumber: 'test', updateTime: '2023-01-10 09:56:57', website: 'test' }, - { 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: '3集团', customerNo: 'sygf202211290001', taxNumber: 'test', updateTime: '2023-01-10 09:56:57', website: 'test' }] - list.value = response.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 = 50 - loadingTable.value = false + // const response = [{ 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' }, + // { 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: '2集团', customerNo: 'sygf202211290001', taxNumber: 'test', updateTime: '2023-01-10 09:56:57', website: 'test' }, + // { 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: '3集团', customerNo: 'sygf202211290001', taxNumber: 'test', updateTime: '2023-01-10 09:56:57', website: 'test' }] + // list.value = response.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 = 50 + // loadingTable.value = false } // 多选发生改变时 function handleSelectionChange(e: any) { diff --git a/src/views/customer/sample/list/edit.vue b/src/views/customer/sample/list/edit.vue index 72dd903..153b66e 100644 --- a/src/views/customer/sample/list/edit.vue +++ b/src/views/customer/sample/list/edit.vue @@ -5,7 +5,7 @@ import type { FormInstance, UploadUserFile } from 'element-plus' import { ref } from 'vue' import { Calendar, Search } from '@element-plus/icons-vue' -import type { ISampleEdit, SimpleCertification, SimpleMeasureRecord } from './sample_list_interface' +import type { ISampleEdit, Menu, SimpleCertification, SimpleMeasureRecord } from './sample_list_interface' import sampleDialog from './sampleDialog.vue' import showPhoto from '@/views/system/tool/showPhoto.vue' import { SCHEDULE } from '@/utils/scheduleDict' @@ -14,6 +14,7 @@ import countries from '@/components/AddressSelect/country-code.json' import { UploadFile } from '@/api/measure/file' import type { TableColumn } from '@/components/NormalTable/table_interface' +import type { ICustomer } from '@/views/customer/customerInfo/customer_interface' const textMap: { [key: string]: string } = { edit: '编辑', @@ -177,13 +178,7 @@ const fetchCertifications = function (query = null) { dataList.value.certificationRecords = [] } -interface Menu { - name: string - columns: TableColumn[] - pagination: boolean - list: 'measureRecords' | 'certificationRecords' - searchFunc: Function -} + // 菜单 const menu: Menu[] = [ { @@ -275,12 +270,15 @@ } // 选好委托方 -const confirmCheckout = (val: any) => { - dataForm.value.customerNo = val[0].customerNo - dataForm.value.customerName = val[0].customerName - dataForm.value.phone = val[0].phone - dataForm.value.postalCode = val[0].postalCode - dataForm.value.companyAddress = val[0].briefName +const confirmCheckout = (val: Array) => { + if (val && val.length) { + const getValue = val[0] + dataForm.value.customerNo = getValue.customerNo + dataForm.value.customerName = getValue.customerName + dataForm.value.phone = getValue.phone + dataForm.value.postalCode = getValue.postalCode + dataForm.value.companyAddress = getValue.briefName + } } // 控制选择委托方对话框显隐 @@ -346,35 +344,35 @@ const getInfo = () => { getSapmleDetail({ id: infoId.value }).then((res) => { - // res.data = { - // ABC: 'A', - // companyAddress: '北京/北京市', - // customerName: '京东集团', - // customerNo: 'sygf202211290001', - // id: '', - // labelBind: '11222', - // manufacturer: '北京某厂家', - // manufacturerCountry: 'CN', - // manufacturingDate: '2023-03', - // manufacturingNo: '123121', - // mesureCategory: 'jd', - // mesureContent: '项目1', - // mesurePeriod: '1', - // mesureType: 'zj', - // minioFileName: '小程序工期表-1117_1674961769128.xlsx', - // phone: '950618', - // postalCode: 'test', - // remark: '无备注', - // sampleModel: '型号1', - // sampleName: '样品1', - // sampleNo: '', - // measureResultCode: 'bhg', - // } - dataForm.value = res.data - dataForm.value.measureResult = mesureResultMap[dataForm.value.measureResultCode] - for (const item of menu) { - item.searchFunc() + res.data = { + ABC: 'A', + companyAddress: '北京/北京市', + customerName: '京东集团', + customerNo: 'sygf202211290001', + id: '', + labelBind: '11222', + manufacturer: '北京某厂家', + manufacturerCountry: 'CN', + manufacturingDate: '2023-03', + manufacturingNo: '123121', + mesureCategory: 'jd', + mesureContent: '项目1', + mesurePeriod: '1', + mesureType: 'zj', + minioFileName: '小程序工期表-1117_1674961769128.xlsx', + phone: '950618', + postalCode: 'test', + remark: '无备注', + sampleModel: '型号1', + sampleName: '样品1', + sampleNo: '', + measureResultCode: 'bhg', } + // dataForm.value = res.data + // dataForm.value.measureResult = mesureResultMap[dataForm.value.measureResultCode] + // for (const item of menu) { + // item.searchFunc() + // } }) } diff --git a/src/views/customer/sample/list/list.vue b/src/views/customer/sample/list/list.vue index 5a26dc7..4086b48 100644 --- a/src/views/customer/sample/list/list.vue +++ b/src/views/customer/sample/list/list.vue @@ -226,7 +226,7 @@ printJSON(list.value, properties, '样品列表') } else if (checkoutList.value.length > 0) { - const printList = list.value.filter((item: any) => checkoutList.value.includes(item.id)) + const printList = list.value.filter((item: ISampleList) => checkoutList.value.includes(item.id)) printJSON(printList, properties, '样品列表') } else { diff --git a/src/views/customer/sample/list/sampleDialog.vue b/src/views/customer/sample/list/sampleDialog.vue index ea2d652..a5a371b 100644 --- a/src/views/customer/sample/list/sampleDialog.vue +++ b/src/views/customer/sample/list/sampleDialog.vue @@ -88,37 +88,37 @@ // 是否显示当前页,否则跳转第一页 listQuery.value.offset = 1 } - // getCustomerList(listQuery.value).then((response) => { - // // 模拟数据 - // 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}` - // } - // 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: '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}` + } + else { + item.briefName = item.companyProvinceName || item.companyCityName + } + return item + }) + total.value = parseInt(response.data.total) + loadingTable.value = false + }) // 模拟数据 - const response = [{ 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' }, - { 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: '2集团', customerNo: 'sygf202211290001', taxNumber: 'test', updateTime: '2023-01-10 09:56:57', website: 'test' }, - { 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: '3集团', customerNo: 'sygf202211290001', taxNumber: 'test', updateTime: '2023-01-10 09:56:57', website: 'test' }] - list.value = response.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 = 50 - loadingTable.value = false + // const response = [{ 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' }, + // { 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: '2集团', customerNo: 'sygf202211290001', taxNumber: 'test', updateTime: '2023-01-10 09:56:57', website: 'test' }, + // { 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: '3集团', customerNo: 'sygf202211290001', taxNumber: 'test', updateTime: '2023-01-10 09:56:57', website: 'test' }] + // list.value = response.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 = 50 + // loadingTable.value = false } // 多选发生改变时 function handleSelectionChange(e: any) { diff --git a/src/views/customer/sample/list/sample_list_interface.ts b/src/views/customer/sample/list/sample_list_interface.ts index f5d0514..26638ce 100644 --- a/src/views/customer/sample/list/sample_list_interface.ts +++ b/src/views/customer/sample/list/sample_list_interface.ts @@ -1,3 +1,5 @@ +import type { TableColumn } from '@/components/NormalTable/table_interface' + export interface ISampleListQuery { sampleNo: string // 样品编号 sampleName: string // 样品名称 @@ -11,7 +13,7 @@ } export interface ISampleList { - id?: string // 样品唯一标识 + id: string // 样品唯一标识 sampleNo: string // 样品编号 sampleName: string // 样品名称 sampleModel: string // 型号 @@ -71,3 +73,11 @@ effectiveDate: string // 证书出具日期 expirationDate: string // 证书有效期 } + +export interface Menu { + name: string + columns: TableColumn[] + pagination: boolean + list: 'measureRecords' | 'certificationRecords' + searchFunc: Function +} diff --git a/src/views/customer/sample/list/edit.vue b/src/views/customer/sample/list/edit.vue index 72dd903..153b66e 100644 --- a/src/views/customer/sample/list/edit.vue +++ b/src/views/customer/sample/list/edit.vue @@ -5,7 +5,7 @@ import type { FormInstance, UploadUserFile } from 'element-plus' import { ref } from 'vue' import { Calendar, Search } from '@element-plus/icons-vue' -import type { ISampleEdit, SimpleCertification, SimpleMeasureRecord } from './sample_list_interface' +import type { ISampleEdit, Menu, SimpleCertification, SimpleMeasureRecord } from './sample_list_interface' import sampleDialog from './sampleDialog.vue' import showPhoto from '@/views/system/tool/showPhoto.vue' import { SCHEDULE } from '@/utils/scheduleDict' @@ -14,6 +14,7 @@ import countries from '@/components/AddressSelect/country-code.json' import { UploadFile } from '@/api/measure/file' import type { TableColumn } from '@/components/NormalTable/table_interface' +import type { ICustomer } from '@/views/customer/customerInfo/customer_interface' const textMap: { [key: string]: string } = { edit: '编辑', @@ -177,13 +178,7 @@ const fetchCertifications = function (query = null) { dataList.value.certificationRecords = [] } -interface Menu { - name: string - columns: TableColumn[] - pagination: boolean - list: 'measureRecords' | 'certificationRecords' - searchFunc: Function -} + // 菜单 const menu: Menu[] = [ { @@ -275,12 +270,15 @@ } // 选好委托方 -const confirmCheckout = (val: any) => { - dataForm.value.customerNo = val[0].customerNo - dataForm.value.customerName = val[0].customerName - dataForm.value.phone = val[0].phone - dataForm.value.postalCode = val[0].postalCode - dataForm.value.companyAddress = val[0].briefName +const confirmCheckout = (val: Array) => { + if (val && val.length) { + const getValue = val[0] + dataForm.value.customerNo = getValue.customerNo + dataForm.value.customerName = getValue.customerName + dataForm.value.phone = getValue.phone + dataForm.value.postalCode = getValue.postalCode + dataForm.value.companyAddress = getValue.briefName + } } // 控制选择委托方对话框显隐 @@ -346,35 +344,35 @@ const getInfo = () => { getSapmleDetail({ id: infoId.value }).then((res) => { - // res.data = { - // ABC: 'A', - // companyAddress: '北京/北京市', - // customerName: '京东集团', - // customerNo: 'sygf202211290001', - // id: '', - // labelBind: '11222', - // manufacturer: '北京某厂家', - // manufacturerCountry: 'CN', - // manufacturingDate: '2023-03', - // manufacturingNo: '123121', - // mesureCategory: 'jd', - // mesureContent: '项目1', - // mesurePeriod: '1', - // mesureType: 'zj', - // minioFileName: '小程序工期表-1117_1674961769128.xlsx', - // phone: '950618', - // postalCode: 'test', - // remark: '无备注', - // sampleModel: '型号1', - // sampleName: '样品1', - // sampleNo: '', - // measureResultCode: 'bhg', - // } - dataForm.value = res.data - dataForm.value.measureResult = mesureResultMap[dataForm.value.measureResultCode] - for (const item of menu) { - item.searchFunc() + res.data = { + ABC: 'A', + companyAddress: '北京/北京市', + customerName: '京东集团', + customerNo: 'sygf202211290001', + id: '', + labelBind: '11222', + manufacturer: '北京某厂家', + manufacturerCountry: 'CN', + manufacturingDate: '2023-03', + manufacturingNo: '123121', + mesureCategory: 'jd', + mesureContent: '项目1', + mesurePeriod: '1', + mesureType: 'zj', + minioFileName: '小程序工期表-1117_1674961769128.xlsx', + phone: '950618', + postalCode: 'test', + remark: '无备注', + sampleModel: '型号1', + sampleName: '样品1', + sampleNo: '', + measureResultCode: 'bhg', } + // dataForm.value = res.data + // dataForm.value.measureResult = mesureResultMap[dataForm.value.measureResultCode] + // for (const item of menu) { + // item.searchFunc() + // } }) } diff --git a/src/views/customer/sample/list/list.vue b/src/views/customer/sample/list/list.vue index 5a26dc7..4086b48 100644 --- a/src/views/customer/sample/list/list.vue +++ b/src/views/customer/sample/list/list.vue @@ -226,7 +226,7 @@ printJSON(list.value, properties, '样品列表') } else if (checkoutList.value.length > 0) { - const printList = list.value.filter((item: any) => checkoutList.value.includes(item.id)) + const printList = list.value.filter((item: ISampleList) => checkoutList.value.includes(item.id)) printJSON(printList, properties, '样品列表') } else { diff --git a/src/views/customer/sample/list/sampleDialog.vue b/src/views/customer/sample/list/sampleDialog.vue index ea2d652..a5a371b 100644 --- a/src/views/customer/sample/list/sampleDialog.vue +++ b/src/views/customer/sample/list/sampleDialog.vue @@ -88,37 +88,37 @@ // 是否显示当前页,否则跳转第一页 listQuery.value.offset = 1 } - // getCustomerList(listQuery.value).then((response) => { - // // 模拟数据 - // 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}` - // } - // 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: '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}` + } + else { + item.briefName = item.companyProvinceName || item.companyCityName + } + return item + }) + total.value = parseInt(response.data.total) + loadingTable.value = false + }) // 模拟数据 - const response = [{ 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' }, - { 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: '2集团', customerNo: 'sygf202211290001', taxNumber: 'test', updateTime: '2023-01-10 09:56:57', website: 'test' }, - { 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: '3集团', customerNo: 'sygf202211290001', taxNumber: 'test', updateTime: '2023-01-10 09:56:57', website: 'test' }] - list.value = response.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 = 50 - loadingTable.value = false + // const response = [{ 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' }, + // { 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: '2集团', customerNo: 'sygf202211290001', taxNumber: 'test', updateTime: '2023-01-10 09:56:57', website: 'test' }, + // { 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: '3集团', customerNo: 'sygf202211290001', taxNumber: 'test', updateTime: '2023-01-10 09:56:57', website: 'test' }] + // list.value = response.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 = 50 + // loadingTable.value = false } // 多选发生改变时 function handleSelectionChange(e: any) { diff --git a/src/views/customer/sample/list/sample_list_interface.ts b/src/views/customer/sample/list/sample_list_interface.ts index f5d0514..26638ce 100644 --- a/src/views/customer/sample/list/sample_list_interface.ts +++ b/src/views/customer/sample/list/sample_list_interface.ts @@ -1,3 +1,5 @@ +import type { TableColumn } from '@/components/NormalTable/table_interface' + export interface ISampleListQuery { sampleNo: string // 样品编号 sampleName: string // 样品名称 @@ -11,7 +13,7 @@ } export interface ISampleList { - id?: string // 样品唯一标识 + id: string // 样品唯一标识 sampleNo: string // 样品编号 sampleName: string // 样品名称 sampleModel: string // 型号 @@ -71,3 +73,11 @@ effectiveDate: string // 证书出具日期 expirationDate: string // 证书有效期 } + +export interface Menu { + name: string + columns: TableColumn[] + pagination: boolean + list: 'measureRecords' | 'certificationRecords' + searchFunc: Function +} diff --git a/src/views/customer/sample/overTime/detail.vue b/src/views/customer/sample/overTime/detail.vue index 925defe..3541675 100644 --- a/src/views/customer/sample/overTime/detail.vue +++ b/src/views/customer/sample/overTime/detail.vue @@ -217,37 +217,38 @@ }) const getInfo = () => { - getSapmleDetail({ id: infoId.value }).then((res) => { - // res.data = { - // ABC: 'A', - // companyAddress: '北京/北京市', - // customerName: '京东集团', - // customerNo: 'sygf202211290001', - // id: '', - // labelBind: '11222', - // manufacturer: '北京某厂家', - // manufacturerCountry: 'CN', - // manufacturingDate: '2023-03', - // manufacturingNo: '123121', - // mesureCategory: 'jd', - // mesureContent: '项目1', - // mesurePeriod: '1', - // mesureType: 'zj', - // minioFileName: '小程序工期表-1117_1674961769128.xlsx', - // phone: '950618', - // postalCode: 'test', - // remark: '无备注', - // sampleModel: '型号1', - // sampleName: '样品1', - // sampleNo: '', - // measureResultCode: 'bhg', - // } - dataForm.value = res.data - dataForm.value.measureResult = mesureResultMap[dataForm.value.measureResultCode] - for (const item of menu) { - item.searchFunc() - } - }) + // getSapmleDetail({ id: infoId.value }).then((res) => { + // dataForm.value = res.data + // dataForm.value.measureResult = mesureResultMap[dataForm.value.measureResultCode] + // for (const item of menu) { + // item.searchFunc() + // } + // }) + dataForm.value = { + ABC: 'A', + companyAddress: '北京/北京市', + customerName: '京东集团', + customerNo: 'sygf202211290001', + id: '', + labelBind: '11222', + manufacturer: '北京某厂家', + manufacturerCountry: 'CN', + manufacturingDate: '2023-03', + manufacturingNo: '123121', + mesureCategory: 'jd', + mesureContent: '项目1', + mesurePeriod: '1', + mesureType: 'zj', + minioFileName: '小程序工期表-1117_1674961769128.xlsx', + phone: '950618', + postalCode: 'test', + remark: '无备注', + sampleModel: '型号1', + sampleName: '样品1', + sampleNo: '', + measureResultCode: 'bhg', + measureResult: '合格', + } } // 非添加页面获取详情 diff --git a/src/views/customer/sample/list/edit.vue b/src/views/customer/sample/list/edit.vue index 72dd903..153b66e 100644 --- a/src/views/customer/sample/list/edit.vue +++ b/src/views/customer/sample/list/edit.vue @@ -5,7 +5,7 @@ import type { FormInstance, UploadUserFile } from 'element-plus' import { ref } from 'vue' import { Calendar, Search } from '@element-plus/icons-vue' -import type { ISampleEdit, SimpleCertification, SimpleMeasureRecord } from './sample_list_interface' +import type { ISampleEdit, Menu, SimpleCertification, SimpleMeasureRecord } from './sample_list_interface' import sampleDialog from './sampleDialog.vue' import showPhoto from '@/views/system/tool/showPhoto.vue' import { SCHEDULE } from '@/utils/scheduleDict' @@ -14,6 +14,7 @@ import countries from '@/components/AddressSelect/country-code.json' import { UploadFile } from '@/api/measure/file' import type { TableColumn } from '@/components/NormalTable/table_interface' +import type { ICustomer } from '@/views/customer/customerInfo/customer_interface' const textMap: { [key: string]: string } = { edit: '编辑', @@ -177,13 +178,7 @@ const fetchCertifications = function (query = null) { dataList.value.certificationRecords = [] } -interface Menu { - name: string - columns: TableColumn[] - pagination: boolean - list: 'measureRecords' | 'certificationRecords' - searchFunc: Function -} + // 菜单 const menu: Menu[] = [ { @@ -275,12 +270,15 @@ } // 选好委托方 -const confirmCheckout = (val: any) => { - dataForm.value.customerNo = val[0].customerNo - dataForm.value.customerName = val[0].customerName - dataForm.value.phone = val[0].phone - dataForm.value.postalCode = val[0].postalCode - dataForm.value.companyAddress = val[0].briefName +const confirmCheckout = (val: Array) => { + if (val && val.length) { + const getValue = val[0] + dataForm.value.customerNo = getValue.customerNo + dataForm.value.customerName = getValue.customerName + dataForm.value.phone = getValue.phone + dataForm.value.postalCode = getValue.postalCode + dataForm.value.companyAddress = getValue.briefName + } } // 控制选择委托方对话框显隐 @@ -346,35 +344,35 @@ const getInfo = () => { getSapmleDetail({ id: infoId.value }).then((res) => { - // res.data = { - // ABC: 'A', - // companyAddress: '北京/北京市', - // customerName: '京东集团', - // customerNo: 'sygf202211290001', - // id: '', - // labelBind: '11222', - // manufacturer: '北京某厂家', - // manufacturerCountry: 'CN', - // manufacturingDate: '2023-03', - // manufacturingNo: '123121', - // mesureCategory: 'jd', - // mesureContent: '项目1', - // mesurePeriod: '1', - // mesureType: 'zj', - // minioFileName: '小程序工期表-1117_1674961769128.xlsx', - // phone: '950618', - // postalCode: 'test', - // remark: '无备注', - // sampleModel: '型号1', - // sampleName: '样品1', - // sampleNo: '', - // measureResultCode: 'bhg', - // } - dataForm.value = res.data - dataForm.value.measureResult = mesureResultMap[dataForm.value.measureResultCode] - for (const item of menu) { - item.searchFunc() + res.data = { + ABC: 'A', + companyAddress: '北京/北京市', + customerName: '京东集团', + customerNo: 'sygf202211290001', + id: '', + labelBind: '11222', + manufacturer: '北京某厂家', + manufacturerCountry: 'CN', + manufacturingDate: '2023-03', + manufacturingNo: '123121', + mesureCategory: 'jd', + mesureContent: '项目1', + mesurePeriod: '1', + mesureType: 'zj', + minioFileName: '小程序工期表-1117_1674961769128.xlsx', + phone: '950618', + postalCode: 'test', + remark: '无备注', + sampleModel: '型号1', + sampleName: '样品1', + sampleNo: '', + measureResultCode: 'bhg', } + // dataForm.value = res.data + // dataForm.value.measureResult = mesureResultMap[dataForm.value.measureResultCode] + // for (const item of menu) { + // item.searchFunc() + // } }) } diff --git a/src/views/customer/sample/list/list.vue b/src/views/customer/sample/list/list.vue index 5a26dc7..4086b48 100644 --- a/src/views/customer/sample/list/list.vue +++ b/src/views/customer/sample/list/list.vue @@ -226,7 +226,7 @@ printJSON(list.value, properties, '样品列表') } else if (checkoutList.value.length > 0) { - const printList = list.value.filter((item: any) => checkoutList.value.includes(item.id)) + const printList = list.value.filter((item: ISampleList) => checkoutList.value.includes(item.id)) printJSON(printList, properties, '样品列表') } else { diff --git a/src/views/customer/sample/list/sampleDialog.vue b/src/views/customer/sample/list/sampleDialog.vue index ea2d652..a5a371b 100644 --- a/src/views/customer/sample/list/sampleDialog.vue +++ b/src/views/customer/sample/list/sampleDialog.vue @@ -88,37 +88,37 @@ // 是否显示当前页,否则跳转第一页 listQuery.value.offset = 1 } - // getCustomerList(listQuery.value).then((response) => { - // // 模拟数据 - // 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}` - // } - // 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: '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}` + } + else { + item.briefName = item.companyProvinceName || item.companyCityName + } + return item + }) + total.value = parseInt(response.data.total) + loadingTable.value = false + }) // 模拟数据 - const response = [{ 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' }, - { 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: '2集团', customerNo: 'sygf202211290001', taxNumber: 'test', updateTime: '2023-01-10 09:56:57', website: 'test' }, - { 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: '3集团', customerNo: 'sygf202211290001', taxNumber: 'test', updateTime: '2023-01-10 09:56:57', website: 'test' }] - list.value = response.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 = 50 - loadingTable.value = false + // const response = [{ 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' }, + // { 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: '2集团', customerNo: 'sygf202211290001', taxNumber: 'test', updateTime: '2023-01-10 09:56:57', website: 'test' }, + // { 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: '3集团', customerNo: 'sygf202211290001', taxNumber: 'test', updateTime: '2023-01-10 09:56:57', website: 'test' }] + // list.value = response.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 = 50 + // loadingTable.value = false } // 多选发生改变时 function handleSelectionChange(e: any) { diff --git a/src/views/customer/sample/list/sample_list_interface.ts b/src/views/customer/sample/list/sample_list_interface.ts index f5d0514..26638ce 100644 --- a/src/views/customer/sample/list/sample_list_interface.ts +++ b/src/views/customer/sample/list/sample_list_interface.ts @@ -1,3 +1,5 @@ +import type { TableColumn } from '@/components/NormalTable/table_interface' + export interface ISampleListQuery { sampleNo: string // 样品编号 sampleName: string // 样品名称 @@ -11,7 +13,7 @@ } export interface ISampleList { - id?: string // 样品唯一标识 + id: string // 样品唯一标识 sampleNo: string // 样品编号 sampleName: string // 样品名称 sampleModel: string // 型号 @@ -71,3 +73,11 @@ effectiveDate: string // 证书出具日期 expirationDate: string // 证书有效期 } + +export interface Menu { + name: string + columns: TableColumn[] + pagination: boolean + list: 'measureRecords' | 'certificationRecords' + searchFunc: Function +} diff --git a/src/views/customer/sample/overTime/detail.vue b/src/views/customer/sample/overTime/detail.vue index 925defe..3541675 100644 --- a/src/views/customer/sample/overTime/detail.vue +++ b/src/views/customer/sample/overTime/detail.vue @@ -217,37 +217,38 @@ }) const getInfo = () => { - getSapmleDetail({ id: infoId.value }).then((res) => { - // res.data = { - // ABC: 'A', - // companyAddress: '北京/北京市', - // customerName: '京东集团', - // customerNo: 'sygf202211290001', - // id: '', - // labelBind: '11222', - // manufacturer: '北京某厂家', - // manufacturerCountry: 'CN', - // manufacturingDate: '2023-03', - // manufacturingNo: '123121', - // mesureCategory: 'jd', - // mesureContent: '项目1', - // mesurePeriod: '1', - // mesureType: 'zj', - // minioFileName: '小程序工期表-1117_1674961769128.xlsx', - // phone: '950618', - // postalCode: 'test', - // remark: '无备注', - // sampleModel: '型号1', - // sampleName: '样品1', - // sampleNo: '', - // measureResultCode: 'bhg', - // } - dataForm.value = res.data - dataForm.value.measureResult = mesureResultMap[dataForm.value.measureResultCode] - for (const item of menu) { - item.searchFunc() - } - }) + // getSapmleDetail({ id: infoId.value }).then((res) => { + // dataForm.value = res.data + // dataForm.value.measureResult = mesureResultMap[dataForm.value.measureResultCode] + // for (const item of menu) { + // item.searchFunc() + // } + // }) + dataForm.value = { + ABC: 'A', + companyAddress: '北京/北京市', + customerName: '京东集团', + customerNo: 'sygf202211290001', + id: '', + labelBind: '11222', + manufacturer: '北京某厂家', + manufacturerCountry: 'CN', + manufacturingDate: '2023-03', + manufacturingNo: '123121', + mesureCategory: 'jd', + mesureContent: '项目1', + mesurePeriod: '1', + mesureType: 'zj', + minioFileName: '小程序工期表-1117_1674961769128.xlsx', + phone: '950618', + postalCode: 'test', + remark: '无备注', + sampleModel: '型号1', + sampleName: '样品1', + sampleNo: '', + measureResultCode: 'bhg', + measureResult: '合格', + } } // 非添加页面获取详情 diff --git a/src/views/customer/sample/overTime/overtime_list_interface.ts b/src/views/customer/sample/overTime/overtime_list_interface.ts index 025719a..40b8e64 100644 --- a/src/views/customer/sample/overTime/overtime_list_interface.ts +++ b/src/views/customer/sample/overTime/overtime_list_interface.ts @@ -39,10 +39,10 @@ manufacturerCountry: string // 厂家国别 manufacturingDate: string // 出厂年月 ABC: string // ABC - deliverer: string // 送检人 - delivererTel: string // 送检人联系方式 - planDeliverTime: string // 预计送达时间 - requireOverTime: string // 要求检完时间 + deliverer?: string // 送检人 + delivererTel?: string // 送检人联系方式 + planDeliverTime?: string // 预计送达时间 + requireOverTime?: string // 要求检完时间 mesureContent: string // 检定项目 mesurePeriod: string // 检定周期 remark: string // 备注 diff --git a/src/views/customer/sample/list/edit.vue b/src/views/customer/sample/list/edit.vue index 72dd903..153b66e 100644 --- a/src/views/customer/sample/list/edit.vue +++ b/src/views/customer/sample/list/edit.vue @@ -5,7 +5,7 @@ import type { FormInstance, UploadUserFile } from 'element-plus' import { ref } from 'vue' import { Calendar, Search } from '@element-plus/icons-vue' -import type { ISampleEdit, SimpleCertification, SimpleMeasureRecord } from './sample_list_interface' +import type { ISampleEdit, Menu, SimpleCertification, SimpleMeasureRecord } from './sample_list_interface' import sampleDialog from './sampleDialog.vue' import showPhoto from '@/views/system/tool/showPhoto.vue' import { SCHEDULE } from '@/utils/scheduleDict' @@ -14,6 +14,7 @@ import countries from '@/components/AddressSelect/country-code.json' import { UploadFile } from '@/api/measure/file' import type { TableColumn } from '@/components/NormalTable/table_interface' +import type { ICustomer } from '@/views/customer/customerInfo/customer_interface' const textMap: { [key: string]: string } = { edit: '编辑', @@ -177,13 +178,7 @@ const fetchCertifications = function (query = null) { dataList.value.certificationRecords = [] } -interface Menu { - name: string - columns: TableColumn[] - pagination: boolean - list: 'measureRecords' | 'certificationRecords' - searchFunc: Function -} + // 菜单 const menu: Menu[] = [ { @@ -275,12 +270,15 @@ } // 选好委托方 -const confirmCheckout = (val: any) => { - dataForm.value.customerNo = val[0].customerNo - dataForm.value.customerName = val[0].customerName - dataForm.value.phone = val[0].phone - dataForm.value.postalCode = val[0].postalCode - dataForm.value.companyAddress = val[0].briefName +const confirmCheckout = (val: Array) => { + if (val && val.length) { + const getValue = val[0] + dataForm.value.customerNo = getValue.customerNo + dataForm.value.customerName = getValue.customerName + dataForm.value.phone = getValue.phone + dataForm.value.postalCode = getValue.postalCode + dataForm.value.companyAddress = getValue.briefName + } } // 控制选择委托方对话框显隐 @@ -346,35 +344,35 @@ const getInfo = () => { getSapmleDetail({ id: infoId.value }).then((res) => { - // res.data = { - // ABC: 'A', - // companyAddress: '北京/北京市', - // customerName: '京东集团', - // customerNo: 'sygf202211290001', - // id: '', - // labelBind: '11222', - // manufacturer: '北京某厂家', - // manufacturerCountry: 'CN', - // manufacturingDate: '2023-03', - // manufacturingNo: '123121', - // mesureCategory: 'jd', - // mesureContent: '项目1', - // mesurePeriod: '1', - // mesureType: 'zj', - // minioFileName: '小程序工期表-1117_1674961769128.xlsx', - // phone: '950618', - // postalCode: 'test', - // remark: '无备注', - // sampleModel: '型号1', - // sampleName: '样品1', - // sampleNo: '', - // measureResultCode: 'bhg', - // } - dataForm.value = res.data - dataForm.value.measureResult = mesureResultMap[dataForm.value.measureResultCode] - for (const item of menu) { - item.searchFunc() + res.data = { + ABC: 'A', + companyAddress: '北京/北京市', + customerName: '京东集团', + customerNo: 'sygf202211290001', + id: '', + labelBind: '11222', + manufacturer: '北京某厂家', + manufacturerCountry: 'CN', + manufacturingDate: '2023-03', + manufacturingNo: '123121', + mesureCategory: 'jd', + mesureContent: '项目1', + mesurePeriod: '1', + mesureType: 'zj', + minioFileName: '小程序工期表-1117_1674961769128.xlsx', + phone: '950618', + postalCode: 'test', + remark: '无备注', + sampleModel: '型号1', + sampleName: '样品1', + sampleNo: '', + measureResultCode: 'bhg', } + // dataForm.value = res.data + // dataForm.value.measureResult = mesureResultMap[dataForm.value.measureResultCode] + // for (const item of menu) { + // item.searchFunc() + // } }) } diff --git a/src/views/customer/sample/list/list.vue b/src/views/customer/sample/list/list.vue index 5a26dc7..4086b48 100644 --- a/src/views/customer/sample/list/list.vue +++ b/src/views/customer/sample/list/list.vue @@ -226,7 +226,7 @@ printJSON(list.value, properties, '样品列表') } else if (checkoutList.value.length > 0) { - const printList = list.value.filter((item: any) => checkoutList.value.includes(item.id)) + const printList = list.value.filter((item: ISampleList) => checkoutList.value.includes(item.id)) printJSON(printList, properties, '样品列表') } else { diff --git a/src/views/customer/sample/list/sampleDialog.vue b/src/views/customer/sample/list/sampleDialog.vue index ea2d652..a5a371b 100644 --- a/src/views/customer/sample/list/sampleDialog.vue +++ b/src/views/customer/sample/list/sampleDialog.vue @@ -88,37 +88,37 @@ // 是否显示当前页,否则跳转第一页 listQuery.value.offset = 1 } - // getCustomerList(listQuery.value).then((response) => { - // // 模拟数据 - // 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}` - // } - // 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: '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}` + } + else { + item.briefName = item.companyProvinceName || item.companyCityName + } + return item + }) + total.value = parseInt(response.data.total) + loadingTable.value = false + }) // 模拟数据 - const response = [{ 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' }, - { 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: '2集团', customerNo: 'sygf202211290001', taxNumber: 'test', updateTime: '2023-01-10 09:56:57', website: 'test' }, - { 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: '3集团', customerNo: 'sygf202211290001', taxNumber: 'test', updateTime: '2023-01-10 09:56:57', website: 'test' }] - list.value = response.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 = 50 - loadingTable.value = false + // const response = [{ 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' }, + // { 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: '2集团', customerNo: 'sygf202211290001', taxNumber: 'test', updateTime: '2023-01-10 09:56:57', website: 'test' }, + // { 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: '3集团', customerNo: 'sygf202211290001', taxNumber: 'test', updateTime: '2023-01-10 09:56:57', website: 'test' }] + // list.value = response.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 = 50 + // loadingTable.value = false } // 多选发生改变时 function handleSelectionChange(e: any) { diff --git a/src/views/customer/sample/list/sample_list_interface.ts b/src/views/customer/sample/list/sample_list_interface.ts index f5d0514..26638ce 100644 --- a/src/views/customer/sample/list/sample_list_interface.ts +++ b/src/views/customer/sample/list/sample_list_interface.ts @@ -1,3 +1,5 @@ +import type { TableColumn } from '@/components/NormalTable/table_interface' + export interface ISampleListQuery { sampleNo: string // 样品编号 sampleName: string // 样品名称 @@ -11,7 +13,7 @@ } export interface ISampleList { - id?: string // 样品唯一标识 + id: string // 样品唯一标识 sampleNo: string // 样品编号 sampleName: string // 样品名称 sampleModel: string // 型号 @@ -71,3 +73,11 @@ effectiveDate: string // 证书出具日期 expirationDate: string // 证书有效期 } + +export interface Menu { + name: string + columns: TableColumn[] + pagination: boolean + list: 'measureRecords' | 'certificationRecords' + searchFunc: Function +} diff --git a/src/views/customer/sample/overTime/detail.vue b/src/views/customer/sample/overTime/detail.vue index 925defe..3541675 100644 --- a/src/views/customer/sample/overTime/detail.vue +++ b/src/views/customer/sample/overTime/detail.vue @@ -217,37 +217,38 @@ }) const getInfo = () => { - getSapmleDetail({ id: infoId.value }).then((res) => { - // res.data = { - // ABC: 'A', - // companyAddress: '北京/北京市', - // customerName: '京东集团', - // customerNo: 'sygf202211290001', - // id: '', - // labelBind: '11222', - // manufacturer: '北京某厂家', - // manufacturerCountry: 'CN', - // manufacturingDate: '2023-03', - // manufacturingNo: '123121', - // mesureCategory: 'jd', - // mesureContent: '项目1', - // mesurePeriod: '1', - // mesureType: 'zj', - // minioFileName: '小程序工期表-1117_1674961769128.xlsx', - // phone: '950618', - // postalCode: 'test', - // remark: '无备注', - // sampleModel: '型号1', - // sampleName: '样品1', - // sampleNo: '', - // measureResultCode: 'bhg', - // } - dataForm.value = res.data - dataForm.value.measureResult = mesureResultMap[dataForm.value.measureResultCode] - for (const item of menu) { - item.searchFunc() - } - }) + // getSapmleDetail({ id: infoId.value }).then((res) => { + // dataForm.value = res.data + // dataForm.value.measureResult = mesureResultMap[dataForm.value.measureResultCode] + // for (const item of menu) { + // item.searchFunc() + // } + // }) + dataForm.value = { + ABC: 'A', + companyAddress: '北京/北京市', + customerName: '京东集团', + customerNo: 'sygf202211290001', + id: '', + labelBind: '11222', + manufacturer: '北京某厂家', + manufacturerCountry: 'CN', + manufacturingDate: '2023-03', + manufacturingNo: '123121', + mesureCategory: 'jd', + mesureContent: '项目1', + mesurePeriod: '1', + mesureType: 'zj', + minioFileName: '小程序工期表-1117_1674961769128.xlsx', + phone: '950618', + postalCode: 'test', + remark: '无备注', + sampleModel: '型号1', + sampleName: '样品1', + sampleNo: '', + measureResultCode: 'bhg', + measureResult: '合格', + } } // 非添加页面获取详情 diff --git a/src/views/customer/sample/overTime/overtime_list_interface.ts b/src/views/customer/sample/overTime/overtime_list_interface.ts index 025719a..40b8e64 100644 --- a/src/views/customer/sample/overTime/overtime_list_interface.ts +++ b/src/views/customer/sample/overTime/overtime_list_interface.ts @@ -39,10 +39,10 @@ manufacturerCountry: string // 厂家国别 manufacturingDate: string // 出厂年月 ABC: string // ABC - deliverer: string // 送检人 - delivererTel: string // 送检人联系方式 - planDeliverTime: string // 预计送达时间 - requireOverTime: string // 要求检完时间 + deliverer?: string // 送检人 + delivererTel?: string // 送检人联系方式 + planDeliverTime?: string // 预计送达时间 + requireOverTime?: string // 要求检完时间 mesureContent: string // 检定项目 mesurePeriod: string // 检定周期 remark: string // 备注 diff --git a/src/views/device/receive/applyList.vue b/src/views/device/receive/applyList.vue index 4674763..975a887 100644 --- a/src/views/device/receive/applyList.vue +++ b/src/views/device/receive/applyList.vue @@ -1,12 +1,15 @@