| | |
| | | deviceMaintenanceTaskList, |
| | | deviceMaintenanceTaskDel, |
| | | } from "@/api/equipmentManagement/upkeep"; |
| | | import { userListNoPageByTenantId } from "@/api/system/user.js"; |
| | | import dayjs from "dayjs"; |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | |
| | | 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({ |
| | |
| | | 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", |
| | |
| | | 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: "录入日期", |
| | |
| | | fileDialogVisible.value = true; |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | onMounted(async () => { |
| | | const { data } = await userListNoPageByTenantId(); |
| | | userList.value = data || []; |
| | | // 根据默认激活的 Tab 调用对应的查询接口 |
| | | if (activeTab.value === "scheduled") { |
| | | getScheduledTableData(); |