dealer_list.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <template-page
  3. ref="pageRef"
  4. :get-list="getList"
  5. :export-list="exportList"
  6. :operation="operation()"
  7. :options-evens-group="optionsEvensGroup"
  8. :column-parsing="columnParsing"
  9. >
  10. <Popu v-if="visible">
  11. <DealerListDetail :details-id="detailsId" @close="handleClose" />
  12. </Popu>
  13. </template-page>
  14. </template>
  15. <script>
  16. import TemplatePage from '@/components/template/template-page-1.vue'
  17. import import_mixin from '@/components/template/import_mixin.js'
  18. import add_callback_mixin from '@/components/template/add_callback_mixin.js'
  19. import Popu from '@/components/template/popu.vue'
  20. import { getDealerListV2, exportDealerListV2, importCustomerV2, exportJiaXianV2 } from '@/api/basic_data/dealer'
  21. import DealerListDetail from './components/dealer_list-detail.vue'
  22. export default {
  23. components: { TemplatePage, Popu, DealerListDetail },
  24. mixins: [import_mixin, add_callback_mixin],
  25. data() {
  26. return {
  27. visible: false,
  28. // 事件组合
  29. optionsEvensGroup: [
  30. [
  31. [
  32. {
  33. name: '导入',
  34. render: this.importButton(importCustomerV2)
  35. }
  36. ]
  37. ],
  38. [
  39. [
  40. {
  41. name: '导出提贷物流存货类别',
  42. click: p => {
  43. const loading = this.$loading({
  44. lock: true,
  45. text: 'Loading',
  46. spinner: 'el-icon-loading',
  47. background: 'rgba(0, 0, 0, 0.7)'
  48. })
  49. exportJiaXianV2(
  50. {
  51. pageNum: 1,
  52. pageSize: -1,
  53. params: this.$refs.pageRef.getParams().querylist
  54. },
  55. `${this.$route.meta.title}`
  56. )
  57. .then(_res => {
  58. this.$message({
  59. message: '导出成功',
  60. type: 'success'
  61. })
  62. })
  63. .catch(_err => {})
  64. .finally(() => loading.close())
  65. }
  66. }
  67. ]
  68. ]
  69. ],
  70. // 表格属性
  71. tableAttributes: {
  72. // 启用勾选列
  73. selectColumn: true
  74. }, // 关闭新增弹窗
  75. // 表格事件
  76. tableEvents: {
  77. 'selection-change': this.selectionChange
  78. },
  79. recordSelected: [],
  80. detailsId: ''
  81. }
  82. },
  83. methods: {
  84. // 列表请求函数
  85. getList(...p) {
  86. this.recordSelected = []
  87. return getDealerListV2(...p)
  88. },
  89. // 列表导出函数
  90. exportList: exportDealerListV2,
  91. // 表格列解析渲染数据更改
  92. columnParsing(_item, defaultData) {
  93. return defaultData
  94. },
  95. // 监听勾选变化
  96. selectionChange(data) {
  97. this.recordSelected = data
  98. },
  99. operation() {
  100. return (_h, { row, index, column }) => {
  101. return (
  102. <div class="operation-btns">
  103. <el-button
  104. size="mini"
  105. type="text"
  106. onClick={() => {
  107. this.visible = true
  108. this.detailsId = row.id
  109. }}
  110. >
  111. 查看
  112. </el-button>
  113. </div>
  114. )
  115. }
  116. },
  117. handleClose() {
  118. this.addOff(() => {
  119. this.visible = false
  120. })()
  121. }
  122. }
  123. }
  124. </script>
  125. <style lang="scss" scoped></style>