WXL (wul)
4 天以前 70e4d2c33cc2e3af590d1816c0c703da341538cf
src/views/patient/propaganda/index.vue
@@ -37,7 +37,7 @@
            placeholder="请输入患者姓名"
          ></el-input>
        </el-form-item>
        <el-form-item label="患者范围" prop="status">
        <!-- <el-form-item label="患者范围" prop="status">
          <el-select
            v-model="topqueryParams.searchscope"
            placeholder="请选择患者范围"
@@ -50,12 +50,14 @@
            >
            </el-option>
          </el-select>
        </el-form-item>
        </el-form-item> -->
        <el-form-item label="患者范围" prop="status">
          <el-cascader
            v-model="topqueryParams.scopetype"
            placeholder="默认全部"
            :options="sourcetype"
            filterable
            clearable
            :props="{ expandTrigger: 'hover' }"
            @change="handleChange"
          ></el-cascader>
@@ -98,16 +100,15 @@
      </el-form>
      <el-divider></el-divider>
      <el-row :gutter="10" class="mb8">
        <el-col :span="1.5">
        <!-- <el-col :span="1.5">
          <el-button
            type="primary"
            plain
            icon="el-icon-plus"
            size="medium"
            @click="handleAdd"
            >新增</el-button
          >
        </el-col>
        </el-col> -->
        <el-col :span="1.5">
          <div class="documentf">
            <div class="document">
@@ -247,7 +248,7 @@
        <el-table-column
          label="出院日期"
          width="200"
          width="146"
          align="center"
          key="endtime"
          prop="endtime"
@@ -260,11 +261,11 @@
          label="应宣教日期"
          width="200"
          align="center"
          key="longSendTime"
          prop="longSendTime"
          key="visitTime"
          prop="visitTime"
        >
          <template slot-scope="scope">
            <span>{{ formatTime(scope.row.longSendTime) }}</span>
            <span>{{ formatTime(scope.row.visitTime) }}</span>
          </template></el-table-column
        >
        <el-table-column
@@ -372,7 +373,6 @@
          </template>
        </el-table-column> -->
        <el-table-column
          fixed="right"
          label="任务结果记录"
          width="120"
          align="center"
@@ -393,7 +393,6 @@
          </template>
        </el-table-column>
        <el-table-column
          fixed="right"
          label="宣教时间"
          sortable
          align="center"
@@ -402,6 +401,17 @@
        >
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.finishtime) }}</span>
          </template>
        </el-table-column>
        <el-table-column fixed="right" label="操作" align="center" width="100">
          <template slot-scope="scope">
            <el-button
              size="medium"
              type="text"
              icon="el-icon-view"
              @click="previewTemplate(scope.row)"
              >预览</el-button
            >
          </template>
        </el-table-column>
        <!-- <el-table-column
@@ -556,6 +566,10 @@
        >
      </span>
    </el-dialog>
    <!-- 宣教模板预览 -->
    <el-dialog title="模板预览" :visible.sync="previewtf" width="60%">
      <div v-html="htmlRichText"></div>
    </el-dialog>
  </div>
</template>
@@ -569,10 +583,11 @@
  resetUserPwd,
  changeUserStatus,
} from "@/api/system/user";
import { getTaskservelist } from "@/api/AiCentre/index";
import { getTaskservelist, getlibrarylist } from "@/api/AiCentre/index";
import Treeselect from "@riophae/vue-treeselect";
import store from "@/store";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import axios from "axios";
export default {
  name: "Discharge",
@@ -631,6 +646,8 @@
      inputVisible: false,
      inputValue: "",
      previewVisible: false, //门诊宣教预览弹框
      previewtf: false, //宣教模板预览弹框
      htmlRichText: "", //宣教模板预览富文本
      radio: "",
      radios: [],
      previewtype: 2, //预览门诊宣教类型
@@ -752,8 +769,10 @@
        pageNum: 1,
        pageSize: 10,
        serviceType: 4,
        searchscope: 2,
        searchscope: 3,
        sendstate: 2,
        leaveldeptcodes: [],
        leavehospitaldistrictcodes: [],
      },
      propss: { multiple: true },
      options: [],
@@ -782,6 +801,10 @@
        {
          value: 6,
          label: "已完成",
        },
        {
          value: 7,
          label: "超时",
        },
      ],
      topicoptionsyj: [
@@ -832,7 +855,7 @@
  methods: {
    /** 查询门诊宣教服务列表 */
    getList() {
       if (this.topqueryParams.searchscope == 3) {
      if (this.topqueryParams.searchscope == 3) {
        this.topqueryParams.leaveldeptcodes = store.getters.belongDepts.map(
          (obj) => obj.deptCode
        );
@@ -840,6 +863,8 @@
          store.getters.belongWards.map((obj) => obj.districtCode);
      }
      this.loading = true;
      console.log(this.topqueryParams.leavehospitaldistrictcodes, "123");
      console.log(this.topqueryParams.leaveldeptcodes, "344");
      if (
        this.topqueryParams.leavehospitaldistrictcodes[0] &&
@@ -848,6 +873,12 @@
        this.topqueryParams.deptOrDistrict = 2;
      } else {
        this.topqueryParams.deptOrDistrict = 1;
      }
      console.log(55);
      if (!this.followupAuthority()) {
        this.$message.warning("未配置科室/病区相关权限不可查询");
        return Promise.reject(new Error("无权限查询"));
      }
      getTaskservelist(this.topqueryParams).then((response) => {
        this.userList = response.rows[0].serviceSubtaskList;
@@ -863,6 +894,48 @@
    // 查看门诊宣教详情
    Referencequestion(row) {
      this.previewVisible = true;
    },
    // 预览宣教模板(通过 libtemplateid 查询模板信息)
    previewTemplate(row) {
      if (!row.libtemplateid) {
        this.$message.warning("该任务未关联宣教模板");
        return;
      }
      this.htmlRichText = null;
      this.previewtf = true;
      getlibrarylist({ id: row.libtemplateid })
        .then((res) => {
          const tpl = (res.rows && res.rows[0]) || null;
          if (!tpl || !tpl.htmlRichText) {
            this.$message.warning("该模板暂无预览内容");
            return;
          }
          axios
            .get(tpl.htmlRichText)
            .then((response) => {
              this.htmlRichText = response.data;
              this.htmlRichText = this.addStyleToImages(this.htmlRichText);
            })
            .catch(() => {
              this.$message.error("获取模板内容失败");
            });
        })
        .catch(() => {
          this.$message.error("查询模板信息失败");
        });
    },
    // 修复富文本图片路径与样式
    addStyleToImages(html) {
      if (!html) return html;
      let processedHtml = html.replace(
        /\/aifollowup\/aifollowup\//g,
        "/aifollowup/"
      );
      processedHtml = processedHtml.replace(
        /<img([^>]*)style=(['"])(?:(?!\2).)*\2([^>]*)>/g,
        '<img$1style="width:100%;height:auto;"$3>'
      );
      return processedHtml;
    },
    // 添加弹框搜索
    remoteMethod(query) {
@@ -1086,8 +1159,8 @@
<style lang="scss" scoped>
.el-button--primary.is-plain {
  color: #ffffff;
  background: #409eff;
  border-color: #4fabe9;
  background: #5b7cfa;
  border-color: #5b7cfa;
}
.document {
@@ -1212,4 +1285,75 @@
//     font-size: 24px;
//   }
// }
/* ================= 清新高级简约风 ================= */
.app-container {
  background: #f5f7fb;
  border-radius: 14px;
  padding: 20px;
}
/* 查询表单:白色圆角卡片 */
::v-deep .el-form--inline {
  background: #ffffff;
  border-radius: 14px;
  padding: 22px 22px 8px;
  margin-bottom: 18px;
  box-shadow: 0 2px 12px rgba(31, 45, 61, 0.05);
}
/* 隐藏分割线 */
::v-deep .el-divider {
  display: none;
}
/* 工具栏底部间距 */
.mb8 {
  margin-bottom: 18px;
}
/* 按钮:圆角 + 柔和过渡 */
::v-deep .el-button {
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.25s ease;
}
/* 主按钮:清新靛蓝 */
::v-deep .el-button--primary:not(.is-plain) {
  background: #5b7cfa;
  border-color: #5b7cfa;
}
::v-deep .el-button--primary:not(.is-plain):hover,
::v-deep .el-button--primary:not(.is-plain):focus {
  background: #7593fb;
  border-color: #7593fb;
}
/* 表格:白色圆角卡片 + 柔和表头 */
::v-deep .el-table {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(31, 45, 61, 0.05);
}
::v-deep .el-table::before {
  display: none;
}
::v-deep .el-table th {
  background: #f7f9fd !important;
  color: #3f4d63;
  font-weight: 600;
}
::v-deep .el-table td {
  padding: 12px 0;
}
/* 标签圆角 */
::v-deep .el-tag {
  border-radius: 6px;
}
/* 分页间距 */
::v-deep .pagination-container {
  padding-top: 18px;
}
</style>