hsy
22 小时以前 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({
@@ -306,6 +314,18 @@
      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",
      label: "频次",
      minWidth: 150,
@@ -344,7 +364,13 @@
    },
    { prop: "maintenancePerson", label: "保养人", minWidth: 100 },
    { prop: "registrant", label: "登记人", minWidth: 100 },
    { prop: "registrationDate", label: "登记日期", minWidth: 100 },
    {
      prop: "registrationDate",
      label: "登记日期",
      minWidth: 100,
      formatData: cell =>
        cell ? dayjs(cell).format("YYYY-MM-DD HH:mm:ss") : "-",
    },
    {
      fixed: "right",
      label: "操作",
@@ -371,7 +397,9 @@
      label: "计划保养日期",
      align: "center",
      prop: "maintenancePlanTime",
      formatData: cell => dayjs(cell).format("YYYY-MM-DD"),
      formatData: cell => {
        return cell == null ? "-" : dayjs(cell).format("YYYY-MM-DD");
      },
    },
    {
      label: "录入人",
@@ -383,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: "录入日期",
@@ -620,7 +660,9 @@
    fileDialogVisible.value = true;
  };
  onMounted(() => {
  onMounted(async () => {
    const { data } = await userListNoPageByTenantId();
    userList.value = data || [];
    // 根据默认激活的 Tab 调用对应的查询接口
    if (activeTab.value === "scheduled") {
      getScheduledTableData();