WXL
2024-06-21 4fffa66d14a2b2943b35aca961317f3bed6649a0
src/views/knowledge/questionnaire/compilequer/index.vue
@@ -39,28 +39,48 @@
          label-width="100px"
          class="demo-ruleForm"
        >
          <el-form-item label="问卷分类" prop="region">
            <el-select
              v-model="ruleForm.categoryid"
              size="medium"
              filterable
              placeholder="请选择分类"
            >
              <el-option-group
                v-for="group in optionsclass"
                :key="group.id"
                :label="group.name"
              >
                <el-option
                  v-for="item in group.svyLibTemplateCategoryList"
                  :key="item.id"
                  :label="item.name"
                  :value="item.id"
          <el-row :gutter="10">
            <el-col :span="10">
              <el-form-item label="问卷分类" prop="region">
                <el-select
                  v-model="ruleForm.categoryid"
                  size="medium"
                  filterable
                  placeholder="请选择分类"
                >
                </el-option>
              </el-option-group>
            </el-select>
          </el-form-item>
                  <el-option-group
                    v-for="group in optionsclass"
                    :key="group.id"
                    :label="group.name"
                  >
                    <el-option
                      v-for="item in group.svyLibTemplateCategoryList"
                      :key="item.id"
                      :label="item.name"
                      :value="item.id"
                    >
                    </el-option>
                  </el-option-group>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item label="评价类型">
                <el-select
                  v-model="ruleForm.scoreType"
                  placeholder="请选择分类"
                >
                  <el-option
                    v-for="group in appraiselist"
                    :key="group.value"
                    :label="group.label"
                    :value="group.value"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-form-item label="问卷标题" prop="name">
            <div style="width: 30%">
              <el-input v-model="ruleForm.svyname"></el-input>
@@ -267,14 +287,31 @@
      <div v-if="Editprogress == 2">
        <div class="leftvlue-jbxx">问卷题目设置</div>
        <el-divider></el-divider>
        <div class="addtopic">
          <el-button
            type="primary"
            icon="el-icon-plus"
            round
            @click="getaddtopiclist"
            >添加题目</el-button
          >
        <div style="display: flex; justify-content: space-between">
          <div>
            <el-button
              type="primary"
              icon="el-icon-plus"
              round
              @click="getaddtopiclist"
              >添加题目</el-button
            >
          </div>
          <div style="display: flex">
            <span
              style="
                width: 180px;
                font-size: 20px;
                font-weight: normal;
                color: red;
              "
              >问卷总分:</span
            >
            <el-input
              v-model="ruleForm.scriptScore"
              placeholder="请输入分数"
            ></el-input>
          </div>
        </div>
        <div class="presentation">
          <div class="presentation-left">
@@ -401,7 +438,7 @@
                        <el-input
                          type="text"
                          placeholder="请输入"
                          v-model="item.topicid"
                          v-model="item.id"
                          show-word-limit
                        >
                        </el-input> </el-form-item
@@ -657,6 +694,11 @@
        { value: "topic", table: "topic" },
        { value: "topic", table: "topic" },
      ],
      appraiselist: [
        { label: "分数", value: "1" },
        { label: "ABC等级", value: "2" },
        { label: "优良等级", value: "3" },
      ],
      fileList: [
        {
@@ -775,6 +817,8 @@
      });
    },
    submitForm(formName) {
      this.$modal.loading("正在上传数据,请稍候...");
      this.ruleForm.labelInfo = this.dynamicTags.join(",");
      this.ruleForm.suitway = this.ruleForm.suitway.join(",");
@@ -782,12 +826,16 @@
        this.ruleForm.isoperation = 2;
        compileQtemplate(this.ruleForm).then((response) => {
          this.$modal.msgSuccess("修改成功");
          this.$modal.closeLoading();
          this.$router.go(-1);
        });
      } else {
        this.ruleForm.isoperation = 1;
        compileQtemplate(this.ruleForm).then((response) => {
          this.$modal.msgSuccess("新增成功");
          this.$modal.closeLoading();
          this.$router.go(-1);
        });
      }
@@ -799,11 +847,9 @@
      this.ruleForm.svyLibScripts = this.ruleForm.svyLibScripts.concat(
        this.delScriptVOList
      );
      console.log(this.ruleForm.svyLibScripts, "this.ruleForm.svyLibScripts");
      const result = this.tempDetpRelevanceslist.map(
        (subArr) => subArr[subArr.length - 1]
      );
      console.log(result, "result");
      // id数组查数组对象
      result.forEach((item) => {
        const condition = this.ruleForm.tempDetpRelevances.some(
@@ -817,7 +863,6 @@
          });
        }
      });
      console.log(this.ruleForm.tempDetpRelevances);
      // 数组对象查id数组
      this.ruleForm.tempDetpRelevances.forEach((item) => {
        const condition = result.some((obj) => obj === item.deptId);
@@ -827,7 +872,6 @@
          this.ruleForm.tempDetpRelevances[index].delFlag = 1;
        }
      });
      console.log(this.ruleForm.tempDetpRelevances);
      setTimeout(() => {
        this.submitForm();
      }, 1000);
@@ -872,10 +916,11 @@
    // 新增题目
    addtopic(row) {
      row.isoperation = 1;
      row.svyLibTemplateTargetoptions.forEach((item) => {
      row.svyLibScriptOptions.forEach((item) => {
        item.isoperation = 1;
      });
      this.ruleForm.svyLibScripts.push(row);
      this.$modal.msgSuccess("新增成功");
    },
    handleDelete(row) {
      let index = this.ruleForm.svyLibScripts.indexOf(row);
@@ -917,9 +962,7 @@
    },
    // 修改题目信息
    Submittopicobj() {
    },
    Submittopicobj() {},
    // 新增变量
    addvariable() {
      this.variablelist.push({