浏览代码

优化订单列表添加字段

yuhao 2 年之前
父节点
当前提交
589e915bf8

+ 31 - 1
src/pages/confirmOrder/details/index.vue

@@ -763,9 +763,36 @@ export default {
763 763
         this.$message.error("不能选择相同的次卡");
764 764
         return
765 765
       }
766
+      let isProjectList = []
767
+    //判断是否重复选择次卡
768
+    let isTrueCode = false
769
+    this.cardList.forEach(res => {
770
+      if (res.isSelectCard) {
771
+        isProjectList = isProjectList.concat(res.project_ids)
772
+      }
773
+    })
774
+    if (item.isSelectCard) {
775
+      item.project_ids.forEach((_item,index) => {
776
+        isProjectList.forEach((item, i) => {
777
+          if (_item == item) {
778
+            isProjectList.splice(i, 1)
779
+          }
780
+        })
781
+      })
782
+    }
783
+    if (this.includes(isProjectList, item.project_ids)) {
784
+      isTrueCode = true
785
+    }
786
+    if (isTrueCode) {
787
+      this.$message.error('请勿重复选择次卡')
788
+      return
789
+    }
766 790
       this.cardList[index].isSelect = !this.cardList[index].isSelect
767 791
 
768 792
     },
793
+      includes(arr1, arr2) {
794
+    return arr2.every(val => arr1.includes(val));
795
+  },
769 796
     //确定选择的次卡
770 797
     isCardAdd () {
771 798
       let isSelectCardList = []
@@ -774,6 +801,7 @@ export default {
774 801
       let card_data = []
775 802
       let card_data_info = {}
776 803
       console.log(price, 'price');
804
+      let projectId = []
777 805
       if (this.isSelectCoup.length > 0) {
778 806
         this.isSelectCoup.forEach(res => {
779 807
           this.order_data.project_list.forEach(item => {
@@ -787,11 +815,13 @@ export default {
787 815
 
788 816
       project_list.forEach((res,index) => {
789 817
         this.cardList.forEach(e => {
790
-          if (e.isSelect && e.project_ids.indexOf(res.id) > -1) {
818
+          if (e.isSelect && e.project_ids.indexOf(res.id) > -1 && projectId.indexOf(res.id)==-1) {
819
+            projectId.push(res.id)
791 820
             price = price - res.price
792 821
             console.log(price);
793 822
             price = price.toFixed(2)
794 823
             isSelectCardList.push(res)
824
+            isSelectCardList=Array.from(new Set(isSelectCardList))
795 825
             card_data_info = {
796 826
               id: res.id,
797 827
               card_id: e.id

+ 6 - 1
src/pages/coupon/index.vue

@@ -52,6 +52,11 @@
52 52
           </template>
53 53
         </el-table-column>
54 54
         <el-table-column
55
+          prop="id"
56
+          label="用户ID"
57
+          width="120"
58
+        ></el-table-column>
59
+        <el-table-column
55 60
           prop="nickname"
56 61
           label="昵称"
57 62
           width="120"
@@ -86,7 +91,7 @@
86 91
 import api from "../../server/home";
87 92
 
88 93
 export default {
89
-    components: {},
94
+  components: {},
90 95
   data() {
91 96
     return {
92 97
       searckItem: "",

+ 1 - 2
src/pages/customerMan/details/index.vue

@@ -450,7 +450,7 @@ export default {
450 450
     .user-info {
451 451
       display: flex;
452 452
       flex-direction: column;
453
-      align-items: center;
453
+      // align-items: center;
454 454
       .title {
455 455
         width: 100%;
456 456
         display: flex;
@@ -485,7 +485,6 @@ export default {
485 485
           .info {
486 486
             display: flex;
487 487
             justify-content: space-between;
488
-
489 488
             .name {
490 489
               font-size: 14px;
491 490
             }

+ 1 - 0
src/pages/customerMan/index.vue

@@ -25,6 +25,7 @@
25 25
             </div>
26 26
           </template>
27 27
         </el-table-column>
28
+        <el-table-column prop="id" label="用户ID" width="120"></el-table-column>
28 29
         <el-table-column prop="nickname" label="昵称" width="120">
29 30
         </el-table-column>
30 31
         <el-table-column prop="mobile" label="联系电话" show-overflow-tooltip>

+ 1 - 0
src/pages/historicalOrder/index.vue

@@ -41,6 +41,7 @@
41 41
             </div>
42 42
           </template>
43 43
         </el-table-column>
44
+        <el-table-column prop="user_id" label="用户ID" width="120"></el-table-column>
44 45
         <el-table-column
45 46
           prop="nickname"
46 47
           label="昵称"