修正格式化错误

This commit is contained in:
2026-06-03 11:20:57 +08:00
parent 5a2050a736
commit 1bcffc85ae

View File

@@ -157,8 +157,6 @@
() => {
if (row.methodCode) {
handleEnter('methodCode');
}
}
"
>
<el-option
@@ -186,8 +184,6 @@
() => {
if (row.rateCode) {
handleEnter('rateCode');
}
}
"
:ref="(el) => setInputRef('rateCode', el)"
>
@@ -262,9 +258,7 @@
row.unitPrice = row.minUnitPrice;
} else {
row.unitPrice = row.unitTempPrice;
}
row.unitCode_dictText = item.label;
}
"
/>
</template>
@@ -404,7 +398,6 @@
row.unitPrice = row.minUnitPrice;
} else {
row.unitPrice = row.unitTempPrice;
}
row.unitCode_dictText = item.label;
}" />
</template>
@@ -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,8 +663,6 @@ watch(
} else if (newVal == '1') {
props.row.rateCode = '';
props.row.rateCode_dictText = '';
}
}
);
const setDefaultRateCode = () => {
@@ -690,9 +680,6 @@ const setDefaultRateCode = () => {
} else {
props.row.rateCode = 'ST';
props.row.rateCode_dictText = 'ST 立即';
}
}
}
};
// 格式化库存显示
@@ -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,15 +708,12 @@ const handleSave = () => {
if (!formRef.value) {
console.error('Form ref not found');
return;
}
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) {
const found = walk(node.children);
if (found) return found;
}
}
return '';
}
return walk(props.config.organization);
}
@@ -803,7 +779,6 @@ 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 unitType = row.unitCodeList?.find((k) => k.value == row.doseUnitCode)?.type;
@@ -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;
}
}
</style>