Browse Source

福达销售单票毛利计算 2023-12-12

caojunjie 1 year ago
parent
commit
4ed91ad4aa

+ 12 - 0
src/views/exportTrade/salesContract/components/goodsInfo.vue

@@ -642,6 +642,10 @@ export default {
           row.unit = e.unit;
           row.itemMargin = grossProfitCal(e.purchaseAmount, 0, sellingCal(productCal(e.purchaseAmount, 0, this
             .form.coefficient), this.form.exchangeRate), this.form.exchangeRate);
+          // 处理单品毛利率是 -00.00 的问题
+            if (Number(row.itemMargin) === 0) {
+                row.itemMargin = Number(row.itemMargin) + ''
+            }
           row.partsDescribe = null;
           row.remarks = null;
           row.exchangeRate = this.form.exchangeRate;
@@ -1007,12 +1011,20 @@ export default {
         row.insurance,
         row.discount
       );
+        console.log(row.purchaseAmount,'purchaseAmount')
+        console.log(row.partsPrice,'partsPrice')
+        console.log(row.outFactoryPrice,'outFactoryPrice')
+        console.log(this.form.exchangeRate,'exchangeRate')
       row.itemMargin = grossProfitCal(
         row.purchaseAmount,
         row.partsPrice,
         row.outFactoryPrice,
         this.form.exchangeRate
       );
+        // 处理单品毛利率是 -00.00 的问题
+        if (Number(row.itemMargin) === 0) {
+            row.itemMargin = Number(row.itemMargin) + ''
+        }
       // 出厂价格为零,单品毛利润为零
       if(row.outFactoryPrice == 0) {
           row.itemMargin = 0

+ 18 - 0
src/views/exportTrade/salesContract/detailsPage.vue

@@ -2318,8 +2318,25 @@ export default {
                   // 复制的重新进行计算
                   for (let item of this.goodsoptions) {
                       if (item.itemId == this.data[i].itemId) {
+                          this.data[i].purchaseCost = costCal(item.price, item.taxRate);
                           this.data[i].purchaseAmount = item.purchaseAmount
+
                           this.data[i].productPrice = productCal(item.purchaseAmount, 0, item.coefficient);
+                          this.data[i].outFactoryPrice = sellingCal(productCal(item.purchaseAmount, 0, item.coefficient), this.form.exchangeRate);
+                          this.data[i].shareAmount = 0;
+                          this.data[i].internationalAmount = 0;
+                          this.data[i].totalValue = sellingCal(productCal(item.purchaseAmount, 0, item.coefficient), this.form.exchangeRate);
+                          this.data[i].orderQuantity = 1;
+                          this.data[i].insurance = 0;
+                          this.data[i].freight = 0;
+                          this.data[i].discount = null;
+                          this.data[i].price = sellingCal(productCal(item.purchaseAmount, 0, item.coefficient), this.form.exchangeRate);
+                          this.data[i].amount = sellingCal(productCal(item.purchaseAmount, 0, item.coefficient), this.form.exchangeRate);
+                          console.log(sellingCal(productCal(item.purchaseAmount, 0, item.coefficient), this.form.exchangeRate),'出场价格')
+                          this.data[i].taxRate = 0;
+                          this.data[i].unit = item.unit;
+                          this.data[i].itemMargin = grossProfitCal(item.purchaseAmount, 0, sellingCal(productCal(item.purchaseAmount, 0, item.coefficient), this.form.exchangeRate), this.form.exchangeRate);
+
                       }
                   }
                   // 处理金额
@@ -2398,6 +2415,7 @@ export default {
             this.form.totalValue = sum(multiply(e.outFactoryPrice, e.orderQuantity), this.form.totalValue)
           })
           this.subLoading = true;
+          // return
           submit({
             ...this.form,
             orderItemsList: this.data,