Browse Source

非必填的需要completeCount++

lifanagju_citu 7 months ago
parent
commit
90f97c6867

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

@@ -264,16 +264,16 @@ const handleDeleteImg = () => {
 
 // 获取基本信息
 const getBaseInfo = async () => {
-  let completeCount = 0
+  let completeCount = 0 // 非必填的需要completeCount++
   try {
     const data = await getEnterpriseBusiness()
     if (!data || !Object.keys(data).length) return completeFun(completeCount)
     query.id = data.id
     formItems.value.options.forEach(item => {
-      if (item.noParam) return
+      if (item.noParam) return completeCount++
       item.value = data[item.key]
       // 完成度展示
-      if (!item.rules || (item.value !== undefined && item.value !== null && item.value !== '')) completeCount++
+      if (!item.rules?.length || (item.value !== undefined && item.value !== null && item.value !== '')) completeCount++
     })
     licenseUrl.value = data.businessUrl
     // 完成度展示