diff --git a/src/views/inventory/LngInventoryOut/components/createForm.vue b/src/views/inventory/LngInventoryOut/components/createForm.vue index 4673226..ed93093 100644 --- a/src/views/inventory/LngInventoryOut/components/createForm.vue +++ b/src/views/inventory/LngInventoryOut/components/createForm.vue @@ -278,32 +278,32 @@ if (formState.uomCode == 'GJ') { if (!formState.qtyTon) { - formState.qtyTon = (Number(formState.rateTonGj) ? Number(formState.qtyGj || 0)/Number(formState.rateTonGj) : 0).toFixed(3) + formState.qtyTon = Number(formState.rateTonGj) ? Number(formState.qtyGj || 0)/Number(formState.rateTonGj) : 0 amountCount() } if (!formState.amount) { - formState.amount = (Number(formState.qtyGj || 0)*Number(formState.priceGj || 0)).toFixed(2) + formState.amount = Number(formState.qtyGj || 0)*Number(formState.priceGj || 0) amountCount() } } if (formState.uomCode == 'TON') { if (!formState.qtyGj) { - formState.qtyGj = (Number(formState.qtyTon || 0)*Number(formState.rateTonGj || 0)).toFixed(3) + formState.qtyGj = Number(formState.qtyTon || 0)*Number(formState.rateTonGj || 0) amountCount() } if (!formState.amount) { - formState.amount = (Number(formState.qtyTon || 0)*Number(formState.priceTon || 0)).toFixed(2) + formState.amount = Number(formState.qtyTon || 0)*Number(formState.priceTon || 0) amountCount() } } } const amountCount = () => { if (!formState.priceTon) { - formState.priceTon = (Number(formState.qtyTon) ? Number(formState.amount || 0)/Number(formState.qtyTon) : 0).toFixed(4) + formState.priceTon = Number(formState.qtyTon) ? Number(formState.amount || 0)/Number(formState.qtyTon) : 0 } if (!formState.priceGj) { - formState.priceGj = (Number(formState.qtyGj) ? Number(formState.amount || 0)/Number(formState.qtyGj) : 0).toFixed(4) + formState.priceGj = Number(formState.qtyGj) ? Number(formState.amount || 0)/Number(formState.qtyGj) : 0 } } const onSearchStation = (val)=> { @@ -336,6 +336,11 @@ await formRef.value.validateFields(); let obj = { ...formState, + qtyTon: formState.qtyTon ? formState.qtyTon.toFixed(3) : formState.qtyTon, + amount: formState.amount ? formState.amount.toFixed(2) : formState.amount, + qtyGj: formState.qtyGj ? formState.qtyGj.toFixed(3) : formState.qtyGj, + priceTon: formState.priceTon ? formState.priceTon.toFixed(4) : formState.priceTon, + priceGj: formState.priceGj ? formState.priceGj.toFixed(4) : formState.priceGj, lngFileUploadList: dataFile.value, } spinning.value = true;