Sfoglia il codice sorgente

添加多个联系人

lifanagju_citu 7 mesi fa
parent
commit
9585c20c0c
2 ha cambiato i file con 58 aggiunte e 55 eliminazioni
  1. 0 1
      src/layout/personal/navBar.vue
  2. 58 54
      src/views/recruit/entRegister/register.vue

+ 0 - 1
src/layout/personal/navBar.vue

@@ -107,7 +107,6 @@
       <v-radio-group v-model="radios" :hide-details="true">
         <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 :loading="loading1" color="primary" variant="text" @click="newRegistering">{{ btnType ? '注册新企业' : '查看申请进度' }}</v-btn> -->
       <div class="text-end pr-5 pt-5">
         <span class="color-error cursor-pointer text-decoration-underline" @click="newRegistering">{{ btnType ? '都不是我要的?去注册新企业' : '查看申请进度' }}</span>
       </div>

+ 58 - 54
src/views/recruit/entRegister/register.vue

@@ -107,7 +107,7 @@ const showPreview = ref(false)
 const current = ref(0)
 const business = ref({})
 let licenseUrl = ref('')
-const email = localStorage.getItem('loginAccount') || ''
+// const email = localStorage.getItem('loginAccount') && checkEmail(localStorage.getItem('loginAccount')) ? localStorage.getItem('loginAccount') : ''
 
 // 组件挂载后添加事件监听器
 const isMobile = ref(false)
@@ -123,58 +123,6 @@ const showContactList = ref(false)
 const contactInfo = { contactName: '', phone: '', email: '', password: '', passwordConfirm:'' }
 let contactList = [{ ...contactInfo }]
 const contactCopy = ref([])
-const contactSubmit = () => {
-  let falseValueIndex = null
-  let falseKey = null
-  contactCopy.value.forEach((e, index) => {
-    if (falseValueIndex !== null) return
-    if (e && Object.keys(e).length) {
-      Object.keys(e).forEach(key => {
-        if (falseValueIndex !== null) return
-        if (!e[key]) {
-          falseValueIndex = index
-          falseKey = key
-        }
-      })
-    }
-    if (e.password && e.passwordConfirm && e.password !== e.passwordConfirm) 
-    falseValueIndex = index
-    falseKey = 'compareFalse'
-  })
-  const textList =  {
-    contactName: '姓名',
-    phone: '联系电话',
-    email: '企业邮箱',
-    password: '登录密码',
-    passwordConfirm: '登录密码',
-  }
-  if (falseValueIndex || falseValueIndex === 0) {
-    //
-    let text = ''
-    if (falseKey === 'compareFalse') {
-      text = falseValueIndex ? `【联系人${falseValueIndex}】两次输入的密码不一致` : `【管理员】两次输入的密码不一致`
-    } else {
-      text = falseValueIndex ? `请完善联系人${falseValueIndex}的【${textList[falseKey]}】` : `请完善管理员的【${textList[falseKey]}】`
-    }
-    Confirm(t('common.confirmTitle'), text, { hideCancelBtn: true })
-    return
-  } 
-  contactList = [...contactCopy.value]
-  showContactList.value = false
-  saveRegisterInfo()
-}
-const handleAddContact = () => {
-  contactCopy.value = [...contactList]
-  showContactList.value = true
-}
-const addMore = () => {
-  contactCopy.value.push({...contactInfo})
-}
-const delContact = (index) => {
-  Confirm('系统提示', `是否确认删除${index ? `联系人${index}` : '管理员'}?`).then(async () => {
-    contactCopy.value.splice(index, 1)
-  })
-}
 
 // 注册信息保存
 const enterpriseRegisterInfo = ref(localStorage.getItem('enterpriseRegisterInfo') ? JSON.parse(localStorage.getItem('enterpriseRegisterInfo')) : {})
@@ -363,6 +311,60 @@ if (info && Object.keys(info).length && info.status === '2') {
   }
 }
 
+// 多个联系人提交保存
+const contactSubmit = () => {
+  let falseValueIndex = null
+  let falseKey = null
+  contactCopy.value.forEach((e, index) => {
+    if (falseValueIndex !== null) return
+    if (e && Object.keys(e).length) {
+      Object.keys(e).forEach(key => {
+        if (falseValueIndex !== null) return
+        if (!e[key]) {
+          falseValueIndex = index
+          falseKey = key
+        }
+      })
+    }
+    if (e.password && e.passwordConfirm && e.password !== e.passwordConfirm) 
+    falseValueIndex = index
+    falseKey = 'compareFalse'
+  })
+  const textList =  {
+    contactName: '姓名',
+    phone: '联系电话',
+    email: '企业邮箱',
+    password: '登录密码',
+    passwordConfirm: '登录密码',
+  }
+  if (falseValueIndex || falseValueIndex === 0) {
+    //
+    let text = ''
+    if (falseKey === 'compareFalse') {
+      text = falseValueIndex ? `【联系人${falseValueIndex}】两次输入的密码不一致` : `【管理员】两次输入的密码不一致`
+    } else {
+      text = falseValueIndex ? `请完善联系人${falseValueIndex}的【${textList[falseKey]}】` : `请完善管理员的【${textList[falseKey]}】`
+    }
+    Confirm(t('common.confirmTitle'), text, { hideCancelBtn: true })
+    return
+  } 
+  contactList = [...contactCopy.value]
+  showContactList.value = false
+  saveRegisterInfo()
+}
+const handleAddContact = () => {
+  contactCopy.value = [...contactList]
+  showContactList.value = true
+}
+const addMore = () => {
+  contactCopy.value.push({...contactInfo})
+}
+const delContact = (index) => {
+  Confirm('系统提示', `是否确认删除${index ? `联系人${index}` : '管理员'}?`).then(async () => {
+    contactCopy.value.splice(index, 1)
+  })
+}
+
 const contactNameObj = {
   type: 'text',
   key: 'contactName',
@@ -381,7 +383,8 @@ const phoneObj = {
 const emailObj = {
   type: 'text',
   key: 'email',
-  value: email ? email : '',
+  value: '',
+  // value: email ? email : '',
   label: '企业邮箱 *(此邮箱将用于日后“登录邮箱”)',
   // label: '企业邮箱 * (此邮箱将作为企业登录的账号)',
   rules: [
@@ -433,6 +436,7 @@ const passwordConfirmObj = {
     },
   ],
 }
+
 </script>
 
 <style lang="scss" scoped>