merchant.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  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" :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" v-if="list && list.content">
  20. <li v-for="item in list.content.slice(0,8)" @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. type: ''
  76. }
  77. },
  78. components: {
  79. Page,
  80. SearchHeader
  81. },
  82. computed: {
  83. list () {
  84. return this.$store.state.supplier.merchant.merchant.data ? this.$store.state.supplier.merchant.merchant.data : []
  85. }
  86. },
  87. methods: {
  88. addResource (id) {
  89. if (this.isInFrame) {
  90. this.$http.get(`/basic/enterprise /${id}/info`)
  91. .then(res => {
  92. if (res.data) {
  93. window.open(this.$route.query.localPath + this.$route.query.erpPath + '?b2bdata=' + encodeURIComponent(JSON.stringify(res.data)))
  94. }
  95. })
  96. .catch(err => {
  97. console.log(err)
  98. })
  99. } else {
  100. this.isVaildSupplier(id)
  101. }
  102. },
  103. jumpResource (id) {
  104. if (!this.hasJump) {
  105. this.isVaildSupplier(id)
  106. }
  107. },
  108. // 判断是否有有效物料信息
  109. isVaildSupplier (id) {
  110. this.$http.get('/vendor/introduction/product/count', {params: {vendUU: id}})
  111. .then(res => {
  112. if (res.data.count !== 0) {
  113. this.$router.push('/supplier/' + id)
  114. } else {
  115. this.hasDialog = true
  116. }
  117. }, err => {
  118. console.log(err)
  119. })
  120. },
  121. search (type) {
  122. this.pageParams.page = 1
  123. this.searchCode = type.keyword
  124. this.type = type.type && type.type !== 'store' ? type.type : null
  125. this.handleCurrentChange(1)
  126. },
  127. goodsSearch (type) {
  128. this.searchCode = type
  129. this.handleCurrentChange(1)
  130. },
  131. handleCurrentChange (type) {
  132. this.pageParams.page = type
  133. this.$store.dispatch('supplier/loadVendorList', {page: this.pageParams.page, size: this.pageParams.count, keyword: this.searchCode, field: this.type})
  134. }
  135. }
  136. }
  137. </script>
  138. <style type="text/scss" lang="scss">
  139. .merchant{
  140. border-radius:5px;
  141. overflow:hidden;
  142. .el-dialog{
  143. width: 290px!important;
  144. .el-dialog__header{
  145. background: #4290f7;
  146. line-height: 40px;
  147. padding: 0 20px 0;
  148. display:block;
  149. .el-dialog__title{
  150. color:#fff;
  151. }
  152. .el-dialog__headerbtn:hover .el-dialog__close, .el-dialog__headerbtn:focus .el-dialog__close{
  153. color:#fff;
  154. }
  155. }
  156. .el-dialog__body{
  157. padding: 10px 20px;
  158. }
  159. .el-dialog__footer{
  160. text-align: center;
  161. a{
  162. display:inline-block;
  163. background: #3c7cf5;
  164. color:#fff;
  165. font-size: 14px;
  166. line-height: 30px;
  167. height:30px;
  168. padding:0 10px;
  169. border-radius:5px;
  170. }
  171. }
  172. }
  173. .form_dialog{
  174. p{
  175. width:200px;
  176. font-size: 14px;
  177. color:#666666;
  178. margin:0 auto;
  179. padding-top:5px;
  180. line-height: 20px;
  181. span{
  182. color:#eb6054;
  183. }
  184. }
  185. }
  186. .top{
  187. border-bottom:1px solid #d3d3d3;
  188. background: #fff;
  189. .title{
  190. background: #2496f1;
  191. height: 34px;
  192. line-height: 34px;
  193. span{
  194. margin-left: 10px;
  195. font-size: 14px;
  196. font-weight: bold;
  197. color: #fff;
  198. }
  199. }
  200. .search{
  201. float:right;
  202. height:50px;
  203. width:370px;
  204. padding-top:7px;
  205. margin-right:10px;
  206. .search-content-pc input{
  207. width: 283px !important;
  208. margin-top: 0!important;
  209. height: 32px;
  210. border: 1px solid #2496f1;
  211. line-height: 32px;
  212. font-size: 13px;
  213. border-top-right-radius: 0;
  214. border-bottom-right-radius: 0;
  215. }
  216. .search-content-pc > ul{
  217. left:0;
  218. top: 32px;
  219. width:283px;
  220. }
  221. .btn{
  222. margin-top: 0!important;
  223. top: -1px;
  224. left: -20px;
  225. width:68px;
  226. background: #2496f1;
  227. color:#fff;
  228. }
  229. .title{
  230. width:100%;
  231. text-align: left;
  232. }
  233. }
  234. }
  235. .list_info{
  236. height: 983px;
  237. background: #fff;
  238. .empty{
  239. padding-top:600px;
  240. text-align: center;
  241. img{
  242. vertical-align: top;
  243. margin-right:15px;
  244. }
  245. .supplier-empty-info{
  246. display: inline-block;
  247. padding-top:10px;
  248. }
  249. }
  250. > ul{
  251. margin:0;
  252. li{
  253. position:relative;
  254. width:100%;
  255. vertical-align: top;
  256. height:112px;
  257. padding:15px;
  258. border-bottom:1px solid #d3d3d3;
  259. .img{
  260. position:relative;
  261. float:left;
  262. width:80px;
  263. height:80px;
  264. border:1px solid #ccc;
  265. img{
  266. width:100%;
  267. height:100%;
  268. vertical-align: top;
  269. }
  270. .has_shop {
  271. position:absolute;
  272. left:0;
  273. top:0;
  274. width:68px;
  275. height:22px;
  276. background: url(/images/supplier/icon/top_left.png)no-repeat;
  277. color:#fff;
  278. font-weight: bold;
  279. text-align: center;
  280. line-height: 22px;
  281. }
  282. }
  283. .content{
  284. margin-left:100px;
  285. color:#333;
  286. padding-top:2px;
  287. .enterprise_name{
  288. width:690px;
  289. overflow: hidden;
  290. text-overflow: ellipsis;
  291. white-space:nowrap;
  292. font-weight: bold;
  293. color:#333;
  294. font-size: 16px;
  295. margin:0 0 10px;
  296. }
  297. p{
  298. width:690px;
  299. overflow: hidden;
  300. text-overflow: ellipsis;
  301. white-space:nowrap;
  302. font-size: 14px;
  303. color:#333;
  304. margin:0 0 5px;
  305. span{
  306. &.split_line{
  307. margin:0 5px;
  308. }
  309. }
  310. }
  311. }
  312. .select_btn{
  313. position:absolute;
  314. top:40%;
  315. right:20px;
  316. z-index:250;
  317. padding:5px 10px;
  318. text-align: center;
  319. background: #1891e4;
  320. color:#fff;
  321. border-radius:3px;
  322. }
  323. &:hover{
  324. cursor:pointer;
  325. box-shadow: 0 0 5px rgba(0,0,0,.4);
  326. .content{
  327. color:#2496f1;
  328. .enterprise_name{
  329. color:#2496f1;
  330. }
  331. p{
  332. color:#2496f1;
  333. }
  334. }
  335. }
  336. }
  337. }
  338. }
  339. }
  340. </style>