Browse Source

已有企业申请注册企业

lifanagju_citu 8 tháng trước cách đây
mục cha
commit
9b0ab9524a

+ 14 - 16
src/layout/personal/navBar.vue

@@ -107,7 +107,7 @@
       <v-radio-group v-model="radios">
         <v-radio v-for="item in enterpriseList" :key="item.enterpriseId" color="primary" :label="item.enterpriseName" :value="item.enterpriseId"></v-radio>
       </v-radio-group>
-      <v-btn v-if="showRegistering" class="buttons" @click="handleRegistering">注册企业</v-btn>
+      <v-btn :loading="loading1" class="mt-2 mb-3" style="width: 100%;" color="primary" variant="tonal" @click="handleRegistering">{{ btnType ? '注册新企业' : '查看申请进度' }}</v-btn>
     </CtDialog>
   </div>
 </template>
@@ -178,18 +178,13 @@ const show = ref(false)
 const radios = ref(null)
 const enterpriseList = ref([])
 const changeLoginType = async () => {
+  getApplyInfo() // 注册/注册进度
   const data = await getUserBindEnterpriseList() // 申请通过才有数据,否则空数组
   enterpriseList.value = data || []
   if (data?.length) {
-    if (data.length > 1) {
-      show.value = true
-      radios.value = data[0].enterpriseId
-    } else {
-      //只有一个企业直接切换
-      toEnterprise(data[0].enterpriseId)
-    }
+    radios.value = data[0].enterpriseId
+    show.value = true
   }
-  else getApplyInfo()
 }
 
 // 切换为招聘者
@@ -203,19 +198,22 @@ const toEnterprise = async (enterpriseId) => {
   window.location.href = '/enterpriseVerification'
 }
 
+const btnType = ref(0)
 // 查看用户是否有在申请中的数据
 const getApplyInfo = async () => {
   const data = await getUserRegisterEnterpriseApply()
-  const bool = data && Object.keys(data).length // 已经有数据说明已经申请过了
-  const path = bool ? '/recruit/enterprise/register/inReview' : '/recruit/enterprise/register'
-  router.replace({ path })
+  localStorage.setItem('userApplyInfo', JSON.stringify(data))
+  const status = data?.status || null // 有数据说明有申请
+  btnType.value = (!status || data?.status !== '1') ? 0 : 1 // 0没有数据或者没有正在审核,1.有审核数据
 }
 
-const showRegistering = ref(false)
-if (window.location.hostname === 'localhost' || window.location.hostname === '192.168.3.218' || window.location.hostname === '192.168.3.152') {
-  showRegistering.value = true
+// 注册/查看申请进度
+const loading1 = ref(false)
+const handleRegistering = () => {
+  loading1.value = true
+  const path = btnType.value ? '/recruit/enterprise/register' : '/recruit/enterprise/register/inReview'
+  router.replace({ path })
 }
-const handleRegistering = () => { router.push('/recruit/enterprise/register') }
 
 const handleToPersonalCenter = () => {
   router.push({ path: paths[5] })

+ 10 - 2
src/views/recruit/enterprise/register/register.vue

@@ -10,6 +10,9 @@
       </div>
       <!-- 表单 -->
       <div class="CtFormClass" :style="{width: isMobile ? '' : '600px'}">
+        <div v-if="showFailureReason" class="mb-8" style="color: red; font-size: 14px;">
+          <span>审核不通过原因:{{ showFailureReason }}</span>
+        </div>
         <CtForm ref="CtFormRef" :items="formItems" style="width: 100%;">
           <template #prepare>
             <v-checkbox
@@ -145,7 +148,7 @@ const formItems = ref({
       resize: true,
       counter: 500,
       rows: 2,
-      label: '备注/说明 *',
+      label: '备注/说明',
     },
   ]
 })
@@ -170,9 +173,14 @@ const handleCommit = async () => {
 }
 
 // 不通过的企业注册申请 重新发起
+const showFailureReason = ref('')
 const info = JSON.parse(localStorage.getItem('userApplyInfo'))
-if (info && Object.keys(info).length) {
+// 审核不通过的数据回显
+if (info && Object.keys(info).length && info.status === '2') {
+  showFailureReason.value = info?.reason || ''
   licenseUrl.value = info?.businessLicenseUrl
+  isPrepare.value = info?.prepare || false
+  isPrepareChange()
   formItems.value.options.forEach(e => { e.value = info[e.key] })
 }