瀏覽代碼

更换班级

谢杰标 2 年之前
父節點
當前提交
fbbfe14a42

+ 18 - 0
src/api/education/classManageMent.js

@@ -7,4 +7,22 @@ export function rollBackPeriod(data) {
         method: 'post',
         data
     })
+}
+
+// 商品关联的班级
+export function getListGoods(query) {
+    return request({
+        url: `/grade/grade/listGoods`,
+        method: 'GET',
+        params: query
+    })
+}
+
+// 更换班级
+export function changeGradeFree(data) {
+    return request({
+        url: `/grade/grade/changeGradeFree`,
+        method: 'post',
+        data
+    })
 }

+ 1 - 1
src/components/searchBoxNew.vue

@@ -436,7 +436,7 @@
             v-model="formData[item.prop]"
             type="datetime"
             :size="size"
-            placeholder="选择日期时间"
+            :placeholder="item.placeholder"
             value-format="timestamp"
           >
           </el-date-picker>

+ 2 - 2
src/views/Marketing/goods/commodityManageMent/index.vue

@@ -44,7 +44,7 @@
           >修改</el-button
         >
         <el-button type="text" @click="changeStatus(props.scope.row)">{{
-          props.scope.row.goodsStatus === 1 ? "下架" : "上架"
+          props.scope.row.goodsStatus === 1 ? "上架" : "下架"
         }}</el-button>
         <el-button type="text" @click="del(props.scope.row)">删除</el-button>
       </template>
@@ -399,7 +399,7 @@ export default {
       if (!len) {
         return this.$message.warning("请先勾选商品");
       }
-      let name = ["上架", "下架", "删除"][type];
+      let name = ["下架", "上架", "删除"][type];
       this.$confirm(`此操作将所勾选的${len}条商品${name}, 是否继续?`, "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",

+ 24 - 0
src/views/education/classManageMent/listOfhoursToBeReviewed/index.vue

@@ -167,6 +167,18 @@ export default {
           prop: "searchKey",
           placeholder: "请输入姓名/身份证",
         },
+        {
+          prop1: "periodStartTime",
+          prop2: "periodEndTime",
+          placeholder1: "审核通过开始时间",
+          placeholder2: "审核通过结束时间",
+          scope: "moreDataPicker",
+          Diszing: true,
+        },
+        {
+          prop: "className",
+          placeholder: "所在班级",
+        },
       ],
       formData: {
         profileStatus: "",
@@ -279,6 +291,12 @@ export default {
           hidden: true,
           scope: "statusPeriod",
         },
+        {
+          label: "审核通过时间",
+          prop: "periodTime",
+          hidden: true,
+          scope: "aTimeList",
+        },
         {
           label: "待重修(视频节和题卷)",
           prop: "waitRebuildNum",
@@ -474,6 +492,12 @@ export default {
       if (this.formData.classEndTime) {
         data.classEndTime = parseInt(data.classEndTime / 1000);
       }
+      if (this.formData.periodStartTime) {
+        data.periodStartTime = parseInt(data.periodStartTime / 1000);
+      }
+      if (this.formData.periodEndTime) {
+        data.periodEndTime = parseInt(data.periodEndTime / 1000);
+      }
       this.$api
         .inquireGradegradelistUserPeriods(data)
         .then((res) => {

+ 55 - 29
src/views/education/classManageMent/studentMenu/index.vue

@@ -90,7 +90,12 @@
           v-model="formData.companyName"
           placeholder="所在公司"
           @clear="search(3)"
-        ><el-button @click="search(3)" slot="append" icon="el-icon-search"></el-button></el-input>
+          ><el-button
+            @click="search(3)"
+            slot="append"
+            icon="el-icon-search"
+          ></el-button
+        ></el-input>
         <el-select
           clearable
           @change="search(3)"
@@ -113,16 +118,23 @@
           <el-option label="是" :value="1"> </el-option>
           <el-option label="否" :value="0"> </el-option>
         </el-select>
-         <el-button
-          size="medium"
-          @click="exportGrade"
-          :loading="exportLoading"
-          >导出学员数据</el-button>
+        <el-button size="medium" @click="exportGrade" :loading="exportLoading"
+          >导出学员数据</el-button
+        >
       </template>
       <template slot="btn" slot-scope="props">
         <el-button type="text" @click="addClick(props.scope.row, 2)"
           >学员详情</el-button
         >
+        <el-button
+          v-if="
+            props.scope.row.stuAllNum == 0 && props.scope.row.recordNum == 0
+          "
+          type="text"
+          style="color: red"
+          @click="changeClass(props.scope.row)"
+          >更换班级</el-button
+        >
         <!-- <el-button type="text" @click="del(props.scope.row)">移除</el-button> -->
       </template>
     </table-list>
@@ -581,6 +593,11 @@
     </el-dialog>
     <account-tag ref="accountTag" @successFuncBack="successFuncBack" />
     <quick-login ref="quickLogin" @backData="backData" />
+    <tab-class-dialog
+      :visible.sync="dialogVisibleClass"
+      :studentInfo="tabClassStudentInfo"
+      @search="search"
+    ></tab-class-dialog>
   </div>
 </template>
 
@@ -589,10 +606,11 @@ import tableList from "@/components/tableList";
 import pagination from "@/components/pagination";
 import accountTag from "@/components/AccountTag";
 import quickLogin from "@/components/quickLogin";
+import tabClassDialog from "./tabClassDialog.vue";
 import * as baseUrls from "@/utils/request.js";
 
 export default {
-  components: { tableList, pagination, accountTag, quickLogin },
+  components: { tableList, pagination, accountTag, quickLogin, tabClassDialog },
   data() {
     return {
       options: [
@@ -617,7 +635,7 @@ export default {
       size: "medium",
       active: 1,
       loading: false, //当前表单加载是否加载动画
-      exportLoading: false,//导出按钮
+      exportLoading: false, //导出按钮
       navText: {
         title: "班级人数:",
         index: 0,
@@ -626,7 +644,7 @@ export default {
         choice: true,
         border: true,
         addHide: true,
-        rowKey:"id",
+        rowKey: "id",
         gftsStatus: false,
         gfUserStatus: false,
         backFatherBtn: {
@@ -773,21 +791,21 @@ export default {
           prop1: "useStudyCount",
           prop2: "studyCount",
           hidden: true,
-          scope:"studyCount"
+          scope: "studyCount",
         },
         {
           label: "考试机会",
           prop1: "examNumber",
           prop2: "expendNumber",
           hidden: true,
-          scope:"chance"
+          scope: "chance",
         },
         {
           label: "前培机会",
           prop1: "doNumber",
           prop2: "expendBefore",
           hidden: true,
-          scope:"chance"
+          scope: "chance",
         },
         {
           label: "复购-学时冲突",
@@ -806,6 +824,8 @@ export default {
       dialogVisible: false,
       dialogVisibleTable: false,
       dialogVisibleStudent: false,
+      dialogVisibleClass: false,
+      tabClassStudentInfo: {},
       allCheckList: [], //多选数组
       stice: 0,
       obtainGoods: {}, //选择班级头部商品数据
@@ -855,6 +875,10 @@ export default {
     this.search();
   },
   methods: {
+    changeClass(row) {
+      this.dialogVisibleClass = true;
+      this.tabClassStudentInfo = row;
+    },
     /**
      * 组件成功回调
      */
@@ -1172,22 +1196,23 @@ export default {
       }
     },
     //导出学员数据
-    exportGrade(){
-      this.exportLoading = true
-      let data = this.$refs.tableList.allCheckData
-      if(data && data.length > 0){
-       let idCards = data.map(x => x.idCard)
-       this.formData.idCards = idCards
-       console.log(idCards,'idCards');
-       console.log(this.formData,'this.formData');
+    exportGrade() {
+      this.exportLoading = true;
+      let data = this.$refs.tableList.allCheckData;
+      if (data && data.length > 0) {
+        let idCards = data.map((x) => x.idCard);
+        this.formData.idCards = idCards;
+        console.log(idCards, "idCards");
+        console.log(this.formData, "this.formData");
       }
-      this.formData.gradeId = this.$route.query.id,
-      this.formData.status = '0,1',
-      this.$api
-        .inquireGradegradeexportGrade(this.formData)
-        .then((res) => {
+      (this.formData.gradeId = this.$route.query.id),
+        (this.formData.status = "0,1"),
+        this.$api
+          .inquireGradegradeexportGrade(this.formData)
+          .then((res) => {
             if (res.msg) {
-              let url = baseUrls.baseURL + "common/download?fileName=" + res.msg;
+              let url =
+                baseUrls.baseURL + "common/download?fileName=" + res.msg;
               let link = document.createElement("a");
               let fileName = "班级学员数据" + ".xlsx";
               document.body.appendChild(link);
@@ -1199,9 +1224,10 @@ export default {
             } else {
               this.$message.error("导出失败");
             }
-        }).finally(() => {
-          this.exportLoading = false
-        })
+          })
+          .finally(() => {
+            this.exportLoading = false;
+          });
     },
     search(int) {
       this.loading = true;

+ 184 - 0
src/views/education/classManageMent/studentMenu/tabClassDialog.vue

@@ -0,0 +1,184 @@
+<template>
+  <Base-dialog
+    title="更换班级"
+    width="1000px"
+    :isShow.sync="isShow"
+    @submit="submit"
+  >
+    <div>
+      <table-list
+        :tableSets="tableSet"
+        :tableData="tableData"
+        :navText="navText"
+        :loading="loading"
+        :radio.sync="tableRadio"
+      >
+      </table-list>
+      <pagination
+        :total="total"
+        :pageSize="formData.pageSize"
+        :currentPage="formData.pageNum"
+        @handleSizeChange="handleSizeChange"
+        @handleCurrentChange="handleCurrentChange"
+      />
+    </div>
+  </Base-dialog>
+</template>
+
+<script>
+import tableList from "@/components/tableList";
+import { getListGoods, changeGradeFree } from "@/api/education/classManageMent";
+export default {
+  props: {
+    visible: {
+      type: Boolean,
+      default: false,
+    },
+    studentInfo: {
+      type: Object,
+      default: () => {
+        return {};
+      },
+    },
+  },
+  data() {
+    return {
+      navText: {
+        title: "营销活动",
+        index: 0,
+        ch: "条",
+        num: false,
+        border: true,
+        dontNum: true,
+        choice: false,
+        choiceRadio: true,
+        radioKey: "gradeId",
+        tableHide: true,
+        addHide: true,
+        headShow: false,
+        backFatherBtn: {
+          status: false,
+          title: "未定义",
+        },
+      },
+      tableSet: [
+        {
+          label: "班级名称",
+          prop: "className",
+          hidden: true,
+          scope: "editInfo",
+        },
+        {
+          label: "班级人数",
+          prop1: "studentNum",
+          prop2: "studentUpper",
+          hidden: true,
+          scope: "peopleNums",
+          width: "150px",
+        },
+        {
+          label: "开放学习时间",
+          prop: "learningStatus",
+          prop1: "learningTimeStart",
+          hidden: true,
+          scope: "classTimeTypes",
+          width: "150px",
+        },
+        {
+          label: "班级有效期",
+          prop1: "classStartTime",
+          prop2: "classEndTime",
+          hidden: true,
+          Diszing: false,
+          scope: "TimeLists",
+          width: "200px",
+        },
+      ],
+      tableData: [],
+      loading: false,
+      total: 0,
+      tableRadio: "",
+      formData: {},
+    };
+  },
+  methods: {
+    init() {
+      this.tableRadio = "";
+      this.formData = {
+        pageSize: 10,
+        pageNum: 1,
+        goodsId: this.studentInfo.goodsId,
+      };
+    },
+    search() {
+      this.loading = true;
+      getListGoods(this.formData)
+        .then((res) => {
+          this.tableData = res.rows;
+          this.total = res.total;
+          this.navText.index = res.total;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    submit() {
+      if (!this.tableRadio) {
+        return this.$message.error("请选择班级");
+      }
+      
+      let { goodsId, gradeId, orderGoodsId, userId } = this.studentInfo;
+      if(this.tableRadio == gradeId){
+        return this.$message.error("不可更换相同班级");
+      }
+      changeGradeFree({
+        goodsId,
+        oldGradeId: gradeId,
+        gradeId: this.tableRadio,
+        orderGoodsId,
+        userId,
+      }).then((res) => {
+        this.$message.success("更换成功");
+        this.$emit("search", 2);
+        this.isShow = false;
+      });
+    },
+    handleSizeChange(v) {
+      this.formData.pageSize = v;
+      this.formData.pageNum = 1;
+      this.search();
+    },
+    handleCurrentChange(v) {
+      this.formData.pageNum = v;
+      this.search();
+    },
+  },
+  computed: {
+    isShow: {
+      get() {
+        return this.visible;
+      },
+      set(val) {
+        this.$emit("update:visible", false);
+      },
+    },
+  },
+  components: {
+    tableList,
+  },
+  watch: {
+    isShow: {
+      handler(newVal) {
+        if (newVal) {
+          this.init();
+          this.search();
+        }
+      },
+      immediate: true,
+    },
+  },
+};
+</script>
+
+<style>
+</style>

+ 13 - 1
src/views/education/studentManageMent/studentXQ/BankQuestionPassRecord.vue

@@ -102,6 +102,9 @@
               )
             }}%
           </span>
+          <span v-else-if="item.scope === 'mix'">
+            {{ scope.row[item.prop1] }}/{{ scope.row[item.prop2] }}
+          </span>
           <span v-else>
             {{ scope.row[item.prop] }}{{ item.ch ? item.ch : "" }}
           </span>
@@ -555,6 +558,12 @@ export default {
           label: "学时",
           prop: "classHours",
         },
+        {
+          label: "学习进度(节)",
+          prop1: "stuAllNum",
+          prop2: "examNum",
+          scope: "mix",
+        },
         {
           label: "做题进度(试卷)",
           prop1: "stuAllNum",
@@ -820,7 +829,10 @@ export default {
       if (!row.loadDetails) {
         //根据loadDetails判定是否已经加载了数据
         this.$api
-          .inquireselectExamList({ userId: row.userId, orderGoodsId: row.orderGoodsId })
+          .inquireselectExamList({
+            userId: row.userId,
+            orderGoodsId: row.orderGoodsId,
+          })
           .then((res) => {
             row.details = res.data;
             row.loadDetails = true; //加载成功之后更新标识

+ 11 - 1
src/views/education/studentManageMent/studentXQ/liveList.vue

@@ -97,6 +97,9 @@
             {{ $methodsTools.onlyForma(scope.row[item.prop1]) }} -
             {{ $methodsTools.onlyForma(scope.row[item.prop2]) }}
           </span>
+          <span v-else-if="item.scope === 'mix'">
+            {{ scope.row[item.prop1] }}/{{ scope.row[item.prop2] }}
+          </span>
           <span v-else>
             {{ scope.row[item.prop] }}{{ item.ch ? item.ch : "" }}
           </span>
@@ -252,6 +255,12 @@ export default {
           label: "学时",
           prop: "classHours",
         },
+        {
+          label: "学习进度(节)",
+          prop1: "stuAllNum",
+          prop2: "secAllNum",
+          scope: "mix",
+        },
         {
           label: "视频学习进度(节)",
           prop: "studyNum",
@@ -311,7 +320,8 @@ export default {
           prop2: "endTime",
           width: "100px",
           scope: "computerTimes",
-        }], //学习记录表格对应column
+        },
+      ], //学习记录表格对应column
       RemardList: [], //学习记录列表
       loading: false,
     };

+ 9 - 0
src/views/education/studentManageMent/studentXQ/studyRecord.vue

@@ -97,6 +97,9 @@
             {{ $methodsTools.onlyForma(scope.row[item.prop1]) }} -
             {{ $methodsTools.onlyForma(scope.row[item.prop2]) }}
           </span>
+          <span v-else-if="item.scope === 'mix'">
+            {{ scope.row[item.prop1] }}/{{ scope.row[item.prop2] }}
+          </span>
           <span v-else>
             {{ scope.row[item.prop] }}{{ item.ch ? item.ch : "" }}
           </span>
@@ -252,6 +255,12 @@ export default {
           label: "学时",
           prop: "classHours",
         },
+        {
+          label: "学习进度(节)",
+          prop1: "stuAllNum",
+          prop2: "secAllNum",
+          scope: "mix",
+        },
         {
           label: "视频学习进度(节)",
           prop: "studyNum",