ComponentGoods.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. <template>
  2. <div class="component-table">
  3. <!-- 筛选结果展示 -->
  4. <div class="search-record">
  5. 筛选后现为您找到以下<span class="red">{{componentGoods.totalElements}}</span>个结果
  6. </div>
  7. <!-- 列表展示 -->
  8. <table class="product-list">
  9. <thead>
  10. <tr style="height: 40px;">
  11. <th width="80"></th>
  12. <th width="160">品牌/型号</th>
  13. <th width="100">包装/生产日期</th>
  14. <th width="110">库存</th>
  15. <th width="90">数量</th>
  16. <th width="90">香港交货<span style="font-size: 12px;">($)</span></th>
  17. <th width="100">大陆交货<span style="font-size: 12px;">(¥)</span></th>
  18. <th width="100">交期(天)</th>
  19. <th width="100">操作</th>
  20. </tr>
  21. </thead>
  22. <tbody id="productList-content">
  23. <!--| orderBy : dir + orderType ng-class="{'tr-even' : !compGoods.isOdd}"-->
  24. <tr v-for="compGoods in componentGoods.content">
  25. <td>
  26. <!--store/{{compGoods.storeId}}#/batchInfo/{{compGoods.batchCode}}-->
  27. <nuxt-link v-if="compGoods.batchCode" :to="`/product/component/${compGoods.uuid}`">
  28. <img :src="compGoods.img || '/images/all/default.png'"/>
  29. </nuxt-link>
  30. <img v-if="!compGoods.batchCode" :src="compGoods.img || '/images/all/default.png'"/>
  31. <!--store/{{compGoods.storeId}}#/home-->
  32. <nuxt-link :to="'/store/' + compGoods.storeId" class="contact" :title="compGoods.storeName">{{compGoods.storeName}}</nuxt-link>
  33. </td>
  34. <td class="brand-code">
  35. <div class="brand"><nuxt-link :to="`/product/brand/${compGoods.brand.uuid}/`" title="compGoods.brand.nameEn">{{compGoods.brand.nameEn}}</nuxt-link></div>
  36. <div class="code"><nuxt-link :to="`/product/component/${compGoods.uuid}/`" :title="compGoods.code">{{compGoods.code}}</nuxt-link></div>
  37. </td>
  38. <td>
  39. <div class="package">{{compGoods.packaging || '暂无包装方式信息'}}</div>
  40. <div class="date">{{compGoods.produceDate || '-'}}</div>
  41. </td>
  42. <td class="text-left">
  43. <div class="goods">
  44. 库存:<span>{{compGoods.reserve || '暂无库存'}}</span>
  45. </div>
  46. <div class="from" v-if="compGoods.reserve > 0">
  47. 起拍:<span>{{compGoods.minBuyQty}}</span>
  48. </div>
  49. <div class="multiple" v-if="compGoods.reserve > 0">
  50. 倍数:<span>{{compGoods.minPackQty}}</span>
  51. </div>
  52. </td>
  53. <td>
  54. <div v-if="!compGoods.prices">
  55. <span>—</span>
  56. </div>
  57. <div v-for="price in compGoods.prices">
  58. <!--| number-->
  59. <span>{{price.start}}</span> +
  60. </div>
  61. </td>
  62. <td>
  63. <div v-if="(compGoods.currencyName && compGoods.currencyName.indexOf('USD')==-1) || !compGoods.prices">
  64. <span>—</span>
  65. </div>
  66. <div v-for="price in compGoods.prices">
  67. <!--| formateNumber : 6-->
  68. <span>{{price.uSDPrice}}</span>
  69. </div>
  70. </td>
  71. <td>
  72. <div v-if="(compGoods.currencyName && compGoods.currencyName.indexOf('RMB')==-1) || !compGoods.prices">
  73. <span>—</span>
  74. </div>
  75. <div v-for="price in compGoods.prices">
  76. <!--formateNumber : 6-->
  77. <span>{{price.rMBPrice}}</span>
  78. </div>
  79. </td>
  80. <td>
  81. <div v-if="!compGoods.b2cMinDelivery">
  82. <span>—</span>
  83. </div>
  84. <div v-if="compGoods.b2cMinDelivery">交期:<span v-if="compGoods.b2cMinDelivery != compGoods.b2cMaxDelivery">{{compGoods.b2cMinDelivery + '-' + compGoods.b2cMaxDelivery}}</span>
  85. <span v-if="compGoods.b2cMinDelivery == compGoods.b2cMaxDelivery">{{compGoods.b2cMinDelivery}}</span>
  86. </div>
  87. </td>
  88. <td>
  89. <div v-if="!compGoods.reserve">
  90. <span>—</span>
  91. </div>
  92. <buy :item="compGoods"></buy>
  93. </td>
  94. </tr>
  95. <tr v-if="componentGoods.totalElements == 0">
  96. <td colspan="10" class="text-center" style="line-height: 40px; font-size: 20px;">
  97. <i class="fa fa-smile-o fa-lg"></i> 暂无产品信息
  98. </td>
  99. </tr>
  100. </tbody>
  101. </table>
  102. <div style="float: right; margin-bottom: 15px;">
  103. <el-pagination
  104. :current-page.sync="pageParams.page"
  105. :page-size="pageParams.count"
  106. layout="prev, pager, next, jumper"
  107. :total="componentGoods.totalElements"
  108. @current-change="handleCurrentChange">
  109. </el-pagination>
  110. </div>
  111. </div>
  112. </template>
  113. <script>
  114. import Buy from '~components/common/buyOrCar/buyComponent.vue'
  115. export default {
  116. layout: 'mian',
  117. props: ['brandid', 'propertyJSON'],
  118. components: {
  119. Buy
  120. },
  121. data () {
  122. return {
  123. pageParams: {
  124. page: 1,
  125. count: 10,
  126. filter: {
  127. kindid: this.$route.params.id,
  128. brandid: this.brandid,
  129. propertyJSON: this.propertyJSON
  130. }
  131. }
  132. }
  133. },
  134. computed: {
  135. componentGoods () {
  136. let goodsPage = this.$store.state.product.component.componentGoods.data
  137. this.pageParams.page = goodsPage.number
  138. return goodsPage
  139. }
  140. },
  141. methods: {
  142. addToCart: function (goods, buyNow) {
  143. return null
  144. },
  145. handlerCurrentNode (data, node) {
  146. console.log(this.pageParams)
  147. this.pageParams.page = 1
  148. this.pageCmpGoods(this.pageParams)
  149. },
  150. async pageCmpGoods (pageParams) {
  151. let params = {}
  152. params.filter = { kindid: pageParams.filter.kindid }
  153. if (pageParams.filter.brandid && pageParams.filter.brandid !== '') {
  154. params.filter.brandid = pageParams.filter.brandid
  155. }
  156. if (pageParams.filter.propertyJSON !== null && Object.getOwnPropertyNames(pageParams.filter.propertyJSON).length > 3) {
  157. params.filter.properties = pageParams.filter.propertyJSON
  158. }
  159. params.page = pageParams.page
  160. params.count = pageParams.count
  161. let { data } = await this.$http.get('/api/product/product/getCompGoodsByKindid', { params })
  162. this.$store.commit('product/component/GET_CMPGOODS_SUCCESS', data)
  163. },
  164. handleCurrentChange (page) {
  165. this.pageParams.page = page
  166. this.pageParams.filter.brandid = this.brandid
  167. this.pageParams.filter.propertyJSON = this.propertyJSON
  168. console.log(this.pageParams)
  169. this.pageCmpGoods(this.pageParams)
  170. }
  171. }
  172. }
  173. </script>
  174. <style scoped>
  175. @import "~element-ui/lib/theme-default/index.css";
  176. .product-list{
  177. width: 1190px;
  178. margin-bottom: 20px;
  179. }
  180. .product-list thead tr{
  181. border-top: #6493ff 2px solid;
  182. color: #323232;
  183. background: none;
  184. }
  185. /* 物品列表 */
  186. .product-list .brand-code {
  187. font-size: 14px;
  188. text-align: center;
  189. }
  190. .product-list .brand-code .code {
  191. font-weight: 600;
  192. }
  193. .product-list th {
  194. color: rgb(50,50,50);
  195. font-size: 14px;
  196. font-weight: 600;
  197. background-color: #f7f7f7;
  198. text-align: center;
  199. }
  200. .product-list tbody>tr {
  201. border: 1px solid #e8e8e8;
  202. }
  203. .product-list tbody>tr img {
  204. border: 1px solid #e8e8e8;
  205. margin: 10px 0 5px 0;
  206. width: 36px;
  207. height: 36px;
  208. }
  209. .product-list tbody>tr .contact{
  210. font-size: 14px;
  211. color: #5078cb;
  212. width: 90%;
  213. margin: 0 auto;
  214. display: inline-block;
  215. }
  216. .product-list tbody>tr .contact:hover{
  217. color: #d32526;
  218. }
  219. .product-list td {
  220. font-size: 12px;
  221. color: #333;
  222. text-align: center;
  223. line-height: 20px;
  224. }
  225. /* 物品列表按钮 */
  226. .product-list .btn-buy-now {
  227. background-color: #5078CB;
  228. color: #fff;
  229. width: 80px;
  230. height: 30px;
  231. font-size: 12px;
  232. border: 1px solid #5078cb;
  233. }
  234. .product-list .btn-add-cart {
  235. margin-top: 10px;
  236. color: #214797;
  237. width: 80px;
  238. height: 30px;
  239. font-size: 12px;
  240. background-color: #fff;
  241. border: 1px solid #e8e8e8;
  242. }
  243. .product-list .btn-buy-now:hover{
  244. background: #214797;
  245. }
  246. .product-list .btn-add-cart:hover{
  247. background-color: #5078CB;
  248. color: #fff;
  249. }
  250. .product-list .text-left{
  251. text-align: left;
  252. }
  253. .product-list .text-left div{
  254. margin-left: 30px;
  255. }
  256. .product-list tbody tr td{
  257. padding: 10px 0;
  258. }
  259. .search-record{
  260. width: 100%;
  261. margin: 0 auto;
  262. height: 40px;
  263. font-size: 16px;
  264. line-height: 40px;
  265. margin-top: 20px;
  266. }
  267. .search-record span.red{
  268. color: #ff0909;
  269. }
  270. .el-pagination .el-pager li.active{
  271. background-color: #5078cb;
  272. border-color: #337ab7;
  273. }
  274. <!-- 分页 -->
  275. .el-pagination .el-pager li.active {
  276. border-color: #5078cb !important;
  277. background-color: #5078cb !important;
  278. }
  279. </style>