diff --git a/src/views/mes/pro/process/ProProcessContentList.vue b/src/views/mes/pro/process/ProProcessContentList.vue index b002daba7..30bfea621 100644 --- a/src/views/mes/pro/process/ProProcessContentList.vue +++ b/src/views/mes/pro/process/ProProcessContentList.vue @@ -84,18 +84,6 @@ const { t } = useI18n() // 国际化 const loading = ref(false) // 列表的加载中 const list = ref([]) // 列表的数据 - -/** 查询列表 */ -const getList = async () => { - loading.value = true - try { - list.value = await ProProcessContentApi.getProcessContentListByProcessId(props.processId) - } finally { - loading.value = false - } -} - -// ==================== 添加/修改 ==================== const dialogVisible = ref(false) // 弹窗的是否展示 const dialogTitle = ref('') // 弹窗的标题 const formLoading = ref(false) // 表单的加载中 @@ -115,6 +103,16 @@ const formRules = reactive({ sort: [{ required: true, message: '序号不能为空', trigger: 'blur' }] }) +/** 查询列表 */ +const getList = async () => { + loading.value = true + try { + list.value = await ProProcessContentApi.getProcessContentListByProcessId(props.processId) + } finally { + loading.value = false + } +} + /** 添加/修改操作 */ const openForm = (type: string, row?: ProProcessContentVO) => { const maxSort = list.value.reduce((max, item) => Math.max(max, item.sort || 0), 0) diff --git a/src/views/mes/pro/process/ProProcessForm.vue b/src/views/mes/pro/process/ProProcessForm.vue index 20d796e33..ce872f410 100644 --- a/src/views/mes/pro/process/ProProcessForm.vue +++ b/src/views/mes/pro/process/ProProcessForm.vue @@ -68,6 +68,7 @@ import { ProProcessApi, ProProcessVO } from '@/api/mes/pro/process' import ProProcessContentList from './ProProcessContentList.vue' defineOptions({ name: 'ProProcessForm' }) +const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 const { t } = useI18n() // 国际化 const message = useMessage() // 消息弹窗 @@ -112,10 +113,8 @@ const open = async (type: string, id?: number) => { } } } -defineExpose({ open }) // 提供 open 方法,用于打开弹窗 /** 提交表单 */ -const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 const submitForm = async () => { // 校验表单 if (!formRef) return @@ -152,4 +151,6 @@ const resetForm = () => { } formRef.value?.resetFields() } + +defineExpose({ open }) // 提供 open 方法,用于打开弹窗 diff --git a/src/views/mes/pro/process/index.vue b/src/views/mes/pro/process/index.vue index be76f95eb..550ae2849 100644 --- a/src/views/mes/pro/process/index.vue +++ b/src/views/mes/pro/process/index.vue @@ -70,6 +70,7 @@ :show-overflow-tooltip="true" row-key="id" > + @@ -134,6 +135,7 @@ const { t } = useI18n() // 国际化 const loading = ref(true) // 列表的加载中 const list = ref([]) // 列表的数据 const total = ref(0) // 列表的总页数 +const exportLoading = ref(false) // 导出的加载中 const queryParams = reactive({ pageNo: 1, pageSize: 10, @@ -142,7 +144,7 @@ const queryParams = reactive({ status: undefined }) const queryFormRef = ref() // 搜索的表单 -const exportLoading = ref(false) // 导出的加载中 +const formRef = ref() // 表单弹窗 /** 查询列表 */ const getList = async () => { @@ -169,7 +171,6 @@ const resetQuery = () => { } /** 添加/修改操作 */ -const formRef = ref() const openForm = (type: string, id?: number) => { formRef.value.open(type, id) } @@ -203,7 +204,7 @@ const handleExport = async () => { } /** 初始化 **/ -onMounted(async () => { - await getList() +onMounted(() => { + getList() })