| | |
| | | <el-tag v-if="row.status === 0" type="warning">待保养</el-tag> |
| | | </template> |
| | | <template #operation="{ row }"> |
| | | <!-- 这个功能跟新增保养功能一模一样,有啥意义? --> |
| | | <!-- <el-button |
| | | type="primary" |
| | | text |
| | | @click="addMaintain(row)" |
| | | > |
| | | 新增保养 |
| | | </el-button> --> |
| | | <el-button |
| | | type="primary" |
| | | link |
| | |
| | | > |
| | | 删除 |
| | | </el-button> |
| | | <el-button |
| | | type="primary" |
| | | link |
| | | @click="openFileDialog(row)" |
| | | > |
| | | 附件 |
| | | </el-button> |
| | | </template> |
| | | </PIMTable> |
| | | </div> |
| | |
| | | <PlanModal ref="planModalRef" @ok="getTableData" /> |
| | | <MaintenanceModal ref="maintainModalRef" @ok="getTableData" /> |
| | | <FormDia ref="formDiaRef" @closeDia="getScheduledTableData" /> |
| | | <FileList v-if="fileDialogVisible" v-model:visible="fileDialogVisible" :record-type="'device_maintenance'" :record-id="currentMaintenanceTaskId" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, onMounted, reactive, getCurrentInstance, nextTick, computed } from 'vue' |
| | | import {ref, onMounted, reactive, getCurrentInstance, nextTick, computed, defineAsyncComponent} from 'vue' |
| | | import { Search } from '@element-plus/icons-vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import PlanModal from './Form/PlanModal.vue' |
| | |
| | | import dayjs from 'dayjs' |
| | | |
| | | const { proxy } = getCurrentInstance() |
| | | const FileList = defineAsyncComponent(() => import("@/components/Dialog/FileList.vue")); |
| | | |
| | | // Tab相关 |
| | | const activeTab = ref('scheduled') |
| | |
| | | const maintainModalRef = ref() |
| | | // 定时任务弹窗控制器 |
| | | const formDiaRef = ref() |
| | | // 附件弹窗 |
| | | const fileListDialogRef = ref(null) |
| | | const fileDialogVisible = ref(false) |
| | | const currentMaintenanceTaskId = ref(null) |
| | | |
| | | // 任务记录tab(原设备保养页面)相关变量 |
| | | const filters = reactive({ |
| | |
| | | align: "center", |
| | | prop: "createUserName", |
| | | }, |
| | | { |
| | | label: "项目", |
| | | align: "center", |
| | | prop: "machineryCategory", |
| | | }, |
| | | // { |
| | | // label: "录入日期", |
| | | // align: "center", |
| | |
| | | dataType: "slot", |
| | | slot: "operation", |
| | | align: "center", |
| | | width: "200px", |
| | | width: "350px", |
| | | }, |
| | | ]) |
| | | |
| | |
| | | getTableData() |
| | | } |
| | | |
| | | // 打开附件弹窗 |
| | | const openFileDialog = async (row) => { |
| | | currentMaintenanceTaskId.value = row.id |
| | | fileDialogVisible.value = true |
| | | } |
| | | |
| | | onMounted(() => { |
| | | // 根据默认激活的 Tab 调用对应的查询接口 |
| | | if (activeTab.value === 'scheduled') { |