material_list.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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. </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 { getPurchaseOutListV2, setApprovalPurchaseOrderOut, exportPurchaseOutListV2 } from '@/api/supply/purchase'
  18. import { getWarehouseList } from '@/api/supply/apply'
  19. import { thisExpression } from '@babel/types'
  20. export default {
  21. components: { TemplatePage, Popu },
  22. mixins: [import_mixin, add_callback_mixin],
  23. data() {
  24. return {
  25. visible: false,
  26. // 事件组合
  27. optionsEvensGroup: [
  28. // [
  29. // [
  30. // {
  31. // name: '导入',
  32. // render: this.importButton(importCustomerV2)
  33. // }
  34. // ]
  35. // ],
  36. ],
  37. // 表格属性
  38. tableAttributes: {
  39. // 启用勾选列
  40. selectColumn: true
  41. }, // 关闭新增弹窗
  42. // 表格事件
  43. tableEvents: {
  44. 'selection-change': this.selectionChange
  45. },
  46. recordSelected: [],
  47. currentPage: 1, // 当前页码
  48. pageSize: 10, // 每页数量
  49. listTotal: 0, // 列表总数
  50. dataList: null, // 列表数据
  51. listLoading: false, // 列表加载loading
  52. screenForm: {
  53. billNo: '',
  54. correspondId: [],
  55. endTime: '',
  56. date: [],
  57. materialName: '',
  58. materialNumber: '',
  59. materialOldNumber: '',
  60. specification: '',
  61. startTime: '',
  62. supplierName: ''
  63. },
  64. isCollapse: true,
  65. warehouseList: []
  66. }
  67. },
  68. methods: {
  69. // 列表请求函数
  70. getList(...p) {
  71. this.recordSelected = []
  72. return getPurchaseOutListV2(...p)
  73. },
  74. // 列表导出函数
  75. exportList: exportPurchaseOutListV2,
  76. // 表格列解析渲染数据更改
  77. columnParsing(item, defaultData) {
  78. return defaultData
  79. },
  80. // 监听勾选变化
  81. selectionChange(data) {
  82. this.recordSelected = data
  83. },
  84. operation() {
  85. return (h, { row, index, column }) => {
  86. return (
  87. <div class="operation-btns">
  88. <el-popconfirm title="弃审吗?" onConfirm={() => this.handleUnapprove(row.id, row.billNo)}>
  89. <el-button slot="reference" type="text" size="mini">
  90. 弃审
  91. </el-button>
  92. </el-popconfirm>
  93. </div>
  94. )
  95. }
  96. },
  97. handleClose() {
  98. this.addOff(() => {
  99. this.visible = false
  100. })()
  101. },
  102. // 获取仓库列表
  103. getWarehouseList() {
  104. getWarehouseList({
  105. pageNum: 1,
  106. pageSize: -1
  107. }).then(res => {
  108. this.warehouseList = res.data.records
  109. })
  110. },
  111. handleUnapprove(id, billNo) {
  112. setApprovalPurchaseOrderOut({ id, billNo }).then(res => {
  113. this.$successMsg('弃审成功')
  114. this.$refs.pageRef.refreshList()
  115. })
  116. }
  117. }
  118. }
  119. </script>
  120. <style lang="scss" scoped></style>