WXL
2025-08-07 6f1e7a63fa6afc261ba2247bf1d56f59dbb9f4c9
src/views/patient/propaganda/Missioncreation.vue
@@ -124,7 +124,7 @@
                      </el-select> </el-form-item
                  ></el-col>
                </el-row>
                    <el-form-item label="执行周期" prop="longTask">
                <el-form-item label="执行周期" prop="longTask">
                  <el-radio-group v-model="form.longTask">
                    <el-radio :label="0">自定义周期</el-radio>
                    <el-radio :label="1">长期任务</el-radio>
@@ -147,7 +147,10 @@
                    <el-radio :label="2">即刻发送</el-radio>
                  </el-radio-group>
                </el-form-item>
                <el-form-item label="执行日期:" v-if="form.sendType == 1&& !form.longTask">
                <el-form-item
                  label="执行日期:"
                  v-if="form.sendType == 1 && !form.longTask"
                >
                  <el-date-picker
                    v-model="daytime"
                    @change="changeTimeday"
@@ -160,7 +163,10 @@
                  </el-date-picker>
                </el-form-item>
                <el-form-item label="执行时间点:" v-if="form.sendType == 3&& !form.longTask">
                <el-form-item
                  label="执行时间点:"
                  v-if="form.sendType == 3 && !form.longTask"
                >
                  <div style="display: flex">
                    <div style="margin-right: 10px">
                      <el-date-picker
@@ -175,7 +181,10 @@
                  </div>
                </el-form-item>
                <el-form-item label="执行时间段:" v-if="form.sendType == 1&& !form.longTask">
                <el-form-item
                  label="执行时间段:"
                  v-if="form.sendType == 1 && !form.longTask"
                >
                  <div style="display: flex">
                    <div style="margin-right: 10px">
                      <span style="font-size: 18px; margin-right: 10px">①</span>
@@ -406,7 +415,6 @@
                        icon="el-icon-upload2"
                        size="medium"
                        @click="handleImport"
                        >导入</el-button
                      >
                    </el-col>
@@ -530,11 +538,19 @@
    <!-- 模板预览 -->
    <el-dialog title="模板预览" :visible.sync="previewtf" width="60%">
      <div class="preview-left">
        <!-- 单选 -->
        <div v-html="htmlRichText"></div>
        <!-- 根据模板类型显示不同内容 -->
        <div v-if="currentTemplateType == '2'">
          <!-- 通知模板只显示纯文本内容 -->
          <div style="white-space: pre-wrap; font-size: 16px; line-height: 1.6">
            {{ plainTextContent }}
          </div>
        </div>
        <div v-else>
          <!-- 其他类型模板显示富文本内容 -->
          <div v-html="htmlRichText"></div>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <!-- <el-button @click="previewGo">前往模板详情修改</el-button> -->
        <el-button type="primary" @click="previewFn">确认使用</el-button>
      </span>
    </el-dialog>
@@ -606,13 +622,16 @@
        <el-table :data="uploadingData" style="width: 100%">
          <el-table-column prop="serial" label="患者id"> </el-table-column>
          <el-table-column prop="name" label="姓名"
          width="100"> </el-table-column>
          <el-table-column prop="sex" label="性别"width="100"> </el-table-column>
          <el-table-column prop="idcardno" width="300" label="证件号码"> </el-table-column>
          <el-table-column prop="name" label="姓名" width="100">
          </el-table-column>
          <el-table-column prop="sex" label="性别" width="100">
          </el-table-column>
          <el-table-column prop="idcardno" width="300" label="证件号码">
          </el-table-column>
          <el-table-column prop="goday" label="出生日期"> </el-table-column>
          <el-table-column prop="telcode" width="200" label="联系方式"> </el-table-column>
          <el-table-column prop="createTime"  width="200" label="创建日期">
          <el-table-column prop="telcode" width="200" label="联系方式">
          </el-table-column>
          <el-table-column prop="createTime" width="200" label="创建日期">
          </el-table-column>
        </el-table>
        <!-- <pagination
@@ -653,26 +672,20 @@
              <el-form-item label="宣教名称">
                <el-input v-model="topqueryParams.preachname"></el-input>
              </el-form-item>
              <el-form-item label="宣教分类" prop="region">
              <el-form-item label="宣教类型" prop="region">
                <el-select
                  v-model="topqueryParams.assortid"
                  v-model="topqueryParams.hetype"
                  size="medium"
                  filterable
                  placeholder="请选择分类"
                >
                  <el-option-group
                    v-for="group in sortlist"
                    :key="group.id"
                    :label="group.assortname"
                  <el-option
                    v-for="item in heLibraryAssortList"
                    :key="item.id"
                    :label="item.value"
                    :value="item.id"
                  >
                    <el-option
                      v-for="item in group.heLibraryAssortList"
                      :key="item.id"
                      :label="item.assortname"
                      :value="item.id"
                    >
                    </el-option>
                  </el-option-group>
                  </el-option>
                </el-select>
              </el-form-item>
@@ -767,6 +780,8 @@
    return {
      title: "宣教内容列表",
      currenttype: 1, //1宣教2门诊3出院4复诊5体检6问卷
      currentTemplateType: "", // 当前模板类型
      plainTextContent: "", // 纯文本内容
      id: "", //
      previewid: "", //任务模板传递id
      libName: "",
@@ -816,7 +831,7 @@
      tableLabelxj: [
        { label: "创建人", width: "", prop: "createBy" },
        { label: "宣教名称", width: "180", prop: "preachname" },
        { label: "宣教描述", width: "180", prop: "preachcontent" },
        { label: "宣教内容", width: "180", prop: "preachcontent" },
        // { label: "宣教形式", width: "", prop: "playType" },
        { label: "适用方式", width: "", prop: "suitway" },
        { label: "修改日期", width: "", prop: "uploadTime" },
@@ -930,6 +945,10 @@
      ],
      variableListTime: [],
      sortlist: [],
      heLibraryAssortList: [
        { id: 1, value: "宣教" },
        { id: 2, value: "通知" },
      ],
      tasktopic: null, //新增类型
      SelectPatientslist: [],
      form: {
@@ -939,7 +958,10 @@
        templatename: "",
        templateid: null,
        libtemplateid: null,
        kcb: "亲爱的患者-家属,我们是"+localStorage.getItem("orgname")+"的医护人员,为了更好地了解您的康复情况,请您抽一点宝贵时间,观看这份宣教资讯。",
        kcb:
          "亲爱的患者-家属,我们是" +
          localStorage.getItem("orgname") +
          "的医护人员,为了更好地了解您的康复情况,请您抽一点宝贵时间,观看这份宣教资讯。",
        jsy: "生活上要劳逸结合,注意休息和营养,适当锻炼,戒烟限酒,保持心情舒畅,定期复诊。那本次宣教内容就到这里,祝您身体健康!",
      },
      taskoptions: [
@@ -1104,7 +1126,7 @@
    submitForm(formName) {
      this.form.preachform = this.checkList.join(",");
      // this.formatFn(1);
      if (!this.form.patTaskRelevances[0]) {
      if (!this.form.patTaskRelevances[0]&&this.form.longTask==0) {
        this.$modal.msgError("请选择病人");
        return;
      }
@@ -1122,7 +1144,7 @@
        this.form.isoperation = 2;
      } else {
        this.form.isoperation = 1;
        this.form.sendState=1;
        this.form.sendState = 1;
      }
      if (!this.form.type) {
        this.form.type = this.$route.query.type;
@@ -1150,28 +1172,33 @@
    // ----------------------表格子组件事件
    // 选择模板并预览
    selectfn(row, type) {
      // 模板情况下获取模板信息
      this.libName = row.preachname;
      this.htmlRichText = null;
      this.libId = row.id;
      console.log(row, "row");
      this.Tasktemplate = row;
      // 设置当前模板类型
      this.currentTemplateType = row.hetype || "1"; // 默认为宣教类型
      this.previewtf = true;
      this.previewid = row.svyid;
      console.log(this.questionList, "questionList");
      // this.Variablehandling(row.svyLibScripts, 1);
      console.log(row.htmlRichText);
      axios
        .get(row.htmlRichText)
        .then((response) => {
          console.log(response.data, "数据"); // 输出获取到的文件内容
          this.htmlRichText = response.data;
          this.htmlRichText = this.addStyleToImages(this.htmlRichText);
        })
        .catch((error) => {
          this.$modal.msgError("获取富文本失败");
          console.error("Failed to fetch file:", error);
        });
      if (this.currentTemplateType == "2") {
        // 如果是通知模板,获取纯文本内容
        this.plainTextContent = row.preachcontent;
      } else {
        // 其他类型模板获取富文本内容
        axios
          .get(row.htmlRichText)
          .then((response) => {
            this.htmlRichText = response.data;
            this.htmlRichText = this.addStyleToImages(this.htmlRichText);
          })
          .catch((error) => {
            this.$modal.msgError("获取富文本失败");
            console.error("Failed to fetch file:", error);
          });
      }
    },
    // 预览模板
    previewfnm() {
@@ -1182,16 +1209,24 @@
        this.Tasktemplate = res.rows[0];
        this.previewtf = true;
        this.previewid = res.rows[0].svyid;
        axios
          .get(res.rows[0].htmlRichText)
          .then((response) => {
            this.htmlRichText = response.data;
            this.htmlRichText = this.addStyleToImages(this.htmlRichText);
          })
          .catch((error) => {
            this.$modal.msgError("获取富文本失败");
            console.error("Failed to fetch file:", error);
          });
        this.currentTemplateType = res.rows[0].hetype || "1"; // 默认为宣教类型
        if (this.currentTemplateType == "2") {
          // 如果是通知模板,获取纯文本内容
          this.plainTextContent = res.rows[0].preachcontent;
        } else {
          // 其他类型模板获取富文本内容
          axios
            .get(res.rows[0].htmlRichText)
            .then((response) => {
              this.htmlRichText = response.data;
              this.htmlRichText = this.addStyleToImages(this.htmlRichText);
            })
            .catch((error) => {
              this.$modal.msgError("获取富文本失败");
              console.error("Failed to fetch file:", error);
            });
        }
      });
    },
    addStyleToImages(html) {
@@ -1274,7 +1309,7 @@
    handleExport() {},
    // 选择患者表数据
    handleSelectionChange(selection,type) {
    handleSelectionChange(selection, type) {
      console.log("多选患者");
      this.SelectPatientslist = selection;
      this.multiple = !selection.length;
@@ -1289,8 +1324,8 @@
            item.sfzh = item.idcardno;
          }
          if (type) {
            item.hospType=type
          }else{
            item.hospType = type;
          } else {
            item.hospType = this.patientqueryParams.allhosp;
          }
          this.overallCase.push(item);
@@ -1368,7 +1403,10 @@
        templateid: null,
        libtemplateid: null,
        serviceType: Number(this.$route.query.serviceType),
        kcb: "亲爱的患者-家属,我们是"+localStorage.getItem("orgname")+"的医护人员,为了更好地了解您的康复情况,请您抽一点宝贵时间,完成这份随访问卷。",
        kcb:
          "亲爱的患者-家属,我们是" +
          localStorage.getItem("orgname") +
          "的医护人员,为了更好地了解您的康复情况,请您抽一点宝贵时间,观看这份宣教资讯。",
        jsy: "生活上要劳逸结合,注意休息和营养,适当锻炼,戒烟限酒,保持心情舒畅,定期复诊。那本次回访就到这里,祝您身体健康!",
      };
@@ -1601,9 +1639,9 @@
        this.$refs.upload.submit();
        this.dractive++;
      } else if (this.dractive == 2) {
        this.handleSelectionChange(this.uploadingData,4);
        this.handleSelectionChange(this.uploadingData, 4);
        this.upload.open = false;
        this.dractive = 1
        this.dractive = 1;
      }
    },
@@ -1754,6 +1792,23 @@
    }
  }
}
/* 新增样式 */
.preview-left {
  padding: 20px;
  max-height: 70vh;
  overflow-y: auto;
}
/* 纯文本内容样式 */
.plain-text-content {
  white-space: pre-wrap;
  font-size: 16px;
  line-height: 1.6;
  padding: 15px;
  background: #f9f9f9;
  border-radius: 4px;
}
.download {
  text-align: center;
  .el-upload__tip {