Browse Source

核销次卡

yuhao 1 year ago
parent
commit
424c786b9a

+ 163 - 2
src/pages/customerMan/myOrder/index.vue

@@ -146,9 +146,11 @@
146
               ></el-table-column>
146
               ></el-table-column>
147
               <el-table-column prop="status" label="状态" show-overflow-tooltip>
147
               <el-table-column prop="status" label="状态" show-overflow-tooltip>
148
                 <template slot-scope="scope">
148
                 <template slot-scope="scope">
149
-                  <div :class="'color' + scope.row.status">
149
+                  <div :class="'colorB' + scope.row.status">
150
                     {{
150
                     {{
151
-                      scope.row.status == -1
151
+                      scope.row.status == -2
152
+                        ? "已注销"
153
+                        : scope.row.status == -1
152
                         ? "已过期"
154
                         ? "已过期"
153
                         : scope.row.status == -0
155
                         : scope.row.status == -0
154
                         ? "已使用"
156
                         ? "已使用"
@@ -157,6 +159,18 @@
157
                   </div>
159
                   </div>
158
                 </template>
160
                 </template>
159
               </el-table-column>
161
               </el-table-column>
162
+              <el-table-column
163
+                prop=""
164
+                label="操作"
165
+                width="100"
166
+                show-overflow-tooltip
167
+              >
168
+                <template slot-scope="scope" v-if="scope.row.status != -2">
169
+                  <div class="cancleCoupon" @click.stop="cancleCard(scope.row)">
170
+                    操作
171
+                  </div>
172
+                </template>
173
+              </el-table-column>
160
             </el-table>
174
             </el-table>
161
 
175
 
162
             <div class="pagin">
176
             <div class="pagin">
@@ -436,6 +450,30 @@ type: "全额券" -->
436
         </div>
450
         </div>
437
       </div>
451
       </div>
438
     </mine-pupop>
452
     </mine-pupop>
453
+    <!-- 操作核销次卡 -->
454
+    <mine-pupop :show="isCancelCard">
455
+      <div class="CancelCard">
456
+        <div class="image">
457
+          <img
458
+            src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/delete.png"
459
+            alt
460
+            @click="closeCardPop"
461
+          />
462
+        </div>
463
+        <div class="title">核销次卡</div>
464
+        <div class="CardName">
465
+          <div class="one">次卡名称:</div>
466
+          <div>{{ cancelCardInfo.card_name }}</div>
467
+        </div>
468
+        <div class="cardRemark">
469
+          <div class="one">备注信息:</div>
470
+          <el-input v-model.trim="cardRemark"></el-input>
471
+        </div>
472
+        <div class="radio">
473
+          <button class="affirmBtn" @click="checkCard">确定</button>
474
+        </div>
475
+      </div>
476
+    </mine-pupop>
439
   </div>
477
   </div>
440
 </template>
478
 </template>
441
 
479
 
@@ -504,6 +542,9 @@ export default {
504
       cancelCouponInfo: "", //核销优惠券名称
542
       cancelCouponInfo: "", //核销优惠券名称
505
       couponRemark: "", //核销优惠券备注信息
543
       couponRemark: "", //核销优惠券备注信息
506
       refresh: false, //刷新页面数据
544
       refresh: false, //刷新页面数据
545
+      isCancelCard: false, //核销次卡界面
546
+      cancelCardInfo: "", //核销次卡名称
547
+      cardRemark: "", //核销优惠券备注信息
507
     };
548
     };
508
   },
549
   },
509
   computed: {},
550
   computed: {},
@@ -558,6 +599,35 @@ export default {
558
           }
599
           }
559
         });
600
         });
560
     },
601
     },
602
+    // 打开次卡弹窗
603
+    cancleCard(e) {
604
+      this.isCancelCard = true;
605
+      this.cancelCardInfo = e;
606
+    },
607
+    // 关闭次卡弹窗
608
+    closeCardPop() {
609
+      this.isCancelCard = false;
610
+    },
611
+    // 核销次卡
612
+    checkCard() {
613
+      if (this.cardRemark == "") {
614
+        this.$message.error("请填写备注信息");
615
+        return;
616
+      }
617
+      api
618
+        .checkCard({
619
+          id: this.cancelCardInfo.id,
620
+          remark: this.cardRemark,
621
+        })
622
+        .then((res) => {
623
+          if (res.code == 200) {
624
+            this.$message.success("核销成功");
625
+            this.isCancelCard = false;
626
+            // 刷新次卡列表
627
+            this.getCardList();
628
+          }
629
+        });
630
+    },
561
     // 阻止修改次卡时间时键盘弹出
631
     // 阻止修改次卡时间时键盘弹出
562
     forbid() {
632
     forbid() {
563
       //禁止软键盘弹出
633
       //禁止软键盘弹出
@@ -574,6 +644,14 @@ export default {
574
     },
644
     },
575
     // 修改次卡时间
645
     // 修改次卡时间
576
     amendCardTime(e) {
646
     amendCardTime(e) {
647
+      console.log(e);
648
+      if (e.status == -2) {
649
+        this.$message({
650
+          message: "该次卡已注销",
651
+          type: "error",
652
+        });
653
+        return;
654
+      }
577
       this.isAmend = true;
655
       this.isAmend = true;
578
       this.amendCardInfo = e;
656
       this.amendCardInfo = e;
579
       console.log(e);
657
       console.log(e);
@@ -624,6 +702,13 @@ export default {
624
     },
702
     },
625
     //次卡订单详情
703
     //次卡订单详情
626
     openDetail(row, column, event) {
704
     openDetail(row, column, event) {
705
+      if (row.status == -2) {
706
+        this.$message({
707
+          message: "该次卡已注销",
708
+          type: "error",
709
+        });
710
+        return;
711
+      }
627
       this.isPore = true;
712
       this.isPore = true;
628
       api.cardInfo({ id: row.id }).then((res) => {
713
       api.cardInfo({ id: row.id }).then((res) => {
629
         if (res.code == 200) {
714
         if (res.code == 200) {
@@ -846,6 +931,18 @@ export default {
846
 .colorA0 {
931
 .colorA0 {
847
   color: #61d09d;
932
   color: #61d09d;
848
 }
933
 }
934
+.colorB0 {
935
+  color: #3ef3ed;
936
+}
937
+.colorB1 {
938
+  color: #61d09d;
939
+}
940
+.colorB-1 {
941
+  color: #fc3019;
942
+}
943
+.colorB-2 {
944
+  color: #333;
945
+}
849
 .priceColor {
946
 .priceColor {
850
   color: #ff3007;
947
   color: #ff3007;
851
 }
948
 }
@@ -1105,6 +1202,70 @@ export default {
1105
     }
1202
     }
1106
   }
1203
   }
1107
 }
1204
 }
1205
+// 核销次卡界面
1206
+.CancelCard {
1207
+  width: 440px;
1208
+  height: 300px;
1209
+  background-color: #fff;
1210
+  border-radius: 12px;
1211
+  padding: 15px;
1212
+  .image {
1213
+    height: 30px;
1214
+    width: 30px;
1215
+    img {
1216
+      width: 100%;
1217
+    }
1218
+  }
1219
+  .title {
1220
+    text-align: center;
1221
+    font-weight: 700;
1222
+    font-size: 16px;
1223
+    margin-bottom: 40px;
1224
+  }
1225
+  .CardName {
1226
+    display: flex;
1227
+    margin-bottom: 40px;
1228
+    .one {
1229
+      font-weight: 600;
1230
+      margin-right: 10px;
1231
+      width: 90px;
1232
+    }
1233
+  }
1234
+  .cardRemark {
1235
+    display: flex;
1236
+    align-items: center;
1237
+    .one {
1238
+      margin-right: 22px;
1239
+      font-weight: 600;
1240
+      width: 90px;
1241
+    }
1242
+    .el-input {
1243
+      width: 300px;
1244
+      /deep/.el-input__inner:focus {
1245
+        // el-input输入时设置边框颜色
1246
+        border: #fa7d22 1px solid;
1247
+      }
1248
+    }
1249
+  }
1250
+  .radio {
1251
+    width: 100%;
1252
+    display: flex;
1253
+    justify-content: space-evenly;
1254
+    button {
1255
+      width: 176px;
1256
+      height: 28px;
1257
+      border-radius: 14px;
1258
+      background-color: #fff;
1259
+      border: none;
1260
+      margin-top: 50px;
1261
+    }
1262
+    .affirmBtn {
1263
+      background-color: #fa7d22;
1264
+      color: #fff;
1265
+      margin-left: 15px;
1266
+    }
1267
+  }
1268
+}
1108
 .expir_time {
1269
 .expir_time {
1109
   color: #3115cc;
1270
   color: #3115cc;
1110
 }
1271
 }

+ 166 - 3
src/pages/payUser/myOrder/index.vue

@@ -147,9 +147,11 @@
147
               ></el-table-column>
147
               ></el-table-column>
148
               <el-table-column prop="status" label="状态" show-overflow-tooltip>
148
               <el-table-column prop="status" label="状态" show-overflow-tooltip>
149
                 <template slot-scope="scope">
149
                 <template slot-scope="scope">
150
-                  <div :class="'color' + scope.row.status">
150
+                  <div :class="'colorB' + scope.row.status">
151
                     {{
151
                     {{
152
-                      scope.row.status == -1
152
+                      scope.row.status == -2
153
+                        ? "已注销"
154
+                        : scope.row.status == -1
153
                         ? "已过期"
155
                         ? "已过期"
154
                         : scope.row.status == -0
156
                         : scope.row.status == -0
155
                         ? "已使用"
157
                         ? "已使用"
@@ -158,6 +160,18 @@
158
                   </div>
160
                   </div>
159
                 </template>
161
                 </template>
160
               </el-table-column>
162
               </el-table-column>
163
+              <el-table-column
164
+                prop=""
165
+                label="操作"
166
+                width="100"
167
+                show-overflow-tooltip
168
+              >
169
+                <template slot-scope="scope" v-if="scope.row.status != -2">
170
+                  <div class="cancleCoupon" @click.stop="cancleCard(scope.row)">
171
+                    操作
172
+                  </div>
173
+                </template>
174
+              </el-table-column>
161
             </el-table>
175
             </el-table>
162
 
176
 
163
             <div class="pagin">
177
             <div class="pagin">
@@ -455,7 +469,9 @@ type: "全额券" -->
455
             </div>
469
             </div>
456
           </div>
470
           </div>
457
         </div>
471
         </div>
458
-        <div v-if='cardInfo.card_type == 1' class="confirm" @click="confirm">确定</div>
472
+        <div v-if="cardInfo.card_type == 1" class="confirm" @click="confirm">
473
+          确定
474
+        </div>
459
       </div>
475
       </div>
460
     </mine-pupop>
476
     </mine-pupop>
461
     <!-- 修改次卡时间 -->
477
     <!-- 修改次卡时间 -->
@@ -515,12 +531,37 @@ type: "全额券" -->
515
         </div>
531
         </div>
516
       </div>
532
       </div>
517
     </mine-pupop>
533
     </mine-pupop>
534
+    <!-- 操作核销次卡 -->
535
+    <mine-pupop :show="isCancelCard">
536
+      <div class="CancelCard">
537
+        <div class="image">
538
+          <img
539
+            src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/pad_clerk/icon/slices/delete.png"
540
+            alt
541
+            @click="closeCardPop"
542
+          />
543
+        </div>
544
+        <div class="title">核销次卡</div>
545
+        <div class="CardName">
546
+          <div class="one">次卡名称:</div>
547
+          <div>{{ cancelCardInfo.card_name }}</div>
548
+        </div>
549
+        <div class="cardRemark">
550
+          <div class="one">备注信息:</div>
551
+          <el-input v-model.trim="cardRemark"></el-input>
552
+        </div>
553
+        <div class="radio">
554
+          <button class="affirmBtn" @click="checkCard">确定</button>
555
+        </div>
556
+      </div>
557
+    </mine-pupop>
518
   </div>
558
   </div>
519
 </template>
559
 </template>
520
 
560
 
521
 <script>
561
 <script>
522
 import api from "../../../server/home";
562
 import api from "../../../server/home";
523
 import minePupop from "../../../components/minePupop/index.vue";
563
 import minePupop from "../../../components/minePupop/index.vue";
564
+import { log } from "console";
524
 
565
 
525
 export default {
566
 export default {
526
   components: {
567
   components: {
@@ -584,6 +625,9 @@ export default {
584
       cancelCouponInfo: "", //核销优惠券名称
625
       cancelCouponInfo: "", //核销优惠券名称
585
       couponRemark: "", //核销优惠券备注信息
626
       couponRemark: "", //核销优惠券备注信息
586
       refresh: false, //刷新页面数据
627
       refresh: false, //刷新页面数据
628
+      isCancelCard: false, //核销次卡界面
629
+      cancelCardInfo: "", //核销次卡名称
630
+      cardRemark: "", //核销优惠券备注信息
587
     };
631
     };
588
   },
632
   },
589
   computed: {},
633
   computed: {},
@@ -636,6 +680,35 @@ export default {
636
           }
680
           }
637
         });
681
         });
638
     },
682
     },
683
+    // 打开次卡弹窗
684
+    cancleCard(e) {
685
+      this.isCancelCard = true;
686
+      this.cancelCardInfo = e;
687
+    },
688
+    // 关闭次卡弹窗
689
+    closeCardPop() {
690
+      this.isCancelCard = false;
691
+    },
692
+    // 核销次卡
693
+    checkCard() {
694
+      if (this.cardRemark == "") {
695
+        this.$message.error("请填写备注信息");
696
+        return;
697
+      }
698
+      api
699
+        .checkCard({
700
+          id: this.cancelCardInfo.id,
701
+          remark: this.cardRemark,
702
+        })
703
+        .then((res) => {
704
+          if (res.code == 200) {
705
+            this.$message.success("核销成功");
706
+            this.isCancelCard = false;
707
+            // 刷新次卡列表
708
+            this.getCardList();
709
+          }
710
+        });
711
+    },
639
     // 阻止修改次卡时间时键盘弹出
712
     // 阻止修改次卡时间时键盘弹出
640
     forbid() {
713
     forbid() {
641
       //禁止软键盘弹出
714
       //禁止软键盘弹出
@@ -652,6 +725,13 @@ export default {
652
     },
725
     },
653
     // 修改次卡时间
726
     // 修改次卡时间
654
     amendCardTime(e) {
727
     amendCardTime(e) {
728
+      if (e.status == -2) {
729
+        this.$message({
730
+          message: "该次卡已注销",
731
+          type: "error",
732
+        });
733
+        return;
734
+      }
655
       this.isAmend = true;
735
       this.isAmend = true;
656
       this.amendCardInfo = e;
736
       this.amendCardInfo = e;
657
       console.log(e);
737
       console.log(e);
@@ -702,6 +782,13 @@ export default {
702
     },
782
     },
703
     //次卡订单详情
783
     //次卡订单详情
704
     openDetail(row, column, event) {
784
     openDetail(row, column, event) {
785
+      if (row.status == -2) {
786
+        this.$message({
787
+          message: "该次卡已注销",
788
+          type: "error",
789
+        });
790
+        return;
791
+      }
705
       this.isPore = true;
792
       this.isPore = true;
706
       api.cardInfo({ id: row.id }).then((res) => {
793
       api.cardInfo({ id: row.id }).then((res) => {
707
         if (res.code == 200) {
794
         if (res.code == 200) {
@@ -963,6 +1050,18 @@ export default {
963
 .colorA0 {
1050
 .colorA0 {
964
   color: #61d09d;
1051
   color: #61d09d;
965
 }
1052
 }
1053
+.colorB0 {
1054
+  color: #3ef3ed;
1055
+}
1056
+.colorB1 {
1057
+  color: #61d09d;
1058
+}
1059
+.colorB-1 {
1060
+  color: #fc3019;
1061
+}
1062
+.colorB-2 {
1063
+  color: #333;
1064
+}
966
 .priceColor {
1065
 .priceColor {
967
   color: #ff3007;
1066
   color: #ff3007;
968
 }
1067
 }
@@ -1222,6 +1321,70 @@ export default {
1222
     }
1321
     }
1223
   }
1322
   }
1224
 }
1323
 }
1324
+// 核销次卡界面
1325
+.CancelCard {
1326
+  width: 440px;
1327
+  height: 300px;
1328
+  background-color: #fff;
1329
+  border-radius: 12px;
1330
+  padding: 15px;
1331
+  .image {
1332
+    height: 30px;
1333
+    width: 30px;
1334
+    img {
1335
+      width: 100%;
1336
+    }
1337
+  }
1338
+  .title {
1339
+    text-align: center;
1340
+    font-weight: 700;
1341
+    font-size: 16px;
1342
+    margin-bottom: 40px;
1343
+  }
1344
+  .CardName {
1345
+    display: flex;
1346
+    margin-bottom: 40px;
1347
+    .one {
1348
+      font-weight: 600;
1349
+      margin-right: 10px;
1350
+      width: 90px;
1351
+    }
1352
+  }
1353
+  .cardRemark {
1354
+    display: flex;
1355
+    align-items: center;
1356
+    .one {
1357
+      margin-right: 22px;
1358
+      font-weight: 600;
1359
+      width: 90px;
1360
+    }
1361
+    .el-input {
1362
+      width: 300px;
1363
+      /deep/.el-input__inner:focus {
1364
+        // el-input输入时设置边框颜色
1365
+        border: #fa7d22 1px solid;
1366
+      }
1367
+    }
1368
+  }
1369
+  .radio {
1370
+    width: 100%;
1371
+    display: flex;
1372
+    justify-content: space-evenly;
1373
+    button {
1374
+      width: 176px;
1375
+      height: 28px;
1376
+      border-radius: 14px;
1377
+      background-color: #fff;
1378
+      border: none;
1379
+      margin-top: 50px;
1380
+    }
1381
+    .affirmBtn {
1382
+      background-color: #fa7d22;
1383
+      color: #fff;
1384
+      margin-left: 15px;
1385
+    }
1386
+  }
1387
+}
1225
 .expir_time {
1388
 .expir_time {
1226
   color: #3115cc;
1389
   color: #3115cc;
1227
 }
1390
 }

+ 4 - 0
src/server/home.js

@@ -309,4 +309,8 @@ export default class Home {
309
   static syncErpOrder(params) {
309
   static syncErpOrder(params) {
310
     return $http.post(url.syncErpOrder, params)
310
     return $http.post(url.syncErpOrder, params)
311
   }
311
   }
312
+  // 同步erp订单
313
+  static checkCard(params) {
314
+    return $http.post(url.checkCard, params)
315
+  }
312
 }
316
 }

+ 4 - 1
src/server/urls.js

@@ -200,5 +200,8 @@ export default {
200
   checkCoupon: '/v2/pad/coupon/check',
200
   checkCoupon: '/v2/pad/coupon/check',
201
 
201
 
202
   // 同步erp订单
202
   // 同步erp订单
203
-  syncErpOrder:'/v2/pad/order/sync_erp_order'
203
+  syncErpOrder:'/v2/pad/order/sync_erp_order',
204
+
205
+  // 核销次卡
206
+  checkCard:'/v2/pad/card/logoff'
204
 }
207
 }