zhengwei 4 роки тому
батько
коміт
02b12bf864
2 змінених файлів з 115 додано та 150 видалено
  1. 61 37
      pc/src/views/ActionScore.vue
  2. 54 113
      pc/src/views/ScoreResult.vue

+ 61 - 37
pc/src/views/ActionScore.vue

@@ -14,7 +14,7 @@
             <el-col :span="22">
               <el-radio-group v-model="action" size="mini" @change="handleClick" align="left"
                               style="margin-left: -10px;float: left;padding-left: 10px">
-                <el-radio v-for="item in actionList" :label="item.EaId"
+                <el-radio v-for="item in actionList" :label="item.AgdId"
                           border style="margin-top: 10px;margin-left: -10px">
                   {{ item.EaName }}
                 </el-radio>
@@ -38,7 +38,6 @@
           :default-sort="{ prop: 'data', order: 'descending' }"
           element-loading-background="rgba(0, 0, 0, 0.8)"
           class
-          @selection-change="handleSelectionChange"
           ref="multipleTable"
       >
         <el-table-column
@@ -193,25 +192,17 @@ export default {
         this.$route.query.EndStr;
   },
   methods: {
-    handleClick(actionId) {
+    handleClick(AgdId) {
       let that = this;
-      that.getActionBodyNode(actionId);
-    },
-    handleSelectionChange(val) {
-      let row = "";
-      for (let t in this.tableData) {
-        this.tableData[t].IsOnline = 0;
-      }
-      for (let v in val) {
-        val[v].IsOnline = 1;
-      }
+      that.getActionBodyNode(AgdId);
     },
     //获取动作下的身体节点
-    getActionBodyNode(eaid) {
+    getActionBodyNode(AgdId) {
       let that = this;
       let param = {
         token: localStorage.token,
-        eaId: eaid
+        // agdId: AgdId,
+        eaId: 3,
       };
       let postdata = qs.stringify(param);
       ENRelationQuery(postdata).then((res) => {
@@ -219,7 +210,7 @@ export default {
         if (json.Code == 0) {
           if (json.Rs) {
             that.bodyList = json.Rs;
-            that.getTableQuery();
+            that.getTableQuery(AgdId);
           } else {
             that.bodyList = [];
           }
@@ -230,29 +221,62 @@ export default {
     },
     postPageMember() {
       let that = this;
-      // 提交数据
+      //拼接打分权重数据
+      let rowScore = deepClone(that.tableData[0].BodyNodeRs);
+      // console.log(JSON.stringify(rowScore));
+      for (let key in rowScore) {
+        for (let i = 0; i < that.bodyList.length; i++) {//遍历table中的人员名单
+          for (let bodyNd in that.bodyList[i]) {
+            if (key == that.bodyList[i].BnId) {
+              // console.log(key, that.bodyList[i].BnId, rowScore[key]);
+              rowScore[key] = that.bodyList[i].BnId;
+              break;
+            }
+          }
+        }
+      }
+      // console.log(JSON.stringify(rowScore));
+
+      //拼接人员数据
       let scoreRs = [];
       let thisRow = {};
-      for (let i = 0; i < this.tableData.length; i++) {
-        thisRow = this.tableData[i];
-        thisRow.LessonIndex = parseInt(i + 1);
-        thisRow.EndStr = thisRow.CsId;
-        this.$delete(thisRow, 'LessonIndex');
+      for (let i = 0; i < that.tableData.length; i++) {//遍历table中的人员名单
+        thisRow = deepClone(that.tableData[i]);
+        thisRow.BodyNodeScore = rowScore;
+        thisRow.EaScore = 0;//默认评分是0
+        if (thisRow.EaScoreLevel == 2) {//优秀时计算分数
+
+          for (let nodeScore in rowScore) {
+            // console.log(key, that.bodyList[i].BnId, rowScore[key]);
+            console.log(nodeScore, rowScore[nodeScore]);
+
+            for (let nodeName in thisRow.BodyNodeRs) {
+              console.log(nodeName, thisRow.BodyNodeRs[nodeName]);
+              if (nodeScore == nodeName) {
+                //找对应节点的状态
+                if (!thisRow.BodyNodeRs[nodeName]) {//false为优秀
+                  thisRow.EaScore += rowScore[nodeScore];
+                }
+              }
+            }
+          }
+        }
+        this.$delete(thisRow, 'Head');//删除Head属性
+        this.$delete(thisRow, 'Usercode');//删除Usercode属性
         scoreRs.push(thisRow);
       }
+      console.log(scoreRs);
 
-      let res = JSON.stringify(scoreRs);
-      console.log(res);
       let param = {
         token: localStorage.token,
-        actionId: 112,
-        stuScRs: scoreRs,
+        stdId: this.$route.query.StdId,
+        BodyNodeRs: scoreRs
       };
-      let postdata = qs.stringify(param);
-      console.log(postdata);
-
-      // console.log(that.tableData);
+      console.log(param);
+      console.log(JSON.stringify(param));
 
+      let postData = qs.stringify(param);
+      console.log(postData);
     },
     editMemberRow(row) {
       let that = this;
@@ -285,13 +309,13 @@ export default {
         token: localStorage.token,
         agId: this.$route.query.AgId
       };
-      let postdata = qs.stringify(param);
-      AGDetailQuery(postdata).then((res) => {
+      let postData = qs.stringify(param);
+      AGDetailQuery(postData).then((res) => {
         let json = res;
         if (json.Code == 0) {
           if (json.Rs) {
             that.actionList = json.Rs;
-            that.action = json.Rs[0].EaId;
+            that.action = json.Rs[0].AgdId;
             that.getActionBodyNode(that.action);
           } else {
             that.actionList = [];
@@ -308,19 +332,19 @@ export default {
       });
     },
     // 页面数据查询
-    getTableQuery() {
+    getTableQuery(AgdId) {
       let that = this;
       that.loading = true;
       let param = {
         token: localStorage.token,
-        eaId: 1,
+        agdId: AgdId,
         stdId: this.$route.query.StdId
       };
       that.allTableData = [];
       that.tableData = [];
       that.recordsTotal = 0;
-      let postdata = qs.stringify(param);
-      ScoreClassDetailQuery(postdata).then((res) => {
+      let postData = qs.stringify(param);
+      ScoreClassDetailQuery(postData).then((res) => {
         let json = res;
         if (json.Code == 0) {
           that.loading = false;

+ 54 - 113
pc/src/views/ScoreResult.vue

@@ -19,8 +19,6 @@
           :default-sort="{ prop: 'data', order: 'descending' }"
           element-loading-background="rgba(0, 0, 0, 0.8)"
           class
-          :row-class-name="tableRowClassName"
-          @selection-change="handleSelectionChange"
           ref="multipleTable"
       >
         >
@@ -52,8 +50,6 @@
                 width="25px"
                 height="25px"
             />
-            <!--<img class="head" :src="scope.row.Head" alt="" height="51" width="51" v-if="scope.row.Head">-->
-            <!--<img class="head" src="../assets/img/nav/head.png" height="51" width="51" v-else/>-->
           </template>
         </el-table-column>
         <el-table-column
@@ -63,22 +59,25 @@
             sortable
         />
         <el-table-column
-            prop="Phone"
-            label="手机号"
-            width="120"
+            prop="ToTalScore"
+            label="总分"
+            width="90"
             sortable
-            v-if="!isCollapse"
         />
         <el-table-column
-            v-for="item in actionList" :key="item.index" :label="item.label"
-            :value="item.HrId" :prop="item.Prop"
-        />
+            v-for="item in actionList" :key="item.AgdId" :label="item.EaName"
+            :value="item.AgdId" :prop="item.AgdId+''"
+        >
+          <template slot-scope="scope">
+            {{scope.row.DetailScore[item.AgdId]}}
+          </template>
+        </el-table-column>
       </el-table>
       <br/>
       <el-pagination
           background
-          :total="pageination.total"
-          :page-size="pageination.pageItem"
+          :total="pagination.total"
+          :page-size="pagination.pageItem"
           @current-change="pageChange"
       />
     </div>
@@ -88,14 +87,15 @@
 <script>
 import Global from "../Global.js";
 import {
-  ClassOverDetailListQuery,
+  AGDetailQuery,
+  ScoreClassQuery,
 } from "../api/getApiRes";
 
 let qs = require("qs");
 export default {
   data() {
     return {
-      AgId:0,
+      AgId: 0,
       tableData: [],
       title: "",
       ClassType: 0,
@@ -105,34 +105,10 @@ export default {
       current: getNowDate(),
       ClassName: "",
       cur_page: 1,
-      actionList: [{
-        index: 0,
-        value: 0,
-        isCheck: false,
-        Prop: "StdId",
-        label: "总分",
-      }, {
-        index: 1,
-        value: 1,
-        isCheck: true,
-        Prop: "StdId",
-        label: "动作1",
-      }, {
-        index: 2,
-        value: 2,
-        isCheck: false,
-        Prop: "StdId",
-        label: "动作1",
-      }, {
-        index: 3,
-        value: 3,
-        isCheck: false,
-        Prop: "StdId",
-        label: "动作2",
-      }],
-      pageination: {
+      actionList: [],
+      pagination: {
         pageItem: 1000,
-        pageoptions: pageOptions(),
+        pageOptions: pageOptions(),
         total: 1000,
         pageIndex: 1,
       },
@@ -140,8 +116,7 @@ export default {
     };
   },
   mounted() {
-    // this.getTableQuery();
-    // this.getSelectHrSensors();
+    this.getActionQuery();
     this.AgId = this.$route.query.AgId;
     this.ClassType = this.$route.query.ClassType;
     this.PkNum = this.$route.query.PkNum;
@@ -160,102 +135,82 @@ export default {
         query: {},
       });
     },
+    //查询动作
+    getActionQuery() {
+      let that = this;
+      let param = {
+        token: localStorage.token,
+        agId: this.$route.query.AgId
+      };
+      let postData = qs.stringify(param);
+      AGDetailQuery(postData).then((res) => {
+        let json = res;
+        if (json.Code == 0) {
+          if (json.Rs) {
+            that.actionList = json.Rs;
+            that.getTableQuery();
+          } else {
+            that.actionList = [];
+          }
+        } else {
+          that.$message.error(json.Memo + " 错误码:" + json.Code);
+        }
+      });
+    },
     // 页面数据查询
     getTableQuery() {
       let that = this;
-      that.loading = true;
-      that.BeginState = true;
       let param = {
         token: localStorage.token,
-        stdId: this.$route.query.StdId,
-        start: 1, //
-        tableMax: 9999, //
+        stdId: this.$route.query.StdId
       };
       that.allTableData = [];
       that.tableData = [];
       that.recordsTotal = 0;
-      let postdata = qs.stringify(param);
-      ClassOverDetailListQuery(postdata).then((res) => {
+      let postData = qs.stringify(param);
+      ScoreClassQuery(postData).then((res) => {
         let json = res;
         if (json.Code == 0) {
-          that.loading = false;
           if (json.Rs) {
-            // 没人不允许开课
-            if (json.Rs.length > 0) {
-              // 全部预约 都是未到也不允许开课
-              json.Rs.map(function (item) {
-                // 只要有一个不是就放开
-                if (item.Status != 2) {
-                  that.BeginState = false;
-                }
-                item.IsOnline = item.IsOnline.toString();
-                item.IsOnlineState = item.IsOnline == 1 ? true : false;
-              });
-            }
-            // 分队处理
-            // 未上课的分队,已上课的旧的不处理,新人需要处理
-            if (that.FinishClass == 3) {
-              if (that.ClassType == 2) {
-                that.TurnUnit(json.Rs);
-              } else {
-                json.Rs.map(function (item) {
-                  item.group_no = item.GroupNo;
-                });
-              }
-            } else {
-              // 已上课的状态
-              json.Rs.map(function (item, i) {
-                if (that.ClassType == 2) {
-                  if (item.GroupNo == 0) {
-                    item.group_no = (i % that.PkNum) + 1;
-                  } else {
-                    item.group_no = item.GroupNo;
-                  }
-                } else {
-                  item.group_no = item.GroupNo;
-                }
-              });
-            }
             that.allTableData = json.Rs;
             that.recordsTotal = json.Rs.length;
           } else {
             that.allTableData = [];
             that.recordsTotal = 0;
           }
+          console.log(that.allTableData);
           // 设置分页数据
-          that.setPaginations();
+          that.setPagination();
         } else {
           that.$message.error(json.Memo + " 错误码:" + json.Code);
         }
       });
     },
     // 设置分页数据
-    setPaginations() {
+    setPagination() {
       // 分页属性
       let that = this;
-      that.pageination.total = that.recordsTotal;
-
+      that.pagination.total = that.recordsTotal;
       // 默认分页
       that.tableData = that.allTableData.filter((item, index) => {
-        return index < that.pageination.pageItem;
+        return index < that.pagination.pageItem;
       });
     },
     // 每页显示数量
     handleSizeChange() {
       let that = this;
       that.tableData = that.allTableData.filter((item, index) => {
-        return index < that.pageination.pageItem;
+        return index < that.pagination.pageItem;
       });
-      that.draw = that.pageination.pageItem;
-      // that.getTableQuery();
+      that.draw = that.pagination.pageItem;
     },
     // 翻页
     pageChange(pageIndex) {
       let that = this;
       // 获取当前页
-      let index = that.pageination.pageItem * (pageIndex - 1);
+      let index = that.pagination.pageItem * (pageIndex - 1);
       // 数据总数
-      let nums = that.pageination.pageItem * pageIndex;
+      let nums = that.pagination.pageItem * pageIndex;
       // 容器
       let tables = [];
       for (var i = index; i < nums; i++) {
@@ -265,19 +220,6 @@ export default {
         this.tableData = tables;
       }
       that.start = index * that.draw;
-      // that.getTableQuery();
-    },
-    // 过滤时间
-    filterFmtDate(value, row, column) {
-      let that = this;
-      if (
-          column == "0001-01-01T08:05:43+08:05" ||
-          column == "0001-01-01T00:00:00Z"
-      ) {
-        return "未预约";
-      } else {
-        return nonTfmtDate(column, 11);
-      }
     },
     goType(url) {
       this.$router.push({
@@ -297,12 +239,11 @@ export default {
   watch: {
     $route(to) {
       if (to.name == "scoreResult") {
-        this.getTableQuery();
+        this.getActionQuery();
         this.AgId = this.$route.query.AgId;
         this.FinishClass = this.$route.query.FinishClass;
         this.ClassType = this.$route.query.ClassType;
         this.PkNum = this.$route.query.PkNum;
-
         this.title =
             this.$route.query.ClassName +
             " " +