WXL
2026-03-19 5aa165156994b1b8a601063fa0a1107d1893ea57
src/views/business/OrganUtilization/index.vue
@@ -8,34 +8,35 @@
        :inline="true"
        label-width="100px"
      >
        <el-form-item label="住院号" prop="hospitalNo">
        <el-form-item label="住院号" prop="inpatientno">
          <el-input
            v-model="queryParams.hospitalNo"
            v-model="queryParams.inpatientno"
            placeholder="请输入住院号"
            clearable
            style="width: 200px"
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="捐献者姓名" prop="donorName">
        <el-form-item label="捐献者姓名" prop="name">
          <el-input
            v-model="queryParams.donorName"
            v-model="queryParams.name"
            placeholder="请输入捐献者姓名"
            clearable
            style="width: 200px"
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="利用状态" prop="utilizationStatus">
        <el-form-item label="记录状态" prop="recordstate">
          <el-select
            v-model="queryParams.utilizationStatus"
            placeholder="请选择利用状态"
            v-model="queryParams.recordstate"
            placeholder="请选择记录状态"
            clearable
            style="width: 200px"
          >
            <el-option label="已完成" value="completed" />
            <el-option label="进行中" value="in_progress" />
            <el-option label="进行中" value="processing" />
            <el-option label="待处理" value="pending" />
            <el-option label="已关闭" value="closed" />
          </el-select>
        </el-form-item>
        <el-form-item>
@@ -88,61 +89,81 @@
        <el-table-column
          label="住院号"
          align="center"
          prop="hospitalNo"
          prop="inpatientno"
          width="120"
        />
        <el-table-column
          label="案例编号"
          align="center"
          prop="caseNo"
          width="120"
        />
        <el-table-column
          label="捐献者姓名"
          align="center"
          prop="donorName"
          prop="name"
          width="120"
        />
        <el-table-column label="性别" align="center" prop="gender" width="80">
        <el-table-column label="性别" align="center" prop="sex" width="80">
          <template slot-scope="scope">
            <dict-tag
              :options="dict.type.sys_user_sex"
              :value="parseInt(scope.row.gender)"
              :value="scope.row.sex"
            />
          </template>
        </el-table-column>
        <el-table-column label="年龄" align="center" prop="age" width="80" />
        <el-table-column label="血型" align="center" prop="bloodtype" width="80">
          <template slot-scope="scope">
            <dict-tag
              v-if="scope.row.bloodtype"
              :options="dict.type.sys_BloodType"
              :value="scope.row.bloodtype"
            />
            <span v-else>-</span>
          </template>
        </el-table-column>
        <el-table-column
          label="疾病诊断"
          align="center"
          prop="diagnosis"
          prop="diagnosisname"
          min-width="180"
          show-overflow-tooltip
        />
        <el-table-column
          label="利用状态"
          label="完成时间"
          align="center"
          prop="utilizationStatus"
          width="100"
        >
          <template slot-scope="scope">
            <el-tag :type="getStatusTagType(scope.row.utilizationStatus)">
              {{ getStatusText(scope.row.utilizationStatus) }}
            </el-tag>
          </template>
        </el-table-column>
        <el-table-column
          label="登记人"
          align="center"
          prop="registrant"
          width="100"
        />
        <el-table-column
          label="登记时间"
          align="center"
          prop="registrationTime"
          prop="completetime"
          width="160"
        >
          <template slot-scope="scope">
            <span>{{
              scope.row.registrationTime
                ? parseTime(scope.row.registrationTime, "{y}-{m}-{d} {h}:{i}")
              scope.row.completetime
                ? parseTime(scope.row.completetime, "{y}-{m}-{d} {h}:{i}")
                : "-"
            }}</span>
          </template>
        </el-table-column>
        <el-table-column
          label="负责人"
          align="center"
          prop="responsibleusername"
          width="100"
        >
          <template slot-scope="scope">
            <span>{{ scope.row.responsibleusername || "-" }}</span>
          </template>
        </el-table-column>
        <el-table-column
          label="记录状态"
          align="center"
          prop="recordstate"
          width="100"
        >
          <template slot-scope="scope">
            <el-tag :type="getStatusTagType(scope.row.recordstate)">
              {{ getStatusText(scope.row.recordstate) }}
            </el-tag>
          </template>
        </el-table-column>
        <el-table-column
@@ -192,13 +213,13 @@
</template>
<script>
import { listOrganUtilization, delOrganUtilization } from "./organUtilization";
import { completionList, completionadd, completionedit } from "@/api/businessApi";
import Pagination from "@/components/Pagination";
export default {
  name: "OrganUtilizationList",
  components: { Pagination },
  dicts: ["sys_user_sex"],
  dicts: ["sys_user_sex", "sys_BloodType"],
  data() {
    return {
      // 遮罩层
@@ -217,9 +238,11 @@
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        hospitalNo: undefined,
        donorName: undefined,
        utilizationStatus: undefined
        inpatientno: undefined,
        name: undefined,
        recordstate: undefined,
        caseNo: undefined,
        donorno: undefined
      }
    };
  },
@@ -228,30 +251,44 @@
  },
  methods: {
    // 查询器官利用列表
    getList() {
    async getList() {
      this.loading = true;
      listOrganUtilization(this.queryParams)
        .then(response => {
          if (response.code === 200) {
            this.organUtilizationList = response.data.rows;
            this.total = response.data.total;
      try {
        const response = await completionList(this.queryParams);
        if (response.code === 200) {
          // 处理不同格式的响应数据
          let data = response.data;
          if (Array.isArray(data)) {
            this.organUtilizationList = data;
            this.total = data.length;
          } else if (data && data.rows) {
            this.organUtilizationList = data.rows;
            this.total = data.total || data.rows.length;
          } else if (data && data.list) {
            this.organUtilizationList = data.list;
            this.total = data.total || data.list.length;
          } else {
            this.$message.error("获取数据失败");
            this.organUtilizationList = [];
            this.total = 0;
          }
          this.loading = false;
        })
        .catch(error => {
          console.error("获取器官利用列表失败:", error);
          this.loading = false;
          this.$message.error("获取数据失败");
        });
        } else {
          this.$message.error("获取数据失败:" + (response.msg || "未知错误"));
        }
      } catch (error) {
        console.error("获取器官利用列表失败:", error);
        this.$message.error("获取数据失败");
      } finally {
        this.loading = false;
      }
    },
    // 获取状态标签类型
    getStatusTagType(status) {
      const typeMap = {
        completed: "success",
        in_progress: "warning",
        pending: "info"
        processing: "warning",
        pending: "info",
        closed: "danger"
      };
      return typeMap[status] || "info";
    },
@@ -259,8 +296,9 @@
    getStatusText(status) {
      const textMap = {
        completed: "已完成",
        in_progress: "进行中",
        pending: "待处理"
        processing: "进行中",
        pending: "待处理",
        closed: "已关闭"
      };
      return textMap[status] || "未知";
    },
@@ -284,7 +322,10 @@
    handleView(row) {
      this.$router.push({
        path: "/case/organUtilizationInfo",
        query: { id: row.id }
        query: {
          id: row.id,
          infoid: row.infoid
        }
      });
    },
    // 新增按钮操作
@@ -294,9 +335,13 @@
    // 修改按钮操作
    handleUpdate(row) {
      const id = row.id || this.ids[0];
      const infoid = row.infoid;
      this.$router.push({
        path: "/case/organUtilizationInfo",
        query: { id: id }
        query: {
          id: id,
          infoid: infoid
        }
      });
    },
    // 删除按钮操作
@@ -307,14 +352,17 @@
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(() => {
          return delOrganUtilization(ids);
        })
        .then(response => {
          if (response.code === 200) {
            this.$message.success("删除成功");
            this.getList();
          }
        .then(async () => {
          // TODO: 这里需要调用删除接口,但目前API中没有提供删除接口
          // 如果需要删除功能,需要先确认后端是否有对应的删除接口
          this.$message.warning("删除功能暂未实现,请确认后端接口");
          // 临时模拟删除成功
          // const response = await completiondelete(ids);
          // if (response.code === 200) {
          //   this.$message.success("删除成功");
          //   this.getList();
          // }
        })
        .catch(() => {});
    },