preposition_stock_list.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <template-page ref="pageRef" :get-list="getList" :export-list="exportList" :column-parsing="columnParsing" :options-evens-group="optionsEvensGroup" />
  3. </template>
  4. <script>
  5. import TemplatePage from '@/components/template/template-page-1.vue'
  6. import import_mixin from '@/components/template/import_mixin.js'
  7. import { getcustomerFrontList, partsNewInExport, kunCunImportData, kunCunTiaoImportData, downloadkunCunDownload } from '@/api/stock'
  8. export default {
  9. components: { TemplatePage },
  10. mixins: [import_mixin],
  11. data() {
  12. return {
  13. // 事件组合
  14. optionsEvensGroup: [[
  15. [
  16. {
  17. name: '导入',
  18. render: this.importButton(kunCunImportData, '库存初始化')
  19. }
  20. ]
  21. ],
  22. [
  23. [
  24. {
  25. name: '导入',
  26. render: this.importButton(kunCunTiaoImportData, '库存调整')
  27. }
  28. ]
  29. ],
  30. [
  31. [
  32. {
  33. name: '导入模版',
  34. click: () => {
  35. downloadkunCunDownload({}, `${this.$route.meta.title}`)
  36. .then(_res => {
  37. this.$message({
  38. message: '下载成功',
  39. type: 'success'
  40. })
  41. })
  42. .catch(_err => {
  43. this.$message.error('下载失败')
  44. })
  45. }
  46. }
  47. ]
  48. ]],
  49. // 表格属性
  50. tableAttributes: {
  51. // 启用勾选列
  52. selectColumn: true
  53. },
  54. // 表格事件
  55. tableEvents: {
  56. 'selection-change': this.selectionChange
  57. },
  58. recordSelected: []
  59. }
  60. },
  61. methods: {
  62. // 列表请求函数
  63. getList(...p) {
  64. this.recordSelected = []
  65. return getcustomerFrontList(...p)
  66. },
  67. // 列表导出函数
  68. exportList: partsNewInExport,
  69. // 表格列解析渲染数据更改
  70. columnParsing(_item, defaultData) {
  71. return defaultData
  72. },
  73. // 监听勾选变化
  74. selectionChange(data) {
  75. this.recordSelected = data
  76. }
  77. // 批量删除
  78. // dels() {
  79. // if (this.recordSelected.length) {
  80. // this.$confirm('此操作将删除数据, 是否继续?', '提示', {
  81. // confirmButtonText: '确定',
  82. // cancelButtonText: '取消',
  83. // type: 'warning'
  84. // })
  85. // .then(() => {
  86. // partsOldOutDel({
  87. // ids: this.recordSelected.map(item => item.id).join(',')
  88. // })
  89. // .then(res => {
  90. // this.$refs.pageRef.refreshList()
  91. // this.$message({
  92. // type: 'success',
  93. // message: '删除成功!'
  94. // })
  95. // })
  96. // .catch(() => {
  97. // this.$message({
  98. // type: 'error',
  99. // message: '删除失败'
  100. // })
  101. // })
  102. // })
  103. // .catch(() => {
  104. // this.$message({
  105. // type: 'info',
  106. // message: '已取消删除'
  107. // })
  108. // })
  109. // } else {
  110. // this.$message({
  111. // type: 'info',
  112. // message: '请先勾选需要删除的数据!'
  113. // })
  114. // }
  115. // }
  116. }
  117. }
  118. </script>
  119. <style lang="scss" scoped></style>