WXL
3 天以前 dc082351978a1e9f75d7a1471a0ca7ebeac552a5
src/views/project/donatebaseinfo/index.vue
@@ -101,6 +101,12 @@
        </template>
      </el-table-column>
      <el-table-column
        label="住院号"
        align="center"
        prop="inpatientno"
        width="200"
      />
      <el-table-column
        label="捐献进度"
        align="center"
        prop="workflow"
@@ -129,12 +135,7 @@
          />
        </template>
      </el-table-column>
      <el-table-column
        label="案例编号"
        align="center"
        prop="caseNo"
        width="200"
      />
      <el-table-column label="性别" align="center" prop="sex" width="100">
        <template slot-scope="scope">
          <dict-tag
@@ -158,16 +159,12 @@
          }}
        </template>
      </el-table-column>
<<<<<<< HEAD
      <el-table-column label="GCS评分" align="center" prop="gcsScore" width="100"/>
=======
      <el-table-column
        label="上报医院"
        label="GCS评分"
        align="center"
        prop="treatmenthospitalname"
        prop="gcsScore"
        width="100"
      />
      <el-table-column label="GCS评分" align="center" prop="gcsScore" />
>>>>>>> 059398ad3ad81ea49dfb75ac09f268bc0b0f6145
      <el-table-column label="血型" align="center" prop="bloodtype" width="100">
        <template slot-scope="scope">
          <dict-tag
@@ -176,20 +173,24 @@
          />
        </template>
      </el-table-column>
      <el-table-column label="传染病" align="center" prop="infectious">
        <template slot-scope="scope">
          <span v-for="item in scope.row.infectious.split(',')"
            ><dict-tag :options="dict.type.sys_Infectious" :value="item" />
          </span>
        </template>
      </el-table-column>
      <el-table-column label="疾病诊断" align="center" prop="diagnosisname" />
      <el-table-column
        label="报告医院"
        label="协调员"
        align="center"
        prop="treatmenthospitalname"
      />
      <el-table-column
        label="报告人"
        align="center"
        prop="reportername"
        prop="coordinatorName"
        width="100"
      />
      <el-table-column
        label="操作"
        width="190"
        width="220"
        align="center"
        class-name="small-padding fixed-width"
        fixed="right"
@@ -204,14 +205,29 @@
          >
            详情
          </el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleOpenEdit(scope.row)"
            v-hasPermi="['project:donatebaseinfo:edit']"
            >编辑</el-button
            v-if="scope.row.recordstate !== '4'"
          >
            编辑
          </el-button>
          <!-- ✅ 新增:归档按钮 -->
          <el-button
            size="mini"
            type="text"
            style="color:#E6A23C;"
            @click="handleArchive(scope.row)"
            v-if="scope.row.recordstate !== '4'"
          >
            归档
          </el-button>
          <el-button
            size="mini"
            type="text"
@@ -223,6 +239,7 @@
          >
            终止
          </el-button>
          <el-button
            size="mini"
            type="text"
@@ -270,7 +287,8 @@
import {
  listDonatebaseinfo,
  addDonatebaseinfo,
  exportDonatebaseinfo
  exportDonatebaseinfo,
  updateDonatebaseinfo
} from "@/api/project/donatebaseinfo";
import Li_area_select from "@/components/Address";
import OrgSelecter from "@/views/project/components/orgselect";
@@ -287,6 +305,7 @@
  dicts: [
    "sys_user_sex",
    "sys_BloodType",
    "sys_Infectious",
    "sys_DonationCategory",
    "sys_donornode"
  ],
@@ -455,7 +474,52 @@
      this.currentRecord = { ...row };
      this.modalVisible = { ...this.modalVisible, restore: true };
    },
    /** 归档 */
    handleArchive(row) {
      this.$confirm("确认将该案例归档?归档后将不可编辑。", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(async () => {
          try {
            const res = await updateDonatebaseinfo({
              id: row.id,
              recordstate: "4",
              filingtime: this.getCurrentTime()
            });
            if (res.code === 200) {
              this.$modal.msgSuccess("归档成功");
              this.getList();
            } else {
              this.$modal.msgError(res.msg || "归档失败");
            }
          } catch (err) {
            this.$modal.msgError("操作失败");
          }
        })
        .catch(() => {});
    },
    // 获取当前时间
    getCurrentTime() {
      const now = new Date();
      return `${now.getFullYear()}-${(now.getMonth() + 1)
        .toString()
        .padStart(2, "0")}-${now
        .getDate()
        .toString()
        .padStart(2, "0")} ${now
        .getHours()
        .toString()
        .padStart(2, "0")}:${now
        .getMinutes()
        .toString()
        .padStart(2, "0")}:${now
        .getSeconds()
        .toString()
        .padStart(2, "0")}`;
    },
    getTimeList() {
      if (!this.selecttime) {
        // this.queryParams.starttime = "1998-01-01 00:00:00";
@@ -541,12 +605,13 @@
        this.loading = false;
      }
    },
    /** 打开编辑弹窗 */
    handleOpenEdit(row) {
      // 确保在打开弹框前重置currentEditData
      this.currentEditData = {};
      if (row.recordstate === "4") {
        this.$modal.msgWarning("归档案例不可编辑");
        return;
      }
      // 使用$nextTick确保DOM更新完成
      this.currentEditData = {};
      this.$nextTick(() => {
        this.currentEditData = { ...row };
        this.editModalVisible = true;