index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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. import { commonTemplateDownload } from '@/api/common.js'
  42. export default {
  43. components: { TemplatePage, Popu, InsuranceContractForm },
  44. mixins: [import_mixin, operation_mixin],
  45. data() {
  46. return {
  47. // 表格属性
  48. tableAttributes: {
  49. // 启用勾选列
  50. selectColumn: false
  51. },
  52. // 表格事件
  53. tableEvents: {
  54. 'selection-change': this.selectionChange
  55. },
  56. // 勾选选中行
  57. recordSelected: [],
  58. visible: false,
  59. item: null,
  60. showType: null
  61. }
  62. },
  63. computed: {
  64. optionsEvensGroup() {
  65. return [
  66. [
  67. [
  68. this.optionsEvensAuth('download', {
  69. click: () => {
  70. commonTemplateDownload({ name: '雇主险导入.xlsx' }, `${this.$route.meta.title}`)
  71. .then(res => {
  72. this.$message({
  73. message: '下载成功',
  74. type: 'success'
  75. })
  76. })
  77. .catch(err => {
  78. this.$message.error('下载失败')
  79. })
  80. }
  81. })
  82. ],
  83. [
  84. this.optionsEvensAuth('import', ({ moduleName }) => {
  85. return {
  86. name: moduleName,
  87. render: () => {
  88. return this.importButton(policyOrderImportEm, moduleName)
  89. }
  90. }
  91. })
  92. ]
  93. ]
  94. ]
  95. },
  96. // 更多参数
  97. moreParameters() {
  98. return [
  99. {
  100. name: '保单状态',
  101. key: 'policyOrderStatus',
  102. value: '',
  103. conditions: [
  104. {
  105. label: '全部',
  106. value: ''
  107. },
  108. {
  109. label: '新购',
  110. value: 'XG'
  111. },
  112. {
  113. label: '待生效',
  114. value: 'DSX'
  115. },
  116. {
  117. label: '待替换',
  118. value: 'DTH'
  119. },
  120. {
  121. label: '已购买',
  122. value: 'YGM'
  123. },
  124. {
  125. label: '保障中',
  126. value: 'BZZ'
  127. },
  128. {
  129. label: '已失效',
  130. value: 'YSX'
  131. },
  132. {
  133. label: '可替换',
  134. value: 'KTH'
  135. }
  136. ]
  137. }
  138. ]
  139. },
  140. formItems() {
  141. return []
  142. }
  143. },
  144. created() {},
  145. methods: {
  146. // 列表请求函数
  147. getList(p, cb) {
  148. var pam = JSON.parse(JSON.stringify(p))
  149. try {
  150. if (pam.policyOrderStatus) {
  151. pam.params.push({ param: 'policy_order_status', compare: '=', value: pam.policyOrderStatus })
  152. }
  153. cb && cb(pam)
  154. return policyOrderListEm(pam)
  155. } catch (err) {
  156. console.log(err)
  157. }
  158. },
  159. // 列表导出函数
  160. exportList: policyOrderListEmExport,
  161. // 表格列解析渲染数据更改
  162. columnParsing(item, defaultData) {
  163. return defaultData
  164. },
  165. // 表格操作列
  166. operation() {
  167. return this.operationBtn({
  168. edit: {
  169. click: ({ row, index, column }) => {
  170. this.item = { ...row }
  171. this.visible = true
  172. this.showType = 1
  173. // policyOrderDetail({ id: row.id }).then(res => {})
  174. }
  175. },
  176. details: {
  177. click: ({ row, index, column }) => {
  178. this.item = { ...row }
  179. this.visible = true
  180. this.showType = 2
  181. // policyOrderDetail({ id: row.id }).then(res => {})
  182. }
  183. }
  184. })
  185. },
  186. // 关闭新增弹窗
  187. handleClose() {
  188. this.visible = false
  189. this.item = null
  190. this.showType = null
  191. }
  192. }
  193. }
  194. </script>
  195. <style lang="scss" scoped>
  196. .tab {
  197. padding: 20px 20px 0 20px;
  198. }
  199. </style>