lex пре 1 година
родитељ
комит
64ef01b609

+ 47 - 16
src/views/resetTeaming/components/giveMemberList.vue

@@ -65,6 +65,13 @@
       style="margin-bottom: 20px"
       >激活云教练</el-button
     >
+    <el-button
+      type="primary"
+      style="margin-bottom: 20px;margin-left: 12px;"
+      v-permission="'cloudTeacherOrder/cancelInactive'"
+      @click="resetPay()"
+      >取消资格</el-button
+    >
 
     <div class="tableWrap">
       <el-table
@@ -74,7 +81,8 @@
         ref="multipleTable"
         @selection-change="handleSelectionChange"
       >
-        <el-table-column type="selection" width="55"> </el-table-column>
+        <el-table-column type="selection" :selectable="isDisabled" width="55">
+        </el-table-column>
         <el-table-column
           align="center"
           prop="studentId"
@@ -135,7 +143,7 @@
             {{ scope.row.operateTime }}
           </template>
         </el-table-column>
-        <el-table-column align="center" label="操作">
+        <!-- <el-table-column align="center" label="操作">
           <template slot-scope="scope">
             <div>
               <el-button
@@ -143,11 +151,11 @@
                 v-if="scope.row.status == 1"
                 v-permission="'cloudTeacherOrder/cancelInactive'"
                 @click="resetPay(scope.row)"
-                >取消激活</el-button
+                >取消资格</el-button
               >
             </div>
           </template>
-        </el-table-column>
+        </el-table-column> -->
       </el-table>
       <pagination
         sync
@@ -174,13 +182,13 @@
     </el-dialog>
 
     <el-dialog
-      title="取消激活"
+      title="取消资格"
       :visible.sync="cancelCloudStatus"
       width="600px"
       v-if="cancelCloudStatus"
       append-to-body
     >
-      <el-form :model="reson" label-width="100px" ref="form">
+      <el-form :model="reson" label-width="100px" prop="cancelReason">
         <el-form-item
           prop="cancelReason"
           label="取消原因"
@@ -272,6 +280,15 @@ export default {
         this.tableList = res.data.rows;
       } catch (e) {}
     },
+    // 是否允许批量调整
+    isDisabled(row, index) {
+      // || !row.isCallNames
+      if (row.status !== 1) {
+        return false;
+      } else {
+        return true;
+      }
+    },
     handleSelectionChange(val) {
       this.selectStudentList = val || [];
     },
@@ -290,19 +307,33 @@ export default {
       }
       this.giveMemberVisible = true;
     },
-    resetPay(row) {
+    resetPay() {
+      if (this.selectStudentList.length <= 0) {
+        this.$message.error("至少选择一名学生");
+        return;
+      }
       this.cancelCloudStatus = true;
-      this.reson.ids = row.cloudTeacherOrderId;
+      const ids = [];
+      this.selectStudentList.forEach(item => {
+        ids.push(item.cloudTeacherOrderId);
+      });
+      this.reson.ids = ids.join(",");
     },
     async submitDateReset() {
-      try {
-        await cancelInactive(this.reson);
-        this.$message.success("取消激活成功");
-        this.getList();
-      } catch (e) {
-        //
-        console.log(e, "e");
-      }
+      this.$refs["cancelCloudForm"].validate(async flag => {
+        if (flag) {
+          try {
+            await cancelInactive(this.reson);
+            this.$message.success("取消资格成功");
+            this.cancelCloudStatus = false;
+            this.reson.cancelReason = "";
+            this.getList();
+          } catch (e) {
+            //
+            console.log(e, "e");
+          }
+        }
+      });
     }
   },
   filters: {

+ 50 - 16
src/views/studentManager/studentGroupPractice.vue

@@ -54,6 +54,13 @@
         style="margin-bottom: 20px"
         >激活云教练</el-button
       >
+      <el-button
+        type="primary"
+        style="margin-bottom: 20px;margin-left: 12px;"
+        v-permission="'cloudTeacherOrder/cancelInactive'"
+        @click="resetPay"
+        >取消资格</el-button
+      >
 
       <div class="tableWrap">
         <el-table
@@ -63,7 +70,11 @@
           ref="multipleTable"
           @selection-change="handleSelectionChange"
         >
-          <el-table-column type="selection" width="55"> </el-table-column>
+          <el-table-column
+            type="selection"
+            :selectable="isDisabled"
+            width="55"
+          ></el-table-column>
           <el-table-column
             align="center"
             prop="studentId"
@@ -114,7 +125,7 @@
               {{ scope.row.operateTime }}
             </template>
           </el-table-column>
-          <el-table-column align="center" label="操作">
+          <!-- <el-table-column align="center" label="操作">
             <template slot-scope="scope">
               <div>
                 <el-button
@@ -122,11 +133,11 @@
                   v-if="scope.row.status == 1"
                   v-permission="'cloudTeacherOrder/cancelInactive'"
                   @click="resetPay(scope.row)"
-                  >取消激活</el-button
+                  >取消资格</el-button
                 >
               </div>
             </template>
-          </el-table-column>
+          </el-table-column> -->
         </el-table>
         <pagination
           sync
@@ -154,13 +165,13 @@
     </el-dialog>
 
     <el-dialog
-      title="取消激活"
+      title="取消资格"
       :visible.sync="cancelCloudStatus"
       width="600px"
       v-if="cancelCloudStatus"
       append-to-body
     >
-      <el-form :model="reson" label-width="100px" ref="form">
+      <el-form ref="cancelCloudForm" :model="reson" label-width="100px">
         <el-form-item
           prop="cancelReason"
           label="取消原因"
@@ -244,6 +255,15 @@ export default {
       }
       queryInactive;
     },
+    // 是否允许批量调整
+    isDisabled(row, index) {
+      // || !row.isCallNames
+      if (row.status !== 1) {
+        return false;
+      } else {
+        return true;
+      }
+    },
     handleSelectionChange(val) {
       this.selectStudentList = val || [];
     },
@@ -262,19 +282,33 @@ export default {
       }
       this.giveMemberVisible = true;
     },
-    resetPay(row) {
+    resetPay() {
+      if (this.selectStudentList.length <= 0) {
+        this.$message.error("至少选择一名学生");
+        return;
+      }
       this.cancelCloudStatus = true;
-      this.reson.ids = row.cloudTeacherOrderId;
+      const ids = [];
+      this.selectStudentList.forEach(item => {
+        ids.push(item.cloudTeacherOrderId);
+      });
+      this.reson.ids = ids.join(",");
     },
     async submitDateReset() {
-      try {
-        await cancelInactive(this.reson);
-        this.$message.success("取消激活成功");
-        this.getList();
-      } catch (e) {
-        //
-        console.log(e, "e");
-      }
+      this.$refs["cancelCloudForm"].validate(async flag => {
+        if (flag) {
+          try {
+            await cancelInactive(this.reson);
+            this.$message.success("取消资格成功");
+            this.cancelCloudStatus = false;
+            this.reson.cancelReason = "";
+            this.getList();
+          } catch (e) {
+            //
+            console.log(e, "e");
+          }
+        }
+      });
     }
   },
   filters: {