|
|
@@ -4,7 +4,17 @@
|
|
|
<img src="/images/component/default.png"/>
|
|
|
<div class="user-info">
|
|
|
<p v-text="userInfo.data.userName"></p>
|
|
|
- <p v-text="enterpriseInfo.enName"></p>
|
|
|
+ <p>{{enterpriseInfo.enName}}<a @click="setShowEnterpriseToggle(!showEnterpriseToggle, $event)">切换</a></p>
|
|
|
+ <ul class="en-list" v-show="showEnterpriseToggle">
|
|
|
+ <li class="menu-item"
|
|
|
+ v-for="en in sortEnterprises"
|
|
|
+ v-if="en.uu != enterpriseInfo.uu">
|
|
|
+ <a @click="switchEnterprise(en)">{{ en.enName }}</a>
|
|
|
+ </li>
|
|
|
+ <li class="menu-item" v-if="enterpriseInfo.uu">
|
|
|
+ <a @click="switchEnterprise({uu: 0})"><span v-text="userInfo.data.userName"></span>(个人账户)</a>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
</div>
|
|
|
<a v-if="isVendor" v-text="userType === 'saler' ? '切换至买家中心' : '切换至卖家中心'" @click="switchType"></a>
|
|
|
</div>
|
|
|
@@ -22,7 +32,7 @@
|
|
|
</ul>
|
|
|
</div>
|
|
|
<ul class="switch-list vendor-switch" v-if="userType === 'saler'">
|
|
|
- <li :class="{active: seekType == 'wait'}" @click="switchSeek('wait')"><div>待报价</div></li>
|
|
|
+ <li :class="{active: seekType == 'wait'}" @click="switchSeek('wait')"><div>全部</div></li>
|
|
|
<li :class="{active: seekType == 'done'}" @click="switchSeek('done')"><div>已报价</div></li>
|
|
|
</ul>
|
|
|
<div class="search-content">
|
|
|
@@ -107,7 +117,8 @@
|
|
|
seekPage: 1,
|
|
|
seekSize: 10,
|
|
|
purchaseManListData: [],
|
|
|
- isDataChange: false
|
|
|
+ isDataChange: false,
|
|
|
+ showEnterpriseToggle: false
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
|
@@ -126,9 +137,25 @@
|
|
|
mounted: function () {
|
|
|
this.$nextTick(() => {
|
|
|
window.addEventListener('scroll', this.scroll, false)
|
|
|
+ document.body.addEventListener('click', () => {
|
|
|
+ this.setShowEnterpriseToggle(false)
|
|
|
+ }, false)
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 切换当前企业
|
|
|
+ switchEnterprise (en) {
|
|
|
+ this.showEnterpriseToggle = false
|
|
|
+ this.$http.get(`/user/authentication/${en.uu}`).then(() => {
|
|
|
+ this.$store.dispatch('loadUserInfo')
|
|
|
+ })
|
|
|
+ },
|
|
|
+ setShowEnterpriseToggle (flag, e) {
|
|
|
+ if (e) {
|
|
|
+ e.stopPropagation()
|
|
|
+ }
|
|
|
+ this.showEnterpriseToggle = flag
|
|
|
+ },
|
|
|
cancelFocus: function (type, item, event) {
|
|
|
event.stopPropagation()
|
|
|
if (type === 'store') {
|
|
|
@@ -248,6 +275,15 @@
|
|
|
}
|
|
|
return {enName: this.userInfo.data.userName + '(个人账户)'}
|
|
|
},
|
|
|
+ sortEnterprises () {
|
|
|
+ let ens = this.userInfo.data.enterprises
|
|
|
+ if (ens && ens.length) {
|
|
|
+ ens.sort(function (a, b) {
|
|
|
+ return b.lastLoginTime - a.lastLoginTime
|
|
|
+ })
|
|
|
+ }
|
|
|
+ return ens
|
|
|
+ },
|
|
|
isVendor () {
|
|
|
return this.enterpriseInfo.isVendor === 313
|
|
|
},
|
|
|
@@ -335,6 +371,7 @@
|
|
|
margin-left:.25rem;
|
|
|
display: inline-block;
|
|
|
vertical-align: middle;
|
|
|
+ position: relative;
|
|
|
p{
|
|
|
font-size:.3rem;
|
|
|
margin:0;
|
|
|
@@ -342,11 +379,41 @@
|
|
|
overflow: hidden;
|
|
|
text-overflow: ellipsis;
|
|
|
white-space: nowrap;
|
|
|
- width: 3.92rem;
|
|
|
+ max-width: 3.92rem;
|
|
|
&:nth-child(2) {
|
|
|
+ position: relative;
|
|
|
margin-top: .2rem;
|
|
|
+ padding-right: .7rem;
|
|
|
+ a {
|
|
|
+ position: absolute;
|
|
|
+ right: 0;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ .en-list {
|
|
|
+ position: absolute;
|
|
|
+ max-width: 8rem;
|
|
|
+ max-height: 3rem;
|
|
|
+ overflow-y: auto;
|
|
|
+ border-radius: .05rem;
|
|
|
+ .menu-item {
|
|
|
+ height: .6rem;
|
|
|
+ line-height: .6rem;
|
|
|
+ font-size: .3rem;
|
|
|
+ padding: 0 .2rem;
|
|
|
+ overflow: hidden;
|
|
|
+ white-space: nowrap;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ background: rgba(0, 0, 0, .4);
|
|
|
+ &:active, &:focus, &:hover {
|
|
|
+ background: #7d7d7d;
|
|
|
+ }
|
|
|
+ a {
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
> a {
|
|
|
font-size: .24rem;
|