index.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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" :columnParsing="columnParsing2"/>
  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. columnParsing2(item, defaultData) {
  94. if (item.jname === 'residuNum') {
  95. defaultData.render = (h, { row, index, column }) => {
  96. return (
  97. <div style="padding:0 6px;cursor: pointer;">
  98. {row["increType"] != 1 ? row["residuNum"] : ""}
  99. </div>
  100. )
  101. }
  102. }
  103. if (item.jname === 'serviceEndTime') {
  104. defaultData.render = (h, { row, index, column }) => {
  105. return (
  106. <div style="padding:0 6px;cursor: pointer;">
  107. {row[column.columnAttributes.prop] ? row[column.columnAttributes.prop].split(" ")[0] : ""}
  108. </div>
  109. )
  110. }
  111. }
  112. return defaultData
  113. },
  114. }
  115. }
  116. </script>
  117. <style lang="scss" scoped></style>