From 888f941ae16c850c0f1a844ec9436058840920bd Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期五, 24 四月 2026 09:19:02 +0800
Subject: [PATCH] 推送
---
pages/case/CaseDetails.vue | 287 +++++++++++++++++++++++++--------------------------------
1 files changed, 127 insertions(+), 160 deletions(-)
diff --git a/pages/case/CaseDetails.vue b/pages/case/CaseDetails.vue
index 6577fb6..fa0f18c 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"
/>
@@ -217,7 +207,23 @@
:customStyle="textareaStyle(!form.diagnosisname)"
/>
</view>
-
+ <view class="form-item">
+ <text class="item-label">鏄惁闇�瑕佽浆杩�</text>
+ <view class="radio-group horizontal">
+ <view
+ v-for="bloodType in isTransportOptions"
+ :key="bloodType.value"
+ class="radio-item"
+ @click="form.isTransport = bloodType.value"
+ >
+ <view
+ class="radio-dot"
+ :class="{ active: form.isTransport === bloodType.value }"
+ ></view>
+ <text class="radio-label">{{ bloodType.label }}</text>
+ </view>
+ </view>
+ </view>
<view class="form-item">
<text class="item-label">琛�鍨�</text>
<view class="radio-group horizontal">
@@ -225,11 +231,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 +252,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>
@@ -256,7 +262,7 @@
<text class="item-label">鍏朵粬</text>
<u-input
v-model="form.infectiousOther"
- placeholder="璇疯緭鍏ヤ綇闄㈠彿"
+ placeholder="璇疯緭鍏ュ叾浠栦紶鏌撶梾"
border="none"
/>
</view>
@@ -268,11 +274,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 +458,8 @@
ageunit: "", // 鏂板锛氬勾榫勫崟浣�
inpatientno: "",
diagnosisname: "",
- bloodtype: "",
- rhyin: "",
+ bloodType: "",
+ rhYin: "",
infoname: "",
infophone: "",
reportername: userStore.name || "",
@@ -493,6 +499,8 @@
// 閫夋嫨鍣ㄧ姸鎬�
const attachments = ref([]);
const infectiousDiseaselist = ref([]);
+const nationLabel = ref([]);
+
const isReadonly = ref(false);
const id = ref(null);
const selectShow = ref(false);
@@ -543,15 +551,18 @@
]);
const bloodTypeOptions = ref([
- { label: "A鍨�", value: "A" },
- { label: "B鍨�", value: "B" },
- { label: "O鍨�", value: "O" },
- { label: "AB鍨�", value: "AB" },
+ { label: "A鍨�", value: "A鍨�" },
+ { label: "B鍨�", value: "B鍨�" },
+ { label: "O鍨�", value: "O鍨�" },
+ { label: "AB鍨�", value: "AB鍨�" },
]);
-
+const isTransportOptions = ref([
+ { label: "闇�瑕�", value: "2" },
+ { label: "涓嶉渶瑕�", value: "1" },
+]);
const rhOptions = ref([
- { label: "闃虫��", value: "positive" },
- { label: "闃存��", value: "negative" },
+ { label: "闃虫��", value: "1" },
+ { label: "闃存��", value: "0" },
]);
const reporterOptions = ref([
@@ -566,7 +577,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 +592,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 +604,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,29 +635,18 @@
: "璇烽�夋嫨璇佷欢绫诲瀷";
});
-// 閫夋嫨鍣ㄥ彉鏇翠簨浠�
-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;
form.value.nation = nationOptions.value[index].label;
+ console.log(form.value.nation, "form.value.nation");
};
const onIdCardTypeChange = (e) => {
const index = parseInt(e.detail.value);
idCardTypeIndex.value = index;
form.value.idcardtype = idCardTypeOptions.value[index].value;
+ console.log(form.value.idcardtype, "form.value.idcardtype");
};
const onBirthdayChange = (e) => {
@@ -650,12 +655,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 +715,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 +729,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 +759,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 +780,8 @@
if (daysDiff < 0) {
// 鏈潵鏃ユ湡澶勭悊
- form.value.age = '';
- form.value.ageunit = '';
+ form.value.age = "";
+ form.value.ageunit = "";
return;
}
@@ -789,14 +795,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 +810,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;
@@ -818,16 +824,19 @@
// 澶勭悊鍩虹闄勪欢涓婁紶
const handleBaseUpload = (file) => {
console.log("鍩虹闄勪欢涓婁紶鎴愬姛:", file);
+ attachments.value.push(file);
};
// 澶勭悊鍏朵粬闄勪欢涓婁紶
const handleFilesUpdate = (files) => {
- formData.attachments = files.map((file) => ({
+ console.log(files, "files");
+
+ attachments.value = files.map((file) => ({
...file,
// 纭繚鍙瓨鍌ㄥ崐璺緞
- url: file.url.startsWith("http")
- ? file.url.replace(baseUrlHt, "")
- : file.url,
+ // url: file.url.startsWith("http")
+ // ? file.url.replace(baseUrlHt, "")
+ // : file.url,
}));
};
@@ -839,12 +848,12 @@
if (file.type.includes("image")) {
uni.previewImage({
- urls: formData.attachments
+ urls: attachments.value
.filter((f) => f.type.includes("image"))
.map((f) =>
f.url.startsWith("http")
? f.url
- : baseUrlHt + (f.url.startsWith("/") ? "" : "/") + f.url
+ : baseUrlHt + (f.url.startsWith("/") ? "" : "/") + f.url,
),
current: fullUrl,
});
@@ -876,6 +885,8 @@
};
const onHospitalConfirm = (e) => {
+ console.log(e, "姘戞棌");
+
if (e.value && e.value[0]) {
form.value.treatmenthospitalname = e.value[0].label;
}
@@ -960,35 +971,33 @@
try {
uni.showLoading({ title: isEditMode.value ? "淇敼涓�..." : "鎻愪氦涓�..." });
-
// 鍑嗗鎻愪氦鏁版嵁
const submitData = {
...form.value,
age: parseInt(form.value.age) || 0,
annexfilesList: attachments.value.map((file) => ({
- url: file.url,
- name: file.name,
+ path: file.url,
+ fileName: file.name,
type: file.type,
})),
phone: form.value.infophone,
isTransport: form.value.isTransport || "1",
terminationCase: form.value.terminationCase || 0,
reportStatus: form.value.reportStatus || "1",
-
};
let res;
if (isEditMode.value) {
// 淇敼鎺ュ彛
res = await uni.$uapi.post(
- "/system/donatebaseinforeport/edit",
- submitData
+ "/project/donatebaseinforeport/edit",
+ submitData,
);
} else {
// 鏂板鎺ュ彛
res = await uni.$uapi.post(
- "/system/donatebaseinforeport/add",
- submitData
+ "/project/donatebaseinforeport/add",
+ submitData,
);
}
@@ -1028,49 +1037,28 @@
};
const loadCaseData = async (id) => {
- // 妯℃嫙鍔犺浇缂栬緫鏁版嵁
- // form.value = {
- // caseNo: "DON20241216001",
- // treatmenthospitalname: "闈掑矝闀滄箹鍖婚櫌",
- // treatmentdeptname: "绁炵粡澶栫",
- // name: "寮犱笁",
- // nation: "姹夋棌",
- // nationality: "涓浗",
- // idcardtype: "灞呮皯韬唤璇�",
- // idcardno: "370203198510123456",
- // sex: "1",
- // birthday: "1985-10-12",
- // age: "38",
- // inpatientno: "ZY20241216001",
- // diagnosisname: "鑴戝浼ゅ鑷磋剳姝讳骸",
- // bloodtype: "A",
- // rhyin: "positive",
- // infoname: "鏉庡尰鐢�",
- // infophone: "13800138000",
- // reporterno: "寮犲尰鐢�",
- // reporttime: currentTime.value,
- // };
try {
loading.value = true;
const res = await uni.$uapi.get(
- `/system/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.code) {
+ form.value = res.data;
// 澶勭悊閫夋嫨鍣ㄧ储寮�
- updatePickerIndexes();
+ // updatePickerIndexes();
+ console.log(2, "res");
// 澶勭悊闄勪欢
if (res.data.annexfilesList) {
attachments.value = res.data.annexfilesList;
+ attachments.value.forEach((item) => {
+ item.url = item.path;
+ item.name = item.fileName;
+ });
}
+ console.log(3, "res");
uni.showToast({
title: "鏁版嵁鍔犺浇鎴愬姛",
@@ -1089,32 +1077,7 @@
loading.value = false;
}
};
-// 鏇存柊閫夋嫨鍣ㄧ储寮�
-const updatePickerIndexes = () => {
- // 鍖荤枟鏈烘瀯绱㈠紩
- const hospitalIndex = hospitalOptions.value.findIndex(
- (item) => item.label === form.value.treatmenthospitalname
- );
- if (hospitalIndex !== -1) hospitalIndex.value = hospitalIndex;
- // 绉戝绱㈠紩
- const deptIndex = pickerColumns.value[0].findIndex(
- (item) => item.label === form.value.treatmentdeptname
- );
- if (deptIndex !== -1) deptIndex.value = deptIndex;
-
- // 姘戞棌绱㈠紩
- const nationIndex = nationOptions.value.findIndex(
- (item) => item.label === form.value.nation
- );
- if (nationIndex !== -1) nationIndex.value = nationIndex;
-
- // 璇佷欢绫诲瀷绱㈠紩
- const idCardTypeIndex = idCardTypeOptions.value.findIndex(
- (item) => item.value === form.value.idcardtype
- );
- if (idCardTypeIndex !== -1) idCardTypeIndex.value = idCardTypeIndex;
-};
</script>
<style lang="scss" scoped>
.case-report-container {
@@ -1249,6 +1212,16 @@
display: flex;
gap: 20rpx;
margin-top: 40rpx;
+ // background: #fff;
+ // padding: 20rpx 0;
+ // position: fixed;
+ // bottom: 0;
+ // left: 0;
+ // right: 0;
+ // padding: 20rpx 30rpx;
+ // padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
+ // box-shadow: 0 -2rpx 20rpx rgba(0, 0, 0, 0.08);
+ // z-index: 9;
}
.btn {
@@ -1472,12 +1445,6 @@
border-radius: 12rpx !important;
padding: 20rpx 24rpx !important;
background: #fff !important;
-}
-
-.action-buttons {
- display: flex;
- gap: 20rpx;
- margin-top: 40rpx;
}
.btn {
--
Gitblit v1.9.3