index.vue 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <div class="subPage">
  3. <div class="system-table-search">
  4. <div class="flex-h">
  5. <div class="flex-item flex-h">
  6. <el-button size="mini" type="success" @click="redirection('addCase')">新增案场</el-button>
  7. </div>
  8. <tableSearch value="请输入案场名称" @exportSearchKey="searchList"></tableSearch>
  9. </div>
  10. <div class="moreFilter"></div>
  11. </div>
  12. <div class="system-table-box">
  13. <el-table
  14. :data="currentList"
  15. stripe
  16. style="width: 100%">
  17. <el-table-column
  18. prop="CaseId"
  19. label="ID">
  20. </el-table-column>
  21. <el-table-column
  22. prop="CaseName"
  23. label="案场名称">
  24. </el-table-column>
  25. <el-table-column
  26. prop="CaseAddress"
  27. label="地址">
  28. </el-table-column>
  29. <el-table-column label="操作" width="200">
  30. <template slot-scope="scope">
  31. <el-button
  32. size="mini"
  33. type="warning"
  34. @click="editItem(scope.$index, scope.row)">编辑</el-button>
  35. <el-button
  36. size="mini"
  37. type="success"
  38. @click="pplConcerned(scope.$index, scope.row)">相关人员</el-button>
  39. </template>
  40. </el-table-column>
  41. </el-table>
  42. </div>
  43. <el-pagination
  44. @current-change="handleCurrentChange"
  45. :current-page.sync="postData.page"
  46. :page-size="postData.pagesize"
  47. layout="prev, pager, next, jumper"
  48. :total="total">
  49. </el-pagination>
  50. </div>
  51. </template>
  52. <script>
  53. import tableSearch from '@/components/tableSearch/index'
  54. export default {
  55. name: '',
  56. data () {
  57. return {
  58. total: 0,
  59. postData: { // 表格搜索条件
  60. name: '', // 案场名称
  61. page: 1, // 当前页码
  62. pagesize: 10, // 请求数据量
  63. },
  64. currentList: []
  65. }
  66. },
  67. components: {
  68. tableSearch,
  69. },
  70. mounted () {
  71. this.$nextTick(function () { })
  72. },
  73. created () {
  74. this.getList()
  75. },
  76. methods: {
  77. pplConcerned (index, row) { // 相关人员
  78. this.$router.push({name: 'pplConcerned', query: {id: row.CaseId}})
  79. },
  80. getList () { // 获取列表
  81. this.$ajax(this.$api.caseManager.getCaseList.url, {
  82. method: this.$api.caseManager.getCaseList.method,
  83. queryData: this.postData
  84. }).then(res => {
  85. this.currentList = res.list
  86. this.postData.page = res.page
  87. this.total = res.pagenum
  88. })
  89. },
  90. redirection (pathName) { // 重定向
  91. this.$router.push({ name: pathName })
  92. },
  93. handleCurrentChange (val) { // 跳转到分页
  94. this.getList()
  95. },
  96. editItem (index, row) { // 修改
  97. // console.log(index, row)
  98. this.$router.push({ name: 'editCase', query: { id: row.CaseId } })
  99. },
  100. keyManager (index, row) { // 钥匙管理
  101. console.log(index, row)
  102. },
  103. searchList (key) { // 搜索列表
  104. this.postData.name = key
  105. this.currentList = []
  106. this.postData.page = 1
  107. this.getList()
  108. }
  109. }
  110. }
  111. </script>
  112. <!-- Add "scoped" attribute to limit CSS to this component only -->
  113. <style lang="scss" scoped>
  114. @import "page.scss";
  115. </style>