index.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  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. <el-dialog
  85. title="温馨提示"
  86. :visible.sync="centerDialogVisible"
  87. width="30%">
  88. <span style="font-size: 14px;">您目前是个人账户登录,请 <strong>绑定企业</strong> </span>
  89. <span slot="footer" class="dialog-footer">
  90. <el-button type="primary" @click="centerDialogVisible = false">立即绑定</el-button>
  91. <el-button @click="centerDialogVisible = false">暂不绑定</el-button>
  92. </span>
  93. </el-dialog>
  94. </div>
  95. </template>
  96. <script>
  97. import Page from '~components/common/page/pageComponent.vue'
  98. export default {
  99. name: 'manager',
  100. layout: 'cloud',
  101. fetch ({store}) {
  102. return Promise.all([
  103. store.dispatch('loadApplyList', {page: 1, size: 20}),
  104. store.dispatch('loadMemberList', {page: 1, size: 20})
  105. ])
  106. },
  107. components: {
  108. Page
  109. },
  110. data () {
  111. return {
  112. centerDialogVisible: true,
  113. toggle: false,
  114. page: 1,
  115. count: 20
  116. }
  117. },
  118. created: function () {
  119. this.user.userspace ? this.centerDialogVisible = false : this.centerDialogVisible = true
  120. },
  121. computed: {
  122. user () {
  123. return this.$store.state.option.userInfo.data.content
  124. },
  125. apple () {
  126. return this.$store.state.cloudCenter.apple.data.content
  127. },
  128. member () {
  129. return this.$store.state.cloudCenter.member.data.content
  130. }
  131. },
  132. methods: {
  133. handleApplyChange: function (page) {
  134. this.$store.dispatch('loadApplyList', {page: page, size: 20})
  135. },
  136. handleMemberChange: function (page) {
  137. this.$store.dispatch('loadMemberList', {page: page, size: 20})
  138. },
  139. handleClick: function (type, item) {
  140. let param = new FormData()
  141. param.append('userUU', item.user.userUU)
  142. param.append('id', item.id)
  143. let config = {
  144. headers: {'Context-Type': 'multipart/form-data'}
  145. }
  146. if (type) {
  147. this.$http.post('/sso/center/agree/apply', param, config)
  148. .then(res => {
  149. if (res.data.success) {
  150. this.handleApplyChange()
  151. this.$message({
  152. message: '操作成功',
  153. type: 'success'
  154. })
  155. }
  156. if (res.data.error) {
  157. this.$message.error(res.data.errMsg)
  158. }
  159. })
  160. } else {
  161. this.$http.post('/sso/center/disagree/apply', param, config)
  162. .then(res => {
  163. if (res.data.success) {
  164. this.handleApplyChange()
  165. this.$message({
  166. message: '操作成功',
  167. type: 'success'
  168. })
  169. }
  170. if (res.data.error) {
  171. this.$message.error(res.data.mrrMsg)
  172. }
  173. })
  174. }
  175. }
  176. }
  177. }
  178. </script>
  179. <style scoped type="text/scss" lang="scss">
  180. .el-dialog__wrapper{
  181. z-index:10000;
  182. }
  183. .el-dialog__body{
  184. text-align: center;
  185. }
  186. .el-dialog__footer{
  187. text-align: center;
  188. }
  189. .manager{
  190. background: #eee;
  191. padding:50px 0 112px 30px;
  192. }
  193. .w-over-box .table-list{
  194. position:relative;
  195. padding:20px 30px;
  196. margin-bottom:10px;
  197. background: #fff;
  198. }
  199. .w-over-box .table-list .table-top{
  200. position:relative;
  201. }
  202. .w-over-box .table-list .table-top h3{
  203. font-size: 18px;
  204. color:#000;
  205. font-weight: bold;
  206. }
  207. .w-over-box .table-list .table-top a{
  208. display:inline-block;
  209. position:absolute;
  210. right:10px;
  211. top:0;
  212. width:88px;
  213. height:28px;
  214. line-height: 26px;
  215. text-align: center;
  216. color:#0076ad;
  217. border:1px solid #bfbfbf;
  218. border-radius:3px;
  219. }
  220. .w-over-box .table-list .table-top a:hover{
  221. cursor:pointer;
  222. }
  223. .w-over-box .table-list table thead tr th{
  224. font-size: 14px;
  225. color:#333;
  226. border-top:2px solid #ddd!important;
  227. line-height: 25px!important;
  228. }
  229. .w-over-box table tbody tr td{
  230. font-size: 14px;
  231. color:#999;
  232. border:none;
  233. line-height: 25px!important;
  234. }
  235. .w-over-box table tbody tr:hover{
  236. background: #d0e5f5;
  237. }
  238. .w-over-box table tbody tr td button.btn-apply{
  239. border:1px solid #0076ad;
  240. width:40px;
  241. height:22px;
  242. line-height: 20px;
  243. font-size: 12px;
  244. border-radius:0;
  245. color:#0076ad;
  246. background: #fff;
  247. padding:0;
  248. margin:0 5px;
  249. }
  250. .w-over-box table tbody tr td button.btn-apply:hover{
  251. background: #0076ad;
  252. color:#fff;
  253. }
  254. .w-over-box table tbody tr td span{
  255. color: #505050;
  256. font-size: 14px;
  257. }
  258. </style>