index.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <template>
  2. <template-page
  3. ref="pageRef"
  4. :getList="getList"
  5. :exportList="exportList"
  6. :columnParsing="columnParsing"
  7. :optionsEvensGroup="optionsEvensGroup"
  8. :moreParameters="moreParameters"
  9. >
  10. <!-- :operationColumnWidth="200"
  11. :operation="operation()" -->
  12. </template-page>
  13. </template>
  14. <script>
  15. import TemplatePage from '@/components/template/template-page-1.vue'
  16. import import_mixin from '@/components/template/import_mixin.js'
  17. import operation_mixin from '@/components/template/operation_mixin.js'
  18. import { policyOrderListDs, policyOrderListDsExport, policyOrderImportDs } from '@/api/thirdPartyInsurance.js'
  19. import { commonTemplateDownload } from '@/api/common.js'
  20. export default {
  21. components: { TemplatePage },
  22. mixins: [import_mixin, operation_mixin],
  23. data() {
  24. return {
  25. // 事件组合
  26. optionsEvensGroup: [
  27. [
  28. [
  29. this.optionsEvensAuth('import', ({ moduleName }) => {
  30. return {
  31. name: moduleName,
  32. render: () => {
  33. return this.importButton(policyOrderImportDs, moduleName)
  34. }
  35. }
  36. })
  37. ],
  38. [
  39. this.optionsEvensAuth('download', {
  40. click: () => {
  41. commonTemplateDownload({ name: '第三者保险导入.xlsx' }, `第三者保险导入`)
  42. .then(res => {
  43. this.$message({
  44. message: '下载成功',
  45. type: 'success'
  46. })
  47. })
  48. .catch(err => {
  49. this.$message.error('下载失败')
  50. })
  51. }
  52. })
  53. ]
  54. ]
  55. ],
  56. // 表格属性
  57. tableAttributes: {
  58. // 启用勾选列
  59. selectColumn: true
  60. },
  61. // 表格事件
  62. tableEvents: {
  63. 'selection-change': this.selectionChange
  64. },
  65. recordSelected: [],
  66. visible: false,
  67. item: null,
  68. showType: null
  69. }
  70. },
  71. computed: {
  72. // 更多参数
  73. moreParameters() {
  74. return [
  75. {
  76. name: '保单状态',
  77. key: 'policyOrderStatus',
  78. value: '',
  79. conditions: [
  80. {
  81. label: '全部',
  82. value: ''
  83. },
  84. {
  85. label: '待生效',
  86. value: 'DSX'
  87. },
  88. {
  89. label: '保障中',
  90. value: 'BZZ'
  91. },
  92. {
  93. label: '已失效',
  94. value: 'YSX'
  95. }
  96. ]
  97. }
  98. ]
  99. }
  100. },
  101. methods: {
  102. // 列表请求函数
  103. getList(p, cb) {
  104. var pam = JSON.parse(JSON.stringify(p))
  105. try {
  106. if (pam.policyOrderStatus) {
  107. pam.params.push({ param: 'policy_order_status', compare: '=', value: pam.policyOrderStatus })
  108. }
  109. cb && cb(pam)
  110. return policyOrderListDs(pam)
  111. } catch (err) {
  112. console.log(err)
  113. }
  114. },
  115. // 导出
  116. exportList: policyOrderListDsExport,
  117. // 表格列解析渲染数据更改
  118. columnParsing(item, defaultData) {
  119. return defaultData
  120. },
  121. // 监听勾选变化
  122. selectionChange(data) {
  123. this.recordSelected = data
  124. },
  125. operation() {
  126. return this.operationBtn({})
  127. }
  128. }
  129. }
  130. </script>
  131. <style lang="scss" scoped></style>