features.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  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. isInFrame () {
  86. if (this.$route.query.type === 'erp') {
  87. return true
  88. }
  89. },
  90. list () {
  91. return this.$store.state.supplier.merchant.merchant.data
  92. },
  93. all () {
  94. let count = this.$store.state.supplier.merchant.merchantAll.data
  95. let supplierCount = count.content ? count.totalElements + '' : '00000'
  96. return this.formatNumber(supplierCount, 5)
  97. }
  98. },
  99. methods: {
  100. // 供应商数字格式转换
  101. formatNumber (num, key) {
  102. let count = ('00000' + num).substr(-key)
  103. let _arr = []
  104. for (var i = 0; i < count.length; i++) {
  105. _arr.push(count[i])
  106. }
  107. return _arr
  108. },
  109. addResource (id) {
  110. if (this.isInFrame) {
  111. this.$http.get(`/basic/enterprise /${id}/info`)
  112. .then(res => {
  113. if (res.data) {
  114. window.open(this.$route.query.localPath + this.$route.query.erpPath + '?b2bdata=' + encodeURIComponent(JSON.stringify(res.data)))
  115. }
  116. })
  117. .catch(err => {
  118. console.log(err)
  119. })
  120. } else {
  121. this.isVaildSupplier(id)
  122. }
  123. },
  124. jumpResource (id) {
  125. if (!this.hasJump) {
  126. this.isVaildSupplier(id)
  127. }
  128. },
  129. // 判断是否有有效物料信息
  130. isVaildSupplier (id) {
  131. this.$http.get('vendor/introduction/product/count', {params: {vendUU: id}})
  132. .then(res => {
  133. if (res.data.count !== 0) {
  134. this.$router.push('supplier/' + id)
  135. } else {
  136. this.hasDialog = true
  137. }
  138. }, err => {
  139. console.log(err)
  140. })
  141. },
  142. goodsSearch (type) {
  143. this.pageParams.page = 1
  144. this.$store.dispatch('supplier/loadVendorList', {page: this.pageParams.page, size: this.pageParams.count, keyword: type})
  145. },
  146. handleCurrentChange (type) {
  147. this.pageParams.page = type
  148. this.$store.dispatch('supplier/loadVendorList', {page: type, size: this.pageParams.count, keyword: this.searchCode})
  149. }
  150. }
  151. }
  152. </script>
  153. <style type="text/scss" lang="scss">
  154. .merchant{
  155. background: #ecf1f1 url(/images/supplier/banner.jpg)no-repeat;
  156. border-top:3px solid #000;
  157. padding-bottom:25px;
  158. margin-top:-1.5em;
  159. .el-dialog{
  160. width: 290px!important;
  161. .el-dialog__header{
  162. background: #4290f7;
  163. line-height: 40px;
  164. padding: 0 20px 0;
  165. .el-dialog__title{
  166. color:#fff;
  167. }
  168. .el-dialog__headerbtn:hover .el-dialog__close, .el-dialog__headerbtn:focus .el-dialog__close{
  169. color:#fff;
  170. }
  171. }
  172. .el-dialog__body{
  173. padding: 10px 20px;
  174. }
  175. .el-dialog__footer{
  176. text-align: center;
  177. a{
  178. display:inline-block;
  179. background: #3c7cf5;
  180. color:#fff;
  181. font-size: 14px;
  182. line-height: 30px;
  183. height:30px;
  184. padding:0 10px;
  185. border-radius:5px;
  186. }
  187. }
  188. }
  189. .form_dialog{
  190. p{
  191. width:200px;
  192. font-size: 14px;
  193. color:#666666;
  194. margin:0 auto;
  195. padding-top:5px;
  196. line-height: 20px;
  197. span{
  198. color:#eb6054;
  199. }
  200. }
  201. }
  202. .top{
  203. padding-top:30px;
  204. margin-bottom:40px;
  205. .title{
  206. margin:0 auto;
  207. text-align: center;
  208. width:215px;
  209. border-bottom:1px solid #ff5151;
  210. color:#fff;
  211. p{
  212. margin:0;
  213. }
  214. h2{
  215. font-size: 32px;
  216. margin:0;
  217. line-height: 46px;
  218. }
  219. div.count{
  220. position: relative;
  221. .count_num {
  222. position:absolute;
  223. top:4px;
  224. left:3px;
  225. span {
  226. display:inline-block;
  227. width:29px;
  228. text-align: center;
  229. font-size: 28px;
  230. color:#4a2f01;
  231. }
  232. }
  233. }
  234. &:before{
  235. content: '';
  236. display:block;
  237. position:relative;
  238. left:55px;
  239. top:61px;
  240. width:105px;
  241. height:1px;
  242. background: #ff8a00;
  243. }
  244. &:after{
  245. content: '';
  246. display:block;
  247. position:relative;
  248. left:55px;
  249. top:4px;
  250. width:105px;
  251. height:1px;
  252. background: #fff600;
  253. }
  254. }
  255. .search{
  256. float:right;
  257. width:310px;
  258. text-align: right;
  259. margin-right:10px;
  260. .btn{
  261. width:68px;
  262. background: #ffa200;
  263. color:#fff;
  264. }
  265. }
  266. }
  267. .list_info{
  268. padding: 0 10px;
  269. min-height:300px;
  270. margin-bottom:100px;
  271. .empty{
  272. height:418px;
  273. border:15px solid #c4e9f9;
  274. background: #eef9fd;
  275. padding-top:165px;
  276. text-align: center;
  277. img{
  278. vertical-align: top;
  279. margin-right:15px;
  280. }
  281. .info{
  282. display: inline-block;
  283. padding-top:10px;
  284. }
  285. }
  286. > ul{
  287. margin-left:5px;
  288. li{
  289. position:relative;
  290. vertical-align: top;
  291. width:267px;
  292. height:115px;
  293. border-radius:5px;
  294. margin-right:32px;
  295. margin-bottom:60px;
  296. background: #ffffff;
  297. box-shadow: 0 3px 10px rgba(0,0,0,.8);
  298. &:nth-child(4n) {
  299. margin-right:0;
  300. }
  301. &:after{
  302. content: '';
  303. display:block;
  304. position:absolute;
  305. top:99%;
  306. left:50%;
  307. z-index:200;
  308. width:88px;
  309. height:22px;
  310. margin-left:-44px;
  311. background: url(/images/supplier/icon/bottom_center_img.png)no-repeat;
  312. }
  313. .has_shop {
  314. position:absolute;
  315. right:0;
  316. top:0;
  317. width:68px;
  318. height:22px;
  319. background: url(/images/supplier/icon/top_right_img.png)no-repeat;
  320. color:#fff;
  321. font-weight: bold;
  322. text-align: center;
  323. line-height: 22px;
  324. }
  325. .enterprise_name{
  326. padding-top:15px;
  327. width:98%;
  328. overflow: hidden;
  329. text-overflow: ellipsis;
  330. white-space:nowrap;
  331. border-bottom:1px solid #b9def7;
  332. font-weight: bold;
  333. color:#1891e4;
  334. font-size: 18px;
  335. line-height: 48px;
  336. text-align: center;
  337. }
  338. .select_btn{
  339. position:absolute;
  340. bottom:-10px;
  341. left:50%;
  342. z-index:250;
  343. width:56px;
  344. height:56px;
  345. padding:10px 0;
  346. margin-left:-28px;
  347. text-align: center;
  348. line-height: 18px;
  349. background: #1891e4;
  350. border-radius:50%;
  351. color:#fff;
  352. }
  353. &:hover{
  354. cursor:pointer;
  355. .popups{
  356. top:99%;
  357. opacity:1;
  358. z-index:100;
  359. }
  360. }
  361. .popups{
  362. position:absolute;
  363. top:50px;
  364. left:0;
  365. background: #6c6c6c;
  366. width:267px;
  367. min-height:20px;
  368. padding:20px 15px 5px 10px;
  369. transition: all .5s ease;
  370. opacity: 0;
  371. color:#fff;
  372. overflow: hidden;
  373. p{
  374. float:left;
  375. margin: 0 !important;
  376. line-height: 18px;
  377. max-height:18px;
  378. overflow: hidden;
  379. text-overflow: ellipsis;
  380. white-space: nowrap;
  381. &:nth-child(2n-1){
  382. width:42px;
  383. }
  384. &:first-child{
  385. width:85px;
  386. }
  387. &:nth-child(2n){
  388. width:200px;
  389. }
  390. &:nth-child(2){
  391. width:155px;
  392. }
  393. &:nth-child(4){
  394. max-height:38px;
  395. overflow: hidden;
  396. white-space:pre-wrap;
  397. word-wrap:break-word;
  398. }
  399. &:last-child{
  400. overflow: hidden;
  401. text-overflow: ellipsis;
  402. white-space: nowrap;
  403. }
  404. }
  405. }
  406. }
  407. }
  408. }
  409. }
  410. </style>