浏览代码

采购报价单熏得/销售报价单-交期/付款条件问题

jingbb 5 月之前
父节点
当前提交
bea7f1c9e6

+ 2 - 2
src/views/purchase/selectionQuotationForm/SelectionQuotationForm.data.ts

@@ -212,7 +212,7 @@ export const SelectQuotationFormProductColumns: JVxeColumn[] = [
     },
     {
       title: '付款条件(payment terms)',
-      key: 'paymentTerms',
+      key: 'paymentTerm',
       type: JVxeTypes.normal,
       placeholder: '请输入${title}',
       width:"200px",
@@ -228,7 +228,7 @@ export const SelectQuotationFormProductColumns: JVxeColumn[] = [
     },
     {
       title: '交期(delivery time)',
-      key: 'deliveryTime',
+      key: 'deliveryDayChild',
       type: JVxeTypes.normal,
       placeholder: '请输入${title}',
       width:"200px",

+ 0 - 1
src/views/purchase/selectionQuotationForm/components/SelectQuotationFormForm.vue

@@ -425,7 +425,6 @@
                   item.sourceId2=item.id
                   arr[index]={...item}
                   arr[index].selectionSupplier=item.quotationSuppiler
-                  arr[index].deliveryTime=item.childDeliveryTime
                 }
               }              
             })

+ 24 - 15
src/views/saleCode/quotation/components/quotationFormForm.vue

@@ -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,
       }
     }
   });

+ 26 - 26
src/views/saleCode/quotation/quotationForm.data.ts

@@ -144,8 +144,8 @@ export const saleQuotationFormShipColumns: JVxeColumn[] = [
 export const saleQuotationFormProductColumns: JVxeColumn[] = [
     {
       title: '交期(delivery time)',
-      key: 'deliveryTime',
-      type: JVxeTypes.date,
+      key: 'deliveryDayChild',
+      type: JVxeTypes.inputNumber,
       placeholder: '请输入${title}',
       width:"200px",
       defaultValue:'',
@@ -247,14 +247,14 @@ export const saleQuotationFormProductColumns: JVxeColumn[] = [
       width:"200px",
       defaultValue:'',
     },
-    {
-      title: '供应商币种(supplier currency)',
-      key: 'supplierCurrency',
-      type: JVxeTypes.normal,
-      placeholder: '请输入${title}',
-      defaultValue:'',  
-      width:"200px",
-    },
+    // {
+    //   title: '供应商币种(supplier currency)',
+    //   key: 'supplierCurrency',
+    //   type: JVxeTypes.normal,
+    //   placeholder: '请输入${title}',
+    //   defaultValue:'',  
+    //   width:"200px",
+    // },
     {
       title: '采购单价(purchase price)',
       key: 'purchasePrice',
@@ -295,22 +295,6 @@ export const saleQuotationFormProductColumns: JVxeColumn[] = [
       width:"200px",
       defaultValue:'',
     },
-    {
-      title: '客户佣金(customer commission)',
-      key: 'customerCommision',
-      type: JVxeTypes.inputNumber,
-      placeholder: '请输入${title}',
-      width:"200px",
-      defaultValue:'',
-    },
-    {
-      title: '中间人佣金(intermediator commission)',
-      key: 'intermediatorCommission',
-      type: JVxeTypes.inputNumber,
-      placeholder: '请输入${title}',
-      width:"200px",
-      defaultValue:'',
-    },
     {
       title: '销售单价(sale price)',
       key: 'salePrice',
@@ -345,6 +329,22 @@ export const saleQuotationFormProductColumns: JVxeColumn[] = [
       placeholder: '请输入${title}',
       defaultValue:'',
     },
+    {
+      title: '客户佣金(customer commission)',
+      key: 'customerCommision',
+      type: JVxeTypes.normal,
+      placeholder: '请输入${title}',
+      width:"200px",
+      defaultValue:'',
+    },
+    {
+      title: '中间人佣金(intermediator commission)',
+      key: 'intermediatorCommission',
+      type: JVxeTypes.normal,
+      placeholder: '请输入${title}',
+      width:"200px",
+      defaultValue:'',
+    },
     {
       title: '操作(operation)',
       key: 'action',