index.vue 9.5 KB

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