Explorar o código

优化接收单逻辑

Yannay hai 2 meses
pai
achega
9c20086e39

+ 12 - 8
pages/orderDetailNew/components/orderDetailNewView.vue

@@ -20,7 +20,7 @@
20 20
         </view>
21 21
 
22 22
         <ul class="page">
23
-            <li @click="activeIndex = index" v-for="(tab, index) in tabs" :key="index"
23
+            <li @click="handleTabClick(index)" v-for="(tab, index) in tabs" :key="index"
24 24
                 :class="{ 'active': activeIndex === index }">{{ tab }}</li>
25 25
         </ul>
26 26
     </view>
@@ -172,12 +172,12 @@ export default {
172 172
                 "customName": this.pageThreeForm.customName,
173 173
             }
174 174
 
175
-            //调用接口保存收单表单
176
-            if (this.detail.receiptId) {
177
-                this.updateData(params);
178
-            } else {
179
-                this.saveData(params);
180
-            }
175
+            // //调用接口保存收单表单
176
+            // if (this.detail.receiptId) {
177
+            //     this.updateData(params);
178
+            // } else {
179
+            //     this.saveData(params);
180
+            // }
181 181
         },
182 182
         // 确认支付
183 183
         handleConfirmPay() {
@@ -223,7 +223,7 @@ export default {
223 223
                 "freight": warehouseInfo.freight || '',         //运费page4加上
224 224
                 "checkCodeFee": warehouseInfo.checkCodeFee || '',  //查码费
225 225
                 // "totalCost": "60230.00",   // 成本合计 =   运费 + 好处费 + 查码费 + 表款(支付总额) + 维修费。
226
-                "sellingPrice": this.topInfo.price,   //实际价格(售价)顶上tab里面的第三栏
226
+                // "sellingPrice": this.topInfo.price,   //实际价格(售价)顶上tab里面的第三栏
227 227
                 // "performance": "29772.00",  //sellingPrice - totalCost
228 228
                 "receiptRemark": warehouseInfo.remarks + ';' + warehouseInfo.uploadedImage || '',//"收单之后还需再跟进", 先不传
229 229
                 "repairAmount": warehouseInfo.repairAmount || '', //维修总金额 ,先不传
@@ -284,6 +284,10 @@ export default {
284 284
                 console.error("获取跟进记录失败:", error);
285 285
                 uni.$u.toast("获取跟进记录失败");
286 286
             }
287
+        },
288
+        handleTabClick(index) {
289
+            this.activeIndex = index;
290
+            this.$refs.pageThreeComp.getList('2', '3', this.currentReceiptInner.id, this.detail.itemBrand);
287 291
         }
288 292
     },
289 293
 

+ 22 - 4
pages/orderDetailNew/components/pageFour.vue

@@ -420,7 +420,8 @@ export default {
420 420
         },
421 421
 
422 422
         // 确认入库方法
423
-        confirmWarehouseEntry() {
423
+        async confirmWarehouseEntry() {
424
+
424 425
 
425 426
             console.log('确认入库', this.orderDetail.id)
426 427
 
@@ -429,15 +430,32 @@ export default {
429 430
                 content: `是否确认入库改订单:${this.orderDetail.item}?`,
430 431
                 success: async (res) => {
431 432
                     if (res.confirm) {
433
+                        //修改状态
432 434
                         await uni.$u.api.oderForm({
433 435
                             status: "3",
434 436
                             id: this.orderDetail.id,
435 437
                         });
436 438
 
439
+                        await uni.$u.api.updateReceiptForm({
440
+                            id: this.currentReceipt.id,
441
+                            code: this.warehouseInfo.codeStorage || '',//编码
442
+                            expressOrderNo: this.warehouseInfo.expressOrderNo || '',//快递单号
443
+                            item: this.warehouseInfo.item || '',//收单物品
444
+                            checkCodeFee: this.warehouseInfo.checkCodeFee || '',//查码费
445
+                            tableFee: this.warehouseInfo.watchPrice || '',//表款
446
+                            benefitFee: this.warehouseInfo.benefitFee || '',//好处费
447
+                            freight: this.warehouseInfo.freight || '',//运费
448
+                            repairAmount: this.warehouseInfo.repairAmount || '',//维修金额
449
+                            grossPerformance: this.warehouseInfo.grossPerformance || '',//毛业绩
450
+                            receiptRemark: this.warehouseInfo.remarks + ';' + this.warehouseInfo.uploadedImage || '',//收单备注
451
+                        });
452
+
437 453
                         //上传物流表单数据
438
-                        this.$emit('confirmInterStore', {
439
-                            warehouseInfo: this.warehouseInfo,
440
-                        })
454
+                        // this.$emit('confirmInterStore', {
455
+                        //     warehouseInfo: this.warehouseInfo,
456
+                        // })
457
+                        //保存入库信息
458
+
441 459
 
442 460
                         //上传分成数据
443 461
                         await this.addShare()

+ 47 - 17
pages/orderDetailNew/components/pageThree.vue

@@ -166,7 +166,7 @@ export default {
166 166
                     this.paymentInfo.bankName = newVal.bankName || ''
167 167
                     this.paymentInfo.bankAccount = newVal.bankCardNumber || ''
168 168
                     this.paymentInfo.idNumber = newVal.idCard || ''
169
-                    this.paymentAmount = newVal.tableFee || '0.00'
169
+                    // this.paymentAmount = newVal.tableFee || '0.00'
170 170
                 }
171 171
             },
172 172
             deep: true,
@@ -354,19 +354,35 @@ export default {
354 354
         },
355 355
 
356 356
         // 立即支付按钮点击事件
357
-        handlePayNowClick() {
357
+        async handlePayNowClick() {
358
+            //保存
359
+            await uni.$u.api.updateReceiptForm({
360
+                id: this.currentReceipt.id,
361
+                tableFee: this.paymentAmount,
362
+                fileIds: this.detailImages.map(item => item.id).join(',')
363
+            });
364
+
365
+            //保存上面的支付信息
366
+            await uni.$u.api.updateClueOrderForm({
367
+                id: this.orderDetail.id,
368
+                customName: this.paymentInfo.customName || '',
369
+                bankName: this.paymentInfo.bankName || '',
370
+                bankCardNumber: this.paymentInfo.bankAccount || '',
371
+                idCard: this.paymentInfo.idNumber || '',
372
+            });
373
+
358 374
             console.log('点击了立即支付按钮');
359 375
             this.payNowModelShow = true;
360 376
 
361 377
             //让父组件保存数据
362
-            this.$emit('handleNeedSave', {
363
-                fileIds: this.detailImages.map(item => item.id).join(','),
364
-                nowPage: 'formThree',
365
-                form: {
366
-                    ...this.paymentInfo,
367
-                    paymentAmount: this.paymentAmount
368
-                }
369
-            });
378
+            // this.$emit('handleNeedSave', {
379
+            //     fileIds: this.detailImages.map(item => item.id).join(','),
380
+            //     nowPage: 'formThree',
381
+            //     form: {
382
+            //         ...this.paymentInfo,
383
+            //         paymentAmount: this.paymentAmount
384
+            //     }
385
+            // });
370 386
         },
371 387
 
372 388
 
@@ -380,14 +396,28 @@ export default {
380 396
             this.$emit('handleConfirmPay');
381 397
         },
382 398
         // 下一步按钮点击事件
383
-        handleNextClick() {
384
-            console.log('page3点击了下一步按钮', this.detailImages);
385
-            this.$emit('handleNextClick', {
386
-                nowPage: 'formThree',
387
-                form: {
388
-                    ...this.paymentInfo
389
-                }
399
+        async handleNextClick() {
400
+            await uni.$u.api.updateReceiptForm({
401
+                id: this.currentReceipt.id,
402
+                tableFee: this.paymentAmount,
403
+                fileIds: this.detailImages.map(item => item.id).join(',')
404
+            });
405
+
406
+            await uni.$u.api.updateClueOrderForm({
407
+                id: this.orderDetail.id,
408
+                customName: this.paymentInfo.customName || '',
409
+                bankName: this.paymentInfo.bankName || '',
410
+                bankCardNumber: this.paymentInfo.bankAccount || '',
411
+                idCard: this.paymentInfo.idNumber || '',
390 412
             });
413
+
414
+            console.log('page3点击了下一步按钮', this.detailImages);
415
+            // this.$emit('handleNextClick', {
416
+            //     nowPage: 'formThree',
417
+            //     form: {
418
+            //         ...this.paymentInfo
419
+            //     }
420
+            // });
391 421
         },
392 422
 
393 423
         // 确认未收按钮点击事件

+ 6 - 0
pages/orderDetailNew/components/pageTwo.vue

@@ -236,6 +236,12 @@ export default {
236 236
 
237 237
         // 下一步按钮点击事件
238 238
         async handleNextClick() {
239
+            //调接口保存当前的核准价
240
+            await uni.$u.api.updateReceiptForm({
241
+                id: this.currentReceipt.id,
242
+                sellingPrice: this.approvedPrice,
243
+            });
244
+
239 245
             // 创建一个只包含被勾选checkbox对应数据的对象
240 246
             const result = {};
241 247