diff --git a/src/api/read b/src/api/read new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/api/read diff --git a/src/api/read b/src/api/read new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/api/read diff --git a/src/api/reader.ts b/src/api/reader.ts new file mode 100644 index 0000000..e495856 --- /dev/null +++ b/src/api/reader.ts @@ -0,0 +1,30 @@ +// 读写器或扫码枪相关接口 +import axios from 'axios' +import request from './index' +const readerType: { [key: string]: string } = { + readerWriter: 'http://127.0.0.1:8083/business/readWriter/gunAndTId/readList', // 有线扫码枪和大读写器 + // readerWriter: '/proxy/business/readWriter/tId/readList', // 读写器 +} +// 获取大读写器读写内容 +export function getReadList(type: string) { + return axios.get(readerType[type]) +} + +// 设备台账标签绑定 +export function equipmentLabelBind(data: { sampleId: string; label: string }) { + return request({ + url: '/equipment/label/bind', + method: 'post', + data, + }) +} + +// 设备台账标签的设备列表 +export function getReaderEquipmentList(data: Object) { + return request({ + url: '/equipment/label/readList', + method: 'post', + data, + }) +} + diff --git a/src/api/read b/src/api/read new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/api/read diff --git a/src/api/reader.ts b/src/api/reader.ts new file mode 100644 index 0000000..e495856 --- /dev/null +++ b/src/api/reader.ts @@ -0,0 +1,30 @@ +// 读写器或扫码枪相关接口 +import axios from 'axios' +import request from './index' +const readerType: { [key: string]: string } = { + readerWriter: 'http://127.0.0.1:8083/business/readWriter/gunAndTId/readList', // 有线扫码枪和大读写器 + // readerWriter: '/proxy/business/readWriter/tId/readList', // 读写器 +} +// 获取大读写器读写内容 +export function getReadList(type: string) { + return axios.get(readerType[type]) +} + +// 设备台账标签绑定 +export function equipmentLabelBind(data: { sampleId: string; label: string }) { + return request({ + url: '/equipment/label/bind', + method: 'post', + data, + }) +} + +// 设备台账标签的设备列表 +export function getReaderEquipmentList(data: Object) { + return request({ + url: '/equipment/label/readList', + method: 'post', + data, + }) +} + diff --git a/src/components.d.ts b/src/components.d.ts index bb75c7a..6d8ba2e 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -55,6 +55,7 @@ QrDialog: typeof import('./components/QrDialog/index.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] + ScanEquipmentDialog: typeof import('./components/scanEquipmentDialog/index.vue')['default'] ScanSampleDialog: typeof import('./components/ScanSampleDialog/index.vue')['default'] SearchArea: typeof import('./components/SearchArea/index.vue')['default'] SearchBar: typeof import('./components/SearchBar/index.vue')['default'] diff --git a/src/api/read b/src/api/read new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/api/read diff --git a/src/api/reader.ts b/src/api/reader.ts new file mode 100644 index 0000000..e495856 --- /dev/null +++ b/src/api/reader.ts @@ -0,0 +1,30 @@ +// 读写器或扫码枪相关接口 +import axios from 'axios' +import request from './index' +const readerType: { [key: string]: string } = { + readerWriter: 'http://127.0.0.1:8083/business/readWriter/gunAndTId/readList', // 有线扫码枪和大读写器 + // readerWriter: '/proxy/business/readWriter/tId/readList', // 读写器 +} +// 获取大读写器读写内容 +export function getReadList(type: string) { + return axios.get(readerType[type]) +} + +// 设备台账标签绑定 +export function equipmentLabelBind(data: { sampleId: string; label: string }) { + return request({ + url: '/equipment/label/bind', + method: 'post', + data, + }) +} + +// 设备台账标签的设备列表 +export function getReaderEquipmentList(data: Object) { + return request({ + url: '/equipment/label/readList', + method: 'post', + data, + }) +} + diff --git a/src/components.d.ts b/src/components.d.ts index bb75c7a..6d8ba2e 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -55,6 +55,7 @@ QrDialog: typeof import('./components/QrDialog/index.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] + ScanEquipmentDialog: typeof import('./components/scanEquipmentDialog/index.vue')['default'] ScanSampleDialog: typeof import('./components/ScanSampleDialog/index.vue')['default'] SearchArea: typeof import('./components/SearchArea/index.vue')['default'] SearchBar: typeof import('./components/SearchBar/index.vue')['default'] diff --git a/src/components/scanEquipmentDialog/index.vue b/src/components/scanEquipmentDialog/index.vue new file mode 100644 index 0000000..30e2c2c --- /dev/null +++ b/src/components/scanEquipmentDialog/index.vue @@ -0,0 +1,221 @@ + + + + + + + + 请使用扫码枪或读写器扫描标签 + + + + + + 扫描到 {{ list.length }} 个设备 + + + 扫描到 {{ list.length }} 个标签{{ list.length > 1 ? ',请选择需要绑定的标签' : '' }} + + + + + + + + + + + + + + + + + + + + + + + + + 重新扫描 + + + 取 消 + + + 确 定 + + + 关 闭 + + + + + + + diff --git a/src/api/read b/src/api/read new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/api/read diff --git a/src/api/reader.ts b/src/api/reader.ts new file mode 100644 index 0000000..e495856 --- /dev/null +++ b/src/api/reader.ts @@ -0,0 +1,30 @@ +// 读写器或扫码枪相关接口 +import axios from 'axios' +import request from './index' +const readerType: { [key: string]: string } = { + readerWriter: 'http://127.0.0.1:8083/business/readWriter/gunAndTId/readList', // 有线扫码枪和大读写器 + // readerWriter: '/proxy/business/readWriter/tId/readList', // 读写器 +} +// 获取大读写器读写内容 +export function getReadList(type: string) { + return axios.get(readerType[type]) +} + +// 设备台账标签绑定 +export function equipmentLabelBind(data: { sampleId: string; label: string }) { + return request({ + url: '/equipment/label/bind', + method: 'post', + data, + }) +} + +// 设备台账标签的设备列表 +export function getReaderEquipmentList(data: Object) { + return request({ + url: '/equipment/label/readList', + method: 'post', + data, + }) +} + diff --git a/src/components.d.ts b/src/components.d.ts index bb75c7a..6d8ba2e 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -55,6 +55,7 @@ QrDialog: typeof import('./components/QrDialog/index.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] + ScanEquipmentDialog: typeof import('./components/scanEquipmentDialog/index.vue')['default'] ScanSampleDialog: typeof import('./components/ScanSampleDialog/index.vue')['default'] SearchArea: typeof import('./components/SearchArea/index.vue')['default'] SearchBar: typeof import('./components/SearchBar/index.vue')['default'] diff --git a/src/components/scanEquipmentDialog/index.vue b/src/components/scanEquipmentDialog/index.vue new file mode 100644 index 0000000..30e2c2c --- /dev/null +++ b/src/components/scanEquipmentDialog/index.vue @@ -0,0 +1,221 @@ + + + + + + + + 请使用扫码枪或读写器扫描标签 + + + + + + 扫描到 {{ list.length }} 个设备 + + + 扫描到 {{ list.length }} 个标签{{ list.length > 1 ? ',请选择需要绑定的标签' : '' }} + + + + + + + + + + + + + + + + + + + + + + + + + 重新扫描 + + + 取 消 + + + 确 定 + + + 关 闭 + + + + + + + diff --git a/src/components/scanEquipmentDialog/scan-interface.ts b/src/components/scanEquipmentDialog/scan-interface.ts new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/components/scanEquipmentDialog/scan-interface.ts diff --git a/src/api/read b/src/api/read new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/api/read diff --git a/src/api/reader.ts b/src/api/reader.ts new file mode 100644 index 0000000..e495856 --- /dev/null +++ b/src/api/reader.ts @@ -0,0 +1,30 @@ +// 读写器或扫码枪相关接口 +import axios from 'axios' +import request from './index' +const readerType: { [key: string]: string } = { + readerWriter: 'http://127.0.0.1:8083/business/readWriter/gunAndTId/readList', // 有线扫码枪和大读写器 + // readerWriter: '/proxy/business/readWriter/tId/readList', // 读写器 +} +// 获取大读写器读写内容 +export function getReadList(type: string) { + return axios.get(readerType[type]) +} + +// 设备台账标签绑定 +export function equipmentLabelBind(data: { sampleId: string; label: string }) { + return request({ + url: '/equipment/label/bind', + method: 'post', + data, + }) +} + +// 设备台账标签的设备列表 +export function getReaderEquipmentList(data: Object) { + return request({ + url: '/equipment/label/readList', + method: 'post', + data, + }) +} + diff --git a/src/components.d.ts b/src/components.d.ts index bb75c7a..6d8ba2e 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -55,6 +55,7 @@ QrDialog: typeof import('./components/QrDialog/index.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] + ScanEquipmentDialog: typeof import('./components/scanEquipmentDialog/index.vue')['default'] ScanSampleDialog: typeof import('./components/ScanSampleDialog/index.vue')['default'] SearchArea: typeof import('./components/SearchArea/index.vue')['default'] SearchBar: typeof import('./components/SearchBar/index.vue')['default'] diff --git a/src/components/scanEquipmentDialog/index.vue b/src/components/scanEquipmentDialog/index.vue new file mode 100644 index 0000000..30e2c2c --- /dev/null +++ b/src/components/scanEquipmentDialog/index.vue @@ -0,0 +1,221 @@ + + + + + + + + 请使用扫码枪或读写器扫描标签 + + + + + + 扫描到 {{ list.length }} 个设备 + + + 扫描到 {{ list.length }} 个标签{{ list.length > 1 ? ',请选择需要绑定的标签' : '' }} + + + + + + + + + + + + + + + + + + + + + + + + + 重新扫描 + + + 取 消 + + + 确 定 + + + 关 闭 + + + + + + + diff --git a/src/components/scanEquipmentDialog/scan-interface.ts b/src/components/scanEquipmentDialog/scan-interface.ts new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/components/scanEquipmentDialog/scan-interface.ts diff --git a/src/views/tested/device/info/components/edit.vue b/src/views/tested/device/info/components/edit.vue index 81adc08..918ca1c 100644 --- a/src/views/tested/device/info/components/edit.vue +++ b/src/views/tested/device/info/components/edit.vue @@ -19,6 +19,8 @@ import useUserStore from '@/store/modules/user' import { getUserDept, getUserList } from '@/api/system/user' import { getDeviceNameList, getModelAllList, getModelList } from '@/api/eqpt/device/model' +import { equipmentLabelBind } from '@/api/reader' +import scanEquipmentDialog from '@/components/scanEquipmentDialog/index.vue' const $route = useRoute() const $router = useRouter() const userStore = useUserStore() @@ -558,6 +560,27 @@ const print = () => { } + +// --------------------------------------------标签绑定-------------------------------------------- +const scanEquipmentRef = ref() +// 点击扫描收添加 +const scan = () => { + // 参数:是标签绑定 + scanEquipmentRef.value.initDialog(true, 'detail') +} +// 扫描结束 +const scanOver = (value: any) => { + console.log('***************************') + const label = value.label + console.log(label) + scanEquipmentRef.value.closeDialog() + equipmentLabelBind({ label, sampleId: ruleForm.value.equipmentId }).then((res) => { + ElMessage.success('标签绑定成功') + scanEquipmentRef.value.closeDialog() + initDialog() + }) +} +// ----------------------------------------------------------------------------------------------- defineExpose({ ruleForm, apply, editForm, submitForm, saveForm, delForm, print, cancelForm }) @@ -830,11 +853,14 @@ - + + - - - 扫描 + + + + 扫描 + @@ -918,6 +944,9 @@ + + + + diff --git a/src/components/scanEquipmentDialog/scan-interface.ts b/src/components/scanEquipmentDialog/scan-interface.ts new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/components/scanEquipmentDialog/scan-interface.ts diff --git a/src/views/tested/device/info/components/edit.vue b/src/views/tested/device/info/components/edit.vue index 81adc08..918ca1c 100644 --- a/src/views/tested/device/info/components/edit.vue +++ b/src/views/tested/device/info/components/edit.vue @@ -19,6 +19,8 @@ import useUserStore from '@/store/modules/user' import { getUserDept, getUserList } from '@/api/system/user' import { getDeviceNameList, getModelAllList, getModelList } from '@/api/eqpt/device/model' +import { equipmentLabelBind } from '@/api/reader' +import scanEquipmentDialog from '@/components/scanEquipmentDialog/index.vue' const $route = useRoute() const $router = useRouter() const userStore = useUserStore() @@ -558,6 +560,27 @@ const print = () => { } + +// --------------------------------------------标签绑定-------------------------------------------- +const scanEquipmentRef = ref() +// 点击扫描收添加 +const scan = () => { + // 参数:是标签绑定 + scanEquipmentRef.value.initDialog(true, 'detail') +} +// 扫描结束 +const scanOver = (value: any) => { + console.log('***************************') + const label = value.label + console.log(label) + scanEquipmentRef.value.closeDialog() + equipmentLabelBind({ label, sampleId: ruleForm.value.equipmentId }).then((res) => { + ElMessage.success('标签绑定成功') + scanEquipmentRef.value.closeDialog() + initDialog() + }) +} +// ----------------------------------------------------------------------------------------------- defineExpose({ ruleForm, apply, editForm, submitForm, saveForm, delForm, print, cancelForm }) @@ -830,11 +853,14 @@ - + + - - - 扫描 + + + + 扫描 + @@ -918,6 +944,9 @@ + + +