diff --git a/src/views/mes/task/components/TaskDetailList.vue b/src/views/mes/task/components/TaskDetailList.vue index a7b53aae..c0c7dd33 100644 --- a/src/views/mes/task/components/TaskDetailList.vue +++ b/src/views/mes/task/components/TaskDetailList.vue @@ -2,6 +2,7 @@ () + showCreateButton?: boolean +}>(), { + showCreateButton: true +}) const loading = ref(false) // 列表的加载中 const list = ref([]) // 列表的数据 const total = ref(0) // 列表的总页数 @@ -116,21 +120,6 @@ const queryParams = reactive({ taskId: undefined as unknown }) -/** 监听主表的关联字段的变化,加载对应的子表数据 */ -watch( - () => props.taskId, - (val: number) => { - if (!val) { - list.value = [] - total.value = 0 - return - } - queryParams.taskId = val - handleQuery() - }, - { immediate: true, deep: true } -) - /** 查询列表 */ const getList = async () => { loading.value = true @@ -149,6 +138,21 @@ const handleQuery = () => { getList() } +/** 监听主表的关联字段的变化,加载对应的子表数据 */ +watch( + () => props.taskId, + (val: number) => { + if (!val) { + list.value = [] + total.value = 0 + return + } + queryParams.taskId = val + handleQuery() + }, + { immediate: true, deep: true } +) + /** 添加/修改操作 */ const formRef = ref() const openForm = (type: string, id?: number) => { diff --git a/src/views/mes/task/index.vue b/src/views/mes/task/index.vue index 96913633..ff3dea1f 100644 --- a/src/views/mes/task/index.vue +++ b/src/views/mes/task/index.vue @@ -168,14 +168,21 @@ - + - + +