Browse Source

没有返回数据提交计算

lifanagju_citu 7 months ago
parent
commit
c7e086ef83

+ 2 - 2
src/views/recruit/enterprise/entInfoSetting/informationSettingsComponents/basicInfo.vue

@@ -199,8 +199,9 @@ getDict('menduner_industry_type', {}, 'industryList').then(({ data }) => {
 // 获取基本信息
 const getBaseInfo = async () => {
   let completeCount = 0
+  const totalCount = formItems.value.options?.length || 0
   const data = await getEnterpriseBaseInfo()
-  if (!data) return
+  if (!data || !Object.keys(data).length) return emit('complete', { totalCount, completeCount, id: 'basicInfo' }) // 完成度展示
   query.id = data.id
   formItems.value.options.forEach(item => {
     if (item.dictTypeName) {
@@ -219,7 +220,6 @@ const getBaseInfo = async () => {
     if (!item.rules || (item.value !== undefined && item.value !== null && item.value !== '')) completeCount++
   })
   // 完成度展示
-  const totalCount = formItems.value.options?.length || 0
   emit('complete', { totalCount, completeCount, id: 'basicInfo' })
 }
 getBaseInfo()

+ 1 - 2
src/views/recruit/enterprise/entInfoSetting/informationSettingsComponents/businessInformation.vue

@@ -267,8 +267,7 @@ const getBaseInfo = async () => {
   let completeCount = 0
   try {
     const data = await getEnterpriseBusiness()
-    if (data && Object.keys(data).length) completeFun(completeCount)
-    if (!data) return
+    if (!data || !Object.keys(data).length) return completeFun(completeCount)
     query.id = data.id
     formItems.value.options.forEach(item => {
       if (item.noParam) return