subMerchant.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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. :replace-or-not-map="false"
  10. >
  11. <Popu v-if="visible">
  12. <SubMerchantForm v-if="moduleType === 1 || moduleType === 3 || moduleType === 4" :module-type="moduleType" :details-id="detailsId" @close="handleClose" />
  13. <SubMerchantDetail v-if="moduleType === 2" :details-id="detailsId" @close="handleClose" />
  14. </Popu>
  15. </template-page>
  16. </template>
  17. <script>
  18. import TemplatePage from '@/components/template/template-page-1.vue'
  19. import import_mixin from '@/components/template/import_mixin.js'
  20. import add_callback_mixin from '@/components/template/add_callback_mixin.js'
  21. import Popu from '@/components/template/popu.vue'
  22. import { getStagecustomerListV2, exportStagecustomerV2 } from '@/api/basic_data/dealer'
  23. import SubMerchantDetail from './components/subMerchantDetail.vue'
  24. import SubMerchantForm from './components/subMerchantForm.vue'
  25. export default {
  26. components: { TemplatePage, Popu, SubMerchantDetail, SubMerchantForm },
  27. mixins: [import_mixin, add_callback_mixin],
  28. data() {
  29. return {
  30. visible: false,
  31. // 事件组合
  32. optionsEvensGroup: [
  33. [
  34. [
  35. {
  36. name: '新增',
  37. click: this.addOn(() => {
  38. this.visible = true
  39. this.moduleType = 1
  40. })
  41. // isRole: this.$checkBtnRole('add', this.$route.meta.roles)
  42. }
  43. ]
  44. ]
  45. ],
  46. // 表格属性
  47. tableAttributes: {
  48. // 启用勾选列
  49. selectColumn: true
  50. }, // 关闭新增弹窗
  51. // 表格事件
  52. tableEvents: {
  53. 'selection-change': this.selectionChange
  54. },
  55. recordSelected: [],
  56. detailsId: ''
  57. }
  58. },
  59. methods: {
  60. // 列表请求函数
  61. getList(...p) {
  62. this.recordSelected = []
  63. return getStagecustomerListV2(...p)
  64. },
  65. // 列表导出函数
  66. exportList: exportStagecustomerV2,
  67. // 表格列解析渲染数据更改
  68. columnParsing(item, defaultData) {
  69. return defaultData
  70. },
  71. // 监听勾选变化
  72. selectionChange(data) {
  73. this.recordSelected = data
  74. },
  75. operation() {
  76. return (h, { row, index, column }) => {
  77. return (
  78. <div class='operation-btns'>
  79. <el-button
  80. size='mini'
  81. type='text'
  82. onClick={ () => {
  83. this.visible = true
  84. this.moduleType = 2
  85. this.detailsId = row.id
  86. }}
  87. >
  88. 查看
  89. </el-button>
  90. {row.examineStatus === 'SAVE' || row.examineStatus === 'WAIT'
  91. ? <el-button
  92. size='mini'
  93. type='text'
  94. onClick={ () => {
  95. this.visible = true
  96. this.moduleType = 4
  97. this.detailsId = row.id
  98. }}
  99. >
  100. 编辑
  101. </el-button> : null
  102. }
  103. {row.examineStatus === 'SAVE' || row.examineStatus === 'WAIT'
  104. ? <el-button
  105. size='mini'
  106. type='text'
  107. onClick={ () => {
  108. this.visible = true
  109. this.moduleType = 3
  110. this.detailsId = row.id
  111. }}
  112. >
  113. 审核
  114. </el-button> : null
  115. }
  116. </div>
  117. )
  118. }
  119. },
  120. handleClose() {
  121. this.addOff(() => {
  122. this.visible = false
  123. })()
  124. this.$refs.pageRef.refreshList()
  125. }
  126. }
  127. }
  128. </script>
  129. <style lang="scss" scoped></style>