858 lines
36 KiB
JavaScript
858 lines
36 KiB
JavaScript
"use strict";
|
|
const common_vendor = require("../../common/vendor.js");
|
|
if (!Array) {
|
|
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
|
|
_easycom_uni_icons2();
|
|
}
|
|
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
|
|
if (!Math) {
|
|
_easycom_uni_icons();
|
|
}
|
|
const _sfc_main = {
|
|
__name: "edit_card",
|
|
setup(__props) {
|
|
const { proxy } = common_vendor.getCurrentInstance();
|
|
const loading = common_vendor.ref(false);
|
|
const submitting = common_vendor.ref(false);
|
|
const agreedToTerms = common_vendor.ref(true);
|
|
const showDatePicker = common_vendor.ref(false);
|
|
const diagnosisId = common_vendor.ref(null);
|
|
const patientId = common_vendor.ref(null);
|
|
const isAddMode = common_vendor.ref(false);
|
|
const returnUrl = common_vendor.ref("");
|
|
const formData = common_vendor.ref({
|
|
patient_name: "",
|
|
id_card: "",
|
|
gender: 1,
|
|
age: "",
|
|
// 生命体征
|
|
height: "",
|
|
weight: "",
|
|
systolic_pressure: "",
|
|
diastolic_pressure: "",
|
|
fasting_blood_sugar: "",
|
|
// 主诉
|
|
diabetes_discovery_year: "",
|
|
local_hospital_diagnosis: [],
|
|
local_hospital_name: "",
|
|
local_hospital_visit_date: "",
|
|
// 诊断信息
|
|
diagnosis_date: "",
|
|
diagnosis_type: "",
|
|
syndrome_type: "",
|
|
diabetes_type: "",
|
|
// 现病史
|
|
appetite: "",
|
|
water_intake: "",
|
|
diet_condition: [],
|
|
weight_change: "",
|
|
body_feeling: [],
|
|
sleep_condition: [],
|
|
eye_condition: [],
|
|
head_feeling: [],
|
|
sweat_condition: [],
|
|
skin_condition: [],
|
|
urine_condition: [],
|
|
stool_condition: [],
|
|
kidney_condition: [],
|
|
fatty_liver_degree: "",
|
|
// 既往史
|
|
past_history: [],
|
|
trauma_history: 0,
|
|
surgery_history: 0,
|
|
allergy_history: 0,
|
|
family_history: 0,
|
|
pregnancy_history: 0,
|
|
// 临床信息
|
|
symptoms: "",
|
|
tongue_coating: "",
|
|
tongue_images: [],
|
|
report_files: [],
|
|
pulse: "",
|
|
treatment_principle: "",
|
|
prescription: "",
|
|
doctor_advice: "",
|
|
remark: ""
|
|
});
|
|
const diagnosisTypeOptions = common_vendor.ref([]);
|
|
const syndromeTypeOptions = common_vendor.ref([]);
|
|
const diabetesTypeOptions = common_vendor.ref([]);
|
|
const pastHistoryOptions = common_vendor.ref([]);
|
|
const appetiteOptions = common_vendor.ref([]);
|
|
const waterIntakeOptions = common_vendor.ref([]);
|
|
const dietConditionOptions = common_vendor.ref([]);
|
|
const weightChangeOptions = common_vendor.ref([]);
|
|
const bodyFeelingOptions = common_vendor.ref([]);
|
|
const sleepConditionOptions = common_vendor.ref([]);
|
|
const eyeConditionOptions = common_vendor.ref([]);
|
|
const headFeelingOptions = common_vendor.ref([]);
|
|
const sweatConditionOptions = common_vendor.ref([]);
|
|
const skinConditionOptions = common_vendor.ref([]);
|
|
const urineConditionOptions = common_vendor.ref([]);
|
|
const stoolConditionOptions = common_vendor.ref([]);
|
|
const kidneyConditionOptions = common_vendor.ref([]);
|
|
const fattyLiverDegreeOptions = common_vendor.ref([]);
|
|
const datePickerValue = common_vendor.ref([0, 0, 0]);
|
|
const yearRange = common_vendor.ref([]);
|
|
const monthRange = common_vendor.ref(Array.from({ length: 12 }, (_, i) => i + 1));
|
|
const dayRange = common_vendor.ref(Array.from({ length: 31 }, (_, i) => i + 1));
|
|
common_vendor.onMounted(() => {
|
|
loadDictOptions();
|
|
loadCardDetail();
|
|
initDatePicker();
|
|
});
|
|
const loadDictOptions = async () => {
|
|
try {
|
|
const dictTypes = [
|
|
"diagnosis_type",
|
|
"syndrome_type",
|
|
"diabetes_type",
|
|
"past_history",
|
|
"appetite",
|
|
"water_intake",
|
|
"diet_condition",
|
|
"weight_change",
|
|
"body_feeling",
|
|
"sleep_condition",
|
|
"eye_condition",
|
|
"head_feeling",
|
|
"sweat_condition",
|
|
"skin_condition",
|
|
"urine_condition",
|
|
"stool_condition",
|
|
"kidney_condition",
|
|
"fatty_liver_degree"
|
|
];
|
|
const results = await Promise.all(
|
|
dictTypes.map(
|
|
(type) => proxy.apiUrl({
|
|
url: "/api/tcm/getDict",
|
|
method: "GET",
|
|
data: { type }
|
|
})
|
|
)
|
|
);
|
|
results.forEach((res, index) => {
|
|
const type = dictTypes[index];
|
|
if (res.code === 1 && res.data) {
|
|
const data = res.data[type] || [];
|
|
const options = Array.isArray(data) ? data : Object.entries(data).map(([key, value]) => ({
|
|
value: key,
|
|
name: value
|
|
}));
|
|
switch (type) {
|
|
case "diagnosis_type":
|
|
diagnosisTypeOptions.value = options;
|
|
break;
|
|
case "syndrome_type":
|
|
syndromeTypeOptions.value = options;
|
|
break;
|
|
case "diabetes_type":
|
|
diabetesTypeOptions.value = options;
|
|
break;
|
|
case "past_history":
|
|
pastHistoryOptions.value = options;
|
|
break;
|
|
case "appetite":
|
|
appetiteOptions.value = options;
|
|
break;
|
|
case "water_intake":
|
|
waterIntakeOptions.value = options;
|
|
break;
|
|
case "diet_condition":
|
|
dietConditionOptions.value = options;
|
|
break;
|
|
case "weight_change":
|
|
weightChangeOptions.value = options;
|
|
break;
|
|
case "body_feeling":
|
|
bodyFeelingOptions.value = options;
|
|
break;
|
|
case "sleep_condition":
|
|
sleepConditionOptions.value = options;
|
|
break;
|
|
case "eye_condition":
|
|
eyeConditionOptions.value = options;
|
|
break;
|
|
case "head_feeling":
|
|
headFeelingOptions.value = options;
|
|
break;
|
|
case "sweat_condition":
|
|
sweatConditionOptions.value = options;
|
|
break;
|
|
case "skin_condition":
|
|
skinConditionOptions.value = options;
|
|
break;
|
|
case "urine_condition":
|
|
urineConditionOptions.value = options;
|
|
break;
|
|
case "stool_condition":
|
|
stoolConditionOptions.value = options;
|
|
break;
|
|
case "kidney_condition":
|
|
kidneyConditionOptions.value = options;
|
|
break;
|
|
case "fatty_liver_degree":
|
|
fattyLiverDegreeOptions.value = options;
|
|
break;
|
|
}
|
|
}
|
|
});
|
|
} catch (err) {
|
|
common_vendor.index.__f__("error", "at pages/Card/edit_card.vue:979", "加载字典数据失败:", err);
|
|
}
|
|
};
|
|
const initDatePicker = () => {
|
|
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
yearRange.value = Array.from({ length: 100 }, (_, i) => currentYear - 50 + i);
|
|
};
|
|
const initDatePickerValue = (dateStr) => {
|
|
if (!dateStr)
|
|
return;
|
|
try {
|
|
const parts = dateStr.split("-");
|
|
if (parts.length !== 3)
|
|
return;
|
|
const year = parseInt(parts[0]);
|
|
const month = parseInt(parts[1]);
|
|
const day = parseInt(parts[2]);
|
|
const yearIndex = yearRange.value.indexOf(year);
|
|
if (yearIndex === -1)
|
|
return;
|
|
const monthIndex = month - 1;
|
|
const dayIndex = day - 1;
|
|
datePickerValue.value = [yearIndex, monthIndex, dayIndex];
|
|
} catch (err) {
|
|
common_vendor.index.__f__("error", "at pages/Card/edit_card.vue:1014", "初始化日期选择器失败:", err);
|
|
}
|
|
};
|
|
const loadCardDetail = async () => {
|
|
var _a;
|
|
loading.value = true;
|
|
try {
|
|
const pages = getCurrentPages();
|
|
const currentPage = pages[pages.length - 1];
|
|
const options = currentPage.options || {};
|
|
diagnosisId.value = options.id;
|
|
isAddMode.value = options.add === "1" || options.add === 1;
|
|
if (options.returnUrl) {
|
|
try {
|
|
returnUrl.value = decodeURIComponent(String(options.returnUrl));
|
|
} catch (e) {
|
|
returnUrl.value = String(options.returnUrl);
|
|
}
|
|
}
|
|
const userData = common_vendor.index.getStorageSync("userData");
|
|
patientId.value = (_a = userData == null ? void 0 : userData.diagnosis) == null ? void 0 : _a.patient_id;
|
|
if (isAddMode.value) {
|
|
const token = common_vendor.index.getStorageSync("token");
|
|
if (!token) {
|
|
common_vendor.index.showToast({ title: "请先登录", icon: "none" });
|
|
setTimeout(() => common_vendor.index.redirectTo({ url: "/tongji/pages/weekly" }), 1500);
|
|
return;
|
|
}
|
|
loading.value = false;
|
|
return;
|
|
}
|
|
if (!patientId.value) {
|
|
common_vendor.index.showToast({ title: "请先登录", icon: "none" });
|
|
setTimeout(() => common_vendor.index.redirectTo({ url: "/tongji/pages/weekly" }), 1500);
|
|
return;
|
|
}
|
|
if (!diagnosisId.value) {
|
|
common_vendor.index.showToast({ title: "诊单ID不存在", icon: "none" });
|
|
setTimeout(() => common_vendor.index.navigateBack(), 1500);
|
|
return;
|
|
}
|
|
const res = await proxy.apiUrl({
|
|
url: "/api/tcm/diagnosisDetail",
|
|
method: "GET",
|
|
data: {
|
|
id: diagnosisId.value,
|
|
user_id: patientId.value
|
|
}
|
|
});
|
|
if (res.code === 1) {
|
|
const diagnosis = res.data;
|
|
const arrayFields = ["diet_condition", "body_feeling", "sleep_condition", "eye_condition", "head_feeling", "sweat_condition", "skin_condition", "urine_condition", "stool_condition", "kidney_condition", "past_history", "local_hospital_diagnosis", "report_files", "tongue_images"];
|
|
arrayFields.forEach((field) => {
|
|
if (typeof diagnosis[field] === "string" && diagnosis[field]) {
|
|
diagnosis[field] = diagnosis[field].split(",");
|
|
} else if (!diagnosis[field]) {
|
|
diagnosis[field] = [];
|
|
}
|
|
});
|
|
formData.value = diagnosis;
|
|
const ddy = diagnosis.diabetes_discovery_year;
|
|
formData.value.diabetes_discovery_year = ddy == null || ddy === "" ? "" : String(ddy);
|
|
if (!diagnosis.local_hospital_visit_date && diagnosis.diagnosis_date) {
|
|
formData.value.local_hospital_visit_date = diagnosis.diagnosis_date;
|
|
}
|
|
if (formData.value.local_hospital_visit_date) {
|
|
initDatePickerValue(formData.value.local_hospital_visit_date);
|
|
}
|
|
} else {
|
|
common_vendor.index.showToast({ title: res.msg || "获取失败", icon: "none" });
|
|
setTimeout(() => common_vendor.index.navigateBack(), 1500);
|
|
}
|
|
} catch (err) {
|
|
common_vendor.index.__f__("error", "at pages/Card/edit_card.vue:1109", "加载诊单详情失败:", err);
|
|
common_vendor.index.showToast({ title: "加载失败", icon: "none" });
|
|
setTimeout(() => common_vendor.index.navigateBack(), 1500);
|
|
} finally {
|
|
loading.value = false;
|
|
}
|
|
};
|
|
const toggleMultiCheckbox = (field, value) => {
|
|
const index = formData.value[field].indexOf(value);
|
|
if (index > -1) {
|
|
formData.value[field].splice(index, 1);
|
|
} else {
|
|
formData.value[field].push(value);
|
|
}
|
|
};
|
|
const calculateAgeFromIdCard = (idCard) => {
|
|
if (!idCard || idCard.length !== 18) {
|
|
return "";
|
|
}
|
|
const year = parseInt(idCard.substring(6, 10));
|
|
const month = parseInt(idCard.substring(10, 12));
|
|
const day = parseInt(idCard.substring(12, 14));
|
|
const today = /* @__PURE__ */ new Date();
|
|
const currentYear = today.getFullYear();
|
|
const currentMonth = today.getMonth() + 1;
|
|
const currentDay = today.getDate();
|
|
let age = currentYear - year;
|
|
if (currentMonth < month || currentMonth === month && currentDay < day) {
|
|
age--;
|
|
}
|
|
return age;
|
|
};
|
|
const handleIdCardChange = () => {
|
|
if (formData.value.id_card && formData.value.id_card.length === 18) {
|
|
const age = calculateAgeFromIdCard(formData.value.id_card);
|
|
if (age) {
|
|
formData.value.age = age;
|
|
}
|
|
}
|
|
};
|
|
const onDateChange = (e) => {
|
|
datePickerValue.value = e.detail.value;
|
|
};
|
|
const confirmDate = () => {
|
|
const year = yearRange.value[datePickerValue.value[0]];
|
|
const month = String(monthRange.value[datePickerValue.value[1]]).padStart(2, "0");
|
|
const day = String(dayRange.value[datePickerValue.value[2]]).padStart(2, "0");
|
|
formData.value.local_hospital_visit_date = `${year}-${month}-${day}`;
|
|
showDatePicker.value = false;
|
|
};
|
|
const openAgreement = (type) => {
|
|
common_vendor.index.navigateTo({
|
|
url: "/pages/Card/contact?type=" + type
|
|
});
|
|
};
|
|
const submitForm = async () => {
|
|
var _a;
|
|
if (!agreedToTerms.value) {
|
|
common_vendor.index.showToast({ title: "请先阅读并同意相关协议", icon: "none" });
|
|
return;
|
|
}
|
|
if (!formData.value.patient_name) {
|
|
common_vendor.index.showToast({ title: "患者姓名不能为空", icon: "none" });
|
|
return;
|
|
}
|
|
if (formData.value.gender === null || formData.value.gender === void 0) {
|
|
common_vendor.index.showToast({ title: "请选择性别", icon: "none" });
|
|
return;
|
|
}
|
|
if (!formData.value.weight) {
|
|
common_vendor.index.showToast({ title: "体重不能为空", icon: "none" });
|
|
return;
|
|
}
|
|
if (!formData.value.height) {
|
|
common_vendor.index.showToast({ title: "身高不能为空", icon: "none" });
|
|
return;
|
|
}
|
|
if (!formData.value.fasting_blood_sugar) {
|
|
common_vendor.index.showToast({ title: "空腹血糖不能为空", icon: "none" });
|
|
return;
|
|
}
|
|
if (!String(formData.value.diabetes_discovery_year ?? "").trim()) {
|
|
common_vendor.index.showToast({ title: "发现糖尿病患病史不能为空", icon: "none" });
|
|
return;
|
|
}
|
|
if (String(formData.value.diabetes_discovery_year).trim().length > 50) {
|
|
common_vendor.index.showToast({ title: "发现糖尿病患病史最多50个字", icon: "none" });
|
|
return;
|
|
}
|
|
if (!formData.value.local_hospital_diagnosis || formData.value.local_hospital_diagnosis.length === 0) {
|
|
common_vendor.index.showToast({ title: "当地医院诊断结果不能为空", icon: "none" });
|
|
return;
|
|
}
|
|
if (!formData.value.local_hospital_name) {
|
|
common_vendor.index.showToast({ title: "当地就诊医院名称不能为空", icon: "none" });
|
|
return;
|
|
}
|
|
if (!formData.value.local_hospital_visit_date) {
|
|
common_vendor.index.showToast({ title: "当地医院就诊时间不能为空", icon: "none" });
|
|
return;
|
|
}
|
|
submitting.value = true;
|
|
try {
|
|
const submitData = { ...formData.value };
|
|
submitData.diabetes_discovery_year = String(submitData.diabetes_discovery_year ?? "").trim();
|
|
const arrayFields = ["diet_condition", "body_feeling", "sleep_condition", "eye_condition", "head_feeling", "sweat_condition", "skin_condition", "urine_condition", "stool_condition", "kidney_condition", "past_history", "local_hospital_diagnosis", "report_files", "tongue_images"];
|
|
arrayFields.forEach((field) => {
|
|
if (Array.isArray(submitData[field])) {
|
|
submitData[field] = submitData[field].join(",");
|
|
}
|
|
});
|
|
if (submitData.local_hospital_visit_date) {
|
|
submitData.diagnosis_date = submitData.local_hospital_visit_date;
|
|
}
|
|
const apiUrl = isAddMode.value ? "/api/tcm/addCard" : "/api/tcm/updateCard";
|
|
const apiData = isAddMode.value ? { ...submitData, ...patientId.value ? { patient_id: patientId.value } : {} } : { id: diagnosisId.value, patient_id: patientId.value, ...submitData };
|
|
const res = await proxy.apiUrl({
|
|
url: apiUrl,
|
|
method: "POST",
|
|
data: apiData
|
|
});
|
|
if (res.code === 1) {
|
|
if (isAddMode.value && ((_a = res.data) == null ? void 0 : _a.patient_id)) {
|
|
const userData = common_vendor.index.getStorageSync("userData") || {};
|
|
if (!userData.diagnosis)
|
|
userData.diagnosis = {};
|
|
userData.diagnosis.patient_id = res.data.patient_id;
|
|
common_vendor.index.setStorageSync("userData", userData);
|
|
}
|
|
common_vendor.index.showToast({ title: isAddMode.value ? "创建成功" : "保存成功", icon: "success" });
|
|
setTimeout(() => {
|
|
const back = returnUrl.value;
|
|
if (back && back.startsWith("/")) {
|
|
common_vendor.index.redirectTo({ url: back });
|
|
} else {
|
|
common_vendor.index.navigateBack();
|
|
}
|
|
}, 1500);
|
|
} else {
|
|
common_vendor.index.showToast({ title: res.msg || "保存失败", icon: "none" });
|
|
}
|
|
} catch (err) {
|
|
common_vendor.index.__f__("error", "at pages/Card/edit_card.vue:1324", "保存失败:", err);
|
|
common_vendor.index.showToast({ title: "保存失败", icon: "none" });
|
|
} finally {
|
|
submitting.value = false;
|
|
}
|
|
};
|
|
const uploadTonguePhoto = () => {
|
|
var _a;
|
|
const maxCount = 9 - (((_a = formData.value.tongue_images) == null ? void 0 : _a.length) || 0);
|
|
common_vendor.index.chooseImage({
|
|
count: maxCount,
|
|
sizeType: ["compressed"],
|
|
sourceType: ["album", "camera"],
|
|
success: async (res) => {
|
|
const tempFilePaths = res.tempFilePaths;
|
|
try {
|
|
common_vendor.index.showLoading({ title: "上传中..." });
|
|
const token = common_vendor.index.getStorageSync("token");
|
|
const $url = proxy.$url;
|
|
if (!formData.value.tongue_images) {
|
|
formData.value.tongue_images = [];
|
|
}
|
|
for (let i = 0; i < tempFilePaths.length; i++) {
|
|
const uploadRes = await new Promise((resolve, reject) => {
|
|
common_vendor.index.uploadFile({
|
|
url: $url + "/api/upload/image",
|
|
filePath: tempFilePaths[i],
|
|
name: "file",
|
|
header: {
|
|
token,
|
|
"content-type": "multipart/form-data"
|
|
},
|
|
success: (res2) => {
|
|
const data = JSON.parse(res2.data);
|
|
resolve(data);
|
|
},
|
|
fail: (err) => {
|
|
reject(err);
|
|
}
|
|
});
|
|
});
|
|
if (uploadRes.code === 1) {
|
|
formData.value.tongue_images.push(uploadRes.data.uri || uploadRes.data);
|
|
common_vendor.index.__f__("log", "at pages/Card/edit_card.vue:1377", "-", formData);
|
|
}
|
|
}
|
|
common_vendor.index.hideLoading();
|
|
common_vendor.index.showToast({ title: "上传成功", icon: "success" });
|
|
} catch (err) {
|
|
common_vendor.index.hideLoading();
|
|
common_vendor.index.__f__("error", "at pages/Card/edit_card.vue:1385", "上传照片失败:", err);
|
|
common_vendor.index.showToast({ title: "上传失败", icon: "none" });
|
|
}
|
|
},
|
|
fail: (err) => {
|
|
common_vendor.index.__f__("error", "at pages/Card/edit_card.vue:1390", "选择图片失败:", err);
|
|
common_vendor.index.showToast({ title: "选择图片失败", icon: "none" });
|
|
}
|
|
});
|
|
};
|
|
const deleteTonguePhoto = (index) => {
|
|
common_vendor.index.showModal({
|
|
title: "提示",
|
|
content: "确定要删除这张舌苔照片吗?",
|
|
success: (res) => {
|
|
if (res.confirm) {
|
|
formData.value.tongue_images.splice(index, 1);
|
|
common_vendor.index.showToast({ title: "已删除", icon: "success" });
|
|
}
|
|
}
|
|
});
|
|
};
|
|
const uploadExaminationReport = () => {
|
|
var _a;
|
|
const maxCount = 9 - (((_a = formData.value.report_files) == null ? void 0 : _a.length) || 0);
|
|
common_vendor.index.chooseImage({
|
|
count: maxCount,
|
|
sizeType: ["compressed"],
|
|
sourceType: ["album", "camera"],
|
|
success: async (res) => {
|
|
const tempFilePaths = res.tempFilePaths;
|
|
try {
|
|
common_vendor.index.showLoading({ title: "上传中..." });
|
|
const token = common_vendor.index.getStorageSync("token");
|
|
const $url = proxy.$url;
|
|
if (!formData.value.report_files) {
|
|
formData.value.report_files = [];
|
|
}
|
|
for (let i = 0; i < tempFilePaths.length; i++) {
|
|
const uploadRes = await new Promise((resolve, reject) => {
|
|
common_vendor.index.uploadFile({
|
|
url: $url + "/api/upload/image",
|
|
filePath: tempFilePaths[i],
|
|
name: "file",
|
|
header: {
|
|
token,
|
|
"content-type": "multipart/form-data"
|
|
},
|
|
success: (res2) => {
|
|
const data = JSON.parse(res2.data);
|
|
resolve(data);
|
|
},
|
|
fail: (err) => {
|
|
reject(err);
|
|
}
|
|
});
|
|
});
|
|
if (uploadRes.code === 1) {
|
|
formData.value.report_files.push(uploadRes.data.uri || uploadRes.data);
|
|
}
|
|
}
|
|
common_vendor.index.hideLoading();
|
|
common_vendor.index.showToast({ title: "上传成功", icon: "success" });
|
|
} catch (err) {
|
|
common_vendor.index.hideLoading();
|
|
common_vendor.index.__f__("error", "at pages/Card/edit_card.vue:1471", "上传检查报告失败:", err);
|
|
common_vendor.index.showToast({ title: "上传失败", icon: "none" });
|
|
}
|
|
},
|
|
fail: (err) => {
|
|
common_vendor.index.__f__("error", "at pages/Card/edit_card.vue:1476", "选择图片失败:", err);
|
|
common_vendor.index.showToast({ title: "选择图片失败", icon: "none" });
|
|
}
|
|
});
|
|
};
|
|
const deleteExaminationReport = (index) => {
|
|
common_vendor.index.showModal({
|
|
title: "提示",
|
|
content: "确定要删除这张图片吗?",
|
|
success: (res) => {
|
|
if (res.confirm) {
|
|
formData.value.report_files.splice(index, 1);
|
|
common_vendor.index.showToast({ title: "已删除", icon: "success" });
|
|
}
|
|
}
|
|
});
|
|
};
|
|
const previewImages = (urls, current) => {
|
|
common_vendor.index.previewImage({
|
|
urls,
|
|
current
|
|
});
|
|
};
|
|
return (_ctx, _cache) => {
|
|
return common_vendor.e({
|
|
a: loading.value
|
|
}, loading.value ? {} : common_vendor.e({
|
|
b: formData.value.patient_name,
|
|
c: common_vendor.o(($event) => formData.value.patient_name = $event.detail.value, "d0"),
|
|
d: common_vendor.t(formData.value.gender === 1 ? "✓" : ""),
|
|
e: formData.value.gender === 1 ? 1 : "",
|
|
f: common_vendor.o(($event) => formData.value.gender = 1, "38"),
|
|
g: common_vendor.t(formData.value.gender === 0 ? "✓" : ""),
|
|
h: formData.value.gender === 0 ? 1 : "",
|
|
i: common_vendor.o(($event) => formData.value.gender = 0, "0f"),
|
|
j: common_vendor.o(handleIdCardChange, "47"),
|
|
k: formData.value.id_card,
|
|
l: common_vendor.o(($event) => formData.value.id_card = $event.detail.value, "f0"),
|
|
m: formData.value.age,
|
|
n: common_vendor.o(($event) => formData.value.age = $event.detail.value, "ef"),
|
|
o: formData.value.weight,
|
|
p: common_vendor.o(common_vendor.m(($event) => formData.value.weight = $event.detail.value, {
|
|
number: true
|
|
}), "f1"),
|
|
q: formData.value.height,
|
|
r: common_vendor.o(common_vendor.m(($event) => formData.value.height = $event.detail.value, {
|
|
number: true
|
|
}), "7f"),
|
|
s: formData.value.systolic_pressure,
|
|
t: common_vendor.o(common_vendor.m(($event) => formData.value.systolic_pressure = $event.detail.value, {
|
|
number: true
|
|
}), "52"),
|
|
v: formData.value.diastolic_pressure,
|
|
w: common_vendor.o(common_vendor.m(($event) => formData.value.diastolic_pressure = $event.detail.value, {
|
|
number: true
|
|
}), "7e"),
|
|
x: formData.value.fasting_blood_sugar,
|
|
y: common_vendor.o(common_vendor.m(($event) => formData.value.fasting_blood_sugar = $event.detail.value, {
|
|
number: true
|
|
}), "75"),
|
|
z: formData.value.diabetes_discovery_year,
|
|
A: common_vendor.o(($event) => formData.value.diabetes_discovery_year = $event.detail.value, "f7"),
|
|
B: formData.value.local_hospital_diagnosis.includes("糖尿病") ? 1 : "",
|
|
C: common_vendor.o(($event) => toggleMultiCheckbox("local_hospital_diagnosis", "糖尿病"), "e0"),
|
|
D: formData.value.local_hospital_diagnosis.includes("消渴病") ? 1 : "",
|
|
E: common_vendor.o(($event) => toggleMultiCheckbox("local_hospital_diagnosis", "消渴病"), "79"),
|
|
F: formData.value.local_hospital_diagnosis.includes("糖尿病前期") ? 1 : "",
|
|
G: common_vendor.o(($event) => toggleMultiCheckbox("local_hospital_diagnosis", "糖尿病前期"), "f6"),
|
|
H: formData.value.local_hospital_name,
|
|
I: common_vendor.o(($event) => formData.value.local_hospital_name = $event.detail.value, "20"),
|
|
J: common_vendor.t(formData.value.local_hospital_visit_date || "请选择确诊时间"),
|
|
K: common_vendor.o(($event) => showDatePicker.value = true, "1b"),
|
|
L: common_vendor.f(appetiteOptions.value, (item, k0, i0) => {
|
|
return {
|
|
a: common_vendor.t(item.name),
|
|
b: item.value,
|
|
c: formData.value.appetite === item.value ? 1 : "",
|
|
d: common_vendor.o(($event) => formData.value.appetite = item.value, item.value)
|
|
};
|
|
}),
|
|
M: common_vendor.f(dietConditionOptions.value, (item, k0, i0) => {
|
|
return {
|
|
a: common_vendor.t(item.name),
|
|
b: item.value,
|
|
c: formData.value.diet_condition.includes(item.value) ? 1 : "",
|
|
d: common_vendor.o(($event) => toggleMultiCheckbox("diet_condition", item.value), item.value)
|
|
};
|
|
}),
|
|
N: common_vendor.f(waterIntakeOptions.value, (item, k0, i0) => {
|
|
return {
|
|
a: common_vendor.t(item.name),
|
|
b: item.value,
|
|
c: formData.value.water_intake === item.value ? 1 : "",
|
|
d: common_vendor.o(($event) => formData.value.water_intake = item.value, item.value)
|
|
};
|
|
}),
|
|
O: common_vendor.f(weightChangeOptions.value, (item, k0, i0) => {
|
|
return {
|
|
a: common_vendor.t(item.name),
|
|
b: item.value,
|
|
c: formData.value.weight_change === item.value ? 1 : "",
|
|
d: common_vendor.o(($event) => formData.value.weight_change = item.value, item.value)
|
|
};
|
|
}),
|
|
P: common_vendor.f(fattyLiverDegreeOptions.value, (item, k0, i0) => {
|
|
return {
|
|
a: common_vendor.t(item.name),
|
|
b: item.value,
|
|
c: formData.value.fatty_liver_degree === item.value ? 1 : "",
|
|
d: common_vendor.o(($event) => formData.value.fatty_liver_degree = item.value, item.value)
|
|
};
|
|
}),
|
|
Q: common_vendor.f(bodyFeelingOptions.value, (item, k0, i0) => {
|
|
return {
|
|
a: common_vendor.t(item.name),
|
|
b: item.value,
|
|
c: formData.value.body_feeling.includes(item.value) ? 1 : "",
|
|
d: common_vendor.o(($event) => toggleMultiCheckbox("body_feeling", item.value), item.value)
|
|
};
|
|
}),
|
|
R: common_vendor.f(sleepConditionOptions.value, (item, k0, i0) => {
|
|
return {
|
|
a: common_vendor.t(item.name),
|
|
b: item.value,
|
|
c: formData.value.sleep_condition.includes(item.value) ? 1 : "",
|
|
d: common_vendor.o(($event) => toggleMultiCheckbox("sleep_condition", item.value), item.value)
|
|
};
|
|
}),
|
|
S: common_vendor.f(eyeConditionOptions.value, (item, k0, i0) => {
|
|
return {
|
|
a: common_vendor.t(item.name),
|
|
b: item.value,
|
|
c: formData.value.eye_condition.includes(item.value) ? 1 : "",
|
|
d: common_vendor.o(($event) => toggleMultiCheckbox("eye_condition", item.value), item.value)
|
|
};
|
|
}),
|
|
T: common_vendor.f(headFeelingOptions.value, (item, k0, i0) => {
|
|
return {
|
|
a: common_vendor.t(item.name),
|
|
b: item.value,
|
|
c: formData.value.head_feeling.includes(item.value) ? 1 : "",
|
|
d: common_vendor.o(($event) => toggleMultiCheckbox("head_feeling", item.value), item.value)
|
|
};
|
|
}),
|
|
U: common_vendor.f(sweatConditionOptions.value, (item, k0, i0) => {
|
|
return {
|
|
a: common_vendor.t(item.name),
|
|
b: item.value,
|
|
c: formData.value.sweat_condition.includes(item.value) ? 1 : "",
|
|
d: common_vendor.o(($event) => toggleMultiCheckbox("sweat_condition", item.value), item.value)
|
|
};
|
|
}),
|
|
V: common_vendor.f(skinConditionOptions.value, (item, k0, i0) => {
|
|
return {
|
|
a: common_vendor.t(item.name),
|
|
b: item.value,
|
|
c: formData.value.skin_condition.includes(item.value) ? 1 : "",
|
|
d: common_vendor.o(($event) => toggleMultiCheckbox("skin_condition", item.value), item.value)
|
|
};
|
|
}),
|
|
W: common_vendor.f(urineConditionOptions.value, (item, k0, i0) => {
|
|
return {
|
|
a: common_vendor.t(item.name),
|
|
b: item.value,
|
|
c: formData.value.urine_condition.includes(item.value) ? 1 : "",
|
|
d: common_vendor.o(($event) => toggleMultiCheckbox("urine_condition", item.value), item.value)
|
|
};
|
|
}),
|
|
X: common_vendor.f(stoolConditionOptions.value, (item, k0, i0) => {
|
|
return {
|
|
a: common_vendor.t(item.name),
|
|
b: item.value,
|
|
c: formData.value.stool_condition.includes(item.value) ? 1 : "",
|
|
d: common_vendor.o(($event) => toggleMultiCheckbox("stool_condition", item.value), item.value)
|
|
};
|
|
}),
|
|
Y: common_vendor.f(kidneyConditionOptions.value, (item, k0, i0) => {
|
|
return {
|
|
a: common_vendor.t(item.name),
|
|
b: item.value,
|
|
c: formData.value.kidney_condition.includes(item.value) ? 1 : "",
|
|
d: common_vendor.o(($event) => toggleMultiCheckbox("kidney_condition", item.value), item.value)
|
|
};
|
|
}),
|
|
Z: common_vendor.f(pastHistoryOptions.value, (item, k0, i0) => {
|
|
return {
|
|
a: common_vendor.t(item.name),
|
|
b: item.value,
|
|
c: formData.value.past_history.includes(item.value) ? 1 : "",
|
|
d: common_vendor.o(($event) => toggleMultiCheckbox("past_history", item.value), item.value)
|
|
};
|
|
}),
|
|
aa: formData.value.trauma_history === 1 ? 1 : "",
|
|
ab: common_vendor.o(($event) => formData.value.trauma_history = 1, "5e"),
|
|
ac: formData.value.trauma_history === 0 ? 1 : "",
|
|
ad: common_vendor.o(($event) => formData.value.trauma_history = 0, "db"),
|
|
ae: formData.value.surgery_history === 1 ? 1 : "",
|
|
af: common_vendor.o(($event) => formData.value.surgery_history = 1, "f6"),
|
|
ag: formData.value.surgery_history === 0 ? 1 : "",
|
|
ah: common_vendor.o(($event) => formData.value.surgery_history = 0, "69"),
|
|
ai: formData.value.allergy_history === 1 ? 1 : "",
|
|
aj: common_vendor.o(($event) => formData.value.allergy_history = 1, "b7"),
|
|
ak: formData.value.allergy_history === 0 ? 1 : "",
|
|
al: common_vendor.o(($event) => formData.value.allergy_history = 0, "f0"),
|
|
am: formData.value.family_history === 1 ? 1 : "",
|
|
an: common_vendor.o(($event) => formData.value.family_history = 1, "e3"),
|
|
ao: formData.value.family_history === 0 ? 1 : "",
|
|
ap: common_vendor.o(($event) => formData.value.family_history = 0, "18"),
|
|
aq: formData.value.pregnancy_history === 1 ? 1 : "",
|
|
ar: common_vendor.o(($event) => formData.value.pregnancy_history = 1, "71"),
|
|
as: formData.value.pregnancy_history === 0 ? 1 : "",
|
|
at: common_vendor.o(($event) => formData.value.pregnancy_history = 0, "a3"),
|
|
av: formData.value.tongue_images && formData.value.tongue_images.length > 0
|
|
}, formData.value.tongue_images && formData.value.tongue_images.length > 0 ? {
|
|
aw: common_vendor.f(formData.value.tongue_images, (img, index, i0) => {
|
|
return {
|
|
a: img,
|
|
b: common_vendor.o(($event) => previewImages(formData.value.tongue_images, index), index),
|
|
c: common_vendor.o(($event) => deleteTonguePhoto(index), index),
|
|
d: index
|
|
};
|
|
})
|
|
} : {}, {
|
|
ax: formData.value.tongue_images.length < 9
|
|
}, formData.value.tongue_images.length < 9 ? {
|
|
ay: common_vendor.p({
|
|
type: "camera",
|
|
size: "30"
|
|
}),
|
|
az: common_vendor.o(uploadTonguePhoto, "ec")
|
|
} : {}, {
|
|
aA: formData.value.report_files && formData.value.report_files.length > 0
|
|
}, formData.value.report_files && formData.value.report_files.length > 0 ? {
|
|
aB: common_vendor.f(formData.value.report_files, (img, index, i0) => {
|
|
return {
|
|
a: img,
|
|
b: common_vendor.o(($event) => previewImages(formData.value.report_files, index), index),
|
|
c: common_vendor.o(($event) => deleteExaminationReport(index), index),
|
|
d: index
|
|
};
|
|
})
|
|
} : {}, {
|
|
aC: formData.value.report_files.length < 9
|
|
}, formData.value.report_files.length < 9 ? {
|
|
aD: common_vendor.p({
|
|
type: "camera",
|
|
size: "30"
|
|
}),
|
|
aE: common_vendor.o(uploadExaminationReport, "6a")
|
|
} : {}, {
|
|
aF: formData.value.remark,
|
|
aG: common_vendor.o(($event) => formData.value.remark = $event.detail.value, "c8"),
|
|
aH: agreedToTerms.value
|
|
}, agreedToTerms.value ? {} : {}, {
|
|
aI: agreedToTerms.value ? 1 : "",
|
|
aJ: !agreedToTerms.value
|
|
}, !agreedToTerms.value ? {} : {}, {
|
|
aK: !agreedToTerms.value ? 1 : "",
|
|
aL: common_vendor.o(($event) => agreedToTerms.value = false, "2e"),
|
|
aM: common_vendor.o(($event) => openAgreement("service"), "98"),
|
|
aN: common_vendor.o(($event) => openAgreement("privacy"), "cc"),
|
|
aO: common_vendor.o(($event) => agreedToTerms.value = true, "db"),
|
|
aP: common_vendor.t(submitting.value ? "保存中..." : "我已确认无误,提交给医生"),
|
|
aQ: common_vendor.o(submitForm, "17"),
|
|
aR: submitting.value || !agreedToTerms.value
|
|
}), {
|
|
aS: showDatePicker.value
|
|
}, showDatePicker.value ? {
|
|
aT: common_vendor.o(($event) => showDatePicker.value = false, "4e"),
|
|
aU: common_vendor.o(confirmDate, "61"),
|
|
aV: common_vendor.f(yearRange.value, (year, k0, i0) => {
|
|
return {
|
|
a: common_vendor.t(year),
|
|
b: year
|
|
};
|
|
}),
|
|
aW: common_vendor.f(monthRange.value, (month, k0, i0) => {
|
|
return {
|
|
a: common_vendor.t(String(month).padStart(2, "0")),
|
|
b: month
|
|
};
|
|
}),
|
|
aX: common_vendor.f(dayRange.value, (day, k0, i0) => {
|
|
return {
|
|
a: common_vendor.t(String(day).padStart(2, "0")),
|
|
b: day
|
|
};
|
|
}),
|
|
aY: datePickerValue.value,
|
|
aZ: common_vendor.o(onDateChange, "78")
|
|
} : {});
|
|
};
|
|
}
|
|
};
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-47b8e7b0"]]);
|
|
wx.createPage(MiniProgramPage);
|
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/Card/edit_card.js.map
|