ComponentGoods.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  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="`/store/${compGoods.storeId}/${compGoods.batchCode}`" target="_blank">
  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" target="_blank">{{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-show="!compGoods.reserve">
  90. <span>—</span>
  91. </div>
  92. <div v-if="compGoods.reserve > 0">
  93. <buy :item="compGoods"></buy>
  94. </div>
  95. </td>
  96. </tr>
  97. <tr v-if="componentGoods.totalElements == 0">
  98. <td colspan="10" class="text-center" style="line-height: 40px; font-size: 20px;">
  99. <i class="fa fa-smile-o fa-lg"></i> 暂无产品信息
  100. </td>
  101. </tr>
  102. </tbody>
  103. </table>
  104. <div style="float: right; margin-bottom: 15px;">
  105. <page :total="componentGoods.totalElements" :page-size="pageParams.count"
  106. :current="pageParams.page" @childEvent="handleCurrentChange"></page>
  107. </div>
  108. </div>
  109. </template>
  110. <script>
  111. import Buy from '~components/common/buyOrCar/buyComponent.vue'
  112. import Page from '~components/common/page/pageComponent.vue'
  113. export default {
  114. layout: 'mian',
  115. props: ['brandid', 'propertyJSON'],
  116. components: {
  117. Buy,
  118. Page
  119. },
  120. data () {
  121. return {
  122. pageParams: {
  123. page: 1,
  124. count: 10,
  125. filter: {
  126. kindid: this.$route.params.id,
  127. brandid: this.brandid,
  128. propertyJSON: this.propertyJSON
  129. }
  130. }
  131. }
  132. },
  133. computed: {
  134. componentGoods () {
  135. let goodsPage = this.$store.state.product.component.componentGoods.data
  136. this.pageParams.page = goodsPage.number
  137. return goodsPage
  138. }
  139. },
  140. methods: {
  141. addToCart: function (goods, buyNow) {
  142. return null
  143. },
  144. handlerCurrentNode (data, node) {
  145. console.log(this.pageParams)
  146. this.pageParams.page = 1
  147. this.pageCmpGoods(this.pageParams)
  148. },
  149. async pageCmpGoods (pageParams) {
  150. let params = {}
  151. params.filter = { kindid: pageParams.filter.kindid }
  152. if (pageParams.filter.brandid && pageParams.filter.brandid !== '') {
  153. params.filter.brandid = pageParams.filter.brandid
  154. }
  155. if (pageParams.filter.propertyJSON !== null && Object.getOwnPropertyNames(pageParams.filter.propertyJSON).length > 3) {
  156. params.filter.properties = pageParams.filter.propertyJSON
  157. }
  158. params.page = pageParams.page
  159. params.count = pageParams.count
  160. let { data } = await this.$http.get('/api/product/product/getCompGoodsByKindid', { params })
  161. this.$store.commit('product/component/GET_CMPGOODS_SUCCESS', data)
  162. },
  163. handleCurrentChange (page) {
  164. this.pageParams.page = page
  165. this.pageParams.filter.brandid = this.brandid
  166. this.pageParams.filter.propertyJSON = this.propertyJSON
  167. this.pageParams.filter.kindid = this.$route.params.id
  168. this.pageCmpGoods(this.pageParams)
  169. }
  170. }
  171. }
  172. </script>
  173. <style scoped>
  174. .product-list{
  175. width: 1190px;
  176. margin-bottom: 20px;
  177. }
  178. .product-list thead tr{
  179. border-top: #6493ff 2px solid;
  180. color: #323232;
  181. background: none;
  182. }
  183. /* 物品列表 */
  184. .product-list .brand-code {
  185. font-size: 14px;
  186. text-align: center;
  187. }
  188. .product-list .brand-code .code {
  189. font-weight: 600;
  190. }
  191. .product-list th {
  192. color: rgb(50,50,50);
  193. font-size: 14px;
  194. font-weight: 600;
  195. background-color: #f7f7f7;
  196. text-align: center;
  197. }
  198. .product-list tbody>tr {
  199. border: 1px solid #e8e8e8;
  200. }
  201. .product-list tbody>tr img {
  202. border: 1px solid #e8e8e8;
  203. margin: 10px 0 5px 0;
  204. width: 36px;
  205. height: 36px;
  206. }
  207. .product-list tbody>tr .contact{
  208. font-size: 14px;
  209. color: #5078cb;
  210. width: 90%;
  211. margin: 0 auto;
  212. display: inline-block;
  213. }
  214. .product-list tbody>tr .contact:hover{
  215. color: #d32526;
  216. }
  217. .product-list td {
  218. font-size: 12px;
  219. color: #333;
  220. text-align: center;
  221. line-height: 20px;
  222. }
  223. /* 物品列表按钮 */
  224. .product-list .btn-buy-now {
  225. background-color: #5078CB;
  226. color: #fff;
  227. width: 80px;
  228. height: 30px;
  229. font-size: 12px;
  230. border: 1px solid #5078cb;
  231. }
  232. .product-list .btn-add-cart {
  233. margin-top: 10px;
  234. color: #214797;
  235. width: 80px;
  236. height: 30px;
  237. font-size: 12px;
  238. background-color: #fff;
  239. border: 1px solid #e8e8e8;
  240. }
  241. .product-list .btn-buy-now:hover{
  242. background: #214797;
  243. }
  244. .product-list .btn-add-cart:hover{
  245. background-color: #5078CB;
  246. color: #fff;
  247. }
  248. .product-list .text-left{
  249. text-align: left;
  250. }
  251. .product-list .text-left div{
  252. margin-left: 30px;
  253. }
  254. .product-list tbody tr td{
  255. padding: 10px 0;
  256. }
  257. .search-record{
  258. width: 100%;
  259. margin: 0 auto;
  260. height: 40px;
  261. font-size: 16px;
  262. line-height: 40px;
  263. margin-top: 20px;
  264. }
  265. .search-record span.red{
  266. color: #ff0909;
  267. }
  268. .el-pagination .el-pager li.active{
  269. background-color: #5078cb;
  270. border-color: #337ab7;
  271. }
  272. /*<!-- 分页 -->*/
  273. .el-pagination .el-pager li.active {
  274. border-color: #5078cb !important;
  275. background-color: #5078cb !important;
  276. }
  277. </style>