diff --git a/src/api/reader.ts b/src/api/reader.ts index d21d618..efe1fa4 100644 --- a/src/api/reader.ts +++ b/src/api/reader.ts @@ -2,17 +2,27 @@ import axios from 'axios' import request from './index' const readerType: { [key: string]: string } = { - readerWriter: '/proxy/business/readWriter/tId/readList', // 读写器 + readerWriter: '/proxy/business/readWriter/gunAndTId/readList', // 有线扫码枪和大读写器 + // readerWriter: '/proxy/business/readWriter/tId/readList', // 读写器 } // 获取大读写器读写内容 export function getReadList(type: string) { return axios.get(readerType[type]) } -// 获取读写器识别的样品列表 +// 获取读写器识别的样品列表(除了新增委托书详情中的扫描按钮之外的业务中的扫描使用) export function getReaderSampleList(data: Object) { return request({ - url: '/business/readWriter/sample/readList', + url: '/business/readWriter/sample/label/readList', + method: 'post', + data, + }) +} + +// 标签绑定(设备收发) +export function tagBinding(data: Object) { + return request({ + url: '/device/dispatch/label/bind', method: 'post', data, }) diff --git a/src/api/reader.ts b/src/api/reader.ts index d21d618..efe1fa4 100644 --- a/src/api/reader.ts +++ b/src/api/reader.ts @@ -2,17 +2,27 @@ import axios from 'axios' import request from './index' const readerType: { [key: string]: string } = { - readerWriter: '/proxy/business/readWriter/tId/readList', // 读写器 + readerWriter: '/proxy/business/readWriter/gunAndTId/readList', // 有线扫码枪和大读写器 + // readerWriter: '/proxy/business/readWriter/tId/readList', // 读写器 } // 获取大读写器读写内容 export function getReadList(type: string) { return axios.get(readerType[type]) } -// 获取读写器识别的样品列表 +// 获取读写器识别的样品列表(除了新增委托书详情中的扫描按钮之外的业务中的扫描使用) export function getReaderSampleList(data: Object) { return request({ - url: '/business/readWriter/sample/readList', + url: '/business/readWriter/sample/label/readList', + method: 'post', + data, + }) +} + +// 标签绑定(设备收发) +export function tagBinding(data: Object) { + return request({ + url: '/device/dispatch/label/bind', method: 'post', data, }) diff --git a/src/api/workbench/workbench.ts b/src/api/workbench/workbench.ts index 2593bac..86a84d7 100644 --- a/src/api/workbench/workbench.ts +++ b/src/api/workbench/workbench.ts @@ -11,7 +11,7 @@ } // 审批提醒状态变更 -export function changeWorkbenchApproveStatus(data: { id: string; status: number }) { +export function changeWorkbenchApproveStatus(data: { id: string; status: number; businessId?: string; decisionItem?: number; formId?: string; processId?: string; taskId?: string }) { return request({ url: '/workbench/approvalMessage/updateStatus', method: 'post', @@ -28,6 +28,15 @@ }) } +// 工作提醒状态变更 +export function changeWorkbenchWorkListStatus(data: { id: string; status: number }) { + return request({ + url: '/workbench/remindMessage/updateStatus', + method: 'post', + data, + }) +} + // 通知公告已读状态修改 export function changeWorkbenchNoticeStatus(data: { ids: any; userId: string }) { return request({ diff --git a/src/api/reader.ts b/src/api/reader.ts index d21d618..efe1fa4 100644 --- a/src/api/reader.ts +++ b/src/api/reader.ts @@ -2,17 +2,27 @@ import axios from 'axios' import request from './index' const readerType: { [key: string]: string } = { - readerWriter: '/proxy/business/readWriter/tId/readList', // 读写器 + readerWriter: '/proxy/business/readWriter/gunAndTId/readList', // 有线扫码枪和大读写器 + // readerWriter: '/proxy/business/readWriter/tId/readList', // 读写器 } // 获取大读写器读写内容 export function getReadList(type: string) { return axios.get(readerType[type]) } -// 获取读写器识别的样品列表 +// 获取读写器识别的样品列表(除了新增委托书详情中的扫描按钮之外的业务中的扫描使用) export function getReaderSampleList(data: Object) { return request({ - url: '/business/readWriter/sample/readList', + url: '/business/readWriter/sample/label/readList', + method: 'post', + data, + }) +} + +// 标签绑定(设备收发) +export function tagBinding(data: Object) { + return request({ + url: '/device/dispatch/label/bind', method: 'post', data, }) diff --git a/src/api/workbench/workbench.ts b/src/api/workbench/workbench.ts index 2593bac..86a84d7 100644 --- a/src/api/workbench/workbench.ts +++ b/src/api/workbench/workbench.ts @@ -11,7 +11,7 @@ } // 审批提醒状态变更 -export function changeWorkbenchApproveStatus(data: { id: string; status: number }) { +export function changeWorkbenchApproveStatus(data: { id: string; status: number; businessId?: string; decisionItem?: number; formId?: string; processId?: string; taskId?: string }) { return request({ url: '/workbench/approvalMessage/updateStatus', method: 'post', @@ -28,6 +28,15 @@ }) } +// 工作提醒状态变更 +export function changeWorkbenchWorkListStatus(data: { id: string; status: number }) { + return request({ + url: '/workbench/remindMessage/updateStatus', + method: 'post', + data, + }) +} + // 通知公告已读状态修改 export function changeWorkbenchNoticeStatus(data: { ids: any; userId: string }) { return request({ diff --git a/src/components.d.ts b/src/components.d.ts index 90f2dde..be8238f 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -62,6 +62,7 @@ SvgIcon: typeof import('./components/SvgIcon/index.vue')['default'] SystemInfo: typeof import('./components/SystemInfo/index.vue')['default'] TableContainer: typeof import('./components/TableContainer/index.vue')['default'] + TagBingding: typeof import('./components/tagBingding/index.vue')['default'] Trend: typeof import('./components/Trend/index.vue')['default'] } } diff --git a/src/api/reader.ts b/src/api/reader.ts index d21d618..efe1fa4 100644 --- a/src/api/reader.ts +++ b/src/api/reader.ts @@ -2,17 +2,27 @@ import axios from 'axios' import request from './index' const readerType: { [key: string]: string } = { - readerWriter: '/proxy/business/readWriter/tId/readList', // 读写器 + readerWriter: '/proxy/business/readWriter/gunAndTId/readList', // 有线扫码枪和大读写器 + // readerWriter: '/proxy/business/readWriter/tId/readList', // 读写器 } // 获取大读写器读写内容 export function getReadList(type: string) { return axios.get(readerType[type]) } -// 获取读写器识别的样品列表 +// 获取读写器识别的样品列表(除了新增委托书详情中的扫描按钮之外的业务中的扫描使用) export function getReaderSampleList(data: Object) { return request({ - url: '/business/readWriter/sample/readList', + url: '/business/readWriter/sample/label/readList', + method: 'post', + data, + }) +} + +// 标签绑定(设备收发) +export function tagBinding(data: Object) { + return request({ + url: '/device/dispatch/label/bind', method: 'post', data, }) diff --git a/src/api/workbench/workbench.ts b/src/api/workbench/workbench.ts index 2593bac..86a84d7 100644 --- a/src/api/workbench/workbench.ts +++ b/src/api/workbench/workbench.ts @@ -11,7 +11,7 @@ } // 审批提醒状态变更 -export function changeWorkbenchApproveStatus(data: { id: string; status: number }) { +export function changeWorkbenchApproveStatus(data: { id: string; status: number; businessId?: string; decisionItem?: number; formId?: string; processId?: string; taskId?: string }) { return request({ url: '/workbench/approvalMessage/updateStatus', method: 'post', @@ -28,6 +28,15 @@ }) } +// 工作提醒状态变更 +export function changeWorkbenchWorkListStatus(data: { id: string; status: number }) { + return request({ + url: '/workbench/remindMessage/updateStatus', + method: 'post', + data, + }) +} + // 通知公告已读状态修改 export function changeWorkbenchNoticeStatus(data: { ids: any; userId: string }) { return request({ diff --git a/src/components.d.ts b/src/components.d.ts index 90f2dde..be8238f 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -62,6 +62,7 @@ SvgIcon: typeof import('./components/SvgIcon/index.vue')['default'] SystemInfo: typeof import('./components/SystemInfo/index.vue')['default'] TableContainer: typeof import('./components/TableContainer/index.vue')['default'] + TagBingding: typeof import('./components/tagBingding/index.vue')['default'] Trend: typeof import('./components/Trend/index.vue')['default'] } } diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index 9abe8b4..086cc14 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -69,8 +69,19 @@ submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') // 改变总工作台审批提醒的已处理状态 - if (sessionStorage.getItem('workbenchApproveId')) { - changeWorkbenchApproveStatus({ id: sessionStorage.getItem('workbenchApproveId')!, status: 1 }) + if (sessionStorage.getItem('workbenchApproveParams')) { + const row = JSON.parse(sessionStorage.getItem('workbenchApproveParams')!) + console.log('-------', row) + + changeWorkbenchApproveStatus({ + id: row.id, + status: 1, + businessId: row.businessId, + decisionItem: Number(row.decisionItem), + formId: row.formId, + processId: row.processId, + taskId: row.taskId, + }) } btnLoading.value = false dialogVisible.value = false diff --git a/src/api/reader.ts b/src/api/reader.ts index d21d618..efe1fa4 100644 --- a/src/api/reader.ts +++ b/src/api/reader.ts @@ -2,17 +2,27 @@ import axios from 'axios' import request from './index' const readerType: { [key: string]: string } = { - readerWriter: '/proxy/business/readWriter/tId/readList', // 读写器 + readerWriter: '/proxy/business/readWriter/gunAndTId/readList', // 有线扫码枪和大读写器 + // readerWriter: '/proxy/business/readWriter/tId/readList', // 读写器 } // 获取大读写器读写内容 export function getReadList(type: string) { return axios.get(readerType[type]) } -// 获取读写器识别的样品列表 +// 获取读写器识别的样品列表(除了新增委托书详情中的扫描按钮之外的业务中的扫描使用) export function getReaderSampleList(data: Object) { return request({ - url: '/business/readWriter/sample/readList', + url: '/business/readWriter/sample/label/readList', + method: 'post', + data, + }) +} + +// 标签绑定(设备收发) +export function tagBinding(data: Object) { + return request({ + url: '/device/dispatch/label/bind', method: 'post', data, }) diff --git a/src/api/workbench/workbench.ts b/src/api/workbench/workbench.ts index 2593bac..86a84d7 100644 --- a/src/api/workbench/workbench.ts +++ b/src/api/workbench/workbench.ts @@ -11,7 +11,7 @@ } // 审批提醒状态变更 -export function changeWorkbenchApproveStatus(data: { id: string; status: number }) { +export function changeWorkbenchApproveStatus(data: { id: string; status: number; businessId?: string; decisionItem?: number; formId?: string; processId?: string; taskId?: string }) { return request({ url: '/workbench/approvalMessage/updateStatus', method: 'post', @@ -28,6 +28,15 @@ }) } +// 工作提醒状态变更 +export function changeWorkbenchWorkListStatus(data: { id: string; status: number }) { + return request({ + url: '/workbench/remindMessage/updateStatus', + method: 'post', + data, + }) +} + // 通知公告已读状态修改 export function changeWorkbenchNoticeStatus(data: { ids: any; userId: string }) { return request({ diff --git a/src/components.d.ts b/src/components.d.ts index 90f2dde..be8238f 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -62,6 +62,7 @@ SvgIcon: typeof import('./components/SvgIcon/index.vue')['default'] SystemInfo: typeof import('./components/SystemInfo/index.vue')['default'] TableContainer: typeof import('./components/TableContainer/index.vue')['default'] + TagBingding: typeof import('./components/tagBingding/index.vue')['default'] Trend: typeof import('./components/Trend/index.vue')['default'] } } diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue index 9abe8b4..086cc14 100644 --- a/src/components/Approval/ApprovalDialog.vue +++ b/src/components/Approval/ApprovalDialog.vue @@ -69,8 +69,19 @@ submitApproval(formData.type, { taskId: formData.taskId, comments: formData.comments }).then((res) => { ElMessage.success('审批完成') // 改变总工作台审批提醒的已处理状态 - if (sessionStorage.getItem('workbenchApproveId')) { - changeWorkbenchApproveStatus({ id: sessionStorage.getItem('workbenchApproveId')!, status: 1 }) + if (sessionStorage.getItem('workbenchApproveParams')) { + const row = JSON.parse(sessionStorage.getItem('workbenchApproveParams')!) + console.log('-------', row) + + changeWorkbenchApproveStatus({ + id: row.id, + status: 1, + businessId: row.businessId, + decisionItem: Number(row.decisionItem), + formId: row.formId, + processId: row.processId, + taskId: row.taskId, + }) } btnLoading.value = false dialogVisible.value = false diff --git a/src/components/ScanSampleDialog/index.vue b/src/components/ScanSampleDialog/index.vue index 23c89ad..48462e6 100644 --- a/src/components/ScanSampleDialog/index.vue +++ b/src/components/ScanSampleDialog/index.vue @@ -17,6 +17,8 @@ const emits = defineEmits(['confirm']) const dialogVisible = ref(false) // 弹窗显示 const scanStatus = ref('0') +const isBinding = ref(false) // 是否是标签绑定 +const singleChecked = ref('') // 单选选中id // 扫描到的标签列表 const list = ref([]) @@ -27,14 +29,24 @@ // 点击确定,保存选择的成员配置 const confirm = () => { + if (isBinding.value && !singleChecked.value) { // 标签绑定 + ElMessage.warning('请选中') + return false + } + const message = isBinding.value ? '确认绑定吗?' : `确认${props.title}列表中的样品吗?` if (list.value.length) { - ElMessageBox.confirm( - `确认${props.title}列表中全部样品吗?`, - '提示', - { confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning' }, - ).then(() => { + if (isBinding.value) { + ElMessageBox.confirm( + message, + '提示', + { confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning' }, + ).then(() => { + emits('confirm', singleChecked.value) + }) + } + else { emits('confirm', list.value) - }) + } } else { ElMessage.warning('暂无样品数据, 请重新扫描或取消') @@ -47,12 +59,18 @@ getReadList('readerWriter').then((res) => { const response = res.data if (response.code === 200 && response.data.length) { - getReaderSampleList(response.data).then((res) => { - list.value = res.data - }) - } - else { - ElMessage.warning(res.data.message) + if (isBinding.value) { + list.value = response.data.map((item: string) => { + return { + labelBind: item, + } + }) + } + else { + getReaderSampleList(response.data).then((res) => { + list.value = res.data + }) + } } scanStatus.value = '2' // 扫描完成 }).catch(() => { @@ -67,11 +85,13 @@ const deleteRow = (index: number) => { list.value.splice(index, 1) } + /** * 打开弹窗 * @param sampleid 样品id, 需要在弹窗内完成绑定操作的传, 不需要传空字符串 */ -const initDialog = () => { +const initDialog = (isBindingValue = false) => { + isBinding.value = isBindingValue // 是否是标签绑定 scanStatus.value = '1' setTimeout(() => { scan() @@ -83,7 +103,7 @@