From 70e4d2c33cc2e3af590d1816c0c703da341538cf Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期五, 04 九月 2026 14:13:32 +0800
Subject: [PATCH] 测试完成

---
 src/views/patient/propaganda/index.vue |  463 +++++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 332 insertions(+), 131 deletions(-)

diff --git a/src/views/patient/propaganda/index.vue b/src/views/patient/propaganda/index.vue
index 4f2c6bb..f1b9f34 100644
--- a/src/views/patient/propaganda/index.vue
+++ b/src/views/patient/propaganda/index.vue
@@ -11,7 +11,10 @@
         label-width="98px"
       >
         <el-form-item label="浠诲姟鍚嶇О">
-          <el-input v-model="topqueryParams.taskName" placeholder="璇烽�夋嫨浠诲姟鍚嶇О"></el-input>
+          <el-input
+            v-model="topqueryParams.taskName"
+            placeholder="璇烽�夋嫨浠诲姟鍚嶇О"
+          ></el-input>
         </el-form-item>
         <!-- <el-form-item label="鍙戣捣浜�">
           <el-input v-model="topqueryParams.createBy"></el-input>
@@ -34,7 +37,7 @@
             placeholder="璇疯緭鍏ユ偅鑰呭鍚�"
           ></el-input>
         </el-form-item>
-        <el-form-item label="鎮h�呰寖鍥�" prop="status">
+        <!-- <el-form-item label="鎮h�呰寖鍥�" prop="status">
           <el-select
             v-model="topqueryParams.searchscope"
             placeholder="璇烽�夋嫨鎮h�呰寖鍥�"
@@ -47,6 +50,17 @@
             >
             </el-option>
           </el-select>
+        </el-form-item> -->
+        <el-form-item label="鎮h�呰寖鍥�" prop="status">
+          <el-cascader
+            v-model="topqueryParams.scopetype"
+            placeholder="榛樿鍏ㄩ儴"
+            :options="sourcetype"
+            filterable
+            clearable
+            :props="{ expandTrigger: 'hover' }"
+            @change="handleChange"
+          ></el-cascader>
         </el-form-item>
 
         <el-form-item label="瀹f暀鐘舵��" prop="status">
@@ -86,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">
@@ -105,7 +118,6 @@
                 icon="el-icon-upload2"
                 size="medium"
                 @click="handleExport"
-                v-hasPermi="['system:user:export']"
                 >瀵煎嚭</el-button
               >
             </div>
@@ -143,10 +155,9 @@
       <el-table
         v-loading="loading"
         :data="userList"
-         height="660"
+        height="560"
         @selection-change="handleSelectionChange"
       >
-        <el-table-column type="selection" width="50" align="center" />
         <el-table-column
           label="浠诲姟鍚嶇О"
           fixed
@@ -158,60 +169,61 @@
         <!-- <el-table-column label="搴忓彿" fixed align="center" key="id" prop="id" /> -->
         <el-table-column
           label="濮撳悕"
+          width="100"
           fixed
           align="center"
           key="sendname"
           prop="sendname"
         />
         <el-table-column
-        label="瀹f暀鐘舵��"
-        align="center"
-        key="sendstate"
-        prop="sendstate"
-        width="120"
+          label="瀹f暀鐘舵��"
+          align="center"
+          key="sendstate"
+          prop="sendstate"
+          width="120"
         >
-        <template slot-scope="scope">
-          <div v-if="scope.row.sendstate == 1">
-            <el-tag type="primary" :disable-transitions="false"
-                >琚鍙�</el-tag
-                >
-              </div>
-              <div v-if="scope.row.sendstate == 2">
-                <el-tag type="primary" :disable-transitions="false"
-                >寰呭彂閫�</el-tag
-                >
-              </div>
-              <div v-if="scope.row.sendstate == 3">
-                <el-tag type="success" :disable-transitions="false"
-                >宸插彂閫佹湭棰嗗彇</el-tag
-                >
-              </div>
-              <div v-if="scope.row.sendstate == 4">
-                <el-tag type="info" :disable-transitions="false">涓嶆墽琛�</el-tag>
-              </div>
-              <div v-if="scope.row.sendstate == 5">
-                <el-tag type="danger" :disable-transitions="false"
+          <template slot-scope="scope">
+            <div v-if="scope.row.sendstate == 1">
+              <el-tag type="primary" :disable-transitions="false"
+                >琛ㄥ崟宸查鍙�</el-tag
+              >
+            </div>
+            <div v-if="scope.row.sendstate == 2">
+              <el-tag type="primary" :disable-transitions="false"
+                >寰呴殢璁�</el-tag
+              >
+            </div>
+            <div v-if="scope.row.sendstate == 3">
+              <el-tag type="success" :disable-transitions="false"
+                >琛ㄥ崟宸插彂閫�</el-tag
+              >
+            </div>
+            <div v-if="scope.row.sendstate == 4">
+              <el-tag type="info" :disable-transitions="false">涓嶆墽琛�</el-tag>
+            </div>
+            <div v-if="scope.row.sendstate == 5">
+              <el-tag type="danger" :disable-transitions="false"
                 >鍙戦�佸け璐�</el-tag
-                >
-              </div>
-              <div v-if="scope.row.sendstate == 6">
-                <el-tag type="danger" :disable-transitions="false">宸插畬鎴�</el-tag>
-              </div>
-            </template>
-          </el-table-column>
+              >
+            </div>
+            <div v-if="scope.row.sendstate == 6">
+              <el-tag type="danger" :disable-transitions="false">宸插畬鎴�</el-tag>
+            </div>
+          </template>
+        </el-table-column>
 
-          <el-table-column
+        <el-table-column
           label="缁撴灉鐘舵��"
           align="center"
           key="excep"
           prop="excep"
           width="120"
-          >
+        >
           <template slot-scope="scope">
             <div v-if="scope.row.sendstate == 6">
               <dict-tag
-              :options="dict.type.sys_yujing"
-              :value="scope.row.excep"
+                :options="dict.type.sys_yujing"
+                :value="scope.row.excep"
               />
             </div>
             <div v-else>
@@ -220,52 +232,51 @@
           </template>
         </el-table-column>
         <el-table-column
-        label="澶勭悊鎰忚"
-        align="center"
-        key="suggest"
-        prop="suggest"
-        width="120"
+          label="澶勭悊鎰忚"
+          align="center"
+          key="suggest"
+          prop="suggest"
+          width="120"
         >
-        <template slot-scope="scope">
-          <dict-tag
-          :options="dict.type.sys_suggest"
-          :value="scope.row.suggest"
-          />
+          <template slot-scope="scope">
+            <dict-tag
+              :options="dict.type.sys_suggest"
+              :value="scope.row.suggest"
+            />
           </template>
         </el-table-column>
+
         <el-table-column
-        label="鍑洪櫌鏃ユ湡"
-        width="200"
-        align="center"
-        key="endtime"
-        prop="endtime"
+          label="鍑洪櫌鏃ユ湡"
+          width="146"
+          align="center"
+          key="endtime"
+          prop="endtime"
         >
-        <template slot-scope="scope">
-          <span>{{ formatTime(scope.row.endtime) }}</span>
-        </template></el-table-column
-        >
-        <el-table-column
-        label="搴斿鏁欐棩鏈�"
-        width="200"
-        align="center"
-        key="longSendTime"
-        prop="longSendTime"
-        >
-        <template slot-scope="scope">
-          <span>{{ formatTime(scope.row.longSendTime) }}</span>
+          <template slot-scope="scope">
+            <span>{{ formatTime(scope.row.endtime) }}</span>
           </template></el-table-column
-          >
-          <el-table-column
+        >
+        <el-table-column
+          label="搴斿鏁欐棩鏈�"
+          width="200"
+          align="center"
+          key="visitTime"
+          prop="visitTime"
+        >
+          <template slot-scope="scope">
+            <span>{{ formatTime(scope.row.visitTime) }}</span>
+          </template></el-table-column
+        >
+        <el-table-column
           label="鍑洪櫌澶╂暟"
           width="120"
           align="center"
           key="endDay"
           prop="endDay"
-          >
+        >
           <template slot-scope="scope">
-            <span>{{
-              scope.row.endDay ? scope.row.endDay + "澶�" : "鏃ユ湡缂哄け"
-            }}</span>
+            <span>{{ scope.row.endDay ? scope.row.endDay + "澶�" : "" }}</span>
           </template>
         </el-table-column>
         <el-table-column
@@ -289,13 +300,6 @@
           key="drname"
           prop="drname"
         />
-        <el-table-column
-          label="瀹f暀寮傚父璁板綍"
-          width="120"
-          align="center"
-          key="remark"
-          prop="remark"
-        />
 
         <!-- <el-table-column
           label="鐥呭巻鍙�"
@@ -307,7 +311,7 @@
         /> -->
 
         <!-- <el-table-column label="骞撮緞" align="center" key="age" prop="age" /> -->
-        <!-- <el-table-column label="鎬у埆" align="center" key="sex" prop="sex" /> -->
+        <!-- <el-table-column label="鎬у埆"width="100" align="center" key="sex" prop="sex" /> -->
         <!-- <el-table-column label="搴婂彿" align="center" key="badNo" prop="badNo" /> -->
         <el-table-column
           label="绉戝"
@@ -341,6 +345,7 @@
           align="center"
           key="templatename"
           prop="templatename"
+          :show-overflow-tooltip="true"
           width="200"
         />
 
@@ -351,39 +356,42 @@
           prop="createBy"
           width="120"
         />
-        <!-- <el-table-column
-          label="璐d换鍖诲笀"
-          align="center"
-          key="drname"
-          prop="drname"
-          width="120"
-        /> -->
 
         <!-- <el-table-column
-          label="鍑洪櫌鏃堕棿"
-          sortable
+        fixed="right"
+          label="浠诲姟鍙戦�佹祦绋�"
           align="center"
-          prop="createTime"
+          key="serviceSubtaskRecordList"
+          prop="serviceSubtaskRecordList"
           width="160"
+          :show-overflow-tooltip="true"
         >
           <template slot-scope="scope">
-            <span>{{ formatTime(scope.row.createTime) }}</span>
+            <span v-for="item in scope.row.serviceSubtaskRecordList"
+              >{{ item.remark }}銆�
+            </span>
           </template>
         </el-table-column> -->
-        <!-- <el-table-column
-          label="瀹f暀鏃堕棿"
-          sortable
+        <el-table-column
+          label="浠诲姟缁撴灉璁板綍"
+          width="120"
           align="center"
-          prop="createTime"
-          width="160"
+          key="remark"
+          prop="remark"
         >
-          <template slot-scope="scope">
-            <span v-if="scope.row.sendType != 3">{{
-              formatTime(scope.row.createTime)
-            }}</span>
-            <span v-else>鍗冲埢鍙戦��</span>
+          <template slot-scope="scope" v-if="scope.row.remark">
+            <el-tag
+              type="success"
+              v-if="
+                scope.row.sendstate != 5 &&
+                scope.row.sendstate != 4 &&
+                scope.row.remark
+              "
+              >{{ scope.row.remark }}</el-tag
+            >
+            <el-tag type="warning" v-else>{{ scope.row.remark }}</el-tag>
           </template>
-        </el-table-column> -->
+        </el-table-column>
         <el-table-column
           label="瀹f暀鏃堕棿"
           sortable
@@ -393,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
@@ -408,7 +427,6 @@
             <dict-tag :options="serviceState" :value="scope.row.sendstate" />
           </template>
         </el-table-column> -->
-
       </el-table>
 
       <pagination
@@ -548,6 +566,10 @@
         >
       </span>
     </el-dialog>
+    <!-- 瀹f暀妯℃澘棰勮 -->
+    <el-dialog title="妯℃澘棰勮" :visible.sync="previewtf" width="60%">
+      <div v-html="htmlRichText"></div>
+    </el-dialog>
   </div>
 </template>
 
@@ -561,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",
@@ -603,10 +626,28 @@
       ruleForm: {
         type: [],
       },
+      sourcetype: [
+        {
+          value: 1,
+          label: "绉戝",
+          children: [],
+        },
+        {
+          value: 2,
+          label: "鐥呭尯",
+          children: [],
+        },
+        {
+          value: 3,
+          label: "鍏ㄩ儴",
+        },
+      ],
       dynamicTags: ["閫夐」涓�", "閫夐」浜�", "閫夐」涓�"], //閫夐」
       inputVisible: false,
       inputValue: "",
       previewVisible: false, //闂ㄨ瘖瀹f暀棰勮寮规
+      previewtf: false, //瀹f暀妯℃澘棰勮寮规
+      htmlRichText: "", //瀹f暀妯℃澘棰勮瀵屾枃鏈�
       radio: "",
       radios: [],
       previewtype: 2, //棰勮闂ㄨ瘖瀹f暀绫诲瀷
@@ -728,7 +769,10 @@
         pageNum: 1,
         pageSize: 10,
         serviceType: 4,
-        searchscope:2,
+        searchscope: 3,
+        sendstate: 2,
+        leaveldeptcodes: [],
+        leavehospitaldistrictcodes: [],
       },
       propss: { multiple: true },
       options: [],
@@ -736,15 +780,15 @@
       topicoptions: [
         {
           value: 1,
-          label: "琚鍙�",
+          label: "琛ㄥ崟宸查鍙�",
         },
         {
           value: 2,
-          label: "寰呭彂閫�",
+          label: "寰呴殢璁�",
         },
         {
           value: 3,
-          label: "宸插彂閫佹湭棰嗗彇",
+          label: "琛ㄥ崟宸插彂閫�",
         },
         {
           value: 4,
@@ -757,6 +801,10 @@
         {
           value: 6,
           label: "宸插畬鎴�",
+        },
+        {
+          value: 7,
+          label: "瓒呮椂",
         },
       ],
       topicoptionsyj: [
@@ -777,6 +825,19 @@
   watch: {},
   created() {
     this.serviceState = store.getters.serviceState;
+    this.sourcetype[0].children = store.getters.belongDepts.map((dept) => {
+      return {
+        label: dept.deptName,
+        value: dept.deptCode,
+      };
+    });
+    this.sourcetype[1].children = store.getters.belongWards.map((dept) => {
+      return {
+        label: dept.districtName,
+        value: dept.districtCode,
+      };
+    });
+
     this.getList();
     this.getConfigKey("sys.user.initPassword").then((response) => {
       this.initPassword = response.msg;
@@ -794,16 +855,7 @@
   methods: {
     /** 鏌ヨ闂ㄨ瘖瀹f暀鏈嶅姟鍒楄〃 */
     getList() {
-      if (this.topqueryParams.searchscope == 1) {
-        this.topqueryParams.leaveldeptcodes = store.getters.belongDepts.map(
-          (obj) => obj.deptCode
-        );
-        this.topqueryParams.leavehospitaldistrictcodes = null;
-      } else if (this.topqueryParams.searchscope == 2) {
-        this.topqueryParams.leavehospitaldistrictcodes =
-          store.getters.belongWards.map((obj) => obj.districtCode);
-        this.topqueryParams.leaveldeptcodes = null;
-      } else {
+      if (this.topqueryParams.searchscope == 3) {
         this.topqueryParams.leaveldeptcodes = store.getters.belongDepts.map(
           (obj) => obj.deptCode
         );
@@ -811,6 +863,23 @@
           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] &&
+        this.topqueryParams.leaveldeptcodes[0]
+      ) {
+        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;
         this.userList.forEach((item) => {
@@ -826,6 +895,48 @@
     Referencequestion(row) {
       this.previewVisible = true;
     },
+    // 棰勮瀹f暀妯℃澘锛堥�氳繃 libtemplateid 鏌ヨ妯℃澘淇℃伅锛�
+    previewTemplate(row) {
+      if (!row.libtemplateid) {
+        this.$message.warning("璇ヤ换鍔℃湭鍏宠仈瀹f暀妯℃澘");
+        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) {
       if (query !== "") {
@@ -838,6 +949,24 @@
         }, 200);
       } else {
         this.options = [];
+      }
+    },
+    // 鎮h�呰寖鍥村鐞�
+    handleChange(value) {
+      let type = value[0];
+      let code = value.slice(-1)[0];
+      this.topqueryParams.leavehospitaldistrictcodes = [];
+      this.topqueryParams.leaveldeptcodes = [];
+      if (type == 1) {
+        this.topqueryParams.leaveldeptcodes.push(code);
+        this.topqueryParams.leavehospitaldistrictcodes = [];
+        this.topqueryParams.searchscope = 1;
+      } else if (type == 2) {
+        this.topqueryParams.leavehospitaldistrictcodes.push(code);
+        this.topqueryParams.leaveldeptcodes = [];
+        this.topqueryParams.searchscope = 2;
+      } else {
+        this.topqueryParams.searchscope = 3;
       }
     },
     // 闂ㄨ瘖瀹f暀鐘舵�佷慨鏀�
@@ -909,6 +1038,7 @@
         pageNum: 1,
         pageSize: 10,
         serviceType: 4,
+        sendstate: 2,
       };
       this.handleQuery();
     },
@@ -1005,17 +1135,17 @@
     // 渚挎嵎鎸夐挳
     toleadExport(too) {
       if (too == 1) {
-        this.topqueryParams.sendstate=4;
-        this.topqueryParams.excep=null;
+        this.topqueryParams.sendstate = 4;
+        this.topqueryParams.excep = null;
       } else if (too == 2) {
-        this.topqueryParams.excep=1;
+        this.topqueryParams.excep = 1;
       }
       this.handleQuery();
     },
     /** 瀵煎嚭鎸夐挳鎿嶄綔 */
     handleExport() {
       this.download(
-        "system/user/export",
+        "smartor/serviceSubtask/patItemExport",
         {
           ...this.topqueryParams,
         },
@@ -1029,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 {
@@ -1155,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>

--
Gitblit v1.9.3