index.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <template-page
  3. ref="pageRef"
  4. :get-list="getList"
  5. :table-attributes="tableAttributes"
  6. :table-events="tableEvents"
  7. :options-evens-group="optionsEvensGroup"
  8. :moreParameters="moreParameters"
  9. :column-parsing="columnParsing"
  10. :exportList="exportList"
  11. >
  12. </template-page>
  13. </template>
  14. <script>
  15. import TemplatePage from '@/components/template/template-page-1.vue'
  16. import import_mixin from '@/components/template/import_mixin.js'
  17. import {
  18. websitStockList,
  19. websitStockListExport,
  20. websitStockImportM,
  21. websitStockMakeImportM
  22. } from '@/api/inventoryManagement'
  23. import { commonTemplateDownload } from '@/api/common.js'
  24. import operation_mixin from '@/components/template/operation_mixin.js'
  25. export default {
  26. components: { TemplatePage },
  27. mixins: [import_mixin, operation_mixin],
  28. data() {
  29. return {
  30. // 表格属性
  31. tableAttributes: {
  32. // 启用勾选列
  33. selectColumn: false
  34. },
  35. // 表格事件
  36. tableEvents: {
  37. 'selection-change': this.selectionChange
  38. },
  39. // 勾选选中行
  40. recordSelected: []
  41. }
  42. },
  43. computed: {
  44. // 事件组合
  45. optionsEvensGroup() {
  46. return [
  47. [
  48. // [
  49. // this.optionsEvensAuth('template', {
  50. // click: () => {
  51. // commonTemplateDownload({ name: '辅材网点库存.xlsx' }, `${this.$route.meta.title}`)
  52. // .then(res => {
  53. // this.$message({
  54. // message: '下载成功',
  55. // type: 'success'
  56. // })
  57. // })
  58. // .catch(err => {
  59. // this.$message.error('下载失败')
  60. // })
  61. // }
  62. // })
  63. // ],
  64. // [
  65. // this.optionsEvensAuth('imp', ({ moduleName }) => {
  66. // return {
  67. // name: moduleName,
  68. // render: () => {
  69. // return this.importButton(websitStockImportM, moduleName)
  70. // }
  71. // }
  72. // })
  73. // ],
  74. [
  75. this.optionsEvensAuth('stockAuxiliaryMaterialsXz', {
  76. click: () => {
  77. commonTemplateDownload({ name: '辅材盘点网点库存.xlsx' }, `${this.$route.meta.title}`)
  78. .then(res => {
  79. this.$message({
  80. message: '下载成功',
  81. type: 'success'
  82. })
  83. })
  84. .catch(err => {
  85. this.$message.error('下载失败')
  86. })
  87. }
  88. })
  89. ],
  90. [
  91. this.optionsEvensAuth('stockAuxiliaryMaterials', ({ moduleName }) => {
  92. return {
  93. name: moduleName,
  94. render: () => {
  95. return this.importButton(websitStockMakeImportM, moduleName)
  96. }
  97. }
  98. })
  99. ]
  100. ]
  101. ]
  102. },
  103. // 更多参数
  104. moreParameters() {
  105. return []
  106. }
  107. },
  108. methods: {
  109. // 列表请求函数
  110. getList: websitStockList,
  111. // 列表导出函数
  112. exportList: websitStockListExport,
  113. // 表格列解析渲染数据更改
  114. columnParsing(item, defaultData) {
  115. return defaultData
  116. },
  117. // 监听勾选变化
  118. selectionChange(data) {
  119. this.recordSelected = data
  120. }
  121. }
  122. }
  123. </script>
  124. <style lang="scss" scoped></style>