提交merge1.3

This commit is contained in:
2025-12-27 15:30:25 +08:00
parent 8c607c8749
commit 088861f66e
1245 changed files with 220442 additions and 77616 deletions

View File

@@ -501,4 +501,36 @@ export function getGroupMarkers(tableData) {
}
});
return tableData;
<<<<<<< HEAD
=======
}
/**
* 格式化库存数量显示(大单位情况) 示例 1盒5片
* @param quantity 小单位库存数量
* @param partPercent 拆零比
* @param unitCode 大单位label
* @param minUnitCode 小单位label
*/
export function formatInventory(quantity, partPercent, unitCode, minUnitCode) {
// 处理负数情况
const isNegative = quantity < 0;
const absQuantity = Math.abs(quantity);
if (absQuantity % partPercent !== 0) {
const integerPart = Math.floor(absQuantity / partPercent);
const decimalPart = absQuantity % partPercent;
let result = integerPart.toString() + ' ' + unitCode;
if (decimalPart > 0) {
result += decimalPart.toString() + ' ' + minUnitCode;
}
return isNegative ? '-' + result : result;
}
// 整除情况
const result = absQuantity / partPercent;
return isNegative ? '-' + result : result + ' ' + unitCode;
>>>>>>> v1.3
}