|  |  | 
 |  |  |                       </el-select> </el-form-item | 
 |  |  |                   ></el-col> | 
 |  |  |                 </el-row> | 
 |  |  |                 <el-form-item label="发送设置:" v-if="currenttype != 2"> | 
 |  |  |                 <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> | 
 |  |  |                   </el-radio-group> | 
 |  |  |                 </el-form-item> | 
 |  |  |                 <el-row :gutter="20" v-if="form.longTask"> | 
 |  |  |                   <el-col :span="8"> | 
 |  |  |                     <el-form-item label="周期时间" prop="name"> | 
 |  |  |                       <el-input | 
 |  |  |                         v-model="form.sendDay" | 
 |  |  |                         placeholder="默认5天后" | 
 |  |  |                       ></el-input> | 
 |  |  |                     </el-form-item> | 
 |  |  |                   </el-col> | 
 |  |  |                 </el-row> | 
 |  |  |                 <el-form-item label="执行设置" v-if="!form.longTask"> | 
 |  |  |                   <el-radio-group v-model="form.sendType"> | 
 |  |  |                     <el-radio :label="1">时间段发送</el-radio> | 
 |  |  |                     <el-radio :label="3">时间点发送</el-radio> | 
 |  |  |                     <el-radio :label="2">即刻发送</el-radio> | 
 |  |  |                   </el-radio-group> | 
 |  |  |                 </el-form-item> | 
 |  |  |                 <el-form-item label="发送日期:" v-if="form.sendType == 1"> | 
 |  |  |                 <el-form-item | 
 |  |  |                   label="执行日期:" | 
 |  |  |                   v-if="form.sendType == 1 && !form.longTask" | 
 |  |  |                 > | 
 |  |  |                   <el-date-picker | 
 |  |  |                     v-model="daytime" | 
 |  |  |                     @change="changeTimeday" | 
 |  |  | 
 |  |  |                   </el-date-picker> | 
 |  |  |                 </el-form-item> | 
 |  |  |  | 
 |  |  |                 <el-form-item label="发送时间点:" v-if="form.sendType == 3"> | 
 |  |  |                 <el-form-item | 
 |  |  |                   label="执行时间点:" | 
 |  |  |                   v-if="form.sendType == 3 && !form.longTask" | 
 |  |  |                 > | 
 |  |  |                   <div style="display: flex"> | 
 |  |  |                     <div style="margin-right: 10px"> | 
 |  |  |                       <el-date-picker | 
 |  |  | 
 |  |  |                   </div> | 
 |  |  |                 </el-form-item> | 
 |  |  |  | 
 |  |  |                 <el-form-item label="发送时间段:" v-if="form.sendType == 1"> | 
 |  |  |                 <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> | 
 |  |  | 
 |  |  |                         icon="el-icon-upload2" | 
 |  |  |                         size="medium" | 
 |  |  |                         @click="handleImport" | 
 |  |  |  | 
 |  |  |                         >导入</el-button | 
 |  |  |                       > | 
 |  |  |                     </el-col> | 
 |  |  | 
 |  |  |     <!-- 模板预览 --> | 
 |  |  |     <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> | 
 |  |  | 
 |  |  |  | 
 |  |  |         <el-table :data="uploadingData" style="width: 100%"> | 
 |  |  |           <el-table-column prop="serial" label="患者id"> </el-table-column> | 
 |  |  |           <el-table-column prop="name" label="姓名"> </el-table-column> | 
 |  |  |           <el-table-column prop="sex" label="性别"> </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 | 
 |  |  | 
 |  |  |               <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> | 
 |  |  |  | 
 |  |  | 
 |  |  |     return { | 
 |  |  |       title: "宣教内容列表", | 
 |  |  |       currenttype: 1, //1宣教2门诊3出院4复诊5体检6问卷 | 
 |  |  |       currentTemplateType: "", // 当前模板类型 | 
 |  |  |       plainTextContent: "", // 纯文本内容 | 
 |  |  |       id: "", // | 
 |  |  |       previewid: "", //任务模板传递id | 
 |  |  |       libName: "", | 
 |  |  | 
 |  |  |       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" }, | 
 |  |  | 
 |  |  |       ], | 
 |  |  |       variableListTime: [], | 
 |  |  |       sortlist: [], | 
 |  |  |       heLibraryAssortList: [ | 
 |  |  |         { id: 1, value: "宣教" }, | 
 |  |  |         { id: 2, value: "通知" }, | 
 |  |  |       ], | 
 |  |  |       tasktopic: null, //新增类型 | 
 |  |  |       SelectPatientslist: [], | 
 |  |  |       form: { | 
 |  |  |         patTaskRelevances: [], | 
 |  |  |         sendType: 1, | 
 |  |  |         longTask: 0, | 
 |  |  |         templatename: "", | 
 |  |  |         templateid: null, | 
 |  |  |         libtemplateid: null, | 
 |  |  |         kcb: "亲爱的患者-家属,您好!我们是景宁人民医院的医护人员,为了更好地了解您的康复情况,请您抽一点宝贵时间,观看这份宣教资讯。", | 
 |  |  |         kcb: | 
 |  |  |           "亲爱的患者-家属,我们是" + | 
 |  |  |           localStorage.getItem("orgname") + | 
 |  |  |           "的医护人员,为了更好地了解您的康复情况,请您抽一点宝贵时间,观看这份宣教资讯。", | 
 |  |  |         jsy: "生活上要劳逸结合,注意休息和营养,适当锻炼,戒烟限酒,保持心情舒畅,定期复诊。那本次宣教内容就到这里,祝您身体健康!", | 
 |  |  |       }, | 
 |  |  |       taskoptions: [ | 
 |  |  | 
 |  |  |     this.belongDepts = store.getters.belongDepts; | 
 |  |  |     this.form.typename = this.$route.query.typename; | 
 |  |  |     this.form.serviceType = Number(this.$route.query.serviceType); | 
 |  |  |     this.listDept(); | 
 |  |  |     // this.listDept(); | 
 |  |  |     this.Acquisitiontype(); | 
 |  |  |     this.Getdetails(); | 
 |  |  |     this.getheLibraryAssort(); | 
 |  |  | 
 |  |  |     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; | 
 |  |  |       } | 
 |  |  | 
 |  |  |         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; | 
 |  |  | 
 |  |  |     // ----------------------表格子组件事件 | 
 |  |  |     // 选择模板并预览 | 
 |  |  |     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() { | 
 |  |  | 
 |  |  |         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) { | 
 |  |  | 
 |  |  |     handleExport() {}, | 
 |  |  |  | 
 |  |  |     // 选择患者表数据 | 
 |  |  |     handleSelectionChange(selection,type) { | 
 |  |  |     handleSelectionChange(selection, type) { | 
 |  |  |       console.log("多选患者"); | 
 |  |  |       this.SelectPatientslist = selection; | 
 |  |  |       this.multiple = !selection.length; | 
 |  |  | 
 |  |  |             item.sfzh = item.idcardno; | 
 |  |  |           } | 
 |  |  |           if (type) { | 
 |  |  |             item.hospType=type | 
 |  |  |           }else{ | 
 |  |  |             item.hospType = type; | 
 |  |  |           } else { | 
 |  |  |             item.hospType = this.patientqueryParams.allhosp; | 
 |  |  |           } | 
 |  |  |           this.overallCase.push(item); | 
 |  |  | 
 |  |  |         templateid: null, | 
 |  |  |         libtemplateid: null, | 
 |  |  |         serviceType: Number(this.$route.query.serviceType), | 
 |  |  |         kcb: "亲爱的患者-家属,您好!我们是景宁人民医院的医护人员,为了更好地了解您的康复情况,请您抽一点宝贵时间,完成这份随访问卷。", | 
 |  |  |         kcb: | 
 |  |  |           "亲爱的患者-家属,我们是" + | 
 |  |  |           localStorage.getItem("orgname") + | 
 |  |  |           "的医护人员,为了更好地了解您的康复情况,请您抽一点宝贵时间,观看这份宣教资讯。", | 
 |  |  |         jsy: "生活上要劳逸结合,注意休息和营养,适当锻炼,戒烟限酒,保持心情舒畅,定期复诊。那本次回访就到这里,祝您身体健康!", | 
 |  |  |       }; | 
 |  |  |  | 
 |  |  | 
 |  |  |         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; | 
 |  |  |       } | 
 |  |  |     }, | 
 |  |  |  | 
 |  |  | 
 |  |  |     } | 
 |  |  |   } | 
 |  |  | } | 
 |  |  | /* 新增样式 */ | 
 |  |  | .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 { |