Quellcode durchsuchen

flex:信息推送-学时推送

Tang vor 3 Jahren
Ursprung
Commit
6e1298c1f1

+ 23 - 1
src/views/education/classManageMent/classHours/index.vue

@@ -66,7 +66,10 @@
         >
       </div>
       <div>
-        <el-button size="small" v-if="statusShow.indexOf(2) !== -1"
+        <el-button
+          size="small"
+          v-if="statusShow.indexOf(2) !== -1"
+          @click="uploadXS"
           >官方学时推送</el-button
         >
         <span
@@ -325,6 +328,25 @@ export default {
     this.getInitList();
   },
   methods: {
+    uploadXS() {
+      if (!this.$refs.tableList.allCheckData.length) {
+        this.$message.warning("请勾选需要学时信息推送的学员");
+        return;
+      }
+      let arr = this.$refs.tableList.allCheckData.map((item) => {
+        return {
+          userId: item.userId,
+          gradeId: this.$route.query.id,
+        };
+      });
+      this.$api.editGradeUsereditpushPeriod(arr).then((res) => {
+        if (res.code === 200) {
+          this.$message.success("推送成功");
+          this.search();
+          this.$refs.tableList.clearMoreActive();
+        }
+      });
+    },
     changeBTN(int) {
       this.activeBtn = int;
       this.search(6);

+ 28 - 7
src/views/education/classManageMent/studentMenu/index.vue

@@ -16,7 +16,10 @@
         >
       </div>
       <div>
-        <el-button size="small" v-if="statusShow.indexOf(1) !== -1"
+        <el-button
+          size="small"
+          v-if="statusShow.indexOf(1) !== -1"
+          @click="uploadGF"
           >官方信息推送</el-button
         >
         <span
@@ -483,7 +486,6 @@
 import tableList from "@/components/tableList";
 import pagination from "@/components/pagination";
 export default {
-  // name: "StudentMenu",
   components: { tableList, pagination },
   data() {
     return {
@@ -638,7 +640,7 @@ export default {
         },
       ],
       listData: {},
-      finishStatusOS:'',
+      finishStatusOS: "",
       tableData: [], //表单数据
       total: 0, //一共多少条
       dialogVisible: false,
@@ -693,6 +695,25 @@ export default {
     this.search();
   },
   methods: {
+    uploadGF() {
+      if (!this.$refs.tableList.allCheckData.length) {
+        this.$message.warning("请勾选需要官方信息推送的学员");
+        return;
+      }
+      let arr = this.$refs.tableList.allCheckData.map((item) => {
+        return {
+          userId: item.userId,
+          gradeId: this.$route.query.id,
+        };
+      });
+      this.$api.editGradeUsereditpushInfo(arr).then((res) => {
+        if (res.code === 200) {
+          this.$message.success("推送成功");
+          this.search();
+          this.$refs.tableList.clearMoreActive()
+        }
+      });
+    },
     getInfos(e) {
       console.log(e);
     },
@@ -755,9 +776,9 @@ export default {
         id: ars,
       };
       if (this.stice === 1) {
-        if(this.finishStatusOS !== 0 && this.finishStatusOS !== 1 ){
-          this.$message.warning("请选择是否")
-          return
+        if (this.finishStatusOS !== 0 && this.finishStatusOS !== 1) {
+          this.$message.warning("请选择是否");
+          return;
         }
         data.finishStatus = this.finishStatusOS;
       }
@@ -784,7 +805,7 @@ export default {
         this.allCheckList = JSON.parse(
           JSON.stringify(this.$refs.tableList.allCheckData)
         );
-        this.finishStatusOS = ''
+        this.finishStatusOS = "";
         this.dialogVisible = true;
       }
       if (int === 2) {