linwenxin 1 settimana fa
parent
commit
5ea6fae5bf

+ 23 - 0
src/api/thirdPartyInsurance.js

@@ -0,0 +1,23 @@
+import request, { postBlob, getBlob, handleImport } from '@/utils/request'
+
+// 获取列表
+export function policyOrderListDs(data) {
+  return request({
+    url: `/policyOrder/listDs?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+//导出
+export function policyOrderListDsExport(data, name) {
+  return postBlob({
+    url: '/policyOrder/listDs/export',
+    data,
+    name
+  })
+}
+
+export function policyOrderImportDs(data) {
+  return handleImport('/policyOrder/importDs', data.formdata, data.id || '')
+}

+ 10 - 1
src/views/setting/insuranceAdministration/InsuranceAgreement/InsuranceAgreementForm.vue

@@ -203,6 +203,7 @@ export default {
                     { id: 'policyName', label: '保单名称', width: '' },
                     { id: 'policyNumber', label: '保单编号', width: '' },
                     { id: 'policyPrice', label: '保单金额', width: '' },
+                    { id: 'typeName_', label: '保单类型', width: '' },
                     { id: 'startTime', label: '生效时间', width: '' },
                     { id: 'endTime', label: '结束时间', width: '' }
                   ]}
@@ -210,6 +211,7 @@ export default {
                     { id: 'policyName', label: '保单名称', width: '' },
                     { id: 'policyNumber', label: '保单编号', width: '' },
                     { id: 'policyPrice', label: '保单金额', width: '' },
+                    { id: 'typeName_', label: '保单类型', width: '' },
                     { id: 'startTime', label: '生效时间', width: '' },
                     { id: 'endTime', label: '结束时间', width: '' }
                   ]}
@@ -235,6 +237,10 @@ export default {
         for (var key in res.data) {
           this.formData[key] = res.data[key]
         }
+        this.formData.policy = res.data.policy.map(item => ({
+          ...item,
+          typeName_: { AC: '意外险', DS: '第三者责任险' }[item.type]
+        }))
       })
     }
   },
@@ -273,7 +279,10 @@ export default {
         insureList({ pageNum: 1, pageSize: -1, params: params }).then(res => {
           resolve({
             total: res.data.total,
-            data: res.data.records
+            data: res.data.records.map(item => ({
+              ...item,
+              typeName_: { AC: '意外险', DS: '第三者责任险' }[item.type]
+            }))
           })
         })
       })

+ 17 - 1
src/views/setting/insuranceAdministration/InsuranceContract/InsuranceContractForm.vue

@@ -59,7 +59,8 @@ export default {
         month11: '',
         month12: '',
         policyRanges: [{ rangeName: '', rangeText: '' }],
-        policyWebsits: []
+        policyWebsits: [],
+        type: ''
       },
       formRules: {
         text: [{ required: true, message: '请输入', trigger: 'blur' }],
@@ -167,6 +168,21 @@ export default {
             rules: [{ required: true, message: '请选择', trigger: 'blur' }]
           }
         },
+
+        {
+          md: 6,
+          name: 'el-select',
+          options: [
+            { value: 'AC', label: '意外险' },
+            { value: 'DS', label: '第三者责任险' }
+          ],
+          attributes: { placeholder: '请选择', filterable: true, clearable: true },
+          formItemAttributes: {
+            label: '保单类型',
+            prop: 'type',
+            rules: [...required]
+          }
+        },
         {
           name: 'slot-component',
           md: 24,

+ 76 - 0
src/views/setting/insuranceAdministration/thirdPartyInsurance/index.vue

@@ -0,0 +1,76 @@
+<template>
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :exportList="exportList"
+    :columnParsing="columnParsing"
+    :optionsEvensGroup="optionsEvensGroup"
+    :morePlan="morePlan"
+  >
+    <!-- :operationColumnWidth="200"
+    :operation="operation()" -->
+  </template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import operation_mixin from '@/components/template/operation_mixin.js'
+import { policyOrderListDs, policyOrderListDsExport, policyOrderImportDs } from '@/api/thirdPartyInsurance.js'
+export default {
+  components: { TemplatePage },
+  mixins: [import_mixin, operation_mixin],
+  data() {
+    return {
+      morePlan: [],
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            this.optionsEvensAuth('import', ({ moduleName }) => {
+              return {
+                name: moduleName,
+                render: () => {
+                  return this.importButton(policyOrderImportDs, moduleName)
+                }
+              }
+            })
+          ]
+        ]
+      ],
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+      visible: false,
+      item: null,
+      showType: null
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList: policyOrderListDs,
+    // 导出
+    exportList: policyOrderListDsExport,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return this.operationBtn({})
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped></style>