|
@@ -37,6 +37,10 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
+ <template #contacts>
|
|
|
|
+ <!-- 联系人 -->
|
|
|
|
+ <v-btn class="mb-5" style="width: 100%; text-align: center;" variant="text" color="primary" prepend-icon="mdi-plus-box" @click="handleAddContact">添加联系人</v-btn>
|
|
|
|
+ </template>
|
|
</CtForm>
|
|
</CtForm>
|
|
<div class="note">
|
|
<div class="note">
|
|
<h4>注意事项:</h4>
|
|
<h4>注意事项:</h4>
|
|
@@ -57,6 +61,26 @@
|
|
<PreviewImg v-if="showPreview" :current="current" :list="[licenseUrl]" @close="showPreview = !showPreview"></PreviewImg>
|
|
<PreviewImg v-if="showPreview" :current="current" :list="[licenseUrl]" @close="showPreview = !showPreview"></PreviewImg>
|
|
|
|
|
|
<Loading :visible="loading"></Loading>
|
|
<Loading :visible="loading"></Loading>
|
|
|
|
+
|
|
|
|
+ <CtDialog :visible="showContactList" title="添加联系人" :footer="true" widthType="3" @close="showContactList = false" @submit="contactSubmit">
|
|
|
|
+ <div style="min-height: 50vh;">
|
|
|
|
+ <div>
|
|
|
|
+ <div v-for="(item, index) in contactCopy" :key="index" class="contactItemCard">
|
|
|
|
+ <div class="d-flex justify-space-between pb-2">
|
|
|
|
+ <div class="mb-3 pl-3" style="font-size: 13px; color: 00897B; border-left: 5px solid #00897B;">{{ index ? '联系人' + index : '管理员' }}</div>
|
|
|
|
+ <v-btn v-if="index" color="error" density="compact" variant="text" @click="delContact(index)">删除</v-btn>
|
|
|
|
+ <div v-else style="font-size: 12px; color: #999">不可删除</div>
|
|
|
|
+ </div>
|
|
|
|
+ <TextUI v-model="item.contactName" :item="{...contactNameObj}"></TextUI>
|
|
|
|
+ <TextUI v-model="item.phone" :item="{...phoneObj}"></TextUI>
|
|
|
|
+ <TextUI v-model="item.email" :item="{...emailObj}"></TextUI>
|
|
|
|
+ <TextUI v-model="item.password" :item="{...passwordObj}"></TextUI>
|
|
|
|
+ <TextUI v-model="item.passwordConfirm" :item="{...passwordConfirmObj}"></TextUI>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <v-btn class="mb-5 mt-3" style="width: 100%; text-align: center;" color="primary" prepend-icon="mdi-plus-box" @click="addMore">继续添加</v-btn>
|
|
|
|
+ </div>
|
|
|
|
+ </CtDialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -71,6 +95,7 @@ import { onMounted, ref, computed } from 'vue';
|
|
import { checkEmail } from '@/utils/validate'
|
|
import { checkEmail } from '@/utils/validate'
|
|
import { getBusinessLicenseOCR } from '@/api/common'
|
|
import { getBusinessLicenseOCR } from '@/api/common'
|
|
import Confirm from '@/plugins/confirm'
|
|
import Confirm from '@/plugins/confirm'
|
|
|
|
+import TextUI from '@/components/FormUI/TextInput'
|
|
|
|
|
|
const { t } = useI18n()
|
|
const { t } = useI18n()
|
|
const CtFormRef = ref()
|
|
const CtFormRef = ref()
|
|
@@ -94,16 +119,61 @@ onMounted(() => {
|
|
import { useRoute } from 'vue-router'; const route = useRoute()
|
|
import { useRoute } from 'vue-router'; const route = useRoute()
|
|
const pageType = route?.query?.type || '' // type: noLoginToRegister:->登录页注册企业
|
|
const pageType = route?.query?.type || '' // type: noLoginToRegister:->登录页注册企业
|
|
|
|
|
|
-const handleSecondConfirm = () => {
|
|
|
|
- const obj = formItems.value.options.find(e => e.key === 'passwordConfirm')
|
|
|
|
- obj.type = obj.type === 'password' ? 'text' : 'password'
|
|
|
|
- obj.appendInnerIcon = obj.type === 'password' ? 'mdi-eye-off-outline' : 'mdi-eye-outline'
|
|
|
|
|
|
+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 handlePassword = () => {
|
|
|
|
- const obj = formItems.value.options.find(e => e.key === 'password')
|
|
|
|
- obj.type = obj.type === 'password' ? 'text' : 'password'
|
|
|
|
- obj.appendInnerIcon = obj.type === 'password' ? 'mdi-eye-off-outline' : 'mdi-eye-outline'
|
|
|
|
|
|
+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)
|
|
|
|
+ })
|
|
}
|
|
}
|
|
|
|
|
|
// 注册信息保存
|
|
// 注册信息保存
|
|
@@ -116,6 +186,7 @@ const saveRegisterInfo = () => {
|
|
formItems.value.options.forEach(e => {
|
|
formItems.value.options.forEach(e => {
|
|
if (e.key) obj[e.key] = e.value
|
|
if (e.key) obj[e.key] = e.value
|
|
})
|
|
})
|
|
|
|
+ obj.contactList = contactList
|
|
localStorage.setItem('enterpriseRegisterInfo', JSON.stringify(obj))
|
|
localStorage.setItem('enterpriseRegisterInfo', JSON.stringify(obj))
|
|
}
|
|
}
|
|
|
|
|
|
@@ -160,8 +231,9 @@ const formItems = ref({
|
|
type: 'text',
|
|
type: 'text',
|
|
key: 'anotherName',
|
|
key: 'anotherName',
|
|
value: '',
|
|
value: '',
|
|
- label: '企业别名 *',
|
|
|
|
- rules: [v => !!v || '请输入企业别名']
|
|
|
|
|
|
+ label: '企业别称',
|
|
|
|
+ counter: 50,
|
|
|
|
+ blur: saveRegisterInfo
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: 'text',
|
|
type: 'text',
|
|
@@ -173,78 +245,7 @@ const formItems = ref({
|
|
blur: saveRegisterInfo
|
|
blur: saveRegisterInfo
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- type: 'text',
|
|
|
|
- key: 'contactName',
|
|
|
|
- value: '',
|
|
|
|
- label: '联系人姓名 *',
|
|
|
|
- rules: [v => !!v || '请输入联系人姓名'],
|
|
|
|
- blur: saveRegisterInfo
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- type: 'phoneNumber',
|
|
|
|
- key: 'phone',
|
|
|
|
- value: '',
|
|
|
|
- label: '联系电话 *',
|
|
|
|
- rules: [v => !!v || '请输入联系电话'],
|
|
|
|
- blur: saveRegisterInfo
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- type: 'text',
|
|
|
|
- key: 'email',
|
|
|
|
- value: email ? email : '',
|
|
|
|
- label: '企业邮箱 *(此邮箱将用于日后“登录邮箱”)',
|
|
|
|
- // label: '企业邮箱 * (此邮箱将作为企业登录的账号)',
|
|
|
|
- rules: [
|
|
|
|
- value => {
|
|
|
|
- if (value) return true
|
|
|
|
- return '请输入企业邮箱'
|
|
|
|
- },
|
|
|
|
- value => {
|
|
|
|
- if (checkEmail(value)) return true
|
|
|
|
- return '请输入正确的企业邮箱'
|
|
|
|
- }
|
|
|
|
- ],
|
|
|
|
- blur: saveRegisterInfo
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- type: 'password',
|
|
|
|
- key: 'password',
|
|
|
|
- value: '',
|
|
|
|
- appendInnerIcon: 'mdi-eye-off-outline',
|
|
|
|
- label: '账户登录密码 *',
|
|
|
|
- placeholder: '请输入账户登录密码',
|
|
|
|
- appendInnerClick: handlePassword,
|
|
|
|
- rules: [
|
|
|
|
- value => {
|
|
|
|
- if (value) return true
|
|
|
|
- return '请输入账户登录密码'
|
|
|
|
- },
|
|
|
|
- value => {
|
|
|
|
- if (/^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]).{8,16}$/.test(value)) return true
|
|
|
|
- return '请输入8-16位数由数字、大小写字母组成的密码'
|
|
|
|
- }
|
|
|
|
- ],
|
|
|
|
- blur: saveRegisterInfo
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- type: 'password',
|
|
|
|
- key: 'passwordConfirm',
|
|
|
|
- value: '',
|
|
|
|
- appendInnerIcon: 'mdi-eye-off-outline',
|
|
|
|
- label: '请再次输入账户登录密码 *',
|
|
|
|
- placeholder: '请再次输入账户登录密码',
|
|
|
|
- appendInnerClick: handleSecondConfirm,
|
|
|
|
- rules: [
|
|
|
|
- value => {
|
|
|
|
- if (value) return true
|
|
|
|
- return '请再次输入密码'
|
|
|
|
- },
|
|
|
|
- value => {
|
|
|
|
- if (value === formItems.value.options.find(e => e.key === 'password').value) return true
|
|
|
|
- return '两次输入密码不一致'
|
|
|
|
- }
|
|
|
|
- ],
|
|
|
|
- blur: saveRegisterInfo
|
|
|
|
|
|
+ slotName: 'contacts'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
type: 'textarea',
|
|
type: 'textarea',
|
|
@@ -308,6 +309,7 @@ const handleCommit = async () => {
|
|
|
|
|
|
const businessLicenseUrl = licenseUrl.value;
|
|
const businessLicenseUrl = licenseUrl.value;
|
|
if (!prepareValue.value && !businessLicenseUrl) return Snackbar.warning('请上传营业执照图片')
|
|
if (!prepareValue.value && !businessLicenseUrl) return Snackbar.warning('请上传营业执照图片')
|
|
|
|
+ if (!contactList || !contactList.length || !contactList[0].contactName) return Snackbar.warning('请添加联系人信息')
|
|
const params = {
|
|
const params = {
|
|
businessLicenseUrl,
|
|
businessLicenseUrl,
|
|
prepare: prepareValue.value,
|
|
prepare: prepareValue.value,
|
|
@@ -316,6 +318,11 @@ const handleCommit = async () => {
|
|
if (e.key) params[e.key] = e.value
|
|
if (e.key) params[e.key] = e.value
|
|
})
|
|
})
|
|
if (business.value && Object.keys(business.value).length) params.ocr = business.value
|
|
if (business.value && Object.keys(business.value).length) params.ocr = business.value
|
|
|
|
+ // 联系人
|
|
|
|
+ params.contacts = contactList
|
|
|
|
+ params.contactName = contactList[0].contactName
|
|
|
|
+ params.phone = contactList[0].phone
|
|
|
|
+ params.email = contactList[0].email
|
|
|
|
|
|
await enterpriseRegisterApply(params)
|
|
await enterpriseRegisterApply(params)
|
|
localStorage.removeItem('loginAccount')
|
|
localStorage.removeItem('loginAccount')
|
|
@@ -327,14 +334,20 @@ const handleCommit = async () => {
|
|
// 不通过的企业注册申请 重新发起
|
|
// 不通过的企业注册申请 重新发起
|
|
const failureReason = ref('')
|
|
const failureReason = ref('')
|
|
const info = JSON.parse(localStorage.getItem('userApplyInfo'))
|
|
const info = JSON.parse(localStorage.getItem('userApplyInfo'))
|
|
|
|
+console.log(1, '23456', info)
|
|
// 审核不通过的数据回显
|
|
// 审核不通过的数据回显
|
|
if (info && Object.keys(info).length && info.status === '2') {
|
|
if (info && Object.keys(info).length && info.status === '2') {
|
|
failureReason.value = info?.reason || ''
|
|
failureReason.value = info?.reason || ''
|
|
licenseUrl.value = info?.businessLicenseUrl
|
|
licenseUrl.value = info?.businessLicenseUrl
|
|
|
|
+ contactList = info?.contacts.map(e => {
|
|
|
|
+ e.passwordConfirm = e.password
|
|
|
|
+ return e
|
|
|
|
+ }) || [{ ...contactInfo }]
|
|
// prepareValue.value = info?.prepare || false
|
|
// prepareValue.value = info?.prepare || false
|
|
formItems.value.options.forEach(e => {
|
|
formItems.value.options.forEach(e => {
|
|
- if (e.key === 'passwordConfirm') e.value = info.password
|
|
|
|
- else e.value = info[e.key]
|
|
|
|
|
|
+ // if (e.key === 'passwordConfirm') e.value = info.password
|
|
|
|
+ // else e.value = info[e.key]
|
|
|
|
+ e.value = info[e.key]
|
|
})
|
|
})
|
|
isPrepareChange()
|
|
isPrepareChange()
|
|
} else {
|
|
} else {
|
|
@@ -342,6 +355,7 @@ if (info && Object.keys(info).length && info.status === '2') {
|
|
if (enterpriseRegisterInfo.value && Object.keys(enterpriseRegisterInfo.value).length) {
|
|
if (enterpriseRegisterInfo.value && Object.keys(enterpriseRegisterInfo.value).length) {
|
|
licenseUrl.value = enterpriseRegisterInfo.value.licenseUrl
|
|
licenseUrl.value = enterpriseRegisterInfo.value.licenseUrl
|
|
business.value = enterpriseRegisterInfo.value?.ocr
|
|
business.value = enterpriseRegisterInfo.value?.ocr
|
|
|
|
+ contactList = enterpriseRegisterInfo.value?.contactList || []
|
|
formItems.value.options.forEach(e => {
|
|
formItems.value.options.forEach(e => {
|
|
if (e.key === 'passwordConfirm') e.value = enterpriseRegisterInfo.value.password
|
|
if (e.key === 'passwordConfirm') e.value = enterpriseRegisterInfo.value.password
|
|
else e.value = enterpriseRegisterInfo.value[e.key]
|
|
else e.value = enterpriseRegisterInfo.value[e.key]
|
|
@@ -350,6 +364,76 @@ if (info && Object.keys(info).length && info.status === '2') {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+const contactNameObj = {
|
|
|
|
+ type: 'text',
|
|
|
|
+ key: 'contactName',
|
|
|
|
+ value: '',
|
|
|
|
+ label: '联系人姓名 *',
|
|
|
|
+ rules: [v => !!v || '请输入联系人姓名'],
|
|
|
|
+}
|
|
|
|
+const phoneObj = {
|
|
|
|
+ type: 'phoneNumber',
|
|
|
|
+ key: 'phone',
|
|
|
|
+ value: '',
|
|
|
|
+ label: '联系电话 *',
|
|
|
|
+ rules: [v => !!v || '请输入联系电话'],
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const emailObj = {
|
|
|
|
+ type: 'text',
|
|
|
|
+ key: 'email',
|
|
|
|
+ value: email ? email : '',
|
|
|
|
+ label: '企业邮箱 *(此邮箱将用于日后“登录邮箱”)',
|
|
|
|
+ // label: '企业邮箱 * (此邮箱将作为企业登录的账号)',
|
|
|
|
+ rules: [
|
|
|
|
+ value => {
|
|
|
|
+ if (value) return true
|
|
|
|
+ return '请输入企业邮箱'
|
|
|
|
+ },
|
|
|
|
+ value => {
|
|
|
|
+ if (checkEmail(value)) return true
|
|
|
|
+ return '请输入正确的企业邮箱'
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const passwordObj = {
|
|
|
|
+ type: 'password',
|
|
|
|
+ key: 'password',
|
|
|
|
+ value: '',
|
|
|
|
+ password: true,
|
|
|
|
+ appendInnerIcon: 'mdi-eye-off-outline',
|
|
|
|
+ label: '账户登录密码 *',
|
|
|
|
+ placeholder: '请输入账户登录密码',
|
|
|
|
+ // appendInnerClick: handlePassword,
|
|
|
|
+ rules: [
|
|
|
|
+ value => {
|
|
|
|
+ if (value) return true
|
|
|
|
+ return '请输入账户登录密码'
|
|
|
|
+ },
|
|
|
|
+ value => {
|
|
|
|
+ if (/^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]).{8,16}$/.test(value)) return true
|
|
|
|
+ return '请输入8-16位数由数字、大小写字母组成的密码'
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const passwordConfirmObj = {
|
|
|
|
+ type: 'password',
|
|
|
|
+ key: 'passwordConfirm',
|
|
|
|
+ value: '',
|
|
|
|
+ password: true,
|
|
|
|
+ appendInnerIcon: 'mdi-eye-off-outline',
|
|
|
|
+ label: '请再次输入账户登录密码 *',
|
|
|
|
+ placeholder: '请再次输入账户登录密码',
|
|
|
|
+ // appendInnerClick: handleSecondConfirm,
|
|
|
|
+ rules: [
|
|
|
|
+ value => {
|
|
|
|
+ if (value) return true
|
|
|
|
+ return '请再次输入密码'
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
@@ -411,4 +495,10 @@ if (info && Object.keys(info).length && info.status === '2') {
|
|
margin-bottom: 12px;
|
|
margin-bottom: 12px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+.contactItemCard {
|
|
|
|
+ background-color: var(--default-bgc);
|
|
|
|
+ border-radius: 8px;
|
|
|
|
+ padding: 16px 24px;
|
|
|
|
+ margin-bottom: 20px;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|