purchase_list.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <template-page
  3. ref="pageRef"
  4. :getList="getList"
  5. :exportList="exportList"
  6. :operation="operation()"
  7. :optionsEvensGroup="optionsEvensGroup"
  8. :columnParsing="columnParsing"
  9. >
  10. <Popu v-if="visible">
  11. <PurchaseDetail :listItem="queryItem" @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 { getPurchaseOrderListV2,exportPurchaseOrderV2 } from '@/api/supply/purchase'
  21. import PurchaseDetail from '@/views/supply/purchase/components/purchase_detail'
  22. export default {
  23. components: { TemplatePage, Popu, PurchaseDetail },
  24. mixins: [import_mixin, add_callback_mixin],
  25. data() {
  26. return {
  27. visible: false,
  28. // 事件组合
  29. optionsEvensGroup: [
  30. ],
  31. // 表格属性
  32. tableAttributes: {
  33. // 启用勾选列
  34. selectColumn: true
  35. }, // 关闭新增弹窗
  36. // 表格事件
  37. tableEvents: {
  38. 'selection-change': this.selectionChange
  39. },
  40. recordSelected: [],
  41. currentPage: 1, // 当前页码
  42. pageSize: 10, // 每页数量
  43. listTotal: 0, // 列表总数
  44. dataList: null, // 列表数据
  45. listLoading: false, // 列表加载loading
  46. screenForm: {
  47. // 筛选表单数据
  48. business: '',
  49. supplier: '',
  50. date: []
  51. },
  52. isCollapse: true,
  53. queryItem: {}
  54. }
  55. },
  56. methods: {
  57. // 列表请求函数
  58. getList(...p) {
  59. this.recordSelected = []
  60. return getPurchaseOrderListV2(...p)
  61. },
  62. // 列表导出函数
  63. exportList: exportPurchaseOrderV2,
  64. // 表格列解析渲染数据更改
  65. columnParsing(item, defaultData) {
  66. return defaultData
  67. },
  68. // 监听勾选变化
  69. selectionChange(data) {
  70. this.recordSelected = data
  71. },
  72. operation() {
  73. return (h, { row, index, column }) => {
  74. return (
  75. <div class="operation-btns">
  76. <el-button
  77. size="mini"
  78. type="text"
  79. onClick={ () => {
  80. this.visible = true
  81. this.toDetail(row)
  82. }}
  83. >
  84. 详情
  85. </el-button>
  86. </div>
  87. )
  88. }
  89. },
  90. handleClose() {
  91. this.addOff(() => {
  92. this.visible = false
  93. })()
  94. },
  95. // 进入详情
  96. toDetail(item) {
  97. this.queryItem = item
  98. },
  99. }
  100. }
  101. </script>
  102. <style lang="scss" scoped></style>