| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288 |
- <template>
- <div class="component-table">
- <!-- 筛选结果展示 -->
- <div class="search-record">
- 筛选后现为您找到以下<span class="red">{{componentGoods.totalElements}}</span>个结果
- </div>
- <!-- 列表展示 -->
- <table class="product-list">
- <thead>
- <tr style="height: 40px;">
- <th width="80"></th>
- <th width="160">品牌/型号</th>
- <th width="100">包装/生产日期</th>
- <th width="110">库存</th>
- <th width="90">数量</th>
- <th width="90">香港交货<span style="font-size: 12px;">($)</span></th>
- <th width="100">大陆交货<span style="font-size: 12px;">(¥)</span></th>
- <th width="100">交期(天)</th>
- <th width="100">操作</th>
- </tr>
- </thead>
- <tbody id="productList-content">
- <!--| orderBy : dir + orderType ng-class="{'tr-even' : !compGoods.isOdd}"-->
- <tr v-for="compGoods in componentGoods.content">
- <td>
- <!--store/{{compGoods.storeId}}#/batchInfo/{{compGoods.batchCode}}-->
- <nuxt-link v-if="compGoods.batchCode" :to="`/product/component/${compGoods.uuid}`">
- <img :src="compGoods.img || '/images/all/default.png'"/>
- </nuxt-link>
- <img v-if="!compGoods.batchCode" :src="compGoods.img || '/images/all/default.png'"/>
- <!--store/{{compGoods.storeId}}#/home-->
- <nuxt-link :to="'/store/' + compGoods.storeId" class="contact" :title="compGoods.storeName">{{compGoods.storeName}}</nuxt-link>
- </td>
- <td class="brand-code">
- <div class="brand"><nuxt-link :to="`/product/brand/${compGoods.brand.uuid}/`" title="compGoods.brand.nameEn">{{compGoods.brand.nameEn}}</nuxt-link></div>
- <div class="code"><nuxt-link :to="`/product/component/${compGoods.uuid}/`" :title="compGoods.code">{{compGoods.code}}</nuxt-link></div>
- </td>
- <td>
- <div class="package">{{compGoods.packaging || '暂无包装方式信息'}}</div>
- <div class="date">{{compGoods.produceDate || '-'}}</div>
- </td>
- <td class="text-left">
- <div class="goods">
- 库存:<span>{{compGoods.reserve || '暂无库存'}}</span>
- </div>
- <div class="from" v-if="compGoods.reserve > 0">
- 起拍:<span>{{compGoods.minBuyQty}}</span>
- </div>
- <div class="multiple" v-if="compGoods.reserve > 0">
- 倍数:<span>{{compGoods.minPackQty}}</span>
- </div>
- </td>
- <td>
- <div v-if="!compGoods.prices">
- <span>—</span>
- </div>
- <div v-for="price in compGoods.prices">
- <!--| number-->
- <span>{{price.start}}</span> +
- </div>
- </td>
- <td>
- <div v-if="(compGoods.currencyName && compGoods.currencyName.indexOf('USD')==-1) || !compGoods.prices">
- <span>—</span>
- </div>
- <div v-for="price in compGoods.prices">
- <!--| formateNumber : 6-->
- <span>{{price.uSDPrice}}</span>
- </div>
- </td>
- <td>
- <div v-if="(compGoods.currencyName && compGoods.currencyName.indexOf('RMB')==-1) || !compGoods.prices">
- <span>—</span>
- </div>
- <div v-for="price in compGoods.prices">
- <!--formateNumber : 6-->
- <span>{{price.rMBPrice}}</span>
- </div>
- </td>
- <td>
- <div v-if="!compGoods.b2cMinDelivery">
- <span>—</span>
- </div>
- <div v-if="compGoods.b2cMinDelivery">交期:<span v-if="compGoods.b2cMinDelivery != compGoods.b2cMaxDelivery">{{compGoods.b2cMinDelivery + '-' + compGoods.b2cMaxDelivery}}</span>
- <span v-if="compGoods.b2cMinDelivery == compGoods.b2cMaxDelivery">{{compGoods.b2cMinDelivery}}</span>
- </div>
- </td>
- <td>
- <div v-if="!compGoods.reserve">
- <span>—</span>
- </div>
- <buy :item="compGoods"></buy>
- </td>
- </tr>
- <tr v-if="componentGoods.totalElements == 0">
- <td colspan="10" class="text-center" style="line-height: 40px; font-size: 20px;">
- <i class="fa fa-smile-o fa-lg"></i> 暂无产品信息
- </td>
- </tr>
- </tbody>
- </table>
- <div style="float: right; margin-bottom: 15px;">
- <el-pagination
- :current-page.sync="pageParams.page"
- :page-size="pageParams.count"
- layout="prev, pager, next, jumper"
- :total="componentGoods.totalElements"
- @current-change="handleCurrentChange">
- </el-pagination>
- </div>
- </div>
- </template>
- <script>
- import Buy from '~components/common/buyOrCar/buyComponent.vue'
- export default {
- layout: 'mian',
- props: ['brandid', 'propertyJSON'],
- components: {
- Buy
- },
- data () {
- return {
- pageParams: {
- page: 1,
- count: 10,
- filter: {
- kindid: this.$route.params.id,
- brandid: this.brandid,
- propertyJSON: this.propertyJSON
- }
- }
- }
- },
- computed: {
- componentGoods () {
- let goodsPage = this.$store.state.product.component.componentGoods.data
- this.pageParams.page = goodsPage.number
- return goodsPage
- }
- },
- methods: {
- addToCart: function (goods, buyNow) {
- return null
- },
- handlerCurrentNode (data, node) {
- console.log(this.pageParams)
- this.pageParams.page = 1
- this.pageCmpGoods(this.pageParams)
- },
- async pageCmpGoods (pageParams) {
- let params = {}
- params.filter = { kindid: pageParams.filter.kindid }
- if (pageParams.filter.brandid && pageParams.filter.brandid !== '') {
- params.filter.brandid = pageParams.filter.brandid
- }
- if (pageParams.filter.propertyJSON !== null && Object.getOwnPropertyNames(pageParams.filter.propertyJSON).length > 3) {
- params.filter.properties = pageParams.filter.propertyJSON
- }
- params.page = pageParams.page
- params.count = pageParams.count
- let { data } = await this.$http.get('/api/product/product/getCompGoodsByKindid', { params })
- this.$store.commit('product/component/GET_CMPGOODS_SUCCESS', data)
- },
- handleCurrentChange (page) {
- this.pageParams.page = page
- this.pageParams.filter.brandid = this.brandid
- this.pageParams.filter.propertyJSON = this.propertyJSON
- console.log(this.pageParams)
- this.pageCmpGoods(this.pageParams)
- }
- }
- }
- </script>
- <style scoped>
- @import "~element-ui/lib/theme-default/index.css";
- .product-list{
- width: 1190px;
- margin-bottom: 20px;
- }
- .product-list thead tr{
- border-top: #6493ff 2px solid;
- color: #323232;
- background: none;
- }
- /* 物品列表 */
- .product-list .brand-code {
- font-size: 14px;
- text-align: center;
- }
- .product-list .brand-code .code {
- font-weight: 600;
- }
- .product-list th {
- color: rgb(50,50,50);
- font-size: 14px;
- font-weight: 600;
- background-color: #f7f7f7;
- text-align: center;
- }
- .product-list tbody>tr {
- border: 1px solid #e8e8e8;
- }
- .product-list tbody>tr img {
- border: 1px solid #e8e8e8;
- margin: 10px 0 5px 0;
- width: 36px;
- height: 36px;
- }
- .product-list tbody>tr .contact{
- font-size: 14px;
- color: #5078cb;
- width: 90%;
- margin: 0 auto;
- display: inline-block;
- }
- .product-list tbody>tr .contact:hover{
- color: #d32526;
- }
- .product-list td {
- font-size: 12px;
- color: #333;
- text-align: center;
- line-height: 20px;
- }
- /* 物品列表按钮 */
- .product-list .btn-buy-now {
- background-color: #5078CB;
- color: #fff;
- width: 80px;
- height: 30px;
- font-size: 12px;
- border: 1px solid #5078cb;
- }
- .product-list .btn-add-cart {
- margin-top: 10px;
- color: #214797;
- width: 80px;
- height: 30px;
- font-size: 12px;
- background-color: #fff;
- border: 1px solid #e8e8e8;
- }
- .product-list .btn-buy-now:hover{
- background: #214797;
- }
- .product-list .btn-add-cart:hover{
- background-color: #5078CB;
- color: #fff;
- }
- .product-list .text-left{
- text-align: left;
- }
- .product-list .text-left div{
- margin-left: 30px;
- }
- .product-list tbody tr td{
- padding: 10px 0;
- }
- .search-record{
- width: 100%;
- margin: 0 auto;
- height: 40px;
- font-size: 16px;
- line-height: 40px;
- margin-top: 20px;
- }
- .search-record span.red{
- color: #ff0909;
- }
- .el-pagination .el-pager li.active{
- background-color: #5078cb;
- border-color: #337ab7;
- }
- <!-- 分页 -->
- .el-pagination .el-pager li.active {
- border-color: #5078cb !important;
- background-color: #5078cb !important;
- }
- </style>
|