|
@@ -155,6 +155,7 @@
|
|
|
:rowNumber="true"
|
|
|
:rowSelection="true"
|
|
|
asyncRemove
|
|
|
+ @valueChange="changeValues"
|
|
|
>
|
|
|
<template #lastPrice="props">
|
|
|
<a @click="viewHistory">{{ props.row.lastPrice }}</a>
|
|
@@ -593,6 +594,20 @@
|
|
|
formData.quotationCustomer =obj[0].customerId
|
|
|
formData.quotationCustomerName =obj[0].customerId_dictText
|
|
|
}
|
|
|
+ function changeValues(prop){
|
|
|
+ if(prop.col.key=='purchasePrice'||prop.col.key=='taxRate'||prop.col.key=='tariff'||prop.col.key=='discount'||prop.col.key=='grossMargin'||prop.col.key=='customerCommision'||prop.col.key=='intermediatorCommission'){
|
|
|
+ if(prop.row.purchasePrice&&prop.row.taxRate&&prop.row.tariff&&prop.row.discount&&prop.row.grossMargin&&prop.row.customerCommision&&prop.row.intermediatorCommission){
|
|
|
+ var num= prop.row.purchasePrice/1*(1+prop.row.taxRate/100)*(1+prop.row.tariff/100)*(1-prop.row.discount/100)/(1-prop.row.grossMargin/100-prop.row.customerCommision/100-prop.row.intermediatorCommission/100)
|
|
|
+ prop.row.salePrice = num.toFixed(2)
|
|
|
+ if(prop.row.quantity){
|
|
|
+ prop.row.taxAmount = prop.row.salePrice*prop.row.quantity
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(prop.col.key=='quantity'&&prop.row.salePrice&&prop.row.quantity){
|
|
|
+ prop.row.taxAmount = prop.row.salePrice*prop.row.quantity
|
|
|
+ }
|
|
|
+ }
|
|
|
return {
|
|
|
saleQuotationFormShipTableRef,
|
|
|
saleQuotationFormShipTable,
|
|
@@ -640,7 +655,8 @@
|
|
|
VersionDetail,
|
|
|
queryVersonHistoryData,
|
|
|
addProductFromSupplier,
|
|
|
- notAllowEdit
|
|
|
+ notAllowEdit,
|
|
|
+ changeValues
|
|
|
}
|
|
|
}
|
|
|
});
|