_uuid.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394
  1. <template>
  2. <div class="x-content" @click="onHideBox()">
  3. <div class="container">
  4. <div class="w-over-top">
  5. <div class="w-over">
  6. <h3>绑定企业</h3>
  7. <hr>
  8. <div class="bind-search">
  9. <div class="search">
  10. <input type="search" class="form-control" placeholder="输入企业名称查询"
  11. @click="onShowBox()"
  12. v-model="keyword">
  13. <i class="delete" @click="deleteSearch()"></i><i class="icon-search"></i>
  14. <ul class="list-unstyled" v-show="isShowBox" @mouseenter="hasBox=true" @mouseleave="hasBox=false">
  15. <li class="hit" v-text="keyword" @click="selectInfo(keyword)"></li>
  16. <template v-for="item in searchName.content">
  17. <li class="hit" @click="selectInfo(item)" v-text="item"></li>
  18. </template>
  19. </ul>
  20. </div>
  21. <div class="search-info">
  22. <h3 id="name"><i></i><span v-text="enterPrise">企业名称</span><em v-if="hasRegister && searchInfo.length <= 0">(未注册)</em></h3>
  23. <hr/>
  24. <div class="row">
  25. <div class="col-xs-3"><p>管理员</p></div>
  26. <div class="col-xs-9"><span v-text="searchInfo.admin ? searchInfo.admin.vipName : ''"></span></div>
  27. </div>
  28. <div class="row">
  29. <div class="col-xs-3"><p>企业法人</p></div>
  30. <div class="col-xs-9"><span v-text="searchInfo.corporation"></span></div>
  31. </div>
  32. <div class="row">
  33. <div class="col-xs-3"><p>营业执照</p></div>
  34. <div class="col-xs-9"><span v-text="searchInfo.businessCode"></span></div>
  35. </div>
  36. <div class="row">
  37. <div class="col-xs-3"><p>企业地址</p></div>
  38. <div class="col-xs-9"><span v-text="searchInfo.regAddress"></span></div>
  39. </div>
  40. </div>
  41. </div>
  42. <template v-if="hasRegister && !searchInfo">
  43. <a name="register" :href="`/register/enterpriseRegistration${this.$store.state.option.fullPath}`">立即注册</a>
  44. </template>
  45. <template v-if="hasRegister && searchInfo && searchInfo.admin">
  46. <a href="javascript:void(0)" @click="bingEnterPrise()">申请绑定</a>
  47. <p id="applyText">管理员审核通过后成功绑定</p>
  48. </template>
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. </template>
  54. <script>
  55. export default {
  56. layout: 'main',
  57. data () {
  58. return {
  59. keyword: '',
  60. number: 5,
  61. isShowBox: false,
  62. hasBox: false,
  63. clickInput: false,
  64. enterPrise: '企业名称',
  65. hasRegister: false
  66. }
  67. },
  68. watch: {
  69. 'keyword': function () {
  70. this.handleChange()
  71. }
  72. },
  73. created () {
  74. this.$store.dispatch('restForName')
  75. this.$store.dispatch('restForInfo')
  76. },
  77. computed: {
  78. searchName () {
  79. return this.$store.state.search.keywords.data.content ? this.$store.state.search.keywords.data.content : ''
  80. },
  81. searchInfo () {
  82. return this.$store.state.search.enterprise.data.content ? this.$store.state.search.enterprise.data.content : ''
  83. }
  84. },
  85. methods: {
  86. handleChange: function () {
  87. if (this.keyword) {
  88. this.isShowBox = true
  89. this.$store.dispatch('searchForName', {keyword: this.keyword, number: this.number})
  90. }
  91. },
  92. onShowBox: function () {
  93. if (this.isShowBox) {
  94. this.onHideBox()
  95. } else {
  96. this.isShowBox = true
  97. this.clickInput = true
  98. }
  99. },
  100. onHideBox: function () {
  101. if (!this.hasBox && !this.clickInput) {
  102. this.isShowBox = false
  103. } else {
  104. this.clickInput = false
  105. }
  106. },
  107. selectInfo: function (item) {
  108. this.isShowBox = false
  109. this.enterPrise = item
  110. this.hasRegister = true
  111. this.$store.dispatch('searchForInfo', { name: item })
  112. this.$store.dispatch('restForName')
  113. },
  114. deleteSearch: function () {
  115. this.keyword = ''
  116. this.enterPrise = '企业名称'
  117. this.hasRegister = false
  118. this.$store.dispatch('restForName')
  119. this.$store.dispatch('restForInfo')
  120. },
  121. bingEnterPrise: function () {
  122. let param = new FormData()
  123. param.append('userUU', this.$route.params.uuid)
  124. param.append('spaceUU', this.searchInfo.spaceUU)
  125. let config = {
  126. headers: {'Context-type': 'multipart/form-data'}
  127. }
  128. this.$http.post('/api/user/apply/bind', param, config)
  129. .then(res => {
  130. if (res.data.success) {
  131. this.$message({
  132. message: '申请成功,请耐心等待管理员审批',
  133. type: 'success'
  134. })
  135. }
  136. if (res.data.error) {
  137. this.$message.error(res.data.errMsg)
  138. }
  139. })
  140. }
  141. }
  142. }
  143. </script>
  144. <style scoped type="text/scss" lang="scss">
  145. .x-content {
  146. background: #eee;
  147. }
  148. .w-over-top {
  149. margin-top:50px;
  150. padding:50px 0;
  151. background: #fff;
  152. }
  153. .w-over-top .w-over>h3{
  154. font-size: 30px;
  155. text-align: center;
  156. color:#11b200;
  157. margin:0;
  158. }
  159. .w-over-top hr{
  160. border-top:1px solid #dcdcdc;
  161. }
  162. .w-over-top .w-over>p#applyText{
  163. text-align: center;
  164. font-size: 14px;
  165. color:#b5b5b5;
  166. margin-top:20px;
  167. }
  168. .w-over-top .w-over>strong{
  169. font-size: 14px;
  170. color:#b5b5b5;
  171. padding-top:20px;
  172. }
  173. .w-over-top .link-list .item{
  174. padding:15px 25px 0;
  175. width:170px;
  176. height:100px;
  177. box-shadow: 0 0 10px rgba(0,0,0,.5);
  178. }
  179. .w-over-top .link-list .item:hover{
  180. position:relative;
  181. top:-3px;
  182. cursor:pointer;
  183. }
  184. .w-over-top .link-list .item img{
  185. display:block;
  186. height:40px;
  187. }
  188. .w-over-top .link-list .item span{
  189. font-size: 16px;
  190. color:#333;
  191. font-weight: bold;
  192. }
  193. .w-over-top .link-list .item .caption{
  194. padding-top:12px;
  195. text-align: center;
  196. }
  197. .w-over-top .w-over>a{
  198. display: block;
  199. margin:0 auto;
  200. margin-top:60px;
  201. width:220px;
  202. height:42px;
  203. line-height: 42px;
  204. text-align: center;
  205. color:#fff;
  206. font-size: 14px;
  207. background: #0076ad;
  208. border-radius:5px;
  209. }
  210. .w-over-bottom {
  211. padding-top:35px;
  212. padding-bottom:50px;
  213. background: #fff;
  214. }
  215. .w-over-bottom .w-over>p{
  216. text-align: center;
  217. margin-bottom:25px;
  218. font-size: 16px;
  219. color:#646464;
  220. }
  221. .w-over-bottom .w-over>a{
  222. display:block;
  223. margin:0 auto;
  224. margin-bottom:45px;
  225. width:130px;
  226. height:32px;
  227. line-height: 30px;
  228. text-align: center;
  229. border-radius:15px;
  230. border:1px solid #0076ad;
  231. color:#0076ad;
  232. font-size: 14px;
  233. }
  234. .w-over-bottom .media{
  235. padding:10px;
  236. }
  237. .w-over-bottom .media-left{
  238. padding:10px 30px 10px 10px;
  239. width:190px;
  240. height:120px;
  241. }
  242. .w-over-bottom .media-left a{
  243. display:block;
  244. text-align: center;
  245. width:170px;
  246. height:100px;
  247. padding-top:20px;
  248. box-shadow: 0 0 10px rgba(0,0,0,.4);
  249. }
  250. .w-over-bottom .media-left a img{
  251. display:block;
  252. width:80px;
  253. height:30px;
  254. margin:0 auto;
  255. margin-bottom:16px;
  256. }
  257. .w-over-bottom .media-left a span{
  258. font-size: 16px;
  259. color:#333;
  260. font-weight: bold;
  261. }
  262. .w-over-bottom .media .media-body{
  263. padding-top:10px;
  264. }
  265. .w-over-bottom .media .media-body .media-heading{
  266. color:#333;
  267. font-weight: bold;
  268. font-size: 16px;
  269. margin-bottom:15px;
  270. }
  271. .w-over-bottom .media .media-body p{
  272. font-size: 14px;
  273. color:#8c8c8c;
  274. line-height: 25px;
  275. margin:0;
  276. }
  277. .w-over{
  278. width:880px;
  279. margin:0 auto;
  280. }
  281. .w-over-top .bind-search{
  282. width:500px;
  283. margin:0 auto;
  284. }
  285. .w-over-top .bind-search .search{
  286. position:relative;
  287. margin-top:40px;
  288. margin-bottom:40px;
  289. }
  290. .w-over-top .bind-search .search input{
  291. padding-right: 65px;
  292. }
  293. .w-over-top .bind-search .search i{
  294. position:absolute;
  295. top:7px;
  296. right:0;
  297. display:block;
  298. width:30px;
  299. height:30px;
  300. font-size: 20px;
  301. color: #cbcbcb;
  302. }
  303. .w-over-top .bind-search .search i.delete {
  304. right: 30px;
  305. top:9px;
  306. background: url('/img/over_account/delete.png')no-repeat;
  307. }
  308. .w-over-top .bind-search .search i.icon-search {
  309. right: 0;
  310. top:9px;
  311. background: url('/img/over_account/search.png')no-repeat;
  312. }
  313. .w-over-top .bind-search .search ul{
  314. position:absolute;
  315. top:100%;
  316. left:0;
  317. z-index:100;
  318. width:100%;
  319. max-height:226px;
  320. overflow-y:auto;
  321. border:1px solid #dcdcdc;
  322. background: #fff;
  323. padding:10px 0;
  324. }
  325. .w-over-top .bind-search .search li{
  326. height:34px;
  327. line-height: 34px;
  328. padding-left:12px;
  329. color:#010101;
  330. width:480px;
  331. overflow: hidden;
  332. text-overflow: ellipsis;
  333. white-space: nowrap;
  334. }
  335. .w-over-top .bind-search .search .list-name li em{
  336. color:#ff5c5c;
  337. }
  338. .w-over-top .bind-search .search li:hover{
  339. cursor:pointer;
  340. background: #f7f7f7;
  341. }
  342. .w-over-top .bind-search .search li.hit{
  343. color:#8c8c8c;
  344. }
  345. .w-over-top .bind-search .search-info{
  346. padding:20px;
  347. background: #f7f7f7;
  348. overflow: hidden;
  349. }
  350. .w-over-top .bind-search .search-info h3{
  351. font-size: 18px;
  352. color:#000;
  353. line-height: 20px;
  354. font-weight: bold;
  355. }
  356. .w-over-top .bind-search .search-info h3 i{
  357. display:inline-block;
  358. position:relative;
  359. top:5px;
  360. width:30px;
  361. height:20px;
  362. background:url('/img/over_account/business.png')no-repeat;
  363. }
  364. .w-over-top .bind-search .search-info h3 span{
  365. color:#787878;
  366. display:inline-block;
  367. vertical-align: bottom;
  368. width:310px;
  369. overflow: hidden;
  370. text-overflow: ellipsis;
  371. white-space: nowrap;
  372. }
  373. .w-over-top .bind-search .search-info h3 em{
  374. margin-left:10px;
  375. color:#e87405;
  376. font-style:normal;
  377. }
  378. .w-over-top .bind-search .search-info .row{
  379. margin-bottom:15px;
  380. }
  381. .w-over-top .bind-search .search-info .row p{
  382. font-weight: bold;
  383. font-size: 14px;
  384. color:#000;
  385. margin:0;
  386. }
  387. .w-over-top .bind-search .search-info .row span{
  388. font-size: 14px;
  389. color:#787878;
  390. }
  391. </style>