|
@@ -50,18 +50,23 @@
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
- <a-form-item label="币种(currency)" v-bind="validateInfos.currency" id="quotationFormForm-currency" name="currency">
|
|
|
+ <a-form-item label="币种(currency)" v-bind="validateInfos.currency" id="quotationFormForm-currency" name="currency" :labelCol="formItemLayout.labelCol1" :wrapperCol="formItemLayout.wrapperCol1">
|
|
|
<JDictSelectTag v-model:value="formData.currency" placeholder="请选择" dictCode="currency" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
+ <a-col :span="12">
|
|
|
+ <a-form-item label="汇率(exchangeRate)" v-bind="validateInfos.exchangeRate" id="quotationFormForm-exchangeRate" name="exchangeRate" >
|
|
|
+ <a-input-number v-model:value="formData.exchangeRate" placeholder="请输入" allow-clear AutoComplete="off" @change="changeDiscountOrExchangeRate" suffix="%"></a-input-number>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
<a-col :span="12">
|
|
|
<a-form-item label="贸易方式(delivery terms)" v-bind="validateInfos.deliveryTerms" id="quotationFormForm-deliveryTerms" name="deliveryTerms" :labelCol="formItemLayout.labelCol1" :wrapperCol="formItemLayout.wrapperCol1">
|
|
|
<JDictSelectTag v-model:value="formData.deliveryTerms" placeholder="请选择" dictCode="delivery_terms"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
- <a-form-item label="交期(delivery time)" v-bind="validateInfos.deliveryTime" id="quotationFormForm-deliveryTime" name="deliveryTime">
|
|
|
- <a-date-picker placeholder="请选择交期(delivery time)" v-model:value="formData.deliveryTime" @change="changeDelivertTime" value-format="YYYY-MM-DD" format="YYYY-MM-DD" style="width: 100%" allow-clear />
|
|
|
+ <a-form-item label="交期(delivery time)" v-bind="validateInfos.deliveryDayHead" id="quotationFormForm-deliveryDayHead" name="deliveryDayHead">
|
|
|
+ <a-input-number placeholder="" v-model:value="formData.deliveryDayHead" @change="changeDelivertTime" style="width: 100%" allow-clear />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
@@ -76,7 +81,7 @@
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
|
<a-form-item label="客户折扣(custumer discount)" v-bind="validateInfos.custumerDiscount" id="quotationFormForm-custumerDiscount" name="custumerDiscount" :labelCol="formItemLayout.labelCol1" :wrapperCol="formItemLayout.wrapperCol1">
|
|
|
- <a-input v-model:value="formData.custumerDiscount" placeholder="请输入客户折扣(custumer discount)" allow-clear AutoComplete="off" @change="changeDiscount"></a-input>
|
|
|
+ <a-input v-model:value="formData.custumerDiscount" placeholder="请输入客户折扣(custumer discount)" allow-clear AutoComplete="off" @change="changeDiscountOrExchangeRate" suffix="%"></a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
@@ -274,7 +279,7 @@
|
|
|
maker: '',
|
|
|
currency:"",
|
|
|
deliveryTerms: '',
|
|
|
- deliveryTime: '',
|
|
|
+ deliveryDayHead: '',
|
|
|
paymentTerms: '',
|
|
|
placeDelivery: '',
|
|
|
custumerDiscount: '',
|
|
@@ -287,6 +292,7 @@
|
|
|
attachs: '',
|
|
|
supplierAttachs: '',
|
|
|
sourceCode:'',
|
|
|
+ exchangeRate:''
|
|
|
});
|
|
|
|
|
|
//表单验证
|
|
@@ -454,7 +460,7 @@
|
|
|
item.productClass = item.classId_dictText
|
|
|
item.productCode = item.code
|
|
|
// item.unit = item.measurementUnit
|
|
|
- item.deliveryTime = formData.deliveryTime
|
|
|
+ item.deliveryDayChild = formData.deliveryDayHead
|
|
|
item.productId = item.id
|
|
|
var obj = await getRowRate(item)
|
|
|
item.taxRate = obj.rateNumber
|
|
@@ -479,6 +485,7 @@
|
|
|
if(item.value==data[0].customerId){
|
|
|
formData.priority =item.priority
|
|
|
formData.custumerDiscount=item.discount
|
|
|
+ formData.paymentTerms=item.paymentTerms
|
|
|
}
|
|
|
})
|
|
|
if(saleQuotationFormProductTable.dataSource.length>0){
|
|
@@ -503,7 +510,8 @@
|
|
|
priority:item.priority,
|
|
|
intermediatorCommission:item.intermediatorCommission,
|
|
|
commission:item.commission,
|
|
|
- discount:item.discount
|
|
|
+ discount:item.discount,
|
|
|
+ paymentTerms:item.paymentTerms
|
|
|
})
|
|
|
})
|
|
|
}
|
|
@@ -559,7 +567,7 @@
|
|
|
const xTable = saleQuotationFormProductTableRef.value!.getXTable();
|
|
|
var newArr = [...xTable.data]
|
|
|
newArr.map(item=>{
|
|
|
- item.deliveryTime = formData.deliveryTime
|
|
|
+ item.deliveryDayChild = formData.deliveryDayHead
|
|
|
})
|
|
|
saleQuotationFormProductTable.dataSource = newArr
|
|
|
}
|
|
@@ -624,6 +632,7 @@
|
|
|
item.customerCommision = event.commission
|
|
|
formData.custumerDiscount=event.discount
|
|
|
item.discount = event.discount
|
|
|
+ formData.paymentTerms = event.paymentTerms
|
|
|
}
|
|
|
})
|
|
|
})
|
|
@@ -636,7 +645,7 @@
|
|
|
formData.model = data[0].fatherModel
|
|
|
formData.maker = data[0].maker
|
|
|
formData.productionClass = data[0].productionClass
|
|
|
-
|
|
|
+ formData.deliveryDayHead = data[0].deliveryDayChild
|
|
|
}
|
|
|
async function getRowRate(row){
|
|
|
var obj= {
|
|
@@ -667,28 +676,28 @@
|
|
|
}
|
|
|
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){
|
|
|
//汇率默认为1
|
|
|
- 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)
|
|
|
+ formData.exchangeRate = (formData.exchangeRate==''||formData.exchangeRate===null)?1:formData.exchangeRate
|
|
|
+ var num= prop.row.purchasePrice/Number(formData.exchangeRate)*(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).toFixed(2)
|
|
|
}
|
|
|
- }
|
|
|
}
|
|
|
if(prop.col.key=='quantity'&&prop.row.salePrice&&prop.row.quantity){
|
|
|
prop.row.taxAmount = (prop.row.salePrice*prop.row.quantity).toFixed(2)
|
|
|
}
|
|
|
}
|
|
|
- function changeDiscount(){
|
|
|
+ function changeDiscountOrExchangeRate(){
|
|
|
if(saleQuotationFormProductTable.dataSource.length>0){
|
|
|
const xTable = saleQuotationFormProductTableRef.value!.getXTable();
|
|
|
var newArr = [...xTable.data]
|
|
|
+ formData.exchangeRate = (formData.exchangeRate==''||formData.exchangeRate===null)?1:formData.exchangeRate
|
|
|
newArr.map(item=>{
|
|
|
item.discount = formData.custumerDiscount
|
|
|
if(item.purchasePrice&&item.taxRate&&item.tariff&&item.discount&&item.grossMargin&&item.customerCommision&&item.intermediatorCommission){
|
|
|
//汇率默认为1
|
|
|
- var num= item.purchasePrice/1*(1+item.taxRate/100)*(1+item.tariff/100)*(1-item.discount/100)/(1-item.grossMargin/100-item.customerCommision/100-item.intermediatorCommission/100)
|
|
|
+ var num= item.purchasePrice/Number(formData.exchangeRate)*(1+item.taxRate/100)*(1+item.tariff/100)*(1-item.discount/100)/(1-item.grossMargin/100-item.customerCommision/100-item.intermediatorCommission/100)
|
|
|
item.salePrice = num.toFixed(2)
|
|
|
if(item.quantity){
|
|
|
item.taxAmount = (item.salePrice*item.quantity).toFixed(2)
|
|
@@ -749,7 +758,7 @@
|
|
|
notAllowEdit,
|
|
|
changeValues,
|
|
|
getRowRate,
|
|
|
- changeDiscount
|
|
|
+ changeDiscountOrExchangeRate,
|
|
|
}
|
|
|
}
|
|
|
});
|