index.vue 3.1KB

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