From 1bcffc85aedb328b69b5b036d890c8262524c306 Mon Sep 17 00:00:00 2001 From: chenqi Date: Wed, 3 Jun 2026 11:20:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=A0=BC=E5=BC=8F=E5=8C=96?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../home/components/order/OrderForm.vue | 65 ++++++------------- 1 file changed, 19 insertions(+), 46 deletions(-) diff --git a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/OrderForm.vue b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/OrderForm.vue index d7da1abd6..eecf94dad 100755 --- a/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/OrderForm.vue +++ b/openhis-ui-vue3/src/views/inpatientDoctor/home/components/order/OrderForm.vue @@ -157,9 +157,7 @@ () => { if (row.methodCode) { handleEnter('methodCode'); - } - } - " + " > { if (row.rateCode) { handleEnter('rateCode'); - } - } - " + " :ref="(el) => setInputRef('rateCode', el)" > @@ -404,8 +398,7 @@ row.unitPrice = row.minUnitPrice; } else { row.unitPrice = row.unitTempPrice; - } - row.unitCode_dictText = item.label; + row.unitCode_dictText = item.label; }" /> @@ -629,7 +622,6 @@ const formRef = ref(); const registerFormRef = () => { if (formRef.value && proxy?.$parent?.$refs) { proxy.$parent.$refs[props.formRefName] = formRef.value; - } }; // 监听 formRef 变化,确保注册 @@ -640,18 +632,19 @@ watch( nextTick(() => { registerFormRef(); }); - } - }, + }, { immediate: true } ); }); - } - return false; - if (err?.message?.includes('label') || err?.message?.includes('width') || err?.message?.includes('NaN')) { +// Suppress el-form teardown errors during vxe-table expand collapse onErrorCaptured((err) => { -// Suppress el-form-label-wrap teardown errors during vxe-table expand collapse + if (err?.message?.includes('label') || err?.message?.includes('width') || err?.message?.includes('NaN')) { + return false; + } +}); + onMounted(() => { nextTick(() => { registerFormRef(); @@ -659,7 +652,6 @@ onMounted(() => { // Bug #615: 临时医嘱频次默认改为 ONCE(临时一次),不再强制设为 ST if (props.row.therapyEnum == '2' && !props.row.rateCode && props.row.adviceType != 7) { setDefaultRateCode(); - } }); watch( @@ -671,9 +663,7 @@ watch( } else if (newVal == '1') { props.row.rateCode = ''; props.row.rateCode_dictText = ''; - } - } -); + ); const setDefaultRateCode = () => { if (Array.isArray(props.config.rateCode)) { @@ -690,10 +680,7 @@ const setDefaultRateCode = () => { } else { props.row.rateCode = 'ST'; props.row.rateCode_dictText = 'ST 立即'; - } - } - } -}; + }; // 格式化库存显示 const stockFormat = (partPercent: number, unitList: any[], quantity: number): string => { @@ -704,19 +691,15 @@ const stockFormat = (partPercent: number, unitList: any[], quantity: number): st const b = Math.floor(quantity / partPercent); if (a == 0) { return b + ' ' + unitCode; - } return b + ' ' + unitCode + ' ' + a + ' ' + minUnitCode; }; // 检查单位 const checkUnit = (item: any): boolean => { if (item.type == 'dose') { - return false; } else if (props.row.partAttributeEnum == '2' && item.type == 'minUnit') { - return false; } else { return true; - } }; const handleEnter = (prop: string) => props.handlers.handleEnter(prop, props.row, props.index); @@ -725,16 +708,13 @@ const handleSave = () => { if (!formRef.value) { console.error('Form ref not found'); return; - } - formRef.value.validate((valid: boolean) => { + formRef.value.validate((valid: boolean) => { if (valid) { emit('save', props.row, props.index); } else { if (proxy?.$modal?.msgWarning) { proxy.$modal.msgWarning('请完善必填信息'); - } - } - }); + }); }); }; @@ -773,14 +753,10 @@ function findOrgName(orgId: any): string { if (typeof node.id === 'string' && node.id.length >= 16 && strId.length >= 16 && node.id.substring(0, 15) === strId.substring(0, 15)) { return node.name; - } - if (node.children) { + if (node.children) { const found = walk(node.children); if (found) return found; - } - } - return ''; - } + return ''; return walk(props.config.organization); } @@ -803,8 +779,7 @@ const calculateTotalAmount = () => { if (row.adviceType == 7 && row.doseQuantity && row.dispensePerDuration) { const freq = row.rateCode ? 1 : 1; // 频次由医生手动选,总量仅依据单次用量×天数估算 row.quantity = new Decimal(row.doseQuantity || 0).mul(row.dispensePerDuration || 0).toNumber(); - } - const qty = new Decimal(row.quantity || row.doseQuantity || 0); + const qty = new Decimal(row.quantity || row.doseQuantity || 0); // 根据首次用量单位类型决定使用哪个单价 const unitType = row.unitCodeList?.find((k) => k.value == row.doseUnitCode)?.type; const price = unitType == 'unit' ? row.unitPrice : row.minUnitPrice; @@ -863,10 +838,8 @@ defineExpose({ .expend_div { :deep(.el-form-item--default) { margin-bottom: 0px; - } :deep(.el-input-number .el-input__inner) { text-align: center; - } }