diff --git a/src/api/blood/index.ts b/src/api/blood/index.ts index 33d4131..dbdae45 100644 --- a/src/api/blood/index.ts +++ b/src/api/blood/index.ts @@ -298,6 +298,24 @@ export function printReport(query?: Object) { params: query }) } +// 临床发血获取血液信息 +export function queryBloodInfo(query?: Object) { + return request({ + url: '/bus/bloodbank/backin/queryBloodInfo', + method: 'get', + params: query + }) +} +// 临床发血退血保存数据 +export function txsaveData(query?: Object) { + return request({ + url: '/bus/bloodbank/backin/saveData', + method: 'post', + data: query + }) +} + + diff --git a/src/utils/classCom.ts b/src/utils/classCom.ts index 813dfeb..0e2e851 100644 --- a/src/utils/classCom.ts +++ b/src/utils/classCom.ts @@ -157,4 +157,18 @@ export function useAutoSize() { }); return autoSize; +} + + +/** + * 字节转 MB,保留n位小数 + * @param size 字节 string|number + * @param digits 保留小数,默认2 + * @returns {string} "0.03 MB" + */ +export function formatByteToMB(size: string | number, digits = 2): string { + const byte = Number(size) + if (isNaN(byte) || byte <= 0) return '0 MB' + const mb = byte / 1024 / 1024 + return `${mb.toFixed(digits)} MB` } \ No newline at end of file diff --git a/src/views/blood/clinical/index.vue b/src/views/blood/clinical/index.vue index 31e08dc..7b16132 100644 --- a/src/views/blood/clinical/index.vue +++ b/src/views/blood/clinical/index.vue @@ -388,7 +388,8 @@ - +