From 09dc74e264b6262cbe41c9c8476e24705871d4a6 Mon Sep 17 00:00:00 2001
From: yxh <172933527@qq.com>
Date: 星期日, 08 十一月 2026 23:31:17 +0800
Subject: [PATCH] yxh

---
 src/api/ecg/appointment/index.ts |   89 ++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 81 insertions(+), 8 deletions(-)

diff --git a/src/api/ecg/appointment/index.ts b/src/api/ecg/appointment/index.ts
index 45283ba..798a472 100644
--- a/src/api/ecg/appointment/index.ts
+++ b/src/api/ecg/appointment/index.ts
@@ -3,6 +3,10 @@
 // 棰勭害 VO
 export interface AppointmentVO {
   id: number,
+  applyNo: string  // 棰勭害鐢宠缂栧彿
+  episodeId: string //灏辫瘖娴佹按鍙�
+  patSrc: number
+  tolerance:number// 鏄惁鑰愯嵂
   patId: string // 鎮h�呯紪鍙�
   patName: string // 鎮h�呭鍚�
   patGender: number // 鎮h�呮�у埆
@@ -16,19 +20,55 @@
   patWardCode: string // 鎮h�呮墍鍦ㄧ梾鍖轰唬鐮�
   patWardDesc: string // 鎮h�呮墍鍦ㄧ梾鍖哄悕绉�
   patBedNo: string // 搴婂彿
-  bookId: string // 棰勭害缂栧彿
   bookDate: Date // 棰勭害鏃ユ湡
   bookTimeslot: number // 棰勭害鏃堕棿娈�
   bookTime: Date // 棰勭害鍙戠敓鏃堕棿, 鐐瑰嚮棰勭害鐨勬椂闂�
-  bookCheckType: number // 棰勭害妫�鏌ョ被鍨�
+  bookCheckType: number // 棰勭害妫�鏌ラ」鐩�
   paid: number //宸蹭粯娆�
+  bookSeqNum: number
+  /**
+   * 銆愭湰闇�姹傘�戦潪褰撳ぉ棰勭害绛惧埌鐨�"宸茬‘璁�"鏍囪銆�
+   * 鍓嶇寮圭獥纭鍚庣疆 true 浼犵粰鍚庣锛氬悗绔嵁姝ゆ斁琛岄潪褰撳ぉ棰勭害锛屽苟鎸�**棰勭暀鍙�**鍙栧彿銆�
+   */
+  forceCheckIn?: boolean
+  // ========== 浠ヤ笅瀛楁鍚庣 AppointmentRespVO 涓�鐩存湁杩斿洖锛屾鍓� TS 鏈0鏄� ==========
+  // 闇�姹�1 浣跨敤锛氱姸鎬� / 寮�鍗曞尰甯� / 寮�鍗曟棩鏈� / 璺濅粖澶╂暟锛堢敱 doctorTime 璁$畻锛�/ 灏辫瘖鍗″彿
+  status?: string // 鐘舵�侊紙瀛楀吀 ecg_status锛�
+  doctor?: string // 寮�鍗曞尰甯�
+  doctorCode?: string // 寮�鍗曞尰甯堜唬鐮�
+  doctorTime?: Date | number | string // 寮�鍗曟棩鏈燂紙寮�鍗曟椂闂达級
+  registerDate?: Date | number | string // 鐧昏鏃堕棿
+  hospitalNo?: string // 浣忛櫌鍙�
+  medicalCard?: string // 灏辫瘖鍗″彿锛堝簱涓涓虹┖锛岄〉闈㈠洖閫�鍒� outpatientNo锛�
+  doctorAdviceNo?: string // 鍖诲槺鍙凤紙HIS root 2.16.156.10011.1.28锛涘簱涓巻鍙叉暟鎹负绌猴級
+  outpatientNo?: string // 闂ㄨ瘖鍙凤紙瀹炴祴閮ㄥ垎鏁版嵁瀛樼殑鏄韩浠借瘉鍙凤級
+  bookSrc?: number // 棰勭害鏉ユ簮锛�0浜哄伐 10骞冲彴
+  roomName?: string // 璇婂鍚嶇О
+  remark?: string // 澶囨敞
+  jjbz?: string // 鍔犳�ユ爣璁�
+  createTime?: Date | number | string // 鍒涘缓鏃堕棿
+}
+
+/**
+ * 銆愭湰闇�姹傘�戦绾﹁褰曢〉鐨勩�岄绾︽棩鏈熴�嶇敤鏃ユ湡鑼冨洿閫夋嫨鍣紝鍓嶇瀛楁鏄� `bookDateRange`锛圼'2026-11-01','2026-11-30']锛夛紝
+ * 鑰屽悗绔帴鏀剁殑鏄� `bookDateStart` / `bookDateEnd`锛堝惈棣栧熬涓ゅぉ锛夈��
+ * 杩欓噷缁熶竴杞崲锛岄伩鍏嶆瘡涓皟鐢ㄧ偣鍚勫啓涓�閬嶏細鍒嗛〉銆佸鍑洪兘璧板畠銆�
+ */
+const withBookDateRange = (params: any) => {
+  if (!params) return params
+  const { bookDateRange, ...rest } = params
+  if (Array.isArray(bookDateRange) && bookDateRange.length === 2 && bookDateRange[0] && bookDateRange[1]) {
+    rest.bookDateStart = `${bookDateRange[0]} 00:00:00`
+    rest.bookDateEnd = `${bookDateRange[1]} 23:59:59`
+  }
+  return rest
 }
 
 // 棰勭害 API
 export const AppointmentApi = {
   // 鏌ヨ棰勭害鍒嗛〉
   getAppointmentPage: async (params: any) => {
-    return await request.get({ url: `/ecg/appointment/page`, params })
+    return await request.get({ url: `/ecg/appointment/page`, params: withBookDateRange(params) })
   },
 
   // 鏌ヨ棰勭害璇︽儏
@@ -36,14 +76,42 @@
     return await request.get({ url: `/ecg/appointment/get?id=` + id })
   },
 
-  // 鏌ヨ棰勭害璇︽儏
-  getAppointmentByPatId: async (patId: string) => {
-    return await request.get({ url: `/ecg/appointment/get-by-patient?patId=` + patId })
+  //
+  getCurAppointmentByPatIdAndCheckType: async (patId: string, checkType: number) => {
+    return await request.get({ url: `/ecg/appointment/get-current-by-patient?patId=` + patId + '&checkType=' + checkType })
+  },
+
+  // 浠嶩IS鎴栬�匘B鏌ヨ棰勭害璇︽儏
+  queryAndCreateAppointmentByPatId: async (patId: string) => {
+    return await request.get({ url: `/ecg/appointment/query-and-create-by-patient?patId=` + patId })
+  },
+
+  // 浠嶩IS鏌ヨ棰勭害鎴栧紑鍗曚俊鎭�
+  queryAppointmentFromHis: async (patId: string) => {
+    return await request.get({ url: `/ecg/appointment/query-his-by-patient?patId=` + patId })
+  },
+
+  /**
+   * 銆愭湰闇�姹傦細绱ф�ユ偅鑰呬笉鎺掗槦鐩存帴妫�鏌ャ�戞寜銆岀敵璇峰崟鍙� / 灏辫瘖鍙� / 鎮h�呯紪鍙枫�嶆煡杩戜竴涓湀锛埪�30 澶╋級鐨勯绾﹁褰曘��
+   * 缁撴灉鎸夐绾︽椂闂村�掑簭锛沗checkTypes` 涓烘湰绐楀彛寮�灞曠殑妫�鏌ラ」鐩紙閫楀彿鍒嗛殧锛岀┖鍒欎笉闄愶級銆�
+   */
+  getEmergencyCandidates: async (code: string, checkTypes?: number[]) => {
+    const types = Array.isArray(checkTypes) && checkTypes.length > 0 ? checkTypes.join(',') : ''
+    return await request.get({
+      url:
+        `/ecg/appointment/emergency-candidates?code=` +
+        encodeURIComponent(code) +
+        (types ? `&checkTypes=${types}` : '')
+    })
   },
 
   // 鏂板棰勭害
   createAppointment: async (data: AppointmentVO) => {
     return await request.post({ url: `/ecg/appointment/create`, data })
+  },
+  // 鐘舵�佹洿鏂�
+  alterAppointment: async (data: AppointmentVO) => {
+    return await request.post({ url: `/ecg/appointment/updateStatus`, data })
   },
 
   // 淇敼棰勭害
@@ -58,12 +126,17 @@
 
   // 瀵煎嚭棰勭害 Excel
   exportAppointment: async (params) => {
-    return await request.download({ url: `/ecg/appointment/export-excel`, params })
+    return await request.download({ url: `/ecg/appointment/export-excel`, params: withBookDateRange(params) })
   },
 
-  // 淇敼棰勭害
+  // 棰勭害纭
   confirmAppointment: async (data: AppointmentVO) => {
       return await request.post({ url: `/ecg/appointment/confirm`, data })
+  },
+
+  // VIP棰勭害纭
+  confirmAppointmentVip: async (data: AppointmentVO) => {
+      return await request.post({ url: `/ecg/appointment/confirm-vip`, data })
   }
 
 }

--
Gitblit v1.9.3