ComponentGoods.vue 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  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?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" v-if="compGoods.brand.nameEn"><nuxt-link :to="`/product/brand/${compGoods.brand.uuid}/`" title="compGoods.brand.nameEn">{{compGoods.brand.nameEn}}</nuxt-link></div>
  36. <div class="brand" v-if="!compGoods.brand.nameEn">—</div>
  37. <div class="code" v-if="compGoods.code"><nuxt-link :to="`/product/component/${compGoods.uuid}/`" :title="compGoods.code">{{compGoods.code}}</nuxt-link></div>
  38. <div class="code" v-if="!compGoods.code">—</div>
  39. </td>
  40. <td>
  41. <div class="package" v-if="compGoods.packaging">{{compGoods.packaging}}</div>
  42. <div v-if="!compGoods.produceDate && !compGoods.packaging">—</div>
  43. <div class="date" v-if="compGoods.produceDate">{{compGoods.produceDate}}</div>
  44. </td>
  45. <td class="text-left">
  46. <div class="goods" v-if="compGoods.reserve">
  47. 库存:<span>{{compGoods.reserve}}</span>
  48. </div>
  49. <div v-if="!compGoods.reserve" style="text-align: center;margin-left: 0;"><span>—</span></div>
  50. <div class="from" v-if="compGoods.reserve && compGoods.reserve > 0">
  51. 起拍:<span v-if="compGoods.minBuyQty">{{compGoods.minBuyQty}}</span>
  52. </div>
  53. <!--<div class="multiple" v-if="compGoods.reserve > 0">
  54. 倍数:<span>{{compGoods.minPackQty}}</span>
  55. </div>-->
  56. <div class="can-div-sell" v-if="compGoods.reserve" v-text="compGoods.breakUp?'可拆卖':'不可拆卖'"></div>
  57. </td>
  58. <td>
  59. <div v-if="!compGoods.prices">
  60. <span>—</span>
  61. </div>
  62. <div v-for="price in compGoods.prices">
  63. <!--| number-->
  64. <span>{{price.start}}</span> +
  65. </div>
  66. </td>
  67. <td>
  68. <div v-if="(compGoods.currencyName && compGoods.currencyName.indexOf('USD')==-1) || !compGoods.prices">
  69. <span>—</span>
  70. </div>
  71. <div v-for="price in compGoods.prices">
  72. <!--| formateNumber : 6-->
  73. <span>{{price.uSDPrice}}</span>
  74. </div>
  75. </td>
  76. <td>
  77. <div v-if="(compGoods.currencyName && compGoods.currencyName.indexOf('RMB')==-1) || !compGoods.prices">
  78. <span>—</span>
  79. </div>
  80. <div v-for="price in compGoods.prices">
  81. <!--formateNumber : 6-->
  82. <span>{{price.rMBPrice}}</span>
  83. </div>
  84. </td>
  85. <td>
  86. <div v-if="!compGoods.b2cMinDelivery">
  87. <span>—</span>
  88. </div>
  89. <div v-if="compGoods.b2cMinDelivery">交期:<span v-if="compGoods.b2cMinDelivery != compGoods.b2cMaxDelivery">{{compGoods.b2cMinDelivery + '-' + compGoods.b2cMaxDelivery}}</span>
  90. <span v-if="compGoods.b2cMinDelivery == compGoods.b2cMaxDelivery">{{compGoods.b2cMinDelivery}}</span>
  91. </div>
  92. </td>
  93. <td>
  94. <div v-show="!compGoods.reserve">
  95. <span>—</span>
  96. </div>
  97. <div v-if="compGoods.reserve > 0">
  98. <buy :item="compGoods"></buy>
  99. </div>
  100. </td>
  101. </tr>
  102. <tr v-if="componentGoods.totalElements == 0">
  103. <td colspan="10" class="text-center" style="line-height: 40px; font-size: 20px;">
  104. <i class="fa fa-smile-o fa-lg"></i> 暂无产品信息
  105. </td>
  106. </tr>
  107. </tbody>
  108. </table>
  109. <div style="float: right; margin-bottom: 15px;">
  110. <page :total="componentGoods.totalElements" :page-size="pageParams.count"
  111. :current="pageParams.page" @childEvent="handleCurrentChange"></page>
  112. </div>
  113. </div>
  114. </template>
  115. <script>
  116. import Buy from '~components/common/buyOrCar/buyComponent.vue'
  117. import Page from '~components/common/page/pageComponent.vue'
  118. export default {
  119. layout: 'mian',
  120. props: ['brandid', 'propertyJSON'],
  121. components: {
  122. Buy,
  123. Page
  124. },
  125. data () {
  126. return {
  127. pageParams: {
  128. page: 1,
  129. count: 10,
  130. filter: {
  131. kindid: this.$route.params.id,
  132. brandid: this.brandid,
  133. propertyJSON: this.propertyJSON
  134. }
  135. }
  136. }
  137. },
  138. computed: {
  139. componentGoods () {
  140. let goodsPage = this.$store.state.product.component.componentGoods.data
  141. this.pageParams.page = goodsPage.number
  142. return goodsPage
  143. }
  144. },
  145. methods: {
  146. addToCart: function (goods, buyNow) {
  147. return null
  148. },
  149. handlerCurrentNode (data, node) {
  150. console.log(this.pageParams)
  151. this.pageParams.page = 1
  152. this.pageCmpGoods(this.pageParams)
  153. },
  154. async pageCmpGoods (pageParams) {
  155. let params = {}
  156. params.filter = { kindid: pageParams.filter.kindid }
  157. if (pageParams.filter.brandid && pageParams.filter.brandid !== '') {
  158. params.filter.brandid = pageParams.filter.brandid
  159. }
  160. if (pageParams.filter.propertyJSON !== null && Object.getOwnPropertyNames(pageParams.filter.propertyJSON).length > 3) {
  161. params.filter.properties = pageParams.filter.propertyJSON
  162. }
  163. params.page = pageParams.page
  164. params.count = pageParams.count
  165. let { data } = await this.$http.get('/api/product/product/getCompGoodsByKindid', { params })
  166. this.$store.commit('product/component/GET_CMPGOODS_SUCCESS', data)
  167. },
  168. handleCurrentChange (page) {
  169. this.pageParams.page = page
  170. this.pageParams.filter.brandid = this.brandid
  171. this.pageParams.filter.propertyJSON = this.propertyJSON
  172. this.pageParams.filter.kindid = this.$route.params.id
  173. this.pageCmpGoods(this.pageParams)
  174. }
  175. }
  176. }
  177. </script>
  178. <style scoped>
  179. .product-list{
  180. width: 1190px;
  181. margin-bottom: 20px;
  182. }
  183. .product-list thead tr{
  184. border-top: #6493ff 2px solid;
  185. color: #323232;
  186. background: none;
  187. }
  188. /* 物品列表 */
  189. .product-list .brand-code {
  190. font-size: 14px;
  191. text-align: center;
  192. }
  193. .product-list .brand-code .code {
  194. font-weight: 600;
  195. }
  196. .product-list th {
  197. color: rgb(50,50,50);
  198. font-size: 14px;
  199. font-weight: 600;
  200. background-color: #f7f7f7;
  201. text-align: center;
  202. }
  203. .product-list tbody>tr {
  204. border: 1px solid #e8e8e8;
  205. }
  206. .product-list tbody>tr img {
  207. border: 1px solid #e8e8e8;
  208. margin: 10px 0 5px 0;
  209. width: 36px;
  210. height: 36px;
  211. }
  212. .product-list tbody>tr .contact{
  213. font-size: 14px;
  214. color: #5078cb;
  215. width: 90%;
  216. margin: 0 auto;
  217. display: inline-block;
  218. }
  219. .product-list tbody>tr .contact:hover{
  220. color: #d32526;
  221. }
  222. .product-list td {
  223. font-size: 12px;
  224. /*color: #333;*/
  225. text-align: center;
  226. line-height: 20px;
  227. }
  228. .product-list td a{
  229. color: #337ab7;
  230. max-width: 160px;
  231. overflow: hidden;
  232. text-overflow: ellipsis;
  233. display: block;
  234. }
  235. .product-list td a:hover {
  236. color: #23527c;
  237. }
  238. /* 物品列表按钮 */
  239. .product-list .btn-buy-now {
  240. background-color: #5078CB;
  241. color: #fff;
  242. width: 80px;
  243. height: 30px;
  244. font-size: 12px;
  245. border: 1px solid #5078cb;
  246. }
  247. .product-list .btn-add-cart {
  248. margin-top: 10px;
  249. color: #214797;
  250. width: 80px;
  251. height: 30px;
  252. font-size: 12px;
  253. background-color: #fff;
  254. border: 1px solid #e8e8e8;
  255. }
  256. .product-list .btn-buy-now:hover{
  257. background: #214797;
  258. }
  259. .product-list .btn-add-cart:hover{
  260. background-color: #5078CB;
  261. color: #fff;
  262. }
  263. .product-list .text-left{
  264. text-align: left;
  265. }
  266. .product-list .text-left div{
  267. margin-left: 30px;
  268. }
  269. .product-list tbody tr td{
  270. padding: 10px 0;
  271. }
  272. .product-list tbody tr td .can-div-sell {
  273. color: #333;
  274. }
  275. .search-record{
  276. width: 100%;
  277. margin: 0 auto;
  278. height: 40px;
  279. font-size: 16px;
  280. line-height: 40px;
  281. margin-top: 20px;
  282. }
  283. .search-record span.red{
  284. color: #ff0909;
  285. }
  286. .el-pagination .el-pager li.active{
  287. background-color: #5078cb;
  288. border-color: #337ab7;
  289. }
  290. /*<!-- 分页 -->*/
  291. .el-pagination .el-pager li.active {
  292. border-color: #5078cb !important;
  293. background-color: #5078cb !important;
  294. }
  295. </style>