xiejiebiao 2 лет назад
Родитель
Сommit
43207f0a11

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

@@ -78,4 +78,13 @@ export function goodsDel(data) {
         method: 'post',
         data
     })
+}
+
+// 新增每日一练试卷时间
+export function addExamTime(data) {
+    return request({
+        url: `/goods/addExamTime`,
+        method: 'post',
+        data
+    })
 }

+ 8 - 0
src/newApi/goods.js

@@ -40,6 +40,14 @@ export default {
             params: data
         })
     },
+    // 获取题库商品每日一练试卷列表
+    getBankGoodsExamList(id) {
+        return request({
+            url: '/goods/getBankGoodsExamList/'+id,
+            method: 'get',
+        })
+    },
+    
     //查询前培或补考商品列表
     inquireGoodslistGoods(data) {
         return request({

+ 116 - 0
src/views/Marketing/goods/commodityManageMent/DayPracticeSetDialog.vue

@@ -0,0 +1,116 @@
+<template>
+  <Base-dialog title="设置" width="700px" :isShow.sync="isShow" @submit="submit">
+    <div class="day-set-box">
+      <el-select v-model="atype" placeholder="请选择">
+        <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
+        </el-option>
+      </el-select>
+      <el-form :model="{ list }" ref="ruleForm" label-width="400px" class="demo-ruleForm" label-position="left">
+        <el-form-item :label="item.examName
+        " v-for="(item, index) in list" :key="item.id" :prop="'list.' + index + '.examTime'"
+          :rules="{ validator: validateDate, trigger: 'change' }">
+          <el-date-picker style="witdh: 150px" v-model="item.examTime" type="date" placeholder="选择日期"
+            :picker-options="pickerOptions" value-format="timestamp">
+          </el-date-picker>
+        </el-form-item>
+      </el-form>
+    </div>
+  </Base-dialog>
+</template>
+
+<script>
+import {
+  addExamTime
+} from "@/api/resource/good";
+export default {
+  data() {
+    return {
+      list: [],
+      options: [
+        {
+          value: "1",
+          label: "顺序添加",
+        },
+      ],
+      atype: "1",
+      pickerOptions: {
+        disabledDate(time) {
+          return time.getTime() < Date.now() - 24 * 60 * 60 * 1000;
+        },
+      },
+      isShow: false,
+    };
+  },
+  methods: {
+    init() {
+      this.atype = "1";
+      this.list = []
+      this.$nextTick(() => {
+        this.$refs.ruleForm.clearValidate();
+      });
+    },
+    open(goodsId) {
+      this.isShow = true;
+      this.init();
+      this.getList(goodsId)
+    },
+    submit() {
+      this.$refs.ruleForm.validate((valid) => {
+        if (valid) {
+          let list = JSON.parse(JSON.stringify(this.list));
+          list.map(e => {
+            if (e.examTime) {
+              e.examTime /= 1000
+            }
+          })
+          addExamTime(list).then(res => {
+            this.$message.success("设置成功") ;
+            this.isShow = false
+          })
+        } else {
+          return false;
+        }
+      });
+    },
+    validateDate(rule, value, callback) {
+      if (!value) {
+        return callback();
+      }
+      let list = this.list.filter((e) => e.examTime == value);
+      if (list.length > 1) {
+        return callback(new Error("存在重复时间"));
+      }
+      return callback();
+    },
+    getList(goodsId) {
+      this.$api.getBankGoodsExamList(goodsId).then((res) => {
+        res.data.map(e => {
+          if (e.examTime) {
+            e.examTime *= 1000
+          }
+        })
+        this.list = res.data;
+      });
+    },
+  },
+
+};
+</script>
+
+<style lang="scss" scoped>
+.day-set-box {
+  .demo-ruleForm {
+    max-height: 500px;
+    overflow-x: auto;
+    margin-top: 30px;
+    padding-left: 20px;
+
+    /deep/ {
+      .el-date-editor.el-input,
+      .el-date-editor.el-input__inner {
+        width: 150px;
+      }
+    }
+  }
+}
+</style>

+ 5 - 1
src/views/Marketing/goods/commodityManageMent/index.vue

@@ -39,6 +39,8 @@
           type="text"
           @click="setTeacher(props.scope.row)"
           >双师制设置</el-button
+        ><el-button v-if="props.scope.row.examRecord" type="text" @click="$refs.dayPracticeSet.open(props.scope.row.goodsId)"
+          >每日一练设置</el-button
         >
         <el-button type="text" @click="addClick(props.scope.row, 0)"
           >修改</el-button
@@ -84,6 +86,7 @@
         <el-button type="primary" @click="submit">确 定</el-button>
       </span>
     </el-dialog>
+    <Day-practice-set-dialog ref="dayPracticeSet"></Day-practice-set-dialog>
   </div>
 </template>
 
@@ -91,6 +94,7 @@
 import searchBoxNew from "@/components/searchBoxNew";
 import tableList from "@/components/tableList";
 import pagination from "@/components/pagination";
+import DayPracticeSetDialog from "./DayPracticeSetDialog.vue";
 import {
   getGoodsSpecList,
   goodsUpdateSpec,
@@ -99,7 +103,7 @@ import {
 } from "@/api/resource/good";
 export default {
   name: "CommodityManageMent",
-  components: { searchBoxNew, tableList, pagination },
+  components: { searchBoxNew, tableList, pagination, DayPracticeSetDialog },
   data() {
     return {
       loading: false, //当前表单加载是否加载动画

+ 13 - 2
src/views/Marketing/goods/commodityManageMent/poppleSetTKCOPY.vue

@@ -34,7 +34,11 @@
       >
         <span class="custom-tree-node" slot-scope="{ node }">
           <span>{{ node.label }}</span>
-          <span v-if="node.checked"
+          <span
+            v-if="
+              node.checked &&
+              !(node.paperName == '随机练习' || node.paperName == '每日一练')
+            "
             >试做前
             <el-input-number
               v-model="node.data.num"
@@ -87,6 +91,11 @@ export default {
     },
     inits() {
       this.datas = JSON.parse(JSON.stringify(this.copyData));
+      this.datas.map((e) => {
+        if (e.paperName == "随机练习" || e.paperName == "每日一练") {
+          e.disabled = true;
+        }
+      });
     },
     openExpand() {
       if (this.examConfigList) {
@@ -94,7 +103,7 @@ export default {
           JSON.stringify(this.examConfigList)
         );
         var arrays = this.examConfigList.map((item) => {
-          return item.TypeId
+          return item.TypeId;
         });
         this.$nextTick(() => {
           this.audition = arrays;
@@ -242,6 +251,8 @@ export default {
                     }
                   });
                 }
+                item.disabled =
+                  item.paperName == "随机练习" || item.paperName == "每日一练";
                 item.hasChildren = false;
               });
               return resolve(res.data);

+ 7 - 4
src/views/education/mockTestManagement/mockExamArrangement/activeExam.vue

@@ -90,7 +90,9 @@
                   scope.row[item.prop3]
                 }}
               </span>
-              <span v-else-if="item.scope === 'fabStatus'">{{scope.row[item.prop] === 1 ? '已发布':'未发布'}}</span>
+              <span v-else-if="item.scope === 'fabStatus'">{{
+                scope.row[item.prop] === 1 ? "已发布" : "未发布"
+              }}</span>
               <span v-else>{{ scope.row[item.prop] }}</span></template
             >
           </el-table-column>
@@ -171,8 +173,8 @@ export default {
     };
   },
   methods: {
-    openBoxGoods(index, indexs,obj) {
-      this.getData = JSON.parse(JSON.stringify(obj))
+    openBoxGoods(index, indexs, obj) {
+      this.getData = JSON.parse(JSON.stringify(obj));
       this.$set(this.examActiveObj, "examId", obj.examId);
       this.$set(this.examActiveObj, "examName", obj.examName);
       this.index = index;
@@ -201,7 +203,7 @@ export default {
         .then((res) => {
           this.tableData = res.rows;
           this.total = res.total;
-          console.log(this.examActiveObj)
+          console.log(this.examActiveObj);
         })
         .finally(() => {
           this.loading = false;
@@ -216,6 +218,7 @@ export default {
         key: "",
         publishStatus: 1,
         status: 1,
+        exclude: 1,
         // paperName: "模考配的试卷",
       };
       this.getGoods();

+ 5 - 0
src/views/resource/bankManagement/chapterVolumeManagement/index.vue

@@ -152,6 +152,11 @@ export default {
           prop: "examNum",
           hidden: true,
         },
+        {
+          label: "题目总数",
+          prop: "questionNum",
+          hidden: true,
+        },
         {
           label: "最后编辑时间",
           prop: "updateTime",

+ 28 - 18
src/views/resource/videoManagement/courseManagement/chapterContent/index.vue

@@ -190,7 +190,12 @@
       />
       <span slot="footer" class="dialog-footer">
         <el-button @click="dialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="submitForm" :disabled="activeLists.length === 0">确 定</el-button>
+        <el-button
+          type="primary"
+          @click="submitForm"
+          :disabled="activeLists.length === 0"
+          >确 定</el-button
+        >
       </span>
     </el-dialog>
     <el-dialog
@@ -606,7 +611,7 @@ export default {
       }
     },
     initSort() {
-      this.sortList = JSON.parse(JSON.stringify(this.tableDataInfos));  
+      this.sortList = JSON.parse(JSON.stringify(this.tableDataInfos));
     },
     submitTableBoxs() {
       let arr = this.sortList.map((items) => {
@@ -650,12 +655,12 @@ export default {
     //1确定关联试卷弹窗
     submitExam() {
       if (!this.templateRadio && !this.goodsName) {
-        console.log(this.menuExamList,'this.menuExamList111111');
+        console.log(this.menuExamList, "this.menuExamList111111");
         this.menuExamList = this.menuExamList.filter((item) => {
           return item.onlyId != this.onlyId;
         });
       } else {
-        console.log(this.menuExamList,'this.menuExamList222222');
+        console.log(this.menuExamList, "this.menuExamList222222");
         var arrays = {};
         let ast = this.onlyId.split("-").map(Number);
         arrays = {
@@ -684,7 +689,7 @@ export default {
     },
     //开启关联试卷盒子
     openExamBox(node, item) {
-      console.log(this.tableDataInfos,'this.tableDataInfos');
+      console.log(this.tableDataInfos, "this.tableDataInfos");
       var ints = item.id.split("-").map(Number);
       var arr = [];
       if (ints[0] === 1) {
@@ -799,6 +804,7 @@ export default {
       data.businessId = this.pageInfo.businessId;
       data.subjectId = this.pageInfo.subjectId;
       data.name = this.formData6.name;
+      data.exclude = 1;
       this.$api.inquirebankexamList(data).then((res) => {
         this.tableDataExam = res.rows;
         this.total6 = res.total;
@@ -844,7 +850,7 @@ export default {
       this.centerDialogVisible = false;
       this.dialogVisible = true;
       this.$nextTick(function () {
-        self.activeLists = []
+        self.activeLists = [];
         self.$refs.multipleTable.clearSelection();
       });
     },
@@ -1037,7 +1043,7 @@ export default {
       var array = [];
       array = this.tableDataInfos.map((item) => {
         if (item.type === this.radio) {
-          return item.CodeId
+          return item.CodeId;
         }
       });
       if (
@@ -1245,17 +1251,21 @@ export default {
           sort: item.sort,
         });
       });
-      if(this.menuExamList && this.menuExamList.length > 0){
-          this.menuExamList.forEach((item) => {
-              if(item.moduleId != 0 && item.sectionId == 0 && item.chapterId == 0){
-                item.type = 3
-              }else if(item.sectionId != 0){
-                item.type = 2
-              }else{
-                item.type = 1
-              }
-          })
-      } 
+      if (this.menuExamList && this.menuExamList.length > 0) {
+        this.menuExamList.forEach((item) => {
+          if (
+            item.moduleId != 0 &&
+            item.sectionId == 0 &&
+            item.chapterId == 0
+          ) {
+            item.type = 3;
+          } else if (item.sectionId != 0) {
+            item.type = 2;
+          } else {
+            item.type = 1;
+          }
+        });
+      }
       var data = {
         courseId: Number(this.$route.query.id),
         menuExamList: this.menuExamList,