diff --git a/components.d.ts b/components.d.ts index c479123..6d22984 100644 --- a/components.d.ts +++ b/components.d.ts @@ -9,10 +9,12 @@ declare module 'vue' { export interface GlobalComponents { Confirm: typeof import('./src/components/Confirm.vue')['default'] ElButton: typeof import('element-plus/es')['ElButton'] + ElCol: typeof import('element-plus/es')['ElCol'] ElDropdown: typeof import('element-plus/es')['ElDropdown'] ElFooter: typeof import('element-plus/es')['ElFooter'] ElHeader: typeof import('element-plus/es')['ElHeader'] ElIcon: typeof import('element-plus/es')['ElIcon'] + ElRow: typeof import('element-plus/es')['ElRow'] ElTable: typeof import('element-plus/es')['ElTable'] ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] ErrorModal: typeof import('./src/components/dialogs/ErrorModal.vue')['default'] diff --git a/src/pages/Index/History.vue b/src/pages/Index/History.vue index fccd989..ffd7e6a 100644 --- a/src/pages/Index/History.vue +++ b/src/pages/Index/History.vue @@ -405,6 +405,8 @@ const handleConfirmDelete = async () => { } eMessage.success('删除成功') + //刷新 + getTableData() } catch (error) { eMessage.error('删除失败') } finally { diff --git a/src/pages/Index/Regular/TestTube.vue b/src/pages/Index/Regular/TestTube.vue index e40b18c..1f56c25 100644 --- a/src/pages/Index/Regular/TestTube.vue +++ b/src/pages/Index/Regular/TestTube.vue @@ -93,10 +93,12 @@ import { useConsumablesStore, useTestTubeStore, useSettingTestTubeStore, + } from '../../../store' import { ElDialog } from 'element-plus' import { BloodType, ReactionPlateGroup, TestTubeRack } from '@/websocket/socket' import { eMessage } from '../utils' +import { reactionPlateGroupItem } from './type' const router = useRouter() @@ -265,6 +267,37 @@ const updateTubeSettings = async (rackIdx: number, tubeIdx: number) => { eMessage.error('试管架已激活,不能修改') return } + //检查耗材 + if(consumablesStore.consumableData && consumablesStore.consumableData.reactionPlateGroup){ + let reactionPlateGroup = consumablesStore.consumableData.reactionPlateGroup + let list:reactionPlateGroupItem[] = [] + reactionPlateGroup.forEach((item:any) => { + if(item.projId && selectedProjIds.value.includes(item.projId) && item.num <=0){ + list.push(item.projName) + } + }) + if(list.length){ + eMessage.error(`项目${list.join(',')}耗材不足,请添加耗材`) + return; + } + } + + //超出现有数量 + if(consumablesStore.projectsAvailable){ + let list = consumablesStore.projectsAvailable.map((item:any) => { + console.log('projIdCntMap===', projIdCntMap) + let cn = projIdCntMap[item.projId || 1]; + console.log('cn===', cn , item.num) + if(cn > item.num){ + return item; + } + }) + if(list && list.length){ + eMessage.error(`耗材已用尽,请添加耗材`) + return; + } + } + if (tubeIdx < rack.tubeSettings.length) { const setting = rack.tubeSettings[tubeIdx] const updSetting = { diff --git a/src/pages/Index/Regular/type.ts b/src/pages/Index/Regular/type.ts new file mode 100644 index 0000000..73606fb --- /dev/null +++ b/src/pages/Index/Regular/type.ts @@ -0,0 +1,10 @@ +export type reactionPlateGroupItem = { + projId?: number + projName: string + projShortName: string + lotId: string + color?: string + num?: number + isInstall: boolean + reserveNum: number +} \ No newline at end of file diff --git a/src/pages/Index/components/History/HistoryTable.vue b/src/pages/Index/components/History/HistoryTable.vue index db08ebe..957cc7d 100644 --- a/src/pages/Index/components/History/HistoryTable.vue +++ b/src/pages/Index/components/History/HistoryTable.vue @@ -25,7 +25,7 @@