From 686b5fc223ab80e8a470649abcf77bc82e093b4a Mon Sep 17 00:00:00 2001 From: zy <276996223@qq.com> Date: Fri, 21 Feb 2025 15:39:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=81=E4=B8=9A=E6=A8=A1=E5=9D=97=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/enterprises/update.vue | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/views/enterprises/update.vue b/src/views/enterprises/update.vue index ed979bf..9fdc4ef 100644 --- a/src/views/enterprises/update.vue +++ b/src/views/enterprises/update.vue @@ -276,12 +276,12 @@ function init() { if (query.id) { // 修改:如果有 id 则设置为 'update' formType.value = 'update' - EnterprisesApi.getEnterprises(query.id).then((res) => { + EnterprisesApi.getEnterprises(query.id).then((res) => { selectedUser.value=res.inviterName; // formData.value.startUserSelectAssignees=res.userId; formData.value = res }) - }else{ formType.value = 'create'} + }else{formType.value = 'create'} } // 控制地图弹窗显示隐藏 const showMap = ref(false) @@ -367,8 +367,13 @@ const handleSearch = () => { onMounted(() => { init() - getQualificationList() - getInspectionslList() + //判断是添加删除 + if(query.id){ + getQualificationList() + getInspectionslList() + + } + getEnterpriseUserList() //getInspectionsLogList() const openMapAndInit = async () => { @@ -505,7 +510,12 @@ const getInspectionslList = async () => { loading.value = true try { const data = await EnterpriseInspectionsApi.getEnterpriseInspectionsPage({"enterpriseId":query.id}) - inspectionslist.value = data.list + if(!data.list || data.list.length === 0){ + console.log("No data or data is null"); + } else { + inspectionslist.value = data.list; + } + } finally { loading.value = false } @@ -517,7 +527,11 @@ const getInspectionsLogList = async (insprctionsId) => { loading.value = true try { const data = await EnterpriseInspectionsApi.inspectionsLogList({"inspectionsId":insprctionsId}) - inspectionsLogList.value = data + if(!data.list || data.list.length === 0){ + console.log("No data or data is null"); + } else { + inspectionsLogList.value = data.list; + } } finally { loading.value = false }