hsy
15 小时以前 2d3530a7c11557a40807ad7c0b9e302ce6ce3a9f
src/views/equipmentManagement/upkeep/index.vue
@@ -241,6 +241,7 @@
    deviceMaintenanceTaskList,
    deviceMaintenanceTaskDel,
  } from "@/api/equipmentManagement/upkeep";
  import { userListNoPageByTenantId } from "@/api/system/user.js";
  import dayjs from "dayjs";
  const { proxy } = getCurrentInstance();
@@ -261,6 +262,13 @@
  const fileListDialogRef = ref(null);
  const fileDialogVisible = ref(false);
  const currentMaintenanceTaskId = ref(null);
  const userList = ref([]);
  const getUserName = (userId) => {
    if (!userId) return "--";
    const user = userList.value.find(u => String(u.userId) === String(userId));
    return user ? user.nickName : userId;
  };
  // 保养记录tab(原设备保养页面)相关变量
  const filters = reactive({
@@ -304,6 +312,18 @@
      prop: "machineryCategory",
      minWidth: 120,
      formatData: cell => cell || "--",
    },
    {
      label: "保养类型",
      prop: "maintenanceType",
      minWidth: 100,
      formatData: cell => (cell === "1" ? "日常使用" : cell === "2" ? "定期保养" : "--")
    },
    {
      prop: "executorId",
      label: "执行人",
      minWidth: 100,
      formatData: cell => getUserName(cell)
    },
    {
      prop: "frequencyType",
@@ -391,6 +411,18 @@
      align: "center",
      prop: "machineryCategory",
      formatData: cell => cell || "--",
    },
    {
      label: "保养类型",
      align: "center",
      prop: "maintenanceType",
      formatData: cell => (cell === "1" ? "日常使用" : cell === "2" ? "定期保养" : "--")
    },
    {
      label: "执行人",
      align: "center",
      prop: "executorId",
      formatData: cell => getUserName(cell)
    },
    // {
    //   label: "录入日期",
@@ -628,7 +660,9 @@
    fileDialogVisible.value = true;
  };
  onMounted(() => {
  onMounted(async () => {
    const { data } = await userListNoPageByTenantId();
    userList.value = data || [];
    // 根据默认激活的 Tab 调用对应的查询接口
    if (activeTab.value === "scheduled") {
      getScheduledTableData();