index.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <template-page
  3. ref="pageRef"
  4. :get-list="getList"
  5. :exportList="exportList"
  6. :table-attributes="tableAttributes"
  7. :table-events="tableEvents"
  8. :options-evens-group="optionsEvensGroup"
  9. :moreParameters="moreParameters"
  10. :column-parsing="columnParsing"
  11. :operation="operation()"
  12. >
  13. <Popu v-if="visible">
  14. <el-page-header slot="head" content="" @back="handleClose" />
  15. <InsuranceContractForm
  16. :item="item"
  17. :type="showType"
  18. @success="
  19. () => {
  20. handleClose()
  21. $refs.pageRef.refreshList()
  22. }
  23. "
  24. /> </Popu
  25. ></template-page>
  26. </template>
  27. <script>
  28. import TemplatePage from '@/components/template/template-page-1.vue'
  29. import { required, mobileRequired, mobile, httpUrl, email } from '@/components/template/rules_verify.js'
  30. import {
  31. policyOrderListEm,
  32. policyOrderListEmExport,
  33. policyOrderImportEm,
  34. policyOrderDetail,
  35. policyOrderUpdate
  36. } from '@/api/employerInsurance'
  37. import operation_mixin from '@/components/template/operation_mixin.js'
  38. import import_mixin from '@/components/template/import_mixin.js'
  39. import Popu from '@/components/template/popu.vue'
  40. import InsuranceContractForm from './InsuranceContractForm.vue'
  41. export default {
  42. components: { TemplatePage, Popu, InsuranceContractForm },
  43. mixins: [import_mixin, operation_mixin],
  44. data() {
  45. return {
  46. // 表格属性
  47. tableAttributes: {
  48. // 启用勾选列
  49. selectColumn: false
  50. },
  51. // 表格事件
  52. tableEvents: {
  53. 'selection-change': this.selectionChange
  54. },
  55. // 勾选选中行
  56. recordSelected: [],
  57. visible: false,
  58. item: null,
  59. showType: null
  60. }
  61. },
  62. computed: {
  63. optionsEvensGroup() {
  64. return [
  65. [
  66. [
  67. this.optionsEvensAuth('import', ({ moduleName }) => {
  68. return {
  69. name: moduleName,
  70. render: () => {
  71. return this.importButton(policyOrderImportEm, moduleName)
  72. }
  73. }
  74. })
  75. ]
  76. ]
  77. ]
  78. },
  79. // 更多参数
  80. moreParameters() {
  81. return [
  82. {
  83. name: '保单状态',
  84. key: 'policyOrderStatus',
  85. value: '',
  86. conditions: [
  87. {
  88. label: '全部',
  89. value: ''
  90. },
  91. {
  92. label: '待购买',
  93. value: 'DGM'
  94. },
  95. {
  96. label: '保障中',
  97. value: 'BZZ'
  98. },
  99. {
  100. label: '待生效',
  101. value: 'DSX'
  102. },
  103. {
  104. label: '已失效',
  105. value: 'YSX'
  106. }
  107. ]
  108. }
  109. ]
  110. },
  111. formItems() {
  112. return []
  113. }
  114. },
  115. created() {},
  116. methods: {
  117. // 列表请求函数
  118. getList(p, cb) {
  119. var pam = JSON.parse(JSON.stringify(p))
  120. try {
  121. if (pam.policyOrderStatus) {
  122. pam.params.push({ param: 'policy_order_status', compare: '=', value: pam.policyOrderStatus })
  123. }
  124. cb && cb(pam)
  125. return policyOrderListEm(pam)
  126. } catch (err) {
  127. console.log(err)
  128. }
  129. },
  130. // 列表导出函数
  131. exportList: policyOrderListEmExport,
  132. // 表格列解析渲染数据更改
  133. columnParsing(item, defaultData) {
  134. return defaultData
  135. },
  136. // 表格操作列
  137. operation() {
  138. return this.operationBtn({
  139. edit: {
  140. click: ({ row, index, column }) => {
  141. this.item = { ...row }
  142. this.visible = true
  143. this.showType = 1
  144. // policyOrderDetail({ id: row.id }).then(res => {})
  145. }
  146. },
  147. details: {
  148. click: ({ row, index, column }) => {
  149. this.item = { ...row }
  150. this.visible = true
  151. this.showType = 2
  152. // policyOrderDetail({ id: row.id }).then(res => {})
  153. }
  154. }
  155. })
  156. },
  157. // 关闭新增弹窗
  158. handleClose() {
  159. this.visible = false
  160. this.item = null
  161. this.showType = null
  162. }
  163. }
  164. }
  165. </script>
  166. <style lang="scss" scoped>
  167. .tab {
  168. padding: 20px 20px 0 20px;
  169. }
  170. </style>