瀏覽代碼

page4增加计算业绩和计算毛业绩

Yannay 2 月之前
父節點
當前提交
37a96c4b15
共有 2 個文件被更改,包括 53 次插入11 次删除
  1. 50 11
      pages/orderDetailNew/components/pageFour.vue
  2. 3 0
      pages/orderDetailNew/index.vue

+ 50 - 11
pages/orderDetailNew/components/pageFour.vue

@@ -44,14 +44,14 @@
44 44
                 <!-- 查码费和表款同一行 -->
45 45
                 <u-row class="info-row" justify="space-between">
46 46
                     <u-col span="5.8">
47
-                        <u-form-item label="查码费">
48
-                            <u--input v-model="warehouseInfo.checkCodeFee" placeholder="请输入查码费" class="info-input"
47
+                        <u-form-item label="表款">
48
+                            <u--input v-model="warehouseInfo.watchPrice" placeholder="请输入表款" class="info-input"
49 49
                                 type="number" />
50 50
                         </u-form-item>
51 51
                     </u-col>
52 52
                     <u-col span="5.8">
53
-                        <u-form-item label="表款">
54
-                            <u--input v-model="warehouseInfo.watchPrice" placeholder="请输入表款" class="info-input"
53
+                        <u-form-item label="查码费">
54
+                            <u--input v-model="warehouseInfo.checkCodeFee" placeholder="请输入查码费" class="info-input"
55 55
                                 type="number" />
56 56
                         </u-form-item>
57 57
                     </u-col>
@@ -81,12 +81,27 @@
81 81
                         </u-form-item>
82 82
                     </u-col>
83 83
                     <u-col span="5.8">
84
-                        <u-form-item label="毛业绩">
85
-                            <u--input v-model="warehouseInfo.grossPerformance" placeholder="请输入毛业绩" class="info-input"
84
+                        <u-form-item label="分单比例(0~100)">
85
+                            <u--input v-model="warehouseInfo.splitRatio" placeholder="请输入分单比例(0~100)" class="info-input"
86 86
                                 type="number" />
87 87
                         </u-form-item>
88 88
                     </u-col>
89 89
                 </u-row>
90
+                <!-- 业绩 -->
91
+                <u-row class="info-row" justify="space-between">
92
+                    <u-col span="5.8">
93
+                        <u-form-item label="业绩">
94
+                            <u--input :disabled="true" :value="computedPerformance" placeholder="业绩自动计算"
95
+                                class="info-input" type="number" />
96
+                        </u-form-item>
97
+                    </u-col>
98
+                    <u-col span="5.8">
99
+                        <u-form-item label="毛业绩">
100
+                            <u--input :disabled="true" :value="computedGrossPerformance" placeholder="毛业绩自动计算"
101
+                                class="info-input" type="number" />
102
+                        </u-form-item>
103
+                    </u-col>
104
+                </u-row>
90 105
 
91 106
                 <!-- 收单备注 -->
92 107
                 <u-row class="info-row">
@@ -288,13 +303,33 @@ export default {
288 303
                         freight: data.freight || '',//运费
289 304
                         repairAmount: data.repairAmount || '',//维修金额
290 305
                         grossPerformance: data.grossPerformance || '',//毛业绩
306
+                        performance: data.performance || '',//业绩
291 307
                         remarks: data.receiptRemark?.split(';')[0] || '',//收单备注  截取备注第一部分
308
+                        splitRatio: data.splitRatio || '',//分单比例
292 309
                     }
293 310
                     this.getShareList()
294 311
                 }
295 312
             },
296 313
         }
297 314
     },
315
+    computed: {
316
+        computedPerformance() {
317
+            //业绩   //sellingPrice - (totalCost// 成本合计 =   运费1 + 好处费1 + 查码费1 + 表款(支付总额)1+ 维修费1。)
318
+            const sellingPrice = this.currentReceipt.sellingPrice || 0
319
+            const totalCost = Number(this.warehouseInfo.watchPrice) + Number(this.warehouseInfo.freight) + Number(this.warehouseInfo.benefitFee) + Number(this.warehouseInfo.checkCodeFee) + Number(this.warehouseInfo.repairAmount)
320
+
321
+            return sellingPrice - totalCost
322
+        },
323
+
324
+        computedGrossPerformance() {
325
+            // 毛业绩  //毛利 performance*splitRatio,分单比例
326
+            const performance = Number(this.computedPerformance) || 0
327
+            //保留小数点后两位
328
+            const p = performance * (Number(this.warehouseInfo.splitRatio) / 100 || 0)
329
+            return p.toFixed(2)
330
+        },
331
+
332
+    },
298 333
     data() {
299 334
         return {
300 335
             // 入库信息相关的数据
@@ -309,6 +344,8 @@ export default {
309 344
                 freight: '',//运费
310 345
                 repairAmount: '',//维修金额
311 346
                 grossPerformance: '',//毛业绩
347
+                performance: '',//业绩
348
+                splitRatio: '',//分单比例
312 349
                 remarks: '',//收单备注
313 350
             },
314 351
             // 分成信息相关的数据
@@ -431,10 +468,10 @@ export default {
431 468
                 success: async (res) => {
432 469
                     if (res.confirm) {
433 470
                         //修改状态
434
-                        await uni.$u.api.oderForm({
435
-                            status: "3",
436
-                            id: this.orderDetail.id,
437
-                        });
471
+                        // await uni.$u.api.oderForm({
472
+                        //     status: "3",
473
+                        //     id: this.orderDetail.id,
474
+                        // });
438 475
 
439 476
                         await uni.$u.api.updateReceiptForm({
440 477
                             id: this.currentReceipt.id,
@@ -446,7 +483,9 @@ export default {
446 483
                             benefitFee: this.warehouseInfo.benefitFee || '',//好处费
447 484
                             freight: this.warehouseInfo.freight || '',//运费
448 485
                             repairAmount: this.warehouseInfo.repairAmount || '',//维修金额
449
-                            grossPerformance: this.warehouseInfo.grossPerformance || '',//毛业绩
486
+                            grossPerformance: this.computedGrossPerformance || '',//毛业绩
487
+                            performance: this.computedPerformance || '',//毛业绩
488
+                            splitRatio: this.warehouseInfo.splitRatio || '',//分单比例
450 489
                             receiptRemark: this.warehouseInfo.remarks + ';' + this.warehouseInfo.uploadedImage || '',//收单备注
451 490
                         });
452 491
 

+ 3 - 0
pages/orderDetailNew/index.vue

@@ -31,9 +31,12 @@
31 31
         <!-- 加一单选择模态窗 -->
32 32
         <u-modal :show="addOneModelShow" :title="'加一单'" showCancelButton @cancel="addOneModelShow = false"
33 33
             @confirm="handleAddOneConfirm">
34
+            <!-- 品牌选择按钮 -->
34 35
             <u-button type="primary" plain @click="showBrandSelector = true;"
35 36
                 :text="currentAddBrand.dictLabel || '点击请选择品牌'"></u-button>
37
+            <!-- 物品选择按钮 -->
36 38
         </u-modal>
39
+
37 40
         <!-- 加一单品牌选择器 -->
38 41
         <u-picker :show="showBrandSelector" @confirm="handleBrandConfirm" :columns="brandColumns"
39 42
             @cancel='showBrandSelector = false' keyName="dictLabel"></u-picker>