index.vue 8.7 KB

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