StoreInfo.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  1. <template>
  2. <div class="storeInfo container">
  3. <div class="form-group">
  4. <div class="storeIns">
  5. <div class="sign">选择商家:</div>
  6. <div class="storeInList" v-for="storeIn in store">
  7. <div class="choose" :class="{'storeIn-active' : storeIn.isSelected, 'storeIn' : !storeIn.isSelected}" @click="store.length==1?'':addStore(storeIn)">
  8. <a class="storeLogo">
  9. <img :src="storeIn.logoUrl || '/images/component/default.png'" :alt="storeIn.storeName" :title="storeIn.storeName">
  10. </a>
  11. </div>
  12. </div>
  13. <div class="storeInList" style="font-size: 14px" v-if="!store || store.length == 0">
  14. 暂无商家信息
  15. </div>
  16. </div>
  17. </div>
  18. <div class="form-group" style="margin-bottom: 40px;">
  19. <div>
  20. <div style="font-size: 14px">
  21. <span>产品匹配:</span>
  22. <span v-if="store && store.length > 0">
  23. <input type="checkbox" v-if="storeExist && UmallExist" @click="filterType('umall')" :checked="!this.params.filter.ignoreUMall">
  24. <span v-if="UmallExist">&nbsp;库存寄售&nbsp;</span>
  25. <input type="checkbox" v-if="storeExist && UmallExist" @click="filterType('store')" :checked="!this.params.filter.ignoreStore">
  26. <span v-if="storeExist">&nbsp;店铺自营</span>
  27. </span>
  28. <span v-if="!store || store.length == 0">暂无可匹配的信息 </span>
  29. </div>
  30. </div>
  31. </div>
  32. <div class="goodsList">
  33. <div class="goods-item">按商家列表</div>
  34. <table class="table">
  35. <thead>
  36. <tr class="height54">
  37. <th class="text-center" width="100">型号</th>
  38. <th class="text-center" width="80">包装方式</th>
  39. <th class="text-center" width="120">生产日期</th>
  40. <th class="text-center" width="150">库存</th>
  41. <th class="text-center" width="80">梯度/pcs</th>
  42. <th class="text-center" width="100">香港交货<span style="font-size: 12px;">($)</span></th>
  43. <th class="text-center" width="130">大陆交货<span style="font-size: 12px;">(¥)</span></th>
  44. <th class="text-center" width="120">交期<span style="font-size: 12px;">(天)</span></th>
  45. <th class="text-center" width="140">操作</th>
  46. </tr>
  47. </thead>
  48. <tbody class="text-center">
  49. <tr style="cursor: pointer;" v-for="list in storeList.content" @click="goProductDetail(list.storeid, list.batchCode)">
  50. <td style="position: relative">
  51. <img class="sellout-flag" v-if="list.status === 602" src="/images/search/sellout-search.png" alt="">
  52. <a v-if="list.code">{{list.code}}</a>
  53. <a v-if="!list.code">—</a>
  54. </td>
  55. <td>
  56. <a v-if="list.packaging">{{list.packaging}}</a>
  57. <a v-if="!list.packaging">—</a>
  58. </td>
  59. <td>
  60. <a v-if="list.produceDate">{{list.produceDate}}</a>
  61. <a v-if="!list.produceDate">—</a>
  62. </td>
  63. <td style="text-align: left;padding-left: 25px;">
  64. <a>
  65. <div v-if="list.reserve">
  66. <span>库存:</span>
  67. <span>{{list.reserve}}</span>
  68. </div>
  69. <div v-if="!list.reserve" style="text-align: center;margin-left: 0;"><span>—</span></div>
  70. <div v-if="list.reserve && list.reserve>0">
  71. <span>起拍:</span>
  72. <span v-if="list.minBuyQty">{{list.minBuyQty}}</span>
  73. </div>
  74. <div class="can-div-sell" v-text="list.breakUp?'可拆卖':'不可拆卖'"></div>
  75. <!--<div>-->
  76. <!--<span>倍数:</span>-->
  77. <!--<span>{{list.minPackQty}}</span>-->
  78. <!--</div>-->
  79. </a>
  80. </td>
  81. <td>
  82. <a>
  83. <div v-for="price in list.prices">
  84. <span v-if="list.prices">{{price.start}}</span>+
  85. <span v-if="!list.prices">—</span>
  86. </div>
  87. </a>
  88. </td>
  89. <td>
  90. <a>
  91. <div v-show="list.currencyName.indexOf('USD')==-1 || !list.prices">
  92. <span>—</span>
  93. </div>
  94. <div v-for="price in list.prices">
  95. <span>{{price.uSDPrice | currency}}</span>
  96. </div>
  97. </a>
  98. </td>
  99. <td>
  100. <a>
  101. <div v-show="list.currencyName.indexOf('RMB')==-1 || !list.prices">
  102. <span>—</span>
  103. </div>
  104. <div v-for="price in list.prices">
  105. <span>{{price.rMBPrice | currency}}</span>
  106. </div>
  107. </a>
  108. </td>
  109. <td>
  110. <a>
  111. <div v-show="list.b2cMinDelivery">
  112. <span>交期:</span>
  113. <span>{{list.b2cMinDelivery}}</span>
  114. <span v-if="list.b2cMaxDelivery && list.b2cMaxDelivery !== list.b2cMinDelivery">-</span>
  115. <span v-if="list.b2cMaxDelivery && list.b2cMaxDelivery !== list.b2cMinDelivery">{{list.b2cMaxDelivery}}</span>
  116. </div>
  117. <div v-if="!list.b2cMinDelivery">
  118. <span>—</span>
  119. </div>
  120. </a>
  121. </td>
  122. <td>
  123. <buy :item="list" :disabledFlag="list.status === 602"></buy>
  124. </td>
  125. </tr>
  126. <tr v-if="!storeList.content || storeList.content.length == 0">
  127. <td colspan="12">
  128. <div class="empty">
  129. <p class="empty-img">
  130. <img src="/images/brandList/empty-cart.png">
  131. </p>
  132. <div class="empty-info">
  133. <p class="grey"> 暂无现货信息 </p>
  134. <a href="javascript:history.go(-1)"><i class="fa fa-mail-reply fa-xs"></i>返回上一页</a>
  135. </div>
  136. </div>
  137. </td>
  138. </tr>
  139. </tbody>
  140. </table>
  141. </div>
  142. </div>
  143. </template>
  144. <script>
  145. import Buy from '~components/common/buyOrCar/buyComponent.vue'
  146. export default {
  147. name: 'StoreInfo',
  148. data () {
  149. return {
  150. storeIds: [],
  151. UmallExist: false,
  152. storeExist: false,
  153. params: {
  154. count: 10,
  155. page: 1,
  156. sorting: {'minPriceRMB': 'ASC'},
  157. filter: {
  158. uuid: this.$route.params.uuid,
  159. ignoreUMall: false,
  160. ignoreStore: false,
  161. storeIds: ''
  162. }
  163. }
  164. }
  165. },
  166. components: {
  167. Buy
  168. },
  169. filters: {
  170. currency: function (num) {
  171. if (typeof num === 'number') {
  172. if (num <= 0.000001) {
  173. num = 0.000001
  174. } else {
  175. if (num.toString().indexOf('.') === -1) {
  176. num += '.00'
  177. } else {
  178. let inputStr = num.toString()
  179. let arr = inputStr.split('.')
  180. let floatNum = arr[1]
  181. if (floatNum.length > 6) {
  182. num = inputStr.substring(0, arr[0].length + 7)
  183. if (Number(floatNum.charAt(6)) > 4) {
  184. num = (Number(num) * 1000000 + 1) / 1000000
  185. }
  186. } else if (floatNum.length === 1) {
  187. num = num + '0'
  188. }
  189. }
  190. }
  191. }
  192. return num
  193. }
  194. },
  195. computed: {
  196. stores () {
  197. return this.$store.state.componentStore.store
  198. },
  199. store () {
  200. return this.stores.data
  201. },
  202. storeList () {
  203. let storeList = this.$store.state.componentInformation.information.data
  204. let _self = this
  205. if (storeList.content) {
  206. storeList.content.forEach(function (item) {
  207. _self.storeIds.push(item.storeid)
  208. })
  209. }
  210. if (this.storeIds.length > 0) {
  211. if (this.storeIds.indexOf(this.storeId) === -1) {
  212. this.storeExist = true
  213. } else {
  214. this.storeIds.splice(this.storeIds.indexOf(this.storeId), 1)
  215. if (this.storeIds.length > 0) {
  216. this.storeExist = true
  217. }
  218. this.UmallExist = true
  219. }
  220. }
  221. return storeList
  222. },
  223. storeId () {
  224. let UmallStoreId = this.$store.state.componentUmallStoreId.storeId.data
  225. return UmallStoreId
  226. }
  227. },
  228. methods: {
  229. addStore (storeIn) {
  230. if (typeof storeIn.isSelected === 'undefined') {
  231. storeIn.isSelected = false
  232. }
  233. storeIn.isSelected = !storeIn.isSelected
  234. // 点击请求处理
  235. let index = this.params.filter.storeIds.indexOf(storeIn.uuid)
  236. if (index === -1) {
  237. if (this.params.filter.storeIds === '') {
  238. this.params.filter.storeIds += storeIn.uuid
  239. } else {
  240. this.params.filter.storeIds += ',' + storeIn.uuid
  241. }
  242. } else {
  243. if (this.params.filter.storeIds.charAt(index + storeIn.uuid.length) === '') {
  244. if (this.params.filter.storeIds.charAt(index - 1) === ',') {
  245. this.params.filter.storeIds = this.params.filter.storeIds.replace(',' + storeIn.uuid, '')
  246. }
  247. this.params.filter.storeIds = this.params.filter.storeIds.replace(storeIn.uuid, '')
  248. } else {
  249. this.params.filter.storeIds = this.params.filter.storeIds.replace(storeIn.uuid + ',', '')
  250. }
  251. }
  252. this.$store.dispatch('loadComponentInformation', this.params)
  253. },
  254. filterType (type) {
  255. if (type === 'umall') {
  256. this.params.filter.ignoreUMall = !this.params.filter.ignoreUMall
  257. } else if (type === 'store') {
  258. this.params.filter.ignoreStore = !this.params.filter.ignoreStore
  259. }
  260. this.$store.dispatch('loadComponentInformation', this.params)
  261. },
  262. goProductDetail: function (storeid, batchcode) {
  263. window.location.href = '/store/' + storeid + '/' + batchcode
  264. }
  265. }
  266. }
  267. </script>
  268. <style scoped>
  269. .storeInfo .storeIns{
  270. margin-top: 20px;
  271. width: 1190px;
  272. line-height: 48px;
  273. position: relative;
  274. padding-left: 70px;
  275. }
  276. .storeInfo .storeIns .sign {
  277. display: inline-block;
  278. vertical-align: middle;
  279. font-size: 14px;
  280. position: absolute;
  281. left: 0;
  282. top: 0;
  283. }
  284. .storeInfo .storeIns .storeInList {
  285. display: inline-block;
  286. }
  287. .storeInfo .choose {
  288. border: 1px solid #ccc;
  289. }
  290. .storeInfo .storeIn {
  291. width: 98px;
  292. height: 49px;
  293. line-height: 30px;
  294. float: left;
  295. border: 1px solid #ccc;
  296. text-align: center;
  297. vertical-align: middle;
  298. margin-right: 15px;
  299. cursor: pointer;
  300. }
  301. .storeInfo .storeIn-active {
  302. width: 98px;
  303. height: 49px;
  304. line-height: 46px;
  305. float: left;
  306. border: 1px solid #5078cb;
  307. text-align: center;
  308. vertical-align: middle;
  309. margin-right: 15px;
  310. cursor: pointer;
  311. }
  312. .storeInfo .storeIn a,.componentDetail .storeIn-active a {
  313. display: table-cell;
  314. height: 49px;
  315. width: 98px;
  316. text-align: center;
  317. vertical-align: middle;
  318. }
  319. .storeInList .choose a img{
  320. max-width: 95px;
  321. max-height: 45px;
  322. margin-bottom: 1px;
  323. }
  324. a.storeLogo>img,.storeIn-active a.storeLogo>img {
  325. max-width: 95px;
  326. max-height: 46px;
  327. }
  328. .storeInfo .goodsList {
  329. clear: both;
  330. font-size: 14px;
  331. }
  332. .storeInfo .goodsList .goods-item {
  333. height: 30px;
  334. width: 120px;
  335. background-color: #5078cb;
  336. color: #fff;
  337. text-align: center;
  338. vertical-align: middle;
  339. line-height: 30px;
  340. }
  341. .storeInfo .goodsList thead {
  342. background-color: #F7F7F7;
  343. border:2px solid #f7f7f7;
  344. }
  345. .storeInfo .goodsList tbody tr td{
  346. vertical-align: middle;
  347. text-align: center;
  348. }
  349. .storeInfo .goodsList tbody tr td .sellout-flag {
  350. position: absolute;
  351. right: 0;
  352. bottom: 0;
  353. }
  354. .storeInfo .goodsList tbody tr td a {
  355. color: #474443;
  356. }
  357. .storeInfo .goodsList tbody tr td:hover a{
  358. color: #474443;
  359. }
  360. /*.storeInfo .goodsList .btn{*/
  361. /*border-radius: 4px;*/
  362. /*width: 80px;*/
  363. /*height: 30px;*/
  364. /*color: #214797;*/
  365. /*font-size: 14px;*/
  366. /*line-height: 14px;*/
  367. /*text-align: center;*/
  368. /*margin: 5px 0;*/
  369. /*padding: 0;*/
  370. /*user-select: none;*/
  371. /*background-image: none;*/
  372. /*border: 1px solid transparent;*/
  373. /*font-weight: 400;*/
  374. /*}*/
  375. /*.storeInfo .goodsList .btn-buyNow {*/
  376. /*color: #fff;*/
  377. /*background-color: #5078cb;*/
  378. /*}*/
  379. /*.storeInfo .goodsList .btn-default{*/
  380. /*background-color: #fff;*/
  381. /*border-color: #ccc;*/
  382. /*}*/
  383. .storeInfo .form-group input{
  384. vertical-align: sub;
  385. }
  386. .storeInfo .height54{
  387. height: 54px;
  388. background: none;
  389. color: #333;
  390. }
  391. .storeInfo .height54 th{
  392. line-height: 54px;
  393. border-bottom: none;
  394. padding: 0;
  395. }
  396. .storeInfo .table tbody td{
  397. border-bottom: #ddd 1px solid;
  398. border-top: none;
  399. }
  400. .storeInfo .table tbody{
  401. border-left: #ddd 1px solid;
  402. border-right: #ddd 1px solid;
  403. }
  404. .storeInfo .table tbody td div{
  405. margin-left: 10%;
  406. }
  407. .storeInfo .table tbody tr:hover{
  408. background: #ecf2fd;
  409. }
  410. .storeInfo .goodsList .can-div-sell {
  411. text-align: left;
  412. color: #333;
  413. }
  414. /**/
  415. .storeInfo .empty{
  416. overflow: hidden;
  417. margin: 0!important;
  418. height:130px;
  419. display:inline-flex;
  420. align-items: center;
  421. }
  422. .storeInfo .empty-info{
  423. line-height: 14px;
  424. width: 143px;
  425. }
  426. .empty-info .grey{
  427. color: #999;
  428. font-size: 14px;
  429. }
  430. .storeInfo .empty .empty-info>a{
  431. font-size: 14px;
  432. color: #5078cb;
  433. }
  434. .storeInfo .empty .empty-info i{
  435. margin-right:5px;
  436. }
  437. </style>