relation-list.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <div v-loading="loading">
  3. <div class="white-box">
  4. <div style="margin-bottom: 10px;">
  5. 会员编号:
  6. <el-input v-model="filterForm.userName" size="mini" style="width:200px;"></el-input>
  7. 深度:
  8. <el-input v-model="filterForm.deep" size="mini" style="width:60px;"></el-input>
  9. 期数:
  10. <el-input v-model="filterForm.periodNum" size="mini" style="width:60px;"></el-input>
  11. <el-button type="primary" size="small" @click="handleFilter">确定</el-button>
  12. </div>
  13. <el-table :data="tableData" stripe style="width: 100%;" :height="tool.getTableHeight()">
  14. <el-table-column label="会员编号" prop="USER_NAME">
  15. <template slot-scope="scope">
  16. <el-tag size="small" class="no-border">{{scope.row.BASE_INFO.USER_NAME}}</el-tag>
  17. </template>
  18. </el-table-column>
  19. <el-table-column label="会员姓名" prop="REAL_NAME">
  20. <template slot-scope="scope">
  21. <el-tag type="success" size="small" class="no-border">{{scope.row.BASE_INFO.REAL_NAME}}</el-tag>
  22. </template>
  23. </el-table-column>
  24. <el-table-column label="级别">
  25. <template slot-scope="scope">
  26. {{scope.row.BASE_INFO.DEC_LV_NAME}}
  27. </template>
  28. </el-table-column>
  29. <el-table-column label="聘级">
  30. <template slot-scope="scope">
  31. {{scope.row.BASE_INFO.EMP_LV_NAME}}
  32. </template>
  33. </el-table-column>
  34. <!--<el-table-column label="团队人数" prop="CHILD_NUM"></el-table-column>-->
  35. <el-table-column label="加入期数">
  36. <template slot-scope="scope">
  37. {{scope.row.BASE_INFO.PERIOD_AT}}
  38. </template>
  39. </el-table-column>
  40. <el-table-column label="代数" prop="TOP_DEEP"></el-table-column>
  41. <el-table-column label="省" prop="BASE_INFO.PROVINCE_NAME"></el-table-column>
  42. <el-table-column label="市" prop="BASE_INFO.CITY_NAME"></el-table-column>
  43. <el-table-column label="创建时间" width="170">
  44. <template slot-scope="scope">
  45. {{tool.formatDate(scope.row.CREATED_AT)}}
  46. </template>
  47. </el-table-column>
  48. <el-table-column fixed="right" label="操作" width="180">
  49. <template slot-scope="scope">
  50. <el-dropdown size="small" trigger="click">
  51. <el-button type="primary" size="small" @click.stop="">
  52. Operate on this data<i class="el-icon-arrow-down el-icon--right"></i>
  53. </el-button>
  54. <el-dropdown-menu slot="dropdown">
  55. <el-dropdown-item command="edit" @click.native="handleShow(scope.row)">查看下级</el-dropdown-item>
  56. </el-dropdown-menu>
  57. </el-dropdown>
  58. </template>
  59. </el-table-column>
  60. </el-table>
  61. <div class="white-box-footer">
  62. <el-button type="success" size="small" @click="handleExport">Export Excel</el-button>
  63. <pagination :total="totalCount" :page_size="pageSize" @size-change="handleSizeChange" @current-change="handleCurrentChange"></pagination>
  64. </div>
  65. </div>
  66. </div>
  67. </template>
  68. <script>
  69. import network from '@/utils/network'
  70. import tool from '@/utils/tool'
  71. import store from '@/utils/vuexStore'
  72. import baseInfo from '@/utils/baseInfo'
  73. import Pagination from '@/components/Pagination'
  74. export default {
  75. name: 'atlas_relation-list',
  76. components: {Pagination},
  77. mounted() {
  78. this.getData()
  79. store.state.socket.onMessageCallback = this.onMessageCallback
  80. },
  81. data() {
  82. return {
  83. allData: null,
  84. tableData: null,
  85. loading: true,
  86. currentPage: 1,
  87. totalPages: 1,
  88. totalCount: 1,
  89. pageSize: 20,
  90. tool: tool,
  91. baseDecLevels: baseInfo.decLevels(),
  92. baseEmpLevels: baseInfo.empLevels(),
  93. filterForm: {
  94. userName: null,
  95. deep: null,
  96. periodNum: null,
  97. },
  98. }
  99. },
  100. methods: {
  101. handleCurrentChange(page) {
  102. this.getData(page, this.pageSize)
  103. },
  104. handleSizeChange(pageSize) {
  105. this.getData(this.currentPage, pageSize)
  106. },
  107. handleFilter() {
  108. this.getData(1, this.pageSize)
  109. },
  110. handleShow(row) {
  111. this.loading = true
  112. this.filterForm.userName = row.BASE_INFO.USER_NAME
  113. this.filterForm.deep = 1
  114. this.getData(1, this.pageSize)
  115. },
  116. getData(page, pageSize) {
  117. let obj = this
  118. network.getPageData(this, 'atlas/relation-list', page, pageSize, this.filterForm, function (response) {
  119. obj.allData = response
  120. }).catch(response => {
  121. obj.loading = false
  122. })
  123. },
  124. handleExport(){
  125. this.$confirm(`确定要导出当前数据吗?`, 'Notice', {
  126. confirmButtonText: 'confirm', // 确定
  127. cancelButtonText: 'cancel', // 取消
  128. type: 'warning'
  129. }).then(() => {
  130. return network.getData(`atlas/relation-list-export`, this.filterForm)
  131. }).then(response => {
  132. this.$message({
  133. message: response,
  134. type: 'success'
  135. })
  136. }).catch(response => {
  137. })
  138. },
  139. onMessageCallback(data) {
  140. //this.getData(this.currentPage, this.pageSize, false)
  141. },
  142. }
  143. }
  144. </script>
  145. <style scoped>
  146. </style>