merchant.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  1. <template>
  2. <div class="merchant">
  3. <div class="container">
  4. <div class="top clearfix">
  5. <div class="title">
  6. <p>High quality dealer</p>
  7. <h2>供应商列表</h2>
  8. <div class="count">
  9. <img src="/images/supplier/count.png" alt=""/>
  10. <div class="count_num">
  11. <span v-for="spCount in all" v-text="spCount"></span>
  12. </div>
  13. </div>
  14. </div>
  15. <div class="search">
  16. <search-header :outerKeyword="searchCode" :similarUrl="similarUrl" :type="'supplier'" @searchAction="search" :placeholder="'品牌/类目/型号/公司名'"></search-header>
  17. </div>
  18. </div>
  19. <div class="list_info">
  20. <div class="empty" v-if="!list.content || list.content.length === 0">
  21. <img src="/images/supplier/icon/empty.png">
  22. <div class="info">
  23. <p>暂无供应商信息</p>
  24. <a href="javascript:history.go(-1)"><i class="fa fa-reply" style="margin-right:5px;"></i>返回上一页</a>
  25. </div>
  26. </div>
  27. <ul class="list-inline">
  28. <li v-for="item in list.content" @click="jumpResource(item.enUU)">
  29. <div class="has_shop" v-if="item.isStore === 1">已开店</div>
  30. <div class="enterprise_name" v-text="item.enName">深圳英优软科技有限公司</div>
  31. <div class="select_btn" v-html="isInFrame ? '添加为<br/>供应商' : '查看<br/>更多'" @mouseleave="hasJump = false" @mouseenter="hasJump = true" @click="addResource(item.enUU)"></div>
  32. <div class="popups">
  33. <p>企业执照号:</p><p v-text="item.enBusinesscode ? item.enBusinesscode : '暂无信息'">1</p>
  34. <p>地址:</p><p v-text="item.enAddress ? item.enAddress : '暂无信息'">1</p>
  35. <p>邮箱:</p><p v-text="item.enEmail ? item.enEmail : '暂无信息'">h</p>
  36. <p>电话:</p><p v-text="item.enTel ? item.enTel : '暂无信息'">1</p>
  37. <p>行业:</p><p v-text="item.enIndustry ? item.enIndustry : '暂无信息'">1</p>
  38. </div>
  39. </li>
  40. </ul>
  41. <div style="float: right;">
  42. <page :total="list.totalElements" :page-size="pageParams.count"
  43. :current="pageParams.page" v-on:childEvent="handleCurrentChange">
  44. </page>
  45. </div>
  46. </div>
  47. <el-dialog
  48. title="提示"
  49. :visible.sync="hasDialog ">
  50. <div class="form_dialog">
  51. <p><span>供应商正在完善产品信息,</span>暂时不能查看更多。 </p>
  52. </div>
  53. <span slot="footer" class="dialog-footer">
  54. <a type="button" @click="hasDialog=false">我知道了</a>
  55. </span>
  56. </el-dialog>
  57. </div>
  58. </div>
  59. </template>
  60. <script>
  61. import SearchHeader from '~components/common/PcSearchHeader.vue'
  62. import Page from '~components/common/page/pageComponent.vue'
  63. export default {
  64. name: 'MerchantView',
  65. data () {
  66. return {
  67. hasDialog: false,
  68. hasJump: false,
  69. searchCode: '',
  70. pageParams: {
  71. count: 20,
  72. page: 1
  73. },
  74. similarUrl: '/search/product/similarKeywords',
  75. type: ''
  76. }
  77. },
  78. components: {
  79. Page,
  80. SearchHeader
  81. },
  82. computed: {
  83. list () {
  84. return this.$store.state.supplier.merchant.merchant.data
  85. },
  86. all () {
  87. let count = this.$store.state.supplier.merchant.merchantAll.data
  88. let supplierCount = count.content ? count.totalElements + '' : '00000'
  89. return this.formatNumber(supplierCount, 5)
  90. }
  91. },
  92. methods: {
  93. // 供应商数字格式转换
  94. formatNumber (num, key) {
  95. let count = ('00000' + num).substr(-key)
  96. let _arr = []
  97. for (var i = 0; i < count.length; i++) {
  98. _arr.push(count[i])
  99. }
  100. return _arr
  101. },
  102. addResource (id) {
  103. if (this.isInFrame) {
  104. this.$http.get(`/basic/enterprise /${id}/info`)
  105. .then(res => {
  106. if (res.data) {
  107. window.open(this.$route.query.localPath + this.$route.query.erpPath + '?b2bdata=' + encodeURIComponent(JSON.stringify(res.data)))
  108. }
  109. })
  110. .catch(err => {
  111. console.log(err)
  112. })
  113. } else {
  114. this.isVaildSupplier(id)
  115. }
  116. },
  117. jumpResource (id) {
  118. if (!this.hasJump) {
  119. this.isVaildSupplier(id)
  120. }
  121. },
  122. // 判断是否有有效物料信息
  123. isVaildSupplier (id) {
  124. this.$http.get('vendor/introduction/product/count', {params: {vendUU: id}})
  125. .then(res => {
  126. if (res.data.count !== 0) {
  127. this.$router.push('supplier/' + id)
  128. } else {
  129. this.hasDialog = true
  130. }
  131. }, err => {
  132. console.log(err)
  133. })
  134. },
  135. search (type) {
  136. this.pageParams.page = 1
  137. this.searchCode = type.keyword
  138. this.type = type.type
  139. this.handleCurrentChange(1)
  140. },
  141. goodsSearch (type) {
  142. this.searchCode = type
  143. this.handleCurrentChange(1)
  144. },
  145. handleCurrentChange (type) {
  146. this.pageParams.page = type
  147. this.$store.dispatch('supplier/loadVendorList', {page: this.pageParams.page, size: this.pageParams.count, keyword: this.searchCode, field: this.type})
  148. }
  149. }
  150. }
  151. </script>
  152. <style type="text/scss" lang="scss">
  153. .merchant{
  154. background: #ecf1f1 url(/images/supplier/banner.jpg)no-repeat;
  155. border-top:3px solid #000;
  156. padding-bottom:25px;
  157. margin-top:-1.5em;
  158. .el-dialog{
  159. width: 290px!important;
  160. .el-dialog__header{
  161. background: #4290f7;
  162. line-height: 40px;
  163. padding: 0 20px 0;
  164. .el-dialog__title{
  165. color:#fff;
  166. }
  167. .el-dialog__headerbtn:hover .el-dialog__close, .el-dialog__headerbtn:focus .el-dialog__close{
  168. color:#fff;
  169. }
  170. }
  171. .el-dialog__body{
  172. padding: 10px 20px;
  173. }
  174. .el-dialog__footer{
  175. text-align: center;
  176. a{
  177. display:inline-block;
  178. background: #3c7cf5;
  179. color:#fff;
  180. font-size: 14px;
  181. line-height: 30px;
  182. height:30px;
  183. padding:0 10px;
  184. border-radius:5px;
  185. }
  186. }
  187. }
  188. .form_dialog{
  189. p{
  190. width:200px;
  191. font-size: 14px;
  192. color:#666666;
  193. margin:0 auto;
  194. padding-top:5px;
  195. line-height: 20px;
  196. span{
  197. color:#eb6054;
  198. }
  199. }
  200. }
  201. .top{
  202. padding-top:30px;
  203. margin-bottom:40px;
  204. .title{
  205. margin:0 auto;
  206. text-align: center;
  207. width:215px;
  208. border-bottom:1px solid #ff5151;
  209. color:#fff;
  210. p{
  211. margin:0;
  212. }
  213. h2{
  214. font-size: 32px;
  215. margin:0;
  216. line-height: 46px;
  217. }
  218. div.count{
  219. position: relative;
  220. .count_num {
  221. position:absolute;
  222. top:4px;
  223. left:3px;
  224. span {
  225. display:inline-block;
  226. width:29px;
  227. text-align: center;
  228. font-size: 28px;
  229. color:#4a2f01;
  230. }
  231. }
  232. }
  233. &:before{
  234. content: '';
  235. display:block;
  236. position:relative;
  237. left:55px;
  238. top:61px;
  239. width:105px;
  240. height:1px;
  241. background: #ff8a00;
  242. }
  243. &:after{
  244. content: '';
  245. display:block;
  246. position:relative;
  247. left:55px;
  248. top:4px;
  249. width:105px;
  250. height:1px;
  251. background: #fff600;
  252. }
  253. }
  254. .search{
  255. float:right;
  256. width:370px;
  257. padding-top:50px;
  258. margin-right:10px;
  259. .btn{
  260. width:68px;
  261. background: #ffa200;
  262. color:#fff;
  263. }
  264. .title{
  265. width:100%;
  266. text-align: left;
  267. }
  268. }
  269. }
  270. .list_info{
  271. padding: 0 10px;
  272. min-height:300px;
  273. margin-bottom:100px;
  274. .empty{
  275. height:418px;
  276. border:15px solid #c4e9f9;
  277. background: #eef9fd;
  278. padding-top:165px;
  279. text-align: center;
  280. img{
  281. vertical-align: top;
  282. margin-right:15px;
  283. }
  284. .info{
  285. display: inline-block;
  286. padding-top:10px;
  287. }
  288. }
  289. > ul{
  290. margin-left:5px;
  291. li{
  292. position:relative;
  293. vertical-align: top;
  294. width:267px;
  295. height:115px;
  296. border-radius:5px;
  297. margin-right:32px;
  298. margin-bottom:60px;
  299. background: #ffffff;
  300. box-shadow: 0 3px 10px rgba(0,0,0,.8);
  301. &:nth-child(4n) {
  302. margin-right:0;
  303. }
  304. &:after{
  305. content: '';
  306. display:block;
  307. position:absolute;
  308. top:99%;
  309. left:50%;
  310. z-index:200;
  311. width:88px;
  312. height:22px;
  313. margin-left:-44px;
  314. background: url(/images/supplier/icon/bottom_center_img.png)no-repeat;
  315. }
  316. .has_shop {
  317. position:absolute;
  318. right:0;
  319. top:0;
  320. width:68px;
  321. height:22px;
  322. background: url(/images/supplier/icon/top_right_img.png)no-repeat;
  323. color:#fff;
  324. font-weight: bold;
  325. text-align: center;
  326. line-height: 22px;
  327. }
  328. .enterprise_name{
  329. padding-top:15px;
  330. width:98%;
  331. overflow: hidden;
  332. text-overflow: ellipsis;
  333. white-space:nowrap;
  334. border-bottom:1px solid #b9def7;
  335. font-weight: bold;
  336. color:#1891e4;
  337. font-size: 18px;
  338. line-height: 48px;
  339. text-align: center;
  340. }
  341. .select_btn{
  342. position:absolute;
  343. bottom:-10px;
  344. left:50%;
  345. z-index:250;
  346. width:56px;
  347. height:56px;
  348. padding:10px 0;
  349. margin-left:-28px;
  350. text-align: center;
  351. line-height: 18px;
  352. background: #1891e4;
  353. border-radius:50%;
  354. color:#fff;
  355. }
  356. &:hover{
  357. cursor:pointer;
  358. .popups{
  359. top:99%;
  360. opacity:1;
  361. z-index:100;
  362. }
  363. }
  364. .popups{
  365. position:absolute;
  366. top:50px;
  367. left:0;
  368. background: #6c6c6c;
  369. width:267px;
  370. min-height:20px;
  371. padding:20px 15px 5px 10px;
  372. transition: all .5s ease;
  373. opacity: 0;
  374. color:#fff;
  375. overflow: hidden;
  376. p{
  377. float:left;
  378. margin: 0 !important;
  379. line-height: 18px;
  380. max-height:18px;
  381. overflow: hidden;
  382. text-overflow: ellipsis;
  383. white-space: nowrap;
  384. &:nth-child(2n-1){
  385. width:42px;
  386. }
  387. &:first-child{
  388. width:85px;
  389. }
  390. &:nth-child(2n){
  391. width:200px;
  392. }
  393. &:nth-child(2){
  394. width:155px;
  395. }
  396. &:nth-child(4){
  397. max-height:38px;
  398. overflow: hidden;
  399. white-space:pre-wrap;
  400. word-wrap:break-word;
  401. }
  402. &:last-child{
  403. overflow: hidden;
  404. text-overflow: ellipsis;
  405. white-space: nowrap;
  406. }
  407. }
  408. }
  409. }
  410. }
  411. }
  412. }
  413. </style>