|
|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div class="x-content">
|
|
|
+ <div class="x-content" @click="onHideBox()">
|
|
|
<div class="container">
|
|
|
<div class="w-over-top">
|
|
|
<div class="w-over">
|
|
|
@@ -7,41 +7,45 @@
|
|
|
<hr>
|
|
|
<div class="bind-search">
|
|
|
<div class="search">
|
|
|
- <input type="search" class="form-control" placeholder="输入企业名称查询">
|
|
|
- <i class="delete"></i><i class="icon-search"></i>
|
|
|
- <ul class="list-unstyled">
|
|
|
- <li class="hit">3432432</li>
|
|
|
- <li class="hit">3432432</li>
|
|
|
- <li class="hit">3432432</li>
|
|
|
- <li class="hit">3432432</li>
|
|
|
- <li class="hit">3432432</li>
|
|
|
- <li class="hit">3432432</li>
|
|
|
+ <input type="search" class="form-control" placeholder="输入企业名称查询"
|
|
|
+ @click="onShowBox()"
|
|
|
+ v-model="keyword">
|
|
|
+ <i class="delete" @click="deleteSearch()"></i><i class="icon-search"></i>
|
|
|
+ <ul class="list-unstyled" v-show="isShowBox" @mouseenter="hasBox=true" @mouseleave="hasBox=false">
|
|
|
+ <li class="hit" v-text="keyword" @click="selectInfo(keyword)"></li>
|
|
|
+ <template v-for="item in searchName.content">
|
|
|
+ <li class="hit" @click="selectInfo(item)" v-text="item"></li>
|
|
|
+ </template>
|
|
|
</ul>
|
|
|
</div>
|
|
|
<div class="search-info">
|
|
|
- <h3 id="name"><i></i><span>企业名称</span><em>(未注册)</em></h3>
|
|
|
+ <h3 id="name"><i></i><span v-text="enterPrise">企业名称</span><em v-if="hasRegister && searchInfo.length <= 0">(未注册)</em></h3>
|
|
|
<hr/>
|
|
|
<div class="row">
|
|
|
<div class="col-xs-3"><p>管理员</p></div>
|
|
|
- <div class="col-xs-9"><span id="admin"></span></div>
|
|
|
+ <div class="col-xs-9"><span v-text="searchInfo.admin ? searchInfo.admin.vipName : ''"></span></div>
|
|
|
</div>
|
|
|
<div class="row">
|
|
|
<div class="col-xs-3"><p>企业法人</p></div>
|
|
|
- <div class="col-xs-9"><span id="corporation"></span></div>
|
|
|
+ <div class="col-xs-9"><span v-text="searchInfo.corporation"></span></div>
|
|
|
</div>
|
|
|
<div class="row">
|
|
|
<div class="col-xs-3"><p>营业执照</p></div>
|
|
|
- <div class="col-xs-9"><span id="businessCode"></span></div>
|
|
|
+ <div class="col-xs-9"><span v-text="searchInfo.businessCode"></span></div>
|
|
|
</div>
|
|
|
<div class="row">
|
|
|
<div class="col-xs-3"><p>企业地址</p></div>
|
|
|
- <div class="col-xs-9"><span id="address"></span></div>
|
|
|
+ <div class="col-xs-9"><span v-text="searchInfo.regAddress"></span></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <a name="register" href="/sso/register?appId=${appId}">立即注册</a>
|
|
|
- <a name="apply" href="javascript:void(0)">申请绑定</a>
|
|
|
- <p id="applyText">管理员审核通过后成功绑定</p>
|
|
|
+ <template v-if="hasRegister && !searchInfo">
|
|
|
+ <a name="register" href="/sso/register">立即注册</a>
|
|
|
+ </template>
|
|
|
+ <template v-if="hasRegister && searchInfo && !searchInfo.admin">
|
|
|
+ <a href="javascript:void(0)" @click="bingEnterPrise()">申请绑定</a>
|
|
|
+ <p id="applyText">管理员审核通过后成功绑定</p>
|
|
|
+ </template>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -50,7 +54,92 @@
|
|
|
|
|
|
<script>
|
|
|
export default {
|
|
|
- layout: 'main'
|
|
|
+ layout: 'main',
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ keyword: '',
|
|
|
+ number: 5,
|
|
|
+ isShowBox: false,
|
|
|
+ hasBox: false,
|
|
|
+ clickInput: false,
|
|
|
+ enterPrise: '企业名称',
|
|
|
+ hasRegister: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ 'keyword': function () {
|
|
|
+ this.handleChange()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ this.$store.dispatch('restForName')
|
|
|
+ this.$store.dispatch('restForInfo')
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ searchName () {
|
|
|
+ return this.$store.state.search.keywords.data.content ? this.$store.state.search.keywords.data.content : ''
|
|
|
+ },
|
|
|
+ searchInfo () {
|
|
|
+ return this.$store.state.search.enterprise.data.content ? this.$store.state.search.enterprise.data.content : ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ handleChange: function () {
|
|
|
+ if (this.keyword) {
|
|
|
+ this.isShowBox = true
|
|
|
+ this.$store.dispatch('searchForName', {keyword: this.keyword, number: this.number})
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onShowBox: function () {
|
|
|
+ if (this.isShowBox) {
|
|
|
+ this.onHideBox()
|
|
|
+ } else {
|
|
|
+ this.isShowBox = true
|
|
|
+ this.clickInput = true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onHideBox: function () {
|
|
|
+ if (!this.hasBox && !this.clickInput) {
|
|
|
+ this.isShowBox = false
|
|
|
+ } else {
|
|
|
+ this.clickInput = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ selectInfo: function (item) {
|
|
|
+ this.isShowBox = false
|
|
|
+ this.enterPrise = item
|
|
|
+ this.hasRegister = true
|
|
|
+ this.$store.dispatch('searchForInfo', { name: item })
|
|
|
+ this.$store.dispatch('restForName')
|
|
|
+ },
|
|
|
+ deleteSearch: function () {
|
|
|
+ this.keyword = ''
|
|
|
+ this.enterPrise = '企业名称'
|
|
|
+ this.hasRegister = false
|
|
|
+ this.$store.dispatch('restForName')
|
|
|
+ this.$store.dispatch('restForInfo')
|
|
|
+ },
|
|
|
+ bingEnterPrise: function () {
|
|
|
+ let param = new FormData()
|
|
|
+ param.append('userUU', this.$route.params.uuid)
|
|
|
+ param.append('spaceUU', this.searchInfo.spaceUU)
|
|
|
+ let config = {
|
|
|
+ headers: {'Context-type': 'multipart/form-data'}
|
|
|
+ }
|
|
|
+ this.$http.post('/api/user/apply/bind', param, config)
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.success) {
|
|
|
+ this.$message({
|
|
|
+ message: '您成功绑定企业',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (res.data.error) {
|
|
|
+ this.$message.error(res.data.errMsg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
@@ -225,9 +314,8 @@
|
|
|
background: url('/img/over_account/search.png')no-repeat;
|
|
|
}
|
|
|
.w-over-top .bind-search .search ul{
|
|
|
- display:none;
|
|
|
position:absolute;
|
|
|
- top:34px;
|
|
|
+ top:100%;
|
|
|
left:0;
|
|
|
z-index:100;
|
|
|
width:100%;
|