merchant.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378
  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>
  9. <div class="search">
  10. <div class="input-group">
  11. <input type="search" class="form-control" title="code" placeholder="名称/地址/行业"
  12. v-model="searchCode" @keyup.13="goodsSearch(searchCode)" @search="goodsSearch(searchCode)"/>
  13. <span class="input-group-btn">
  14. <button type="button" class="btn" @click="goodsSearch(searchCode)">&nbsp;查 询</button>
  15. </span>
  16. </div>
  17. </div>
  18. </div>
  19. <div class="list_info">
  20. <div class="empty" v-if="!list.content || list.content.length === 0">
  21. <img src="/images/supplier/icon/empty.png">
  22. <div class="info">
  23. <p>暂无供应商信息</p>
  24. <a href="javascript:history.go(-1)"><i class="fa fa-reply" style="margin-right:5px;"></i>返回上一页</a>
  25. </div>
  26. </div>
  27. <ul class="list-inline">
  28. <li v-for="item in list.content" @click="jumpResource(item.enUU)">
  29. <div class="has_shop" v-if="item.isStore === 1">已开店</div>
  30. <div class="enterprise_name" v-text="item.enName">深圳英优软科技有限公司</div>
  31. <div class="select_btn" v-html="isInFrame ? '添加为<br/>供应商' : '查看<br/>更多'" @mouseleave="hasJump = false" @mouseenter="hasJump = true" @click="addResource(item.enUU)"></div>
  32. <div class="popups">
  33. <p>企业执照号:</p><p v-text="item.enBusinesscode ? item.enBusinesscode : '暂无信息'">1</p>
  34. <p>地址:</p><p v-text="item.enAddress ? item.enAddress : '暂无信息'">1</p>
  35. <p>邮箱:</p><p v-text="item.enEmail ? item.enEmail : '暂无信息'">h</p>
  36. <p>电话:</p><p v-text="item.enTel ? item.enTel : '暂无信息'">1</p>
  37. <p>行业:</p><p v-text="item.enIndustry ? item.enIndustry : '暂无信息'">1</p>
  38. </div>
  39. </li>
  40. </ul>
  41. <div style="float: right;">
  42. <page :total="list.totalElements" :page-size="pageParams.count"
  43. :current="pageParams.page" v-on:childEvent="handleCurrentChange">
  44. </page>
  45. </div>
  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. </div>
  59. </template>
  60. <script>
  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: 20,
  71. page: 1
  72. }
  73. }
  74. },
  75. components: {
  76. Page
  77. },
  78. computed: {
  79. isInFrame () {
  80. if (this.$route.query.type === 'erp') {
  81. return true
  82. }
  83. },
  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. goodsSearch (type) {
  123. this.pageParams.page = 1
  124. this.$store.dispatch('supplier/loadVendorList', {page: this.pageParams.page, size: this.pageParams.count, keyword: type})
  125. },
  126. handleCurrentChange (type) {
  127. this.pageParams.page = type
  128. this.$store.dispatch('supplier/loadVendorList', {page: type, size: this.pageParams.count, keyword: this.searchCode})
  129. }
  130. }
  131. }
  132. </script>
  133. <style type="text/scss" lang="scss">
  134. .merchant{
  135. background: #ecf1f1 url(/images/supplier/banner.jpg)no-repeat;
  136. border-top:3px solid #000;
  137. padding-bottom:25px;
  138. margin-top:-1.5em;
  139. .el-dialog{
  140. width: 290px!important;
  141. .el-dialog__header{
  142. background: #4290f7;
  143. line-height: 40px;
  144. padding: 0 20px 0;
  145. .el-dialog__title{
  146. color:#fff;
  147. }
  148. .el-dialog__headerbtn:hover .el-dialog__close, .el-dialog__headerbtn:focus .el-dialog__close{
  149. color:#fff;
  150. }
  151. }
  152. .el-dialog__body{
  153. padding: 10px 20px;
  154. }
  155. .el-dialog__footer{
  156. text-align: center;
  157. a{
  158. display:inline-block;
  159. background: #3c7cf5;
  160. color:#fff;
  161. font-size: 14px;
  162. line-height: 30px;
  163. height:30px;
  164. padding:0 10px;
  165. border-radius:5px;
  166. }
  167. }
  168. }
  169. .form_dialog{
  170. p{
  171. width:200px;
  172. font-size: 14px;
  173. color:#666666;
  174. margin:0 auto;
  175. padding-top:5px;
  176. line-height: 20px;
  177. span{
  178. color:#eb6054;
  179. }
  180. }
  181. }
  182. .top{
  183. padding-top:30px;
  184. margin-bottom:40px;
  185. .title{
  186. margin:0 auto;
  187. text-align: center;
  188. width:215px;
  189. border-bottom:1px solid #ff5151;
  190. color:#fff;
  191. p{
  192. margin:0;
  193. }
  194. h2{
  195. font-size: 32px;
  196. margin:0;
  197. line-height: 46px;
  198. }
  199. &:before{
  200. content: '';
  201. display:block;
  202. position:relative;
  203. left:55px;
  204. top:61px;
  205. width:105px;
  206. height:1px;
  207. background: #ff8a00;
  208. }
  209. &:after{
  210. content: '';
  211. display:block;
  212. position:relative;
  213. left:55px;
  214. top:4px;
  215. width:105px;
  216. height:1px;
  217. background: #fff600;
  218. }
  219. }
  220. .search{
  221. float:right;
  222. width:310px;
  223. text-align: right;
  224. margin-right:10px;
  225. .btn{
  226. width:68px;
  227. background: #ffa200;
  228. color:#fff;
  229. }
  230. }
  231. }
  232. .list_info{
  233. padding: 0 10px;
  234. min-height:300px;
  235. margin-bottom:100px;
  236. .empty{
  237. height:418px;
  238. border:15px solid #c4e9f9;
  239. background: #eef9fd;
  240. padding-top:165px;
  241. text-align: center;
  242. img{
  243. vertical-align: top;
  244. margin-right:15px;
  245. }
  246. .info{
  247. display: inline-block;
  248. padding-top:10px;
  249. }
  250. }
  251. > ul{
  252. margin-left:5px;
  253. li{
  254. position:relative;
  255. vertical-align: top;
  256. width:267px;
  257. height:115px;
  258. border-radius:5px;
  259. margin-right:32px;
  260. margin-bottom:60px;
  261. background: #ffffff;
  262. box-shadow: 0 3px 10px rgba(0,0,0,.8);
  263. &:nth-child(4n) {
  264. margin-right:0;
  265. }
  266. &:after{
  267. content: '';
  268. display:block;
  269. position:absolute;
  270. top:99%;
  271. left:50%;
  272. z-index:200;
  273. width:88px;
  274. height:22px;
  275. margin-left:-44px;
  276. background: url(/images/supplier/icon/bottom_center_img.png)no-repeat;
  277. }
  278. .has_shop {
  279. position:absolute;
  280. right:0;
  281. top:0;
  282. width:68px;
  283. height:22px;
  284. background: url(/images/supplier/icon/top_right_img.png)no-repeat;
  285. color:#fff;
  286. font-weight: bold;
  287. text-align: center;
  288. line-height: 22px;
  289. }
  290. .enterprise_name{
  291. padding-top:15px;
  292. width:98%;
  293. overflow: hidden;
  294. text-overflow: ellipsis;
  295. white-space:nowrap;
  296. border-bottom:1px solid #b9def7;
  297. font-weight: bold;
  298. color:#1891e4;
  299. font-size: 18px;
  300. line-height: 48px;
  301. text-align: center;
  302. }
  303. .select_btn{
  304. position:absolute;
  305. bottom:-10px;
  306. left:50%;
  307. z-index:250;
  308. width:56px;
  309. height:56px;
  310. padding:10px 0;
  311. margin-left:-28px;
  312. text-align: center;
  313. line-height: 18px;
  314. background: #1891e4;
  315. border-radius:50%;
  316. color:#fff;
  317. }
  318. &:hover{
  319. cursor:pointer;
  320. .popups{
  321. top:99%;
  322. opacity:1;
  323. z-index:100;
  324. }
  325. }
  326. .popups{
  327. position:absolute;
  328. top:50px;
  329. left:0;
  330. background: #6c6c6c;
  331. width:267px;
  332. min-height:20px;
  333. padding:20px 15px 5px 10px;
  334. transition: all .5s ease;
  335. opacity: 0;
  336. color:#fff;
  337. overflow: hidden;
  338. p{
  339. float:left;
  340. margin: 0 !important;
  341. line-height: 18px;
  342. max-height:18px;
  343. overflow: hidden;
  344. text-overflow: ellipsis;
  345. white-space: nowrap;
  346. &:nth-child(2n-1){
  347. width:42px;
  348. }
  349. &:first-child{
  350. width:85px;
  351. }
  352. &:nth-child(2n){
  353. width:200px;
  354. }
  355. &:nth-child(2){
  356. width:155px;
  357. }
  358. &:nth-child(4){
  359. max-height:38px;
  360. overflow: hidden;
  361. white-space:pre-wrap;
  362. word-wrap:break-word;
  363. }
  364. &:last-child{
  365. overflow: hidden;
  366. text-overflow: ellipsis;
  367. white-space: nowrap;
  368. }
  369. }
  370. }
  371. }
  372. }
  373. }
  374. }
  375. </style>