From 871522ed7e06fd9c62a87c178d7f5c88d7853a20 Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期一, 20 四月 2026 18:04:35 +0800
Subject: [PATCH] 初始提交

---
 pages/case/CaseDetails.vue |  177 +++++++++++++++++++++++++++--------------------------------
 1 files changed, 81 insertions(+), 96 deletions(-)

diff --git a/pages/case/CaseDetails.vue b/pages/case/CaseDetails.vue
index 5dad930..e2ead72 100644
--- a/pages/case/CaseDetails.vue
+++ b/pages/case/CaseDetails.vue
@@ -16,51 +16,41 @@
           </view>
 
           <view class="form-grid">
+            <!-- 淇敼鍚庯細娌荤枟鍖婚櫌杈撳叆妗� -->
             <view class="form-item">
-              <text class="item-label">妗堜緥缂栧彿</text>
+              <text class="item-label required">娌荤枟鍖婚櫌</text>
               <u-input
-                v-model="form.caseNo"
-                placeholder="涓婃姤鍚庤嚜鍔ㄧ敓鎴�"
-                disabled
-                :disabledColor="disabledColor"
-                border="none"
+                v-model="form.treatmenthospitalname"
+                placeholder="璇疯緭鍏ユ不鐤楀尰闄㈠悕绉�"
+                maxlength="100"
+                class="custom-input"
               />
             </view>
 
-            <!-- 鏀归�犲悗鐨勫尰鐤楁満鏋勯�夋嫨 -->
+            <!-- 鏂板锛氫笂鎶ュ尰闄� -->
             <view class="form-item">
-              <text class="item-label">鍖荤枟鏈烘瀯</text>
-              <picker
-                mode="selector"
-                :range="hospitalLabels"
-                :value="hospitalIndex"
-                @change="onHospitalChange"
-              >
-                <view class="picker">
-                  <text>{{ currentHospital }}</text>
-                  <text class="icon-arrow">鈥�</text>
-                </view>
-              </picker>
+              <text class="item-label">涓婃姤鍖婚櫌</text>
+              <u-input
+                v-model="form.toHospital"
+                placeholder="璇疯緭鍏ヤ笂鎶ュ尰闄�"
+                maxlength="100"
+                class="custom-input"
+              />
             </view>
 
-            <!-- 鏀归�犲悗鐨勭瀹ら�夋嫨 -->
+            <!-- 鏂板锛氶儴闂ㄥ悕绉� -->
             <view class="form-item">
-              <text class="item-label">绉戝</text>
-              <picker
-                mode="selector"
-                :range="deptLabels"
-                :value="deptIndex"
-                @change="onDeptChange"
-              >
-                <view class="picker">
-                  <text>{{ currentDept }}</text>
-                  <text class="icon-arrow">鈥�</text>
-                </view>
-              </picker>
+              <text class="item-label">閮ㄩ棬鍚嶇О</text>
+              <u-input
+                v-model="form.deptName"
+                placeholder="璇疯緭鍏ラ儴闂ㄥ悕绉�"
+                maxlength="50"
+                class="custom-input"
+              />
             </view>
 
             <view class="form-item">
-              <text class="item-label required">濮撳悕</text>
+              <text class="item-label required">鎮h�呭鍚�</text>
               <u-input
                 type="text"
                 v-model="form.name"
@@ -201,7 +191,7 @@
             <view class="form-item">
               <text class="item-label">GCS璇勫垎</text>
               <u-input
-                v-model="form.gscScore"
+                v-model="form.gcsScore"
                 placeholder="璇疯緭鍏CS璇勫垎"
                 border="none"
               />
@@ -225,11 +215,11 @@
                   v-for="bloodType in bloodTypeOptions"
                   :key="bloodType.value"
                   class="radio-item"
-                  @click="form.bloodtype = bloodType.value"
+                  @click="form.bloodType = bloodType.value"
                 >
                   <view
                     class="radio-dot"
-                    :class="{ active: form.bloodtype === bloodType.value }"
+                    :class="{ active: form.bloodType === bloodType.value }"
                   ></view>
                   <text class="radio-label">{{ bloodType.label }}</text>
                 </view>
@@ -246,7 +236,7 @@
                 >
                   <view
                     class="radio-dot"
-                    :class="{ active: form.bloodtype === bloodType.value }"
+                    :class="{ active: form.infectious == bloodType.value }"
                   ></view>
                   <text class="radio-label">{{ bloodType.label }}</text>
                 </view>
@@ -268,11 +258,11 @@
                   v-for="rh in rhOptions"
                   :key="rh.value"
                   class="radio-item"
-                  @click="form.rhyin = rh.value"
+                  @click="form.rhYin = rh.value"
                 >
                   <view
                     class="radio-dot"
-                    :class="{ active: form.rhyin === rh.value }"
+                    :class="{ active: form.rhYin === rh.value }"
                   ></view>
                   <text class="radio-label">{{ rh.label }}</text>
                 </view>
@@ -452,8 +442,8 @@
   ageunit: "", // 鏂板锛氬勾榫勫崟浣�
   inpatientno: "",
   diagnosisname: "",
-  bloodtype: "",
-  rhyin: "",
+  bloodType: "",
+  rhYin: "",
   infoname: "",
   infophone: "",
   reportername: userStore.name || "",
@@ -493,6 +483,8 @@
 // 閫夋嫨鍣ㄧ姸鎬�
 const attachments = ref([]);
 const infectiousDiseaselist = ref([]);
+const nationLabel = ref([]);
+
 const isReadonly = ref(false);
 const id = ref(null);
 const selectShow = ref(false);
@@ -566,7 +558,12 @@
 
 // 璁$畻灞炴��
 const isFormValid = computed(() => {
-  return form.value.name && form.value.idcardno && form.value.diagnosisname;
+  return (
+    form.value.name &&
+    form.value.idcardno &&
+    form.value.diagnosisname &&
+    form.value.toHospital
+  );
 });
 // 閫夋嫨鍣ㄧ储寮�
 const hospitalIndex = ref(-1);
@@ -576,11 +573,11 @@
 
 // 璁$畻灞炴�� - 鏍囩鏁扮粍
 const hospitalLabels = computed(() =>
-  hospitalOptions.value.map((item) => item.label)
+  hospitalOptions.value.map((item) => item.label),
 );
 const ageDisplay = computed(() => {
   if (!form.value.age || !form.value.ageunit) {
-    return '鑷姩璁$畻';
+    return "鑷姩璁$畻";
   }
   return `${form.value.age}${form.value.ageunit}`;
 });
@@ -588,10 +585,10 @@
   return pickerColumns.value[0].map((item) => item.label);
 });
 const nationLabels = computed(() =>
-  nationOptions.value.map((item) => item.label)
+  nationLabel.value.map((item) => item.label),
 );
 const idCardTypeLabels = computed(() =>
-  idCardTypeOptions.value.map((item) => item.label)
+  idCardTypeOptions.value.map((item) => item.label),
 );
 
 // 璁$畻灞炴�� - 褰撳墠閫変腑鏄剧ず鏂囨湰
@@ -619,22 +616,10 @@
     : "璇烽�夋嫨璇佷欢绫诲瀷";
 });
 
-// 閫夋嫨鍣ㄥ彉鏇翠簨浠�
-const onHospitalChange = (e) => {
-  const index = parseInt(e.detail.value);
-  hospitalIndex.value = index;
-  form.value.treatmenthospitalname = hospitalOptions.value[index].label;
-};
-
-const onDeptChange = (e) => {
-  const index = parseInt(e.detail.value);
-  deptIndex.value = index;
-  form.value.treatmentdeptname = pickerColumns.value[0][index].label;
-};
 
 const onNationChange = (e) => {
   const index = parseInt(e.detail.value);
-  nationIndex.value = index;
+  nationIndex.value = nationOptions.value[index].label;
   form.value.nation = nationOptions.value[index].label;
 };
 
@@ -650,12 +635,12 @@
 };
 const onDateConfirm = (e) => {
   const date = new Date(e.value);
-  
+
   // 鏍煎紡鍖栨棩鏈熶负 YYYY-MM-DD
   form.value.birthday = `${date.getFullYear()}-${(date.getMonth() + 1)
     .toString()
     .padStart(2, "0")}-${date.getDate().toString().padStart(2, "0")}`;
-  
+
   calculateAge();
   showDatePicker.value = false;
 };
@@ -710,12 +695,12 @@
   dict.value = await useDict(
     "sys_IDType",
     "sys_user_sex",
+    "sys_Nation",
     "sys_BloodType",
     "sys_Infectious",
     "sys_AgeUnit", // 鏂板骞撮緞鍗曚綅
     "sys_education", // 鏂板瀛﹀巻
-    "sys_nation", // 鏂板姘戞棌
-    "sys_occupation" // 鏂板鑱屼笟
+    "sys_occupation", // 鏂板鑱屼笟
   );
   initOptions();
   updateCurrentTime();
@@ -724,6 +709,7 @@
 const initOptions = () => {
   infectiousDiseaselist.value = dict.value.sys_Infectious || [];
   idCardTypeOptions.value = dict.value.sys_IDType || [];
+  nationLabel.value = dict.value.sys_Nation || [];
 };
 // 鏂规硶瀹氫箟
 const updateCurrentTime = () => {
@@ -753,18 +739,18 @@
 
 const calculateAge = () => {
   if (!form.value.birthday) {
-    form.value.age = '';
-    form.value.ageunit = '';
+    form.value.age = "";
+    form.value.ageunit = "";
     return;
   }
 
   const birthDate = new Date(form.value.birthday);
   const today = new Date();
-  
+
   // 妫�鏌ユ棩鏈熸湁鏁堟��
   if (isNaN(birthDate.getTime())) {
-    form.value.age = '';
-    form.value.ageunit = '';
+    form.value.age = "";
+    form.value.ageunit = "";
     return;
   }
 
@@ -774,8 +760,8 @@
 
   if (daysDiff < 0) {
     // 鏈潵鏃ユ湡澶勭悊
-    form.value.age = '';
-    form.value.ageunit = '';
+    form.value.age = "";
+    form.value.ageunit = "";
     return;
   }
 
@@ -789,14 +775,14 @@
   if (years >= 1) {
     // 澶т簬绛変簬1骞达細鏄剧ず骞�
     let actualYears = years;
-    
+
     // 澶勭悊鏈堜唤鍜屾棩鏈熺殑杈圭晫鎯呭喌
     if (months < 0 || (months === 0 && days < 0)) {
       actualYears = years - 1;
     }
-    
+
     ageValue = actualYears.toString();
-    ageUnit = '宀�';
+    ageUnit = "宀�";
   } else if (daysDiff >= 30) {
     // 澶т簬绛変簬30澶╋細鏄剧ず鏈�
     let totalMonths = years * 12 + months;
@@ -804,11 +790,11 @@
       totalMonths--;
     }
     ageValue = Math.max(1, totalMonths).toString(); // 纭繚鑷冲皯1涓湀
-    ageUnit = '涓湀';
+    ageUnit = "涓湀";
   } else {
     // 灏忎簬30澶╋細鏄剧ず澶�
     ageValue = Math.max(1, daysDiff).toString(); // 纭繚鑷冲皯1澶�
-    ageUnit = '澶�';
+    ageUnit = "澶�";
   }
 
   form.value.age = ageValue;
@@ -844,7 +830,7 @@
         .map((f) =>
           f.url.startsWith("http")
             ? f.url
-            : baseUrlHt + (f.url.startsWith("/") ? "" : "/") + f.url
+            : baseUrlHt + (f.url.startsWith("/") ? "" : "/") + f.url,
         ),
       current: fullUrl,
     });
@@ -974,7 +960,6 @@
       isTransport: form.value.isTransport || "1",
       terminationCase: form.value.terminationCase || 0,
       reportStatus: form.value.reportStatus || "1",
-      
     };
 
     let res;
@@ -982,13 +967,13 @@
       // 淇敼鎺ュ彛
       res = await uni.$uapi.post(
         "/project/donatebaseinforeport/edit",
-        submitData
+        submitData,
       );
     } else {
       // 鏂板鎺ュ彛
       res = await uni.$uapi.post(
         "/project/donatebaseinforeport/add",
-        submitData
+        submitData,
       );
     }
 
@@ -1043,8 +1028,8 @@
   //   age: "38",
   //   inpatientno: "ZY20241216001",
   //   diagnosisname: "鑴戝浼ゅ鑷磋剳姝讳骸",
-  //   bloodtype: "A",
-  //   rhyin: "positive",
+  //   bloodType: "A",
+  //   rhYin: "positive",
   //   infoname: "鏉庡尰鐢�",
   //   infophone: "13800138000",
   //   reporterno: "寮犲尰鐢�",
@@ -1053,24 +1038,24 @@
   try {
     loading.value = true;
     const res = await uni.$uapi.get(
-      `/project/donatebaseinforeport/getInfo/${id}`
+      `/project/donatebaseinforeport/getInfo/${id}`,
     );
 
-    if (res.code === 200 && res.data) {
-      // 濉厖琛ㄥ崟鏁版嵁
-      Object.keys(form.value).forEach((key) => {
-        if (res.data[key] !== undefined && res.data[key] !== null) {
-          form.value[key] = res.data[key];
-        }
-      });
+    if (res) {
+      console.log(res, "res");
+
+      form.value = res;
+      console.log(1, "res");
 
       // 澶勭悊閫夋嫨鍣ㄧ储寮�
-      updatePickerIndexes();
+      // updatePickerIndexes();
 
+      console.log(2, "res");
       // 澶勭悊闄勪欢
-      if (res.data.annexfilesList) {
-        attachments.value = res.data.annexfilesList;
+      if (res.annexfilesList) {
+        attachments.value = res.annexfilesList;
       }
+      console.log(3, "res");
 
       uni.showToast({
         title: "鏁版嵁鍔犺浇鎴愬姛",
@@ -1093,25 +1078,25 @@
 const updatePickerIndexes = () => {
   // 鍖荤枟鏈烘瀯绱㈠紩
   const hospitalIndex = hospitalOptions.value.findIndex(
-    (item) => item.label === form.value.treatmenthospitalname
+    (item) => item.label === form.value.treatmenthospitalname,
   );
   if (hospitalIndex !== -1) hospitalIndex.value = hospitalIndex;
 
   // 绉戝绱㈠紩
   const deptIndex = pickerColumns.value[0].findIndex(
-    (item) => item.label === form.value.treatmentdeptname
+    (item) => item.label === form.value.treatmentdeptname,
   );
   if (deptIndex !== -1) deptIndex.value = deptIndex;
 
   // 姘戞棌绱㈠紩
   const nationIndex = nationOptions.value.findIndex(
-    (item) => item.label === form.value.nation
+    (item) => item.label === form.value.nation,
   );
   if (nationIndex !== -1) nationIndex.value = nationIndex;
 
   // 璇佷欢绫诲瀷绱㈠紩
   const idCardTypeIndex = idCardTypeOptions.value.findIndex(
-    (item) => item.value === form.value.idcardtype
+    (item) => item.value === form.value.idcardtype,
   );
   if (idCardTypeIndex !== -1) idCardTypeIndex.value = idCardTypeIndex;
 };

--
Gitblit v1.9.3