supplier_list.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <template>
  2. <template-page
  3. ref="pageRef"
  4. :getList="getList"
  5. :optionsEvensGroup="optionsEvensGroup"
  6. :exportList="exportList"
  7. :operation="operation()"
  8. :columnParsing="columnParsing"
  9. >
  10. <Popu v-if="visible">
  11. <supplier-list-detail :infoList="infoList" @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 { getListV2,exportListV2,getInfoApi } from '@/api/basic_data/supplier'
  21. import SupplierListDetail from './components/supplier_list-detail.vue'
  22. export default {
  23. components: { TemplatePage, Popu, SupplierListDetail },
  24. mixins: [import_mixin, add_callback_mixin],
  25. data() {
  26. return {
  27. visible: false,
  28. // 事件组合
  29. optionsEvensGroup: [],
  30. // 表格属性
  31. tableAttributes: {
  32. // 启用勾选列
  33. selectColumn: true
  34. }, // 关闭新增弹窗
  35. // 表格事件
  36. tableEvents: {
  37. 'selection-change': this.selectionChange
  38. },
  39. recordSelected: [],
  40. searchForm: {
  41. // 筛选表单数据
  42. name: ''
  43. },
  44. infoList: {},
  45. }
  46. },
  47. methods: {
  48. // 列表请求函数
  49. getList(...p) {
  50. this.recordSelected = []
  51. return getListV2(...p)
  52. },
  53. // 列表导出函数
  54. exportList: exportListV2,
  55. // 表格列解析渲染数据更改
  56. columnParsing(item, defaultData) {
  57. return defaultData
  58. },
  59. // 监听勾选变化
  60. selectionChange(data) {
  61. this.recordSelected = data
  62. },
  63. operation() {
  64. return (h, { row, index, column }) => {
  65. return (
  66. <div class="operation-btns">
  67. <el-button
  68. size="mini"
  69. type="text"
  70. onClick={async () => {
  71. this.visible = true
  72. const res = await getInfoApi({ id:row.id })
  73. this.infoList = res.data
  74. }}
  75. >
  76. 查看
  77. </el-button>
  78. </div>
  79. )
  80. }
  81. },
  82. handleClose() {
  83. this.addOff(() => {
  84. this.visible = false
  85. })()
  86. }
  87. }
  88. }
  89. </script>
  90. <style lang="scss" scoped></style>