Browse Source

工商信息更改同时更新基本信息

lifanagju_citu 6 tháng trước cách đây
mục cha
commit
bf87e480ec

+ 9 - 0
src/views/recruit/enterprise/entInfoSetting/index.vue

@@ -28,6 +28,7 @@
         <template v-for="item in tabList" :key="item.id">
           <div v-show="item.value === tab">
             <component
+              ref="componentRef"
               :is="item.path"
               @complete="handleComplete"
             />
@@ -53,6 +54,8 @@ import {
 } from 'vue-router'
 import { useI18n } from '@/hooks/web/useI18n'
 
+const componentRef = ref()
+
 const route = useRoute()
 const { t } = useI18n()
 // tab
@@ -104,6 +107,12 @@ const handleComplete = (val) => { // completeNum: tab内完成数, totalNum: tab
     item.totalCount = val.totalCount || 0
   }
   calcCompletion()
+  if (val.isUpdate && val.id === 'businessInformation') {
+    // 工商信息更改同时更新基本信息
+    if (componentRef.value?.length) {
+      componentRef.value[0].getBaseInfo()
+    }
+  }
 }
 </script>
 

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

@@ -195,6 +195,7 @@ getDict('menduner_industry_type', {}, 'industryList').then(({ data }) => {
 //   return obj
 // })
 
+
 // 获取基本信息
 const getBaseInfo = async () => {
   let completeCount = 0
@@ -244,9 +245,9 @@ const handleSave = async () => {
   getBaseInfo()
 }
 
-// defineExpose({
-//   getAuthInfo
-// })
+defineExpose({
+  getBaseInfo
+})
 </script>
 
 <style lang="scss" scoped>

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

@@ -192,8 +192,6 @@ const query = reactive({})
 
 // licenseUrl.value = info?.businessLicenseUrl ?? ''
 
-
-
 const handleSave = async () => {
   const { valid } = await CtFormRef.value.formRef.validate()
   if (!valid) return
@@ -205,13 +203,16 @@ const handleSave = async () => {
   if (!query.establishmentTime) return Snackbar.warning('请选择成立时间')
   await updateEnterpriseBusiness(query)
   Snackbar.success('编辑成功')
+  isUpdate = true
   getBaseInfo()
 }
 
+let isUpdate = false // 是否同时更新基本信息
 // 完成度展示
 const completeFun = (completeCount = 0) => {
   const totalCount = formItems.value.options?.length || 0
-  emit('complete', { totalCount, completeCount, id: 'businessInformation' })
+  emit('complete', { totalCount, completeCount, id: 'businessInformation', isUpdate })
+  isUpdate = false // 重置
 }
 
 // 识别营业执照图片