Bladeren bron

0714Commit

zhengwei 4 jaren geleden
bovenliggende
commit
0c32f17930

+ 13 - 2
pc/src/Global.js

@@ -319,6 +319,7 @@ turnResToOptionByCoach = function (data) {
     });
     return ids
 };
+
 turnResToOptionByUsers = function (data) {
     if (!data) return false
     let ids = data.map(item => {
@@ -357,8 +358,6 @@ turnShopResToOption = function (data) {
     return ids
 };
 
-
-
 turnStdToOption = function (data) {
     if (!data) return false
     let ids = data.map(item => {
@@ -373,6 +372,18 @@ turnStdToOption = function (data) {
     return ids
 };
 
+turnActionsResToOption = function (data) {
+    if (data == null) return false
+    if (!data) return false
+    let ids = data.map(item => {
+        return {
+            label: item.EaName,
+            key: parseInt(item.EaId),
+            value: parseInt(item.EaId)
+        }
+    })
+    return ids
+}
 
 turnResToOptionByGroup = function (data) {
     if (!data) return false;

+ 30 - 0
pc/src/api/getApiRes.js

@@ -932,6 +932,11 @@ export function ActionGroupEdit(postdata) {
     let url = headapi + 'v1/Score/ActionGroupEdit';
     return getApiBasic(url, postdata);
 }
+//动作分组详情查询
+export function AGDetailQuery(postdata) {
+    let url = headapi + 'v1/Score/AGDetailQuery';
+    return getApiBasic(url, postdata);
+}
 //动作分组状态修改
 export function ActionGroupStatusEdit(postdata) {
     let url = headapi + 'v1/Score/ActionGroupStatusEdit';
@@ -942,6 +947,21 @@ export function ExerciseActionQuery(postdata) {
     let url = headapi + 'v1/Score/ExerciseActionQuery';
     return getApiBasic(url, postdata);
 }
+//动作与节点关联查询
+export function ENRelationQuery(postdata) {
+    let url = headapi + 'v1/Score/ENRelationQuery';
+    return getApiBasic(url, postdata);
+}
+// 动作与节点关联添加
+export function ENRelationAdd(postdata) {
+    let url = headapi + 'v1/Score/ENRelationAdd';
+    return getApiBasic(url, postdata);
+}
+//动作分组详情修改
+export function AGDetailEdit(postdata) {
+    let url = headapi + 'v1/Score/AGDetailEdit';
+    return getApiBasic(url, postdata);
+}
 //锻炼动作表添加
 export function ExerciseActionAdd(postdata) {
     let url = headapi + 'v1/Score/ExerciseActionAdd';
@@ -962,6 +982,16 @@ export function BodyNodeQuery(postdata) {
     let url = headapi + 'v1/Score/BodyNodeQuery';
     return getApiBasic(url, postdata);
 }
+//动作与节点关联修改
+export function ENRelationEdit(postdata) {
+    let url = headapi + 'v1/Score/ENRelationEdit';
+    return getApiBasic(url, postdata);
+}
+//修改动作与节点关联状态
+export function ENRelationStatusEdit(postdata) {
+    let url = headapi + 'v1/Score/ENRelationStatusEdit';
+    return getApiBasic(url, postdata);
+}
 //添加身体节点
 export function BodyNodeAdd(postdata) {
     let url = headapi + 'v1/Score/BodyNodeAdd';

+ 13 - 5
pc/src/router/index.js

@@ -150,7 +150,7 @@ const routes = [
                 }
             }, {
                 path: '/ratingManage',
-                name: 'cost',
+                name: 'ratingManage',
                 component: () => import('@/views/ActionGroups.vue'),
                 meta: {
                     title: "动作分组",
@@ -158,15 +158,23 @@ const routes = [
                 }
             },{
                 path: '/actionExercise',
-                name: 'cost',
+                name: 'actionExercise',
                 component: () => import('@/views/ActionExercise.vue'),
                 meta: {
                     title: "锻炼动作",
                     // clmid: "9",
                 }
+            },{
+                path: '/actionManage',
+                name: 'actionManage',
+                component: () => import('@/views/ActionManage.vue'),
+                meta: {
+                    title: "动作管理",
+                    // clmid: "9",
+                }
             },{
                 path: '/bodyNode',
-                name: 'cost',
+                name: 'bodyNode',
                 component: () => import('@/views/BodyNode.vue'),
                 meta: {
                     title: "身体节点",
@@ -174,7 +182,7 @@ const routes = [
                 }
             },{
                 path: '/actionScore',
-                name: 'cost',
+                name: 'actionScore',
                 component: () => import('@/views/ActionScore.vue'),
                 meta: {
                     title: "动作评分",
@@ -182,7 +190,7 @@ const routes = [
                 }
             },{
                 path: '/scoreResult',
-                name: 'cost',
+                name: 'scoreResult',
                 component: () => import('@/views/ScoreResult.vue'),
                 meta: {
                     title: "评分结果",

+ 5 - 1
pc/src/views/ActionExercise.vue

@@ -156,6 +156,7 @@ export default {
       activeName: 'comm',
       dialogVisible: false,//其他dialog
       addActionVisible: false,//新增动作分组弹窗
+      associateNodeVisible: false,//关联身体节点弹窗
       dialogTitle: '新增心率设备',
       BtnGetAllPower: false,
       tableRadio: [],
@@ -216,7 +217,9 @@ export default {
     },
     //动作分组动作管理
     manageAction(row) {
-      this.$router.push({path: '/bindRecord', query: {hrId: row.HrId}});
+      this.$router.push({path: '/actionManage', query: {
+        eaId: row.EaId,
+        eaName: row.EaName}});
     },
     // 关闭所有弹窗
     allDialogClose() {
@@ -435,6 +438,7 @@ export default {
         eaName: that.panel.str,
         eaTag: that.panel.tag,
         status: that.panel.status,
+        agId: 0
       };
       let postdata = qs.stringify(param);
       ExerciseActionQuery(postdata).then(res => {

+ 116 - 16
pc/src/views/ActionGroups.vue

@@ -34,7 +34,7 @@
       </div>
     </div>
     <div class="change">
-      <el-button @click="addActionGroup" size="mini" type="primary" >新增动作分组</el-button>
+      <el-button @click="addActionGroup" size="mini" type="primary">新增动作分组</el-button>
       <el-button @click="editActionGroup" size="mini">编辑动作分组</el-button>
       <el-button @click="deleteActionGroup" size="mini" type="danger">删除动作分组</el-button>
     </div>
@@ -57,7 +57,19 @@
         <el-table-column prop="id" label="操作">
           <template slot-scope="scope">
             <el-button type="primary" size="mini" @click="manageActionGroup(scope.row)">管理</el-button>
-            <el-button type="info" size="mini" @click="viewActionGroup(scope.row)">查看</el-button>
+            <el-popover
+                placement="left"
+                title="动作分组明细"
+                width="450"
+                trigger="click"
+                content="这是一段内容,这是一段内容,这是一段内容,这是一段内容。">
+              <el-table :data="form.groupAcData">
+                <el-table-column property="EaName" label="动作名称"></el-table-column>
+              </el-table>
+              <el-button slot="reference" type="info" size="mini" @click="getAcGroupDetail(scope.row)"
+                         style="margin-left: 10px;margin-right: 10px">查看
+              </el-button>
+            </el-popover>
             <el-button type="success" v-if="scope.row.Status == 8" size="mini" @click="enableRow(scope.row,1)">
               启用
             </el-button>
@@ -73,6 +85,7 @@
                      :current-page.sync="cur_page"
       ></el-pagination>
     </div>
+
     <el-dialog :title="dialogTitle" :visible.sync="addActionGroupVisible" width="650px">
       <div class="dialogContent">
         <div class>
@@ -92,6 +105,20 @@
         <el-button size="small" @click="addActionGroupVisible = false">取消</el-button>
       </div>
     </el-dialog>
+
+    <el-dialog :title="dialogTitle" :visible.sync="manageActionGroupVisible" width="650px">
+      <div class="dialogContent">
+        <div class>
+          <el-transfer filterable v-model="form.dialogValue" :data="form.dialogData" :titles="['全部动作','已绑动作']">
+          </el-transfer>
+        </div>
+      </div>
+      <div class="dialogFooter">
+        <el-button type="primary" size="small" @click="confirmManageActionGroup">确定</el-button>
+        <el-button size="small" @click="manageActionGroupVisible = false">取消</el-button>
+      </div>
+    </el-dialog>
+
   </div>
 </template>
 
@@ -100,9 +127,12 @@ import Global from '../Global.js'
 import {
   ActionGroupStatusEdit,
   ActionGroupEdit,
-  GetHrSensorsPowerPercent,
   ActionGroupQuery,
   ActionGroupAdd,
+  ClassListQuery,
+  ExerciseActionQuery,
+  AGDetailEdit,
+  AGDetailQuery
 } from "../api/getApiRes";
 
 let qs = require('qs');
@@ -112,6 +142,7 @@ export default {
       activeName: 'comm',
       dialogVisible: false,//其他dialog
       addActionGroupVisible: false,//新增动作分组弹窗
+      manageActionGroupVisible: false,//管理动作分组弹窗
       dialogTitle: '新增心率设备',
       BtnGetAllPower: false,
       tableRadio: [],
@@ -141,9 +172,11 @@ export default {
       },
       form: {
         agId: '',
+        agName: '',
         name: '',
         memo: '',
         btnType: 0,//0新建,1编辑编辑
+        groupAcData: [],
         dialogData: [],//穿梭待选
         dialogValue: [],//穿梭已选
       },
@@ -152,6 +185,7 @@ export default {
   },
   mounted() {
     this.getTableQuery();
+    this.getAllActions();
   },
   methods: {
     //顶部菜单项切换
@@ -168,11 +202,19 @@ export default {
     },
     //动作分组动作管理
     manageActionGroup(row) {
-      this.$router.push({path: '/bindRecord', query: {hrId: row.HrId}});
+      let that = this;
+      that.allDialogClose();
+      that.manageActionGroupVisible = true;
+      that.dialogTitle = '分组动作管理'
+      that.form.agId = row.AgId;
+      that.form.agName = row.AgName;
+      that.getAcGroupDetail(row);
     },
     // 关闭所有弹窗
     allDialogClose() {
       this.dialogVisible = false;
+      this.addActionGroupVisible = false;
+      this.manageActionGroupVisible = false;
     },
     //清除弹窗输入项
     clearForm() {
@@ -317,6 +359,37 @@ export default {
         });
       });
     },
+    //编辑动作组动作
+    confirmManageActionGroup() {
+      let that = this;
+      if (!that.form.dialogValue) {
+        this.$message.error('错了哦,请至少选定一个动作');
+        return false
+      }
+      console.log(that.form.dialogValue.toString());
+      let param = {
+        token: localStorage.token,
+        agId: that.form.agId,
+        agName: that.form.agName,
+        ecList: that.form.dialogValue.toString()
+      };
+      let postdata = qs.stringify(param);
+      AGDetailEdit(postdata).then(res => {
+        let json = res;
+        if (json.Code == 0) {
+          that.$message({
+            showClose: true,
+            message: '执行成功!',
+            type: 'success'
+          });
+          that.manageActionGroupVisible = false;
+          // table 重载
+          that.getTableQuery();
+        } else {
+          that.$message.error(json.Memo + ' 错误码:' + json.Code);
+        }
+      })
+    },
     //设置行状态
     enableRow(row, status) {
       let that = this;
@@ -343,26 +416,53 @@ export default {
       })
     },
     //查看动作分组详情
-    viewActionGroup(row) {
+    getAcGroupDetail(row) {
       let that = this;
+      that.form.groupAcData = [];
+      that.form.dialogValue = [];
+
       let param = {
         token: localStorage.token,
-        shopId: row.ShopId,
-        hrId: row.HrId,
+        shopId: localStorage.shopId,
+        agId: row.AgId,
       };
       let postdata = qs.stringify(param);
-      GetHrSensorsPowerPercent(postdata).then(res => {
+      AGDetailQuery(postdata).then(res => {
         let json = res;
         if (json.Code == 0) {
-          console.log(json);
-          that.getTableQuery();
-          that.$message({
-            showClose: true,
-            message: '电量获取成功!',
-            type: 'success'
-          });
+          if (json.Rs != '') {
+            that.form.groupAcData = json.Rs;
+            for (let temp in that.form.groupAcData) {
+              console.log(that.form.groupAcData[temp].EaId);
+              that.form.dialogValue.push(that.form.groupAcData[temp].EaId)
+            }
+          } else {
+            that.form.groupAcData = [];
+          }
         } else {
-          that.$message.error(json.Memo);
+          that.$message.error(json.Memo + ' 错误码:' + json.Code);
+        }
+      })
+    },
+    //获取当前所有动作
+    getAllActions() {
+      let that = this;
+      let param = {
+        token: localStorage.token,
+        shopId: localStorage.shopId,
+        agId: 0,
+      };
+      let postdata = qs.stringify(param);
+      ExerciseActionQuery(postdata).then(res => {
+        let json = res;
+        if (json.Code == 0) {
+          if (json.Rs != '') {
+            that.form.dialogData = turnActionsResToOption(json.Rs);
+          } else {
+            that.form.dialogData = [];
+          }
+        } else {
+          that.$message.error(json.Memo + ' 错误码:' + json.Code);
         }
       })
     },

+ 569 - 0
pc/src/views/ActionManage.vue

@@ -0,0 +1,569 @@
+<template>
+  <div class="context">
+    <el-page-header @back="goBack" content="动作管理"></el-page-header>
+    <div class="panel">
+      <br>
+      <h5> {{eaName}}</h5>
+    </div>
+    <div class="change">
+      <el-button @click="addBodyNode" size="mini" type="primary">新增节点</el-button>
+      <el-button @click="editBodyNode" size="mini">编辑节点</el-button>
+      <el-button @click="deleteBodyNode" size="mini" type="danger">删除节点</el-button>
+    </div>
+    <div class="table">
+      <el-table :data="tableData" border is-horizontal-resize
+                :default-sort="{ prop: 'date', order: 'descending' }" element-loading-background="rgba(0, 0, 0, 0.8)"
+                class @selection-change="handleSelectionChange" @current-change="clickChange">
+        >
+        <el-table-column label="选择" width="55">
+          <template slot-scope="scope">
+            <el-radio v-model="tableRadio" :label="scope.row">
+              <i></i>
+            </el-radio>
+          </template>
+        </el-table-column>
+        <el-table-column type="index" label="序号" align="center" width="60"/>
+        <el-table-column prop="BnName" label="节点名称" align="center" sortable/>
+        <el-table-column prop="Weight" label="所占权重" align="center" sortable/>
+        <el-table-column prop="DefScore" label="默认分数" align="center" sortable/>
+        <el-table-column prop="id" label="状态">
+          <template slot-scope="scope">
+            <el-button type="success" v-if="scope.row.Status == 8" size="mini" @click="enableRow(scope.row,1)">
+              启用
+            </el-button>
+            <el-button type="warning" v-if="scope.row.Status == 1" size="mini" @click="enableRow(scope.row,8)">
+              禁用
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <br/>
+      <el-pagination background :total="pagination.total" :page-size="pagination.pageItem"
+                     @current-change="pageChange"
+                     :current-page.sync="cur_page"
+      ></el-pagination>
+    </div>
+    <el-dialog :title="dialogTitle" :visible.sync="addBodyNodeVisible" width="650px">
+      <div class="dialogContent">
+        <div class>
+          <el-form ref="form" :model="form" label-width="160px">
+            <el-form-item label="身体节点" :required="true">
+              <el-select v-model="form.bnId" placeholder="请选择">
+                <el-option
+                    v-for="item in form.bnList"
+                    :key="item.BnId"
+                    :label="item.BnName"
+                    :value="item.BnId">
+                </el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item label="权重">
+              <el-input-number v-model="form.weight" :min="1" :max="10" label="1122"></el-input-number>
+            </el-form-item>
+            <el-form-item label="默认分数">
+              <el-input-number v-model="form.score" :min="1" :max="10" label="描述文字"></el-input-number>
+            </el-form-item>
+          </el-form>
+        </div>
+      </div>
+      <div class="dialogFooter">
+        <el-button type="primary" size="small" v-if="form.btnType == 0" @click="confirmAddNodeRelation">确定</el-button>
+        <el-button type="primary" size="small" v-if="form.btnType == 1" @click="confirmEditRelation">确定</el-button>
+        <el-button size="small" @click="addBodyNodeVisible = false">取消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import Global from '../Global.js'
+import {
+  BodyNodeStatusEdit,
+  ENRelationEdit,
+  ENRelationQuery,
+  ENRelationAdd,
+  BodyNodeQuery, ENRelationStatusEdit,
+} from "../api/getApiRes";
+
+let qs = require('qs');
+export default {
+  data() {
+    return {
+      eaId: '',
+      eaName: '',
+      dialogVisible: false,//其他dialog
+      addBodyNodeVisible: false,//新增关联节点弹窗
+      dialogTitle: '',
+      tableRadio: [],
+      cur_page: 1,
+      // panel 配置项目
+      panel: {
+        str: '',
+        status: "",
+        draw: 1,
+        start: 0,
+        recordsTotal: 0,
+        tableData: [],
+        allTableData: [],
+        loading: false,
+        statusOptions: [
+          {value: "", label: '全部'},
+          {value: 1, label: '启用'},
+          {value: 8, label: '禁用'},
+        ]
+      },
+      multipleSelection: [],
+      pagination: {
+        pageItem: 10,
+        pageOptions: pageOptions(),
+        total: 100,
+        pageIndex: 1,
+      },
+      form: {
+        enId:'',
+        bnId:'',
+        bnName:'',
+        bnList:[],
+        weight:5,
+        score:5,
+        btnType: 0,//0新建,1编辑编辑
+      },
+      tableData: []
+    }
+  },
+  mounted() {
+    console.log("mounted");
+    this.eaId = this.$route.query.eaId;
+    this.eaName = this.$route.query.eaName;
+    this.getTableQuery();
+  },
+  methods: {
+    //返回上一页
+    goBack() {
+      this.$router.push({path: '/actionExercise'});
+    },
+    //顶部菜单项切换
+    goType(url) {
+      this.$router.push({path: '/' + url});
+    },
+    //tableData中的行点击事件
+    clickChange(item) {
+      this.tableRadio = item
+    },
+    //tableData中的行选择事件
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
+    },
+    // 关闭所有弹窗
+    allDialogClose() {
+      this.dialogVisible = false;
+    },
+    //清除弹窗输入项
+    clearForm() {
+      this.form.bnId = '';
+    },
+    // 新增动作
+    addBodyNode() {
+      this.clearForm();
+      this.addBodyNodeVisible = true;
+      this.form.btnType = 0;
+      this.dialogTitle = '新增关联节点'
+      this.getBodyNodes();
+    },
+    //确认提交新动作
+    confirmAddNodeRelation() {
+      let that = this;
+      if (!that.form.bnId) {
+        this.$message.error('错了哦,身体节点名称不能为空');
+        return false
+      }
+      console.log(that.form.bnId);
+      let param = {
+        token: localStorage.token,
+        eaId: that.eaId,
+        eaName: that.eaName,
+        bnId: that.form.bnId,
+        bnName: "bodyNode:"+that.form.bnId,
+        weight: that.form.weight,
+        defScore: that.form.score
+      };
+      let postdata = qs.stringify(param);
+      ENRelationAdd(postdata).then(res => {
+        let json = res;
+        if (json.Code == 0) {
+          // 关闭弹窗
+          that.addBodyNodeVisible = false;
+          // 重载列表
+          that.getTableQuery();
+          that.$message({
+            showClose: true,
+            message: '关联节点添加成功!',
+            type: 'success'
+          });
+        } else {
+          that.$message.error(json.Memo + ' 错误码:' + json.Code);
+        }
+      })
+    },
+    //编辑关联节点
+    editBodyNode() {
+      let that = this;
+      this.clearForm();
+      if (this.tableRadio.length == 0) {
+        this.$message.error("请先选中一条记录");
+        return false
+      }
+      this.dialogVisible = true;
+      this.addBodyNodeVisible = true
+      this.dialogTitle = '编辑节点';
+      this.getBodyNodes();
+
+      let row = this.tableRadio;
+      this.form.shopid = row.ShopId;
+      this.form.bnId = row.BnId;
+      this.form.enId = row.EnId;
+      this.form.name = row.BnName;
+      this.form.btnType = 1;
+    },
+    //提交编辑关联节点
+    confirmEditRelation() {
+      let that = this;
+      if (!that.form.name) {
+        this.$message.error('错了哦,关联节点名称不能为空');
+        return false
+      }
+
+      let param = {
+        token: localStorage.token,
+        enId: that.form.enId,
+        eaName: that.eaName,
+        bnId: that.form.bnId,
+        bnName: that.form.name,
+        weight: that.form.weight,
+        defScore: that.form.score
+      };
+      let postdata = qs.stringify(param);
+      ENRelationEdit(postdata).then(res => {
+        let json = res;
+        if (json.Code == 0) {
+          // 关闭弹窗
+          that.addBodyNodeVisible = false;
+          // 重载列表
+          that.getTableQuery();
+          that.$message({
+            showClose: true,
+            message: '身体节点编辑信息编辑成功!',
+            type: 'success'
+          });
+        } else {
+          that.$message.error(json.Memo + ' 错误码:' + json.Code);
+        }
+      })
+    },
+    //删除关联节点
+    deleteBodyNode() {
+      let that = this;
+      let row = this.tableRadio;
+      let param = {
+        token: localStorage.token,
+        bnId: row.BnId,
+        bnName: row.BnName,
+        enId: row.EnId,
+        eaName: that.eaName,
+        status: 9 //1:启用,8:禁用,9:删除
+      };
+      let postdata = qs.stringify(param);
+
+      this.$confirm('此操作将永久删除关联的身体节点, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        ENRelationStatusEdit(postdata).then(res => {
+          let json = res;
+          if (json.Code == 0) {
+            // table 重载
+            that.getTableQuery();
+            that.$message({
+              showClose: true,
+              message: '删除成功',
+              type: 'success'
+            });
+          } else {
+            that.$message.error(json.Memo);
+          }
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
+        });
+      });
+    },
+    //设置行状态
+    enableRow(row, status) {
+      let that = this;
+      let param = {
+        token: localStorage.token,
+        bnId: row.BnId,
+        bnName: row.BnName,
+        enId: row.EnId,
+        eaName: that.eaName,
+        status: status,//1:启用 8:暂停 9:删除
+      };
+      let postdata = qs.stringify(param);
+      ENRelationStatusEdit(postdata).then(res => {
+        let json = res;
+        if (json.Code == 0) {
+          that.$message({
+            showClose: true,
+            message: '执行成功!',
+            type: 'success'
+          });
+          // table 重载
+          that.getTableQuery();
+        } else {
+          that.$message.error(json.Memo + ' 错误码:' + json.Code);
+        }
+      })
+    },
+    //查询所有身体节点
+    getBodyNodes(){
+      let that = this;
+      that.loading = true;
+      let param = {
+        token: localStorage.token
+      };
+      let postdata = qs.stringify(param);
+      BodyNodeQuery(postdata).then(res => {
+        let json = res;
+        if (json.Code == 0) {
+          if (json.Rs) {
+            that.form.bnList = json.Rs;
+          } else {
+            that.form.bnList = [];
+          }
+          // 设置分页数据
+          that.setPaginations();
+        } else {
+          that.$message.error(json.Memo + ' 错误码:' + json.Code);
+        }
+      })
+    },
+    // 查询按钮
+    query() {
+      let that = this;
+      that.start = 0;
+      that.cur_page = 1;
+      this.getTableQuery();
+      this.$message.success('查询完毕');
+    },
+    // 页面数据查询
+    getTableQuery() {
+      let that = this;
+      that.loading = true;
+      let param = {
+        token: localStorage.token,
+        eaId: that.eaId
+      };
+      let postdata = qs.stringify(param);
+      ENRelationQuery(postdata).then(res => {
+        let json = res;
+        if (json.Code == 0) {
+          that.loading = false;
+          if (json.Rs) {
+            that.allTableData = json.Rs;
+            that.recordsTotal = json.Rs.length;
+          } else {
+            that.allTableData = [];
+            that.recordsTotal = 0;
+          }
+          // 设置分页数据
+          that.setPaginations();
+        } else {
+          that.$message.error(json.Memo + ' 错误码:' + json.Code);
+        }
+      })
+    },
+    // 设置分页数据
+    setPaginations() {
+      // 分页属性
+      let that = this;
+      that.pagination.total = that.recordsTotal;
+
+      // 默认分页
+      that.tableData = that.allTableData.filter((item, index) => {
+        return index < that.pagination.pageItem;
+      });
+    },
+    // 每页显示数量
+    handleSizeChange() {
+      let that = this;
+      that.tableData = that.allTableData.filter((item, index) => {
+        return index < that.pagination.pageItem;
+      });
+      that.draw = that.pagination.pageItem;
+      // that.getTableQuery();
+    },
+    // 翻页
+    pageChange(pageIndex) {
+      let that = this;
+      // 获取当前页
+      let index = that.pagination.pageItem * (pageIndex - 1);
+      // 数据总数
+      let nums = that.pagination.pageItem * pageIndex;
+      // 容器
+      let tables = [];
+      for (var i = index; i < nums; i++) {
+        if (that.allTableData[i]) {
+          tables.push(that.allTableData[i])
+        }
+        this.tableData = tables;
+      }
+      that.start = index * that.draw;
+      // that.getTableQuery();
+    },
+    // 自动排序
+    sortChange(params) {
+      console.log(params)
+    },
+    //            过滤时间
+    filterFmtDate(value, row, column) {
+      let that = this;
+      if (column == 0) {
+        return '未获得'
+      } else {
+        return nonTfmtDatetoLength(new Date(column * 1000), 16);
+      }
+    },
+  },
+  watch: {
+    $route(to) {
+      if (to.path == '/actionManage') {
+        this.eaId = this.$route.query.eaId;
+        this.eaName = this.$route.query.eaName;
+        this.getTableQuery();
+      }
+    },
+  },
+}
+</script>
+
+<style scoped>
+@import "../assets/css/panel.css";
+
+.context {
+  /* height: 770px; */
+  overflow-y: scroll;
+
+  display: block;
+  margin: 0 auto;
+  background-color: #fff !important;
+  padding: 30px;
+}
+
+.panel-body {
+  padding: 20px;
+  background: #f0f2f5;
+}
+
+.change {
+  width: 100%;
+  overflow: hidden;
+  display: block;
+  margin: 0 auto;
+  padding-top: 10px;
+  padding-bottom: 10px;
+}
+
+.change button {
+  float: left;
+}
+
+.change button.pull-right {
+  float: right;
+}
+
+.likeTab {
+  width: 100%;
+  overflow: hidden;
+  display: block;
+  margin: 0 auto;
+  padding-top: 10px;
+  padding-bottom: 0;
+  border-bottom: 1px solid #ccc;
+  margin-bottom: 10px;
+}
+
+.likeTab button {
+  float: left;
+  border-radius: 0;
+}
+
+.likeTab button.pull-right {
+  float: right;
+}
+
+.dialogTitle {
+  width: 100%;
+  overflow: hidden;
+  display: block;
+  margin: 0 auto;
+  color: #000000;
+  font-size: 18px;
+  text-align: center;
+}
+
+.dialogTitle em {
+  float: none;
+  font-style: normal;
+  color: #3799ff;
+  margin: 0;
+}
+
+/deep/ .el-transfer-panel__item .el-checkbox__input {
+  left: 40px;
+}
+
+.dialogFooter {
+  width: 90%;
+  overflow: hidden;
+  display: block;
+  margin: 0 auto;
+  margin-top: 10px;
+}
+
+.dialogFooter button {
+  float: right;
+  margin-left: 10px;
+}
+
+.dialogContent {
+  width: 100%;
+  overflow: hidden;
+  display: block;
+  margin: 0 auto;
+}
+
+.dialogContent .pull-left {
+  width: 30%;
+  float: left;
+}
+
+.dialogContent .pull-right {
+  width: 70%;
+  float: right;
+}
+
+.panel_control /deep/ .el-input {
+  width: 90px;
+  float: left;
+}
+
+.panel-body em {
+  /*float: left;*/
+  line-height: 40px;
+  margin-right: 10px;
+}
+
+</style>

File diff suppressed because it is too large
+ 78 - 815
pc/src/views/ActionScore.vue


+ 4 - 0
pc/src/views/ScoreResult.vue

@@ -95,6 +95,7 @@ let qs = require("qs");
 export default {
   data() {
     return {
+      AgId:0,
       tableData: [],
       title: "",
       ClassType: 0,
@@ -141,6 +142,7 @@ export default {
   mounted() {
     // this.getTableQuery();
     // this.getSelectHrSensors();
+    this.AgId = this.$route.query.AgId;
     this.ClassType = this.$route.query.ClassType;
     this.PkNum = this.$route.query.PkNum;
     this.FinishClass = this.$route.query.FinishClass;
@@ -280,6 +282,7 @@ export default {
     goType(url) {
       this.$router.push({
         path: '/' + url, query: {
+          AgId: this.$route.query.AgId,
           StdId: this.$route.query.StdId,
           ClassName: this.$route.query.ClassName,
           BeginStr: this.$route.query.BeginStr,
@@ -295,6 +298,7 @@ export default {
     $route(to) {
       if (to.name == "scoreResult") {
         this.getTableQuery();
+        this.AgId = this.$route.query.AgId;
         this.FinishClass = this.$route.query.FinishClass;
         this.ClassType = this.$route.query.ClassType;
         this.PkNum = this.$route.query.PkNum;

+ 4 - 74
pc/src/views/courseEdit.vue

@@ -6,8 +6,8 @@
         <span class="classNames">{{ title }} {{ ClassStateText }}</span>
         <div class="likeTab">
           <el-button type="primary" @click="goType('courseEdit')" size="mini">人员管理</el-button>
-          <el-button v-if="AgId>=0" @click="goType('actionScore')" size="mini">动作评分</el-button>
-          <el-button v-if="AgId>=0" @click="goType('scoreResult')" size="mini">评分结果</el-button>
+          <el-button v-if="AgId>0" @click="goType('actionScore')" size="mini">动作评分</el-button>
+          <el-button v-if="AgId>0" @click="goType('scoreResult')" size="mini">评分结果</el-button>
         </div>
         <div class="panel_control">
           <el-row :gutter="20">
@@ -672,15 +672,6 @@ export default {
         this.$route.query.EndStr;
   },
   methods: {
-    // 禁用或启用绑定心率带
-    showOrDiss(row) {
-      // console.log(row);
-      // if (row.isOnline == 1) {
-      //     row.isOnline = 0
-      // } else {
-      //     row.isOnline = 1
-      // }
-    },
     handleSelectionChange(val) {
       let row = "";
       for (let t in this.tableData) {
@@ -709,14 +700,7 @@ export default {
       console.log();
     },
     wathcIsOnlineRow(checked, row) {
-      console.log(row);
-      // if(row.Sn){
-      //     row.IsOnlineState = false;
-      //     this.$message.error( '请先解绑心率带');
-      //     return false
-      // }else{
       row.IsOnline = checked == true ? 1 : 0;
-      // }
     },
     // 请选心率带
     bindSensorToUser(row) {
@@ -731,7 +715,6 @@ export default {
       obj = this.panel.bindList.find((item) => {
         return item.HrId === row.BindId;
       });
-      // let oldSn = row.BindId == 0 ? row.Sn : '';
       let oldSn = "";
       let param = {
         token: localStorage.token,
@@ -759,18 +742,6 @@ export default {
         }
       });
     },
-    toggleSelection(rows) {
-      // if(rows.IsOnline == 1){
-      //     // 网课学生状态置入
-      //
-      // }
-      if (rows) {
-        rows.forEach((row) => {
-          console.log(row);
-          this.$refs.multipleTable.toggleRowSelection(1);
-        });
-      }
-    },
     // 临时会员绑定心率带
     bindSensorToTmepUser(row) {
       let that = this;
@@ -862,49 +833,6 @@ export default {
       } else {
         that.$message.error("临时会员无法替换心率带");
       }
-
-      // let that = this;
-      // let text = "";
-      // if (this.$route.query.FinishClass == 2) {
-      //     text = '当前上课种是否回收用户' + row.Name + '的心率设备?(回收将重置用户的上课成绩)'
-      // } else {
-      //     text = '是否回收用户' + row.Name + '的心率设备?'
-      // }
-      // this.$confirm(text, '回收操作', {
-      //     confirmButtonText: '确定',
-      //     cancelButtonText: '取消',
-      //     type: 'warning'
-      // }).then(() => {
-      //     let param = {
-      //         token: localStorage.token,
-      //         cfId: row.CfId,
-      //         bindId: row.BindId,
-      //         userId: row.UserId,
-      //         sn: row.Sn,
-      //     };
-      //     let postdata = qs.stringify(param);
-      //     UnBindHrSensorsToUser(postdata).then(res => {
-      //         let json = res;
-      //         if (json.Code == 0) {
-      //             that.$message({
-      //                 showClose: true,
-      //                 message: '心率带' + row.Sn + '回收成功!',
-      //                 type: 'success'
-      //             });
-      //             // table 重载
-      //             that.getTableQuery();
-      //             // 重置心率带可选列表
-      //             // that.getSelectHrSensors();
-      //         } else {
-      //             that.$message.error(json.Memo + ' 错误码:' + json.Code);
-      //         }
-      //     })
-      // }).catch(() => {
-      //     this.$message({
-      //         type: 'info',
-      //         message: '已取消回收'
-      //     });
-      // });
     },
     // 确认下课
     addFinish() {
@@ -1710,6 +1638,7 @@ export default {
     goType(url) {
       this.$router.push({
         path: '/' + url, query: {
+          AgId: this.$route.query.AgId,
           StdId: this.$route.query.StdId,
           ClassName: this.$route.query.ClassName,
           BeginStr: this.$route.query.BeginStr,
@@ -1728,6 +1657,7 @@ export default {
         this.FinishClass = this.$route.query.FinishClass;
         this.ClassType = this.$route.query.ClassType;
         this.PkNum = this.$route.query.PkNum;
+        this.AgId = this.$route.query.AgId;
 
         this.title =
             this.$route.query.ClassName +

+ 48 - 55
pc/src/views/courses.vue

@@ -72,17 +72,11 @@
         </el-table-column>
         <el-table-column prop="Status" label="操作">
           <template slot-scope="scope">
-            <!--<el-button type="primary" round size="mini" @click="checkClassOverPrepare(scope.row)">-->
-            <!--下课-->
-            <!--</el-button>-->
             <el-button type="primary" round size="mini" v-if="scope.row.FinishClass == 0"
                        @click="showDialogMemberVisible(scope.row)">
               上课
             </el-button>
-            <!--<el-button type="danger" round size="mini" v-if="scope.row.FinishClass == 0"-->
-            <!--@click="closeLesson(scope.row)">-->
-            <!--关课-->
-            <!--</el-button>-->
+
             <el-button type="primary" round size="mini"
                        v-if="scope.row.FinishClass == 3 || scope.row.FinishClass == 2" @click="seeEdit(scope.row)">
               管理
@@ -112,15 +106,15 @@
         <div class="">
           <el-form ref="form" :model="form" label-width="160px">
             <el-form-item label="评分" :required="true">
-              <el-radio-group v-model="form.isScore"style="margin-left: -180px">
-                <el-radio label="2">关闭</el-radio>
+              <el-radio-group v-model="form.isScore" style="margin-left: -180px">
+                <el-radio label="0">关闭</el-radio>
                 <el-radio label="1">开启</el-radio>
               </el-radio-group>
             </el-form-item>
             <el-form-item v-if="form.isScore == 1" label="动作分组" :required="true">
-              <el-select v-model="form.svId" filterable placeholder="请选择" @change="changeLocationValue">
-                <el-option v-for="item in form.svList" :key="item.SvId" :label="item.Name"
-                           :value="item.SvId">
+              <el-select v-model="form.agId" filterable placeholder="请选择">
+                <el-option v-for="item in form.actionList" :key="item.AgId" :label="item.AgName"
+                           :value="item.AgId">
                 </el-option>
               </el-select>
             </el-form-item>
@@ -159,8 +153,8 @@
         </div>
       </div>
       <div class="dialogFooter">
-        <el-button type="primary" size="small" v-if="form.btnType == 0" :disabled="PrepareBtnStatus"
-                   @click="getClassStartPrepare()">确定
+        <el-button type="primary" size="small" v-if="form.btnType == 0" @click="getClassStartPrepare()"
+                   :disabled="PrepareBtnStatus">确定
         </el-button>
         <el-button type="primary" size="small" v-if="form.btnType == 1" @click="getClassStartPrepareForEdit()">
           确定
@@ -174,7 +168,7 @@
 <script>
 import Global from '../Global.js'
 import {
-  ClassPreFinishListQuery,
+  ActionGroupQuery,
   ClassOverPrepare,
   ClassDetailQuery,
   QueryShopVenue,
@@ -249,7 +243,8 @@ export default {
       form: {
         name: '',
         svId: '',
-        isScore: 0,
+        agId: '',
+        isScore: "0",
         svName: '',
         classType: 1,
         userCode: '',
@@ -266,6 +261,7 @@ export default {
         expTime: '',
         StdId: '',
         svList: [],//区域列表
+        actionList: [],//动作列表
         dialogdata: [],//穿梭待选
         dialogValue: [],//穿梭已选
         dialogCoachdata: [],//穿梭已选
@@ -301,10 +297,18 @@ export default {
       this.dialogMemberVisible = true;
       this.className = row.ClassName + ' ' + row.BeginStr + ' - ' + row.EndStr;
       this.form.StdId = row.StdId;
-      this.getQueryShopVenue();
       this.form.svId = row.SvId;
+      this.form.svName = row.SvName;
       this.form.classType = row.ClassType;
       this.form.pkNum = row.PkNum;
+      if (row.AgId != 0) {
+        this.form.isScore = "1";
+        this.form.agId = row.AgId;
+      } else {
+        this.form.agId = "";
+      }
+      this.getQueryShopVenue();
+      this.getQueryShopActionGroup();
     },
     // 准备上课
     getClassStartPrepare() {
@@ -321,6 +325,7 @@ export default {
         token: localStorage.token,
         stdId: that.form.StdId,
         svId: that.form.svId,
+        agId: that.form.agId == "" ? 0 : that.form.agId,
         svName: that.form.svName,
         classType: that.form.classType,
         pkNum: uppkNum,
@@ -343,6 +348,7 @@ export default {
           this.$router.push({
             path: '/courseEdit',
             query: {
+              AgId: that.form.agId,
               StdId: that.form.StdId,
               ClassName: that.form.ClassName,
               BeginStr: that.form.BeginStr,
@@ -370,10 +376,15 @@ export default {
       // 不是竞技pk的时候为0
       let uppkNum = that.form.classType == 2 ? that.form.pkNum : 0;
 
+      if (that.form.isScore === "0") {
+        that.form.agId = 0;
+      }
+
       let param = {
         token: localStorage.token,
         stdId: that.form.StdId,
         svId: that.form.svId,
+        agId: that.form.agId,
         svName: that.form.svName,
         classType: that.form.classType,
         pkNum: uppkNum,
@@ -414,43 +425,6 @@ export default {
         }
       });
     },
-    // 关课
-    closeLesson(row) {
-      that.$message.error('功能未上线,请耐心等候');
-      return false;
-      let that = this;
-      let param = {
-        token: localStorage.token,
-        hrId: row.HrId,
-        status: 9,//
-      };
-      let postdata = qs.stringify(param);
-      this.$confirm('此操作将永久关闭当前课程, 是否继续?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        HrSensorsStatusEdit(postdata).then(res => {
-          let json = res;
-          if (json.Code == 0) {
-            that.$message({
-              showClose: true,
-              message: '选中的课程已关闭!',
-              type: 'success'
-            });
-            // 重载列表
-            that.getTableQuery();
-          } else {
-            that.$message.error(json.Memo + ' 错误码:' + json.Code);
-          }
-        });
-      }).catch(() => {
-        this.$message({
-          type: 'info',
-          message: '已取消关课'
-        });
-      });
-    },
     // 获取select的label
     changeLocationValue(val) {
       //locations是v-for里面的也是datas里面的值
@@ -481,6 +455,23 @@ export default {
         }
       })
     },
+    // 获取商家下动作列表
+    getQueryShopActionGroup() {
+      let that = this;
+      let param = {
+        token: localStorage.token,
+        shopId: localStorage.ServiceId
+      };
+      let postdata = qs.stringify(param);
+      ActionGroupQuery(postdata).then(res => {
+        let json = res;
+        if (json.Code == 0) {
+          that.form.actionList = json.Rs;
+        } else {
+          that.$message.error(json.Memo + ' 错误码:' + json.Code);
+        }
+      })
+    },
     vipSelect(stdId) {
       let that = this;
       // 筛选相同的stdid的classId
@@ -506,9 +497,10 @@ export default {
     },
     showDialogMemberVisible(row) {
       this.dialogMemberVisible = true;
-      this.form.btnType = 0;//0新建,1编辑编辑
+      this.form.btnType = 0;//0新建,1编辑
       // clear
       this.form.svList = "";
+      this.form.actionList = "";
       this.form.classType = 1;
       this.form.pkNum = 2;
 
@@ -524,6 +516,7 @@ export default {
       this.form.StdId = row.StdId;
       this.getCoachOption();
       this.getQueryShopVenue();
+      this.getQueryShopActionGroup();
     },
     // 获取教练选项
     getCoachOption() {

+ 1 - 0
pc/src/views/heartEquip.vue

@@ -188,6 +188,7 @@ export default {
       dialogTitle: '新增心率设备',
       dialogValue: [],
       tableRadio: [],
+      cur_page: '',
       // panel 配置项目
       panel: {
         str: '',

+ 2 - 1
pc/src/views/heartLog.vue

@@ -561,7 +561,8 @@
         },
         watch: {
             $route(to) {
-                if (to.name == 'heartLog') {
+              console.log("watch");
+              if (to.name == 'heartLog') {
                     this.regionName = this.$route.query.name;
                     this.getTableQuery();
                 }

Some files were not shown because too many files changed in this diff