diff --git a/src/views/business/schedule/order/orderEdit.vue b/src/views/business/schedule/order/orderEdit.vue index f59a1e2..f61ee46 100644 --- a/src/views/business/schedule/order/orderEdit.vue +++ b/src/views/business/schedule/order/orderEdit.vue @@ -65,6 +65,8 @@ const scanSampleRef = ref() // 标签绑定弹窗ref const certificationsMap = ref([]) // 证书类别 const powerVoltageMap = ref([]) // 电源电压 +const measureWayList = ref([]) // 检测方式 +const measureWayMap: any = ref({}) // 检测方式 const isUrgentMap = ref([]) // 是否加急 const sampleStatusMap = ref([]) as any// 样品状态 const customerInfoMap = ref([]) // 系统字典--航天计量检测技术(江苏)有限公司基本信息 @@ -81,6 +83,7 @@ { text: '仪器编号', value: 'manufacturingNo', align: 'center', required: true }, { text: '生产厂家', value: 'manufacturer', align: 'center', required: true }, { text: '样品编号', value: 'sampleNo', align: 'center', width: '170', disabled: true, required: true }, + { text: '检测方式', value: 'measureWayName', align: 'center', width: '170', disabled: true, required: true }, // { text: '电源电压', value: 'powerVoltage', align: 'center', required: true }, { text: '外观状态', value: 'appearanceStatus', align: 'center', required: false }, { text: '检测项目', value: 'measureContent', align: 'center', required: false }, @@ -96,6 +99,7 @@ { text: '仪器编号', value: 'manufacturingNo', align: 'center', required: true }, { text: '生产厂家', value: 'manufacturer', align: 'center', required: true }, { text: '样品编号', value: 'sampleNo', align: 'center', width: '170', disabled: true, required: true }, + { text: '检测方式', value: 'measureWayName', align: 'center', width: '170', disabled: true, required: true }, { text: '校准要求', value: 'certificateRequire', align: 'center', required: false }, { text: '外观状态', value: 'appearanceStatus', align: 'center', required: false }, // { text: '客户特殊要求', value: 'specialRequire', align: 'center', required: false }, @@ -151,7 +155,13 @@ } // 获取字典值 -function getDict() { +async function getDict() { + // 检测方式 + const measureWayResponse = await getDictByCode('measureWay') + measureWayList.value = measureWayResponse.data + measureWayResponse.data.forEach((item: { value: string; name: string }) => { + measureWayMap.value[`${item.value}`] = item.name + }) // 证书类别 getDictByCode('certificationType').then((response) => { certificationsMap.value = response.data @@ -263,6 +273,8 @@ // 选择好样品 const clickConfirmSample = (val: Array) => { val.forEach((item: ISampleList) => { + console.log(item) + // 只添加列表里不存在的 const index = list.value.findIndex((i: ISampleList) => item.id === i.id) if (index === -1) { @@ -326,6 +338,7 @@ isEdit: true, // 是否可编辑 isExistSample: '0', // 是否存在样品库中 1存在、0不存在 delId: getUid(), + measureWay: '2', // 实验室检测 }) } @@ -546,6 +559,8 @@ return { ...item, sampleStatusName: item.sampleStatus ? sampleStatusMap.value[item.sampleStatus] : '', + measureWayName: `${item.measureWay}` ? measureWayMap.value[item.measureWay] : item.measureWayMap, // 检测方式 + isEdit: pageType.value === 'edit', } }) loading.close() @@ -1075,6 +1090,15 @@ :value="i.value" /> + + + + diff --git a/src/views/business/schedule/order/orderEdit.vue b/src/views/business/schedule/order/orderEdit.vue index f59a1e2..f61ee46 100644 --- a/src/views/business/schedule/order/orderEdit.vue +++ b/src/views/business/schedule/order/orderEdit.vue @@ -65,6 +65,8 @@ const scanSampleRef = ref() // 标签绑定弹窗ref const certificationsMap = ref([]) // 证书类别 const powerVoltageMap = ref([]) // 电源电压 +const measureWayList = ref([]) // 检测方式 +const measureWayMap: any = ref({}) // 检测方式 const isUrgentMap = ref([]) // 是否加急 const sampleStatusMap = ref([]) as any// 样品状态 const customerInfoMap = ref([]) // 系统字典--航天计量检测技术(江苏)有限公司基本信息 @@ -81,6 +83,7 @@ { text: '仪器编号', value: 'manufacturingNo', align: 'center', required: true }, { text: '生产厂家', value: 'manufacturer', align: 'center', required: true }, { text: '样品编号', value: 'sampleNo', align: 'center', width: '170', disabled: true, required: true }, + { text: '检测方式', value: 'measureWayName', align: 'center', width: '170', disabled: true, required: true }, // { text: '电源电压', value: 'powerVoltage', align: 'center', required: true }, { text: '外观状态', value: 'appearanceStatus', align: 'center', required: false }, { text: '检测项目', value: 'measureContent', align: 'center', required: false }, @@ -96,6 +99,7 @@ { text: '仪器编号', value: 'manufacturingNo', align: 'center', required: true }, { text: '生产厂家', value: 'manufacturer', align: 'center', required: true }, { text: '样品编号', value: 'sampleNo', align: 'center', width: '170', disabled: true, required: true }, + { text: '检测方式', value: 'measureWayName', align: 'center', width: '170', disabled: true, required: true }, { text: '校准要求', value: 'certificateRequire', align: 'center', required: false }, { text: '外观状态', value: 'appearanceStatus', align: 'center', required: false }, // { text: '客户特殊要求', value: 'specialRequire', align: 'center', required: false }, @@ -151,7 +155,13 @@ } // 获取字典值 -function getDict() { +async function getDict() { + // 检测方式 + const measureWayResponse = await getDictByCode('measureWay') + measureWayList.value = measureWayResponse.data + measureWayResponse.data.forEach((item: { value: string; name: string }) => { + measureWayMap.value[`${item.value}`] = item.name + }) // 证书类别 getDictByCode('certificationType').then((response) => { certificationsMap.value = response.data @@ -263,6 +273,8 @@ // 选择好样品 const clickConfirmSample = (val: Array) => { val.forEach((item: ISampleList) => { + console.log(item) + // 只添加列表里不存在的 const index = list.value.findIndex((i: ISampleList) => item.id === i.id) if (index === -1) { @@ -326,6 +338,7 @@ isEdit: true, // 是否可编辑 isExistSample: '0', // 是否存在样品库中 1存在、0不存在 delId: getUid(), + measureWay: '2', // 实验室检测 }) } @@ -546,6 +559,8 @@ return { ...item, sampleStatusName: item.sampleStatus ? sampleStatusMap.value[item.sampleStatus] : '', + measureWayName: `${item.measureWay}` ? measureWayMap.value[item.measureWay] : item.measureWayMap, // 检测方式 + isEdit: pageType.value === 'edit', } }) loading.close() @@ -1075,6 +1090,15 @@ :value="i.value" /> + + + + diff --git a/src/views/business/schedule/order/orderList_interface.ts b/src/views/business/schedule/order/orderList_interface.ts index d99d6b1..b8cf6aa 100644 --- a/src/views/business/schedule/order/orderList_interface.ts +++ b/src/views/business/schedule/order/orderList_interface.ts @@ -34,6 +34,7 @@ certificationCompanyAddress?: string // 证书单位地址 orderType: string // 委托单类型 appearanceStatus?: string // 外观 + measureWay?: string // 实验室检测 } // 详情表单 @@ -95,6 +96,7 @@ accordStandard: string // 检测依据标准 certificateRequire: string // 证书要求 specialRequire: string // 客户特殊要求 + measureWay?: string // 检测方式 } // 字典 diff --git a/src/views/business/schedule/order/orderEdit.vue b/src/views/business/schedule/order/orderEdit.vue index f59a1e2..f61ee46 100644 --- a/src/views/business/schedule/order/orderEdit.vue +++ b/src/views/business/schedule/order/orderEdit.vue @@ -65,6 +65,8 @@ const scanSampleRef = ref() // 标签绑定弹窗ref const certificationsMap = ref([]) // 证书类别 const powerVoltageMap = ref([]) // 电源电压 +const measureWayList = ref([]) // 检测方式 +const measureWayMap: any = ref({}) // 检测方式 const isUrgentMap = ref([]) // 是否加急 const sampleStatusMap = ref([]) as any// 样品状态 const customerInfoMap = ref([]) // 系统字典--航天计量检测技术(江苏)有限公司基本信息 @@ -81,6 +83,7 @@ { text: '仪器编号', value: 'manufacturingNo', align: 'center', required: true }, { text: '生产厂家', value: 'manufacturer', align: 'center', required: true }, { text: '样品编号', value: 'sampleNo', align: 'center', width: '170', disabled: true, required: true }, + { text: '检测方式', value: 'measureWayName', align: 'center', width: '170', disabled: true, required: true }, // { text: '电源电压', value: 'powerVoltage', align: 'center', required: true }, { text: '外观状态', value: 'appearanceStatus', align: 'center', required: false }, { text: '检测项目', value: 'measureContent', align: 'center', required: false }, @@ -96,6 +99,7 @@ { text: '仪器编号', value: 'manufacturingNo', align: 'center', required: true }, { text: '生产厂家', value: 'manufacturer', align: 'center', required: true }, { text: '样品编号', value: 'sampleNo', align: 'center', width: '170', disabled: true, required: true }, + { text: '检测方式', value: 'measureWayName', align: 'center', width: '170', disabled: true, required: true }, { text: '校准要求', value: 'certificateRequire', align: 'center', required: false }, { text: '外观状态', value: 'appearanceStatus', align: 'center', required: false }, // { text: '客户特殊要求', value: 'specialRequire', align: 'center', required: false }, @@ -151,7 +155,13 @@ } // 获取字典值 -function getDict() { +async function getDict() { + // 检测方式 + const measureWayResponse = await getDictByCode('measureWay') + measureWayList.value = measureWayResponse.data + measureWayResponse.data.forEach((item: { value: string; name: string }) => { + measureWayMap.value[`${item.value}`] = item.name + }) // 证书类别 getDictByCode('certificationType').then((response) => { certificationsMap.value = response.data @@ -263,6 +273,8 @@ // 选择好样品 const clickConfirmSample = (val: Array) => { val.forEach((item: ISampleList) => { + console.log(item) + // 只添加列表里不存在的 const index = list.value.findIndex((i: ISampleList) => item.id === i.id) if (index === -1) { @@ -326,6 +338,7 @@ isEdit: true, // 是否可编辑 isExistSample: '0', // 是否存在样品库中 1存在、0不存在 delId: getUid(), + measureWay: '2', // 实验室检测 }) } @@ -546,6 +559,8 @@ return { ...item, sampleStatusName: item.sampleStatus ? sampleStatusMap.value[item.sampleStatus] : '', + measureWayName: `${item.measureWay}` ? measureWayMap.value[item.measureWay] : item.measureWayMap, // 检测方式 + isEdit: pageType.value === 'edit', } }) loading.close() @@ -1075,6 +1090,15 @@ :value="i.value" /> + + + + diff --git a/src/views/business/schedule/order/orderList_interface.ts b/src/views/business/schedule/order/orderList_interface.ts index d99d6b1..b8cf6aa 100644 --- a/src/views/business/schedule/order/orderList_interface.ts +++ b/src/views/business/schedule/order/orderList_interface.ts @@ -34,6 +34,7 @@ certificationCompanyAddress?: string // 证书单位地址 orderType: string // 委托单类型 appearanceStatus?: string // 外观 + measureWay?: string // 实验室检测 } // 详情表单 @@ -95,6 +96,7 @@ accordStandard: string // 检测依据标准 certificateRequire: string // 证书要求 specialRequire: string // 客户特殊要求 + measureWay?: string // 检测方式 } // 字典 diff --git a/src/views/business/schedule/order/selectSample.vue b/src/views/business/schedule/order/selectSample.vue index 19de265..b71d854 100644 --- a/src/views/business/schedule/order/selectSample.vue +++ b/src/views/business/schedule/order/selectSample.vue @@ -6,6 +6,7 @@ import type { ISampleList, ISampleListQuery } from '@/views/customer/sample/list/sample_list_interface' import type { TableColumn } from '@/components/NormalTable/table_interface' import { getOrderSampleList } from '@/api/business/schedule/order' +import { getDictByCode } from '@/api/system/dict' const props = defineProps({ visible: { @@ -48,6 +49,7 @@ { text: '委托方代码', value: 'customerNo', align: 'center' }, { text: '委托方名称', value: 'customerName', align: 'center' }, { text: '检定周期', value: 'measurePeriod', align: 'center' }, + { text: '检测方式', value: 'measureWayName', align: 'center' }, // { text: '上次检定时间', value: 'measureLastTime', align: 'center', width: '180px' }, // { text: '样品状态', value: 'sampleSatusName', align: 'center', width: '80px' }, // { text: '备注', value: 'remark', align: 'center', width: '180px' }, @@ -60,7 +62,15 @@ const loadingTable = ref(false) // 选中的内容 const checkoutList = ref([]) - +const measureWayMap: any = ref({}) +// 获取字典值 +async function getDict() { + // 检测方式 + const response = await getDictByCode('measureWay') + response.data.forEach((item: { value: string; name: string }) => { + measureWayMap.value[`${item.value}`] = item.name + }) +} // 数据查询 function fetchData(isNowPage = false) { loadingTable.value = true @@ -70,7 +80,12 @@ } listQuery.value.customerNo = props.customerNo getOrderSampleList(listQuery.value).then((response) => { - list.value = response.data.rows + list.value = response.data.rows.map((item: { measureWay: string }) => { + return { + ...item, + measureWayName: `${item.measureWay}` ? measureWayMap.value[item.measureWay] : item.measureWay, // 检测方式名称 + } + }) total.value = parseInt(response.data.total) loadingTable.value = false }) @@ -78,6 +93,8 @@ // 多选发生改变时 function handleSelectionChange(e: any) { + console.log(e); + checkoutList.value = e.map((item: any) => { return { ...item, @@ -138,7 +155,9 @@ dialogVisible.value = newValue if (newValue) { listQuery.value.offset = 1 - fetchData(true) + getDict().then(() => { + fetchData(true) + }) } }) diff --git a/src/views/business/schedule/order/orderEdit.vue b/src/views/business/schedule/order/orderEdit.vue index f59a1e2..f61ee46 100644 --- a/src/views/business/schedule/order/orderEdit.vue +++ b/src/views/business/schedule/order/orderEdit.vue @@ -65,6 +65,8 @@ const scanSampleRef = ref() // 标签绑定弹窗ref const certificationsMap = ref([]) // 证书类别 const powerVoltageMap = ref([]) // 电源电压 +const measureWayList = ref([]) // 检测方式 +const measureWayMap: any = ref({}) // 检测方式 const isUrgentMap = ref([]) // 是否加急 const sampleStatusMap = ref([]) as any// 样品状态 const customerInfoMap = ref([]) // 系统字典--航天计量检测技术(江苏)有限公司基本信息 @@ -81,6 +83,7 @@ { text: '仪器编号', value: 'manufacturingNo', align: 'center', required: true }, { text: '生产厂家', value: 'manufacturer', align: 'center', required: true }, { text: '样品编号', value: 'sampleNo', align: 'center', width: '170', disabled: true, required: true }, + { text: '检测方式', value: 'measureWayName', align: 'center', width: '170', disabled: true, required: true }, // { text: '电源电压', value: 'powerVoltage', align: 'center', required: true }, { text: '外观状态', value: 'appearanceStatus', align: 'center', required: false }, { text: '检测项目', value: 'measureContent', align: 'center', required: false }, @@ -96,6 +99,7 @@ { text: '仪器编号', value: 'manufacturingNo', align: 'center', required: true }, { text: '生产厂家', value: 'manufacturer', align: 'center', required: true }, { text: '样品编号', value: 'sampleNo', align: 'center', width: '170', disabled: true, required: true }, + { text: '检测方式', value: 'measureWayName', align: 'center', width: '170', disabled: true, required: true }, { text: '校准要求', value: 'certificateRequire', align: 'center', required: false }, { text: '外观状态', value: 'appearanceStatus', align: 'center', required: false }, // { text: '客户特殊要求', value: 'specialRequire', align: 'center', required: false }, @@ -151,7 +155,13 @@ } // 获取字典值 -function getDict() { +async function getDict() { + // 检测方式 + const measureWayResponse = await getDictByCode('measureWay') + measureWayList.value = measureWayResponse.data + measureWayResponse.data.forEach((item: { value: string; name: string }) => { + measureWayMap.value[`${item.value}`] = item.name + }) // 证书类别 getDictByCode('certificationType').then((response) => { certificationsMap.value = response.data @@ -263,6 +273,8 @@ // 选择好样品 const clickConfirmSample = (val: Array) => { val.forEach((item: ISampleList) => { + console.log(item) + // 只添加列表里不存在的 const index = list.value.findIndex((i: ISampleList) => item.id === i.id) if (index === -1) { @@ -326,6 +338,7 @@ isEdit: true, // 是否可编辑 isExistSample: '0', // 是否存在样品库中 1存在、0不存在 delId: getUid(), + measureWay: '2', // 实验室检测 }) } @@ -546,6 +559,8 @@ return { ...item, sampleStatusName: item.sampleStatus ? sampleStatusMap.value[item.sampleStatus] : '', + measureWayName: `${item.measureWay}` ? measureWayMap.value[item.measureWay] : item.measureWayMap, // 检测方式 + isEdit: pageType.value === 'edit', } }) loading.close() @@ -1075,6 +1090,15 @@ :value="i.value" /> + + + + diff --git a/src/views/business/schedule/order/orderList_interface.ts b/src/views/business/schedule/order/orderList_interface.ts index d99d6b1..b8cf6aa 100644 --- a/src/views/business/schedule/order/orderList_interface.ts +++ b/src/views/business/schedule/order/orderList_interface.ts @@ -34,6 +34,7 @@ certificationCompanyAddress?: string // 证书单位地址 orderType: string // 委托单类型 appearanceStatus?: string // 外观 + measureWay?: string // 实验室检测 } // 详情表单 @@ -95,6 +96,7 @@ accordStandard: string // 检测依据标准 certificateRequire: string // 证书要求 specialRequire: string // 客户特殊要求 + measureWay?: string // 检测方式 } // 字典 diff --git a/src/views/business/schedule/order/selectSample.vue b/src/views/business/schedule/order/selectSample.vue index 19de265..b71d854 100644 --- a/src/views/business/schedule/order/selectSample.vue +++ b/src/views/business/schedule/order/selectSample.vue @@ -6,6 +6,7 @@ import type { ISampleList, ISampleListQuery } from '@/views/customer/sample/list/sample_list_interface' import type { TableColumn } from '@/components/NormalTable/table_interface' import { getOrderSampleList } from '@/api/business/schedule/order' +import { getDictByCode } from '@/api/system/dict' const props = defineProps({ visible: { @@ -48,6 +49,7 @@ { text: '委托方代码', value: 'customerNo', align: 'center' }, { text: '委托方名称', value: 'customerName', align: 'center' }, { text: '检定周期', value: 'measurePeriod', align: 'center' }, + { text: '检测方式', value: 'measureWayName', align: 'center' }, // { text: '上次检定时间', value: 'measureLastTime', align: 'center', width: '180px' }, // { text: '样品状态', value: 'sampleSatusName', align: 'center', width: '80px' }, // { text: '备注', value: 'remark', align: 'center', width: '180px' }, @@ -60,7 +62,15 @@ const loadingTable = ref(false) // 选中的内容 const checkoutList = ref([]) - +const measureWayMap: any = ref({}) +// 获取字典值 +async function getDict() { + // 检测方式 + const response = await getDictByCode('measureWay') + response.data.forEach((item: { value: string; name: string }) => { + measureWayMap.value[`${item.value}`] = item.name + }) +} // 数据查询 function fetchData(isNowPage = false) { loadingTable.value = true @@ -70,7 +80,12 @@ } listQuery.value.customerNo = props.customerNo getOrderSampleList(listQuery.value).then((response) => { - list.value = response.data.rows + list.value = response.data.rows.map((item: { measureWay: string }) => { + return { + ...item, + measureWayName: `${item.measureWay}` ? measureWayMap.value[item.measureWay] : item.measureWay, // 检测方式名称 + } + }) total.value = parseInt(response.data.total) loadingTable.value = false }) @@ -78,6 +93,8 @@ // 多选发生改变时 function handleSelectionChange(e: any) { + console.log(e); + checkoutList.value = e.map((item: any) => { return { ...item, @@ -138,7 +155,9 @@ dialogVisible.value = newValue if (newValue) { listQuery.value.offset = 1 - fetchData(true) + getDict().then(() => { + fetchData(true) + }) } }) diff --git a/src/views/customer/sample/list/edit.vue b/src/views/customer/sample/list/edit.vue index 6b6bde8..824f0f8 100644 --- a/src/views/customer/sample/list/edit.vue +++ b/src/views/customer/sample/list/edit.vue @@ -30,6 +30,7 @@ const visible = ref(false) // 控制对话框显隐 const mesureCategoryList = ref([]) // 校检类别 const measureTypeList = ref([]) // 检定方式 +const measureWayList = ref([]) // 检测方式 const powerVoltageList = ref([]) // 电源电压 const userList = ref([]) // 人员列表 const ABCList = ref([]) // ABC @@ -58,6 +59,8 @@ minioFileName: '', // 说明书 labelBind: '', // 标签绑定 measureType: '1', // 检定方式 1自检、2外包、3外检 + measureWayName: '', // 检测方式名称 + measureWay: '', // 检测方式 measureLastTime: '', // 检定日期 validDeadline: '', // 有效日期 powerVoltage: '', // 电源电压 @@ -87,6 +90,7 @@ manufacturingNo: [{ required: true, message: '出厂编号必填', trigger: 'blur' }], customerNo: [{ required: true, message: '委托方代码必填', trigger: 'change' }], customerName: [{ required: true, message: '委托方名称必填', trigger: 'change' }], + measureWay: [{ required: true, message: '检测方式必填', trigger: 'change' }], // phone: [{ required: true, message: '委托方电话必填', trigger: 'change' }], // postalCode: [{ required: true, message: '委托方邮编必填', trigger: 'change' }], // customerAddress: [{ required: true, message: '委托方地址必填', trigger: 'change' }], @@ -116,6 +120,10 @@ getDictByCode('measureType').then((response) => { measureTypeList.value = response.data }) + // 检测方式 + getDictByCode('measureWay').then((response) => { + measureWayList.value = response.data + }) // 电源电压 getDictByCode('powerVoltage').then((response) => { powerVoltageList.value = response.data @@ -369,6 +377,14 @@ } } // ---------------------------------------------------------------------------------- +// 检测方式改变事件 +const changeMeasureWay = (val: string) => { + const index = measureWayList.value.findIndex(item => item.value === val) + if (index !== -1) { + dataForm.value.measureWayName = measureWayList.value[index].name + } +} + // 业务员选择事件 const changeBusPersonId = (val: string) => { const index = userList.value.findIndex(item => item.id === val) @@ -658,8 +674,6 @@ - - + + + + + + + diff --git a/src/views/business/schedule/order/orderEdit.vue b/src/views/business/schedule/order/orderEdit.vue index f59a1e2..f61ee46 100644 --- a/src/views/business/schedule/order/orderEdit.vue +++ b/src/views/business/schedule/order/orderEdit.vue @@ -65,6 +65,8 @@ const scanSampleRef = ref() // 标签绑定弹窗ref const certificationsMap = ref([]) // 证书类别 const powerVoltageMap = ref([]) // 电源电压 +const measureWayList = ref([]) // 检测方式 +const measureWayMap: any = ref({}) // 检测方式 const isUrgentMap = ref([]) // 是否加急 const sampleStatusMap = ref([]) as any// 样品状态 const customerInfoMap = ref([]) // 系统字典--航天计量检测技术(江苏)有限公司基本信息 @@ -81,6 +83,7 @@ { text: '仪器编号', value: 'manufacturingNo', align: 'center', required: true }, { text: '生产厂家', value: 'manufacturer', align: 'center', required: true }, { text: '样品编号', value: 'sampleNo', align: 'center', width: '170', disabled: true, required: true }, + { text: '检测方式', value: 'measureWayName', align: 'center', width: '170', disabled: true, required: true }, // { text: '电源电压', value: 'powerVoltage', align: 'center', required: true }, { text: '外观状态', value: 'appearanceStatus', align: 'center', required: false }, { text: '检测项目', value: 'measureContent', align: 'center', required: false }, @@ -96,6 +99,7 @@ { text: '仪器编号', value: 'manufacturingNo', align: 'center', required: true }, { text: '生产厂家', value: 'manufacturer', align: 'center', required: true }, { text: '样品编号', value: 'sampleNo', align: 'center', width: '170', disabled: true, required: true }, + { text: '检测方式', value: 'measureWayName', align: 'center', width: '170', disabled: true, required: true }, { text: '校准要求', value: 'certificateRequire', align: 'center', required: false }, { text: '外观状态', value: 'appearanceStatus', align: 'center', required: false }, // { text: '客户特殊要求', value: 'specialRequire', align: 'center', required: false }, @@ -151,7 +155,13 @@ } // 获取字典值 -function getDict() { +async function getDict() { + // 检测方式 + const measureWayResponse = await getDictByCode('measureWay') + measureWayList.value = measureWayResponse.data + measureWayResponse.data.forEach((item: { value: string; name: string }) => { + measureWayMap.value[`${item.value}`] = item.name + }) // 证书类别 getDictByCode('certificationType').then((response) => { certificationsMap.value = response.data @@ -263,6 +273,8 @@ // 选择好样品 const clickConfirmSample = (val: Array) => { val.forEach((item: ISampleList) => { + console.log(item) + // 只添加列表里不存在的 const index = list.value.findIndex((i: ISampleList) => item.id === i.id) if (index === -1) { @@ -326,6 +338,7 @@ isEdit: true, // 是否可编辑 isExistSample: '0', // 是否存在样品库中 1存在、0不存在 delId: getUid(), + measureWay: '2', // 实验室检测 }) } @@ -546,6 +559,8 @@ return { ...item, sampleStatusName: item.sampleStatus ? sampleStatusMap.value[item.sampleStatus] : '', + measureWayName: `${item.measureWay}` ? measureWayMap.value[item.measureWay] : item.measureWayMap, // 检测方式 + isEdit: pageType.value === 'edit', } }) loading.close() @@ -1075,6 +1090,15 @@ :value="i.value" /> + + + + diff --git a/src/views/business/schedule/order/orderList_interface.ts b/src/views/business/schedule/order/orderList_interface.ts index d99d6b1..b8cf6aa 100644 --- a/src/views/business/schedule/order/orderList_interface.ts +++ b/src/views/business/schedule/order/orderList_interface.ts @@ -34,6 +34,7 @@ certificationCompanyAddress?: string // 证书单位地址 orderType: string // 委托单类型 appearanceStatus?: string // 外观 + measureWay?: string // 实验室检测 } // 详情表单 @@ -95,6 +96,7 @@ accordStandard: string // 检测依据标准 certificateRequire: string // 证书要求 specialRequire: string // 客户特殊要求 + measureWay?: string // 检测方式 } // 字典 diff --git a/src/views/business/schedule/order/selectSample.vue b/src/views/business/schedule/order/selectSample.vue index 19de265..b71d854 100644 --- a/src/views/business/schedule/order/selectSample.vue +++ b/src/views/business/schedule/order/selectSample.vue @@ -6,6 +6,7 @@ import type { ISampleList, ISampleListQuery } from '@/views/customer/sample/list/sample_list_interface' import type { TableColumn } from '@/components/NormalTable/table_interface' import { getOrderSampleList } from '@/api/business/schedule/order' +import { getDictByCode } from '@/api/system/dict' const props = defineProps({ visible: { @@ -48,6 +49,7 @@ { text: '委托方代码', value: 'customerNo', align: 'center' }, { text: '委托方名称', value: 'customerName', align: 'center' }, { text: '检定周期', value: 'measurePeriod', align: 'center' }, + { text: '检测方式', value: 'measureWayName', align: 'center' }, // { text: '上次检定时间', value: 'measureLastTime', align: 'center', width: '180px' }, // { text: '样品状态', value: 'sampleSatusName', align: 'center', width: '80px' }, // { text: '备注', value: 'remark', align: 'center', width: '180px' }, @@ -60,7 +62,15 @@ const loadingTable = ref(false) // 选中的内容 const checkoutList = ref([]) - +const measureWayMap: any = ref({}) +// 获取字典值 +async function getDict() { + // 检测方式 + const response = await getDictByCode('measureWay') + response.data.forEach((item: { value: string; name: string }) => { + measureWayMap.value[`${item.value}`] = item.name + }) +} // 数据查询 function fetchData(isNowPage = false) { loadingTable.value = true @@ -70,7 +80,12 @@ } listQuery.value.customerNo = props.customerNo getOrderSampleList(listQuery.value).then((response) => { - list.value = response.data.rows + list.value = response.data.rows.map((item: { measureWay: string }) => { + return { + ...item, + measureWayName: `${item.measureWay}` ? measureWayMap.value[item.measureWay] : item.measureWay, // 检测方式名称 + } + }) total.value = parseInt(response.data.total) loadingTable.value = false }) @@ -78,6 +93,8 @@ // 多选发生改变时 function handleSelectionChange(e: any) { + console.log(e); + checkoutList.value = e.map((item: any) => { return { ...item, @@ -138,7 +155,9 @@ dialogVisible.value = newValue if (newValue) { listQuery.value.offset = 1 - fetchData(true) + getDict().then(() => { + fetchData(true) + }) } }) diff --git a/src/views/customer/sample/list/edit.vue b/src/views/customer/sample/list/edit.vue index 6b6bde8..824f0f8 100644 --- a/src/views/customer/sample/list/edit.vue +++ b/src/views/customer/sample/list/edit.vue @@ -30,6 +30,7 @@ const visible = ref(false) // 控制对话框显隐 const mesureCategoryList = ref([]) // 校检类别 const measureTypeList = ref([]) // 检定方式 +const measureWayList = ref([]) // 检测方式 const powerVoltageList = ref([]) // 电源电压 const userList = ref([]) // 人员列表 const ABCList = ref([]) // ABC @@ -58,6 +59,8 @@ minioFileName: '', // 说明书 labelBind: '', // 标签绑定 measureType: '1', // 检定方式 1自检、2外包、3外检 + measureWayName: '', // 检测方式名称 + measureWay: '', // 检测方式 measureLastTime: '', // 检定日期 validDeadline: '', // 有效日期 powerVoltage: '', // 电源电压 @@ -87,6 +90,7 @@ manufacturingNo: [{ required: true, message: '出厂编号必填', trigger: 'blur' }], customerNo: [{ required: true, message: '委托方代码必填', trigger: 'change' }], customerName: [{ required: true, message: '委托方名称必填', trigger: 'change' }], + measureWay: [{ required: true, message: '检测方式必填', trigger: 'change' }], // phone: [{ required: true, message: '委托方电话必填', trigger: 'change' }], // postalCode: [{ required: true, message: '委托方邮编必填', trigger: 'change' }], // customerAddress: [{ required: true, message: '委托方地址必填', trigger: 'change' }], @@ -116,6 +120,10 @@ getDictByCode('measureType').then((response) => { measureTypeList.value = response.data }) + // 检测方式 + getDictByCode('measureWay').then((response) => { + measureWayList.value = response.data + }) // 电源电压 getDictByCode('powerVoltage').then((response) => { powerVoltageList.value = response.data @@ -369,6 +377,14 @@ } } // ---------------------------------------------------------------------------------- +// 检测方式改变事件 +const changeMeasureWay = (val: string) => { + const index = measureWayList.value.findIndex(item => item.value === val) + if (index !== -1) { + dataForm.value.measureWayName = measureWayList.value[index].name + } +} + // 业务员选择事件 const changeBusPersonId = (val: string) => { const index = userList.value.findIndex(item => item.id === val) @@ -658,8 +674,6 @@ - - + + + + + + + diff --git a/src/views/customer/sample/list/sample_list_interface.ts b/src/views/customer/sample/list/sample_list_interface.ts index 2687603..09b103b 100644 --- a/src/views/customer/sample/list/sample_list_interface.ts +++ b/src/views/customer/sample/list/sample_list_interface.ts @@ -54,6 +54,8 @@ minioFileName: string // 说明书 labelBind: string // 标签绑定 measureType: string // 检定方式 + measureWayName: string // 检测方式名称 + measureWay: string // 检测方式 measureLastTime?: string // 检定日期 validDeadline?: string // 有效日期 powerVoltage: string // 电源电压