index.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <basic-container>
  3. <avue-crud
  4. :key="key"
  5. ref="crud"
  6. :option="option"
  7. :data="data"
  8. :search.sync="search"
  9. @on-load="onLoad"
  10. @search-reset="query={}"
  11. :page.sync="page" >
  12. </avue-crud>
  13. </basic-container>
  14. </template>
  15. <script>
  16. import {statisticsSaleDetail} from "@/api/saleDetail";
  17. export default {
  18. data(){
  19. return {
  20. key: 0,
  21. search: {},
  22. data: [],
  23. total: [],
  24. query: {},
  25. page: {
  26. pageSize: 10,
  27. currentPage: 1,
  28. total: 0,
  29. pageSizes: [10, 50, 100, 200, 300]
  30. },
  31. option: {},
  32. }
  33. },
  34. methods:{
  35. // 获取列表数据
  36. onLoad(page, params = {}) {
  37. let queryParams = {
  38. size: page.pageSize,
  39. current: page.currentPage,
  40. ...Object.assign(params, this.search)
  41. }
  42. statisticsSaleDetail(queryParams).then(res => {
  43. this.data = res.data.data.records
  44. this.page.total = res.data.data.total
  45. this.option.height = window.innerHeight - 230;
  46. // generalLedgerTotal(queryParams).then(res=>{
  47. // this.total = res.data.data
  48. // })
  49. })
  50. },
  51. }
  52. }
  53. </script>
  54. <style scoped>
  55. </style>