linwenxin преди 5 месеца
родител
ревизия
e6b267dc16

+ 265 - 0
src/api/InsuranceManagement.js

@@ -0,0 +1,265 @@
+import request, { postBlob } from '@/utils/request'
+
+// 商用保险保存
+export function insureWorkerCommercialSave(data) {
+  return request({
+    url: `/insure/worker/commercial/save`,
+    method: 'post',
+    data
+  })
+}
+
+export function insureList2(params) {
+  return request({
+    url: `/worker/list2`,
+    method: 'post',
+    params
+  })
+}
+
+// worker/list2
+
+/**
+ * 保险合同
+ */
+
+export function insureList(data) {
+  return request({
+    url: `/insure/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function insureListExport(data, name) {
+  return postBlob({
+    url: '/insure/list/export',
+    data,
+    name
+  })
+}
+
+export function insureDetail(params) {
+  return request({
+    url: `/insure/detail`,
+    method: 'post',
+    params
+  })
+}
+
+export function insureSave(data) {
+  return request({
+    url: `/insure/save`,
+    method: 'post',
+    data
+  })
+}
+
+export function insureOnOff(params) {
+  return request({
+    url: `/insure/on-off`,
+    method: 'post',
+    params
+  })
+}
+
+export function insureDelete(params) {
+  return request({
+    url: `/insure/delete`,
+    method: 'post',
+    params
+  })
+}
+
+/**
+ * 保险协议
+ */
+
+export function insureAgreeList(data) {
+  return request({
+    url: `/insure/agree/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function insureAgreeExport(data, name) {
+  return postBlob({
+    url: '/insure/agree/export',
+    data,
+    name
+  })
+}
+
+export function insureAgreeDetail(params) {
+  return request({
+    url: `/insure/agree/detail`,
+    method: 'post',
+    params
+  })
+}
+
+export function insureAgreeSave(data) {
+  return request({
+    url: `/insure/agree/save`,
+    method: 'post',
+    data
+  })
+}
+
+export function insureAgreeOnOff(params) {
+  return request({
+    url: `/insure/agree/on-off`,
+    method: 'post',
+    params
+  })
+}
+
+export function insureAgreeDelete(params) {
+  return request({
+    url: `/insure/agree/delete`,
+    method: 'post',
+    params
+  })
+}
+
+/**
+ * 邮箱配置
+ */
+export function insureEmailConfig(data) {
+  return request({
+    url: `/insure/email/config`,
+    method: 'post',
+    data
+  })
+}
+
+export function insureEmailDetail(params) {
+  return request({
+    url: `/insure/email/detail`,
+    method: 'post',
+    params
+  })
+}
+
+/**
+ * 邮箱配置
+ */
+export function insureListemail(data) {
+  return request({
+    url: `/insure/listemail?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function insureListemailExport(data, name) {
+  return postBlob({
+    url: '/insure/listemail/export',
+    data,
+    name
+  })
+}
+
+export function insureDetailemail(params) {
+  return request({
+    url: `/insure/detailemail`,
+    method: 'post',
+    params
+  })
+}
+
+export function insureResend(params) {
+  return request({
+    url: `/insure/resend`,
+    method: 'post',
+    params
+  })
+}
+
+/**
+ * 工程师保险
+ */
+export function insureWorkerList(data) {
+  var { moduleId, ...p } = data
+  return request({
+    url: `/insure/worker/list?moduleId=`,
+    method: 'post',
+    data: p
+  })
+}
+
+export function insureWorkerLists(data) {
+  return request({
+    url: `/insure/worker/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function insureWorkerExport(data, name) {
+  return postBlob({
+    url: '/insure/worker/export',
+    data,
+    name
+  })
+}
+
+export function insureWorkerDetail(params) {
+  return request({
+    url: `/insure/worker/detail`,
+    method: 'post',
+    params
+  })
+}
+
+export function insureWorkerOnOff(params) {
+  return request({
+    url: `/insure/worker/on-off`,
+    method: 'post',
+    params
+  })
+}
+
+/**
+ * 商用工程师保险
+ */
+export function insureWorkerCommercialList(data) {
+  return request({
+    url: `/insure/worker/commercial/list?moduleId=${data.moduleId}`,
+    method: 'post',
+    data
+  })
+}
+
+export function insureWorkerCommercialExport(data, name) {
+  return postBlob({
+    url: '/insure/worker/commercial/export',
+    data,
+    name
+  })
+}
+
+export function insureWorkerCommercialDetail(params) {
+  return request({
+    url: `/insure/worker/commercial/detail`,
+    method: 'post',
+    params
+  })
+}
+
+export function insureWorkerCommercialExamine(params) {
+  return request({
+    url: `/insure/worker/commercial/examine`,
+    method: 'post',
+    params
+  })
+}
+
+export function insureWorkerCommercialOnOff(params) {
+  return request({
+    url: `/insure/worker/commercial/onOff`,
+    method: 'post',
+    params
+  })
+}

+ 10 - 1
src/layout/components/Navbar.vue

@@ -16,7 +16,7 @@
                 v-for="(item, index) in routes"
                 :key="index"
                 :class="{ item: true, select: path === item.path }"
-                @click="path = item.path"
+                @click="tizhuanyemian(item)"
               >
                 {{ item.meta.title }}
               </div>
@@ -24,6 +24,7 @@
           </v-scroll-view>
         </div>
       </div>
+
       <!-- 右侧 -->
       <div class="right-menu">
         <div class="right-menu-item" v-if="bigViewsBool" @click="goBigViews">
@@ -416,6 +417,14 @@ export default {
     this.$store.commit('app/SET_L1_PATH', this.path)
   },
   methods: {
+    tizhuanyemian(item) {
+      if (item.type == 4) {
+        this.$router.push({ name: item.name })
+      } else {
+        this.path = item.path
+      }
+    },
+
     goBigViews() {
       this.$router.push({
         name: 'bigViews'

+ 1 - 1
src/views/iframeView.vue

@@ -11,7 +11,7 @@ export default {
   },
   computed: {
     url() {
-      if (!!~this.$route.meta.url.indexOf("?x-token=")) {
+      if (!!~this.$route.meta.url.indexOf('?x-token=')) {
         return this.$route.meta.url && this.token ? `${this.$route.meta.url}${this.token}` : ''
       } else {
         return this.$route.meta.url

+ 160 - 0
src/views/setting/insuranceAdministration/InsuranceAgreement/InsuranceAgreementForm.vue

@@ -0,0 +1,160 @@
+<template>
+  <div>
+    <zj-form-container ref="formRef" :formData="formData" :formRules="formRules">
+      <zj-form-module title="保险基础信息" label-width="120px" :formData="formData" :formItems="formItems" :column="3">
+      </zj-form-module>
+    </zj-form-container>
+    <div v-if="type === 0 || type === 1">
+      <el-button size="mini" @click="submit">提交</el-button>
+      <el-button size="mini" @click="reset">重置</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+import { insureAgreeDetail, insureAgreeSave } from '@/api/InsuranceManagement.js'
+export default {
+  props: {
+    type: {
+      type: Number,
+      default: null
+    },
+    item: {
+      type: Object,
+      default: null
+    }
+  },
+  data() {
+    return {
+      disabled: this.type === 2,
+      // 表单数据
+      formData: {
+        content: '',
+        typeName: '投保须知',
+        name: '',
+        insureId: '',
+        status: 'ON'
+      },
+      formRules: {
+        content: [{ required: true, message: '请输入', trigger: 'blur' }],
+        typeName: [{ required: true, message: '请输入', trigger: 'blur' }],
+        name: [{ required: true, message: '请输入', trigger: 'blur' }],
+        insureId: [{ required: true, message: '请输入', trigger: 'blur' }],
+        status: [{ required: true, message: '请输入', trigger: 'blur' }]
+      }
+    }
+  },
+  computed: {
+    formItems() {
+      return [
+        {
+          name: 'el-radio',
+          options: [
+            { label: '投保须知', value: '投保须知' },
+            { label: '保险合同说明', value: '保险合同说明' }
+          ],
+          events: {
+            change: val => {
+              this.formData.content = ''
+            }
+          },
+          md: 24,
+          attributes: { disabled: this.type !== 0 },
+          formItemAttributes: { label: '协议展示类型', prop: 'typeName' }
+        },
+        {
+          name: 'el-input',
+          md: 24,
+          attributes: { disabled: this.disabled },
+          formItemAttributes: { label: '协议名称', prop: 'name' }
+        },
+        {
+          name: 'slot-component',
+          md: 24,
+          formItemAttributes: { label: '保险合同ID', prop: 'insureId' },
+          render: (h, { props }) => {
+            var { formData } = props
+            return (
+              <div>
+                <el-input
+                  disabled={this.disabled}
+                  value={formData.insureId}
+                  onInput={val => {
+                    formData.insureId = val
+                  }}
+                ></el-input>
+                <p>输入【保险合同配置】的保险合同ID,则购买该保险的工程师可查看,填【0】关联所有保险</p>
+              </div>
+            )
+          }
+        },
+        {
+          name: 'slot-component',
+          md: 24,
+          attributes: { disabled: this.disabled },
+          formItemAttributes: { label: '协议内容', prop: 'content' },
+          render: (h, { props }) => {
+            var { formData } = props
+            return (
+              <v-quill-editor
+                disabled={this.disabled}
+                value={formData.content}
+                onInput={val => {
+                  formData.content = val
+                }}
+              ></v-quill-editor>
+            )
+          }
+        },
+        {
+          name: 'el-radio',
+          options: [
+            { label: '启用', value: 'ON' },
+            { label: '禁用', value: 'OFF' }
+          ],
+          md: 24,
+          attributes: { disabled: this.disabled },
+          formItemAttributes: { label: '状态', prop: 'status' }
+        }
+      ]
+    }
+  },
+  created() {
+    // 获取详情
+    if (this.type !== 0) {
+      insureAgreeDetail({
+        id: this.item.id
+      }).then(res => {
+        for (var key in res.data) {
+          this.formData[key] = res.data[key]
+        }
+      })
+    }
+  },
+  methods: {
+    submit() {
+      this.$refs['formRef'].validate(valid => {
+        if (valid) {
+          insureAgreeSave({
+            ...this.formData
+          }).then(res => {
+            this.$message({
+              type: 'success',
+              message: `保存成功!`
+            })
+            this.$emit('success')
+          })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    reset() {
+      Object.assign(this.$data, this.$options.data())
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 166 - 0
src/views/setting/insuranceAdministration/InsuranceAgreement/index.vue

@@ -0,0 +1,166 @@
+<template>
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :exportList="exportList"
+    :columnParsing="columnParsing"
+    :optionsEvensGroup="optionsEvensGroup"
+    :morePlan="morePlan"
+    :operationColumnWidth="200"
+    :operation="operation()"
+  >
+    <Popu v-if="visible">
+      <el-page-header slot="head" content="" @back="handleClose" />
+      <InsuranceAgreementForm
+        :item="item"
+        :type="showType"
+        @success="
+          () => {
+            handleClose()
+            $refs.pageRef.refreshList()
+          }
+        "
+      />
+    </Popu>
+  </template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import add_callback_mixin from '@/components/template/add_callback_mixin.js'
+import Popu from '@/components/template/popu.vue'
+import InsuranceAgreementForm from './InsuranceAgreementForm.vue'
+import operation_mixin from '@/components/template/operation_mixin.js'
+
+import { insureAgreeList, insureAgreeExport, insureAgreeOnOff, insureAgreeDelete } from '@/api/InsuranceManagement.js'
+export default {
+  components: { TemplatePage, Popu, InsuranceAgreementForm },
+  mixins: [import_mixin, add_callback_mixin, operation_mixin],
+  data() {
+    return {
+      morePlan: [],
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '新增',
+              isRole: this.$restrict('add'),
+
+              click: this.addOn(() => {
+                this.item = null
+                this.showType = 0
+                this.visible = true
+              })
+            }
+          ]
+        ]
+      ],
+      // 关闭新增弹窗
+      handleClose: this.addOff(() => {
+        this.visible = false
+        this.item = null
+        this.showType = null
+      }),
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+      visible: false,
+      item: null,
+      showType: null
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList: insureAgreeList,
+    // 导出
+    exportList: insureAgreeExport,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      if (item.jname === 'status') {
+        defaultData.render = (h, { row, index, column }) => {
+          return (
+            <div style="box-sizing: border-box;padding: 0 6px;">
+              <el-switch
+                value={row.status}
+                onInput={value => (row.status = value)}
+                active-value="有效"
+                inactive-value="无效"
+                onChange={() => {
+                  insureAgreeOnOff({
+                    id: row.id,
+                    status: row.status === '有效' ? 'ON' : 'OFF'
+                  }).then(res => {
+                    this.$successMsg('状态更改成功')
+                  })
+                }}
+              ></el-switch>
+              <span style="margin-left:10px">{row.status}</span>
+            </div>
+          )
+        }
+      }
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return this.operationBtn({
+        edit: {
+          conditions: ({ row, index, column }) => {
+            return true
+          },
+          click: ({ row, index, column }) => {
+            this.item = row
+            this.visible = true
+            this.showType = 1
+          }
+        },
+        detail: {
+          conditions: ({ row, index, column }) => {
+            return true
+          },
+          click: ({ row, index, column }) => {
+            this.item = row
+            this.visible = true
+            this.showType = 2
+          }
+        },
+        del: {
+          conditions: ({ row, index, column }) => {
+            return true
+          },
+          prompt: '确定删除?',
+          click: ({ row, index, column }) => {
+            insureAgreeDelete({
+              id: row.id
+            })
+              .then(res => {
+                this.$refs.pageRef.refreshList()
+                this.$message({
+                  type: 'success',
+                  message: `删除成功!`
+                })
+              })
+              .catch(err => {
+                console.log(err)
+              })
+          }
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 410 - 0
src/views/setting/insuranceAdministration/InsuranceContract/InsuranceContractForm.vue

@@ -0,0 +1,410 @@
+<template>
+  <div>
+    <zj-form-container ref="formRef" :formData="formData" :formRules="formRules">
+      <zj-form-module title="保险基础信息" label-width="110px" :formData="formData" :formItems="formItems" :column="3">
+      </zj-form-module>
+      <zj-form-module title="保单内容" label-width="100px" :formData="formData" :formItems="formItems2" :column="3">
+      </zj-form-module>
+    </zj-form-container>
+    <div v-if="type === 0 || type === 1">
+      <el-button size="mini" @click="submit">提交</el-button>
+      <el-button size="mini" @click="reset">重置</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+import { insureDetail, insureSave } from '@/api/InsuranceManagement.js'
+import { dateFormat } from '@/utils/util'
+export default {
+  props: {
+    type: {
+      type: Number,
+      default: null
+    },
+    item: {
+      type: Object,
+      default: null
+    }
+  },
+  data() {
+    return {
+      disabled: this.type === 2,
+      // 表单数据
+      formData: {
+        content: '',
+        typeName: '',
+        name: '',
+        number: '',
+        amount: '',
+        startTime: '',
+        endTime: '',
+        insureCompany: '',
+        isSync: '',
+        isEmail: '',
+        insureTax1: '',
+        insureTax2: '',
+        insureTax3: '',
+        insureTax4: '',
+        insureTax5: '',
+        insureTax6: '',
+        insureTax7: '',
+        insureTax8: '',
+        insureTax9: '',
+        insureTax10: '',
+        insureTax11: '',
+        insureTax12: '',
+        insureRangeList: [{ name: '', content: '' }]
+      },
+      formRules: {
+        content: [{ required: true, message: '请输入', trigger: 'blur' }],
+        typeName: [{ required: true, message: '请输入', trigger: 'blur' }],
+        name: [{ required: true, message: '请输入', trigger: 'blur' }],
+        number: [{ required: true, message: '请输入', trigger: 'blur' }],
+        amount: [{ required: true, message: '请输入', trigger: 'blur' }],
+        startTime: [{ required: true, message: '请输入', trigger: 'blur' }],
+        endTime: [{ required: true, message: '请输入', trigger: 'blur' }],
+        insureCompany: [{ required: true, message: '请输入', trigger: 'blur' }],
+        insureTax1: [
+          { required: true, message: '全部必填', trigger: 'blur' },
+          {
+            required: true,
+            validator: (rule, value, callback) => {
+              if (value === '') {
+                callback(new Error('请输入'))
+              } else if (value > 100 || value < 0) {
+                callback(new Error('百分比必须为0到100的数值'))
+              } else {
+                callback()
+              }
+            },
+            trigger: 'blur'
+          }
+        ]
+      },
+      insureTaxKeys: [
+        'insureTax1',
+        'insureTax2',
+        'insureTax3',
+        'insureTax4',
+        'insureTax5',
+        'insureTax6',
+        'insureTax7',
+        'insureTax8',
+        'insureTax9',
+        'insureTax10',
+        'insureTax11',
+        'insureTax12'
+      ]
+    }
+  },
+  computed: {
+    formItems() {
+      return [
+        {
+          name: 'el-input',
+          attributes: { disabled: this.disabled },
+          formItemAttributes: { label: '保险类型', prop: 'typeName' }
+        },
+        {
+          name: 'el-input',
+          attributes: { disabled: this.disabled },
+          formItemAttributes: { label: '保单名称', prop: 'name' }
+        },
+        {
+          name: 'el-input',
+          attributes: { disabled: this.disabled },
+          formItemAttributes: { label: '保单编号', prop: 'number' }
+        },
+        {
+          name: 'el-input',
+          attributes: { disabled: this.disabled },
+          formItemAttributes: { label: '保单金额', prop: 'amount' }
+        },
+        {
+          name: 'el-date-picker',
+          attributes: { disabled: this.disabled, type: 'datetime', style: { width: '100%' } },
+          formItemAttributes: { label: '生效时间', prop: 'startTime' }
+        },
+        {
+          name: 'el-date-picker',
+          attributes: { disabled: this.disabled, type: 'datetime', style: { width: '100%' } },
+          formItemAttributes: { label: '失效时间', prop: 'endTime' }
+        },
+        {
+          name: 'el-radio',
+          options: [
+            {
+              label: '是',
+              value: 'YES'
+            },
+            {
+              label: '否',
+              value: 'NO'
+            }
+          ],
+          attributes: {
+            disabled: this.disabled
+          },
+          formItemAttributes: {
+            label: '是否发送邮件',
+            prop: 'isEmail',
+            rules: [{ required: true, message: '请选择', trigger: 'blur' }]
+          }
+        },
+        {
+          name: 'el-radio',
+          options: [
+            {
+              label: '是',
+              value: 'YES'
+            },
+            {
+              label: '否',
+              value: 'NO'
+            }
+          ],
+          attributes: {
+            disabled: this.disabled
+          },
+          formItemAttributes: {
+            label: '是否上传格力',
+            prop: 'isSync',
+            rules: [{ required: true, message: '请选择', trigger: 'blur' }]
+          }
+        },
+        {
+          name: 'slot-component',
+          md: 24,
+          attributes: { disabled: this.disabled },
+          formItemAttributes: { label: '保费率', prop: 'insureTax1' },
+          render: (h, { props }) => {
+            var { formData } = props
+            return (
+              <div>
+                <zj-table
+                  columns={[
+                    {
+                      columnAttributes: {
+                        label: '保险期间(个月)',
+                        width: '110px'
+                      },
+                      render: (h, { row }) => {
+                        return <div style="box-sizing: border-box;padding: 0 6px;">年费率百分比</div>
+                      }
+                    },
+                    ...(keys => {
+                      var list = []
+                      for (let i = 0; i < keys.length; i++) {
+                        list.push({
+                          columnAttributes: {
+                            label: i + 1 + ''
+                          },
+                          render: (h, { row }) => {
+                            return (
+                              <el-form-item
+                                prop={keys[i]}
+                                rules={this.formRules.insureTax1}
+                                label-width="0px"
+                                style="margin:0"
+                              >
+                                <el-input
+                                  disabled={this.disabled}
+                                  type="number"
+                                  min={0}
+                                  max={100}
+                                  value={formData[keys[i]]}
+                                  onInput={val => {
+                                    formData[keys[i]] = val
+                                  }}
+                                >
+                                  <span slot="suffix">%</span>
+                                </el-input>
+                              </el-form-item>
+                            )
+                          }
+                        })
+                      }
+                      return list
+                    })(this.insureTaxKeys)
+                  ]}
+                  tableData={[{}]}
+                ></zj-table>
+              </div>
+            )
+          }
+        },
+        {
+          name: 'slot-component',
+          md: 24,
+          attributes: { disabled: this.disabled },
+          formItemAttributes: {
+            label: '保障范围',
+            prop: 'insureRangeList',
+            rules: [
+              {
+                required: true,
+                validator: (rule, value, callback) => {
+                  let bool = false
+                  for (let item of value) {
+                    if (!item.name || !item.content) {
+                      bool = true
+                    }
+                  }
+                  if (bool) {
+                    callback(new Error('全部必填'))
+                  } else {
+                    callback()
+                  }
+                },
+                trigger: 'blur'
+              }
+            ]
+          },
+          render: (h, { props }) => {
+            var { formData } = props
+            return (
+              <zj-table
+                columns={[
+                  ...(list => {
+                    return list.map(item => {
+                      return {
+                        columnAttributes: {
+                          label: item.name,
+                          prop: item.prop,
+                          width: item.prop === 'options' ? '80px' : ''
+                        },
+                        render: (h, { row, column, index }) => {
+                          return column.columnAttributes.prop === 'options' ? (
+                            this.type == 1 || this.type == 0 ? (
+                              <div style="box-sizing: border-box;padding: 0 6px;">
+                                <el-button
+                                  type="text"
+                                  onClick={() => {
+                                    formData.insureRangeList.push({ name: '', content: '' })
+                                  }}
+                                >
+                                  添加
+                                </el-button>
+                                {formData.insureRangeList.length > 1 ? (
+                                  <el-button
+                                    type="text"
+                                    onClick={() => {
+                                      formData.insureRangeList.splice(index, 1)
+                                    }}
+                                  >
+                                    删除
+                                  </el-button>
+                                ) : null}
+                              </div>
+                            ) : null
+                          ) : (
+                            <el-form-item label-width="0px" style="margin:0">
+                              <el-input
+                                disabled={this.disabled}
+                                value={row[item.prop]}
+                                onInput={val => {
+                                  row[item.prop] = val
+                                }}
+                              ></el-input>
+                            </el-form-item>
+                          )
+                        }
+                      }
+                    })
+                  })([
+                    { name: '名称', prop: 'name' },
+                    { name: '内容', prop: 'content' },
+                    { name: '操作', prop: 'options' }
+                  ])
+                ]}
+                tableData={formData.insureRangeList}
+              ></zj-table>
+            )
+          }
+        }
+      ]
+    },
+    formItems2() {
+      return [
+        {
+          name: 'slot-component',
+          md: 24,
+          attributes: { disabled: this.disabled },
+          formItemAttributes: { label: '保单内容', prop: 'content' },
+          render: (h, { props }) => {
+            var { formData } = props
+            return (
+              <v-quill-editor
+                disabled={this.disabled}
+                value={formData.content}
+                onInput={val => {
+                  formData.content = val
+                }}
+              ></v-quill-editor>
+            )
+          }
+        },
+        {
+          name: 'el-input',
+          md: 24,
+          attributes: { disabled: this.disabled },
+          formItemAttributes: { label: '承保公司', prop: 'insureCompany' }
+        }
+      ]
+    }
+  },
+  created() {
+    // 获取详情
+    if (this.type !== 0) {
+      insureDetail({
+        id: this.item.id
+      }).then(res => {
+        for (var key in res.data) {
+          if (~this.insureTaxKeys.indexOf(key)) {
+            this.formData[key] = res.data[key] * 100
+          } else if (key == 'insureRangeList') {
+            this.formData[key] = res?.data[key]?.length ? res.data[key] : [{ name: '', content: '' }]
+          } else {
+            this.formData[key] = res.data[key]
+          }
+        }
+      })
+    }
+  },
+  methods: {
+    submit() {
+      this.$refs['formRef'].validate(valid => {
+        if (valid) {
+          insureSave({
+            ...this.formData,
+            startTime: dateFormat('YYYY-mm-dd HH:MM:SS', new Date(this.formData.startTime)),
+            endTime: dateFormat('YYYY-mm-dd HH:MM:SS', new Date(this.formData.endTime)),
+            ...(() => {
+              var obj = {}
+              for (var key of this.insureTaxKeys) {
+                obj[key] = this.formData[key] / 100
+              }
+              return obj
+            })()
+          }).then(res => {
+            this.$message({
+              type: 'success',
+              message: `保存成功!`
+            })
+            this.$emit('success')
+          })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    reset() {
+      Object.assign(this.$data, this.$options.data())
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 166 - 0
src/views/setting/insuranceAdministration/InsuranceContract/index.vue

@@ -0,0 +1,166 @@
+<template>
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :exportList="exportList"
+    :columnParsing="columnParsing"
+    :optionsEvensGroup="optionsEvensGroup"
+    :morePlan="morePlan"
+    :operationColumnWidth="200"
+    :operation="operation()"
+  >
+    <Popu v-if="visible">
+      <el-page-header slot="head" content="" @back="handleClose" />
+      <InsuranceContractForm
+        :item="item"
+        :type="showType"
+        @success="
+          () => {
+            handleClose()
+            $refs.pageRef.refreshList()
+          }
+        "
+      />
+    </Popu>
+  </template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import add_callback_mixin from '@/components/template/add_callback_mixin.js'
+import Popu from '@/components/template/popu.vue'
+import InsuranceContractForm from './InsuranceContractForm.vue'
+import operation_mixin from '@/components/template/operation_mixin.js'
+
+import { insureList, insureListExport, insureOnOff, insureDelete } from '@/api/InsuranceManagement.js'
+export default {
+  components: { TemplatePage, Popu, InsuranceContractForm },
+  mixins: [import_mixin, add_callback_mixin, operation_mixin],
+  data() {
+    return {
+      morePlan: [],
+      // 事件组合
+      optionsEvensGroup: [
+        [
+          [
+            {
+              name: '新增',
+              isRole: this.$restrict('add'),
+
+              click: this.addOn(() => {
+                this.item = null
+                this.showType = 0
+                this.visible = true
+              })
+            }
+          ]
+        ]
+      ],
+      // 关闭新增弹窗
+      handleClose: this.addOff(() => {
+        this.visible = false
+        this.item = null
+        this.showType = null
+      }),
+      // 表格属性
+      tableAttributes: {
+        // 启用勾选列
+        selectColumn: true
+      },
+      // 表格事件
+      tableEvents: {
+        'selection-change': this.selectionChange
+      },
+      recordSelected: [],
+      visible: false,
+      item: null,
+      showType: null
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList: insureList,
+    // 导出
+    exportList: insureListExport,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      if (item.jname === 'status') {
+        defaultData.render = (h, { row, index, column }) => {
+          return (
+            <div class="operation-btns">
+              <el-switch
+                value={row.status}
+                onInput={value => (row.status = value)}
+                active-value="有效"
+                inactive-value="无效"
+                onChange={() => {
+                  insureOnOff({
+                    id: row.id,
+                    status: row.status === '有效' ? 'ON' : 'OFF'
+                  }).then(res => {
+                    this.$successMsg('状态更改成功')
+                  })
+                }}
+              ></el-switch>
+              <span style="margin-left:10px">{row.status}</span>
+            </div>
+          )
+        }
+      }
+      return defaultData
+    },
+    // 监听勾选变化
+    selectionChange(data) {
+      this.recordSelected = data
+    },
+    operation() {
+      return this.operationBtn({
+        edit: {
+          conditions: ({ row, index, column }) => {
+            return true
+          },
+          click: ({ row, index, column }) => {
+            this.item = row
+            this.visible = true
+            this.showType = 1
+          }
+        },
+        detail: {
+          conditions: ({ row, index, column }) => {
+            return true
+          },
+          click: ({ row, index, column }) => {
+            this.item = row
+            this.visible = true
+            this.showType = 2
+          }
+        },
+        del: {
+          conditions: ({ row, index, column }) => {
+            return true
+          },
+          prompt: '确定删除?',
+          click: ({ row, index, column }) => {
+            insureDelete({
+              id: row.id
+            })
+              .then(res => {
+                this.$refs.pageRef.refreshList()
+                this.$message({
+                  type: 'success',
+                  message: `删除成功!`
+                })
+              })
+              .catch(err => {
+                console.log(err)
+              })
+          }
+        }
+      })
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 131 - 0
src/views/setting/insuranceAdministration/mailboxConfig/index.vue

@@ -0,0 +1,131 @@
+<template>
+  <div style="box-sizing: border-box; padding: 20px">
+    <zj-form-container
+      ref="formRef"
+      :formData="formData"
+      :formRules="formRules"
+      :formAttributes="{ 'label-position': 'top' }"
+    >
+      <zj-form-module title="邮箱配置" :formData="formData" :formItems="formItems" :column="1"> </zj-form-module>
+    </zj-form-container>
+    <div>
+      <el-button size="mini" type="primary" @click="submit">提交</el-button>
+      <el-button size="mini" type="success" @click="reset">重置</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+import { insureEmailConfig, insureEmailDetail } from '@/api/InsuranceManagement.js'
+export default {
+  data() {
+    return {
+      formData: {
+        sendEmail: '',
+        sendName: '',
+        sendPassword: '',
+        corpId: '',
+        secret: '',
+        receComEmail: '',
+        receYwxEmail: '',
+        sendDailyTime: '',
+        noticeDay: ''
+      },
+      formRules: {
+        receComEmail: [{ required: true, message: '请输入', trigger: 'blur' }],
+        receYwxEmail: [{ required: true, message: '请输入', trigger: 'blur' }],
+        sendDailyTime: [{ required: true, message: '请输入', trigger: 'blur' }],
+        noticeDay: [{ required: true, message: '请输入', trigger: 'blur' }],
+        sendName: [{ required: true, message: '请输入', trigger: 'blur' }],
+        sendEmail: [{ required: true, message: '请输入', trigger: 'blur' }],
+        sendPassword: [{ required: true, message: '请输入', trigger: 'blur' }]
+      }
+    }
+  },
+  computed: {
+    formItems() {
+      return [
+        {
+          name: 'el-input',
+          formItemAttributes: { label: '接收邮箱,公用', prop: 'receComEmail' }
+        },
+        {
+          name: 'el-input',
+          formItemAttributes: { label: '接收邮箱,意外险专用,多邮箱以英文逗号隔开', prop: 'receYwxEmail' }
+        },
+        {
+          name: 'el-time-picker',
+          md: 8,
+          attributes: { style: 'width:100%', format: 'HH:mm', valueFormat: 'HH:mm' },
+          formItemAttributes: { label: '每日发送时间', prop: 'sendDailyTime', 'label-position': 'left' }
+        },
+        {
+          name: 'el-input',
+          md: 8,
+          formItemAttributes: { label: '到期提醒时间:保险到期前多少天', prop: 'noticeDay' }
+        },
+        {
+          name: 'el-input',
+          md: 8,
+          formItemAttributes: { label: '企业id', prop: 'corpId' }
+        },
+        {
+          name: 'el-input',
+          md: 8,
+          formItemAttributes: { label: '发件人昵称', prop: 'sendName' }
+        },
+        {
+          name: 'el-input',
+          md: 8,
+          formItemAttributes: { label: '发件人邮箱', prop: 'sendEmail' }
+        },
+        {
+          name: 'el-input',
+          md: 8,
+          formItemAttributes: { label: '发件人密码', prop: 'sendPassword' }
+        },
+
+        {
+          name: 'el-input',
+          md: 8,
+          formItemAttributes: { label: '应用的凭证密钥', prop: 'secret' }
+        }
+      ]
+    }
+  },
+  created() {
+    // 获取详情
+    insureEmailDetail().then(res => {
+      for (var key in res.data) {
+        if (key !== 'id') {
+          this.formData[key] = res.data[key]
+        }
+      }
+    })
+  },
+  methods: {
+    submit() {
+      this.$refs['formRef'].validate(valid => {
+        if (valid) {
+          insureEmailConfig({
+            ...this.formData
+          }).then(res => {
+            this.$message({
+              type: 'success',
+              message: `保存成功!`
+            })
+          })
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    },
+    reset() {
+      Object.assign(this.$data, this.$options.data())
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 96 - 0
src/views/setting/insuranceAdministration/sentEmailRecords/index.vue

@@ -0,0 +1,96 @@
+<template>
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :exportList="exportList"
+    :columnParsing="columnParsing"
+    :optionsEvensGroup="optionsEvensGroup"
+    :morePlan="morePlan"
+    :operationColumnWidth="160"
+    :operation="operation()"
+  >
+    <Popu v-if="visible">
+      <SentEmailRecordsForm :item="item" @handleClose="handleClose" />
+    </Popu>
+  </template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import import_mixin from '@/components/template/import_mixin.js'
+import add_callback_mixin from '@/components/template/add_callback_mixin.js'
+import Popu from '@/components/template/popu.vue'
+import SentEmailRecordsForm from './sentEmailRecordsForm.vue'
+import operation_mixin from '@/components/template/operation_mixin.js'
+
+import { insureListemail, insureListemailExport, insureResend } from '@/api/InsuranceManagement.js'
+export default {
+  components: { TemplatePage, Popu, SentEmailRecordsForm },
+  mixins: [import_mixin, add_callback_mixin, operation_mixin],
+  data() {
+    return {
+      morePlan: [],
+      // 事件组合
+      optionsEvensGroup: [],
+      // 表格属性
+      tableAttributes: {},
+      // 表格事件
+      tableEvents: {},
+      recordSelected: [],
+      visible: false,
+      item: null
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList: insureListemail,
+    // 导出
+    exportList: insureListemailExport,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    },
+    operation() {
+      return this.operationBtn({
+        detail: {
+          conditions: ({ row, index, column }) => {
+            return true
+          },
+          click: ({ row, index, column }) => {
+            this.item = row
+            this.visible = true
+          }
+        },
+        anew: {
+          conditions: ({ row, index, column }) => {
+            return true
+          },
+          prompt: '是否确定重新发送?',
+          click: ({ row, index, column }) => {
+            insureResend({
+              emailBatchNo: row.emailBatchNo
+            })
+              .then(res => {
+                this.$refs.pageRef.refreshList()
+                this.$message({
+                  type: 'success',
+                  message: `发送成功!`
+                })
+              })
+              .catch(err => {
+                console.log(err)
+              })
+          }
+        }
+      })
+    },
+    // 关闭新增弹窗
+    handleClose() {
+      this.visible = false
+      this.item = null
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 50 - 0
src/views/setting/insuranceAdministration/sentEmailRecords/list.vue

@@ -0,0 +1,50 @@
+<template>
+  <template-page
+    ref="pageRef"
+    :getList="getList"
+    :exportList="exportList"
+    :columnParsing="columnParsing"
+    :optionsEvensGroup="optionsEvensGroup"
+    :morePlan="morePlan"
+  >
+  </template-page>
+</template>
+
+<script>
+import TemplatePage from '@/components/template/template-page-1.vue'
+import { insureWorkerList, insureWorkerExport } from '@/api/InsuranceManagement.js'
+export default {
+  components: { TemplatePage },
+  props: {
+    batchEamilNo: {
+      type: String,
+      default: ''
+    }
+  },
+  data() {
+    return {
+      morePlan: [],
+      // 事件组合
+      optionsEvensGroup: [],
+      // 表格属性
+      tableAttributes: {},
+      // 表格事件
+      tableEvents: {}
+    }
+  },
+  methods: {
+    // 列表请求函数
+    getList(p) {
+      return insureWorkerList({ ...p, emailBatchNo: this.batchEamilNo })
+    },
+    // 导出
+    exportList: insureWorkerExport,
+    // 表格列解析渲染数据更改
+    columnParsing(item, defaultData) {
+      return defaultData
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped></style>

+ 81 - 0
src/views/setting/insuranceAdministration/sentEmailRecords/sentEmailRecordsForm.vue

@@ -0,0 +1,81 @@
+<template>
+  <zj-page-container>
+    <div style="height: 40px">
+      <el-page-header slot="head" content="" @back="$emit('handleClose')" />
+    </div>
+    <el-tabs v-model="tibleType" type="card" size="mini">
+      <el-tab-pane label="发送详情" name="fsxq"> </el-tab-pane>
+      <el-tab-pane label="保单信息" name="bdxx"> </el-tab-pane>
+    </el-tabs>
+    <zj-page-fill>
+      <div v-show="tibleType === 'fsxq'">
+        <el-descriptions class="margin-top" :column="2" border :labelStyle="{ width: '140px' }">
+          <el-descriptions-item>
+            <template slot="label"> 邮件发送批次 </template>
+            {{ info.emailBatchNo }}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 发送邮箱 </template>
+            {{ info.sendEmail }}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 接收邮箱 </template>
+            {{ info.receEmail }}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 发送状态 </template>
+            {{ info.sendStatus }}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 发送时间 </template>
+            {{ info.sendTime }}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 回执状态 </template>
+            {{ info.receStatus }}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 回执时间 </template>
+            {{ info.receTime }}
+          </el-descriptions-item>
+          <el-descriptions-item>
+            <template slot="label"> 操作时间 </template>
+            {{ info.updateTime }}
+          </el-descriptions-item>
+        </el-descriptions>
+      </div>
+      <List v-show="tibleType === 'bdxx'" v-if="info.emailBatchNo" :batchEamilNo="info.emailBatchNo" />
+    </zj-page-fill>
+  </zj-page-container>
+</template>
+
+<script>
+import List from './list.vue'
+import { insureDetailemail } from '@/api/InsuranceManagement.js'
+export default {
+  components: { List },
+  props: {
+    item: {
+      type: Object,
+      default: null
+    }
+  },
+  data() {
+    return {
+      tibleType: 'fsxq',
+      info: {}
+    }
+  },
+  created() {
+    // 获取详情
+    insureDetailemail({
+      id: this.item.id
+    }).then(res => {
+      this.info = res.data
+    })
+  },
+  methods: {}
+}
+</script>
+
+<style lang="scss" scoped></style>