copy from applications/drone-command/src/views/basicManage/maintainRecord/maintainRecord.vue
copy to applications/drone-command/src/views/basicManage/deviceScrap/index.vue
| File was copied from applications/drone-command/src/views/basicManage/maintainRecord/maintainRecord.vue |
| | |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <div> |
| | | <el-button type="primary" @click="handleAdd">维护计划</el-button> |
| | | <el-button type="danger" :disabled="!selectedIds.length" @click="handleDelete()">删除</el-button> |
| | | </div> |
| | | <el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" /> |
| | | <el-table-column type="index" width="60" label="序号" /> |
| | |
| | | </el-table-column> |
| | | <el-table-column prop="deviceModel" label="型号" /> |
| | | <el-table-column prop="manufacturer" label="生产厂商" /> |
| | | <el-table-column prop="createTime" label="入库时间" /> |
| | | <el-table-column prop="source" label="来源" /> |
| | | <el-table-column prop="charger" label="负责人" /> |
| | | <el-table-column prop="scrapTime" label="报废时间" /> |
| | | <el-table-column prop="scrapReason" label="报废原因" /> |
| | | <el-table-column prop="disposeWay" label="处置方式" /> |
| | | <el-table-column prop="maintainReminder" label="维护提醒" /> |
| | | <el-table-column prop="planCycleType" label="维护计划"> |
| | | <template v-slot="{ row }"> |
| | | {{ getPlanCycleLabel(row) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作"> |
| | | <template v-slot="{ row }"> |
| | | <el-link @click="handleView(row)" type="primary">查看</el-link> |
| | | <el-link @click="maintenance(row)" type="warning">维护</el-link> |
| | | <el-link @click="handleDelete(row)" type="danger">删除</el-link> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | </template> |
| | | <script setup> |
| | | import { onMounted, ref } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { getDictionaryByCode } from '@/api/system/dictbiz' |
| | | import { getDeptTree } from '@/api/system/dept' |
| | | import { getDictLabel } from '@ztzf/utils' |
| | | import { fwDeviceMaintainPlanPageApi, fwDeviceMaintainPlanRemoveApi } from './maintainRecordApi' |
| | | import FormDiaLog from './FormDiaLog.vue' |
| | | import MaintenanceDiaLog from '@/views/basicManage/maintainRecord/MaintenanceDiaLog.vue' |
| | | import { fwDeviceScrapPageApi } from '@/views/basicManage/deviceStock/fwDeviceScrapApi' |
| | | |
| | | const initSearchParams = () => ({ |
| | | deviceName: '', // 设备名称 |
| | |
| | | async function getList() { |
| | | loading.value = true |
| | | try { |
| | | const res = await fwDeviceMaintainPlanPageApi(searchParams.value) |
| | | const res = await fwDeviceScrapPageApi(searchParams.value) |
| | | list.value = res?.data?.data?.records ?? [] |
| | | total.value = res?.data?.data?.total ?? 0 |
| | | } finally { |
| | |
| | | // 查看 |
| | | function handleView(row) { |
| | | dialogRef.value?.open({ mode: 'view', row: { ...row } }) |
| | | } |
| | | |
| | | // 维护 |
| | | function maintenance(row) { |
| | | maintenanceDialogRef.value?.open({ mode: 'edit', row: { ...row } }) |
| | | } |
| | | |
| | | // 删除 |
| | | async function handleDelete(row) { |
| | | const tips = row ? '该条' : '选中的项' |
| | | await ElMessageBox.confirm(`确认删除${tips}吗?`, '提示', { type: 'warning' }) |
| | | const ids = row ? row.id : selectedIds.value.join(',') |
| | | await fwDeviceMaintainPlanRemoveApi({ ids }) |
| | | ElMessage.success('删除成功') |
| | | selectedIds.value = [] |
| | | getList() |
| | | } |
| | | |
| | | // 勾选值设置 |