WXL
2 天以前 2cc85c64f1c64a2dbaeae276a3e2ca8420de76b7
pages/case/CaseDetails.vue
@@ -822,16 +822,19 @@
// 处理基础附件上传
const handleBaseUpload = (file) => {
  console.log("基础附件上传成功:", file);
  attachments.value.push(file);
};
// 处理其他附件上传
const handleFilesUpdate = (files) => {
  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,
  }));
};
@@ -963,16 +966,14 @@
  }
  try {
    console.log(attachments.value);
    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,
@@ -1032,47 +1033,26 @@
};
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(
      `/project/donatebaseinforeport/getInfo/${id}`,
    );
    if (res) {
      console.log(res, "res");
      form.value = res;
      console.log(1, "res");
    if (res.code) {
      form.value = res.data;
      // 处理选择器索引
      // updatePickerIndexes();
      console.log(2, "res");
      // 处理附件
      if (res.annexfilesList) {
        attachments.value = res.annexfilesList;
      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");
@@ -1253,6 +1233,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 {
@@ -1476,12 +1466,6 @@
  border-radius: 12rpx !important;
  padding: 20rpx 24rpx !important;
  background: #fff !important;
}
.action-buttons {
  display: flex;
  gap: 20rpx;
  margin-top: 40rpx;
}
.btn {