|
|
@ -61,16 +61,13 @@ |
|
|
|
<div class="project-title"> |
|
|
|
<span>样本类型</span> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="type-list"> |
|
|
|
<div |
|
|
|
v-for="item in settingTubeStore.bloodTypes" |
|
|
|
:key="item.key" |
|
|
|
@click="selectBloodType(item)" |
|
|
|
class="blood-button" |
|
|
|
:class="{ active: emergencyPosition.bloodType === item.key }" |
|
|
|
> |
|
|
|
{{ item.name }} |
|
|
|
</div> |
|
|
|
<el-radio-group v-model="emergencyPosition.bloodType" size="large" > |
|
|
|
<el-radio-button :disabled="!sampleListSomeProjId || !sampleListSomeProjId.includes(type.key)" v-for="type in settingTubeStore.bloodTypes" :key="type.key" :value="type.key"> |
|
|
|
{{ type.name }} |
|
|
|
</el-radio-button> |
|
|
|
</el-radio-group> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<hr style="height: 1px; border: none" /> |
|
|
@ -108,7 +105,7 @@ import { |
|
|
|
} from '@/store' |
|
|
|
import type { AddEmergencyInfo } from '@/types/Index' |
|
|
|
import type { BloodType, ReactionPlateGroup } from '@/websocket/socket' |
|
|
|
import { eMessage } from '../utils' |
|
|
|
import { eMessage, findCommonElements } from '../utils' |
|
|
|
|
|
|
|
defineOptions({ |
|
|
|
name: 'EmergencyForm', |
|
|
@ -119,6 +116,8 @@ const keyboardType = ref<'text' | 'number'>('text') |
|
|
|
const softKeyboardRef = ref() |
|
|
|
const currentFocusType = ref('') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const openKeyboard = (type: 'sampleBarcode' | 'userid') => { |
|
|
|
inputValue.value = type === 'sampleBarcode' ? emergencyPosition.value.sampleBarcode : emergencyPosition.value.userid |
|
|
|
keyboardVisible.value = true |
|
|
@ -147,6 +146,8 @@ const emergencyStore = useEmergencyStore() |
|
|
|
const deviceStore = useDeviceStore() |
|
|
|
const settingTubeStore = useSettingTestTubeStore() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const isProjectActivated = (item: ReactionPlateGroup) => { |
|
|
|
return emergencyPosition.value.projIds.includes(item.projId!) |
|
|
|
} |
|
|
@ -202,6 +203,8 @@ const confirmHandle = async () => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const sampleListSomeProjId = ref([]) |
|
|
|
|
|
|
|
const selectProject = (item: ReactionPlateGroup) => { |
|
|
|
const projectIndex = emergencyPosition.value.projIds.findIndex( |
|
|
|
(proj) => proj === item.projId, |
|
|
@ -211,14 +214,31 @@ const selectProject = (item: ReactionPlateGroup) => { |
|
|
|
} else { |
|
|
|
emergencyPosition.value.projIds.push(item.projId!) |
|
|
|
} |
|
|
|
let sampleList:string[][] = []; // 保存选择项目的样本类型 |
|
|
|
emergencyPosition.value.projIds.forEach(projId => { |
|
|
|
const supportBloodTypes = settingTubeStore.supportedProjects?.find( |
|
|
|
(p) => p.projId === projId, |
|
|
|
)?.supportBloodTypes |
|
|
|
sampleList.push(supportBloodTypes) |
|
|
|
|
|
|
|
}) |
|
|
|
sampleListSomeProjId.value = findCommonElements(sampleList) |
|
|
|
console.log(sampleListSomeProjId.value) |
|
|
|
emergencyPosition.value.bloodType = undefined |
|
|
|
} |
|
|
|
|
|
|
|
const selectBloodType = (item: { key: BloodType }) => { |
|
|
|
emergencyPosition.value.bloodType = item.key |
|
|
|
} |
|
|
|
|
|
|
|
watch(() =>consumableStore.projectsAvailable, () => { |
|
|
|
console.log(consumableStore.projectsAvailable) |
|
|
|
} ) |
|
|
|
|
|
|
|
// 处理回显数据 |
|
|
|
onMounted(() => { |
|
|
|
|
|
|
|
console.log(settingTubeStore.bloodTypes) |
|
|
|
if (!emergencyStore.emergencyInfo) { |
|
|
|
return |
|
|
|
} |
|
|
@ -253,6 +273,9 @@ onUnmounted(() => { |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="less" scoped> |
|
|
|
::v-deep(.el-radio-button__inner){ |
|
|
|
font-size: 1.5rem; |
|
|
|
} |
|
|
|
input { |
|
|
|
margin-bottom: 20px; |
|
|
|
padding: 8px 5px; |
|
|
|