|
@@ -159,10 +159,15 @@ const queryParams = reactive({
|
|
status: undefined,
|
|
status: undefined,
|
|
createTime: [],
|
|
createTime: [],
|
|
})
|
|
})
|
|
|
|
+
|
|
|
|
+// 响应式变量存储选中的部门
|
|
|
|
+const selectedDept = ref<{ id: number; name: string }>()
|
|
const queryFormRef = ref() // 搜索的表单
|
|
const queryFormRef = ref() // 搜索的表单
|
|
const exportLoading = ref(false) // 导出的加载中
|
|
const exportLoading = ref(false) // 导出的加载中
|
|
/** 处理部门被点击 */
|
|
/** 处理部门被点击 */
|
|
const handleDeptNodeClick = async (row) => {
|
|
const handleDeptNodeClick = async (row) => {
|
|
|
|
+ // 记录选中的部门信息
|
|
|
|
+ selectedDept.value = { id: row.id, name: row.name }
|
|
queryParams.deptId = row.id
|
|
queryParams.deptId = row.id
|
|
await getList()
|
|
await getList()
|
|
}
|
|
}
|
|
@@ -187,6 +192,7 @@ const handleQuery = () => {
|
|
/** 重置按钮操作 */
|
|
/** 重置按钮操作 */
|
|
const resetQuery = () => {
|
|
const resetQuery = () => {
|
|
queryFormRef.value.resetFields()
|
|
queryFormRef.value.resetFields()
|
|
|
|
+ selectedDept.value = undefined
|
|
handleQuery()
|
|
handleQuery()
|
|
}
|
|
}
|
|
|
|
|
|
@@ -201,8 +207,14 @@ const openForm = (type: string, id?: number) => {
|
|
push({ name: 'IotMainPlanEdit', params: {id } })
|
|
push({ name: 'IotMainPlanEdit', params: {id } })
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- // 新增
|
|
|
|
- push({ name: 'IotAddMainPlan', params:{} })
|
|
|
|
|
|
+ // 新增 保养计划
|
|
|
|
+ push({
|
|
|
|
+ name: 'IotAddMainPlan',
|
|
|
|
+ query: {
|
|
|
|
+ deptId: selectedDept.value?.id,
|
|
|
|
+ deptName: selectedDept.value?.name
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
|
|
|
|
const handleStatusChange = async (row: IotMaintenancePlanVO) => {
|
|
const handleStatusChange = async (row: IotMaintenancePlanVO) => {
|