| | |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="6"> |
| | | <el-form-item label="设备编号" prop="devId"> |
| | | <el-input v-model="formData.devId" placeholder="请输入设备编号" @input="getDevInfo" /> |
| | | <el-input v-model="formData.devId" :placeholder="requireDevId ? '请输入设备编号' : '可留空'" @input="getDevInfo" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' |
| | | import { tranlateDevState } from "../../../../utils/statusFormatter"; |
| | | import { copyText } from '@/utils/copyText' |
| | | import { getConfigKey } from '@/api/infra/config' |
| | | import { getCheckTypeName, needDevReady } from "../../../../utils/checkTypeFormatter"; |
| | | import { useRoomStore } from '@/store/modules/room' |
| | | // 需求1:患者信息 18 项统一展示块 |
| | |
| | | patId: [{ required: true, message: '患者不能为空', trigger: 'blur' }], |
| | | patName: [{ required: true, message: '患者名不能为空', trigger: 'blur' }] |
| | | }) |
| | | |
| | | /** |
| | | * 【系统参数】动态血压和心电设备领用安装登记设备编号 |
| | | * 值“是”(默认)→ 设备编号必填; |
| | | * 值“否” → 允许不填(校验规则同步放开)。 |
| | | */ |
| | | const requireDevId = ref(true) |
| | | const loadDevIdRequired = async () => { |
| | | try { |
| | | const value = await getConfigKey('ecg.dev.rent.device.no.required') |
| | | const text = String(value ?? '').trim() |
| | | requireDevId.value = !( |
| | | text === '否' || text === '0' || |
| | | text.toLowerCase() === 'false' || text.toLowerCase() === 'no' |
| | | ) |
| | | } catch (e) { |
| | | console.warn('[DevInstallPanel] 读取“设备编号必填”系统参数失败,按必填处理', e) |
| | | requireDevId.value = true |
| | | } |
| | | formRules.devId = requireDevId.value |
| | | ? [{ required: true, message: '设备编号不能为空', trigger: 'blur' }] |
| | | : [] |
| | | } |
| | | |
| | | |
| | | const checkTypeStore = useCheckTypeStore() |
| | |
| | | } |
| | | |
| | | const getDevInfo = async () => { |
| | | if (formData.value?.devId == null) { |
| | | // 设备编号允许留空(系统参数=否)时,空值不再去查设备,避免无意义请求/报错 |
| | | if (!formData.value?.devId) { |
| | | devInfo.value.brand = undefined |
| | | devInfo.value.model = undefined |
| | | devInfo.value.state = undefined |
| | |
| | | onMounted(() => { |
| | | resetForm() |
| | | getList() |
| | | loadDevIdRequired() |
| | | }) |
| | | |
| | | </script> |