merchant.vue 8.7 KB

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