浏览代码

优化订单列表添加字段

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

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

@@ -763,9 +763,36 @@ export default {
763
         this.$message.error("不能选择相同的次卡");
763
         this.$message.error("不能选择相同的次卡");
764
         return
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
       this.cardList[index].isSelect = !this.cardList[index].isSelect
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
     isCardAdd () {
797
     isCardAdd () {
771
       let isSelectCardList = []
798
       let isSelectCardList = []
@@ -774,6 +801,7 @@ export default {
774
       let card_data = []
801
       let card_data = []
775
       let card_data_info = {}
802
       let card_data_info = {}
776
       console.log(price, 'price');
803
       console.log(price, 'price');
804
+      let projectId = []
777
       if (this.isSelectCoup.length > 0) {
805
       if (this.isSelectCoup.length > 0) {
778
         this.isSelectCoup.forEach(res => {
806
         this.isSelectCoup.forEach(res => {
779
           this.order_data.project_list.forEach(item => {
807
           this.order_data.project_list.forEach(item => {
@@ -787,11 +815,13 @@ export default {
787
 
815
 
788
       project_list.forEach((res,index) => {
816
       project_list.forEach((res,index) => {
789
         this.cardList.forEach(e => {
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
             price = price - res.price
820
             price = price - res.price
792
             console.log(price);
821
             console.log(price);
793
             price = price.toFixed(2)
822
             price = price.toFixed(2)
794
             isSelectCardList.push(res)
823
             isSelectCardList.push(res)
824
+            isSelectCardList=Array.from(new Set(isSelectCardList))
795
             card_data_info = {
825
             card_data_info = {
796
               id: res.id,
826
               id: res.id,
797
               card_id: e.id
827
               card_id: e.id

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

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

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

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

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

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

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

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