index.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. <template>
  2. <div class="manager">
  3. <template v-if="!centerDialogVisible">
  4. <!--企业管理成员列表部分-->
  5. <div class="us-member w-over-box" v-if="toggle">
  6. <div class="container">
  7. <div class="table-list">
  8. <div class="table-top">
  9. <h3>成员列表</h3>
  10. <a class="btn-us-apply" @click="toggle = !toggle">申请列表</a>
  11. </div>
  12. <table class="table table-striped" v-if="member.content.length !== 0">
  13. <thead>
  14. <tr>
  15. <th>角色</th>
  16. <th>用户名称</th>
  17. <th>个人UU</th>
  18. <th>手机号</th>
  19. <th>邮箱</th>
  20. </tr>
  21. </thead>
  22. <tbody>
  23. <tr v-for="item in member.content">
  24. <td >管理员</td>
  25. <td v-text="item.vipName ? item.vipName : ''">李事业</td>
  26. <td v-text="item.userUU ? item.userUU : ''">U456</td>
  27. <td v-text="item.mobile ? item.mobile : ''">123456799+66</td>
  28. <td v-text="item.email ? item.email : ''">112456112@qq.com</td>
  29. </tr>
  30. </tbody>
  31. </table>
  32. <div style="text-align: center;color:#333;height:100px;line-height: 100px;" v-if="member.content.length === 0">现在没有可以申请的列表哦!</div>
  33. <page :total="member.totalElements" :page-size="count"
  34. :current="page" @childEvent="handleApplyChange">
  35. </page>
  36. </div>
  37. </div>
  38. </div>
  39. <!--企业管理申请列表部分-->
  40. <div class="us-apply w-over-box" v-else>
  41. <div class="container">
  42. <div class="table-list">
  43. <div class="table-top">
  44. <h3>申请列表</h3>
  45. <a class="btn-us-member" @click="toggle = !toggle">成员列表</a>
  46. </div>
  47. <table class="table table-striped" v-if="apple.content.length !== 0">
  48. <thead>
  49. <tr>
  50. <th>操作</th>
  51. <th>用户名称</th>
  52. <th>个人UU</th>
  53. <th>手机号</th>
  54. <th>邮箱</th>
  55. </tr>
  56. </thead>
  57. <tbody>
  58. <tr v-for="item in apple.content">
  59. <td v-if="item.status === 311">
  60. <button class="btn btn-apply" @click="handleClick(true, item)">同意</button>
  61. <button class="btn btn-apply" @click="handleClick(false, item)">拒绝</button>
  62. </td>
  63. <td v-if="item.status === 316">
  64. 已同意
  65. </td>
  66. <td v-if="item.status === 317">
  67. 已拒绝
  68. </td>
  69. <td v-text="item.user.vipName ? item.user.vipName : ''">李事业</td>
  70. <td v-text="item.user.userUU ? item.user.userUU : ''">U456</td>
  71. <td v-text="item.user.mobile ? item.user.mobile : ''">123456799+66</td>
  72. <td v-text="item.user.email ? item.user.email : ''">112456112@qq.com</td>
  73. </tr>
  74. </tbody>
  75. </table>
  76. <div style="text-align: center; color:#333;height:100px;line-height: 100px;" v-if="apple.content.length === 0">现在没有可以申请的列表哦!</div>
  77. <page :total="apple.totalElements" :page-size="count"
  78. :current="page" @childEvent="handleMemberChange">
  79. </page>
  80. </div>
  81. </div>
  82. </div>
  83. </template>
  84. <template>
  85. <el-dialog class="center"
  86. title="温馨提示"
  87. :visible.sync="centerDialogVisible"
  88. width="30%"
  89. @close="noBingClick">
  90. <span style="font-size: 14px;">您目前是个人账户登录,请 <strong>绑定企业</strong>。 </span>
  91. <span slot="footer" class="dialog-footer">
  92. <el-button type="primary" @click="bingEnterpriseClick">立即绑定</el-button>
  93. <el-button @click="noBingClick">暂不绑定</el-button>
  94. </span>
  95. </el-dialog>
  96. </template>
  97. </div>
  98. </template>
  99. <script>
  100. import Page from '~components/common/page/pageComponent.vue'
  101. export default {
  102. name: 'manager',
  103. layout: 'cloud',
  104. fetch ({store}) {
  105. return Promise.all([
  106. store.dispatch('loadApplyList', {page: 1, size: 20}),
  107. store.dispatch('loadMemberList', {page: 1, size: 20})
  108. ])
  109. },
  110. components: {
  111. Page
  112. },
  113. data () {
  114. return {
  115. centerDialogVisible: true,
  116. toggle: false,
  117. page: 1,
  118. count: 20
  119. }
  120. },
  121. created: function () {
  122. this.user.userspace ? this.centerDialogVisible = false : this.centerDialogVisible = true
  123. },
  124. computed: {
  125. user () {
  126. return this.$store.state.option.userInfo.data.content
  127. },
  128. apple () {
  129. return this.$store.state.cloudCenter.apple.data.content
  130. },
  131. member () {
  132. return this.$store.state.cloudCenter.member.data.content
  133. }
  134. },
  135. methods: {
  136. bingEnterpriseClick: function () {
  137. window.location.href = '/bingEnterPrise'
  138. },
  139. noBingClick: function () {
  140. window.location.href = '/cloudcenter'
  141. this.centerDialogVisible = false
  142. },
  143. handleApplyChange: function (page) {
  144. this.$store.dispatch('loadApplyList', {page: page, size: 20})
  145. },
  146. handleMemberChange: function (page) {
  147. this.$store.dispatch('loadMemberList', {page: page, size: 20})
  148. },
  149. handleClick: function (type, item) {
  150. let param = new FormData()
  151. param.append('userUU', item.user.userUU)
  152. param.append('id', item.id)
  153. let config = {
  154. headers: {'Context-Type': 'multipart/form-data'}
  155. }
  156. if (type) {
  157. this.$http.post('/sso/center/agree/apply', param, config)
  158. .then(res => {
  159. if (res.data.success) {
  160. this.handleApplyChange()
  161. this.$message({
  162. message: '操作成功',
  163. type: 'success'
  164. })
  165. }
  166. if (res.data.error) {
  167. this.$message.error(res.data.errMsg)
  168. }
  169. })
  170. } else {
  171. this.$http.post('/sso/center/disagree/apply', param, config)
  172. .then(res => {
  173. if (res.data.success) {
  174. this.handleApplyChange()
  175. this.$message({
  176. message: '操作成功',
  177. type: 'success'
  178. })
  179. }
  180. if (res.data.error) {
  181. this.$message.error(res.data.mrrMsg)
  182. }
  183. })
  184. }
  185. }
  186. }
  187. }
  188. </script>
  189. <style scoped type="text/scss" lang="scss">
  190. .w-over-box table tbody tr:hover {
  191. background: #d0e5f5!important;
  192. }
  193. .table-striped>tbody>tr:nth-of-type(even){
  194. background: #f4f4f4!important;
  195. }
  196. .table-striped>tbody>tr:nth-of-type(odd){
  197. background: #fff!important;
  198. }
  199. .manager{
  200. background: #eee;
  201. padding:50px 0 112px 30px;
  202. }
  203. .w-over-box .table-list{
  204. position:relative;
  205. padding:20px 30px;
  206. margin-bottom:10px;
  207. background: #fff;
  208. }
  209. .w-over-box .table-list .table-top{
  210. position:relative;
  211. }
  212. .w-over-box .table-list .table-top h3{
  213. font-size: 18px;
  214. color:#000;
  215. font-weight: bold;
  216. }
  217. .w-over-box .table-list .table-top a{
  218. display:inline-block;
  219. position:absolute;
  220. right:10px;
  221. top:0;
  222. width:88px;
  223. height:28px;
  224. line-height: 26px;
  225. text-align: center;
  226. color:#0076ad;
  227. border:1px solid #bfbfbf;
  228. border-radius:3px;
  229. }
  230. .w-over-box .table-list .table-top a:hover{
  231. cursor:pointer;
  232. }
  233. .w-over-box .table-list table thead tr th{
  234. font-size: 14px;
  235. color:#333;
  236. border-top:2px solid #ddd!important;
  237. line-height: 25px!important;
  238. }
  239. .w-over-box table tbody tr td{
  240. font-size: 14px;
  241. color:#999;
  242. border:none;
  243. line-height: 25px!important;
  244. }
  245. .w-over-box table tbody tr:hover{
  246. background: #d0e5f5;
  247. }
  248. .w-over-box table tbody tr td button.btn-apply{
  249. border:1px solid #0076ad;
  250. width:40px;
  251. height:22px;
  252. line-height: 20px;
  253. font-size: 12px;
  254. border-radius:0;
  255. color:#0076ad;
  256. background: #fff;
  257. padding:0;
  258. margin:0 5px;
  259. }
  260. .w-over-box table tbody tr td button.btn-apply:hover{
  261. background: #0076ad;
  262. color:#fff;
  263. }
  264. .w-over-box table tbody tr td span{
  265. color: #505050;
  266. font-size: 14px;
  267. }
  268. </style>