谢杰标 2 лет назад
Родитель
Сommit
e5f66bd54d

+ 18 - 0
src/api/resource/good.js

@@ -60,4 +60,22 @@ export function goodsUpdateSpec(data) {
         method: 'post',
         data
     })
+}
+
+// 商品批量上下架
+export function goodsUpdateStatus(data) {
+    return request({
+        url: `/goods/batch/updateStatus`,
+        method: 'post',
+        data
+    })
+}
+
+// 商品批量删除
+export function goodsDel(data) {
+    return request({
+        url: `/goods/batch/del`,
+        method: 'post',
+        data
+    })
 }

+ 39 - 0
src/api/resource/videoManagement.js

@@ -0,0 +1,39 @@
+import request from '@/utils/request'
+
+// 课程批量删除
+export function courseBatchDel(data) {
+    return request({
+        url: `/course/batch/del`,
+        method: 'post',
+        data
+    })
+}
+
+
+// 模块批量删除
+export function moduleBatchDel(data) {
+    return request({
+        url: `/course/module/batch/del`,
+        method: 'post',
+        data
+    })
+}
+
+// 章批量删除
+export function chapterBatchDel(data) {
+    return request({
+        url: `/course/chapter/batch/del`,
+        method: 'post',
+        data
+    })
+}
+
+
+// 节批量删除
+export function sectionBatchDel(data) {
+    return request({
+        url: `/course/section/batch/del`,
+        method: 'post',
+        data
+    })
+}

+ 38 - 0
src/api/resource/volumeManagement.js

@@ -0,0 +1,38 @@
+import request from '@/utils/request'
+
+// 模块卷批量删除
+export function moduleVolumeBatchDel(data) {
+    return request({
+        url: `/bank/module/batch/del`,
+        method: 'post',
+        data
+    })
+}
+
+// 章批量删除
+export function chapterVolumeBatchDel(data) {
+    return request({
+        url: `/bank/chapter/batch/del`,
+        method: 'post',
+        data
+    })
+}
+
+
+// 试卷批量删除
+export function paperBatchDel(data) {
+    return request({
+        url: `/bank/exam/batch/del`,
+        method: 'post',
+        data
+    })
+}
+
+// 题目批量删除
+export function questionBatchDel(data) {
+    return request({
+        url: `/bank/question/batch/del`,
+        method: 'post',
+        data
+    })
+}

+ 27 - 19
src/components/Study/StudentInfo.vue

@@ -2,20 +2,23 @@
   <div class="studyInfo">
     <header>
       <div class="left"><i></i><span>学员信息</span></div>
-      <span v-for="(item, i) in headList" :key="i">
-        <strong style="color: red">「{{ i + 1 }}」</strong>
-        {{ item.lebel }}
-        <span v-if="item.key != 'num' && item.key != 'time'">{{
-          userData[item.key]
-        }}</span>
-        <span v-else-if="item.key == 'num'"
-          >完成{{ userData.stuAllNum + userData.recordNum }}节的内容学习</span
-        >
-        <span v-else-if="item.key == 'time'"
-          >{{ $methodsTools.onlyForma(userData.studyStartTime, false) }} -
-          {{ $methodsTools.onlyForma(userData.studyEndTime, false) }}</span
-        >
-      </span>
+      <div class="goods_info">
+        <span v-for="(item, i) in headList" :key="i">
+          <strong style="color: red">「{{ i + 1 }}」</strong>
+          {{ item.lebel }}
+          <span v-if="item.key != 'num' && item.key != 'time'">{{
+            userData[item.key]
+          }}</span>
+          <span v-else-if="item.key == 'num'"
+            >完成{{ userData.stuAllNum + userData.recordNum }}节的内容学习</span
+          >
+          <span v-else-if="item.key == 'time'"
+            >{{ $methodsTools.onlyForma(userData.studyStartTime, false) }} -
+            {{ $methodsTools.onlyForma(userData.studyEndTime, false) }}</span
+          >
+        </span>
+      </div>
+
       <el-button class="btn" type="primary" size="mini" @click="packUp">{{
         showBox ? "收起" : "展开"
       }}</el-button>
@@ -137,7 +140,8 @@ export default {
   & > header {
     display: flex;
     position: relative;
-    height: 48px;
+    flex-wrap: wrap;
+    // height: 48px;
     line-height: 48px;
     & > .left {
       display: flex;
@@ -156,10 +160,14 @@ export default {
         font-weight: bold;
       }
     }
-    & > span {
-      font-size: 14px;
-      padding-left: 20px;
-      white-space: nowrap;
+    & > .goods_info {
+      display: flex;
+      flex-wrap: wrap;
+      span {
+        font-size: 14px;
+        padding-left: 20px;
+        white-space: nowrap;
+      }
     }
     .btn {
       position: absolute;

+ 34 - 23
src/views/Marketing/goods/commodityManageMent/index.vue

@@ -20,9 +20,9 @@
       rowKey="goodsId"
     >
       <template slot="customize">
-        <el-button size="medium" @click="handelBatch(0)" type="success"
+        <el-button size="medium" @click="handelBatch(1)" type="success"
           >批量上架</el-button
-        ><el-button size="medium" @click="handelBatch(1)" type="success"
+        ><el-button size="medium" @click="handelBatch(0)" type="success"
           >批量下架</el-button
         ><el-button size="medium" @click="handelBatch(2)" type="warning"
           >批量删除</el-button
@@ -90,7 +90,12 @@
 import searchBoxNew from "@/components/searchBoxNew";
 import tableList from "@/components/tableList";
 import pagination from "@/components/pagination";
-import { getGoodsSpecList, goodsUpdateSpec } from "@/api/resource/good";
+import {
+  getGoodsSpecList,
+  goodsUpdateSpec,
+  goodsUpdateStatus,
+  goodsDel,
+} from "@/api/resource/good";
 export default {
   name: "CommodityManageMent",
   components: { searchBoxNew, tableList, pagination },
@@ -393,29 +398,35 @@ export default {
       if (!len) {
         return this.$message.warning("请先勾选商品");
       }
-      this.$confirm(
-        `此操作将所勾选的${len}条商品${['上架','下架','删除'][type]}, 是否继续?`,
-        "提示",
-        {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning",
-        }
-      )
+      let name = ["上架", "下架", "删除"][type];
+      this.$confirm(`此操作将所勾选的${len}条商品${name}, 是否继续?`, "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
         .then(() => {
-          const goodsList = this.$refs.tableList.allCheckData.map(
+          const goodsIds = this.$refs.tableList.allCheckData.map(
             (item) => item.goodsId
           );
-          // this.$api
-          //   .editbankquestion({
-          //     status: -1,
-          //     questionIds: questionIdsList,
-          //   })
-          //   .then((res) => {
-          //     this.$message.success("批量删除成功");
-          //     this.$refs.tableList.clearMoreActive();
-          //     this.search(1);
-          //   });
+          if (type == 2) {
+            goodsDel({
+              status: -1,
+              ids: goodsIds,
+            }).then((res) => {
+              this.$message.success("批量删除成功");
+              this.$refs.tableList.clearMoreActive();
+              this.search(1);
+            });
+          } else {
+            goodsUpdateStatus({
+              goodsStatus: type,
+              goodsIds,
+            }).then((res) => {
+              this.$message.success(`批量${name}成功`);
+              this.$refs.tableList.clearMoreActive();
+              this.search(1);
+            });
+          }
         })
         .catch(() => {});
     },

+ 27 - 23
src/views/education/mockTestManagement/mockExamArrangement/addMockExam/infoPage.vue

@@ -163,30 +163,34 @@
                   >删除</i
                 >
               </div>
-              <div style="margin-bottom: 10px">
-                指定开放学员,有购买一下商品:<el-button
-                  type="info"
-                  :size="size"
-                  @click="activeGoods(index, indexs)"
-                  >选择商品</el-button
-                >
-              </div>
-              <ul class="goodslist_style">
-                <li
-                  v-for="(ititem, itindex) in items.mockMajorSubjectGoodsList"
-                  :key="itindex"
-                >
-                  {{ ititem.goodsCode }}-{{ ititem.goodsName }}-<span
-                    style="color: red"
-                    >¥{{ ititem.price }}</span
-                  ><i
-                    class="deleteStyle"
-                    style="margin-left: 10px"
-                    @click="items.mockMajorSubjectGoodsList.splice(itindex, 1)"
-                    >删除</i
+              <template v-if="!listData.mockActivity">
+                <div style="margin-bottom: 10px">
+                  指定开放学员,有购买一下商品:<el-button
+                    type="info"
+                    :size="size"
+                    @click="activeGoods(index, indexs)"
+                    >选择商品</el-button
+                  >
+                </div>
+                <ul class="goodslist_style">
+                  <li
+                    v-for="(ititem, itindex) in items.mockMajorSubjectGoodsList"
+                    :key="itindex"
                   >
-                </li>
-              </ul>
+                    {{ ititem.goodsCode }}-{{ ititem.goodsName }}-<span
+                      style="color: red"
+                      >¥{{ ititem.price }}</span
+                    ><i
+                      class="deleteStyle"
+                      style="margin-left: 10px"
+                      @click="
+                        items.mockMajorSubjectGoodsList.splice(itindex, 1)
+                      "
+                      >删除</i
+                    >
+                  </li>
+                </ul>
+              </template>
             </div>
           </li>
         </ul>

+ 31 - 35
src/views/education/mockTestManagement/mockExamArrangement/editMockExam/infoPage.vue

@@ -163,34 +163,34 @@
                   >删除</i
                 >
               </div>
-              <div style="margin-bottom: 10px">
-                指定开放学员,有购买一下商品:<el-button
-                  type="info"
-                  :size="size"
-                  @click="activeGoods(index, indexs)"
-                  >选择商品</el-button
-                >
-              </div>
-              <ul class="goodslist_style">
-                <li
-                  v-for="(
-                    ititem, itindex
-                  ) in items.mockMajorSubjectGoodsList"
-                  :key="itindex"
-                >
-                  {{ ititem.goodsCode }}-{{ ititem.goodsName }}-<span
-                    style="color: red"
-                    >¥{{ ititem.price }}</span
-                  ><i
-                    class="deleteStyle"
-                    style="margin-left: 10px"
-                    @click="
-                      items.mockMajorSubjectGoodsList.splice(itindex, 1)
-                    "
-                    >删除</i
+              <template v-if="!listData.mockActivity">
+                <div style="margin-bottom: 10px">
+                  指定开放学员,有购买一下商品:<el-button
+                    type="info"
+                    :size="size"
+                    @click="activeGoods(index, indexs)"
+                    >选择商品</el-button
+                  >
+                </div>
+                <ul class="goodslist_style">
+                  <li
+                    v-for="(ititem, itindex) in items.mockMajorSubjectGoodsList"
+                    :key="itindex"
                   >
-                </li>
-              </ul>
+                    {{ ititem.goodsCode }}-{{ ititem.goodsName }}-<span
+                      style="color: red"
+                      >¥{{ ititem.price }}</span
+                    ><i
+                      class="deleteStyle"
+                      style="margin-left: 10px"
+                      @click="
+                        items.mockMajorSubjectGoodsList.splice(itindex, 1)
+                      "
+                      >删除</i
+                    >
+                  </li>
+                </ul>
+              </template>
             </div>
           </li>
         </ul>
@@ -239,9 +239,7 @@ export default {
             i < this.infoData[index].mockMajorSubjectList.length;
             i++
           ) {
-            if (
-              this.infoData[index].mockMajorSubjectList[i].subjectId === id
-            ) {
+            if (this.infoData[index].mockMajorSubjectList[i].subjectId === id) {
               status = true;
               break;
             }
@@ -282,7 +280,7 @@ export default {
      * 获取初始模考专业列表
      */
     getBybusinfoPage(data) {
-      console.log(data)
+      console.log(data);
       this.infoData = data;
     },
     /**
@@ -420,8 +418,7 @@ export default {
         educationTypeId: this.listData.educationTypeId,
         businessId: this.listData.businessId,
         examId: this.infoData[index].mockMajorSubjectList[indexs].examId,
-        examName:
-          this.infoData[index].mockMajorSubjectList[indexs].examName,
+        examName: this.infoData[index].mockMajorSubjectList[indexs].examName,
       });
     },
     /**
@@ -446,8 +443,7 @@ export default {
       this.$refs.activeSection.openBoxGoods(index, indexs, {
         educationTypeId: this.listData.educationTypeId,
         businessId: this.listData.businessId,
-        sectionId:
-          this.infoData[index].mockMajorSubjectList[indexs].sectionId,
+        sectionId: this.infoData[index].mockMajorSubjectList[indexs].sectionId,
         sectionName:
           this.infoData[index].mockMajorSubjectList[indexs].sectionName,
       });

+ 1 - 1
src/views/education/questionBankLearning/questionRecordPage/listOfQuestions/studentData/index.vue

@@ -386,7 +386,7 @@ export default {
             data.historyExamJson[i].type === 5) &&
           data.historyExamJson[i].scoreResult
         ) {
-          data.score += data.historyExamJson[i].scoreResult;
+          data.score += data.historyExamJson[i].scoreResult*1;
         }
       }
       data.historyExamJson = JSON.stringify(data.historyExamJson);

+ 10 - 11
src/views/resource/bankManagement/chapterVolumeManagement/index.vue

@@ -43,6 +43,7 @@
 import searchBoxNew from "@/components/searchBoxNew";
 import tableList from "@/components/tableList";
 import pagination from "@/components/pagination";
+import { chapterVolumeBatchDel } from "@/api/resource/volumeManagement";
 export default {
   components: { searchBoxNew, tableList, pagination },
   name: "ChapterVolumeManagement",
@@ -196,19 +197,17 @@ export default {
         }
       )
         .then(() => {
-          const questionIdsList = this.$refs.tableList.allCheckData.map(
+          const ids = this.$refs.tableList.allCheckData.map(
             (item) => item.chapterExamId
           );
-          this.$api
-            .editbankquestion({
-              status: -1,
-              questionIds: questionIdsList,
-            })
-            .then((res) => {
-              this.$message.success("批量删除成功");
-              this.$refs.tableList.clearMoreActive();
-              this.search(1);
-            });
+          chapterVolumeBatchDel({
+            status: -1,
+            ids,
+          }).then((res) => {
+            this.$message.success("批量删除成功");
+            this.$refs.tableList.clearMoreActive();
+            this.search(1);
+          });
         })
         .catch(() => {});
     },

+ 10 - 11
src/views/resource/bankManagement/testPaperManagement/index.vue

@@ -51,6 +51,7 @@ import searchBoxNew from "@/components/searchBoxNew";
 import tableList from "@/components/tableList";
 import pagination from "@/components/pagination";
 import testPaperPreview from "@/components/testPaperPreview";
+import { paperBatchDel } from "@/api/resource/volumeManagement";
 export default {
   name: "TestPaperManagement",
   components: { tableList, pagination, searchBoxNew, testPaperPreview },
@@ -200,19 +201,17 @@ export default {
         }
       )
         .then(() => {
-          const questionIdsList = this.$refs.tableList.allCheckData.map(
+          const ids = this.$refs.tableList.allCheckData.map(
             (item) => item.examId
           );
-          this.$api
-            .editbankquestion({
-              status: -1,
-              questionIds: questionIdsList,
-            })
-            .then((res) => {
-              this.$message.success("批量删除成功");
-              this.$refs.tableList.clearMoreActive();
-              this.search(1);
-            });
+          paperBatchDel({
+            status: -1,
+            ids,
+          }).then((res) => {
+            this.$message.success("批量删除成功");
+            this.$refs.tableList.clearMoreActive();
+            this.search(1);
+          });
         })
         .catch(() => {});
     },

+ 22 - 21
src/views/resource/bankManagement/topicManagement/index.vue

@@ -256,6 +256,7 @@ import busIns from "@/components/busIns";
 import questionBank from "@/components/questionBank";
 import wordPop from "./wordPop.vue";
 import excelPop from "./excelPop.vue";
+import { questionBatchDel } from "@/api/resource/volumeManagement";
 export default {
   components: {
     questionBank,
@@ -353,7 +354,7 @@ export default {
           prop: "type",
           hidden: true,
           scope: "topic",
-          width:"140px"
+          width: "140px",
         },
         {
           label: "标题前缀",
@@ -479,27 +480,27 @@ export default {
         this.$message.warning("请勾选需要删除的题目");
         return;
       }
-      this.$confirm(`此操作将永久删除所勾选的${this.$refs.tableList.allCheckData.length}条题目, 是否继续?`, "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-      })
+      this.$confirm(
+        `此操作将永久删除所勾选的${this.$refs.tableList.allCheckData.length}条题目, 是否继续?`,
+        "提示",
+        {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        }
+      )
         .then(() => {
-          const questionIdsList = this.$refs.tableList.allCheckData.map(
-            (item) => {
-              return item.questionId;
-            }
-          );
-          this.$api
-            .editbankquestion({
-              status: -1,
-              questionIds: questionIdsList,
-            })
-            .then((res) => {
-              this.$message.success("批量删除成功");
-              this.$refs.tableList.clearMoreActive();
-              this.search(1);
-            });
+          const ids = this.$refs.tableList.allCheckData.map((item) => {
+            return item.questionId;
+          });
+          questionBatchDel({
+            status: -1,
+            ids,
+          }).then((res) => {
+            this.$message.success("批量删除成功");
+            this.$refs.tableList.clearMoreActive();
+            this.search(1);
+          });
         })
         .catch(() => {});
       // console.log(this.$refs.tableList.)

+ 11 - 12
src/views/resource/bankManagement/volumeManagement/index.vue

@@ -43,6 +43,7 @@
 import searchBoxNew from "@/components/searchBoxNew";
 import tableList from "@/components/tableList";
 import pagination from "@/components/pagination";
+import { moduleVolumeBatchDel } from "@/api/resource/volumeManagement";
 export default {
   components: { searchBoxNew, tableList, pagination },
   name: "VolumeManagement",
@@ -50,7 +51,7 @@ export default {
     return {
       loading: false, //当前表单加载是否加载动画
       navText: {
-        title: "模块管理",
+        title: "模块管理",
         index: 0,
         ch: "条",
         border: true,
@@ -203,19 +204,17 @@ export default {
         }
       )
         .then(() => {
-          const questionIdsList = this.$refs.tableList.allCheckData.map(
+          const ids = this.$refs.tableList.allCheckData.map(
             (item) => item.moduleExamId
           );
-          this.$api
-            .editbankquestion({
-              status: -1,
-              questionIds: questionIdsList,
-            })
-            .then((res) => {
-              this.$message.success("批量删除成功");
-              this.$refs.tableList.clearMoreActive();
-              this.search(1);
-            });
+          moduleVolumeBatchDel({
+            status: -1,
+            ids,
+          }).then((res) => {
+            this.$message.success("批量删除成功");
+            this.$refs.tableList.clearMoreActive();
+            this.search(1);
+          });
         })
         .catch(() => {});
     },

+ 10 - 11
src/views/resource/videoManagement/chapter/index.vue

@@ -43,6 +43,7 @@
 import searchBoxNew from "@/components/searchBoxNew";
 import tableList from "@/components/tableList";
 import pagination from "@/components/pagination";
+import { chapterBatchDel } from "@/api/resource/videoManagement";
 export default {
   name: "Chapter",
   components: { searchBoxNew, tableList, pagination },
@@ -207,19 +208,17 @@ export default {
         }
       )
         .then(() => {
-          const questionIdsList = this.$refs.tableList.allCheckData.map(
+          const ids = this.$refs.tableList.allCheckData.map(
             (item) => item.chapterId
           );
-          this.$api
-            .editbankquestion({
-              status: -1,
-              questionIds: questionIdsList,
-            })
-            .then((res) => {
-              this.$message.success("批量删除成功");
-              this.$refs.tableList.clearMoreActive();
-              this.search(1);
-            });
+          chapterBatchDel({
+            status: -1,
+            ids,
+          }).then((res) => {
+            this.$message.success("批量删除成功");
+            this.$refs.tableList.clearMoreActive();
+            this.search(1);
+          });
         })
         .catch(() => {});
     },

+ 11 - 11
src/views/resource/videoManagement/courseManagement/index.vue

@@ -47,6 +47,7 @@
 import searchBoxNew from "@/components/searchBoxNew";
 import tableList from "@/components/tableList";
 import pagination from "@/components/pagination";
+import { courseBatchDel } from "@/api/resource/videoManagement";
 export default {
   name: "CourseManagement",
   components: { searchBoxNew, tableList, pagination },
@@ -235,19 +236,18 @@ export default {
         }
       )
         .then(() => {
-          const questionIdsList = this.$refs.tableList.allCheckData.map(
+          console.log(5646)
+          const ids = this.$refs.tableList.allCheckData.map(
             (item) => item.courseId
           );
-          this.$api
-            .editbankquestion({
-              status: -1,
-              questionIds: questionIdsList,
-            })
-            .then((res) => {
-              this.$message.success("批量删除成功");
-              this.$refs.tableList.clearMoreActive();
-              this.search(1);
-            });
+          courseBatchDel({
+            status: -1,
+            ids,
+          }).then((res) => {
+            this.$message.success("批量删除成功");
+            this.$refs.tableList.clearMoreActive();
+            this.search(1);
+          });
         })
         .catch(() => {});
     },

+ 10 - 11
src/views/resource/videoManagement/festival/index.vue

@@ -132,6 +132,7 @@ import * as baseUrls from "@/utils/request.js";
 import searchBoxNew from "@/components/searchBoxNew";
 import tableList from "@/components/tableList";
 import pagination from "@/components/pagination";
+import { sectionBatchDel } from "@/api/resource/videoManagement";
 export default {
   name: "Festival",
   components: { searchBoxNew, tableList, pagination },
@@ -346,19 +347,17 @@ export default {
         }
       )
         .then(() => {
-          const questionIdsList = this.$refs.tableList.allCheckData.map(
+          const ids = this.$refs.tableList.allCheckData.map(
             (item) => item.sectionId
           );
-          this.$api
-            .editbankquestion({
-              status: -1,
-              questionIds: questionIdsList,
-            })
-            .then((res) => {
-              this.$message.success("批量删除成功");
-              this.$refs.tableList.clearMoreActive();
-              this.search(1);
-            });
+          sectionBatchDel({
+            status: -1,
+            ids,
+          }).then((res) => {
+            this.$message.success("批量删除成功");
+            this.$refs.tableList.clearMoreActive();
+            this.search(1);
+          });
         })
         .catch(() => {});
     },

+ 10 - 11
src/views/resource/videoManagement/moduleManagement/index.vue

@@ -48,6 +48,7 @@ import searchBoxNew from "@/components/searchBoxNew";
 import tableList from "@/components/tableList";
 import pagination from "@/components/pagination";
 import giftQuestionPaper from "./giftQuestionPaper.vue";
+import { moduleBatchDel } from "@/api/resource/videoManagement";
 export default {
   name: "ModuleManagement",
   components: { searchBoxNew, tableList, pagination, giftQuestionPaper },
@@ -214,19 +215,17 @@ export default {
         }
       )
         .then(() => {
-          const questionIdsList = this.$refs.tableList.allCheckData.map(
+          const ids = this.$refs.tableList.allCheckData.map(
             (item) => item.moduleId
           );
-          this.$api
-            .editbankquestion({
-              status: -1,
-              questionIds: questionIdsList,
-            })
-            .then((res) => {
-              this.$message.success("批量删除成功");
-              this.$refs.tableList.clearMoreActive();
-              this.search(1);
-            });
+          moduleBatchDel({
+            status: -1,
+            ids,
+          }).then((res) => {
+            this.$message.success("批量删除成功");
+            this.$refs.tableList.clearMoreActive();
+            this.search(1);
+          });
         })
         .catch(() => {});
       // console.log(this.$refs.tableList.)