index.vue 1.7 KB

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