From bbbc478129f72b26e2ec4a2e981ed8698a96880c Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期四, 22 十月 2026 00:28:18 +0800
Subject: [PATCH] 当service_type=6时,需要根据传入的入院还是离院病区(病区)去后端查询

---
 src/views/patient/propaganda/particty.vue |  259 +++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 229 insertions(+), 30 deletions(-)

diff --git a/src/views/patient/propaganda/particty.vue b/src/views/patient/propaganda/particty.vue
index 46d0f82..16482f9 100644
--- a/src/views/patient/propaganda/particty.vue
+++ b/src/views/patient/propaganda/particty.vue
@@ -228,7 +228,9 @@
                       <el-option
                         v-for="item in medicalOptions"
                         :key="item.id"
-                        :label="item.itemName + ' (' + item.manufacturerName + ')'"
+                        :label="
+                          item.itemName + ' (' + item.manufacturerName + ')'
+                        "
                         :value="item.itemCode"
                       />
                     </el-select>
@@ -328,6 +330,35 @@
                   ></el-col>
                 </el-row>
 
+                <!-- 缂欎簯鍘夸汉姘戝尰闄細瓒呮椂鏈畬鎴愭槸鍚﹀啀娆¢殢璁� / 鍐嶆闅忚鍏宠仈浠诲姟 -->
+                <el-row v-if="form.appltype == 1 && orgname == '缂欎簯鍘夸汉姘戝尰闄�'">
+                  <el-col :span="12">
+                    <el-form-item label="瓒呮椂鏈畬鎴愭槸鍚﹀啀娆¢殢璁�">
+                      <el-radio-group v-model="form.nexttaskflag">
+                        <el-radio label="1">鏄�</el-radio>
+                        <el-radio label="0">鍚�</el-radio>
+                      </el-radio-group>
+                    </el-form-item>
+                  </el-col>
+                  <el-col :span="12">
+                    <el-form-item label="鍐嶆闅忚鍏宠仈浠诲姟">
+                      <el-input
+                        style="width: 300px"
+                        :disabled="true"
+                        v-model="nexttaskname"
+                        placeholder="璇风偣鍑诲彸渚ч�夋嫨浠诲姟"
+                      />
+                      <el-button
+                        style="margin-left: 10px"
+                        type="primary"
+                        icon="el-icon-edit"
+                        circle
+                        @click="openNextTaskDialog"
+                      ></el-button>
+                    </el-form-item>
+                  </el-col>
+                </el-row>
+
                 <!-- 鐥呭尯鍏宠仈 -->
                 <el-row v-if="form.appltype == 2">
                   <el-col :span="20"
@@ -377,7 +408,7 @@
                       <el-tag
                         v-for="tag in diagglist"
                         :key="tag.icdcode"
-                        @close="removediagg(tag.icd10code)"
+                        @close="removediagg(tag)"
                         type="warning"
                         closable
                         :disable-transitions="false"
@@ -710,7 +741,7 @@
                         </div>
                         <el-tag
                           v-for="tag in diagglist"
-                          @close="removediagg(tag.icd10code)"
+                          @close="removediagg(tag)"
                           type="warning"
                           closable
                           :disable-transitions="false"
@@ -924,6 +955,30 @@
                   </el-table>
                 </el-row>
               </div>
+            </div>
+          </div>
+          <div class="examine-jic">
+            <div class="headline">
+              <div>浜屾闅忚浠诲姟閰嶇疆</div>
+            </div>
+            <div class="jic-value">
+              <el-form label-width="125px">
+                <el-form-item label="浜屾闅忚浠诲姟">
+                  <el-input
+                    style="width: 300px"
+                    :disabled="true"
+                    v-model="nexttaskname"
+                    placeholder="璇风偣鍑诲彸渚ч�夋嫨浠诲姟"
+                  />
+                  <el-button
+                    style="margin-left: 10px"
+                    type="primary"
+                    icon="el-icon-edit"
+                    circle
+                    @click="openNextTaskDialog"
+                  ></el-button>
+                </el-form-item>
+              </el-form>
             </div>
           </div>
         </div>
@@ -1335,6 +1390,68 @@
         </div>
       </div>
     </el-drawer>
+    <!-- 閫夋嫨鍐嶆闅忚鍏宠仈浠诲姟 -->
+    <el-dialog
+      title="閫夋嫨浠诲姟"
+      :visible.sync="nextTaskDialogVisible"
+      width="60%"
+      :close-on-click-modal="false"
+    >
+      <el-form :inline="true" size="small">
+        <el-form-item label="浠诲姟鍚嶇О">
+          <el-input
+            v-model="nextTaskQuery.taskName"
+            placeholder="璇疯緭鍏ヤ换鍔″悕绉�"
+            @keyup.enter.native="handleNextTaskQuery"
+          ></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button
+            type="primary"
+            icon="el-icon-search"
+            @click="handleNextTaskQuery"
+            >鎼滅储</el-button
+          >
+          <el-button icon="el-icon-refresh" @click="resetNextTaskQuery"
+            >閲嶇疆</el-button
+          >
+        </el-form-item>
+      </el-form>
+      <el-table :data="nextTaskList" border v-loading="nextTaskLoading">
+        <el-table-column
+          label="浠诲姟鍚嶇О"
+          prop="taskName"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          label="浠诲姟鎻忚堪"
+          prop="taskDesc"
+          show-overflow-tooltip
+        />
+        <el-table-column
+          label="鏈嶅姟椤圭洰"
+          prop="templatename"
+          show-overflow-tooltip
+        />
+        <el-table-column label="鎿嶄綔" width="100" align="center">
+          <template slot-scope="scope">
+            <el-button type="text" @click="selectNextTask(scope.row)"
+              >閫夋嫨</el-button
+            >
+          </template>
+        </el-table-column>
+      </el-table>
+      <pagination
+        v-show="nextTaskTotal > 0"
+        :total="nextTaskTotal"
+        :page.sync="nextTaskQuery.pageNum"
+        :limit.sync="nextTaskQuery.pageSize"
+        @pagination="getNextTaskList"
+      />
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="nextTaskDialogVisible = false">鍙� 娑�</el-button>
+      </span>
+    </el-dialog>
     <Optional-Form
       ref="child"
       :dialogVisiblepatient="dialogVisiblepatientjb"
@@ -1373,8 +1490,10 @@
   rwztaskdiaggetlist,
   taskmedicallist,
   getQtemplatelist,
+  getTasklist,
 } from "@/api/AiCentre/index";
 import { listMedication } from "@/api/knowledge/drug";
+import { getIvrtask } from "@/api/smartor/ivrtask";
 import { deptTreeSelect } from "@/api/system/user";
 import OptionalForm from "@/components/OptionalForm";
 import SortCheckbox from "@/components/SortCheckbox";
@@ -1575,6 +1694,9 @@
       SelectPatientslist: [],
       form: {
         patTaskRelevances: [],
+        nexttaskflag: "0",
+        nexttaskid: null,
+        nexttaskname: "",
         sendType: 3,
         longTask: 0,
         templatename: "",
@@ -1648,6 +1770,14 @@
       belongDepts: [],
       quote: false,
       serviceType: null,
+      // 鍐嶆闅忚鍏宠仈浠诲姟锛堢紮浜戝幙浜烘皯鍖婚櫌锛�
+      orgname: localStorage.getItem("orgname"),
+      nextTaskDialogVisible: false,
+      nextTaskLoading: false,
+      nextTaskList: [],
+      nextTaskTotal: 0,
+      nextTaskQuery: { pageNum: 1, pageSize: 10, taskName: "" },
+      nexttaskname: "",
       // 妯℃澘鎼滅储
       templateOptions: [],
       templateLoading: false,
@@ -1764,6 +1894,7 @@
         this.form.serviceType == 9 ||
         this.form.serviceType == 11 ||
         this.form.serviceType == 12 ||
+        this.form.serviceType == 20 ||
         this.form.serviceType == 10
       ) {
         this.checkboxlist = [
@@ -1822,6 +1953,9 @@
     Getdetails() {
       this.form = {
         patTaskRelevances: [],
+        nexttaskflag: "0",
+        nexttaskid: null,
+        nexttaskname: "",
         sendType: 1,
         sendDay: 5,
         templatename: "",
@@ -1851,6 +1985,15 @@
         getTaskInfo({ taskid: this.id }).then((res) => {
           if (res.code == 200) {
             this.form = res.data;
+            // 鍥炴樉鍐嶆闅忚鍏宠仈浠诲姟
+            if (this.form.nexttaskflag == null) this.form.nexttaskflag = "0";
+            this.nexttaskname = "";
+            if (this.form.nexttaskid) {
+              getIvrtask(this.form.nexttaskid).then((r) => {
+                this.nexttaskname = (r.data && r.data.taskName) || "";
+                this.form.nexttaskname = (r.data && r.data.taskName) || "";
+              });
+            }
             // 濡傛灉杩斿洖浜� serviceTaskScheduleVO锛屽垯瑙f瀽鏄庣粏涓殑 content
             if (
               this.form.serviceTaskScheduleVO &&
@@ -1955,6 +2098,10 @@
       this.time2 = "";
       this.time3 = "";
       this.time4 = "";
+      this.form.nexttaskflag = "0";
+      this.form.nexttaskid = null;
+      this.form.nexttaskname = "";
+      this.nexttaskname = "";
       // 閲嶇疆浠诲姟缁�
       this.form.serviceTaskScheduleVO = {
         scheduleStyle: 0,
@@ -2159,7 +2306,7 @@
                 item.icdname = item.icd10name;
                 this.diagglist.push(item);
               } else {
-               this.diagglist.push(item);
+                this.diagglist.push(item);
               }
               this.illnesscodes.push(item.icd10code);
             });
@@ -2181,7 +2328,7 @@
             });
           }
         });
-        taskdiaggetlist(this.queryParamsdept).then((res) => {
+         taskdiaggetlist(this.queryParamsdept).then((res) => {
           if (res.code == 200) {
             let arr = res.rows;
             arr.forEach((item) => {
@@ -2189,7 +2336,8 @@
                 item.icdname = item.icd10name;
                 this.diagglist.push(item);
               } else {
-                getillnesslist({ icdname: item.icd10name }).then((res) => {
+
+                getillnesslist({ icdcode: item.icd10code }).then((res) => {
                   item.icdname = res.rows[0].icdname;
                   this.diagglist.push(item);
                 });
@@ -2209,7 +2357,7 @@
                 ...item,
                 itemCode: code,
                 itemName: item.itemName || item.medicalName,
-                manufacturerName: item.manufacturerName || item.medicalCompany
+                manufacturerName: item.manufacturerName || item.medicalCompany,
               });
             });
           }
@@ -2255,43 +2403,88 @@
         });
       }
     },
-    removediagg(row) {
+    removediagg(tag) {
       // 浠诲姟缁勶細鏈湴鍒犻櫎鍗冲彲锛屽悗绔繚瀛樻椂缁熶竴鏇存柊
       if (this.form.appltype == 5) {
-        this.diagglist = this.diagglist.filter((item) => item.icd10code != row);
+        this.diagglist = this.diagglist.filter((item) => item != tag);
         return;
       }
-      // 鏅�氱柧鐥呭叧鑱旓細璋冨悗绔帴鍙i�愭潯鍒犻櫎
-      let result = this.diagglist
-        .filter((item) => item.icd10code == row)
-        .map((item) => item.id);
-      if (result.length) {
-        taskdiaghospgetsondel(result).then((res) => {
+
+      // 鏅�氱柧鐥呭叧鑱旓細鍒ゆ柇鏄惁鏈� id锛堝凡淇濆瓨鐨勮褰曟墠鏈� id锛�
+      if (tag.id) {
+        // id 瀛樺湪锛岃皟鍚庣鎺ュ彛鍒犻櫎
+        taskdiaghospgetsondel([tag.id]).then((res) => {
           if (res.code) {
-            this.diagglist = this.diagglist.filter(
-              (item) => item.icd10code != row
-            );
+            this.diagglist = this.diagglist.filter((item) => item != tag);
             this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
           }
         });
+      } else {
+        // id 涓嶅瓨鍦紙鏈繚瀛樼殑鏂拌褰曪級锛岀洿鎺ユ湰鍦板垹闄�
+        this.diagglist = this.diagglist.filter((item) => item != tag);
+        this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
       }
     },
     remoteopcode(name) {
       // 鍗犱綅
     },
     remoteSearchMedical(query) {
-      if (!query) { this.medicalOptions = []; return; }
-      listMedication({ itemName: query, pageNum: 1, pageSize: 20 }).then((res) => {
-        this.medicalOptions = res.rows || [];
-      });
+      if (!query) {
+        this.medicalOptions = [];
+        return;
+      }
+      listMedication({ itemName: query, pageNum: 1, pageSize: 20 }).then(
+        (res) => {
+          this.medicalOptions = res.rows || [];
+        }
+      );
     },
     removeMedical(code) {
-      taskmedicaldel({ itemCode: code, taskid: this.form.taskid }).then((res) => {
-        if (res.code == 200) {
-          this.medicalCodes = this.medicalCodes.filter((c) => c !== code);
-          this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+      taskmedicaldel({ itemCode: code, taskid: this.form.taskid }).then(
+        (res) => {
+          if (res.code == 200) {
+            this.medicalCodes = this.medicalCodes.filter((c) => c !== code);
+            this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+          }
         }
-      });
+      );
+    },
+
+    // ---------- 鍐嶆闅忚鍏宠仈浠诲姟 ----------
+    openNextTaskDialog() {
+      this.nextTaskQuery = { pageNum: 1, pageSize: 10, taskName: "" };
+      this.nextTaskDialogVisible = true;
+      this.getNextTaskList();
+    },
+    getNextTaskList() {
+      this.nextTaskLoading = true;
+      getTasklist({
+        pageNum: this.nextTaskQuery.pageNum,
+        pageSize: this.nextTaskQuery.pageSize,
+        taskName: this.nextTaskQuery.taskName || undefined,
+      })
+        .then((res) => {
+          this.nextTaskList = res.rows || [];
+          this.nextTaskTotal = res.total || 0;
+          this.nextTaskLoading = false;
+        })
+        .catch(() => {
+          this.nextTaskLoading = false;
+        });
+    },
+    handleNextTaskQuery() {
+      this.nextTaskQuery.pageNum = 1;
+      this.getNextTaskList();
+    },
+    resetNextTaskQuery() {
+      this.nextTaskQuery = { pageNum: 1, pageSize: 10, taskName: "" };
+      this.getNextTaskList();
+    },
+    selectNextTask(row) {
+      this.form.nexttaskid = row.taskid;
+      this.form.nexttaskname = row.taskName;
+      this.nexttaskname = row.taskName;
+      this.nextTaskDialogVisible = false;
     },
 
     // ---------- 鎮h�呴�夋嫨 ----------
@@ -2821,7 +3014,7 @@
           // 灏嗕富瀵硅薄鏀惧叆 form 鎻愪氦
         }
         if (this.form.appltype == 5) {
-          console.log(this.form,'杩涘叆浠诲姟缁勯厤缃�');
+          console.log(this.form, "杩涘叆浠诲姟缁勯厤缃�");
 
           this.form.serviceTaskScheduleVO.icd10codes = this.form.icd10code;
           this.form.serviceTaskScheduleVO.wardCodes =
@@ -2858,7 +3051,9 @@
           );
           this.form.medicalCode = this.medicalCodes.join(",");
           this.form.medicalName = selectedMeds.map((m) => m.itemName).join(",");
-          this.form.medicalCompany = selectedMeds.map((m) => m.manufacturerName).join(",");
+          this.form.medicalCompany = selectedMeds
+            .map((m) => m.manufacturerName)
+            .join(",");
         }
 
         this.form.serviceType = this.serviceType;
@@ -2871,7 +3066,11 @@
           .map((item) => item.icdname)
           .join(",");
         // 鐤剧梾/鎵嬫湳/鑽搧鍏宠仈鐨勭瀹�/鐥呭尯鏍¢獙
-        if (this.form.appltype == 3 || this.form.appltype == 4 || this.form.appltype == 6) {
+        if (
+          this.form.appltype == 3 ||
+          this.form.appltype == 4 ||
+          this.form.appltype == 6
+        ) {
           const hasDept = this.diseaseDept?.deptCode;
           const hasWard = this.diseaseWard?.districtCode;
           if (!hasDept && !hasWard) {

--
Gitblit v1.9.3