index.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <div>
  3. <el-dialog title="查看关联盲票" :visible.sync="associationShow" :before-close="close">
  4. <el-table :data="associationData">
  5. <el-table-column property="boxId" label="盲票组Id" min-width="250" align="center"></el-table-column>
  6. <el-table-column property="title" label="盲票组名称" min-width="250" align="center"></el-table-column>
  7. <el-table-column property="status" label="状态" min-width="250" align="center">
  8. <template slot-scope="{row}">
  9. {{ row.status && JSON.parse(row.status).desc }}
  10. </template>
  11. </el-table-column>
  12. </el-table>
  13. <pagination :total="total" :page.sync="pageParams.pageNum" :limit.sync="pageParams.pageSize"
  14. @pagination="getList()"/>
  15. </el-dialog>
  16. </div>
  17. </template>
  18. <script>
  19. import {associationList} from "../../api/business/goods";
  20. export default {
  21. name: "camilo",
  22. props: {
  23. associationShow: {
  24. type: Boolean,
  25. default: true
  26. },
  27. associationGoodsId: {
  28. type: Number,
  29. default: 0
  30. },
  31. },
  32. data() {
  33. return {
  34. pageParams: {
  35. pageNum: 1,
  36. pageSize: 10
  37. },
  38. loading: false,
  39. associationData: [],
  40. total: 0,
  41. };
  42. },
  43. mounted() {
  44. this.getList()
  45. },
  46. methods: {
  47. close() {
  48. this.$emit('cancel')
  49. },
  50. getList() {
  51. if (this.loading) {
  52. return
  53. }
  54. this.loading = true
  55. associationList('pageNum=' + this.pageParams.pageNum + '&pageSize=' + this.pageParams.pageSize + '&', {goodsId: this.associationGoodsId}).then(res => {
  56. this.loading = false
  57. if (res.code === 0) {
  58. this.associationData = res.rows
  59. this.total = res.total
  60. }
  61. }).catch(() => {
  62. this.loading = false
  63. })
  64. },
  65. }
  66. }
  67. </script>
  68. <style lang="scss" scoped>
  69. </style>