diff --git a/public/config/config.json b/public/config/config.json index 36e461e..9e4e859 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -3,7 +3,7 @@ "versionByEqpt":"1.3.5.0", "baseUrl": "http://111.198.10.15:21611", "baseUrlBusiness": "http://111.198.10.15:21606", - "baseUrlLaboratory": "http://111.198.10.15:21610", + "baseUrlLaboratory": "http://111.198.10.15:21607", "pathDict": { "fbfpsbgl":"/reviewpage/detail", "fbfmlgl":"/directorypage/detail", diff --git a/public/config/config.json b/public/config/config.json index 36e461e..9e4e859 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -3,7 +3,7 @@ "versionByEqpt":"1.3.5.0", "baseUrl": "http://111.198.10.15:21611", "baseUrlBusiness": "http://111.198.10.15:21606", - "baseUrlLaboratory": "http://111.198.10.15:21610", + "baseUrlLaboratory": "http://111.198.10.15:21607", "pathDict": { "fbfpsbgl":"/reviewpage/detail", "fbfmlgl":"/directorypage/detail", diff --git a/src/api/eqpt/measurementPlan/task.ts b/src/api/eqpt/measurementPlan/task.ts index a291108..aaed504 100644 --- a/src/api/eqpt/measurementPlan/task.ts +++ b/src/api/eqpt/measurementPlan/task.ts @@ -135,3 +135,13 @@ }, }) } +// 获取上一份任务单 设备的附件和特殊要求 +export function getPreTaskContent(ids: any) { + return request({ + url: '/business/order/contentBySampleIds', + method: 'post', + data: { + ids, + }, + }) +} diff --git a/public/config/config.json b/public/config/config.json index 36e461e..9e4e859 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -3,7 +3,7 @@ "versionByEqpt":"1.3.5.0", "baseUrl": "http://111.198.10.15:21611", "baseUrlBusiness": "http://111.198.10.15:21606", - "baseUrlLaboratory": "http://111.198.10.15:21610", + "baseUrlLaboratory": "http://111.198.10.15:21607", "pathDict": { "fbfpsbgl":"/reviewpage/detail", "fbfmlgl":"/directorypage/detail", diff --git a/src/api/eqpt/measurementPlan/task.ts b/src/api/eqpt/measurementPlan/task.ts index a291108..aaed504 100644 --- a/src/api/eqpt/measurementPlan/task.ts +++ b/src/api/eqpt/measurementPlan/task.ts @@ -135,3 +135,13 @@ }, }) } +// 获取上一份任务单 设备的附件和特殊要求 +export function getPreTaskContent(ids: any) { + return request({ + url: '/business/order/contentBySampleIds', + method: 'post', + data: { + ids, + }, + }) +} diff --git a/src/views/tested/MeasurementPlan/early/components/table.vue b/src/views/tested/MeasurementPlan/early/components/table.vue index 13805e8..64140a2 100644 --- a/src/views/tested/MeasurementPlan/early/components/table.vue +++ b/src/views/tested/MeasurementPlan/early/components/table.vue @@ -7,6 +7,7 @@ import { useCheckList } from '@/utils/useCheckList' import scanEquipmentDialog from '@/components/scanEquipmentDialog/index.vue' import QRcodeDeviceDialog from '@/components/QRcodeDeviceDialog/index.vue' +import { getPreTaskContent } from '@/api/eqpt/measurementPlan/task' const $props = defineProps({ data: { type: Array, @@ -188,7 +189,9 @@ // 多选 device.forEach((item) => { // equipmentNo + const ids = [] as any if (!list.value.filter((citem: any) => citem.equipmentId === item.id).length) { + ids.push(item.id) list.value.push({ ...item, equipmentId: item.id, @@ -201,6 +204,21 @@ specialRequire: '无', appendixDescn: '无', }) + if (!ids.length) { return } + // 获取上一份任务单 设备的附件和特殊要求 + getPreTaskContent(ids).then((res) => { + if (res.data.length) { + console.log(res.data, '获取上一份任务单 设备的附件和特殊要求') + + res.data.forEach((item: any) => { + const index = list.value.findIndex((citem: any) => citem.equipmentId === item.sampleId) + if (index !== -1) { + list.value[index].appendixDescn = item.appendixDescn + list.value[index].specialRequire = item.specialRequire + } + }) + } + }) } }) } @@ -222,6 +240,13 @@ } if (!list.value.filter((citem: any) => citem.equipmentId === row.equipmentId).length) { list.value[selectRow.value] = row + // 获取上一份任务单 设备的附件和特殊要求 + getPreTaskContent([device.id]).then((res) => { + if (res.data.length) { + list.value[selectRow.value].appendixDescn = res.data[0].appendixDescn + list.value[selectRow.value].specialRequire = res.data[0].specialRequire + } + }) } } } @@ -265,8 +290,10 @@ console.log(value, 'value, 设备列表rfid') scanEquipmentRef.value.closeDialog() // 多选 + const ids = [] as any value.forEach((item: any) => { if (!list.value.filter((c: any) => c.equipmentId === item.id).length) { + ids.push(item.id) list.value.push({ ...item, // appearanceInspect: '', @@ -286,6 +313,21 @@ }) } }) + if (!ids.length) { return } + // 获取上一份任务单 设备的附件和特殊要求 + getPreTaskContent(ids).then((res) => { + if (res.data.length) { + console.log(res.data, '获取上一份任务单 设备的附件和特殊要求') + + res.data.forEach((item: any) => { + const index = list.value.findIndex((citem: any) => citem.equipmentId === item.sampleId) + if (index !== -1) { + list.value[index].appendixDescn = item.appendixDescn + list.value[index].specialRequire = item.specialRequire + } + }) + } + }) } // --------------------------------------------二维码扫描-------------------------------------------- const qrcodeRef = ref() @@ -298,8 +340,10 @@ console.log('***************************') console.log(value, 'value, 设备列表二维码') // 多选 + const ids = [] as any value.forEach((item: any) => { if (!list.value.filter((c: any) => c.equipmentId === item.id).length) { + ids.push(item.id) list.value.push({ // appearanceInspect: '', // appendixDescn: '无', @@ -319,6 +363,21 @@ }) } }) + if (!ids.length) { return } + // 获取上一份任务单 设备的附件和特殊要求 + getPreTaskContent(ids).then((res) => { + if (res.data.length) { + console.log(res.data, '获取上一份任务单 设备的附件和特殊要求') + + res.data.forEach((item: any) => { + const index = list.value.findIndex((citem: any) => citem.equipmentId === item.sampleId) + if (index !== -1) { + list.value[index].appendixDescn = item.appendixDescn + list.value[index].specialRequire = item.specialRequire + } + }) + } + }) } diff --git a/public/config/config.json b/public/config/config.json index 36e461e..9e4e859 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -3,7 +3,7 @@ "versionByEqpt":"1.3.5.0", "baseUrl": "http://111.198.10.15:21611", "baseUrlBusiness": "http://111.198.10.15:21606", - "baseUrlLaboratory": "http://111.198.10.15:21610", + "baseUrlLaboratory": "http://111.198.10.15:21607", "pathDict": { "fbfpsbgl":"/reviewpage/detail", "fbfmlgl":"/directorypage/detail", diff --git a/src/api/eqpt/measurementPlan/task.ts b/src/api/eqpt/measurementPlan/task.ts index a291108..aaed504 100644 --- a/src/api/eqpt/measurementPlan/task.ts +++ b/src/api/eqpt/measurementPlan/task.ts @@ -135,3 +135,13 @@ }, }) } +// 获取上一份任务单 设备的附件和特殊要求 +export function getPreTaskContent(ids: any) { + return request({ + url: '/business/order/contentBySampleIds', + method: 'post', + data: { + ids, + }, + }) +} diff --git a/src/views/tested/MeasurementPlan/early/components/table.vue b/src/views/tested/MeasurementPlan/early/components/table.vue index 13805e8..64140a2 100644 --- a/src/views/tested/MeasurementPlan/early/components/table.vue +++ b/src/views/tested/MeasurementPlan/early/components/table.vue @@ -7,6 +7,7 @@ import { useCheckList } from '@/utils/useCheckList' import scanEquipmentDialog from '@/components/scanEquipmentDialog/index.vue' import QRcodeDeviceDialog from '@/components/QRcodeDeviceDialog/index.vue' +import { getPreTaskContent } from '@/api/eqpt/measurementPlan/task' const $props = defineProps({ data: { type: Array, @@ -188,7 +189,9 @@ // 多选 device.forEach((item) => { // equipmentNo + const ids = [] as any if (!list.value.filter((citem: any) => citem.equipmentId === item.id).length) { + ids.push(item.id) list.value.push({ ...item, equipmentId: item.id, @@ -201,6 +204,21 @@ specialRequire: '无', appendixDescn: '无', }) + if (!ids.length) { return } + // 获取上一份任务单 设备的附件和特殊要求 + getPreTaskContent(ids).then((res) => { + if (res.data.length) { + console.log(res.data, '获取上一份任务单 设备的附件和特殊要求') + + res.data.forEach((item: any) => { + const index = list.value.findIndex((citem: any) => citem.equipmentId === item.sampleId) + if (index !== -1) { + list.value[index].appendixDescn = item.appendixDescn + list.value[index].specialRequire = item.specialRequire + } + }) + } + }) } }) } @@ -222,6 +240,13 @@ } if (!list.value.filter((citem: any) => citem.equipmentId === row.equipmentId).length) { list.value[selectRow.value] = row + // 获取上一份任务单 设备的附件和特殊要求 + getPreTaskContent([device.id]).then((res) => { + if (res.data.length) { + list.value[selectRow.value].appendixDescn = res.data[0].appendixDescn + list.value[selectRow.value].specialRequire = res.data[0].specialRequire + } + }) } } } @@ -265,8 +290,10 @@ console.log(value, 'value, 设备列表rfid') scanEquipmentRef.value.closeDialog() // 多选 + const ids = [] as any value.forEach((item: any) => { if (!list.value.filter((c: any) => c.equipmentId === item.id).length) { + ids.push(item.id) list.value.push({ ...item, // appearanceInspect: '', @@ -286,6 +313,21 @@ }) } }) + if (!ids.length) { return } + // 获取上一份任务单 设备的附件和特殊要求 + getPreTaskContent(ids).then((res) => { + if (res.data.length) { + console.log(res.data, '获取上一份任务单 设备的附件和特殊要求') + + res.data.forEach((item: any) => { + const index = list.value.findIndex((citem: any) => citem.equipmentId === item.sampleId) + if (index !== -1) { + list.value[index].appendixDescn = item.appendixDescn + list.value[index].specialRequire = item.specialRequire + } + }) + } + }) } // --------------------------------------------二维码扫描-------------------------------------------- const qrcodeRef = ref() @@ -298,8 +340,10 @@ console.log('***************************') console.log(value, 'value, 设备列表二维码') // 多选 + const ids = [] as any value.forEach((item: any) => { if (!list.value.filter((c: any) => c.equipmentId === item.id).length) { + ids.push(item.id) list.value.push({ // appearanceInspect: '', // appendixDescn: '无', @@ -319,6 +363,21 @@ }) } }) + if (!ids.length) { return } + // 获取上一份任务单 设备的附件和特殊要求 + getPreTaskContent(ids).then((res) => { + if (res.data.length) { + console.log(res.data, '获取上一份任务单 设备的附件和特殊要求') + + res.data.forEach((item: any) => { + const index = list.value.findIndex((citem: any) => citem.equipmentId === item.sampleId) + if (index !== -1) { + list.value[index].appendixDescn = item.appendixDescn + list.value[index].specialRequire = item.specialRequire + } + }) + } + }) } diff --git a/src/views/tested/MeasurementPlan/task/components/list.vue b/src/views/tested/MeasurementPlan/task/components/list.vue index e7379cf..a375bbc 100644 --- a/src/views/tested/MeasurementPlan/task/components/list.vue +++ b/src/views/tested/MeasurementPlan/task/components/list.vue @@ -445,6 +445,11 @@ :is-showmulti-select="true" @change="changePage" @multi-select="multiSelect" >