Merge remote-tracking branch 'origin/dev_NEW_pro' into dev_NEW_pro
| | |
| | | width: 0; |
| | | overflow: hidden; |
| | | visibility: hidden; |
| | | display: inline-block;
|
| | | }
|
| | | & > i {
|
| | | height: 0;
|
| | | width: 0;
|
| | | overflow: hidden;
|
| | | visibility: hidden;
|
| | | display: inline-block;
|
| | | display: inline-block; |
| | | } |
| | | } |
| | | } |
| | |
| | | margin-bottom: 6px; |
| | | border-radius: 14px; |
| | | color: v-bind(getMenuTextColor); |
| | | font-size: 13px; |
| | | |
| | | &:hover { |
| | | background-color: var(--menu-hover, rgba(0, 0, 0, 0.06)) !important; |
| | |
| | | |
| | | .el-sub-menu__title { |
| | | color: v-bind(getMenuTextColor); |
| | | } |
| | | |
| | | :deep(.el-sub-menu__icon-arrow) { |
| | | display: inline-flex !important; |
| | | align-items: center; |
| | | justify-content: center; |
| | | width: 14px; |
| | | height: 14px; |
| | | margin-top: -7px; |
| | | right: 12px; |
| | | font-size: 14px !important; |
| | | color: currentColor !important; |
| | | opacity: 0.72; |
| | | } |
| | | |
| | | :deep(.el-sub-menu.is-active > .el-sub-menu__title) { |
| | |
| | | |
| | | :deep(.el-sub-menu.is-active > .el-sub-menu__title .menu-title), |
| | | :deep(.el-sub-menu.is-active > .el-sub-menu__title .svg-icon), |
| | | :deep(.el-sub-menu.is-active > .el-sub-menu__title .el-sub-menu__icon-arrow), |
| | | :deep(.el-menu-item.is-active .menu-title), |
| | | :deep(.el-menu-item.is-active .svg-icon) { |
| | | color: v-bind(theme) !important; |
| | |
| | | </div> |
| | | </template> |
| | | <template #isEnabled="{ row }"> |
| | | <el-tag :type="row.isEnabled === 1 ? 'success' : 'danger'" size="small"> |
| | | <el-tag :type="row.isEnabled === 1 ? 'success' : 'danger'" |
| | | size="small"> |
| | | {{ row.isEnabled == 1 ? '是' : '否' }} |
| | | </el-tag> |
| | | </template> |
| | |
| | | label: "是否启用", |
| | | minWidth: 100, |
| | | dataType: "slot", |
| | | slot: "isEnabled" |
| | | slot: "isEnabled", |
| | | }, |
| | | { |
| | | prop: "frequencyType", |
| | |
| | | }, |
| | | { prop: "registrant", label: "登记人", minWidth: 100 }, |
| | | { prop: "createTime", label: "登记日期", minWidth: 100 }, |
| | | { |
| | | prop: "inspectionResult", |
| | | label: "巡检结果", |
| | | minWidth: 100, |
| | | dataType: "tag", |
| | | formatData: val => { |
| | | return val == 1 ? "正常" : "异常"; |
| | | }, |
| | | formatType: val => { |
| | | return val == 1 ? "success" : "danger"; |
| | | }, |
| | | }, |
| | | { prop: "abnormalDescription", label: "异常描述", minWidth: 100 }, |
| | | ]); |
| | | |
| | | // 操作列配置 |
| | |
| | | <div class="app-container"> |
| | | <el-tabs v-model="activeTab" |
| | | @tab-change="handleTabChange"> |
| | | <!-- 定时任务管理tab --> |
| | | <el-tab-pane label="定时任务管理" |
| | | <!-- 保养任务tab --> |
| | | <el-tab-pane label="保养任务" |
| | | name="scheduled"> |
| | | <div class="search_form"> |
| | | <el-form :model="scheduledFilters" |
| | |
| | | <div class="table_list"> |
| | | <div class="actions"> |
| | | <el-text class="mx-1" |
| | | size="large">定时任务管理</el-text> |
| | | size="large">保养任务</el-text> |
| | | <div> |
| | | <el-button type="primary" |
| | | icon="Plus" |
| | |
| | | </PIMTable> |
| | | </div> |
| | | </el-tab-pane> |
| | | <!-- 任务记录tab(原设备保养页面) --> |
| | | <el-tab-pane label="任务记录" |
| | | <!-- 保养记录tab(原设备保养页面) --> |
| | | <el-tab-pane label="保养记录" |
| | | name="record"> |
| | | <div class="search_form"> |
| | | <el-form :model="filters" |
| | |
| | | <div class="table_list"> |
| | | <div class="actions"> |
| | | <el-text class="mx-1" |
| | | size="large">任务记录</el-text> |
| | | size="large">保养记录</el-text> |
| | | <div> |
| | | <el-button type="success" |
| | | icon="Van" |
| | |
| | | const fileDialogVisible = ref(false); |
| | | const currentMaintenanceTaskId = ref(null); |
| | | |
| | | // 任务记录tab(原设备保养页面)相关变量 |
| | | // 保养记录tab(原设备保养页面)相关变量 |
| | | const filters = reactive({ |
| | | deviceName: "", |
| | | maintenancePlanTime: "", |
| | |
| | | }); |
| | | const multipleList = ref([]); |
| | | |
| | | // 定时任务管理tab相关变量 |
| | | // 保养任务tab相关变量 |
| | | const scheduledFilters = reactive({ |
| | | taskName: "", |
| | | status: "", |
| | |
| | | }); |
| | | const scheduledMultipleList = ref([]); |
| | | |
| | | // 定时任务管理表格列配置 |
| | | // 保养任务表格列配置 |
| | | const scheduledColumns = ref([ |
| | | { prop: "taskName", label: "设备名称" }, |
| | | { |
| | |
| | | }, |
| | | ]); |
| | | |
| | | // 任务记录表格列配置(原设备保养表格列) |
| | | // 保养记录表格列配置(原设备保养表格列) |
| | | const columns = ref([ |
| | | { |
| | | label: "设备名称", |
| | |
| | | } |
| | | }; |
| | | |
| | | // 定时任务管理相关方法 |
| | | // 保养任务相关方法 |
| | | const getScheduledTableData = async () => { |
| | | try { |
| | | const params = { |
| | |
| | | ElMessage.info("导出定时任务功能待实现"); |
| | | }; |
| | | |
| | | // 任务记录相关方法(原设备保养页面方法) |
| | | // 保养记录相关方法(原设备保养页面方法) |
| | | const getTableData = async () => { |
| | | try { |
| | | const params = { |
| | |
| | | }); |
| | | }; |
| | | |
| | | const findSiblings = (items: any[], tempId: string): any[] | null => { |
| | | if (!items || items.length === 0) return null; |
| | | // 检查当前层级 |
| | | if (items.some(item => item.tempId === tempId)) { |
| | | return items; |
| | | } |
| | | // 递归查找子级 |
| | | for (const item of items) { |
| | | if (item.children && item.children.length > 0) { |
| | | const result = findSiblings(item.children, tempId); |
| | | if (result) return result; |
| | | } |
| | | } |
| | | return null; |
| | | }; |
| | | |
| | | const handleProcessChange = (row: any, value: any) => { |
| | | if (value) { |
| | | const siblings = findSiblings(dataValue.dataList, row.tempId); |
| | | if (siblings) { |
| | | const isDuplicate = siblings.some( |
| | | s => s.tempId !== row.tempId && s.processId === value |
| | | ); |
| | | if (isDuplicate) { |
| | | const option = getProcessOptionById(value); |
| | | const processName = option?.name || "该工序"; |
| | | ElMessage.warning(`同一层级下不能选择重复的消耗工序:${processName}`); |
| | | row.processId = ""; |
| | | syncProcessOperationFields(row); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | row.processId = value || ""; |
| | | syncProcessOperationFields(row); |
| | | }; |
| | |
| | | const validateAll = () => { |
| | | let isValid = true; |
| | | |
| | | // 校验一组兄弟节点的工序是否唯一 |
| | | const checkProcessUniqueness = (items: any[]) => { |
| | | if (!items || items.length === 0 || !isValid) return; |
| | | |
| | | const processIds = new Set(); |
| | | for (const item of items) { |
| | | if (item.processId) { |
| | | if (processIds.has(item.processId)) { |
| | | const option = getProcessOptionById(item.processId); |
| | | const processName = option?.name || item.processName || "未知工序"; |
| | | ElMessage.error( |
| | | `产品「${item.productName}」的消耗工序「${processName}」在当前层级已存在,请勿重复设置` |
| | | ); |
| | | isValid = false; |
| | | return; |
| | | } |
| | | processIds.add(item.processId); |
| | | } |
| | | } |
| | | |
| | | // 递归校验子级的兄弟节点 |
| | | for (const item of items) { |
| | | if (item.children && item.children.length > 0) { |
| | | checkProcessUniqueness(item.children); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | // 校验函数 |
| | | const validateItem = (item: any, isTopLevel = false) => { |
| | | if (!isValid) return; |
| | | // 校验当前项的必填字段 |
| | | if (!item.model) { |
| | | ElMessage.error("请选择规格"); |
| | |
| | | // return; |
| | | // } |
| | | |
| | | // 递归校验子项 |
| | | // 递归校验子项字段 |
| | | if (item.children && item.children.length > 0) { |
| | | item.children.forEach(child => { |
| | | validateItem(child, false); |
| | |
| | | } |
| | | }; |
| | | |
| | | // 遍历所有顶层项 |
| | | // 1. 首先校验同一父级下的同层消耗工序是否唯一 |
| | | checkProcessUniqueness(dataValue.dataList); |
| | | if (!isValid) return false; |
| | | |
| | | // 2. 然后遍历校验所有顶层项的字段必填情况 |
| | | dataValue.dataList.forEach(item => { |
| | | validateItem(item, true); |
| | | }); |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="规格型号:" prop="model"> |
| | | <el-select v-model="form.model" placeholder="请选择" clearable :disabled="operationType === 'edit'" |
| | | filterable readonly @change="handleChangeModel"> |
| | | <el-option v-for="item in modelOptions" :key="item.id" :label="item.model" :value="item.id" /> |
| | | </el-select> |
| | | <el-select v-model="form.productModelId" placeholder="请选择" clearable :disabled="operationType === 'edit'" |
| | | filterable readonly @change="handleChangeModel"> |
| | | <el-option v-for="item in modelOptions" :key="item.id" :label="item.model" :value="item.id" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | productId: "", |
| | | model: "", |
| | | unit: "", |
| | | quantity: "", |
| | | quantity: undefined, |
| | | checkCompany: "", |
| | | checkResult: "", |
| | | inspectType: '', |
| | |
| | | dealResult: '', |
| | | dealName: '', |
| | | dealTime: '', |
| | | productModelId: undefined, |
| | | }, |
| | | rules: { |
| | | checkTime: [{ required: false, message: "请输入", trigger: "blur" },], |
| | |
| | | productId: '', |
| | | model: '', |
| | | unit: '', |
| | | quantity: '', |
| | | quantity: undefined, |
| | | productName: '', |
| | | productModelId: undefined, |
| | | }; |
| | | } else { |
| | | form.value = {}; |
| | |
| | | modelList({ id: value }).then((res) => { |
| | | modelOptions.value = res; |
| | | }) |
| | | }; |
| | | const handleChangeModel = (value) => { |
| | | const selectedModel = modelOptions.value.find(item => item.id === value); |
| | | if (selectedModel) { |
| | | form.value.model = selectedModel.model; |
| | | } |
| | | }; |
| | | const findNodeById = (nodes, productId) => { |
| | | for (let i = 0; i < nodes.length; i++) { |
| | |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
| | | </style> |