history.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <el-dialog
  3. append-to-body
  4. title="历史明细"
  5. class="el-dialogDeep"
  6. :visible.sync="historyVisible"
  7. width="70%"
  8. :close-on-click-modal="false"
  9. :destroy-on-close="true"
  10. :close-on-press-escape="false"
  11. v-dialog-drag
  12. :before-close="closeDialog"
  13. >
  14. <avue-crud
  15. ref="historyCrud"
  16. :data="historyData"
  17. :option="historyOption"
  18. ></avue-crud>
  19. <span slot="footer" class="dialog-footer">
  20. <el-button @click="closeDialog">关 闭</el-button>
  21. </span>
  22. </el-dialog>
  23. </template>
  24. <script>
  25. import {historyPrice} from "@/api/dealer/sales";
  26. export default {
  27. name: "history",
  28. props: {
  29. params: {
  30. type: Object,
  31. default: {}
  32. }
  33. },
  34. data() {
  35. return {
  36. historyVisible: false,
  37. historyData: [],
  38. historyOption: {
  39. stripe: true,
  40. border: true,
  41. index: true,
  42. viewBtn: false,
  43. editBtn: false,
  44. delBtn: false,
  45. addBtn: false,
  46. menu: false,
  47. align: "center",
  48. menuWidth: "180",
  49. selection: false,
  50. tip: false,
  51. column: [
  52. {
  53. label: "价格",
  54. prop: "price",
  55. index: 1,
  56. overHidden: true
  57. },
  58. {
  59. label: "日期",
  60. prop: "businesDate",
  61. index: 2,
  62. overHidden: true
  63. },
  64. {
  65. label: "备注",
  66. prop: "remarks",
  67. index: 3,
  68. overHidden: true
  69. },
  70. ]
  71. },
  72. }
  73. },
  74. methods: {
  75. init() {
  76. this.historyVisible = true;
  77. historyPrice(this.params).then(res => {
  78. this.historyData = res.data.data? res.data.data: [];
  79. this.$set(this.historyOption, 'height', window.innerHeight - 240)
  80. })
  81. },
  82. // 关闭弹窗
  83. closeDialog() {
  84. this.historyVisible = false;
  85. this.historyData = [];
  86. this.$emit("closeDialog")
  87. },
  88. },
  89. }
  90. </script>
  91. <style scoped>
  92. </style>