index.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <template>
  2. <template-page
  3. ref="pageRef"
  4. :getList="getList"
  5. :exportList="exportList"
  6. :columnParsing="columnParsing"
  7. :optionsEvensGroup="optionsEvensGroup"
  8. :morePlan="morePlan"
  9. :operationColumnWidth="200"
  10. :operation="operation()"
  11. >
  12. <Popu v-if="visible">
  13. <el-page-header slot="head" content="" @back="handleClose" />
  14. <InsuranceContractForm
  15. :item="item"
  16. :type="showType"
  17. @success="
  18. () => {
  19. handleClose()
  20. $refs.pageRef.refreshList()
  21. }
  22. "
  23. />
  24. </Popu>
  25. </template-page>
  26. </template>
  27. <script>
  28. import TemplatePage from '@/components/template/template-page-1.vue'
  29. import import_mixin from '@/components/template/import_mixin.js'
  30. import Popu from '@/components/template/popu.vue'
  31. import InsuranceContractForm from './InsuranceContractForm.vue'
  32. import operation_mixin from '@/components/template/operation_mixin.js'
  33. import { workerApplyList, workerApplyListExport } from '@/api/difficultyExpenseApproval.js'
  34. export default {
  35. components: { TemplatePage, Popu, InsuranceContractForm },
  36. mixins: [import_mixin, operation_mixin],
  37. data() {
  38. return {
  39. morePlan: [],
  40. // 事件组合
  41. optionsEvensGroup: [
  42. [
  43. [
  44. this.optionsEvensAuth('add', {
  45. click: () => {
  46. this.item = null
  47. this.showType = 0
  48. this.visible = true
  49. }
  50. })
  51. ]
  52. ]
  53. ],
  54. // 表格属性
  55. tableAttributes: {
  56. // 启用勾选列
  57. selectColumn: true
  58. },
  59. // 表格事件
  60. tableEvents: {
  61. 'selection-change': this.selectionChange
  62. },
  63. recordSelected: [],
  64. visible: false,
  65. item: null,
  66. showType: null
  67. }
  68. },
  69. methods: {
  70. // 列表请求函数
  71. getList: workerApplyList,
  72. // 导出
  73. exportList: workerApplyListExport,
  74. // 表格列解析渲染数据更改
  75. columnParsing(item, defaultData) {
  76. return defaultData
  77. },
  78. // 监听勾选变化
  79. selectionChange(data) {
  80. this.recordSelected = data
  81. },
  82. operation() {
  83. return this.operationBtn({
  84. edit: {
  85. conditions: ({ row, index, column }) => {
  86. return true
  87. },
  88. click: ({ row, index, column }) => {
  89. this.item = row
  90. this.visible = true
  91. this.showType = 1
  92. }
  93. },
  94. detail: {
  95. conditions: ({ row, index, column }) => {
  96. return true
  97. },
  98. click: ({ row, index, column }) => {
  99. this.item = row
  100. this.visible = true
  101. this.showType = 2
  102. }
  103. }
  104. })
  105. },
  106. // 关闭新增弹窗
  107. handleClose() {
  108. this.visible = false
  109. this.item = null
  110. this.showType = null
  111. }
  112. }
  113. }
  114. </script>
  115. <style lang="scss" scoped></style>