index.vue 9.0 KB

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