index.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  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. middleware: 'authenticated',
  105. fetch ({store}) {
  106. return Promise.all([
  107. store.dispatch('loadApplyList', {page: 0, size: 20}),
  108. store.dispatch('loadMemberList', {page: 0, size: 20})
  109. ])
  110. },
  111. components: {
  112. Page
  113. },
  114. data () {
  115. return {
  116. centerDialogVisible: true,
  117. toggle: true,
  118. page: 0,
  119. count: 20
  120. }
  121. },
  122. created: function () {
  123. this.user.userspace ? this.centerDialogVisible = false : this.centerDialogVisible = true
  124. },
  125. computed: {
  126. user () {
  127. return this.$store.state.option.userInfo.data.content
  128. },
  129. apple () {
  130. return this.$store.state.cloudCenter.apple.data.content
  131. },
  132. member () {
  133. console.log(this.$store.state.cloudCenter.member.data.content)
  134. return this.$store.state.cloudCenter.member.data.content
  135. }
  136. },
  137. methods: {
  138. bingEnterpriseClick: function () {
  139. window.location.href = '/bindEnterPrise/' + this.user.user.userUU
  140. },
  141. noBingClick: function () {
  142. window.location.href = '/cloudcenter'
  143. this.centerDialogVisible = false
  144. },
  145. handleApplyChange: function (page) {
  146. this.$store.dispatch('loadApplyList', {page: page - 1, size: this.count})
  147. },
  148. handleMemberChange: function (page) {
  149. this.$store.dispatch('loadMemberList', {page: page - 1, size: this.count})
  150. },
  151. handleClick: function (type, item) {
  152. let param = new FormData()
  153. param.append('userUU', item.user.userUU)
  154. param.append('id', item.id)
  155. let config = {
  156. headers: {'Context-Type': 'multipart/form-data'}
  157. }
  158. if (type) {
  159. this.$http.post('/sso/center/agree/apply', param, config)
  160. .then(res => {
  161. if (res.data.success) {
  162. this.handleApplyChange()
  163. this.$message({
  164. message: '操作成功',
  165. type: 'success'
  166. })
  167. }
  168. if (res.data.error) {
  169. this.$message.error(res.data.errMsg)
  170. }
  171. })
  172. } else {
  173. this.$http.post('/sso/center/disagree/apply', param, config)
  174. .then(res => {
  175. if (res.data.success) {
  176. this.handleApplyChange()
  177. this.$message({
  178. message: '操作成功',
  179. type: 'success'
  180. })
  181. }
  182. if (res.data.error) {
  183. this.$message.error(res.data.mrrMsg)
  184. }
  185. })
  186. }
  187. }
  188. }
  189. }
  190. </script>
  191. <style scoped type="text/scss" lang="scss">
  192. .w-over-box table tbody tr:hover {
  193. background: #d0e5f5!important;
  194. }
  195. .table-striped>tbody>tr:nth-of-type(even){
  196. background: #f4f4f4!important;
  197. }
  198. .table-striped>tbody>tr:nth-of-type(odd){
  199. background: #fff!important;
  200. }
  201. .manager{
  202. background: #eee;
  203. padding:50px 0 112px 30px;
  204. }
  205. .w-over-box .table-list{
  206. position:relative;
  207. padding:20px 30px;
  208. margin-bottom:10px;
  209. background: #fff;
  210. }
  211. .w-over-box .table-list .table-top{
  212. position:relative;
  213. }
  214. .w-over-box .table-list .table-top h3{
  215. font-size: 18px;
  216. color:#000;
  217. font-weight: bold;
  218. }
  219. .w-over-box .table-list .table-top a{
  220. display:inline-block;
  221. position:absolute;
  222. right:10px;
  223. top:0;
  224. width:88px;
  225. height:28px;
  226. line-height: 26px;
  227. text-align: center;
  228. color:#0076ad;
  229. border:1px solid #bfbfbf;
  230. border-radius:3px;
  231. }
  232. .w-over-box .table-list .table-top a:hover{
  233. cursor:pointer;
  234. }
  235. .w-over-box .table-list table thead tr th{
  236. font-size: 14px;
  237. color:#333;
  238. border-top:2px solid #ddd!important;
  239. line-height: 25px!important;
  240. }
  241. .w-over-box table tbody tr td{
  242. font-size: 14px;
  243. color:#999;
  244. border:none;
  245. line-height: 25px!important;
  246. }
  247. .w-over-box table tbody tr:hover{
  248. background: #d0e5f5;
  249. }
  250. .w-over-box table tbody tr td button.btn-apply{
  251. border:1px solid #0076ad;
  252. width:40px;
  253. height:22px;
  254. line-height: 20px;
  255. font-size: 12px;
  256. border-radius:0;
  257. color:#0076ad;
  258. background: #fff;
  259. padding:0;
  260. margin:0 5px;
  261. }
  262. .w-over-box table tbody tr td button.btn-apply:hover{
  263. background: #0076ad;
  264. color:#fff;
  265. }
  266. .w-over-box table tbody tr td span{
  267. color: #505050;
  268. font-size: 14px;
  269. }
  270. </style>