reconciliationDetail.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <div class="warp">
  3. <template-page
  4. ref="pageRefItem"
  5. :get-list="getList"
  6. :export-list="exportList"
  7. :options-evens-group="optionsEvensGroup"
  8. :column-parsing="columnParsing"
  9. :table-attributes="tableAttributes"
  10. :table-events="tableEvents"
  11. :replace-or-not-map="false"
  12. >
  13. <ExceptionBox :visible="visible" :detail="detail" :record-selected="recordSelected" @close="handleClose" />
  14. </template-page>
  15. </div>
  16. </template>
  17. <script>
  18. import ExceptionBox from './ExceptionBox.vue'
  19. import TemplatePage from '@/components/template/template-page-1.vue'
  20. import import_mixin from '@/components/template/import_mixin.js'
  21. import add_callback_mixin from '@/components/template/add_callback_mixin.js'
  22. import { getListCostBillV2 } from '@/api/logisticsBill'
  23. import { dataTool } from 'echarts'
  24. export default {
  25. components: { TemplatePage, ExceptionBox },
  26. mixins: [import_mixin, add_callback_mixin],
  27. props: {
  28. orderCode: {
  29. type: String,
  30. default: null
  31. },
  32. detail: {
  33. type: Object,
  34. default: () => {
  35. return {}
  36. }
  37. },
  38. param: {
  39. type: String,
  40. default: null
  41. }
  42. },
  43. data() {
  44. return {
  45. visible: false,
  46. // 事件组合
  47. optionsEvensGroup: [
  48. [
  49. [
  50. {
  51. name: '账单异常',
  52. click: async() => {
  53. if (this.recordSelected.length === 0) {
  54. this.$message.error('请选择需要处理的数据')
  55. return
  56. }
  57. this.visible = true
  58. }
  59. }
  60. ]
  61. ]
  62. ],
  63. // 表格属性
  64. tableAttributes: {
  65. // 启用勾选列
  66. selectColumn: true
  67. }, // 关闭新增弹窗
  68. // 表格事件
  69. tableEvents: {
  70. 'selection-change': this.selectionChange
  71. },
  72. recordSelected: [],
  73. listData:[]
  74. }
  75. },
  76. methods: {
  77. // 列表请求函数
  78. getList(...p) {
  79. this.recordSelected = []
  80. p[0].params = [
  81. ...p[0].params,
  82. {
  83. param: this.param,
  84. compare: '=',
  85. value: this.orderCode
  86. }
  87. ]
  88. this.getListCostBillV2(...p)
  89. return getListCostBillV2(...p)
  90. },
  91. // 列表导出函数
  92. exportList: () => {},
  93. // 表格列解析渲染数据更改
  94. columnParsing(item, defaultData) {
  95. return defaultData
  96. },
  97. // 监听勾选变化
  98. selectionChange(data) {
  99. if (data && data.length) {
  100. const newList = []
  101. this.listData.forEach(l=>{
  102. data.forEach(k => {
  103. if (l.id===k.id) {
  104. newList.push(l)
  105. }
  106. });
  107. })
  108. this.recordSelected = newList
  109. }else{
  110. this.recordSelected = []
  111. }
  112. console.log( this.recordSelected)
  113. },
  114. operation() {
  115. return (h, { row, index, column }) => {
  116. return <div class='operation-btns'></div>
  117. }
  118. },
  119. handleClose() {
  120. this.visible = false
  121. this.$refs.pageRefItem.refreshList()
  122. },
  123. getListCostBillV2(p){
  124. getListCostBillV2(p).then(res=>{
  125. this.listData = res.data.records
  126. })
  127. }
  128. }
  129. }
  130. </script>
  131. <style lang="scss" scoped>
  132. .warp{
  133. position: absolute;
  134. left: 0;
  135. right: 0;
  136. bottom: 0;
  137. top: 50px;}
  138. </style>