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/behospitalized.vue | 1269 +++++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 954 insertions(+), 315 deletions(-)

diff --git a/src/views/patient/patient/behospitalized.vue b/src/views/patient/patient/behospitalized.vue
index d755294..56c7b2f 100644
--- a/src/views/patient/patient/behospitalized.vue
+++ b/src/views/patient/patient/behospitalized.vue
@@ -13,34 +13,58 @@
         >
           <el-form-item label="鎮h�呭鍚�" prop="name">
             <el-input
-              v-model="queryParams.name"
+              v-model="queryParams.patname"
               placeholder="璇疯緭鍏ュ鍚�"
               clearable
-              style="width: 200px"
               @keyup.enter.native="handleQuery"
             />
           </el-form-item>
-          <el-form-item label="鎮h�呬綇闄㈠彿" prop="idno">
+          <el-form-item label="涓绘不鍖荤敓" prop="name">
             <el-input
-              v-model="queryParams.idno"
+              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="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=" 鍏ラ櫌鏃ユ湡 " 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>
+          </el-form-item>
+
           <el-row>
             <el-form-item>
               <el-button
@@ -61,7 +85,7 @@
         </el-form>
 
         <el-row :gutter="10" class="mb8">
-          <el-col :span="1.5">
+          <!-- <el-col :span="1.5">
             <el-button
               type="primary"
               plain
@@ -71,18 +95,19 @@
               v-hasPermi="['system:user:add']"
               >鏂板</el-button
             >
-          </el-col>
+          </el-col> -->
+          <!-- 寤剁画鎶ょ悊鎸夐挳 -->
           <el-col :span="1.5">
             <el-button
-              type="success"
+              type="warning"
               plain
-              icon="el-icon-edit"
+              icon="el-icon-plus"
               size="medium"
-              :disabled="single"
-              @click="handleUpdate"
-              v-hasPermi="['system:user:edit']"
-              >淇敼</el-button
+              :disabled="multiple"
+              @click="handleBatchAddTask"
             >
+              娣诲姞寤剁画鎶ょ悊浠诲姟
+            </el-button>
           </el-col>
           <el-col :span="1.5">
             <el-button
@@ -96,65 +121,74 @@
               >鍒犻櫎</el-button
             >
           </el-col>
-          <el-col :span="19">
-            <div class="documentf">
-              <div class="document">
-                <el-button
-                  type="info"
-                  plain
-                  icon="el-icon-upload2"
-                  size="medium"
-                  @click="handleImport"
-                  v-hasPermi="['system:user:import']"
-                  >瀵煎叆</el-button
-                >
-              </div>
-              <div class="document">
-                <el-button
-                  type="warning"
-                  plain
-                  icon="el-icon-download"
-                  size="medium"
-                  @click="handleExport"
-                  v-hasPermi="['system:user:export']"
-                  >瀵煎嚭</el-button
-                >
-              </div>
-            </div>
-          </el-col>
+
           <!-- <el-col :span="1.5"> </el-col> -->
         </el-row>
         <el-table
           v-loading="loading"
           :data="userList"
+          height="808"
           @selection-change="handleSelectionChange"
         >
           <el-table-column type="selection" width="50" align="center" />
-          <el-table-column
+          <!-- <el-table-column
             label="搴忓彿"
+            fixed
             align="center"
-            key="patid"
-            prop="patid"
-          />
+            key="id"
+            prop="id"
+          /> -->
           <el-table-column
-            label="搴婁綅鍙�"
+            label="鍏ラ櫌鏃ユ湡"
             align="center"
-            key="Patientnumber"
-            prop="Patientnumber"
-          />
+            key="starttime"
+            prop="starttime"
+            width="160"
+          >
+            <template slot-scope="scope">
+              <span>{{ formatTime(scope.row.starttime) }}</span>
+            </template>
+          </el-table-column>
+
           <el-table-column
             label="浣忛櫌鍙�"
             align="center"
-            key="Patientnumber"
-            prop="Patientnumber"
+            key="inhospno"
+            prop="inhospno"
+            width="120"
           />
+
           <el-table-column
-            label="鎮h�呭鍚�"
+            label="濮撳悕"
+            width="100"
             align="center"
-            key="name"
-            prop="name"
-          />
-          <el-table-column label="鎬у埆" align="center" key="sex" prop="sex">
+            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>
@@ -167,89 +201,61 @@
             width="120"
           />
           <el-table-column
-            label="璐圭敤"
+            label="鑱旂郴鐢佃瘽"
             align="center"
-            key="telephone"
-            prop="telephone"
+            key="telcode"
+            prop="telcode"
             width="120"
           />
-          <el-table-column
-            label="鍏ョ鏃堕棿"
-            align="center"
-            key="archivetime"
-            prop="archivetime"
-            width="160"
-          >
-            <template slot-scope="scope">
-              <span>{{ parseTime(scope.row.createTime) }}</span>
-            </template>
-          </el-table-column>
-          <el-table-column
-            label="鍑洪櫌鏃堕棿"
-            align="center"
-            key="archivetime"
-            prop="archivetime"
-            width="160"
-          >
-            <template slot-scope="scope">
-              <span>{{ parseTime(scope.row.createTime) }}</span>
-            </template>
-          </el-table-column>
 
           <el-table-column
-            label="鎶ょ悊绛夌骇"
+            label="鍏ラ櫌璇婃柇"
             align="center"
-            key="idtype"
-            prop="idtype"
-            width="120"
-          />
-          <el-table-column
-            label="鐥呮儏鐘舵��"
-            align="center"
-            key="idno"
-            prop="idno"
+            key="diagname"
+            prop="diagname"
             width="190"
           />
 
           <el-table-column
-            label="涓讳换鍖诲笀"
+            label="绉戝"
             align="center"
-            key="telcode"
-            prop="telcode"
+            key="deptname"
+            prop="deptname"
+            width="180"
+          />
+          <el-table-column
+            label="鐥呭尯"
+            align="center"
+            key="leavehospitaldistrictname"
+            prop="leavehospitaldistrictname"
+            width="180"
+          />
+          <el-table-column
+            label="搴婁綅鍙�"
+            align="center"
+            key="bedNo"
+            prop="bedNo"
             width="120"
           />
           <el-table-column
-            label="涓绘不鍖诲笀"
+            label="涓绘不鍖荤敓"
             align="center"
-            key="telcode"
-            prop="telcode"
+            key="drname"
+            prop="drname"
             width="120"
           />
           <el-table-column
-            label="浣忛櫌鍖诲笀"
+            label="璐d换鎶ゅ+"
             align="center"
-            key="telcode"
-            prop="telcode"
+            key="nurseName"
+            prop="nurseName"
             width="120"
           />
-          <el-table-column
-            label="浣忛櫌鐥呭尯"
-            align="center"
-            key="telcode"
-            prop="telcode"
-            width="120"
-          />
-          <el-table-column
-            label="鍏ラ櫌璇婃柇"
-            align="center"
-            key="telcode"
-            prop="telcode"
-            width="120"
-          />
+
           <el-table-column
             label="鎿嶄綔"
+            fixed="right"
             align="center"
-            width="160"
             class-name="small-padding fixed-width"
           >
             <template slot-scope="scope">
@@ -262,18 +268,8 @@
                     query: { id: scope.row.patid },
                   })
                 "
-                v-hasPermi="['system:user:edit']"
                 ><span class="button-textsc"
                   ><i class="el-icon-zoom-in"></i>鏌ョ湅</span
-                ></el-button
-              >
-              <el-button
-                size="medium"
-                type="text"
-                @click="handleUpdate(scope.row)"
-                v-hasPermi="['system:user:edit']"
-                ><span class="button-textxg"
-                  ><i class="el-icon-edit"></i>淇敼</span
                 ></el-button
               >
             </template>
@@ -289,126 +285,172 @@
         />
       </el-col>
     </el-row>
-
-    <!-- 娣诲姞鎴栦慨鏀圭敤鎴烽厤缃璇濇 -->
+    <!-- 鎵归噺娣诲姞寤剁画鎶ょ悊浠诲姟寮圭獥 -->
+    <!-- 鎵归噺娣诲姞寤剁画鎶ょ悊浠诲姟寮圭獥 -->
     <el-dialog
-      :title="amendtag ? '淇敼鎮h�呬俊鎭�' : '鏂板鎮h��'"
-      :visible.sync="Labelchange"
-      width="900px"
+      title="鎵归噺娣诲姞寤剁画鎶ょ悊"
+      :visible.sync="batchTaskVisible"
+      width="90%"
+      append-to-body
+      class="batch-dialog"
+      :close-on-click-modal="false"
     >
-      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
-        <el-row>
-          <el-col :span="12">
-            <el-form-item label="濮撳悕" prop="name">
-              <el-input
-                v-model="form.name"
-                placeholder="璇疯緭鍏ュ鍚�"
-                maxlength="30"
+      <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-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="鎬у埆" prop="sex">
-              <el-select v-model="form.sex" placeholder="璇烽�夋嫨鎬у埆">
-                <el-option
-                  v-for="dict in dict.type.sys_user_sex"
-                  :key="dict.value"
-                  :label="dict.label"
-                  :value="dict.value"
-                ></el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="12">
-            <el-form-item label="璇佷欢绫诲瀷" prop="idtype">
-              <el-select v-model="form.idtype" placeholder="璇烽�夋嫨鎬у埆">
-                <el-option
-                  v-for="item in paperstypes"
-                  :key="item.papersname"
-                  :label="item.papersname"
-                  :value="item.papersname"
-                ></el-option>
-              </el-select>
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="璇佷欢鍙�" prop="idno">
-              <el-input
-                v-model="form.idno"
-                placeholder="璇疯緭鍏ヨ瘉浠跺彿"
-                maxlength="50"
+              <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-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="12">
-            <el-form-item label="鏈汉鎵嬫満鍙�" prop="telcode">
-              <el-input
-                v-model="form.telcode"
-                placeholder="璇疯緭鍏ユ墜鏈哄彿"
-                maxlength="30"
+              <el-table-column prop="deptname" label="绉戝" align="center" />
+              <el-table-column
+                prop="leavehospitaldistrictname"
+                label="鐥呭尯"
+                align="center"
               />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="浜插睘鎵嬫満鍙�" prop="relativetelcode">
-              <el-input
-                v-model="form.relativetelcode"
-                placeholder="璇疯緭鍏ヤ翰灞炴墜鏈哄彿"
-                type="password"
-                maxlength="20"
-                show-password
+            </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
+              style="width: 100%"
+              height="680"
+              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-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="12">
-            <el-form-item label="骞撮緞" prop="age">
-              <el-input
-                v-model="form.age"
-                placeholder="璇疯緭鍏ュ勾榫�"
-                maxlength="30"
+
+              <el-table-column
+                label="鏈嶅姟椤圭洰"
+                align="center"
+                key="templatename"
+                prop="templatename"
+                :show-overflow-tooltip="true"
               />
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="鎮h�呮爣绛�">
-              <!-- <el-select v-model="form.sex" placeholder="璇烽�夋嫨"> -->
-              <el-select v-model="form.tagList" multiple placeholder="璇烽�夋嫨">
-                <el-option
-                  v-for="item in optionstag"
-                  :key="item.tagid"
-                  :label="item.tagname"
-                  :value="item.tagid"
-                >
-                </el-option>
-              </el-select>
-              <!-- </el-select> -->
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="24">
-            <el-form-item label="澶囨敞">
-              <el-input
-                v-model="form.remark"
-                type="textarea"
-                placeholder="璇疯緭鍏ュ唴瀹�"
-              ></el-input>
-            </el-form-item>
-          </el-col>
-        </el-row>
-      </el-form>
+
+              <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 type="primary" @click="submitForm">纭� 瀹�</el-button>
-        <el-button @click="cancel">鍙� 娑�</el-button>
+        <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"
@@ -458,8 +500,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="璇佷欢鍙风爜">
@@ -502,13 +546,9 @@
 
 <script>
 import { delUser } from "@/api/system/user";
-import {
-  listpat_archive,
-  getpat_archive,
-  addpat_archive,
-  updatepat_archive,
-  delpat_archive,
-} from "@/api/smartorpor/pat_archive";
+import formatTime from "@/filters/index";
+
+import { listpatient } from "@/api/patient/record";
 import {
   messagelistpatient,
   alterpatient,
@@ -518,10 +558,15 @@
   Exporterrorpatient,
   toleadpatient,
 } 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 {
   name: "behospitalized",
@@ -554,6 +599,12 @@
       // 榛樿瀵嗙爜
       initPassword: undefined,
       amendtag: false, //鏄惁淇敼
+      // 鎵归噺浠诲姟鐩稿叧鏁版嵁
+      batchTaskVisible: false, // 寮圭獥鍙鎬�
+      selectedPatients: [], // 閫変腑鐨勬偅鑰呭垪琛�
+      taskList: [], // 浠诲姟鍒楄〃
+      selectedTask: null, // 閫変腑鐨勪换鍔�
+      batchLoading: false, // 鎵归噺鎻愪氦鍔犺浇鐘舵��
       // 鏃ユ湡鑼冨洿
       dateRange: [],
       paperstypes: [
@@ -562,15 +613,82 @@
         { papersname: "涓浗娓境灞呮皯韬唤璇�" },
         { papersname: "涓浗鍙版咕灞呮皯韬唤璇�" },
       ],
+      source: [
+        {
+          value: 0,
+          label: "鎵�灞炴偅鑰�",
+        },
+        {
+          value: 1,
+          label: "绉戝鎮h��",
+        },
+        {
+          value: 2,
+          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",
+          },
+        },
+      },
+      sourcetype: [
+        {
+          value: 1,
+          label: "绉戝",
+          children: [],
+        },
+        {
+          value: 2,
+          label: "鐥呭尯",
+          children: [],
+        },
+        {
+          value: 3,
+          label: "鍏ㄩ儴绉戝",
+        },
+        {
+          value: 4,
+          label: "鍏ㄩ儴鐥呭尯",
+        },
+      ],
       // 琛ㄥ崟鍙傛暟
       form: {
         name: "",
         age: "",
         sex: "",
         tagList: [],
-        idno: "",
+        idcardno: "",
         telcode: "",
-        idtype: "",
+        idcardtype: "",
         relativetelcode: "",
       },
       //瀵煎叆杩涘害
@@ -584,8 +702,8 @@
       optionstag: [], //鏍囩鍒楄〃
       Patientrange: [
         {
-          name: "鍏ㄩ儴",
-          id: 1,
+          name: "鍏ㄩ儴绉戝",
+          id: 999,
         },
         {
           name: "褰撳墠绉戝",
@@ -615,57 +733,11 @@
       queryParams: {
         pageNum: 1,
         pageSize: 10,
-        idno: undefined,
-        name: undefined,
-        status: undefined,
-        tagIds: undefined,
-        telcode: undefined,
-      },
-      // 琛ㄥ崟鏍¢獙
-      rules: {
-        // userName: [
-        //   { required: true, message: "鐢ㄦ埛鍚嶇О涓嶈兘涓虹┖", trigger: "blur" },
-        //   {
-        //     min: 2,
-        //     max: 20,
-        //     message: "鐢ㄦ埛鍚嶇О闀垮害蹇呴』浠嬩簬 2 鍜� 20 涔嬮棿",
-        //     trigger: "blur",
-        //   },
-        // ],
-        // nickName: [
-        //   { required: true, message: "鐢ㄦ埛鏄电О涓嶈兘涓虹┖", trigger: "blur" },
-        // ],
-        // password: [
-        //   { required: true, message: "鐢ㄦ埛瀵嗙爜涓嶈兘涓虹┖", trigger: "blur" },
-        //   {
-        //     min: 5,
-        //     max: 20,
-        //     message: "鐢ㄦ埛瀵嗙爜闀垮害蹇呴』浠嬩簬 5 鍜� 20 涔嬮棿",
-        //     trigger: "blur",
-        //   },
-        // ],
-        // email: [
-        //   {
-        //     type: "email",
-        //     message: "璇疯緭鍏ユ纭殑閭鍦板潃",
-        //     trigger: ["blur", "change"],
-        //   },
-        // ],
-        // phonenumber: [
-        //   {
-        //     pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
-        //     message: "璇疯緭鍏ユ纭殑鎵嬫満鍙风爜",
-        //     trigger: "blur",
-        //   },
-        // ],
-        // IDnumber: [
-        //   {
-        //     pattern:
-        //       /^\d{6}((((((19|20)\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|(((19|20)\d{2})(0[13578]|1[02])31)|((19|20)\d{2})02(0[1-9]|1\d|2[0-8])|((((19|20)([13579][26]|[2468][048]|0[48]))|(2000))0229))\d{3})|((((\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|((\d{2})(0[13578]|1[02])31)|((\d{2})02(0[1-9]|1\d|2[0-8]))|(([13579][26]|[2468][048]|0[048])0229))\d{2}))(\d|X|x)$/,
-        //     message: "璇疯緭鍏ユ纭殑韬唤璇佸彿鐮�",
-        //     trigger: "blur",
-        //   },
-        // ],
+        cry: 0,
+        searchscope: 3,
+        scopetype: [],
+        leaveldeptcodes: [],
+        leavehospitaldistrictcodes: [],
       },
     };
   },
@@ -676,24 +748,96 @@
     },
   },
   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.gettabList();
   },
   methods: {
     /** 鏌ヨ鎮h�呭垪琛� */
     getList() {
       this.loading = true;
-      messagelistpatient(this.queryParams).then((response) => {
+      listpatient(this.queryParams).then((response) => {
         console.log(response);
         this.userList = response.rows;
         this.total = response.total;
         this.loading = false;
       });
     },
+    /** 琛ㄦ牸琛屾牱寮� */
+    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";
+      }
+    },
+    listDept() {
+      listDept(this.queryParams).then((res) => {
+        this.deptList = res.data;
+        console.log(this.deptList, "this.deptList");
+      });
+    },
+    // 鎮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 == 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;
+      }
+    },
     /** 鏌ヨ鏍囩鍒楄〃 */
     gettabList() {
-      const queryParams = {};
-      listtag().then((response) => {
+      const tagqueryParams = {
+        pageNum: 1,
+        pageSize: 1000,
+        tagname: undefined,
+        tagdescription: undefined,
+        tagcategoryid: "0",
+      };
+      listtag(tagqueryParams).then((response) => {
         console.log(response);
         this.optionstag = response.rows;
       });
@@ -707,7 +851,151 @@
         this.loading = false;
       });
     },
+    /** 鎵归噺娣诲姞寤剁画鎶ょ悊浠诲姟鎸夐挳鐐瑰嚮 */
+    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);
+    },
+
+    /** 鍔犺浇浠诲姟鍒楄〃 */
+    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: 1, // 寤剁画鎶ょ悊鏍囧織锛堝湪闄㈡偅鑰咃級
+            ...patient,
+            sendname: patient.patname,
+            // 鍦ㄩ櫌鎮h�呬娇鐢ㄥ綋鍓嶆椂闂翠綔涓轰换鍔″紑濮嬫椂闂�
+            starttime: new Date().toISOString().split("T")[0] + " 00:00:00",
+            // 鍦ㄩ櫌鎮h�呭彲鑳介渶瑕佽缃换鍔$殑缁撴潫鏃堕棿锛堝鍑洪櫌鍚�7澶╋級
+            endtime: this.getFollowUpEndTime(patient.starttime),
+            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;
+      }
+    },
+
+    /** 璁$畻闅忚缁撴潫鏃堕棿锛堝湪闄㈡偅鑰咃細鍑洪櫌鍚�7澶╋級 */
+    getFollowUpEndTime(admitDate) {
+      if (!admitDate) return "";
+      // 鍋囪鍦ㄩ櫌鎮h�呯殑寤剁画鎶ょ悊鍦ㄥ嚭闄㈠悗7澶╃粨鏉�
+      const endDate = new Date(admitDate);
+      endDate.setDate(endDate.getDate() + 7); // 鍑洪櫌鍚�7澶�
+      return endDate.toISOString().split("T")[0] + " 00:00:00";
+    },
     // 绛涢�夎妭鐐�
     filterNode(value, data) {
       if (!value) return true;
@@ -718,7 +1006,21 @@
       this.queryParams.deptId = data.id;
       this.handleQuery();
     },
+    //鎮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鏌ヨ鏃犵粨鏋�");
+        }
+      });
+    },
     // 鍙栨秷鎸夐挳
     cancel() {
       this.Labelchange = false;
@@ -731,15 +1033,22 @@
         age: "",
         sex: "",
         tagList: [],
-        idno: "",
+        idcardno: "",
         telcode: "",
-        idtype: "",
+        idcardtype: "",
         relativetelcode: "",
       };
       // this.resetForm("form");
     },
     /** 鎼滅储鎸夐挳鎿嶄綔 */
     handleQuery() {
+      if (this.dateRange) {
+        this.queryParams.startInHospTime = this.dateRange[0];
+        this.queryParams.endInHospTime = this.dateRange[1];
+      } else {
+        this.queryParams.startInHospTime = "";
+        this.queryParams.endInHospTime = "";
+      }
       this.queryParams.pageNum = 1;
       this.getList();
     },
@@ -747,7 +1056,18 @@
     resetQuery() {
       this.dateRange = [];
       this.resetForm("queryForm");
-      this.$refs.tree.setCurrentKey(null);
+      this.queryParams = {
+        pageNum: 1,
+        pageSize: 10,
+        cry: 0,
+        searchscope: 3,
+        scopetype: [],
+        leaveldeptcodes: [],
+        leavehospitaldistrictcodes: [],
+      };
+      this.queryParams.leaveldeptcodes = store.getters.belongDepts.map(
+        (obj) => obj.deptCode
+      );
       this.handleQuery();
     },
     // 澶氶�夋閫変腑鏁版嵁
@@ -833,7 +1153,7 @@
     /** 涓嬭浇妯℃澘鎿嶄綔 */
     importTemplate() {
       this.download(
-        "system/user/importTemplate",
+        "smartor/import/getImportPatTemplate",
         {},
         `user_template_${new Date().getTime()}.xlsx`
       );
@@ -918,6 +1238,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