提交
This commit is contained in:
1 parent
e56d227fe8
commit
4611dbc2b2
237 files changed
+1384060
-24942
No files matched your search
@@ -1,4 +1,6 @@
|
||||
import { computed, ref, watch, type Ref } from 'vue'
|
||||
import { useDictStore } from '@/store/modules/dict'
|
||||
import { getProductUnitLabel } from '@/utils/crm-product-display'
|
||||
|
||||
export interface FreightCalcProductRow {
|
||||
quantity?: number | null
|
||||
@@ -24,8 +26,8 @@ export function sumProductQuantities(products: FreightCalcProductRow[]) {
|
||||
export function resolveFreightUnitLabel(products: FreightCalcProductRow[]) {
|
||||
const units = products.map(row => row.unit).filter(Boolean) as string[]
|
||||
if (!units.length) return '吨'
|
||||
const first = units[0]
|
||||
return first
|
||||
const dictStore = useDictStore()
|
||||
return getProductUnitLabel(dictStore.getLabel.bind(dictStore), units[0])
|
||||
}
|
||||
|
||||
export function usePlFreightCalc(options: {
|
||||
|
||||
Reference in new issue
Block a user