Bladeren bron

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

zhangxin 2 maanden geleden
bovenliggende
commit
afe014e8d7
2 gewijzigde bestanden met toevoegingen van 33 en 8 verwijderingen
  1. 23 4
      pages/orderDetailNew/components/pageFour.vue
  2. 10 4
      pages/orderDetailNew/components/pageTwo.vue

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

@@ -552,7 +552,10 @@ export default {
552 552
         handleSelectOrg(item) {
553 553
             console.log(item.uuid, '当前选择的行的uuid')
554 554
             this.currentEditItem = item.uuid
555
-            this.showOrgPicker = true
555
+            // this.showOrgPicker = true
556
+            this.showPersonPicker = true
557
+            //把当前的组织赋值给当前的组件
558
+            this.columnsPersonList = this.columnsOrgList//获取到的分成人名单
556 559
         },
557 560
         //选择当前的分成人
558 561
         handleSelectPerson(item) {
@@ -561,15 +564,31 @@ export default {
561 564
             //获取当前选择组织的分成人名单
562 565
             // 获取当前行的关联id
563 566
             const deptId = item.deptId
564
-            const org = this.columnsOrgList[0].find(org => org.id == deptId)
565
-            console.log(org, '当前选择的行的组织')
567
+            //递归查找当前选择的组织
568
+            const org = this.findOrg(this.columnsOrgList[0], deptId)
569
+            // const org = this.columnsOrgList[0].find(org => org.id == deptId)
570
+            console.log(org, '当前选择的组织')
566 571
             if (org) {
567 572
                 this.columnsPersonList = [org.children]
568 573
             }
569 574
             // 把当前选择组织的分成人名单赋值给当前行的分成人选项列表
570
-
571 575
             this.showPersonPicker = true
572 576
         },
577
+        //递归查找当前选择的组织
578
+        findOrg(orgList, deptId) {
579
+            for (const org of orgList) {
580
+                if (org.id == deptId) {
581
+                    return org
582
+                }
583
+                if (org.children && org.children.length > 0) {
584
+                    const found = this.findOrg(org.children, deptId)
585
+                    if (found) {
586
+                        return found
587
+                    }
588
+                }
589
+            }
590
+            return null
591
+        },
573 592
 
574 593
         //确认选择组织
575 594
         handleOrgConfirmOrg({ columnIndex, value, values },) {

+ 10 - 4
pages/orderDetailNew/components/pageTwo.vue

@@ -440,17 +440,22 @@ export default {
440 440
         },
441 441
         checkFollowUpContent() {
442 442
             // 检查跟进记录是否包含上面的三个选择
443
+            //每个检查到一个就不继续检查了
444
+            let hasContactMaster = false;
445
+            let hasPhotoTips = false;
446
+            let hasFace2face = false;
443 447
             this.followUpListInner.forEach(item => {
444 448
                 console.log('这里是跟进记录', item)
445 449
                 // 判断内容是否含有联系师傅,师傅拍图技巧,到达客户面对面,如果包含的话就上面对应的box就打上对勾
446
-                if (item.includes('联系师傅')) {
450
+                if (item.includes('联系师傅') && !hasContactMaster) {
447 451
                     this.selectedCheckbox.push('contact师傅');
448 452
                     // 联系师傅的手机号,已:为分割,取后面的内容
449 453
                     const phone = item.split(';')[1] || '';
450 454
                     console.log('联系师傅的手机号111111', phone)
451 455
                     this.formData.contactPhone = phone;
456
+                    hasContactMaster = true;
452 457
                 }
453
-                if (item.includes('师傅拍图技巧')) {
458
+                if (item.includes('师傅拍图技巧') && !hasPhotoTips) {
454 459
                     this.selectedCheckbox.push('photo技巧');
455 460
                     // 师傅拍图技巧的内容,已:为分割,取后面的内容
456 461
                     const photoTips = item.split(';')[1] || '';
@@ -459,9 +464,9 @@ export default {
459 464
                     //把url转为数组
460 465
                     const urlArray = urls.split(',').map(url => url.trim());
461 466
                     this.photoTipsImages = [...this.photoTipsImages, ...urlArray];
462
-
467
+                    hasPhotoTips = true;
463 468
                 }
464
-                if (item.includes('到达客户面对面')) {
469
+                if (item.includes('到达客户面对面') && !hasFace2face) {
465 470
                     this.selectedCheckbox.push('face2face');
466 471
                     // 到达客户面对面的内容,已:为分割,取后面的内容
467 472
                     const face2faceNotes = item.split(';')[1] || '';
@@ -470,6 +475,7 @@ export default {
470 475
                     //把url转为数组
471 476
                     const urlArray = urls.split(',').map(url => url.trim());
472 477
                     this.face2faceImages = [...this.face2faceImages, ...urlArray];
478
+                    hasFace2face = true;
473 479
                 }
474 480
             })
475 481
         },