index.vue 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <template-page ref="pageRef" :get-list="getList" :table-attributes="tableAttributes" :table-events="tableEvents"
  3. :options-evens-group="optionsEvensGroup" :more-parameters="moreParameters" :column-parsing="columnParsing"
  4. :operation="operation" :exportList="exportList">
  5. <div class="cartographer">
  6. <el-dialog title="明细" width="100%" :modal="false" :visible.sync="formDialog" :before-close="()=>{formDialog = false}">
  7. <template-page v-if="formDialog" :get-list="getList2" />
  8. </el-dialog>
  9. </div>
  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 {
  16. increOrderSettleCountList,
  17. increOrderSettleCountListExport
  18. } from '@/api/orderBranchAccount'
  19. import { increOrderSettleList } from "@/api/orderSettleManag.js"
  20. export default {
  21. components: { TemplatePage },
  22. mixins: [import_mixin],
  23. data() {
  24. return {
  25. // 事件组合
  26. optionsEvensGroup: [],
  27. // 表格属性
  28. tableAttributes: {
  29. // 启用勾选列
  30. selectColumn: false
  31. },
  32. // 表格事件
  33. tableEvents: {
  34. 'selection-change': this.selectionChange
  35. },
  36. // 勾选选中数据
  37. recordSelected: [],
  38. formDialog: false,
  39. detailParams: []
  40. }
  41. },
  42. computed: {
  43. // 更多参数
  44. moreParameters() {
  45. return []
  46. },
  47. },
  48. methods: {
  49. // 列表请求函数
  50. getList(p) {
  51. this.detailParams = p.params.filter(item => item.param === "a.pay_time")
  52. return increOrderSettleCountList(p)
  53. },
  54. // 列表导出函数
  55. exportList: increOrderSettleCountListExport,
  56. // 表格列解析渲染数据更改
  57. columnParsing(item, defaultData) {
  58. return defaultData
  59. },
  60. // 监听勾选变化
  61. selectionChange(data) {
  62. this.recordSelected = data
  63. },
  64. // 操作按钮
  65. operation(h, { row, index, column }) {
  66. return (
  67. <div class="operation-btns">
  68. <el-button type="text" onClick={() => {
  69. this.detailParams.push(
  70. {
  71. param: "a.websit_id",
  72. compare: "=",
  73. value: row.websitId
  74. }
  75. )
  76. this.$nextTick(() => {
  77. this.formDialog = true
  78. })
  79. }}>明细</el-button>
  80. </div>
  81. )
  82. },
  83. // 明细列表
  84. getList2(p) {
  85. var pam = JSON.parse(JSON.stringify(p))
  86. pam.params = [...pam.params, ...this.detailParams,]
  87. try {
  88. return increOrderSettleList(pam)
  89. } catch (err) {
  90. }
  91. },
  92. }
  93. }
  94. </script>
  95. <style lang="scss" scoped></style>