WXL
2024-10-12 9da8c98e3a623e6758ee45e2b74b78837398c650
测试完成
已修改2个文件
73 ■■■■ 文件已修改
src/views/patient/propaganda/QuestionnaireTask.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/repositoryai/templateku/configurat/index.vue 69 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/patient/propaganda/QuestionnaireTask.vue
@@ -1422,7 +1422,11 @@
      getTaskQuestioncomit(this.form.templateid).then((res) => {
        if (res.code == 200) {
          this.objyl = res.data;
          if (this.objyl.taskid = data.taskId) {
          this.objyl.isoperation = 1;
          }else{
          this.objyl.isoperation = 2;
          }
          this.objyl.taskid = data.taskId;
          TaskQuestioncomit(this.objyl).then((response) => {
            this.previewtf = false;
src/views/repositoryai/templateku/configurat/index.vue
@@ -267,7 +267,7 @@
                >
                  <el-option
                    class="ruleFormaa"
                    v-for="item in belongDepts"
                    v-for="item in flatArray"
                    :key="item.deptCode"
                    :label="item.deptName"
                    :value="item.deptCode"
@@ -290,7 +290,7 @@
                >
                  <el-option
                    class="ruleFormaa"
                    v-for="item in belongWards"
                    v-for="item in flatArray"
                    :key="item.districtCode"
                    :label="item.districtName"
                    :value="item.districtCode"
@@ -1361,7 +1361,8 @@
  getFollowuplist,
  deltargetillness,
  getillnesslist,
  depthospgetsonlist ,
  depthospgetson,
  depthospgetsonlist,
  illnesslistget,
  getillness,
  getgenerallist,
@@ -1464,6 +1465,7 @@
        { variatename: "病情", variate: "${illness}", default: 1 },
      ],
      deptList: [],
      flatArray:[],
      props: { multiple: true, value: "deptId", label: "deptName" },
      variablelist: [
@@ -1503,7 +1505,7 @@
      this.gettabList();
      this.getvFollowup();
      this.auxiliary();
    }else{
    } else {
      this.tempDetpRelevanceslistform = [];
      this.tempbelongWardsform = [];
    }
@@ -1555,11 +1557,33 @@
      this.id = this.$route.query.id;
      this.task = this.$route.query.task;
    },
    // 获取科室树
    getDeptTree() {
      // 科室列表
      deptTreeSelect().then((response) => {
        this.deptOptions = response.data;
        this.flatArray = this.flattenArray(response.data);
        console.log(this.flatArray,'扩展数据');
      });
    },
    flattenArray(multiArray) {
      let result = [];
      // 递归函数,用于将多级数组转换为一维数组
      function flatten(element, parentId) {
        // 克隆元素以避免修改原始数据
        let item = JSON.parse(JSON.stringify(element));
        if (parentId !== undefined) {
          item.parentId = parentId; // 使用字符串或数字作为键
        }
        result.push(item); // 将元素添加到结果数组
        if (element.children && element.children.length > 0) {
          element.children.forEach((child) => flatten(child, element.id)); // 递归处理子元素
        }
      }
      multiArray.forEach((element) => flatten(element, null)); // 从顶层元素开始递归
      return result; // 返回一维数组
    },
    // 获取表单数据
    getvFollowup() {
@@ -1668,9 +1692,12 @@
        this.ruleForm.assortid = -1;
      }
      this.ruleForm.labelInfo = JSON.stringify(this.dynamicTags);
      if (Array.isArray(this.ruleForm.suitway)) this.ruleForm.suitway = this.ruleForm.suitway.join(",");
      if (Array.isArray(this.ruleForm.campus))this.ruleForm.campus = this.ruleForm.campus.join(",");
      if (Array.isArray(this.ruleForm.submoduleID))this.ruleForm.submoduleID = this.ruleForm.submoduleID.join(",");
      if (Array.isArray(this.ruleForm.suitway))
        this.ruleForm.suitway = this.ruleForm.suitway.join(",");
      if (Array.isArray(this.ruleForm.campus))
        this.ruleForm.campus = this.ruleForm.campus.join(",");
      if (Array.isArray(this.ruleForm.submoduleID))
        this.ruleForm.submoduleID = this.ruleForm.submoduleID.join(",");
      //   提交
      this.ruleForm.ivrLibaTemplateScriptVOList.forEach((res) => {
@@ -1754,8 +1781,8 @@
      }, 1000);
      // this.submitForm();
    },
     // 保存科室/病区
     putbelongDepts(id) {
    // 保存科室/病区
    putbelongDepts(id) {
      if (this.tempDetpRelevanceslistform.length > 0) {
        depthospgetson(this.tempDetpRelevanceslistform).then((res) => {
          if (res.code == 200) {
@@ -1875,10 +1902,12 @@
              isoperation: 1,
            };
          }
          const exists = this.dynamicTags.some(department => department.tagname === tagname);
          const exists = this.dynamicTags.some(
            (department) => department.tagname === tagname
          );
          if (exists) {
            this.$modal.msgError("标签重复");
            return
            return;
          }
          this.ruleForm.ivrLibaTemplateTagList.push(tagvalue);
          this.dynamicTags.push(tagvalue);
@@ -2047,8 +2076,8 @@
    resetForm(formName) {
      this.$refs[formName].resetFields();
    },
  // 科室删除触发
  removetag(row) {
    // 科室删除触发
    removetag(row) {
      let result = this.deptlist
        .filter((item) => item.deptCode == row)
        .map((item) => item.id);
@@ -2065,12 +2094,12 @@
      let result = this.hosplist
        .filter((item) => item.deptCode == row)
        .map((item) => item.id);
        if (result.length) {
          depthospgetsondel(result).then((res) => {
            if (res.code) {
            }
          });
        }
      if (result.length) {
        depthospgetsondel(result).then((res) => {
          if (res.code) {
          }
        });
      }
    },
    // 预览---------------
    preview() {
@@ -2084,7 +2113,7 @@
        .confirm("即将前往模板测试页面,请确认模板数据已保存。")
        .then((res) => {
          this.$router.push({
            path: "/knowledge/tpuconfigurat/measurement",
            path: "/knowledge/templateku/configurat/measurement",
            query: { id: this.id, name: this.ruleForm.templateName },
          });
        })