WXL
2024-09-03 d03829bdf327d0e457a2f4e3699a69d5ad47d3a3
src/views/knowledge/questionnaire/compilequer/index.vue
@@ -695,7 +695,7 @@
            <div
              class="scriptTopic-dev"
              :key="item.sort"
              v-if="item.scriptType == 3"
              v-if="item.scriptType == 4"
            >
              <div class="dev-text">
                {{ item.sort }}、[填空]<span>{{ item.scriptContent }}</span>
@@ -1278,13 +1278,13 @@
  },
  activated() {
    if (this.id != this.$route.query.id) {
      this.gettabList();
      this.getissueinfo();
      this.gettabList();
    }
  },
  created() {
    this.gettabList();
    this.getissueinfo();
    this.gettabList();
    this.mode = store.getters.Askmode;
    this.languagelist = store.getters.languagelist;
    this.usable = store.getters.usable;
@@ -1337,6 +1337,12 @@
    // 获取数据
    getissueinfo() {
      this.id = this.$route.query.id;
      this.ruleForm = {
        svyTemplateLibScripts: [],
        tempDetpRelevances: [],
        svyLibTemplateTagList: [],
      };
      if (this.id) {
        getQtemplateobj({ svyid: this.id }).then((res) => {
          this.ruleForm = res.rows[0];
@@ -1365,9 +1371,11 @@
      });
    },
    submitForm(formName) {
      this.$modal.loading("正在上传数据,请稍候...");
      this.$modal.loading("正在修正保存数据,请稍候...");
      this.ruleForm.suitway = this.ruleForm.suitway.join(",");
      if (!this.ruleForm.categoryid) {
        this.ruleForm.categoryid = -1;
      }
      if (this.id) {
        this.ruleForm.isoperation = 2;
        compileQtemplate(this.ruleForm).then((res) => {
@@ -1808,12 +1816,15 @@
      const allGreaterThanTen = arr.every((array) => {
        const totalScore = array.reduce((accumulator, current) => {
          return accumulator + current.score;
          return accumulator + Number(current.score);
        }, 0);
        console.log(totalScore);
        console.log(this.ruleForm.scriptScore);
        return totalScore == this.ruleForm.scriptScore;
      });
      if (allGreaterThanTen) {
        this.$modal.msgSuccess("题目分值累加和模版总分相符");
        this.$modal.msgSuccess("分值校验成功");
      } else {
        this.$modal.msgError("题目分值累加和模版分值不符");
      }