merchant.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. <template>
  2. <div class="merchant">
  3. <div class="top clearfix">
  4. <div class="title">
  5. <span>供应商列表</span>
  6. </div>
  7. <div class="search">
  8. <search-header :outerKeyword="searchCode" :similarUrl="similarUrl" :type="'supplier'" @searchAction="search" :placeholder="'品牌/类目/型号/公司名'"></search-header>
  9. </div>
  10. </div>
  11. <div class="list_info">
  12. <div class="empty" v-if="!list.content || list.content.length === 0">
  13. <img src="/images/supplier/icon/empty.png">
  14. <div class="supplier-empty-info">
  15. <p>暂无供应商信息</p>
  16. <a href="javascript:history.go(-1)"><i class="fa fa-reply" style="margin-right:5px;"></i>返回上一页</a>
  17. </div>
  18. </div>
  19. <ul class="list-inline">
  20. <li v-for="item in list.content" @click="jumpResource(item.enUU)" class="clearfix">
  21. <div class="img">
  22. <img :src="item.storeLogoUrl || item.logoUrl || '/images/all/default.png'">
  23. <span class="has_shop" v-if="item.isStore === 1"></span>
  24. </div>
  25. <div class="content">
  26. <h3 class="enterprise_name" v-text="item.enName">深圳英优软科技有限公司</h3>
  27. <p>
  28. <span>企业执照号:</span><span v-text="item.enBusinesscode ? item.enBusinesscode : '暂无信息'">1</span>
  29. <span class="split_line">|</span>
  30. <span>地址:</span><span v-text="item.enAddress ? item.enAddress : '暂无信息'">1</span>
  31. </p>
  32. <p>
  33. <span>邮箱:</span><span v-text="item.enEmail ? item.enEmail : '暂无信息'">h</span>
  34. <span>电话:</span><span v-text="item.enTel ? item.enTel : '暂无信息'">1</span>
  35. <span>行业:</span><span v-text="item.enIndustry ? item.enIndustry : '暂无信息'">1</span>
  36. </p>
  37. </div>
  38. <div class="select_btn" v-html="isInFrame ? '+ 添加为供应商' : '+ 查看更多'" @mouseleave="hasJump = false" @mouseenter="hasJump = true" @click="addResource(item.enUU)"></div>
  39. </li>
  40. </ul>
  41. </div>
  42. <div style="float: right;">
  43. <page :total="list.totalElements" :page-size="pageParams.count"
  44. :current="pageParams.page" v-on:childEvent="handleCurrentChange">
  45. </page>
  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. </template>
  59. <script>
  60. import SearchHeader from '~components/common/PcSearchHeader.vue'
  61. import Page from '~components/common/page/pageComponent.vue'
  62. export default {
  63. name: 'MerchantView',
  64. data () {
  65. return {
  66. hasDialog: false,
  67. hasJump: false,
  68. searchCode: '',
  69. pageParams: {
  70. count: 10,
  71. page: 1
  72. },
  73. similarUrl: '/search/product/similarKeywords',
  74. type: ''
  75. }
  76. },
  77. components: {
  78. Page,
  79. SearchHeader
  80. },
  81. computed: {
  82. list () {
  83. return this.$store.state.supplier.merchant.merchant.data
  84. }
  85. },
  86. methods: {
  87. addResource (id) {
  88. if (this.isInFrame) {
  89. this.$http.get(`/basic/enterprise /${id}/info`)
  90. .then(res => {
  91. if (res.data) {
  92. window.open(this.$route.query.localPath + this.$route.query.erpPath + '?b2bdata=' + encodeURIComponent(JSON.stringify(res.data)))
  93. }
  94. })
  95. .catch(err => {
  96. console.log(err)
  97. })
  98. } else {
  99. this.isVaildSupplier(id)
  100. }
  101. },
  102. jumpResource (id) {
  103. if (!this.hasJump) {
  104. this.isVaildSupplier(id)
  105. }
  106. },
  107. // 判断是否有有效物料信息
  108. isVaildSupplier (id) {
  109. this.$http.get('vendor/introduction/product/count', {params: {vendUU: id}})
  110. .then(res => {
  111. if (res.data.count !== 0) {
  112. this.$router.push('supplier/' + id)
  113. } else {
  114. this.hasDialog = true
  115. }
  116. }, err => {
  117. console.log(err)
  118. })
  119. },
  120. search (type) {
  121. this.pageParams.page = 1
  122. this.searchCode = type.keyword
  123. this.type = type.type
  124. this.handleCurrentChange(1)
  125. },
  126. goodsSearch (type) {
  127. this.searchCode = type
  128. this.handleCurrentChange(1)
  129. },
  130. handleCurrentChange (type) {
  131. this.pageParams.page = type
  132. this.$store.dispatch('supplier/loadVendorList', {page: this.pageParams.page, size: this.pageParams.count, keyword: this.searchCode, field: this.type})
  133. }
  134. }
  135. }
  136. </script>
  137. <style type="text/scss" lang="scss">
  138. .merchant{
  139. border-radius:5px;
  140. overflow:hidden;
  141. .el-dialog{
  142. width: 290px!important;
  143. .el-dialog__header{
  144. background: #4290f7;
  145. line-height: 40px;
  146. padding: 0 20px 0;
  147. display:block;
  148. .el-dialog__title{
  149. color:#fff;
  150. }
  151. .el-dialog__headerbtn:hover .el-dialog__close, .el-dialog__headerbtn:focus .el-dialog__close{
  152. color:#fff;
  153. }
  154. }
  155. .el-dialog__body{
  156. padding: 10px 20px;
  157. }
  158. .el-dialog__footer{
  159. text-align: center;
  160. a{
  161. display:inline-block;
  162. background: #3c7cf5;
  163. color:#fff;
  164. font-size: 14px;
  165. line-height: 30px;
  166. height:30px;
  167. padding:0 10px;
  168. border-radius:5px;
  169. }
  170. }
  171. }
  172. .form_dialog{
  173. p{
  174. width:200px;
  175. font-size: 14px;
  176. color:#666666;
  177. margin:0 auto;
  178. padding-top:5px;
  179. line-height: 20px;
  180. span{
  181. color:#eb6054;
  182. }
  183. }
  184. }
  185. .top{
  186. border-bottom:1px solid #d3d3d3;
  187. background: #fff;
  188. .title{
  189. background: #2496f1;
  190. height: 34px;
  191. line-height: 34px;
  192. span{
  193. margin-left: 10px;
  194. font-size: 14px;
  195. font-weight: bold;
  196. color: #fff;
  197. }
  198. }
  199. .search{
  200. float:right;
  201. height:50px;
  202. width:370px;
  203. padding-top:7px;
  204. margin-right:10px;
  205. .search-content-pc > ul{
  206. left:0;
  207. top:100%;
  208. width:100%;
  209. }
  210. .btn{
  211. width:68px;
  212. background: #2496f1;
  213. color:#fff;
  214. }
  215. .title{
  216. width:100%;
  217. text-align: left;
  218. }
  219. }
  220. }
  221. .list_info{
  222. height: 1120px;
  223. background: #fff;
  224. .empty{
  225. padding-top:600px;
  226. text-align: center;
  227. img{
  228. vertical-align: top;
  229. margin-right:15px;
  230. }
  231. .supplier-empty-info{
  232. display: inline-block;
  233. padding-top:10px;
  234. }
  235. }
  236. > ul{
  237. margin:0;
  238. li{
  239. position:relative;
  240. width:100%;
  241. vertical-align: top;
  242. height:112px;
  243. padding:15px;
  244. border-bottom:1px solid #d3d3d3;
  245. .img{
  246. position:relative;
  247. float:left;
  248. width:80px;
  249. height:80px;
  250. border:1px solid #ccc;
  251. img{
  252. width:100%;
  253. height:100%;
  254. vertical-align: top;
  255. }
  256. .has_shop {
  257. position:absolute;
  258. left:0;
  259. top:0;
  260. width:68px;
  261. height:22px;
  262. background: url(/images/supplier/icon/top_left.png)no-repeat;
  263. color:#fff;
  264. font-weight: bold;
  265. text-align: center;
  266. line-height: 22px;
  267. }
  268. }
  269. .content{
  270. margin-left:100px;
  271. color:#333;
  272. padding-top:2px;
  273. .enterprise_name{
  274. width:690px;
  275. overflow: hidden;
  276. text-overflow: ellipsis;
  277. white-space:nowrap;
  278. font-weight: bold;
  279. color:#333;
  280. font-size: 16px;
  281. margin:0 0 10px;
  282. }
  283. p{
  284. width:690px;
  285. overflow: hidden;
  286. text-overflow: ellipsis;
  287. white-space:nowrap;
  288. font-size: 14px;
  289. color:#333;
  290. margin:0 0 5px;
  291. span{
  292. &.split_line{
  293. margin:0 5px;
  294. }
  295. }
  296. }
  297. }
  298. .select_btn{
  299. position:absolute;
  300. top:40%;
  301. right:20px;
  302. z-index:250;
  303. padding:5px 10px;
  304. text-align: center;
  305. background: #1891e4;
  306. color:#fff;
  307. border-radius:3px;
  308. }
  309. &:hover{
  310. cursor:pointer;
  311. box-shadow: 0 0 5px rgba(0,0,0,.8);
  312. .content{
  313. color:#2496f1;
  314. .enterprise_name{
  315. color:#2496f1;
  316. }
  317. p{
  318. color:#2496f1;
  319. }
  320. }
  321. }
  322. }
  323. }
  324. }
  325. }
  326. </style>