Browse Source

加入课程组确认提示

1
mo 3 năm trước cách đây
mục cha
commit
0e4862064d
1 tập tin đã thay đổi với 25 bổ sung9 xóa
  1. 25 9
      src/views/vipClass/vipDetail/components/vipStudentList.vue

+ 25 - 9
src/views/vipClass/vipDetail/components/vipStudentList.vue

@@ -671,7 +671,10 @@ export default {
     clearCom() {
       // this.deleteList = [];
       this.$set(this, "deleteList", []);
-      this.$refs.maskStudentList.clearSelection();
+      if (this.$refs.maskStudentList) {
+        this.$refs.maskStudentList.clearSelection();
+      }
+
       // this.$refs.addCompound.isLook = false;
     },
     getTemplateRow(index, row) {
@@ -682,8 +685,9 @@ export default {
         this.$message.error("请选择一名学生");
         return;
       }
-      console.log(this.deleteList);
+    let str = ''
       let arr = this.deleteList.map((stu) => {
+        str += stu.userName+','
         return {
           vipGroupId: this.id,
           studentId: stu.id,
@@ -691,6 +695,7 @@ export default {
           onlineClassesUnitPrice: stu.onlineClassesUnitPrice,
         };
       });
+      str=str.slice(0,str.length-1)
       // return;
       // let offlineClassesUnitPrice, onlineClassesUnitPrice;
       // this.maskStudentList.forEach((stu) => {
@@ -711,13 +716,24 @@ export default {
       //     offlineClassesUnitPrice,
       //   },
       // ]
-      addVipGroupStudents(arr).then((res) => {
-        if (res.code == 200) {
-          this.$message.success("添加成功");
-          this.getStudents();
-          this.clearCom();
-        }
-      });
+
+      this.$confirm(`是否将${str}加入课程组?`, "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(async (res) => {
+          addVipGroupStudents(arr).then((res) => {
+            if (res.code == 200) {
+              this.$message.success("添加成功");
+              this.getStudents();
+              this.clearCom();
+            }
+          });
+        })
+        .catch((e) => {
+          console.log(e);
+        });
     },
     stopCourse(scope) {
       this.$confirm("是否休学?", "提示", {