Просмотр исходного кода

Merge branch 'master' of http://106.52.242.177:3000/askqvn/crm-app

zhangxin месяцев назад: 2
Родитель
Сommit
af3b99dda8
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
                 <u-row class="info-row" justify="space-between">
45
                 <u-row class="info-row" justify="space-between">
46
                     <u-col span="5.8">
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
                                 type="number" />
49
                                 type="number" />
50
                         </u-form-item>
50
                         </u-form-item>
51
                     </u-col>
51
                     </u-col>
52
                     <u-col span="5.8">
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
                                 type="number" />
55
                                 type="number" />
56
                         </u-form-item>
56
                         </u-form-item>
57
                     </u-col>
57
                     </u-col>
@@ -81,12 +81,27 @@
81
                         </u-form-item>
81
                         </u-form-item>
82
                     </u-col>
82
                     </u-col>
83
                     <u-col span="5.8">
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
                                 type="number" />
86
                                 type="number" />
87
                         </u-form-item>
87
                         </u-form-item>
88
                     </u-col>
88
                     </u-col>
89
                 </u-row>
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
                 <u-row class="info-row">
107
                 <u-row class="info-row">
@@ -288,13 +303,33 @@ export default {
288
                         freight: data.freight || '',//运费
303
                         freight: data.freight || '',//运费
289
                         repairAmount: data.repairAmount || '',//维修金额
304
                         repairAmount: data.repairAmount || '',//维修金额
290
                         grossPerformance: data.grossPerformance || '',//毛业绩
305
                         grossPerformance: data.grossPerformance || '',//毛业绩
306
+                        performance: data.performance || '',//业绩
291
                         remarks: data.receiptRemark?.split(';')[0] || '',//收单备注  截取备注第一部分
307
                         remarks: data.receiptRemark?.split(';')[0] || '',//收单备注  截取备注第一部分
308
+                        splitRatio: data.splitRatio || '',//分单比例
292
                     }
309
                     }
293
                     this.getShareList()
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
     data() {
333
     data() {
299
         return {
334
         return {
300
             // 入库信息相关的数据
335
             // 入库信息相关的数据
@@ -309,6 +344,8 @@ export default {
309
                 freight: '',//运费
344
                 freight: '',//运费
310
                 repairAmount: '',//维修金额
345
                 repairAmount: '',//维修金额
311
                 grossPerformance: '',//毛业绩
346
                 grossPerformance: '',//毛业绩
347
+                performance: '',//业绩
348
+                splitRatio: '',//分单比例
312
                 remarks: '',//收单备注
349
                 remarks: '',//收单备注
313
             },
350
             },
314
             // 分成信息相关的数据
351
             // 分成信息相关的数据
@@ -431,10 +468,10 @@ export default {
431
                 success: async (res) => {
468
                 success: async (res) => {
432
                     if (res.confirm) {
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
                         await uni.$u.api.updateReceiptForm({
476
                         await uni.$u.api.updateReceiptForm({
440
                             id: this.currentReceipt.id,
477
                             id: this.currentReceipt.id,
@@ -446,7 +483,9 @@ export default {
446
                             benefitFee: this.warehouseInfo.benefitFee || '',//好处费
483
                             benefitFee: this.warehouseInfo.benefitFee || '',//好处费
447
                             freight: this.warehouseInfo.freight || '',//运费
484
                             freight: this.warehouseInfo.freight || '',//运费
448
                             repairAmount: this.warehouseInfo.repairAmount || '',//维修金额
485
                             repairAmount: this.warehouseInfo.repairAmount || '',//维修金额
449
-                            grossPerformance: this.warehouseInfo.grossPerformance || '',//毛业绩
486
+                            grossPerformance: this.computedGrossPerformance || '',//毛业绩
487
+                            performance: this.computedPerformance || '',//毛业绩
488
+                            splitRatio: this.warehouseInfo.splitRatio || '',//分单比例
450
                             receiptRemark: this.warehouseInfo.remarks + ';' + this.warehouseInfo.uploadedImage || '',//收单备注
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
         <u-modal :show="addOneModelShow" :title="'加一单'" showCancelButton @cancel="addOneModelShow = false"
32
         <u-modal :show="addOneModelShow" :title="'加一单'" showCancelButton @cancel="addOneModelShow = false"
33
             @confirm="handleAddOneConfirm">
33
             @confirm="handleAddOneConfirm">
34
+            <!-- 品牌选择按钮 -->
34
             <u-button type="primary" plain @click="showBrandSelector = true;"
35
             <u-button type="primary" plain @click="showBrandSelector = true;"
35
                 :text="currentAddBrand.dictLabel || '点击请选择品牌'"></u-button>
36
                 :text="currentAddBrand.dictLabel || '点击请选择品牌'"></u-button>
37
+            <!-- 物品选择按钮 -->
36
         </u-modal>
38
         </u-modal>
39
+
37
         <!-- 加一单品牌选择器 -->
40
         <!-- 加一单品牌选择器 -->
38
         <u-picker :show="showBrandSelector" @confirm="handleBrandConfirm" :columns="brandColumns"
41
         <u-picker :show="showBrandSelector" @confirm="handleBrandConfirm" :columns="brandColumns"
39
             @cancel='showBrandSelector = false' keyName="dictLabel"></u-picker>
42
             @cancel='showBrandSelector = false' keyName="dictLabel"></u-picker>