|
|
@@ -1,14 +1,15 @@
|
|
|
<template>
|
|
|
<div class="component-list container">
|
|
|
- <div class="type-list">型号列表</div>
|
|
|
- <div class="input-group">
|
|
|
+ <div :class="activeTab == 0 ? 'type-list active' : 'type-list'" @click="activeTab = 0">型号列表</div>
|
|
|
+ <div :class="activeTab == 1 ? 'type-list active' : 'type-list'" @click="activeTab = 1">代理商</div>
|
|
|
+ <div class="input-group" v-if="activeTab == 0">
|
|
|
<input type="search" class="input-sm form-control" placeholder="请输入型号" title="code"
|
|
|
v-model="searchCode" @search="goodsSearch(searchCode)"/>
|
|
|
<span class="input-group-btn">
|
|
|
<button class="search btn btn-default" type="button" @click="goodsSearch(searchCode)">搜索器件</button>
|
|
|
</span>
|
|
|
</div>
|
|
|
- <table class="table">
|
|
|
+ <table class="table" v-if="activeTab == 0">
|
|
|
<thead>
|
|
|
<tr class="bgf7">
|
|
|
<th width="500">型号</th>
|
|
|
@@ -39,10 +40,63 @@
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
- <div style="float: right;">
|
|
|
+ <div style="float: right;" v-if="activeTab == 0">
|
|
|
<page :total="list.totalElements" :page-size="pageParams.count"
|
|
|
:current="pageParams.page" @childEvent="handleCurrentChange"></page>
|
|
|
</div>
|
|
|
+ <table class="table supper-table" v-if="activeTab == 1">
|
|
|
+ <thead>
|
|
|
+ <tr class="bgf7">
|
|
|
+ <th width="100"></th>
|
|
|
+ <th width="200">代理商</th>
|
|
|
+ <th width="200">地址</th>
|
|
|
+ <th width="110">电话</th>
|
|
|
+ <th width="110">传真</th>
|
|
|
+ <th width="110">邮箱</th>
|
|
|
+ <th width="120">网址</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ <tr class="text-center" v-for="item in supplier.content">
|
|
|
+ <td v-if="item.storeuuid">
|
|
|
+ <a class='add-link' :href="'/store/' + item.storeuuid">
|
|
|
+ <img :src="item.img || '/images/store/common/default.png'" alt="" class="showImg">
|
|
|
+ <img src="/images/store/common/goIn.png" alt="" class="goIn">
|
|
|
+ </a>
|
|
|
+ </td>
|
|
|
+ <td v-if="!item.storeuuid"><img :src="item.img || '/images/store/common/default.png'" alt="" class="showImg"></td>
|
|
|
+ <td :title='item.vendorName' v-if="item.storeuuid"><a class='add-link' :href="'/store/' + item.storeuuid">{{item.vendorName || '-'}}</a></td>
|
|
|
+ <td :title='item.vendorName' v-if="!item.storeuuid">{{item.vendorName || '-'}}</td>
|
|
|
+ <td :title='item.detailAddress' v-if="item.storeuuid"><a class='add-link' :href="'/store/' + item.storeuuid">{{item.detailAddress || '-'}}</a></td>
|
|
|
+ <td :title='item.detailAddress' v-if="!item.storeuuid">{{item.detailAddress || '-'}}</td>
|
|
|
+ <td :title='item.tel' v-if="item.storeuuid"><a class='add-link' :href="'/store/' + item.storeuuid">{{item.tel || '-'}}</a></td>
|
|
|
+ <td :title='item.tel' v-if="!item.storeuuid">{{item.tel || '-'}}</td>
|
|
|
+ <td :title='item.fax' v-if="item.storeuuid"><a class='add-link' :href="'/store/' + item.storeuuid">{{item.fax || '-'}}</a></td>
|
|
|
+ <td :title='item.fax' v-if="!item.storeuuid">{{item.fax || '-'}}</td>
|
|
|
+ <td :title='item.email' v-if="item.storeuuid"><a class='add-link' :href="'/store/' + item.storeuuid">{{item.email || '-'}}</a></td>
|
|
|
+ <td :title='item.email' v-if="!item.storeuuid">{{item.email || '-'}}</td>
|
|
|
+ <td :title='item.website' v-if="item.storeuuid"><a class='add-link' :href="'/store/' + item.storeuuid">{{item.website || '-'}}</a></td>
|
|
|
+ <td :title='item.website' v-if="!item.storeuuid">{{item.website || '-'}}</td>
|
|
|
+ </tr>
|
|
|
+ <tr v-if="!supplier.content || supplier.content.length === 0">
|
|
|
+ <td colspan="10" class="text-center">
|
|
|
+ <div class="empty">
|
|
|
+ <div class="empty-img">
|
|
|
+ <img src="/images/brandList/empty-cart.png">
|
|
|
+ </div>
|
|
|
+ <div class="empty-info">
|
|
|
+ <p class="grey f16"> 暂无供应商信息 </p>
|
|
|
+ <i class="fa fa-mail-reply fa-xs"></i> <a href="javascript:history.go(-1)">返回上一页</a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ <div style="float: right;" v-if="activeTab == 1">
|
|
|
+ <page :total="supplier.totalElements" :page-size="supplierPageParams.size"
|
|
|
+ :current="supplierPageParams.page" @childEvent="handleChange"></page>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
@@ -56,7 +110,13 @@
|
|
|
count: 10,
|
|
|
filter: {}
|
|
|
},
|
|
|
- searchCode: ''
|
|
|
+ supplierPageParams: {
|
|
|
+ page: 1,
|
|
|
+ size: 5,
|
|
|
+ sort: {'updatetime': 'DESC'}
|
|
|
+ },
|
|
|
+ searchCode: '',
|
|
|
+ activeTab: 0
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
|
@@ -71,6 +131,9 @@
|
|
|
},
|
|
|
brand () {
|
|
|
return this.$store.state.brandDetail.detail.data
|
|
|
+ },
|
|
|
+ supplier () {
|
|
|
+ return this.$store.state.product.supplierInformation.information.data
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -98,6 +161,19 @@
|
|
|
this.pageParams.filter.brandid = this.brand.id
|
|
|
this.pageCmpGoods(this.pageParams)
|
|
|
},
|
|
|
+// 获取供应商分页
|
|
|
+ async pageSupplier (params) {
|
|
|
+ let uuid = this.$route.params.code
|
|
|
+ let { data } = await this.$http.get(`/api/produce/vendorlist/${uuid}`, { params })
|
|
|
+ this.$store.commit('product/supplierInformation/GET_INFORMATION_SUCCESS', data)
|
|
|
+ },
|
|
|
+ handleChange (page) {
|
|
|
+ this.supplierPageParams.page = page
|
|
|
+ this.pageSupplier(this.supplierPageParams)
|
|
|
+ },
|
|
|
+ listenChild: function (brand) {
|
|
|
+ this.$store.dispatch('loadBrandPages', {count: 10, filter: { brandid: brand.id }, page: brand.page})
|
|
|
+ },
|
|
|
toAttach: function (url) {
|
|
|
if (url === '1') {
|
|
|
this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
|
|
|
@@ -126,12 +202,17 @@
|
|
|
height: 34px;
|
|
|
width: 150px;
|
|
|
border: 1px solid #5078cb;
|
|
|
- background-color: #5078CB;
|
|
|
+ /*background-color: #5078CB;*/
|
|
|
float: left;
|
|
|
- color: #fff;
|
|
|
+ color: #5078cb;
|
|
|
line-height: 34px;
|
|
|
text-align: center;
|
|
|
font-size: 14px;
|
|
|
+ cursor: pointer ;
|
|
|
+ }
|
|
|
+ .component-list .type-list.active{
|
|
|
+ background-color: #5078CB;
|
|
|
+ color: #fff;
|
|
|
}
|
|
|
.component-list .input-group {
|
|
|
width: 300px;
|
|
|
@@ -169,6 +250,12 @@
|
|
|
color: #337ab7;
|
|
|
font-size: 12px;
|
|
|
}
|
|
|
+ .component-list table tbody tr td a.add-link {
|
|
|
+ width: 100%;
|
|
|
+ color: #474443;
|
|
|
+ font-size: 14px;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
.component-list .btn-default {
|
|
|
color: #214797;
|
|
|
font-size: 12px;
|
|
|
@@ -219,4 +306,33 @@
|
|
|
font-size: 14px;
|
|
|
color: #5078cb;
|
|
|
}
|
|
|
+ .component-list .supper-table thead th.text-left{
|
|
|
+ text-align: left;
|
|
|
+ }
|
|
|
+ .component-list .supper-table tbody tr{
|
|
|
+ height: 74px;
|
|
|
+ vertical-align:middle ;
|
|
|
+ }
|
|
|
+ .component-list .supper-table tbody tr:hover{
|
|
|
+ background: #eee;
|
|
|
+ }
|
|
|
+ .component-list .supper-table tbody tr td{
|
|
|
+ position: relative;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
+ max-width: 100px;
|
|
|
+ }
|
|
|
+ .component-list .supper-table tbody tr img.showImg{
|
|
|
+ width: 90px;
|
|
|
+ height: 49px;
|
|
|
+ border: 1px solid #dcdcdc;
|
|
|
+ }
|
|
|
+ .component-list .supper-table tbody tr img.goIn {
|
|
|
+ position: absolute;
|
|
|
+ top: 13px;
|
|
|
+ right: 3px;
|
|
|
+ width: 35px;
|
|
|
+ height: 35px;
|
|
|
+ }
|
|
|
</style>
|