修正格式化错误
This commit is contained in:
@@ -157,9 +157,7 @@
|
||||
() => {
|
||||
if (row.methodCode) {
|
||||
handleEnter('methodCode');
|
||||
}
|
||||
}
|
||||
"
|
||||
"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in config.methodCode"
|
||||
@@ -186,9 +184,7 @@
|
||||
() => {
|
||||
if (row.rateCode) {
|
||||
handleEnter('rateCode');
|
||||
}
|
||||
}
|
||||
"
|
||||
"
|
||||
:ref="(el) => setInputRef('rateCode', el)"
|
||||
>
|
||||
<el-option
|
||||
@@ -262,10 +258,8 @@
|
||||
row.unitPrice = row.minUnitPrice;
|
||||
} else {
|
||||
row.unitPrice = row.unitTempPrice;
|
||||
}
|
||||
row.unitCode_dictText = item.label;
|
||||
}
|
||||
"
|
||||
row.unitCode_dictText = item.label;
|
||||
"
|
||||
/>
|
||||
</template>
|
||||
</el-select>
|
||||
@@ -404,8 +398,7 @@
|
||||
row.unitPrice = row.minUnitPrice;
|
||||
} else {
|
||||
row.unitPrice = row.unitTempPrice;
|
||||
}
|
||||
row.unitCode_dictText = item.label;
|
||||
row.unitCode_dictText = item.label;
|
||||
}" />
|
||||
</template>
|
||||
</el-select>
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user