Qukatie 2 vuotta sitten
vanhempi
commit
9bf6073687

+ 52 - 52
src/views/exportTrade/customerInquiry/components/goodsInfo.vue

@@ -772,58 +772,58 @@ export default {
             });
         },
         calculate(val) {
-            // this.form.totalValue = 0
-            // this.data.forEach((e, index) => {
-            //     e.sort = Number(index) + 1
-            //     this.form.totalValue = sum(multiply(e.outFactoryPrice, e.orderQuantity), this.form.totalValue)
-            // })
-            // this.calculateLoading = true
-            // calculationDomesticFees({ ...this.form, domesticAbroad: val, orderItemsList: this.data, }).then(res => {
-            //     this.$confirm("总运费:" + res.data.data.amount + ",单价分摊运费:" + res.data.data.amountF + ",是否继续更新?", {
-            //         confirmButtonText: "确定",
-            //         cancelButtonText: "取消",
-            //         type: "warning"
-            //     }).then(() => {
-            //         this.data.forEach(e => {
-            //             if (val == 1) {
-            //                 e.shareAmount = multiply(res.data.data.amountF, e.outFactoryPrice, 10)
-            //                 e.price = addPrice(e.outFactoryPrice, multiply(res.data.data.amountF, e.outFactoryPrice, 10), e.internationalAmount)
-            //                 e.amount = amountCal(
-            //                     addPrice(e.outFactoryPrice, multiply(res.data.data.amountF, e.outFactoryPrice, 10), e.internationalAmount),
-            //                     e.orderQuantity,
-            //                     e.freight,
-            //                     e.insurance,
-            //                     e.discount
-            //                 );
-            //             } else {
-            //                 e.internationalAmount = multiply(res.data.data.amountF, e.outFactoryPrice, 10)
-            //                 e.price = addPrice(e.outFactoryPrice, multiply(res.data.data.amountF, e.outFactoryPrice, 10), e.shareAmount)
-            //                 e.amount = amountCal(
-            //                     addPrice(e.outFactoryPrice, multiply(res.data.data.amountF, e.outFactoryPrice, 10), e.shareAmount),
-            //                     e.orderQuantity,
-            //                     e.freight,
-            //                     e.insurance,
-            //                     e.discount
-            //                 );
-            //             }
-            //             e.itemMargin = grossProfitCal(
-            //                 e.purchaseAmount,
-            //                 e.partsPrice,
-            //                 e.outFactoryPrice,
-            //                 this.form.exchangeRate
-            //             );
-            //         })
-            //         let arr = []
-            //         res.data.data.fees.forEach(e => {
-            //             // this.orderFeesList.push({ feesType: 2, ...e, corpId: this.form.corpId, corpName: this.form.corpsName, amount: multiply(e.price, e.quantity) })
-            //             arr.push({ feesType: 2, ...e, corpId: this.form.corpId, corpName: this.form.corpsName, amount: multiply(e.price, e.quantity), srcType: val == 1 ? '国内费用' : '国外费用' })
-            //         })
-            //         this.$emit('formGoodstoFees', arr, val == 1 ? '国内费用' : '国外费用')
-            //     });
-            // })
-            //     .finally(() => {
-            //         this.calculateLoading = false;
-            //     });
+            this.form.totalValue = 0
+            this.data.forEach((e, index) => {
+                e.sort = Number(index) + 1
+                this.form.totalValue = sum(multiply(e.outFactoryPrice, e.orderQuantity), this.form.totalValue)
+            })
+            this.calculateLoading = true
+            calculationDomesticFees({ ...this.form, domesticAbroad: val, orderItemsList: this.data, }).then(res => {
+                this.$confirm("总运费:" + res.data.data.amount + ",单价分摊运费:" + res.data.data.amountF + ",是否继续更新?", {
+                    confirmButtonText: "确定",
+                    cancelButtonText: "取消",
+                    type: "warning"
+                }).then(() => {
+                    this.data.forEach(e => {
+                        if (val == 1) {
+                            e.shareAmount = multiply(res.data.data.amountF, e.outFactoryPrice, 10)
+                            e.price = addPrice(e.outFactoryPrice, multiply(res.data.data.amountF, e.outFactoryPrice, 10), e.internationalAmount)
+                            e.amount = amountCal(
+                                addPrice(e.outFactoryPrice, multiply(res.data.data.amountF, e.outFactoryPrice, 10), e.internationalAmount),
+                                e.orderQuantity,
+                                e.freight,
+                                e.insurance,
+                                e.discount
+                            );
+                        } else {
+                            e.internationalAmount = multiply(res.data.data.amountF, e.outFactoryPrice, 10)
+                            e.price = addPrice(e.outFactoryPrice, multiply(res.data.data.amountF, e.outFactoryPrice, 10), e.shareAmount)
+                            e.amount = amountCal(
+                                addPrice(e.outFactoryPrice, multiply(res.data.data.amountF, e.outFactoryPrice, 10), e.shareAmount),
+                                e.orderQuantity,
+                                e.freight,
+                                e.insurance,
+                                e.discount
+                            );
+                        }
+                        e.itemMargin = grossProfitCal(
+                            e.purchaseAmount,
+                            e.partsPrice,
+                            e.outFactoryPrice,
+                            this.form.exchangeRate
+                        );
+                    })
+                    let arr = []
+                    res.data.data.fees.forEach(e => {
+                        // this.orderFeesList.push({ feesType: 2, ...e, corpId: this.form.corpId, corpName: this.form.corpsName, amount: multiply(e.price, e.quantity) })
+                        arr.push({ feesType: 2, ...e, corpId: this.form.corpId, corpName: this.form.corpsName, amount: multiply(e.price, e.quantity), srcType: val == 1 ? '国内费用' : '国外费用' })
+                    })
+                    this.$emit('formGoodstoFees', arr, val == 1 ? '国内费用' : '国外费用')
+                });
+            })
+                .finally(() => {
+                    this.calculateLoading = false;
+                });
         },
         khEdit(status) {
             if (status == 'cname') {

+ 3 - 0
src/views/statisticAnalysis/brandProfit/index.vue

@@ -29,6 +29,9 @@
         <template slot="netGrossProfit" slot-scope="{ row, index }">
           <span>{{ Number(row.netGrossProfit ? row.netGrossProfit : 0).toFixed(2) }}</span>
         </template>
+        <template slot="grossProfitRate" slot-scope="{ row, index }">
+          <span>{{ Number(row.grossProfitRate ? row.grossProfitRate : 0).toFixed(2) }}</span>
+        </template>
       </avue-crud>
     </basic-container>
   </div>

+ 3 - 0
src/views/statisticAnalysis/customerProfit/index.vue

@@ -23,6 +23,9 @@
         <template slot="netGrossProfit" slot-scope="{ row, index }">
           <span>{{ Number(row.netGrossProfit ? row.netGrossProfit : 0).toFixed(2) }}</span>
         </template>
+        <template slot="grossProfitRate" slot-scope="{ row, index }">
+          <span>{{ Number(row.grossProfitRate ? row.grossProfitRate : 0).toFixed(2) }}</span>
+        </template>
       </avue-crud>
     </basic-container>
   </div>

+ 3 - 0
src/views/statisticAnalysis/salesmanProfit/index.vue

@@ -20,6 +20,9 @@
         <template slot="netGrossProfit" slot-scope="{ row, index }">
           <span>{{ Number(row.netGrossProfit ? row.netGrossProfit : 0).toFixed(2) }}</span>
         </template>
+        <template slot="grossProfitRate" slot-scope="{ row, index }">
+          <span>{{ Number(row.grossProfitRate ? row.grossProfitRate : 0).toFixed(2) }}</span>
+        </template>
       </avue-crud>
     </basic-container>
   </div>