merchant.vue 11 KB

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