feat: add stock_formatted field to CuttingPosCombinationDialog for improved stock display; update variant initialization and toggle logic to include formatted stock information
This commit is contained in:
parent
3a8a6982ec
commit
dbfd7ce48e
@ -28,6 +28,7 @@ type SelectedMaterial = {
|
||||
unit: string;
|
||||
unit_abbreviation: string;
|
||||
stock_input: string;
|
||||
stock_formatted?: string;
|
||||
material_usage: string;
|
||||
images?: CuttingCatalogPrice['images'];
|
||||
is_initial?: boolean;
|
||||
@ -89,6 +90,7 @@ function toggleVariant(rawMaterial: CuttingRawMaterialCatalogItem, price: Cuttin
|
||||
unit: rawMaterial.unit,
|
||||
unit_abbreviation: rawMaterial.unit_abbreviation,
|
||||
stock_input: price.stock_input,
|
||||
stock_formatted: price.stock_formatted,
|
||||
material_usage: '1',
|
||||
images: price.images,
|
||||
});
|
||||
@ -117,6 +119,7 @@ function initFromVariant() {
|
||||
unit: rawMaterial.unit,
|
||||
unit_abbreviation: rawMaterial.unit_abbreviation,
|
||||
stock_input: price.stock_input,
|
||||
stock_formatted: price.stock_formatted,
|
||||
material_usage: '1',
|
||||
images: price.images,
|
||||
is_initial: true,
|
||||
@ -187,8 +190,8 @@ watch(open, (value) => {
|
||||
<p class="truncate text-sm font-medium">
|
||||
{{ item.raw_material_name }} - {{ item.variant }}
|
||||
</p>
|
||||
<Badge v-if="item.is_initial" variant="secondary" class="text-xs mt-0.5">
|
||||
Bahan awal
|
||||
<Badge variant="outline" class="text-xs mt-0.5 select-none font-normal">
|
||||
Stok: {{ item.stock_formatted }}
|
||||
</Badge>
|
||||
</div>
|
||||
<div class="flex items-center gap-1" @click.stop>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user