1 files renamed
2 files modified
7 files added
1 files deleted
| | |
| | | <template> |
| | | <el-dialog v-model="visible" :title="dialogTitle" @closed="handleClosed" destroy-on-close> |
| | | <div v-if="dialogReadonly"> |
| | | <h3>设备详情</h3> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <div>设备信息: {{ formData.deviceName }}</div> |
| | |
| | | <div>联系电话: {{ formData.contactPhone }}</div> |
| | | </el-col> |
| | | </el-row> |
| | | <h3>出库去向详情</h3> |
| | | <el-table v-loading="loading" :data="list"> |
| | | <el-table-column type="index" width="60" label="序号" /> |
| | | <el-table-column prop="charger" label="用户" /> |
| | |
| | | // 打开弹框 |
| | | async function open({ mode, row } = {}) { |
| | | dialogMode.value = mode || 'add' |
| | | formData.value = row |
| | | visible.value = true |
| | | if (dialogMode.value === 'add') { |
| | | formData.value = initForm() |
| | | } else { |
| | | formData.value = row |
| | | await loadDetail() |
| | | getList() |
| | | } |
| | |
| | | const searchParams = ref(initSearchParams()) // 查询参数 |
| | | const loading = ref(false) // 列表加载中 |
| | | const list = ref([]) // 列表数据 |
| | | const total = ref(0) // 总数 |
| | | const selectedIds = ref([]) // 勾选的设备ID列表 |
| | | const queryParamsRef = ref(null) // 查询表单实例 |
| | | const dialogRef = ref(null) // 弹框实例 |
| New file |
| | |
| | | <template> |
| | | <el-dialog v-model="visible" :title="titleEnum[dialogMode]" @closed="handleClosed" destroy-on-close> |
| | | <div v-if="dialogReadonly"> |
| | | <h3>设备详情</h3> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <div>设备名称: {{ formData.deviceName }}</div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div>设备类型: {{ getDictLabel(formData.deviceType, dictObj.deviceType) }}</div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div>型号 : {{ formData.deviceModel }}</div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div>生产厂商 : {{ formData.manufacturer }}</div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div>所属部门 : {{ formData.belongDept }}</div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div>负责人 : {{ formData.fzr }}</div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div>维护计划 : {{ getPlanCycleLabel(formData) }}</div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div>维护时间 : {{ list?.[0]?.maintainTime }}</div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div>维护内容 : {{ formData.manufacturer }}</div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div>跟换部件 : {{ formData.manufacturer }}</div> |
| | | </el-col> |
| | | </el-row> |
| | | <h3>维护详情</h3> |
| | | <el-table v-loading="loading" :data="list"> |
| | | <el-table-column type="index" width="60" label="序号" /> |
| | | <el-table-column prop="maintainTime" label="维护时间" /> |
| | | <el-table-column prop="maintainContent" label="维护内容" /> |
| | | <el-table-column prop="replacePart" label="跟换部件" /> |
| | | </el-table> |
| | | <el-pagination |
| | | v-model:current-page="searchParams.current" |
| | | v-model:page-size="searchParams.size" |
| | | :total="total" |
| | | @change="getList" |
| | | /> |
| | | </div> |
| | | <el-form v-else ref="formRef" :model="formData" :rules="rules" :disabled="dialogReadonly" label-width="100px"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="选择设备" prop="deviceId"> |
| | | <el-select v-model="formData.deviceId" placeholder="请选择" filterable clearable> |
| | | <el-option v-for="item in deviceList" :key="item.id" :label="item.deviceName" :value="item.id" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="维护计划周期" prop="planCycleType"> |
| | | <el-select |
| | | v-model="formData.planCycleType" |
| | | placeholder="请选择" |
| | | clearable |
| | | @change="formData.planCycleValue = []" |
| | | > |
| | | <el-option v-for="item in planCycleOptions" :key="item.value" :label="item.label" :value="item.value" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="维护计划时间" prop="planCycleValue"> |
| | | <el-select |
| | | v-model="formData.planCycleValue" |
| | | placeholder="请选择" |
| | | clearable |
| | | multiple |
| | | :disabled="!formData.planCycleType" |
| | | > |
| | | <el-option |
| | | v-for="item in planCycleValueOptions" |
| | | :key="item.value" |
| | | :label="item.value" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <el-button @click="handleCancel">{{ dialogReadonly ? '关闭' : '取消' }}</el-button> |
| | | <el-button |
| | | v-if="!dialogReadonly" |
| | | type="primary" |
| | | :loading="submitting" |
| | | :disabled="submitting" |
| | | @click="handleSubmit" |
| | | > |
| | | 确定 |
| | | </el-button> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { computed, ref } from 'vue' |
| | | import { ElMessage } from 'element-plus' |
| | | import { fieldRules, getDictLabel } from '@ztzf/utils' |
| | | import { fwDeviceMaintainPlanDetailApi, fwDeviceMaintainPlanSubmitApi, fwDevicePageApi } from './maintainRecordApi' |
| | | import { fwDeviceTrackPageApi } from '@/views/basicManage/deviceStock/fwDeviceTrackApi' |
| | | import { fwDeviceMaintainRecordPageApi } from '@/views/basicManage/maintainRecord/fwDeviceMaintainRecord' |
| | | |
| | | const initForm = () => ({ |
| | | deviceId: '', |
| | | planCycleType: '', |
| | | planCycleValue: [], |
| | | }) |
| | | |
| | | const planCycleOptions = inject('planCycleOptions') |
| | | const planCycleValueOptions = ref([]) |
| | | |
| | | const emit = defineEmits(['success']) |
| | | const formRef = ref(null) // 表单实例 |
| | | const formData = ref(initForm()) // 表单数据 |
| | | const visible = ref(false) // 弹框显隐 |
| | | const dialogMode = ref('add') // 弹框模式 |
| | | const submitting = ref(false) // 提交中 |
| | | const deviceList = ref([]) // 设备列表 |
| | | const getPlanCycleLabel = inject('getPlanCycleLabel') |
| | | const dictObj = inject('dictObj') |
| | | const dialogReadonly = computed(() => dialogMode.value === 'view') |
| | | const titleEnum = ref({ edit: '编辑', view: '查看', add: '维护计划' }) |
| | | |
| | | const planCycleLabel = computed(() => { |
| | | const item = planCycleOptions.find(option => option.value === formData.value.planCycleType) |
| | | return item?.label || formData.value.planCycleType || '-' |
| | | }) |
| | | |
| | | const rules = { |
| | | deviceId: fieldRules(true, 0), |
| | | planCycleType: fieldRules(true, 0), |
| | | planCycleValue: [{ required: true, message: '请选择', trigger: ['blur', 'change'] }], |
| | | } |
| | | |
| | | // 获取设备列表 |
| | | function getDeviceList() { |
| | | return fwDevicePageApi({ current: 1, size: 999 }).then(res => { |
| | | deviceList.value = res?.data?.data?.records ?? [] |
| | | }) |
| | | } |
| | | |
| | | // 关闭弹框 |
| | | function handleCancel() { |
| | | visible.value = false |
| | | } |
| | | |
| | | // 提交新增/编辑 |
| | | async function handleSubmit() { |
| | | const isValid = await formRef.value?.validate().catch(() => false) |
| | | if (!isValid) return |
| | | submitting.value = true |
| | | try { |
| | | await fwDeviceMaintainPlanSubmitApi(formData.value) |
| | | ElMessage.success(dialogMode.value === 'add' ? '新增成功' : '更新成功') |
| | | visible.value = false |
| | | emit('success') |
| | | } finally { |
| | | submitting.value = false |
| | | } |
| | | } |
| | | |
| | | // 加载详情 |
| | | async function loadDetail() { |
| | | if (!formData.value.id) return |
| | | const res = await fwDeviceMaintainPlanDetailApi({ id: formData.value.id }) |
| | | formData.value = res?.data?.data ?? {} |
| | | console.log(formData.value, 66) |
| | | } |
| | | |
| | | // 关闭后重置 |
| | | function handleClosed() { |
| | | formData.value = initForm() |
| | | } |
| | | |
| | | const initSearchParams = () => ({ |
| | | current: 1, // 当前页 |
| | | size: 10, // 每页大小 |
| | | }) |
| | | const searchParams = ref(initSearchParams()) |
| | | const total = ref(0) // 总条数 |
| | | const loading = ref(false) // 列表加载中 |
| | | const list = ref([]) // 列表数据 |
| | | async function getList() { |
| | | loading.value = true |
| | | try { |
| | | const params = { ...searchParams.value, planId: formData.value.id } |
| | | const res = await fwDeviceMaintainRecordPageApi(params) |
| | | list.value = res?.data?.data?.records ?? [] |
| | | total.value = res?.data?.data?.total ?? 0 |
| | | } finally { |
| | | loading.value = false |
| | | } |
| | | } |
| | | |
| | | // 打开弹框 |
| | | async function open({ mode, row } = {}) { |
| | | dialogMode.value = mode || 'add' |
| | | visible.value = true |
| | | await getDeviceList() |
| | | if (dialogMode.value === 'add') { |
| | | formData.value = initForm() |
| | | } else { |
| | | formData.value = row |
| | | await loadDetail() |
| | | getList() |
| | | } |
| | | } |
| | | |
| | | defineExpose({ open }) |
| | | |
| | | watch( |
| | | () => formData.value?.planCycleType, |
| | | type => { |
| | | planCycleValueOptions.value = [] |
| | | if (!type) return |
| | | if (type === '1') { |
| | | ;[...Array(12)].forEach((item, index) => { |
| | | ;[...Array(31)].forEach((item1, index1) => { |
| | | planCycleValueOptions.value.push({ value: `${index + 1}月${index1 + 1}号` }) |
| | | }) |
| | | }) |
| | | } else if (type === '2') { |
| | | ;[...Array(31)].forEach((item, index) => { |
| | | planCycleValueOptions.value.push({ value: `${index + 1}号` }) |
| | | }) |
| | | } else if (type === '3') { |
| | | ;[...Array(7)].forEach((item, index) => { |
| | | planCycleValueOptions.value.push({ value: `星期${index + 1}` }) |
| | | }) |
| | | } |
| | | } |
| | | ) |
| | | </script> |
| New file |
| | |
| | | <template> |
| | | <el-dialog v-model="visible" :title="titleEnum[dialogMode]" @closed="handleClosed" destroy-on-close> |
| | | <div v-if="dialogReadonly"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <div>设备名称: {{ deviceName }}</div> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <div>维护计划: {{ planCycleLabel }}</div> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <el-form v-else ref="formRef" :model="formData" :rules="rules" :disabled="dialogReadonly" label-width="100px"> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="维护内容" prop="maintainContent"> |
| | | <el-input v-model="formData.maintainContent" maxlength="50" placeholder="请输入" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="24"> |
| | | <el-form-item label="更换部件" prop="replacePart"> |
| | | <el-input v-model="formData.replacePart" maxlength="50" placeholder="请输入" clearable /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="实际维护时间" prop="maintainTime"> |
| | | <el-date-picker |
| | | v-model="formData.maintainTime" |
| | | type="date" |
| | | placeholder="选择日期" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-form> |
| | | <template #footer> |
| | | <el-button @click="handleCancel">{{ dialogReadonly ? '关闭' : '取消' }}</el-button> |
| | | <el-button |
| | | v-if="!dialogReadonly" |
| | | type="primary" |
| | | :loading="submitting" |
| | | :disabled="submitting" |
| | | @click="handleSubmit" |
| | | > |
| | | 确定 |
| | | </el-button> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { computed, ref } from 'vue' |
| | | import { ElMessage } from 'element-plus' |
| | | import { fieldRules } from '@ztzf/utils' |
| | | import { fwDeviceMaintainPlanDetailApi, fwDeviceMaintainPlanSubmitApi, fwDevicePageApi } from './maintainRecordApi' |
| | | import { fwDeviceMaintainRecordSubmitApi } from '@/views/basicManage/maintainRecord/fwDeviceMaintainRecord' |
| | | |
| | | const initForm = () => ({ |
| | | deviceId: '', |
| | | id: '', |
| | | maintainContent: '', |
| | | replacePart: '', |
| | | maintainTime: '', |
| | | }) |
| | | |
| | | const planCycleOptions = [ |
| | | { label: '每年', value: '1' }, |
| | | { label: '每月', value: '2' }, |
| | | { label: '每周', value: '3' }, |
| | | ] |
| | | |
| | | const emit = defineEmits(['success']) |
| | | const formRef = ref(null) // 表单实例 |
| | | const formData = ref(initForm()) // 表单数据 |
| | | const visible = ref(false) // 弹框显隐 |
| | | const dialogMode = ref('add') // 弹框模式 |
| | | const submitting = ref(false) // 提交中 |
| | | const deviceList = ref([]) // 设备列表 |
| | | |
| | | const dialogReadonly = computed(() => dialogMode.value === 'view') |
| | | const titleEnum = ref({ edit: '编辑', view: '查看', add: '维护计划' }) |
| | | |
| | | const planCycleLabel = computed(() => { |
| | | const item = planCycleOptions.find(option => option.value === formData.value.planCycleType) |
| | | return item?.label || formData.value.planCycleType || '-' |
| | | }) |
| | | const deviceName = computed(() => { |
| | | const target = deviceList.value.find(item => item.id === formData.value.deviceId) |
| | | return formData.value.deviceName || target?.deviceName || '-' |
| | | }) |
| | | |
| | | const rules = { |
| | | maintainContent: fieldRules(true, 50), |
| | | replacePart: fieldRules(true, 50), |
| | | maintainTime: fieldRules(true, 0), |
| | | } |
| | | |
| | | // 关闭弹框 |
| | | function handleCancel() { |
| | | visible.value = false |
| | | } |
| | | |
| | | // 提交新增/编辑 |
| | | async function handleSubmit() { |
| | | const isValid = await formRef.value?.validate().catch(() => false) |
| | | if (!isValid) return |
| | | submitting.value = true |
| | | try { |
| | | await fwDeviceMaintainRecordSubmitApi(formData.value) |
| | | ElMessage.success(dialogMode.value === 'add' ? '新增成功' : '更新成功') |
| | | visible.value = false |
| | | emit('success') |
| | | } finally { |
| | | submitting.value = false |
| | | } |
| | | } |
| | | |
| | | // 加载详情 |
| | | async function loadDetail() { |
| | | console.log(formData.value) |
| | | if (!formData.value.id) return |
| | | const res = await fwDeviceMaintainPlanDetailApi({ id: formData.value.id }) |
| | | formData.value = { |
| | | planId: res?.data?.data?.id, |
| | | deviceId: res?.data?.data.deviceId, |
| | | } |
| | | console.log(formData.value, 66) |
| | | } |
| | | |
| | | // 关闭后重置 |
| | | function handleClosed() { |
| | | formData.value = initForm() |
| | | } |
| | | |
| | | // 打开弹框 |
| | | async function open({ mode, row } = {}) { |
| | | dialogMode.value = mode || 'add' |
| | | visible.value = true |
| | | if (dialogMode.value === 'add') { |
| | | formData.value = initForm() |
| | | } else { |
| | | formData.value = row |
| | | await loadDetail() |
| | | } |
| | | } |
| | | |
| | | defineExpose({ open }) |
| | | </script> |
| New file |
| | |
| | | import request from '@/axios' |
| | | |
| | | // 分页 |
| | | export const fwDeviceMaintainRecordPageApi = params => { |
| | | return request({ |
| | | url: `/drone-fw/device/fwDeviceMaintainRecord/page`, |
| | | method: 'get', |
| | | params, |
| | | }) |
| | | } |
| | | |
| | | // 新增或修改 |
| | | export const fwDeviceMaintainRecordSubmitApi = data => { |
| | | return request({ |
| | | url: `/drone-fw/device/fwDeviceMaintainRecord/submit`, |
| | | method: 'post', |
| | | data, |
| | | }) |
| | | } |
| New file |
| | |
| | | <template> |
| | | <basic-container> |
| | | <el-form ref="queryParamsRef" :model="searchParams"> |
| | | <el-row :gutter="16"> |
| | | <el-col :span="4"> |
| | | <el-form-item label="设备名称" prop="deviceName"> |
| | | <el-input v-model="searchParams.deviceName" placeholder="请输入" clearable @clear="handleSearch" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <el-form-item label="设备类型" prop="deviceType"> |
| | | <el-select v-model="searchParams.deviceType" placeholder="请选择" clearable @change="handleSearch"> |
| | | <el-option |
| | | v-for="item in dictObj.deviceType" |
| | | :key="item.dictKey" |
| | | :label="item.dictValue" |
| | | :value="item.dictKey" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <el-form-item label="所属部门" prop="belongDept"> |
| | | <el-tree-select |
| | | v-model="searchParams.belongDept" |
| | | :data="deptTree" |
| | | :props="treeProps" |
| | | node-key="id" |
| | | check-strictly |
| | | clearable |
| | | @change="handleSearch" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <el-form-item> |
| | | <el-button @click="resetForm">重置</el-button> |
| | | <el-button type="primary" @click="handleSearch">查询</el-button> |
| | | </el-form-item> |
| | | </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 prop="deviceName" label="设备名称" /> |
| | | <el-table-column prop="deviceType" label="设备类型"> |
| | | <template v-slot="{ row }"> |
| | | {{ getDictLabel(row.deviceType, dictObj.deviceType) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="deviceModel" label="型号" /> |
| | | <el-table-column prop="manufacturer" label="生产厂商" /> |
| | | <el-table-column prop="charger" 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> |
| | | <div> |
| | | <el-pagination |
| | | v-model:current-page="searchParams.current" |
| | | v-model:page-size="searchParams.size" |
| | | :total="total" |
| | | @change="getList" |
| | | /> |
| | | </div> |
| | | <FormDiaLog ref="dialogRef" @success="getList" /> |
| | | <MaintenanceDiaLog ref="maintenanceDialogRef" @success="getList" /> |
| | | </basic-container> |
| | | </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' |
| | | |
| | | const initSearchParams = () => ({ |
| | | deviceName: '', // 设备名称 |
| | | deviceType: '', // 设备类型 |
| | | belongDept: '', // 所属部门 |
| | | current: 1, // 当前页 |
| | | size: 10, // 每页大小 |
| | | }) |
| | | const searchParams = ref(initSearchParams()) // 查询参数 |
| | | const total = ref(0) // 总条数 |
| | | const loading = ref(false) // 列表加载中 |
| | | const list = ref([]) // 列表数据 |
| | | const selectedIds = ref([]) // 勾选的ID列表 |
| | | const queryParamsRef = ref(null) // 查询表单实例 |
| | | const dialogRef = ref(null) // 弹框实例 |
| | | const maintenanceDialogRef = ref(null) // 弹框实例 |
| | | const dictObj = ref({ |
| | | deviceType: [], //设备类型 |
| | | deviceAtt: [], //设备属性 |
| | | }) |
| | | provide('dictObj', dictObj) |
| | | const deptTree = ref([]) //部门树 |
| | | const treeProps = { |
| | | label: 'name', |
| | | children: 'children', |
| | | } |
| | | const planCycleOptions = [ |
| | | { label: '每年', value: '1' }, |
| | | { label: '每月', value: '2' }, |
| | | { label: '每周', value: '3' }, |
| | | ] |
| | | provide('planCycleOptions', planCycleOptions) |
| | | |
| | | // 获取列表 |
| | | async function getList() { |
| | | loading.value = true |
| | | try { |
| | | const res = await fwDeviceMaintainPlanPageApi(searchParams.value) |
| | | list.value = res?.data?.data?.records ?? [] |
| | | total.value = res?.data?.data?.total ?? 0 |
| | | } finally { |
| | | loading.value = false |
| | | } |
| | | } |
| | | |
| | | // 查询 |
| | | function handleSearch() { |
| | | searchParams.value.current = 1 |
| | | getList() |
| | | } |
| | | |
| | | // 重置查询 |
| | | function resetForm() { |
| | | queryParamsRef.value?.resetFields() |
| | | searchParams.value.current = 1 |
| | | getList() |
| | | } |
| | | |
| | | // 查看 |
| | | 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() |
| | | } |
| | | |
| | | // 勾选值设置 |
| | | function handleSelectionChange(rows) { |
| | | selectedIds.value = rows.map(item => item.id) |
| | | } |
| | | |
| | | // 获取字典 |
| | | function getDictList() { |
| | | getDictionaryByCode('deviceType,deviceAtt').then(res => { |
| | | dictObj.value = res.data.data |
| | | }) |
| | | } |
| | | |
| | | // 获取部门树 |
| | | function getDeptTreeFun() { |
| | | getDeptTree().then(res => { |
| | | deptTree.value = res.data.data |
| | | }) |
| | | } |
| | | |
| | | // 新增 |
| | | function handleAdd() { |
| | | dialogRef.value?.open({ mode: 'add' }) |
| | | } |
| | | |
| | | function getPlanCycleLabel(row) { |
| | | const item = planCycleOptions.find(option => option.value === row.planCycleType) |
| | | return item?.label + '-' + row.planCycleValue.join(',') |
| | | } |
| | | provide('getPlanCycleLabel', getPlanCycleLabel) |
| | | |
| | | onMounted(() => { |
| | | getList() |
| | | getDictList() |
| | | getDeptTreeFun() |
| | | }) |
| | | </script> |
| | | <style scoped lang="scss"></style> |
| New file |
| | |
| | | import request from '@/axios' |
| | | |
| | | // 列表 |
| | | export const fwDeviceMaintainPlanPageApi = params => { |
| | | return request({ |
| | | url: `/drone-fw/device/fwDeviceMaintainPlan/page`, |
| | | method: 'get', |
| | | params, |
| | | }) |
| | | } |
| | | |
| | | // 新增或编辑 |
| | | export const fwDeviceMaintainPlanSubmitApi = data => { |
| | | return request({ |
| | | url: `/drone-fw/device/fwDeviceMaintainPlan/submit`, |
| | | method: 'post', |
| | | data, |
| | | }) |
| | | } |
| | | |
| | | // 删除 |
| | | export const fwDeviceMaintainPlanRemoveApi = params => { |
| | | return request({ |
| | | url: `/drone-fw/device/fwDeviceMaintainPlan/remove`, |
| | | method: 'post', |
| | | params, |
| | | }) |
| | | } |
| | | |
| | | // 详情 |
| | | export const fwDeviceMaintainPlanDetailApi = params => { |
| | | return request({ |
| | | url: `/drone-fw/device/fwDeviceMaintainPlan/detail`, |
| | | method: 'get', |
| | | params, |
| | | }) |
| | | } |
| | | |
| | | // 设备分页 |
| | | export const fwDevicePageApi = params => { |
| | | return request({ |
| | | url: `/drone-fw/device/fwDevice/page`, |
| | | method: 'get', |
| | | params, |
| | | }) |
| | | } |
| New file |
| | |
| | | |
| | | |
| | | ## 详情 |
| | | |
| | | |
| | | **接口地址**:`/drone-fw/device/fwDeviceMaintainPlan/detail` |
| | | |
| | | |
| | | **请求方式**:`GET` |
| | | |
| | | |
| | | **请求数据类型**:`application/x-www-form-urlencoded` |
| | | |
| | | |
| | | **响应数据类型**:`*/*` |
| | | |
| | | |
| | | **接口描述**:<p>传入fwDeviceMaintainPlan</p> |
| | | |
| | | |
| | | |
| | | **请求参数**: |
| | | |
| | | |
| | | **请求参数**: |
| | | |
| | | |
| | | | 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema | |
| | | | -------- | -------- | ----- | -------- | -------- | ------ | |
| | | |deviceId|设备ID|query|false|integer(int64)|| |
| | | |planCycleType|计划周期(1:每年、2:每月、3:每周)|query|false|string|| |
| | | |planCycleValue|计划周期具体值,数组对象[1,2,3]|query|false|array|string| |
| | | |
| | | |
| | | **响应状态**: |
| | | |
| | | |
| | | | 状态码 | 说明 | schema | |
| | | | -------- | -------- | ----- | |
| | | |200|OK|R«FwDeviceMaintainPlan对象»| |
| | | |401|Unauthorized|| |
| | | |403|Forbidden|| |
| | | |404|Not Found|| |
| | | |
| | | |
| | | **响应参数**: |
| | | |
| | | |
| | | | 参数名称 | 参数说明 | 类型 | schema | |
| | | | -------- | -------- | ----- |----- | |
| | | |code|状态码|integer(int32)|integer(int32)| |
| | | |data|承载数据|FwDeviceMaintainPlan对象|FwDeviceMaintainPlan对象| |
| | | |  areaCode|区域编码|string|| |
| | | |  createDept|创建部门|integer(int64)|| |
| | | |  createTime|创建时间|string(date-time)|| |
| | | |  createUser|创建人|integer(int64)|| |
| | | |  deviceId|设备ID|integer(int64)|| |
| | | |  id|主键id|integer(int64)|| |
| | | |  isDeleted|是否已删除|integer(int32)|| |
| | | |  planCycleType|计划周期(每年、每月、每周)|string|| |
| | | |  planCycleValue|计划周期具体值,数组对象[1,2,3]|array|string| |
| | | |  status|业务状态|integer(int32)|| |
| | | |  updateTime|更新时间|string(date-time)|| |
| | | |  updateUser|更新人|integer(int64)|| |
| | | |msg|返回消息|string|| |
| | | |success|是否成功|boolean|| |
| | | |
| | | |
| | | **响应示例**: |
| | | ```javascript |
| | | { |
| | | "code": 0, |
| | | "data": { |
| | | "areaCode": "", |
| | | "createDept": 0, |
| | | "createTime": "", |
| | | "createUser": 0, |
| | | "deviceId": 0, |
| | | "id": 0, |
| | | "isDeleted": 0, |
| | | "planCycleType": "", |
| | | "planCycleValue": [], |
| | | "status": 0, |
| | | "updateTime": "", |
| | | "updateUser": 0 |
| | | }, |
| | | "msg": "", |
| | | "success": true |
| | | } |
| | | ``` |
| | | |
| | | |
| | | |
| | | ## 分页 |
| | | |
| | | |
| | | **接口地址**:`/drone-fw/device/fwDeviceMaintainPlan/page` |
| | | |
| | | |
| | | **请求方式**:`GET` |
| | | |
| | | |
| | | **请求数据类型**:`application/x-www-form-urlencoded` |
| | | |
| | | |
| | | **响应数据类型**:`*/*` |
| | | |
| | | |
| | | **接口描述**:<p>传入fwDeviceMaintainPlan</p> |
| | | |
| | | |
| | | |
| | | **请求参数**: |
| | | |
| | | |
| | | **请求参数**: |
| | | |
| | | |
| | | | 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema | |
| | | | -------- | -------- | ----- | -------- | -------- | ------ | |
| | | |current|当前页|query|false|integer(int32)|| |
| | | |deviceId|设备ID|query|false|integer(int64)|| |
| | | |planCycleType|计划周期(1:每年、2:每月、3:每周)|query|false|string|| |
| | | |planCycleValue|计划周期具体值,数组对象[1,2,3]|query|false|array|string| |
| | | |size|每页的数量|query|false|integer(int32)|| |
| | | |
| | | |
| | | **响应状态**: |
| | | |
| | | |
| | | | 状态码 | 说明 | schema | |
| | | | -------- | -------- | ----- | |
| | | |200|OK|R«IPage«FwDeviceMaintainPlan对象»»| |
| | | |401|Unauthorized|| |
| | | |403|Forbidden|| |
| | | |404|Not Found|| |
| | | |
| | | |
| | | **响应参数**: |
| | | |
| | | |
| | | | 参数名称 | 参数说明 | 类型 | schema | |
| | | | -------- | -------- | ----- |----- | |
| | | |code|状态码|integer(int32)|integer(int32)| |
| | | |data|承载数据|IPage«FwDeviceMaintainPlan对象»|IPage«FwDeviceMaintainPlan对象»| |
| | | |  current||integer(int64)|| |
| | | |  pages||integer(int64)|| |
| | | |  records|设备维护计划表|array|FwDeviceMaintainPlan对象| |
| | | |    areaCode|区域编码|string|| |
| | | |    createDept|创建部门|integer|| |
| | | |    createTime|创建时间|string|| |
| | | |    createUser|创建人|integer|| |
| | | |    deviceId|设备ID|integer|| |
| | | |    id|主键id|integer|| |
| | | |    isDeleted|是否已删除|integer|| |
| | | |    planCycleType|计划周期(每年、每月、每周)|string|| |
| | | |    planCycleValue|计划周期具体值,数组对象[1,2,3]|array|string| |
| | | |    status|业务状态|integer|| |
| | | |    updateTime|更新时间|string|| |
| | | |    updateUser|更新人|integer|| |
| | | |  size||integer(int64)|| |
| | | |  total||integer(int64)|| |
| | | |msg|返回消息|string|| |
| | | |success|是否成功|boolean|| |
| | | |
| | | |
| | | **响应示例**: |
| | | ```javascript |
| | | { |
| | | "code": 0, |
| | | "data": { |
| | | "current": 0, |
| | | "pages": 0, |
| | | "records": [ |
| | | { |
| | | "areaCode": "", |
| | | "createDept": 0, |
| | | "createTime": "", |
| | | "createUser": 0, |
| | | "deviceId": 0, |
| | | "id": 0, |
| | | "isDeleted": 0, |
| | | "planCycleType": "", |
| | | "planCycleValue": [], |
| | | "status": 0, |
| | | "updateTime": "", |
| | | "updateUser": 0 |
| | | } |
| | | ], |
| | | "size": 0, |
| | | "total": 0 |
| | | }, |
| | | "msg": "", |
| | | "success": true |
| | | } |
| | | ``` |
| | | |
| | | |
| | | |
| | | ## 新增或修改 |
| | | |
| | | |
| | | **接口地址**:`/drone-fw/device/fwDeviceMaintainPlan/submit` |
| | | |
| | | |
| | | **请求方式**:`POST` |
| | | |
| | | |
| | | **请求数据类型**:`application/json` |
| | | |
| | | |
| | | **响应数据类型**:`*/*` |
| | | |
| | | |
| | | **接口描述**:<p>传入fwDeviceMaintainPlan</p> |
| | | |
| | | |
| | | |
| | | **请求示例**: |
| | | |
| | | |
| | | ```javascript |
| | | { |
| | | "deviceId": 0, |
| | | "planCycleType": "", |
| | | "planCycleValue": [] |
| | | } |
| | | ``` |
| | | |
| | | |
| | | **请求参数**: |
| | | |
| | | |
| | | **请求参数**: |
| | | |
| | | |
| | | | 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema | |
| | | | -------- | -------- | ----- | -------- | -------- | ------ | |
| | | |fwDeviceMaintainPlan|fwDeviceMaintainPlan|body|true|FwDeviceMaintainPlanDTO|FwDeviceMaintainPlanDTO| |
| | | |  deviceId|设备ID||false|integer(int64)|| |
| | | |  planCycleType|计划周期(1:每年、2:每月、3:每周)||false|string|| |
| | | |  planCycleValue|计划周期具体值,数组对象[1,2,3]||false|array|string| |
| | | |
| | | |
| | | **响应状态**: |
| | | |
| | | |
| | | | 状态码 | 说明 | schema | |
| | | | -------- | -------- | ----- | |
| | | |200|OK|R| |
| | | |201|Created|| |
| | | |401|Unauthorized|| |
| | | |403|Forbidden|| |
| | | |404|Not Found|| |
| | | |
| | | |
| | | **响应参数**: |
| | | |
| | | |
| | | | 参数名称 | 参数说明 | 类型 | schema | |
| | | | -------- | -------- | ----- |----- | |
| | | |code|状态码|integer(int32)|integer(int32)| |
| | | |data|承载数据|object|| |
| | | |msg|返回消息|string|| |
| | | |success|是否成功|boolean|| |
| | | |
| | | |
| | | **响应示例**: |
| | | ```javascript |
| | | { |
| | | "code": 0, |
| | | "data": {}, |
| | | "msg": "", |
| | | "success": true |
| | | } |
| | | ``` |
| | | |
| | | |
| | | |
| | | ## 逻辑删除 |
| | | |
| | | |
| | | **接口地址**:`/drone-fw/device/fwDeviceMaintainPlan/remove` |
| | | |
| | | |
| | | **请求方式**:`POST` |
| | | |
| | | |
| | | **请求数据类型**:`application/json` |
| | | |
| | | |
| | | **响应数据类型**:`*/*` |
| | | |
| | | |
| | | **接口描述**:<p>传入ids</p> |
| | | |
| | | |
| | | |
| | | **请求参数**: |
| | | |
| | | |
| | | **请求参数**: |
| | | |
| | | |
| | | | 参数名称 | 参数说明 | 请求类型 | 是否必须 | 数据类型 | schema | |
| | | | -------- | -------- | ----- | -------- | -------- | ------ | |
| | | |ids|主键集合|query|true|string|| |
| | | |
| | | |
| | | **响应状态**: |
| | | |
| | | |
| | | | 状态码 | 说明 | schema | |
| | | | -------- | -------- | ----- | |
| | | |200|OK|R| |
| | | |201|Created|| |
| | | |401|Unauthorized|| |
| | | |403|Forbidden|| |
| | | |404|Not Found|| |
| | | |
| | | |
| | | **响应参数**: |
| | | |
| | | |
| | | | 参数名称 | 参数说明 | 类型 | schema | |
| | | | -------- | -------- | ----- |----- | |
| | | |code|状态码|integer(int32)|integer(int32)| |
| | | |data|承载数据|object|| |
| | | |msg|返回消息|string|| |
| | | |success|是否成功|boolean|| |
| | | |
| | | |
| | | **响应示例**: |
| | | ```javascript |
| | | { |
| | | "code": 0, |
| | | "data": {}, |
| | | "msg": "", |
| | | "success": true |
| | | } |
| | | ``` |