barcodeVerification.vue 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <template-page
  3. ref="pageRef"
  4. :get-list="getList"
  5. :export-list="exportList"
  6. :options-evens-group="optionsEvensGroup"
  7. :column-parsing="columnParsing"
  8. >
  9. <Popu v-if="visible" />
  10. </template-page>
  11. </template>
  12. <script>
  13. import TemplatePage from '@/components/template/template-page-1.vue'
  14. import import_mixin from '@/components/template/import_mixin.js'
  15. import add_callback_mixin from '@/components/template/add_callback_mixin.js'
  16. import Popu from '@/components/template/popu.vue'
  17. import { getListCustomerCheckV2, exportListCustomerCheck, importListCustomerCheck, listCustomerCheckDownload } from '@/api/barcode'
  18. export default {
  19. components: { TemplatePage, Popu },
  20. mixins: [import_mixin, add_callback_mixin],
  21. data() {
  22. return {
  23. visible: false,
  24. // 事件组合
  25. optionsEvensGroup: [
  26. [
  27. [
  28. {
  29. name: '导入',
  30. render: this.importButton(importListCustomerCheck)
  31. }
  32. ]
  33. ],
  34. [
  35. [
  36. {
  37. name: '导入模版',
  38. click: () => {
  39. listCustomerCheckDownload({}, `${this.$route.meta.title}`)
  40. .then(res => {
  41. this.$message({
  42. message: '下载成功',
  43. type: 'success'
  44. })
  45. })
  46. .catch(_err => {
  47. this.$message.error('下载失败')
  48. })
  49. }
  50. }
  51. ]
  52. ]
  53. ],
  54. // 表格属性
  55. tableAttributes: {
  56. // 启用勾选列
  57. selectColumn: true
  58. }, // 关闭新增弹窗
  59. // 表格事件
  60. tableEvents: {
  61. 'selection-change': this.selectionChange
  62. },
  63. recordSelected: []
  64. }
  65. },
  66. methods: {
  67. // 列表请求函数
  68. getList(...p) {
  69. this.recordSelected = []
  70. return getListCustomerCheckV2(...p)
  71. },
  72. // 列表导出函数
  73. exportList: exportListCustomerCheck,
  74. // 表格列解析渲染数据更改
  75. columnParsing(item, defaultData) {
  76. return defaultData
  77. },
  78. // 监听勾选变化
  79. selectionChange(data) {
  80. this.recordSelected = data
  81. },
  82. operation() {
  83. return (h, { row, index, column }) => {
  84. return <div class='operation-btns'></div>
  85. }
  86. },
  87. handleClose() {
  88. this.addOff(() => {
  89. this.visible = false
  90. })()
  91. }
  92. }
  93. }
  94. </script>
  95. <style lang="scss" scoped></style>