diff --git a/src/api/system/installation.ts b/src/api/system/installation.ts index 4288976..bc33926 100644 --- a/src/api/system/installation.ts +++ b/src/api/system/installation.ts @@ -35,10 +35,9 @@ }) } // 列表 - 不分页 -export function getLocationList(data: any) { +export function getLocationList() { return request({ url: '/system/location/list', - method: 'post', - data, + method: 'get', }) } diff --git a/src/api/system/installation.ts b/src/api/system/installation.ts index 4288976..bc33926 100644 --- a/src/api/system/installation.ts +++ b/src/api/system/installation.ts @@ -35,10 +35,9 @@ }) } // 列表 - 不分页 -export function getLocationList(data: any) { +export function getLocationList() { return request({ url: '/system/location/list', - method: 'post', - data, + method: 'get', }) } diff --git a/src/views/system/expire/device.vue b/src/views/system/expire/device.vue index 34f42a8..b25a74b 100644 --- a/src/views/system/expire/device.vue +++ b/src/views/system/expire/device.vue @@ -114,11 +114,11 @@ deviceTypeList.value = res.data }) // 设备名称 - getDeviceNameList().then((res) => { + getDeviceNameList({ equipmentType: '1' }).then((res) => { deviceNameList.value = res.data }) // 规格型号及辅助字段 - getModelAllList({}).then((res) => { + getModelAllList({ equipmentType: '1' }).then((res) => { allList.value = res.data modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))) helpList.value = Array.from(new Set(res.data.filter((item: any) => item.helpInstruction).map((item: any) => item.helpInstruction))) diff --git a/src/api/system/installation.ts b/src/api/system/installation.ts index 4288976..bc33926 100644 --- a/src/api/system/installation.ts +++ b/src/api/system/installation.ts @@ -35,10 +35,9 @@ }) } // 列表 - 不分页 -export function getLocationList(data: any) { +export function getLocationList() { return request({ url: '/system/location/list', - method: 'post', - data, + method: 'get', }) } diff --git a/src/views/system/expire/device.vue b/src/views/system/expire/device.vue index 34f42a8..b25a74b 100644 --- a/src/views/system/expire/device.vue +++ b/src/views/system/expire/device.vue @@ -114,11 +114,11 @@ deviceTypeList.value = res.data }) // 设备名称 - getDeviceNameList().then((res) => { + getDeviceNameList({ equipmentType: '1' }).then((res) => { deviceNameList.value = res.data }) // 规格型号及辅助字段 - getModelAllList({}).then((res) => { + getModelAllList({ equipmentType: '1' }).then((res) => { allList.value = res.data modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))) helpList.value = Array.from(new Set(res.data.filter((item: any) => item.helpInstruction).map((item: any) => item.helpInstruction))) diff --git a/src/views/system/installation/list.vue b/src/views/system/installation/list.vue index 8c8b950..72f1130 100644 --- a/src/views/system/installation/list.vue +++ b/src/views/system/installation/list.vue @@ -131,7 +131,7 @@
diff --git a/src/api/system/installation.ts b/src/api/system/installation.ts index 4288976..bc33926 100644 --- a/src/api/system/installation.ts +++ b/src/api/system/installation.ts @@ -35,10 +35,9 @@ }) } // 列表 - 不分页 -export function getLocationList(data: any) { +export function getLocationList() { return request({ url: '/system/location/list', - method: 'post', - data, + method: 'get', }) } diff --git a/src/views/system/expire/device.vue b/src/views/system/expire/device.vue index 34f42a8..b25a74b 100644 --- a/src/views/system/expire/device.vue +++ b/src/views/system/expire/device.vue @@ -114,11 +114,11 @@ deviceTypeList.value = res.data }) // 设备名称 - getDeviceNameList().then((res) => { + getDeviceNameList({ equipmentType: '1' }).then((res) => { deviceNameList.value = res.data }) // 规格型号及辅助字段 - getModelAllList({}).then((res) => { + getModelAllList({ equipmentType: '1' }).then((res) => { allList.value = res.data modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))) helpList.value = Array.from(new Set(res.data.filter((item: any) => item.helpInstruction).map((item: any) => item.helpInstruction))) diff --git a/src/views/system/installation/list.vue b/src/views/system/installation/list.vue index 8c8b950..72f1130 100644 --- a/src/views/system/installation/list.vue +++ b/src/views/system/installation/list.vue @@ -131,7 +131,7 @@
diff --git a/src/views/system/post/list.vue b/src/views/system/post/list.vue index f24eb12..6b6cf27 100644 --- a/src/views/system/post/list.vue +++ b/src/views/system/post/list.vue @@ -116,7 +116,7 @@
diff --git a/src/api/system/installation.ts b/src/api/system/installation.ts index 4288976..bc33926 100644 --- a/src/api/system/installation.ts +++ b/src/api/system/installation.ts @@ -35,10 +35,9 @@ }) } // 列表 - 不分页 -export function getLocationList(data: any) { +export function getLocationList() { return request({ url: '/system/location/list', - method: 'post', - data, + method: 'get', }) } diff --git a/src/views/system/expire/device.vue b/src/views/system/expire/device.vue index 34f42a8..b25a74b 100644 --- a/src/views/system/expire/device.vue +++ b/src/views/system/expire/device.vue @@ -114,11 +114,11 @@ deviceTypeList.value = res.data }) // 设备名称 - getDeviceNameList().then((res) => { + getDeviceNameList({ equipmentType: '1' }).then((res) => { deviceNameList.value = res.data }) // 规格型号及辅助字段 - getModelAllList({}).then((res) => { + getModelAllList({ equipmentType: '1' }).then((res) => { allList.value = res.data modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))) helpList.value = Array.from(new Set(res.data.filter((item: any) => item.helpInstruction).map((item: any) => item.helpInstruction))) diff --git a/src/views/system/installation/list.vue b/src/views/system/installation/list.vue index 8c8b950..72f1130 100644 --- a/src/views/system/installation/list.vue +++ b/src/views/system/installation/list.vue @@ -131,7 +131,7 @@
diff --git a/src/views/system/post/list.vue b/src/views/system/post/list.vue index f24eb12..6b6cf27 100644 --- a/src/views/system/post/list.vue +++ b/src/views/system/post/list.vue @@ -116,7 +116,7 @@
diff --git a/src/views/tested/device/certificate/index.vue b/src/views/tested/device/certificate/index.vue index c9e74e7..138a543 100644 --- a/src/views/tested/device/certificate/index.vue +++ b/src/views/tested/device/certificate/index.vue @@ -148,7 +148,7 @@ const allList = ref([]) const fetchDict = () => { // 设备名称 - getDeviceNameList().then((res) => { + getDeviceNameList({ equipmentType: '1' }).then((res) => { deviceNameList.value = res.data }) // 规格型号 diff --git a/src/api/system/installation.ts b/src/api/system/installation.ts index 4288976..bc33926 100644 --- a/src/api/system/installation.ts +++ b/src/api/system/installation.ts @@ -35,10 +35,9 @@ }) } // 列表 - 不分页 -export function getLocationList(data: any) { +export function getLocationList() { return request({ url: '/system/location/list', - method: 'post', - data, + method: 'get', }) } diff --git a/src/views/system/expire/device.vue b/src/views/system/expire/device.vue index 34f42a8..b25a74b 100644 --- a/src/views/system/expire/device.vue +++ b/src/views/system/expire/device.vue @@ -114,11 +114,11 @@ deviceTypeList.value = res.data }) // 设备名称 - getDeviceNameList().then((res) => { + getDeviceNameList({ equipmentType: '1' }).then((res) => { deviceNameList.value = res.data }) // 规格型号及辅助字段 - getModelAllList({}).then((res) => { + getModelAllList({ equipmentType: '1' }).then((res) => { allList.value = res.data modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))) helpList.value = Array.from(new Set(res.data.filter((item: any) => item.helpInstruction).map((item: any) => item.helpInstruction))) diff --git a/src/views/system/installation/list.vue b/src/views/system/installation/list.vue index 8c8b950..72f1130 100644 --- a/src/views/system/installation/list.vue +++ b/src/views/system/installation/list.vue @@ -131,7 +131,7 @@
diff --git a/src/views/system/post/list.vue b/src/views/system/post/list.vue index f24eb12..6b6cf27 100644 --- a/src/views/system/post/list.vue +++ b/src/views/system/post/list.vue @@ -116,7 +116,7 @@
diff --git a/src/views/tested/device/certificate/index.vue b/src/views/tested/device/certificate/index.vue index c9e74e7..138a543 100644 --- a/src/views/tested/device/certificate/index.vue +++ b/src/views/tested/device/certificate/index.vue @@ -148,7 +148,7 @@ const allList = ref([]) const fetchDict = () => { // 设备名称 - getDeviceNameList().then((res) => { + getDeviceNameList({ equipmentType: '1' }).then((res) => { deviceNameList.value = res.data }) // 规格型号 diff --git a/src/views/tested/device/info/components/edit.vue b/src/views/tested/device/info/components/edit.vue index 22c6431..d310206 100644 --- a/src/views/tested/device/info/components/edit.vue +++ b/src/views/tested/device/info/components/edit.vue @@ -21,6 +21,8 @@ import { getDeviceNameList, getModelAllList, getModelList } from '@/api/eqpt/device/model' import { equipmentLabelBind } from '@/api/reader' import scanEquipmentDialog from '@/components/scanEquipmentDialog/index.vue' +import { getLocationList } from '@/api/system/installation' +import { getPostList } from '@/api/system/post' const $route = useRoute() const $router = useRouter() const userStore = useUserStore() @@ -171,9 +173,13 @@ // 辅助字段 const helpList = ref([]) const allList = ref([]) +// 安装位置 +const installLocationList = ref([]) +// 使用岗位 +const usePositionList = ref([]) const fetchSelectData = async () => { // 规格型号及辅助字段 - const res = await getModelAllList({}) + const res = await getModelAllList({ equipmentType: $route.query.equipmentType }) allList.value = res.data modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))) helpList.value = Array.from(new Set(res.data.filter((item: any) => item.helpInstruction).map((item: any) => item.helpInstruction))) @@ -195,10 +201,19 @@ deviceQualityList.value = res.data }) // 设备名称 - getDeviceNameList().then((res) => { + getDeviceNameList({ equipmentType: $route.query.equipmentType }).then((res) => { deviceNameList.value = res.data console.log(res.data, '设备名称') }) + // 使用岗位 + getPostList({}).then((res) => { + usePositionList.value = res.data + }) + // 安装位置 + getLocationList().then((res) => { + // console.log(res.data, '安装位置') + installLocationList.value = res.data + }) } // 监听设备名称下拉框,修改规格型号和辅助字段 watch(() => ruleForm.value.equipmentName, (newVal) => { @@ -875,7 +890,10 @@ - + + + + @@ -910,21 +928,26 @@ - - - - + + + + - + + + + - - + + + +
diff --git a/src/views/system/post/list.vue b/src/views/system/post/list.vue index f24eb12..6b6cf27 100644 --- a/src/views/system/post/list.vue +++ b/src/views/system/post/list.vue @@ -116,7 +116,7 @@
diff --git a/src/views/tested/device/certificate/index.vue b/src/views/tested/device/certificate/index.vue index c9e74e7..138a543 100644 --- a/src/views/tested/device/certificate/index.vue +++ b/src/views/tested/device/certificate/index.vue @@ -148,7 +148,7 @@ const allList = ref([]) const fetchDict = () => { // 设备名称 - getDeviceNameList().then((res) => { + getDeviceNameList({ equipmentType: '1' }).then((res) => { deviceNameList.value = res.data }) // 规格型号 diff --git a/src/views/tested/device/info/components/edit.vue b/src/views/tested/device/info/components/edit.vue index 22c6431..d310206 100644 --- a/src/views/tested/device/info/components/edit.vue +++ b/src/views/tested/device/info/components/edit.vue @@ -21,6 +21,8 @@ import { getDeviceNameList, getModelAllList, getModelList } from '@/api/eqpt/device/model' import { equipmentLabelBind } from '@/api/reader' import scanEquipmentDialog from '@/components/scanEquipmentDialog/index.vue' +import { getLocationList } from '@/api/system/installation' +import { getPostList } from '@/api/system/post' const $route = useRoute() const $router = useRouter() const userStore = useUserStore() @@ -171,9 +173,13 @@ // 辅助字段 const helpList = ref([]) const allList = ref([]) +// 安装位置 +const installLocationList = ref([]) +// 使用岗位 +const usePositionList = ref([]) const fetchSelectData = async () => { // 规格型号及辅助字段 - const res = await getModelAllList({}) + const res = await getModelAllList({ equipmentType: $route.query.equipmentType }) allList.value = res.data modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))) helpList.value = Array.from(new Set(res.data.filter((item: any) => item.helpInstruction).map((item: any) => item.helpInstruction))) @@ -195,10 +201,19 @@ deviceQualityList.value = res.data }) // 设备名称 - getDeviceNameList().then((res) => { + getDeviceNameList({ equipmentType: $route.query.equipmentType }).then((res) => { deviceNameList.value = res.data console.log(res.data, '设备名称') }) + // 使用岗位 + getPostList({}).then((res) => { + usePositionList.value = res.data + }) + // 安装位置 + getLocationList().then((res) => { + // console.log(res.data, '安装位置') + installLocationList.value = res.data + }) } // 监听设备名称下拉框,修改规格型号和辅助字段 watch(() => ruleForm.value.equipmentName, (newVal) => { @@ -875,7 +890,10 @@ - + + + + @@ -910,21 +928,26 @@ - - - - + + + + - + + + + - - + + + +
diff --git a/src/views/system/post/list.vue b/src/views/system/post/list.vue index f24eb12..6b6cf27 100644 --- a/src/views/system/post/list.vue +++ b/src/views/system/post/list.vue @@ -116,7 +116,7 @@
diff --git a/src/views/tested/device/certificate/index.vue b/src/views/tested/device/certificate/index.vue index c9e74e7..138a543 100644 --- a/src/views/tested/device/certificate/index.vue +++ b/src/views/tested/device/certificate/index.vue @@ -148,7 +148,7 @@ const allList = ref([]) const fetchDict = () => { // 设备名称 - getDeviceNameList().then((res) => { + getDeviceNameList({ equipmentType: '1' }).then((res) => { deviceNameList.value = res.data }) // 规格型号 diff --git a/src/views/tested/device/info/components/edit.vue b/src/views/tested/device/info/components/edit.vue index 22c6431..d310206 100644 --- a/src/views/tested/device/info/components/edit.vue +++ b/src/views/tested/device/info/components/edit.vue @@ -21,6 +21,8 @@ import { getDeviceNameList, getModelAllList, getModelList } from '@/api/eqpt/device/model' import { equipmentLabelBind } from '@/api/reader' import scanEquipmentDialog from '@/components/scanEquipmentDialog/index.vue' +import { getLocationList } from '@/api/system/installation' +import { getPostList } from '@/api/system/post' const $route = useRoute() const $router = useRouter() const userStore = useUserStore() @@ -171,9 +173,13 @@ // 辅助字段 const helpList = ref([]) const allList = ref([]) +// 安装位置 +const installLocationList = ref([]) +// 使用岗位 +const usePositionList = ref([]) const fetchSelectData = async () => { // 规格型号及辅助字段 - const res = await getModelAllList({}) + const res = await getModelAllList({ equipmentType: $route.query.equipmentType }) allList.value = res.data modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))) helpList.value = Array.from(new Set(res.data.filter((item: any) => item.helpInstruction).map((item: any) => item.helpInstruction))) @@ -195,10 +201,19 @@ deviceQualityList.value = res.data }) // 设备名称 - getDeviceNameList().then((res) => { + getDeviceNameList({ equipmentType: $route.query.equipmentType }).then((res) => { deviceNameList.value = res.data console.log(res.data, '设备名称') }) + // 使用岗位 + getPostList({}).then((res) => { + usePositionList.value = res.data + }) + // 安装位置 + getLocationList().then((res) => { + // console.log(res.data, '安装位置') + installLocationList.value = res.data + }) } // 监听设备名称下拉框,修改规格型号和辅助字段 watch(() => ruleForm.value.equipmentName, (newVal) => { @@ -875,7 +890,10 @@ - + + + + @@ -910,21 +928,26 @@ - - - - + + + + - + + + + - - + + + + - + @@ -797,9 +822,7 @@ - - - + @@ -807,6 +830,11 @@ + + + + + - + + - - - - - - - - - - - - - + + + + {{ item.name }} + {{ item.deptName }} + @@ -839,19 +861,45 @@ /> - - - - - + + + + + + + + + + + + + + + + + + + + + + + + 只看我负责的 + + + @@ -869,7 +917,7 @@ diff --git a/src/api/system/installation.ts b/src/api/system/installation.ts index 4288976..bc33926 100644 --- a/src/api/system/installation.ts +++ b/src/api/system/installation.ts @@ -35,10 +35,9 @@ }) } // 列表 - 不分页 -export function getLocationList(data: any) { +export function getLocationList() { return request({ url: '/system/location/list', - method: 'post', - data, + method: 'get', }) } diff --git a/src/views/system/expire/device.vue b/src/views/system/expire/device.vue index 34f42a8..b25a74b 100644 --- a/src/views/system/expire/device.vue +++ b/src/views/system/expire/device.vue @@ -114,11 +114,11 @@ deviceTypeList.value = res.data }) // 设备名称 - getDeviceNameList().then((res) => { + getDeviceNameList({ equipmentType: '1' }).then((res) => { deviceNameList.value = res.data }) // 规格型号及辅助字段 - getModelAllList({}).then((res) => { + getModelAllList({ equipmentType: '1' }).then((res) => { allList.value = res.data modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))) helpList.value = Array.from(new Set(res.data.filter((item: any) => item.helpInstruction).map((item: any) => item.helpInstruction))) diff --git a/src/views/system/installation/list.vue b/src/views/system/installation/list.vue index 8c8b950..72f1130 100644 --- a/src/views/system/installation/list.vue +++ b/src/views/system/installation/list.vue @@ -131,7 +131,7 @@
diff --git a/src/views/system/post/list.vue b/src/views/system/post/list.vue index f24eb12..6b6cf27 100644 --- a/src/views/system/post/list.vue +++ b/src/views/system/post/list.vue @@ -116,7 +116,7 @@
diff --git a/src/views/tested/device/certificate/index.vue b/src/views/tested/device/certificate/index.vue index c9e74e7..138a543 100644 --- a/src/views/tested/device/certificate/index.vue +++ b/src/views/tested/device/certificate/index.vue @@ -148,7 +148,7 @@ const allList = ref([]) const fetchDict = () => { // 设备名称 - getDeviceNameList().then((res) => { + getDeviceNameList({ equipmentType: '1' }).then((res) => { deviceNameList.value = res.data }) // 规格型号 diff --git a/src/views/tested/device/info/components/edit.vue b/src/views/tested/device/info/components/edit.vue index 22c6431..d310206 100644 --- a/src/views/tested/device/info/components/edit.vue +++ b/src/views/tested/device/info/components/edit.vue @@ -21,6 +21,8 @@ import { getDeviceNameList, getModelAllList, getModelList } from '@/api/eqpt/device/model' import { equipmentLabelBind } from '@/api/reader' import scanEquipmentDialog from '@/components/scanEquipmentDialog/index.vue' +import { getLocationList } from '@/api/system/installation' +import { getPostList } from '@/api/system/post' const $route = useRoute() const $router = useRouter() const userStore = useUserStore() @@ -171,9 +173,13 @@ // 辅助字段 const helpList = ref([]) const allList = ref([]) +// 安装位置 +const installLocationList = ref([]) +// 使用岗位 +const usePositionList = ref([]) const fetchSelectData = async () => { // 规格型号及辅助字段 - const res = await getModelAllList({}) + const res = await getModelAllList({ equipmentType: $route.query.equipmentType }) allList.value = res.data modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))) helpList.value = Array.from(new Set(res.data.filter((item: any) => item.helpInstruction).map((item: any) => item.helpInstruction))) @@ -195,10 +201,19 @@ deviceQualityList.value = res.data }) // 设备名称 - getDeviceNameList().then((res) => { + getDeviceNameList({ equipmentType: $route.query.equipmentType }).then((res) => { deviceNameList.value = res.data console.log(res.data, '设备名称') }) + // 使用岗位 + getPostList({}).then((res) => { + usePositionList.value = res.data + }) + // 安装位置 + getLocationList().then((res) => { + // console.log(res.data, '安装位置') + installLocationList.value = res.data + }) } // 监听设备名称下拉框,修改规格型号和辅助字段 watch(() => ruleForm.value.equipmentName, (newVal) => { @@ -875,7 +890,10 @@ - + + + + @@ -910,21 +928,26 @@ - - - - + + + + - + + + + - - + + + + - + @@ -797,9 +822,7 @@ - - - + @@ -807,6 +830,11 @@ + + + + + - + + - - - - - - - - - - - - - + + + + {{ item.name }} + {{ item.deptName }} + @@ -839,19 +861,45 @@ /> - - - - - + + + + + + + + + + + + + + + + + + + + + + + + 只看我负责的 + + + @@ -869,7 +917,7 @@ diff --git a/src/views/tested/device/info/components/showPhoto.vue b/src/views/tested/device/info/components/showPhoto.vue index 3af1845..20148da 100644 --- a/src/views/tested/device/info/components/showPhoto.vue +++ b/src/views/tested/device/info/components/showPhoto.vue @@ -14,6 +14,10 @@ type: String, default: '100px', }, + showClose: { + type: Boolean, + default: true, + }, }) const $emits = defineEmits(['delete']) const $route = useRoute() @@ -60,7 +64,7 @@ {{ item.minioFileName }} - x + x
diff --git a/src/api/system/installation.ts b/src/api/system/installation.ts index 4288976..bc33926 100644 --- a/src/api/system/installation.ts +++ b/src/api/system/installation.ts @@ -35,10 +35,9 @@ }) } // 列表 - 不分页 -export function getLocationList(data: any) { +export function getLocationList() { return request({ url: '/system/location/list', - method: 'post', - data, + method: 'get', }) } diff --git a/src/views/system/expire/device.vue b/src/views/system/expire/device.vue index 34f42a8..b25a74b 100644 --- a/src/views/system/expire/device.vue +++ b/src/views/system/expire/device.vue @@ -114,11 +114,11 @@ deviceTypeList.value = res.data }) // 设备名称 - getDeviceNameList().then((res) => { + getDeviceNameList({ equipmentType: '1' }).then((res) => { deviceNameList.value = res.data }) // 规格型号及辅助字段 - getModelAllList({}).then((res) => { + getModelAllList({ equipmentType: '1' }).then((res) => { allList.value = res.data modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))) helpList.value = Array.from(new Set(res.data.filter((item: any) => item.helpInstruction).map((item: any) => item.helpInstruction))) diff --git a/src/views/system/installation/list.vue b/src/views/system/installation/list.vue index 8c8b950..72f1130 100644 --- a/src/views/system/installation/list.vue +++ b/src/views/system/installation/list.vue @@ -131,7 +131,7 @@
diff --git a/src/views/system/post/list.vue b/src/views/system/post/list.vue index f24eb12..6b6cf27 100644 --- a/src/views/system/post/list.vue +++ b/src/views/system/post/list.vue @@ -116,7 +116,7 @@
diff --git a/src/views/tested/device/certificate/index.vue b/src/views/tested/device/certificate/index.vue index c9e74e7..138a543 100644 --- a/src/views/tested/device/certificate/index.vue +++ b/src/views/tested/device/certificate/index.vue @@ -148,7 +148,7 @@ const allList = ref([]) const fetchDict = () => { // 设备名称 - getDeviceNameList().then((res) => { + getDeviceNameList({ equipmentType: '1' }).then((res) => { deviceNameList.value = res.data }) // 规格型号 diff --git a/src/views/tested/device/info/components/edit.vue b/src/views/tested/device/info/components/edit.vue index 22c6431..d310206 100644 --- a/src/views/tested/device/info/components/edit.vue +++ b/src/views/tested/device/info/components/edit.vue @@ -21,6 +21,8 @@ import { getDeviceNameList, getModelAllList, getModelList } from '@/api/eqpt/device/model' import { equipmentLabelBind } from '@/api/reader' import scanEquipmentDialog from '@/components/scanEquipmentDialog/index.vue' +import { getLocationList } from '@/api/system/installation' +import { getPostList } from '@/api/system/post' const $route = useRoute() const $router = useRouter() const userStore = useUserStore() @@ -171,9 +173,13 @@ // 辅助字段 const helpList = ref([]) const allList = ref([]) +// 安装位置 +const installLocationList = ref([]) +// 使用岗位 +const usePositionList = ref([]) const fetchSelectData = async () => { // 规格型号及辅助字段 - const res = await getModelAllList({}) + const res = await getModelAllList({ equipmentType: $route.query.equipmentType }) allList.value = res.data modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))) helpList.value = Array.from(new Set(res.data.filter((item: any) => item.helpInstruction).map((item: any) => item.helpInstruction))) @@ -195,10 +201,19 @@ deviceQualityList.value = res.data }) // 设备名称 - getDeviceNameList().then((res) => { + getDeviceNameList({ equipmentType: $route.query.equipmentType }).then((res) => { deviceNameList.value = res.data console.log(res.data, '设备名称') }) + // 使用岗位 + getPostList({}).then((res) => { + usePositionList.value = res.data + }) + // 安装位置 + getLocationList().then((res) => { + // console.log(res.data, '安装位置') + installLocationList.value = res.data + }) } // 监听设备名称下拉框,修改规格型号和辅助字段 watch(() => ruleForm.value.equipmentName, (newVal) => { @@ -875,7 +890,10 @@ - + + + + @@ -910,21 +928,26 @@ - - - - + + + + - + + + + - - + + + + - + @@ -797,9 +822,7 @@ - - - + @@ -807,6 +830,11 @@ + + + + + - + + - - - - - - - - - - - - - + + + + {{ item.name }} + {{ item.deptName }} + @@ -839,19 +861,45 @@ /> - - - - - + + + + + + + + + + + + + + + + + + + + + + + + 只看我负责的 + + + @@ -869,7 +917,7 @@ diff --git a/src/views/tested/device/info/components/showPhoto.vue b/src/views/tested/device/info/components/showPhoto.vue index 3af1845..20148da 100644 --- a/src/views/tested/device/info/components/showPhoto.vue +++ b/src/views/tested/device/info/components/showPhoto.vue @@ -14,6 +14,10 @@ type: String, default: '100px', }, + showClose: { + type: Boolean, + default: true, + }, }) const $emits = defineEmits(['delete']) const $route = useRoute() @@ -60,7 +64,7 @@ {{ item.minioFileName }} - x + x
diff --git a/src/views/tested/device/model/components/edit.vue b/src/views/tested/device/model/components/edit.vue index 0db38a6..f9b05e5 100644 --- a/src/views/tested/device/model/components/edit.vue +++ b/src/views/tested/device/model/components/edit.vue @@ -40,6 +40,7 @@ technicalTargetList: [], // 技术指标 updateTime: '', equipmentType: '', + inspectable: [] as any, }) // 表单 // 设备名称验证规则 const checkCycle = (rule: any, value: any, callback: any) => { @@ -53,13 +54,20 @@ callback() } } +// 表单验证规则 const rules = ref({ equipmentName: [{ required: true, message: '设备名称必填', trigger: ['blur', 'change'] }], equipmentType: [{ required: true, message: '设备分类必选', trigger: ['blur', 'change'] }], - category: [{ required: true, message: '设备分类必选', trigger: ['blur', 'change'] }], + // category: [{ required: true, message: '设备分类必选', trigger: ['blur', 'change'] }], model: [{ required: true, message: '规格型号必填', trigger: ['blur', 'change'] }], checkCycle: [{ required: true, validator: checkCycle, trigger: ['blur', 'change'] }], -}) // 表单验证规则 +}) +// 当计量站可检时,设备分类必填 +watch(() => ruleForm.value.inspectable, (newVal) => { + if (newVal?.length) { + rules.value.category = [{ required: true, message: '设备分类必选', trigger: ['blur', 'change'] }] + } +}, { deep: true }) // 弹窗初始化 const initDialog = () => { dialogStatus.value = $route.params.type as string @@ -76,8 +84,15 @@ else { const data = JSON.parse($route.query.row as string) // detailGroup({ groupId: data.id }).then((res) => { - ruleForm.value = data // }) + ruleForm.value = data + // 计量站是否可检 + if (data.inspectable) { + ruleForm.value.inspectable = data.inspectable.split(',') + } + else { + ruleForm.value.inspectable = [] + } } } onMounted(() => { @@ -107,8 +122,12 @@ ruleForm.value.helpInstruction = '/' } ruleForm.value.technicalTargetList = tableRef.value.list + const data = { + ...ruleForm.value, + inspectable: ruleForm.value.inspectable.join(','), + } if ($route.params.type === 'create') { - handlerFunApi('create', ruleForm.value).then((res) => { + handlerFunApi('create', data).then((res) => { ElMessage.success('添加成功') close() }) @@ -116,7 +135,7 @@ else { // ruleForm.value.technicalTargetList = tableRef.value.list console.log(ruleForm.value) - handlerFunApi('update', ruleForm.value).then((res) => { + handlerFunApi('update', data).then((res) => { ElMessage.success('修改成功') close() }) @@ -216,7 +235,7 @@ :model="ruleForm" :rules="rules" label-position="right" label-width="110px" class="form" :disabled="dialogStatus === 'detail'" - :class="$route.path.includes('detail') ? 'isDetail' : ''" + :class="[$route.path.includes('detail') ? 'isDetail' : '']" > @@ -232,24 +251,24 @@ - + - + - + - + @@ -281,8 +300,8 @@ - - + + @@ -292,11 +311,19 @@ + + + + + + + + - + @@ -309,5 +336,13 @@ diff --git a/src/api/system/installation.ts b/src/api/system/installation.ts index 4288976..bc33926 100644 --- a/src/api/system/installation.ts +++ b/src/api/system/installation.ts @@ -35,10 +35,9 @@ }) } // 列表 - 不分页 -export function getLocationList(data: any) { +export function getLocationList() { return request({ url: '/system/location/list', - method: 'post', - data, + method: 'get', }) } diff --git a/src/views/system/expire/device.vue b/src/views/system/expire/device.vue index 34f42a8..b25a74b 100644 --- a/src/views/system/expire/device.vue +++ b/src/views/system/expire/device.vue @@ -114,11 +114,11 @@ deviceTypeList.value = res.data }) // 设备名称 - getDeviceNameList().then((res) => { + getDeviceNameList({ equipmentType: '1' }).then((res) => { deviceNameList.value = res.data }) // 规格型号及辅助字段 - getModelAllList({}).then((res) => { + getModelAllList({ equipmentType: '1' }).then((res) => { allList.value = res.data modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))) helpList.value = Array.from(new Set(res.data.filter((item: any) => item.helpInstruction).map((item: any) => item.helpInstruction))) diff --git a/src/views/system/installation/list.vue b/src/views/system/installation/list.vue index 8c8b950..72f1130 100644 --- a/src/views/system/installation/list.vue +++ b/src/views/system/installation/list.vue @@ -131,7 +131,7 @@
diff --git a/src/views/system/post/list.vue b/src/views/system/post/list.vue index f24eb12..6b6cf27 100644 --- a/src/views/system/post/list.vue +++ b/src/views/system/post/list.vue @@ -116,7 +116,7 @@
diff --git a/src/views/tested/device/certificate/index.vue b/src/views/tested/device/certificate/index.vue index c9e74e7..138a543 100644 --- a/src/views/tested/device/certificate/index.vue +++ b/src/views/tested/device/certificate/index.vue @@ -148,7 +148,7 @@ const allList = ref([]) const fetchDict = () => { // 设备名称 - getDeviceNameList().then((res) => { + getDeviceNameList({ equipmentType: '1' }).then((res) => { deviceNameList.value = res.data }) // 规格型号 diff --git a/src/views/tested/device/info/components/edit.vue b/src/views/tested/device/info/components/edit.vue index 22c6431..d310206 100644 --- a/src/views/tested/device/info/components/edit.vue +++ b/src/views/tested/device/info/components/edit.vue @@ -21,6 +21,8 @@ import { getDeviceNameList, getModelAllList, getModelList } from '@/api/eqpt/device/model' import { equipmentLabelBind } from '@/api/reader' import scanEquipmentDialog from '@/components/scanEquipmentDialog/index.vue' +import { getLocationList } from '@/api/system/installation' +import { getPostList } from '@/api/system/post' const $route = useRoute() const $router = useRouter() const userStore = useUserStore() @@ -171,9 +173,13 @@ // 辅助字段 const helpList = ref([]) const allList = ref([]) +// 安装位置 +const installLocationList = ref([]) +// 使用岗位 +const usePositionList = ref([]) const fetchSelectData = async () => { // 规格型号及辅助字段 - const res = await getModelAllList({}) + const res = await getModelAllList({ equipmentType: $route.query.equipmentType }) allList.value = res.data modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))) helpList.value = Array.from(new Set(res.data.filter((item: any) => item.helpInstruction).map((item: any) => item.helpInstruction))) @@ -195,10 +201,19 @@ deviceQualityList.value = res.data }) // 设备名称 - getDeviceNameList().then((res) => { + getDeviceNameList({ equipmentType: $route.query.equipmentType }).then((res) => { deviceNameList.value = res.data console.log(res.data, '设备名称') }) + // 使用岗位 + getPostList({}).then((res) => { + usePositionList.value = res.data + }) + // 安装位置 + getLocationList().then((res) => { + // console.log(res.data, '安装位置') + installLocationList.value = res.data + }) } // 监听设备名称下拉框,修改规格型号和辅助字段 watch(() => ruleForm.value.equipmentName, (newVal) => { @@ -875,7 +890,10 @@ - + + + + @@ -910,21 +928,26 @@ - - - - + + + + - + + + + - - + + + + - + @@ -797,9 +822,7 @@ - - - + @@ -807,6 +830,11 @@ + + + + + - + + - - - - - - - - - - - - - + + + + {{ item.name }} + {{ item.deptName }} + @@ -839,19 +861,45 @@ /> - - - - - + + + + + + + + + + + + + + + + + + + + + + + + 只看我负责的 + + + @@ -869,7 +917,7 @@ diff --git a/src/views/tested/device/info/components/showPhoto.vue b/src/views/tested/device/info/components/showPhoto.vue index 3af1845..20148da 100644 --- a/src/views/tested/device/info/components/showPhoto.vue +++ b/src/views/tested/device/info/components/showPhoto.vue @@ -14,6 +14,10 @@ type: String, default: '100px', }, + showClose: { + type: Boolean, + default: true, + }, }) const $emits = defineEmits(['delete']) const $route = useRoute() @@ -60,7 +64,7 @@ {{ item.minioFileName }} - x + x
diff --git a/src/views/tested/device/model/components/edit.vue b/src/views/tested/device/model/components/edit.vue index 0db38a6..f9b05e5 100644 --- a/src/views/tested/device/model/components/edit.vue +++ b/src/views/tested/device/model/components/edit.vue @@ -40,6 +40,7 @@ technicalTargetList: [], // 技术指标 updateTime: '', equipmentType: '', + inspectable: [] as any, }) // 表单 // 设备名称验证规则 const checkCycle = (rule: any, value: any, callback: any) => { @@ -53,13 +54,20 @@ callback() } } +// 表单验证规则 const rules = ref({ equipmentName: [{ required: true, message: '设备名称必填', trigger: ['blur', 'change'] }], equipmentType: [{ required: true, message: '设备分类必选', trigger: ['blur', 'change'] }], - category: [{ required: true, message: '设备分类必选', trigger: ['blur', 'change'] }], + // category: [{ required: true, message: '设备分类必选', trigger: ['blur', 'change'] }], model: [{ required: true, message: '规格型号必填', trigger: ['blur', 'change'] }], checkCycle: [{ required: true, validator: checkCycle, trigger: ['blur', 'change'] }], -}) // 表单验证规则 +}) +// 当计量站可检时,设备分类必填 +watch(() => ruleForm.value.inspectable, (newVal) => { + if (newVal?.length) { + rules.value.category = [{ required: true, message: '设备分类必选', trigger: ['blur', 'change'] }] + } +}, { deep: true }) // 弹窗初始化 const initDialog = () => { dialogStatus.value = $route.params.type as string @@ -76,8 +84,15 @@ else { const data = JSON.parse($route.query.row as string) // detailGroup({ groupId: data.id }).then((res) => { - ruleForm.value = data // }) + ruleForm.value = data + // 计量站是否可检 + if (data.inspectable) { + ruleForm.value.inspectable = data.inspectable.split(',') + } + else { + ruleForm.value.inspectable = [] + } } } onMounted(() => { @@ -107,8 +122,12 @@ ruleForm.value.helpInstruction = '/' } ruleForm.value.technicalTargetList = tableRef.value.list + const data = { + ...ruleForm.value, + inspectable: ruleForm.value.inspectable.join(','), + } if ($route.params.type === 'create') { - handlerFunApi('create', ruleForm.value).then((res) => { + handlerFunApi('create', data).then((res) => { ElMessage.success('添加成功') close() }) @@ -116,7 +135,7 @@ else { // ruleForm.value.technicalTargetList = tableRef.value.list console.log(ruleForm.value) - handlerFunApi('update', ruleForm.value).then((res) => { + handlerFunApi('update', data).then((res) => { ElMessage.success('修改成功') close() }) @@ -216,7 +235,7 @@ :model="ruleForm" :rules="rules" label-position="right" label-width="110px" class="form" :disabled="dialogStatus === 'detail'" - :class="$route.path.includes('detail') ? 'isDetail' : ''" + :class="[$route.path.includes('detail') ? 'isDetail' : '']" > @@ -232,24 +251,24 @@ - + - + - + - + @@ -281,8 +300,8 @@ - - + + @@ -292,11 +311,19 @@ + + + + + + + + - + @@ -309,5 +336,13 @@ diff --git a/src/views/tested/device/model/components/list.vue b/src/views/tested/device/model/components/list.vue index 4dd6dac..5985bc6 100644 --- a/src/views/tested/device/model/components/list.vue +++ b/src/views/tested/device/model/components/list.vue @@ -7,6 +7,7 @@ import { getDictByCode } from '@/api/system/dict' import { getPhotoUrl } from '@/api/system/tool' import { download } from '@/utils/download' +import showPhoto from '@/views/tested/device/info/components/showPhoto.vue' const { proxy } = getCurrentInstance() as any const listQuery = reactive({ equipmentType: '', @@ -187,7 +188,7 @@ deviceNameList.value = res.data }) // 规格型号及辅助字段 - getModelAllList({}).then((res) => { + getModelAllList({ equipmentType: '' }).then((res) => { allList.value = res.data modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))) helpList.value = Array.from(new Set(res.data.filter((item: any) => item.helpInstruction).map((item: any) => item.helpInstruction))) @@ -204,11 +205,22 @@ getDeviceNameList({ equipmentType: newVal }).then((res) => { deviceNameList.value = res.data }) + getModelAllList({ equipmentType: newVal }).then((res) => { + allList.value = res.data + modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))) + helpList.value = Array.from(new Set(res.data.filter((item: any) => item.helpInstruction).map((item: any) => item.helpInstruction))) + }) } else { + // 设备名称 getDeviceNameList({ equipmentType: '' }).then((res) => { deviceNameList.value = res.data }) + getModelAllList({ equipmentType: '' }).then((res) => { + allList.value = res.data + modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))) + helpList.value = Array.from(new Set(res.data.filter((item: any) => item.helpInstruction).map((item: any) => item.helpInstruction))) + }) } }, { deep: true, @@ -303,9 +315,10 @@ diff --git a/src/views/tested/device/model/components/edit.vue b/src/views/tested/device/model/components/edit.vue index 0db38a6..f9b05e5 100644 --- a/src/views/tested/device/model/components/edit.vue +++ b/src/views/tested/device/model/components/edit.vue @@ -40,6 +40,7 @@ technicalTargetList: [], // 技术指标 updateTime: '', equipmentType: '', + inspectable: [] as any, }) // 表单 // 设备名称验证规则 const checkCycle = (rule: any, value: any, callback: any) => { @@ -53,13 +54,20 @@ callback() } } +// 表单验证规则 const rules = ref({ equipmentName: [{ required: true, message: '设备名称必填', trigger: ['blur', 'change'] }], equipmentType: [{ required: true, message: '设备分类必选', trigger: ['blur', 'change'] }], - category: [{ required: true, message: '设备分类必选', trigger: ['blur', 'change'] }], + // category: [{ required: true, message: '设备分类必选', trigger: ['blur', 'change'] }], model: [{ required: true, message: '规格型号必填', trigger: ['blur', 'change'] }], checkCycle: [{ required: true, validator: checkCycle, trigger: ['blur', 'change'] }], -}) // 表单验证规则 +}) +// 当计量站可检时,设备分类必填 +watch(() => ruleForm.value.inspectable, (newVal) => { + if (newVal?.length) { + rules.value.category = [{ required: true, message: '设备分类必选', trigger: ['blur', 'change'] }] + } +}, { deep: true }) // 弹窗初始化 const initDialog = () => { dialogStatus.value = $route.params.type as string @@ -76,8 +84,15 @@ else { const data = JSON.parse($route.query.row as string) // detailGroup({ groupId: data.id }).then((res) => { - ruleForm.value = data // }) + ruleForm.value = data + // 计量站是否可检 + if (data.inspectable) { + ruleForm.value.inspectable = data.inspectable.split(',') + } + else { + ruleForm.value.inspectable = [] + } } } onMounted(() => { @@ -107,8 +122,12 @@ ruleForm.value.helpInstruction = '/' } ruleForm.value.technicalTargetList = tableRef.value.list + const data = { + ...ruleForm.value, + inspectable: ruleForm.value.inspectable.join(','), + } if ($route.params.type === 'create') { - handlerFunApi('create', ruleForm.value).then((res) => { + handlerFunApi('create', data).then((res) => { ElMessage.success('添加成功') close() }) @@ -116,7 +135,7 @@ else { // ruleForm.value.technicalTargetList = tableRef.value.list console.log(ruleForm.value) - handlerFunApi('update', ruleForm.value).then((res) => { + handlerFunApi('update', data).then((res) => { ElMessage.success('修改成功') close() }) @@ -216,7 +235,7 @@ :model="ruleForm" :rules="rules" label-position="right" label-width="110px" class="form" :disabled="dialogStatus === 'detail'" - :class="$route.path.includes('detail') ? 'isDetail' : ''" + :class="[$route.path.includes('detail') ? 'isDetail' : '']" > @@ -232,24 +251,24 @@ - + - + - + - + @@ -281,8 +300,8 @@ - - + + @@ -292,11 +311,19 @@ + + + + + + + + - + @@ -309,5 +336,13 @@ diff --git a/src/views/tested/device/model/components/list.vue b/src/views/tested/device/model/components/list.vue index 4dd6dac..5985bc6 100644 --- a/src/views/tested/device/model/components/list.vue +++ b/src/views/tested/device/model/components/list.vue @@ -7,6 +7,7 @@ import { getDictByCode } from '@/api/system/dict' import { getPhotoUrl } from '@/api/system/tool' import { download } from '@/utils/download' +import showPhoto from '@/views/tested/device/info/components/showPhoto.vue' const { proxy } = getCurrentInstance() as any const listQuery = reactive({ equipmentType: '', @@ -187,7 +188,7 @@ deviceNameList.value = res.data }) // 规格型号及辅助字段 - getModelAllList({}).then((res) => { + getModelAllList({ equipmentType: '' }).then((res) => { allList.value = res.data modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))) helpList.value = Array.from(new Set(res.data.filter((item: any) => item.helpInstruction).map((item: any) => item.helpInstruction))) @@ -204,11 +205,22 @@ getDeviceNameList({ equipmentType: newVal }).then((res) => { deviceNameList.value = res.data }) + getModelAllList({ equipmentType: newVal }).then((res) => { + allList.value = res.data + modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))) + helpList.value = Array.from(new Set(res.data.filter((item: any) => item.helpInstruction).map((item: any) => item.helpInstruction))) + }) } else { + // 设备名称 getDeviceNameList({ equipmentType: '' }).then((res) => { deviceNameList.value = res.data }) + getModelAllList({ equipmentType: '' }).then((res) => { + allList.value = res.data + modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))) + helpList.value = Array.from(new Set(res.data.filter((item: any) => item.helpInstruction).map((item: any) => item.helpInstruction))) + }) } }, { deep: true, @@ -303,9 +315,10 @@ diff --git a/src/views/tested/device/model/components/edit.vue b/src/views/tested/device/model/components/edit.vue index 0db38a6..f9b05e5 100644 --- a/src/views/tested/device/model/components/edit.vue +++ b/src/views/tested/device/model/components/edit.vue @@ -40,6 +40,7 @@ technicalTargetList: [], // 技术指标 updateTime: '', equipmentType: '', + inspectable: [] as any, }) // 表单 // 设备名称验证规则 const checkCycle = (rule: any, value: any, callback: any) => { @@ -53,13 +54,20 @@ callback() } } +// 表单验证规则 const rules = ref({ equipmentName: [{ required: true, message: '设备名称必填', trigger: ['blur', 'change'] }], equipmentType: [{ required: true, message: '设备分类必选', trigger: ['blur', 'change'] }], - category: [{ required: true, message: '设备分类必选', trigger: ['blur', 'change'] }], + // category: [{ required: true, message: '设备分类必选', trigger: ['blur', 'change'] }], model: [{ required: true, message: '规格型号必填', trigger: ['blur', 'change'] }], checkCycle: [{ required: true, validator: checkCycle, trigger: ['blur', 'change'] }], -}) // 表单验证规则 +}) +// 当计量站可检时,设备分类必填 +watch(() => ruleForm.value.inspectable, (newVal) => { + if (newVal?.length) { + rules.value.category = [{ required: true, message: '设备分类必选', trigger: ['blur', 'change'] }] + } +}, { deep: true }) // 弹窗初始化 const initDialog = () => { dialogStatus.value = $route.params.type as string @@ -76,8 +84,15 @@ else { const data = JSON.parse($route.query.row as string) // detailGroup({ groupId: data.id }).then((res) => { - ruleForm.value = data // }) + ruleForm.value = data + // 计量站是否可检 + if (data.inspectable) { + ruleForm.value.inspectable = data.inspectable.split(',') + } + else { + ruleForm.value.inspectable = [] + } } } onMounted(() => { @@ -107,8 +122,12 @@ ruleForm.value.helpInstruction = '/' } ruleForm.value.technicalTargetList = tableRef.value.list + const data = { + ...ruleForm.value, + inspectable: ruleForm.value.inspectable.join(','), + } if ($route.params.type === 'create') { - handlerFunApi('create', ruleForm.value).then((res) => { + handlerFunApi('create', data).then((res) => { ElMessage.success('添加成功') close() }) @@ -116,7 +135,7 @@ else { // ruleForm.value.technicalTargetList = tableRef.value.list console.log(ruleForm.value) - handlerFunApi('update', ruleForm.value).then((res) => { + handlerFunApi('update', data).then((res) => { ElMessage.success('修改成功') close() }) @@ -216,7 +235,7 @@ :model="ruleForm" :rules="rules" label-position="right" label-width="110px" class="form" :disabled="dialogStatus === 'detail'" - :class="$route.path.includes('detail') ? 'isDetail' : ''" + :class="[$route.path.includes('detail') ? 'isDetail' : '']" > @@ -232,24 +251,24 @@ - + - + - + - + @@ -281,8 +300,8 @@ - - + + @@ -292,11 +311,19 @@ + + + + + + + + - + @@ -309,5 +336,13 @@ diff --git a/src/views/tested/device/model/components/list.vue b/src/views/tested/device/model/components/list.vue index 4dd6dac..5985bc6 100644 --- a/src/views/tested/device/model/components/list.vue +++ b/src/views/tested/device/model/components/list.vue @@ -7,6 +7,7 @@ import { getDictByCode } from '@/api/system/dict' import { getPhotoUrl } from '@/api/system/tool' import { download } from '@/utils/download' +import showPhoto from '@/views/tested/device/info/components/showPhoto.vue' const { proxy } = getCurrentInstance() as any const listQuery = reactive({ equipmentType: '', @@ -187,7 +188,7 @@ deviceNameList.value = res.data }) // 规格型号及辅助字段 - getModelAllList({}).then((res) => { + getModelAllList({ equipmentType: '' }).then((res) => { allList.value = res.data modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))) helpList.value = Array.from(new Set(res.data.filter((item: any) => item.helpInstruction).map((item: any) => item.helpInstruction))) @@ -204,11 +205,22 @@ getDeviceNameList({ equipmentType: newVal }).then((res) => { deviceNameList.value = res.data }) + getModelAllList({ equipmentType: newVal }).then((res) => { + allList.value = res.data + modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))) + helpList.value = Array.from(new Set(res.data.filter((item: any) => item.helpInstruction).map((item: any) => item.helpInstruction))) + }) } else { + // 设备名称 getDeviceNameList({ equipmentType: '' }).then((res) => { deviceNameList.value = res.data }) + getModelAllList({ equipmentType: '' }).then((res) => { + allList.value = res.data + modelList.value = Array.from(new Set(res.data.filter((item: any) => item.model).map((item: any) => item.model))) + helpList.value = Array.from(new Set(res.data.filter((item: any) => item.helpInstruction).map((item: any) => item.helpInstruction))) + }) } }, { deep: true, @@ -303,9 +315,10 @@