Browse Source

是否网课

Changpeng Duan 4 years ago
parent
commit
fa881c32fb
3 changed files with 40 additions and 16 deletions
  1. 4 1
      online/src/page/mainpage.vue
  2. 2 0
      pc/src/views/Member.vue
  3. 34 15
      pc/src/views/courseEdit.vue

+ 4 - 1
online/src/page/mainpage.vue

@@ -349,6 +349,9 @@
                         that.duId = parseInt(json.DuInfo.DuId);
                         that.DpName = json.DuInfo.DpName;
                         console.log('that.duId:' + that.duId);
+                        if(that.InClass == 1){
+                            that.AddHrSensorsUpdate(that.sn);
+                        }
                     } else {
                         that.$message.error(json.Memo);
                     }
@@ -716,7 +719,7 @@
                     let json = res;
                     if (json.Code == 0) {
                         that.HrId = json.HrId;
-                        that.Toast('心率带已连接在线课程', 'success');
+                        // that.Toast('心率带已连接在线课程', 'success');
                     } else {
                         that.HrId = '';
                         that.Toast(json.Memo);

+ 2 - 0
pc/src/views/Member.vue

@@ -1286,6 +1286,8 @@
                     start: that.start,//
                     tableMax: 20,//
                 };
+                that.allTableData = [];
+                that.recordsTotal = 0;
                 let postdata = qs.stringify(param);
                 VipUserListQuery(postdata).then(res => {
                     let json = res;

+ 34 - 15
pc/src/views/courseEdit.vue

@@ -38,7 +38,7 @@
                 <el-button @click="addFinishMember">添加上课会员</el-button>
                 <el-button @click="addTempMember" type="warning">添加临时会员</el-button>
                 <el-button @click="addCrossMember" type="primary">添加跨店会员</el-button>
-                <el-button @click="" type="warning">全部网课</el-button>
+                <el-button @click="allSetOnline" type="warning">全部网课</el-button>
             </div>
         </div>
         <div class="table">
@@ -225,14 +225,14 @@
                         sortable
                 >
                     <template slot-scope="scope">
-                            <el-checkbox label="网课"
-                                         v-model="scope.row.IsOnline"
-                                         :disabled="scope.row.BindId > 0"
-                                         :checked="scope.row.IsOnline"
-                                         name="type"
-                                         true-label="1"
-                                         false-label="0"
-                            ></el-checkbox>
+                        <el-checkbox label="网课"
+                                     v-model="scope.row.IsOnline"
+                                     ::checked="scope.row.IsOnline"
+                                     :disabled="scope.row.BindId > 0 || scope.row.HrSubmitFlag == 1"
+                                     name="type"
+                                     true-label=1
+                                     false-label="0"
+                        ></el-checkbox>
                     </template>
                 </el-table-column>
                 <el-table-column
@@ -265,6 +265,7 @@
                                        @click="getClassOverDetailDel(scope.row)">
                                 删除
                             </el-button>
+                            &nbsp;
                             <em v-if="FinishClass != 3">
                                 <el-button type="warning" round
                                            v-if="scope.row.Status == 1 || scope.row.Status == 3 && FinishClass == 2 "
@@ -281,6 +282,7 @@
                                        @click="getClassOverTempDel(scope.row)">
                                 删除
                             </el-button>
+                            &nbsp;
                             <span v-if="FinishClass != 3 && scope.row.IsTmpUser == 1">
                                 <el-button type="warning" round
                                            v-if="scope.row.Status == 1 || scope.row.Status == 3 && FinishClass == 2 "
@@ -793,7 +795,6 @@
                 let that = this;
                 // 没绑心率带不能开课,预约未到的不管他
                 for (var i = 0; i < this.tableData.length; i++) {
-                    console.log(this.tableData[i].IsOnline);
                     if (this.tableData[i].Sn == 0 && this.tableData[i].Status != 2 && this.tableData[i].IsOnline != 1) {
                         that.$message.error("会员" + this.tableData[i].Name + '没绑心率带,不能开课');
                         return false
@@ -841,7 +842,7 @@
                         birthday: row.Birthday,
                         is_tmp_user: row.IsTmpUser,
                         is_private: row.IsPrivate,
-                        isOnline: row.IsOnline,
+                        isOnline: parseInt(row.IsOnline),
                     }
                 }
                 // 确认上课
@@ -1265,6 +1266,9 @@
                     start: 1,//
                     tableMax: 9999,//
                 };
+                that.allTableData = [];
+                that.tableData = [];
+                that.recordsTotal = 0;
                 let postdata = qs.stringify(param);
                 ClassOverDetailListQuery(postdata).then(res => {
                     let json = res;
@@ -1279,6 +1283,7 @@
                                     if (item.Status != 2) {
                                         that.BeginState = false;
                                     }
+                                    item.IsOnline =   item.IsOnline.toString()
                                 });
                             }
                             // 分队处理
@@ -1305,7 +1310,6 @@
                                     }
                                 });
                             }
-                            console.log(json.Rs);
                             that.allTableData = json.Rs;
                             that.recordsTotal = json.Rs.length;
                         } else {
@@ -1423,8 +1427,7 @@
             getClassDetailAndSnAdd(row) {
                 let begin_time = parseInt(new Date().valueOf() / 1000);
                 let duRs = [];
-                console.log(row);
-                if (!row.Sn && !row.IsOnline) {
+                if (!row.Sn && row.IsOnline == 0) {
                     this.$message.error(row.Name + '没有绑定心率带');
                     return false
                 }
@@ -1478,7 +1481,23 @@
                     return 'yellow-row';
                 }
                 return '';
-            }
+            },
+            // 全部网课todo
+            allSetOnline() {
+                let that = this;
+                let row = '';
+                that.tableData.map(function (item) {
+                    row = item;
+                    console.log(row);
+                    // 没有bindID的 且没有被禁用的 选中
+                    if (row.BindId == 0 && row.HrSubmitFlag == 0) {
+                        row.IsOnline = "1";
+                    }else{
+                        // row.IsOnline = 0;
+                    }
+                })
+            },
+            // 刷新列表要清空先 todo
         },
         watch: {
             $route(to) {