maven
2025-10-11 0ad2c4106d6f570e0ca63c8fe5093e6f97492534
src/views/equipment/management/index.vue
@@ -142,7 +142,8 @@
        :title="dialogTableTitle"
        :table-data="dialogTableData"
        :columns="dialogTableColumns"
        width="60%"
        width="70%"
        height="500px"
      />
    </el-card>
  </div>
@@ -196,7 +197,7 @@
};
// 响应式状态管理 - 使用解构和默认值
const initFormState = () => ({ consumables: false });
const initFormState = () => ({ isConsumables: false });
const state = reactive({
  form: initFormState(),
@@ -253,8 +254,8 @@
    columns: [
      { prop: "equipmentNo", label: "设备编号", minWidth: 100 },
      { prop: "equipmentName", label: "设备名称", minWidth: 100 },
      { prop: "consumables", label: "耗材",
        formatter: (row) => (row.consumables ? "是" : "否"), minWidth: 100 },
      { prop: "isConsumables", label: "耗材",
        formatter: (row) => (row.isConsumables ? "是" : "否"), minWidth: 100 },
      { prop: "quantity", label: "总数量", minWidth: 100 },
      { prop: "usedNo", label: "已使用数量", minWidth: 100 },
      { prop: "specification", label: "规格型号", minWidth: 100 },
@@ -386,7 +387,7 @@
const resetState = () => {
  form.value = {
    consumables: false,
    isConsumables: false,
  };
  addOrEdit.value = "add";
  loading.value = true;
@@ -411,7 +412,7 @@
const handleAdd = () => {
  addOrEdit.value = "add";
  form.value = {
    consumables: false,
    isConsumables: false,
  };
  title.value = `新增${currentTabConfig.value.label}`;
  // 通用的
@@ -461,13 +462,10 @@
      
      // 调用详情接口获取数据
      const { data, code } = await getUsageDetailList(row.id);
      if (code === 200 && data) {
        console.log('设备操作记录:', data);
        // 处理数组数据,直接显示操作记录列表
        if (Array.isArray(data.records)) {
          dialogTableData.value = data.records;
        if (Array.isArray(data)) {
          dialogTableData.value = data;
          dialogTableColumns.value = [
            { prop: 'equipmentNo', label: '设备编号', minWidth: 100 },
            { prop: 'equipmentName', label: '设备名称', minWidth: 120 },
@@ -485,7 +483,6 @@
          ];
        } else {
          ElMessage.warning('暂无操作记录');
          dialogTableVisible.value = false;
        }
      } else {
        ElMessage.error('获取详情数据失败');
@@ -550,7 +547,6 @@
  if (formData.equipmentStatus === EQUIPMENT_STATUS.RETURNED) {
    ElMessage.success("设备已完全归还");
  } else if (formData.equipmentStatus === EQUIPMENT_STATUS.PARTIAL_RETURN) {
    ElMessage.success("设备部分归还成功");
  } else if (formData.equipmentStatus === EQUIPMENT_STATUS.USING) {
    ElMessage.success("设备领用成功");
  } else {