From 055c1f8a3ff936b777e625dcb782edf2ccfb0f59 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期五, 03 四月 2026 09:55:25 +0800
Subject: [PATCH] 测试完成

---
 src/views/patient/patient/hospital.vue |  986 +++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 905 insertions(+), 81 deletions(-)

diff --git a/src/views/patient/patient/hospital.vue b/src/views/patient/patient/hospital.vue
index d8360e7..bde9c2b 100644
--- a/src/views/patient/patient/hospital.vue
+++ b/src/views/patient/patient/hospital.vue
@@ -11,7 +11,7 @@
           v-show="showSearch"
           label-width="98px"
         >
-          <el-form-item label="濮撳悕" prop="name">
+          <el-form-item label="鎮h�呭鍚�" prop="name">
             <el-input
               v-model="queryParams.patname"
               placeholder="璇疯緭鍏ュ鍚�"
@@ -20,51 +20,60 @@
               @keyup.enter.native="handleQuery"
             />
           </el-form-item>
-          <el-form-item label="鎮h�呯紪鍙�" prop="patid">
+          <el-form-item label="涓绘不鍖荤敓" prop="name">
             <el-input
-              v-model="queryParams.patid"
+              v-model="queryParams.drname"
+              placeholder="璇疯緭鍏ュ鍚�"
+              clearable
+              @keyup.enter.native="handleQuery"
+            />
+          </el-form-item>
+          <el-form-item label="璐d换鎶ゅ+" prop="name">
+            <el-input
+              v-model="queryParams.nurseName"
+              placeholder="璇疯緭鍏ュ鍚�"
+              clearable
+              @keyup.enter.native="handleQuery"
+            />
+          </el-form-item>
+          <el-form-item label="浣忛櫌鍙�" prop="inhospno">
+            <el-input
+              v-model="queryParams.inhospno"
               placeholder="璇疯緭鍏ユ偅鑰呯紪鍙�"
               clearable
               style="width: 250px"
               @keyup.enter.native="handleQuery"
             />
           </el-form-item>
+          <el-form-item label="绉戝鍚嶇О" prop="inhospno">
+            <el-input
+              v-model="queryParams.deptname"
+              placeholder="璇疯緭鍏ョ瀹ゅ悕绉�"
+              clearable
+              style="width: 250px"
+              @keyup.enter.native="handleQuery"
+            />
+          </el-form-item>
 
-          <el-form-item label="鎶ょ悊绛夌骇" prop="tagId">
-            <el-select v-model="queryParams.Patientid" placeholder="璇烽�夋嫨">
-              <el-option
-                v-for="dict in dict.type.nursinggrade"
-                :key="dict.value"
-                :label="dict.label"
-                :value="dict.value"
-              >
-              </el-option>
-            </el-select>
+          <el-form-item label="鎮h�呰寖鍥�" prop="status">
+            <el-cascader
+              v-model="queryParams.scopetype"
+              placeholder="榛樿鍏ㄩ儴绉戝"
+              :options="sourcetype"
+              :props="{ expandTrigger: 'hover' }"
+              @change="handleChange"
+            ></el-cascader>
           </el-form-item>
-          <el-form-item label="鎮h�呮潵婧�" prop="tagId">
-            <el-select
-                v-model="queryParams.searchscope"
-                placeholder="璇烽�夋嫨鎮h�呮潵婧�"
-              >
-                <el-option
-                  v-for="item in source"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
-                >
-                </el-option>
-              </el-select>
-          </el-form-item>
-          <el-form-item label=" 鍏ラ櫌鏃ユ湡 " prop="createTime">
+          <el-form-item label=" 鍑洪櫌鏃ユ湡 " prop="createTime">
             <el-date-picker
-            v-model="dateRange"
-            style="width: 240px"
-            value-format="yyyy-MM-dd"
-            type="daterange"
-            range-separator="-"
-            start-placeholder="寮�濮嬫棩鏈�"
-            end-placeholder="缁撴潫鏃ユ湡"
-          ></el-date-picker>
+              v-model="dateRange"
+              style="width: 240px"
+              value-format="yyyy-MM-dd"
+              type="daterange"
+              range-separator="-"
+              start-placeholder="寮�濮嬫棩鏈�"
+              end-placeholder="缁撴潫鏃ユ湡"
+            ></el-date-picker>
           </el-form-item>
 
           <el-row>
@@ -87,7 +96,7 @@
         </el-form>
 
         <el-row :gutter="10" class="mb8">
-          <el-col :span="1.5">
+          <!-- <el-col :span="1.5">
             <el-button
               type="primary"
               plain
@@ -97,8 +106,8 @@
               v-hasPermi="['system:user:add']"
               >鏂板</el-button
             >
-          </el-col>
-          <el-col :span="1.5">
+          </el-col> -->
+          <!-- <el-col :span="1.5">
             <el-button
               type="success"
               plain
@@ -109,6 +118,18 @@
               v-hasPermi="['system:user:edit']"
               >淇敼</el-button
             >
+          </el-col> -->
+          <el-col :span="1.5">
+            <el-button
+              type="warning"
+              plain
+              icon="el-icon-plus"
+              size="medium"
+              :disabled="multiple"
+              @click="handleBatchAddTask"
+            >
+              娣诲姞寤剁画鎶ょ悊浠诲姟
+            </el-button>
           </el-col>
           <el-col :span="1.5">
             <el-button
@@ -128,6 +149,7 @@
         <el-table
           v-loading="loading"
           :data="userList"
+          height="808"
           @selection-change="handleSelectionChange"
         >
           <el-table-column type="selection" width="50" align="center" />
@@ -153,17 +175,49 @@
           <el-table-column
             label="浣忛櫌鍙�"
             align="center"
-            key="patno"
-            prop="patno"
-          width="120"
+            key="inhospno"
+            prop="inhospno"
+            width="120"
           />
-          <el-table-column
+          <!-- <el-table-column
             label="濮撳悕"
+          width="100"
             align="center"
             key="patname"
             prop="patname"
-          />
-          <el-table-column label="鎬у埆" align="center" key="sex" prop="sex">
+          /> -->
+          <el-table-column
+            fixed
+            label="濮撳悕"
+            width="100"
+            align="center"
+            key="patname"
+            prop="patname"
+          >
+            <template slot-scope="scope">
+              <el-button
+                size="medium"
+                type="text"
+                @click="
+                  gettoken360(
+                    scope.row.idcardno,
+                    scope.row.drcode,
+                    scope.row.drname
+                  )
+                "
+                ><span class="button-textsc">{{
+                  scope.row.patname
+                }}</span></el-button
+              >
+            </template>
+          </el-table-column>
+          <el-table-column
+            label="鎬у埆"
+            width="100"
+            align="center"
+            key="sex"
+            prop="sex"
+          >
             <template slot-scope="scope">
               <span>{{ scope.row.sex == 1 ? "鐢�" : "濂�" }}</span>
             </template>
@@ -173,7 +227,7 @@
             align="center"
             key="age"
             prop="age"
-            width="120"
+            width="80"
           />
           <el-table-column
             label="鑱旂郴鐢佃瘽"
@@ -226,6 +280,13 @@
             width="120"
           />
           <el-table-column
+            label="缁忕鍖荤敓"
+            align="center"
+            key="managementDoctor"
+            prop="managementDoctor"
+            width="120"
+          />
+          <el-table-column
             label="涓绘不鍖荤敓"
             align="center"
             key="drname"
@@ -257,7 +318,6 @@
                     query: { id: scope.row.patid },
                   })
                 "
-
                 ><span class="button-textsc"
                   ><i class="el-icon-zoom-in"></i>鏌ョ湅</span
                 ></el-button
@@ -275,7 +335,172 @@
         />
       </el-col>
     </el-row>
+    <!-- 鎵归噺娣诲姞浠诲姟寮圭獥 -->
+    <!-- 鎵归噺娣诲姞寤剁画鎶ょ悊浠诲姟寮圭獥 -->
+    <el-dialog
+      title="鎵归噺娣诲姞寤剁画鎶ょ悊"
+      :visible.sync="batchTaskVisible"
+      width="90%"
+      append-to-body
+      class="batch-dialog"
+      :close-on-click-modal="false"
+    >
+      <el-row :gutter="20">
+        <!-- 宸︿晶锛氶�変腑鎮h�呭垪琛� -->
+        <el-col :span="12">
+          <div class="batch-patient-section">
+            <div class="section-header">
+              <h4>閫変腑鎮h��</h4>
+              <span class="patient-count">{{ selectedPatients.length }}浜�</span>
+            </div>
+            <el-table
+              :data="selectedPatients"
+              border
+              style="width: 100%"
+              size="small"
+              :row-class-name="tableRowClassName"
+              :header-cell-style="{ background: '#F5F7FA', color: '#606266' }"
+            >
+              <el-table-column
+                prop="patname"
+                label="濮撳悕"
+                width="100"
+                align="center"
+              />
+              <el-table-column
+                prop="sex"
+                label="鎬у埆"
+                width="80"
+                align="center"
+              >
+                <template slot-scope="scope">
+                  <el-tag
+                    size="small"
+                    :type="scope.row.sex === 1 ? 'primary' : 'danger'"
+                  >
+                    {{ scope.row.sex === 1 ? "鐢�" : "濂�" }}
+                  </el-tag>
+                </template>
+              </el-table-column>
+              <el-table-column
+                label="鍏ラ櫌鏃堕棿"
+                align="center"
+                key="starttime"
+                prop="starttime"
+                width="120"
+              >
+                <template slot-scope="scope">
+                  <span class="time-text">{{
+                    formatTime(scope.row.starttime)
+                  }}</span>
+                </template>
+              </el-table-column>
+              <el-table-column
+                prop="inhospno"
+                label="浣忛櫌鍙�"
+                width="120"
+                align="center"
+              />
+              <el-table-column prop="deptname" label="绉戝" align="center" />
+              <el-table-column
+                prop="leavehospitaldistrictname"
+                label="鐥呭尯"
+                align="center"
+              />
+            </el-table>
+          </div>
+        </el-col>
 
+        <!-- 鍙充晶锛氫换鍔″垪琛� -->
+        <el-col :span="12">
+          <div class="batch-task-section">
+            <div class="section-header">
+              <h4>寤剁画鎶ょ悊浠诲姟</h4>
+              <div v-if="selectedTask" class="task-selected-hint selected">
+                <i class="el-icon-success"></i>
+                <span>宸查�夋嫨锛歿{ selectedTask.taskName }}</span>
+              </div>
+              <div v-else class="task-selected-hint">
+                <i class="el-icon-info"></i>
+                <span>璇风偣鍑婚�夋嫨涓�涓换鍔�</span>
+              </div>
+            </div>
+            <el-table
+              :data="taskList"
+              border
+               height="680"
+              style="width: 100%"
+              size="small"
+              @current-change="handleTaskSelectionChange"
+              highlight-current-row
+              :row-class-name="taskRowClassName"
+              :header-cell-style="{ background: '#F5F7FA', color: '#606266' }"
+              :current-row-key="selectedTask ? selectedTask.taskid : ''"
+            >
+              <el-table-column
+                label="浠诲姟鍚嶇О"
+                fixed
+                align="center"
+                key="taskName"
+                prop="taskName"
+                :show-overflow-tooltip="true"
+                width="180"
+              />
+
+              <el-table-column
+                label="鏈嶅姟椤圭洰"
+                align="center"
+                key="templatename"
+                prop="templatename"
+                :show-overflow-tooltip="true"
+              />
+
+              <el-table-column
+                label="鍒涘缓浜�"
+                align="center"
+                key="createBy"
+                prop="createBy"
+                :show-overflow-tooltip="true"
+              />
+              <el-table-column
+                label="鍒涘缓鏃堕棿"
+                sortable
+                align="center"
+                prop="createTime"
+              >
+                <template slot-scope="scope">
+                  <span class="time-text">{{
+                    formatTime(scope.row.createTime)
+                  }}</span>
+                </template>
+              </el-table-column>
+              <template #empty>
+                <div class="empty-message">
+                  <i class="el-icon-document"></i>
+                  <span>鏆傛棤鍙敤寤剁画鎶ょ悊浠诲姟</span>
+                  <span class="empty-tips">璇疯仈绯荤鐞嗗憳鍒涘缓浠诲姟</span>
+                </div>
+              </template>
+            </el-table>
+          </div>
+        </el-col>
+      </el-row>
+
+      <!-- 搴曢儴鎸夐挳 -->
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="batchTaskVisible = false" :disabled="batchLoading"
+          >鍙� 娑�</el-button
+        >
+        <el-button
+          type="primary"
+          :loading="batchLoading"
+          @click="submitBatchTask"
+          :disabled="!selectedTask || batchLoading"
+        >
+          {{ batchLoading ? "鍒涘缓涓�..." : "鍒涘缓寤剁画鎶ょ悊浠诲姟" }}
+        </el-button>
+      </div>
+    </el-dialog>
     <!-- 鐢ㄦ埛瀵煎叆瀵硅瘽妗� -->
     <el-dialog
       :title="upload.title"
@@ -325,8 +550,10 @@
       <div class="uploading" v-else-if="dractive == 2">
         <el-table :data="uploadingData" style="width: 100%">
           <el-table-column prop="serial" label="搴忓彿"> </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="name" label="濮撳悕" width="100">
+          </el-table-column>
+          <el-table-column prop="sex" label="鎬у埆" width="100">
+          </el-table-column>
           <el-table-column prop="certificate" label="璇佷欢绫诲瀷">
           </el-table-column>
           <el-table-column prop="certificatenum" label="璇佷欢鍙风爜">
@@ -370,19 +597,23 @@
 <script>
 import { delUser } from "@/api/system/user";
 
+import { listpatient } from "@/api/patient/record";
 import {
-  listpatient,
-  particularpatient,
+  messagelistpatient,
+  alterpatient,
   addpatient,
+  particularpatient,
   deletepatient,
   Exporterrorpatient,
   toleadpatient,
-} from "@/api/patient/record";
+} from "@/api/patient/homepage";
 import { listtag } from "@/api/system/label";
 import { getToken } from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
 import { listDept } from "@/api/system/dept";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import { query360PatInfo, getTasklist, addSubtask } from "@/api/AiCentre/index";
+
 import store from "@/store";
 
 export default {
@@ -416,6 +647,12 @@
       // 榛樿瀵嗙爜
       initPassword: undefined,
       amendtag: false, //鏄惁淇敼
+      // 鎵归噺浠诲姟鐩稿叧鏁版嵁
+      batchTaskVisible: false, // 寮圭獥鍙鎬�
+      selectedPatients: [], // 閫変腑鐨勬偅鑰呭垪琛�
+      taskList: [], // 浠诲姟鍒楄〃
+      selectedTask: null, // 閫変腑鐨勪换鍔�
+      batchLoading: false, // 鎵归噺鎻愪氦鍔犺浇鐘舵��
       // 鏃ユ湡鑼冨洿
       dateRange: [],
       source: [
@@ -432,6 +669,39 @@
           label: "鐥呭尯鎮h��",
         },
       ],
+      postData: {
+        XiaoXiTou: {
+          FaSongFCSJC: "ZJHES",
+          FaSongJGID: localStorage.getItem("orgid"),
+          FaSongJGMC: localStorage.getItem("orgname"),
+          FaSongSJ: "2025-01-09聽17:29:36",
+          FaSongXTJC: "SUIFANGXT",
+          FaSongXTMC: "闅忚绯荤粺",
+          XiaoXiID: "5FA92AFB-9833-4608-87C7-F56A654AC171",
+          XiaoXiLX: "SC_LC_360STCX",
+          XiaoXiMC: "360聽瑙嗗浘鏌ヨ",
+          ZuHuID: localStorage.getItem("ZuHuID"),
+          ZuHuMC: localStorage.getItem("orgname"),
+        },
+        YeWuXX: {
+          BingRenXX: {
+            ZhengJianHM: "",
+            ZhengJianLXDM: "01",
+            ZhengJianLXMC: "灞呮皯韬唤璇�",
+            ZuZhiJGID: localStorage.getItem("orgid"),
+            ZuZhiJGMC: localStorage.getItem("orgname"),
+          },
+          YongHuXX: {
+            XiTongID: "SUIFANGXT",
+            XiTongMC: "闅忚绯荤粺",
+            YongHuID: localStorage.getItem("YongHuID"),
+            YongHuXM: localStorage.getItem("YongHuXM"),
+            ZuZhiJGID: localStorage.getItem("orgid"),
+            ZuZhiJGMC: localStorage.getItem("orgname"),
+            idp: "lyra",
+          },
+        },
+      },
       paperstypes: [
         { papersname: "韬唤璇�" },
         { papersname: "鎶ょ収" },
@@ -449,6 +719,26 @@
         idcardtype: "",
         relativetelcode: "",
       },
+      sourcetype: [
+        {
+          value: 1,
+          label: "绉戝",
+          children: [],
+        },
+        {
+          value: 2,
+          label: "鐥呭尯",
+          children: [],
+        },
+        {
+          value: 3,
+          label: "鍏ㄩ儴绉戝",
+        },
+        {
+          value: 4,
+          label: "鍏ㄩ儴鐥呭尯",
+        },
+      ],
       //瀵煎叆杩涘害
       dractive: 1,
       // 瀵煎叆灞曠ず琛ㄥ崟
@@ -492,16 +782,13 @@
         pageNum: 1,
         pageSize: 10,
         cry: 1,
-        idcardno: undefined,
-        name: undefined,
-        status: undefined,
-        tagIds: undefined,
-        telcode: undefined,
+        searchscope: 3,
+        scopetype: [],
+        leaveldeptcodes: [],
+        leavehospitaldistrictcodes: [],
       },
       // 琛ㄥ崟鏍¢獙
-      rules: {
-
-      },
+      rules: {},
     };
   },
   watch: {
@@ -511,30 +798,31 @@
     },
   },
   created() {
-
+    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.queryParams.leaveldeptcodes = store.getters.belongDepts.map(
+      (obj) => obj.deptCode
+    );
+    this.queryParams.leavehospitaldistrictcodes = store.getters.belongWards.map(
+      (obj) => obj.districtCode
+    );
     this.getList();
-    this.listDept();
+    // this.listDept();
     this.gettabList();
   },
   methods: {
     /** 鏌ヨ鎮h�呭垪琛� */
     getList() {
-      if (this.queryParams.searchscope == 1) {
-        this.queryParams.leaveldeptcodes = store.getters.belongDepts.map(
-          (obj) => obj.deptCode
-        );
-        this.queryParams.leavehospitaldistrictcodes=null;
-      } else if (this.queryParams.searchscope == 2) {
-        this.queryParams.leavehospitaldistrictcodes =
-          store.getters.belongWards.map((obj) => obj.districtCode);
-          this.queryParams.leaveldeptcodes=null;
-      } else {
-        this.queryParams.leaveldeptcodes = store.getters.belongDepts.map(
-          (obj) => obj.deptCode
-        );
-        this.queryParams.leavehospitaldistrictcodes =
-          store.getters.belongWards.map((obj) => obj.districtCode);
-      }
       this.loading = true;
       listpatient(this.queryParams).then((response) => {
         console.log(response);
@@ -549,6 +837,177 @@
         console.log(this.deptList, "this.deptList");
       });
     },
+    //鎮h��360璺宠浆
+    gettoken360(sfzh, drcode, drname) {
+      // this.$modal.msgWarning('360鍔熻兘鏆傛湭寮�閫�');
+
+      this.postData.YeWuXX.BingRenXX.ZhengJianHM = sfzh;
+
+      query360PatInfo(this.postData).then((res) => {
+        if (res.data.url) {
+          window.open(res.data.url, "_blank");
+          // this.linkUrl = res.data.url;
+        } else {
+          this.$modal.msgWarning("360鏌ヨ鏃犵粨鏋�");
+        }
+      });
+    },
+    /** 鎵归噺娣诲姞浠诲姟鎸夐挳鐐瑰嚮 */
+    handleBatchAddTask() {
+      // 鏍¢獙鏄惁閫変腑鎮h��
+      if (this.ids.length === 0) {
+        this.$modal.msgWarning("璇疯嚦灏戦�変腑1鍚嶆偅鑰�");
+        return;
+      }
+
+      // 鑾峰彇閫変腑鎮h�呯殑绉戝淇℃伅
+      const patientDepts = new Set();
+      let deptcode = "";
+      this.ids.forEach((patId) => {
+        const patient = this.userList.find((item) => item.patid === patId);
+        if (patient) {
+          patientDepts.add(patient.deptname);
+          deptcode = patient.deptcode;
+        }
+      });
+
+      // 鑾峰彇閫変腑鎮h�呭垪琛�
+      this.selectedPatients = this.userList.filter((item) =>
+        this.ids.includes(item.patid)
+      );
+
+      // 鏄剧ず寮圭獥
+      this.batchTaskVisible = true;
+
+      // 鑾峰彇浠诲姟鍒楄〃
+      this.loadTaskList(deptcode);
+    },
+    /** 琛ㄦ牸琛屾牱寮� */
+    tableRowClassName({ row, rowIndex }) {
+      if (rowIndex % 2 === 0) {
+        return "even-row";
+      } else {
+        return "odd-row";
+      }
+    },
+
+    /** 浠诲姟琛ㄦ牸琛屾牱寮� */
+    taskRowClassName({ row, rowIndex }) {
+      if (rowIndex % 2 === 0) {
+        return "task-even-row";
+      } else {
+        return "task-odd-row";
+      }
+    },
+    /** 鍔犺浇浠诲姟鍒楄〃 */
+    loadTaskList(deptcode) {
+      this.batchLoading = true;
+      let topqueryParams = {
+        pageNum: 1,
+        pageSize: 100, // 璁剧疆杈冨ぇ鐨勫垎椤佃幏鍙栨洿澶氫换鍔�
+        type: 2, // 鏍规嵁瀹為檯鎯呭喌璋冩暣
+      };
+
+      getTasklist(topqueryParams)
+        .then((response) => {
+          this.taskList = response.rows;
+          this.batchLoading = false;
+
+          if (this.taskList.length === 0) {
+            this.$modal.msgWarning("褰撳墠绉戝鏃犲彲鐢ㄤ换鍔�");
+          }
+        })
+        .catch((error) => {
+          this.$modal.msgError("鑾峰彇浠诲姟鍒楄〃澶辫触锛�" + error.message);
+          this.batchLoading = false;
+        });
+    },
+
+    /** 澶勭悊浠诲姟閫夋嫨鍙樺寲 */
+    handleTaskSelectionChange(currentRow) {
+      this.selectedTask = currentRow;
+    },
+
+    /** 鎵归噺鎻愪氦浠诲姟 */
+    async submitBatchTask() {
+      // 鏍¢獙鏄惁閫変腑浠诲姟
+      if (!this.selectedTask) {
+        this.$modal.msgWarning("璇烽�夋嫨1涓换鍔�");
+        return;
+      }
+
+      this.batchLoading = true;
+      const successPatients = [];
+      const failedPatients = [];
+      const errorMessages = [];
+
+      try {
+        // 閬嶅巻閫変腑鐨勬偅鑰咃紝閫愪釜璋冪敤鎺ュ彛
+        for (const patient of this.selectedPatients) {
+          const params = {
+            taskid: this.selectedTask.taskid,
+            type: this.selectedTask.type,
+            taskName: this.selectedTask.taskName,
+            serviceType: 99,
+            preachform: this.selectedTask.preachform,
+            templateid: this.selectedTask.templateid,
+            libtemplateid: this.selectedTask.libtemplateid,
+            sendstate: 2,
+            continueFlag: 2,
+            ...patient,
+            sendname: patient.patname,
+            starttime: patient.starttime ? patient.starttime + " 00:00:00" : "",
+            endtime: patient.endtime ? patient.endtime + " 00:00:00" : "",
+            leavediagname: patient.leavediagname || patient.diagname || "",
+            age: patient.age || "",
+          };
+
+          try {
+            const response = await addSubtask(params);
+            if (response.code === 200) {
+              successPatients.push(patient.patname);
+            } else {
+              failedPatients.push(patient.patname);
+              errorMessages.push(
+                `${patient.patname}: ${response.msg || "娣诲姞澶辫触"}`
+              );
+            }
+          } catch (error) {
+            failedPatients.push(patient.patname);
+            errorMessages.push(
+              `${patient.patname}: ${error.message || "缃戠粶閿欒"}`
+            );
+          }
+        }
+
+        // 鏄剧ず澶勭悊缁撴灉
+        if (failedPatients.length === 0) {
+          this.$modal.msgSuccess(
+            `鎴愬姛涓� ${successPatients.length} 鍚嶆偅鑰呮坊鍔犱换鍔
+          );
+        } else {
+          this.$modal.msgWarning(
+            `鎴愬姛娣诲姞 ${successPatients.length} 浜猴紝澶辫触 ${failedPatients.length} 浜恒�俙 +
+              (errorMessages.length > 0
+                ? `澶辫触鍘熷洜锛�${errorMessages.join("; ")}`
+                : "")
+          );
+        }
+
+        this.batchTaskVisible = false;
+        this.getList(); // 鍒锋柊鎮h�呭垪琛�
+      } catch (error) {
+        this.$modal.msgError("鎵归噺娣诲姞浠诲姟杩囩▼涓嚭閿欙細" + error.message);
+      } finally {
+        this.batchLoading = false;
+      }
+    },
+
+    /** 鏍煎紡鍖栨椂闂� */
+    formatTime(time) {
+      if (!time) return "";
+      return time;
+    },
     /** 鏌ヨ鏍囩鍒楄〃 */
     gettabList() {
       const tagqueryParams = {
@@ -562,6 +1021,34 @@
         console.log(response);
         this.optionstag = response.rows;
       });
+    },
+    // 鎮h�呰寖鍥村鐞�
+    handleChange(value) {
+      let type = value[0];
+      let code = value.slice(-1)[0];
+      this.queryParams.leavehospitaldistrictcodes = [];
+      this.queryParams.leaveldeptcodes = [];
+
+      if (type == 1) {
+        this.queryParams.leaveldeptcodes.push(code);
+        this.queryParams.leavehospitaldistrictcodes = [];
+        this.queryParams.searchscope = 1;
+      } else if (type == 2) {
+        this.queryParams.leavehospitaldistrictcodes.push(code);
+        this.queryParams.leaveldeptcodes = [];
+        this.queryParams.searchscope = 2;
+      } else if (type == 3) {
+        this.queryParams.leaveldeptcodes = store.getters.belongDepts.map(
+          (obj) => obj.deptCode
+        );
+        this.queryParams.searchscope = 3;
+        this.queryParams.leavehospitaldistrictcodes = [];
+      } else if (type == 4) {
+        this.queryParams.leaveldeptcodes = [];
+        this.queryParams.leavehospitaldistrictcodes =
+          store.getters.belongWards.map((obj) => obj.districtCode);
+        this.queryParams.searchscope = 4;
+      }
     },
     // 鏌ヨ瀵煎叆灞曠ず鍒楄〃
     geterryList() {
@@ -605,6 +1092,13 @@
     },
     /** 鎼滅储鎸夐挳鎿嶄綔 */
     handleQuery() {
+      if (this.dateRange) {
+        this.queryParams.startOutHospTime = this.dateRange[0];
+        this.queryParams.endOutHospTime = this.dateRange[1];
+      } else {
+        this.queryParams.startOutHospTime = "";
+        this.queryParams.endOutHospTime = "";
+      }
       this.queryParams.pageNum = 1;
       this.getList();
     },
@@ -612,7 +1106,18 @@
     resetQuery() {
       this.dateRange = [];
       this.resetForm("queryForm");
-      this.$refs.tree.setCurrentKey(null);
+      this.queryParams = {
+        pageNum: 1,
+        pageSize: 10,
+        cry: 1,
+        searchscope: 3,
+        scopetype: [],
+        leaveldeptcodes: [],
+        leavehospitaldistrictcodes: [],
+      };
+      this.queryParams.leaveldeptcodes = store.getters.belongDepts.map(
+        (obj) => obj.deptCode
+      );
       this.handleQuery();
     },
     // 澶氶�夋閫変腑鏁版嵁
@@ -698,7 +1203,7 @@
     /** 涓嬭浇妯℃澘鎿嶄綔 */
     importTemplate() {
       this.download(
-        "system/user/importTemplate",
+        "smartor/import/getImportPatTemplate",
         {},
         `user_template_${new Date().getTime()}.xlsx`
       );
@@ -783,6 +1288,325 @@
   }
 }
 .button-textsc {
-  color: #28cfe6;
+  color: #3664d9;
+}
+// 鎵归噺浠诲姟寮圭獥浼樺寲鏍峰紡
+.batch-dialog {
+  .el-dialog__body {
+    padding: 20px 20px 10px;
+  }
+
+  .el-dialog__header {
+    background: linear-gradient(135deg, #5788fe, #7aa1ff);
+    padding: 15px 20px;
+
+    .el-dialog__title {
+      color: white;
+      font-weight: 600;
+      font-size: 16px;
+    }
+
+    .el-dialog__headerbtn {
+      .el-dialog__close {
+        color: white;
+        font-size: 18px;
+
+        &:hover {
+          color: #f0f0f0;
+        }
+      }
+    }
+  }
+}
+
+// 寮圭獥鍐呭鍖哄煙
+.batch-patient-section,
+.batch-task-section {
+  h4 {
+    margin: 0 0 12px 0;
+    color: #333;
+    font-size: 16px;
+    font-weight: 600;
+    padding-left: 8px;
+    border-left: 4px solid #5788fe;
+    display: flex;
+    align-items: center;
+
+    &::before {
+      content: "";
+      display: inline-block;
+      width: 6px;
+      height: 6px;
+      background-color: #5788fe;
+      border-radius: 50%;
+      margin-right: 8px;
+    }
+  }
+
+  .section-header {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    margin-bottom: 12px;
+
+    .patient-count {
+      color: #5788fe;
+      font-weight: 500;
+      background: #f0f5ff;
+      padding: 4px 12px;
+      border-radius: 12px;
+      font-size: 13px;
+    }
+  }
+}
+
+// 鎮h�呰〃鏍间紭鍖�
+.batch-patient-section {
+  .el-table {
+    border: 1px solid #e8eaec;
+    border-radius: 6px;
+    overflow: hidden;
+
+    .el-table__header-wrapper {
+      th {
+        background-color: #f5f7fa;
+        color: #606266;
+        font-weight: 600;
+        height: 40px;
+      }
+    }
+
+    .el-table__body-wrapper {
+      tr:hover > td {
+        background-color: #f5f9ff;
+      }
+    }
+  }
+}
+
+// 浠诲姟琛ㄦ牸浼樺寲
+.batch-task-section {
+  .el-table {
+    border: 1px solid #e8eaec;
+    border-radius: 6px;
+    overflow: hidden;
+
+    .el-table__header-wrapper {
+      th {
+        background-color: #f5f7fa;
+        color: #606266;
+        font-weight: 600;
+        height: 40px;
+      }
+    }
+
+    .el-table__body-wrapper {
+      tr {
+        cursor: pointer;
+        transition: all 0.3s;
+
+        &:hover > td {
+          background-color: #f5f9ff;
+        }
+
+        // 閫変腑琛屾牱寮�
+        &.current-row {
+          td {
+            background-color: #e8f1ff !important;
+            border-left: 3px solid #5788fe;
+
+            &:first-child {
+              border-left: none;
+            }
+          }
+        }
+      }
+
+      .selected-row {
+        position: relative;
+
+        &::after {
+          content: "鉁�";
+          position: absolute;
+          right: 10px;
+          top: 50%;
+          transform: translateY(-50%);
+          color: #5788fe;
+          font-weight: bold;
+          font-size: 16px;
+        }
+      }
+    }
+
+    .el-table__empty-block {
+      min-height: 200px;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+    }
+  }
+}
+
+// 绌虹姸鎬佷紭鍖�
+.empty-message {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  padding: 40px 20px;
+  color: #909399;
+
+  i {
+    font-size: 48px;
+    margin-bottom: 12px;
+    color: #c0c4cc;
+  }
+
+  span {
+    font-size: 14px;
+    color: #c0c4cc;
+  }
+
+  .empty-tips {
+    margin-top: 8px;
+    font-size: 12px;
+    color: #dcdfe6;
+  }
+}
+
+// 搴曢儴鎸夐挳鍖哄煙
+.dialog-footer {
+  display: flex;
+  justify-content: flex-end;
+  padding: 20px 0 0;
+  border-top: 1px solid #f0f0f0;
+  margin-top: 20px;
+
+  .el-button {
+    min-width: 80px;
+    height: 36px;
+    border-radius: 4px;
+    font-size: 14px;
+
+    &.el-button--default {
+      color: #666;
+      border-color: #dcdfe6;
+
+      &:hover {
+        color: #5788fe;
+        border-color: #5788fe;
+        background-color: #f0f5ff;
+      }
+    }
+
+    &.el-button--primary {
+      background: linear-gradient(135deg, #5788fe, #7aa1ff);
+      border-color: #5788fe;
+
+      &:hover {
+        background: linear-gradient(135deg, #4a7cfe, #6b94ff);
+        border-color: #4a7cfe;
+      }
+
+      &:active {
+        background: linear-gradient(135deg, #3d70fe, #5e87ff);
+        border-color: #3d70fe;
+      }
+
+      &.is-loading {
+        position: relative;
+        pointer-events: none;
+
+        &::after {
+          content: "";
+          position: absolute;
+          right: 10px;
+          top: 50%;
+          transform: translateY(-50%);
+          width: 16px;
+          height: 16px;
+          border: 2px solid transparent;
+          border-top-color: white;
+          border-radius: 50%;
+          animation: loading-rotate 1s linear infinite;
+        }
+      }
+    }
+  }
+}
+
+// 鍔犺浇鍔ㄧ敾
+@keyframes loading-rotate {
+  0% {
+    transform: translateY(-50%) rotate(0deg);
+  }
+  100% {
+    transform: translateY(-50%) rotate(360deg);
+  }
+}
+
+// 鍝嶅簲寮忚皟鏁�
+@media screen and (max-width: 1200px) {
+  .batch-patient-section,
+  .batch-task-section {
+    margin-bottom: 20px;
+  }
+
+  .el-row {
+    flex-wrap: wrap;
+  }
+
+  .el-col-12 {
+    width: 100%;
+  }
+}
+
+// 浠诲姟鍒楄〃閫変腑鎻愮ず
+.task-selected-hint {
+  margin-top: 8px;
+  font-size: 12px;
+  color: #5788fe;
+  display: flex;
+  align-items: center;
+
+  i {
+    margin-right: 4px;
+    font-size: 14px;
+  }
+
+  &.selected {
+    color: #67c23a;
+  }
+}
+
+// 寮圭獥婊氬姩浼樺寲
+.el-dialog__wrapper {
+  .el-dialog {
+    border-radius: 8px;
+    overflow: hidden;
+    box-shadow: 0 4px 20px rgba(87, 136, 254, 0.1);
+
+    .el-dialog__body {
+      max-height: 70vh;
+      overflow-y: auto;
+
+      &::-webkit-scrollbar {
+        width: 6px;
+      }
+
+      &::-webkit-scrollbar-track {
+        background: #f5f5f5;
+        border-radius: 3px;
+      }
+
+      &::-webkit-scrollbar-thumb {
+        background: #c0c4cc;
+        border-radius: 3px;
+
+        &:hover {
+          background: #a0a4ab;
+        }
+      }
+    }
+  }
 }
 </style>

--
Gitblit v1.9.3