qualityControlPlan.vue 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <div class="app-container">
  3. <SearchBoxVue class="filter-list-form" ref="SearchBoxRef" @search="handleSearch" @reset="handleReset" />
  4. <div class="filter-list-action">
  5. <el-row type="flex" justify="space-between" align="middle">
  6. <mPagination v-if="tableData && tableData.length !== 0" :data="paginationData" @pageChangeEvent="pageHasChanged"></mPagination>
  7. <el-row type="flex" justify="end" style="flex:1">
  8. <el-button @click="openAddPlanModal" type="primary">新建计划</el-button>
  9. </el-row>
  10. </el-row>
  11. <TableBoxVue :loading="loading" :data="tableData" ref="tableRef"/>
  12. </div>
  13. <AddPlanModalBoxVue ref="AddPlanModalBoxVueRef" @onUpdate="getList"/>
  14. </div>
  15. </template>
  16. <script>
  17. import mPagination from '@/components/m-pagination';
  18. import SearchBoxVue from '@/views/recordsRoom/qc/components/qualityControlPlan/SearchBox.vue'
  19. import TableBoxVue from '@/views/recordsRoom/qc/components/qualityControlPlan/TableBox.vue'
  20. import AddPlanModalBoxVue from '@/views/recordsRoom/qc/components/qualityControlPlan/AddPlanModal.vue'
  21. import pagination from '@/components/Pagination/index2.vue'
  22. import { getCaseAppealList } from '@/api/admin'
  23. export default {
  24. components: {
  25. mPagination,
  26. SearchBoxVue,
  27. TableBoxVue,
  28. pagination,
  29. AddPlanModalBoxVue
  30. },
  31. data() {
  32. return {
  33. loading: false,
  34. tableData: [],
  35. paginationData: {
  36. total: 0,
  37. currentPage: 1,
  38. pageSize: 10
  39. },
  40. }
  41. },
  42. created() {
  43. },
  44. mounted() {
  45. this.getList()
  46. },
  47. methods: {
  48. getList() {
  49. this.loading = true
  50. getCaseAppealList({
  51. ...this.$refs.SearchBoxRef.formData,
  52. page: this.paginationData.currentPage,
  53. page_size: this.paginationData.pageSize
  54. }).then(res => {
  55. this.paginationData.total = res.data.count
  56. this.tableData = res.data.list
  57. this.$refs.tableRef.selectedArray = []
  58. }).catch(error => {
  59. console.log(error)
  60. }).finally(() => {
  61. this.loading = false
  62. })
  63. },
  64. pageHasChanged() {
  65. this.getList()
  66. },
  67. handleSearch() {
  68. this.paginationData.currentPage = 1
  69. this.getList()
  70. },
  71. handleReset() {
  72. this.handleSearch()
  73. },
  74. openAddPlanModal() {
  75. this.$refs.AddPlanModalBoxVueRef.openModal()
  76. }
  77. }
  78. }
  79. </script>
  80. <style lang="scss" scoped>
  81. </style>