MrShi
2025-04-11 3a45da15c947c2d478a44a51bd0f926647b1b841
company/src/components/business/OperaSettleClaimsWindow.vue
@@ -6,17 +6,23 @@
        :confirm-working="isWorking"
        @confirm="confirm"
    >
        <div class="desc">
        <div class="desc" v-loading="loading">
            <div class="desc_label">
                <div class="desc_label_left">
                    <span class="desc_label_left_title">
                        报案详情
                    </span>
                    <span class="desc_label_left_time" :style="contrast(model.createDate, model.baoxianEndTime) ? 'rgba(249, 86, 1, 0.996)' : 'black'">
                    <span class="desc_label_left_time" :style="contrast(model.createDate, model.baoxianEndTime) ? 'color: rgba(249, 86, 1, 0.996)' : 'color: black'">
                        报案日期:{{ model.createDate }}
                    </span>
                    <span class="desc_label_left_code">
                        报案号:{{ model.reportNum || '-' }}
                    </span>
                    <span class="desc_label_left_code">
                      状态:
                      <span  :class="'settle-status'+model.status" v-if="model.status==0 || model.status==2|| model.status==3">处理中 </span>
                      <span  :class="'settle-status'+model.status" v-if="model.status==1">已撤案 </span>
                      <span  :class="'settle-status'+model.status" v-if="model.status==4">已结案 </span>
                    </span>
                </div>
                <div class="desc_label_right">
@@ -27,8 +33,8 @@
                        <el-button type="danger" v-if="model.status !=1 && model.status !=4" @click="$refs.operaInsuranceApplyCheckWindow.open('撤销申请',model,remarkLogList,3)">撤销申请</el-button>
                    </template>
                    <template v-else>
                        <el-button type="primary" @click="edit" v-if="model.status === 2">修改信息</el-button>
                        <el-button type="primary" @click="$refs.supplementaryExplanation.open('补充说明', model.id)" v-if="model.status === 2">补充说明</el-button>
                        <el-button type="primary" @click="edit" v-if="model.status === 0 || model.status === 2 || model.status === 3">修改信息</el-button>
                        <el-button type="primary" @click="$refs.supplementaryExplanation.open('补充说明', model.id)" v-if="model.status === 0 || model.status === 2 || model.status === 3">补充说明</el-button>
                    </template>
                </div>
            </div>
@@ -50,20 +56,20 @@
                    </div>
                </div>
                <div class="desc_list_item">
                    <div class="desc_list_item_label">
                    <div class="desc_list_item_label" >
                        事故发生时间:
                    </div>
                    <div class="desc_list_item_val" :style="contrast24(model.createDate, model.baoxianStartTime) ? 'rgba(249, 86, 1, 0.996)' : 'black'">
                      {{ model.createDate }}
                    <div class="desc_list_item_val" :style="contrast24(model.baoxianStartTime, model.happenTime) ? 'color: rgba(249, 86, 1, 0.996)' : 'color: black'">
                      {{ model.happenTime }}
                    </div>
                </div>
                <div class="desc_list_item">
                    <div class="desc_list_item_label">
                        所属保单号:
                    </div>
                    <div class="desc_list_item_val" style="cursor: pointer; color: rgba(39, 157, 255, 0.968627450980392);">
                    <div class="desc_list_item_val" style="cursor: pointer; color: rgba(39, 157, 255, 0.968627450980392);" @click="$refs.OperaInsuranceApplyDetails.open('投保详情', { id: model.insuranceApplyId })">
                      {{ model.applyCode || '-' }}
                        <el-button v-if="model.baoxiandanFile && model.baoxiandanFile.fileurlFull" type="primary" style="margin-left: 10px;" @click="openBaoxiandan">查看保险单</el-button>
                        <el-button v-if="model.baoxiandanFile && model.baoxiandanFile.fileurlFull" type="primary" style="margin-left: 10px;" @click.stop="openBaoxiandan">查看保险单</el-button>
                    </div>
                </div>
                <div class="desc_list_item">
@@ -110,9 +116,9 @@
                    <div class="desc_list_item_label">
                        事故类型:
                    </div>
                    <div class="desc_list_item_val"  v-if="model.medicalInsurance ===1">上下班途中受伤</div>
                    <div class="desc_list_item_val" v-else-if="model.medicalInsurance ===2">非工作时间受伤</div>
                    <div class="desc_list_item_val"  v-else-if="model.medicalInsurance ===3">意外受</div>
                    <div class="desc_list_item_val"  v-if="model.type ===1">上下班途中受伤</div>
                    <div class="desc_list_item_val" v-else-if="model.type ===2">非工作时间受伤</div>
                    <div class="desc_list_item_val"  v-else-if="model.type ===3">意外受伤</div>
                    <div class="desc_list_item_val"  v-else>工作期间受伤</div>
                </div>
                <div class="desc_list_item">
@@ -120,7 +126,7 @@
                        是否住院:
                    </div>
                    <div class="desc_list_item_val">
                        <div class="desc_list_item_val"  v-if="model.inHospital ===1">是</div>
                        <div class="desc_list_item_val"  v-if="model.inHospital === 0">是</div>
                        <div class="desc_list_item_val"  v-else>否</div>
                    </div>
                </div>
@@ -128,7 +134,7 @@
                    <div class="desc_list_item_label">
                        是否有医疗保险:
                    </div>
                    <div class="desc_list_item_val">{{ model.medicalInsurance ===1?"是":"否" }}</div>
                    <div class="desc_list_item_val">{{ model.medicalInsurance ===0?"是":"否" }}</div>
                </div>
                <div class="desc_list_item">
                    <div class="desc_list_item_label">
@@ -151,6 +157,10 @@
                    <div class="desc_list_item_val">  {{model.informantPhone}} </div>
                </div>
                <div class="desc_list_item" style="width: 100%;">
                    <div class="desc_list_item_label"> 被保险人: </div>
                    <div class="desc_list_item_val">{{model.companyName}}</div>
                </div>
                <div class="desc_list_item" style="width: 100%;">
                    <div class="desc_list_item_label"> 事故描述: </div>
                    <div class="desc_list_item_val">{{model.content}}</div>
                </div>
@@ -160,8 +170,8 @@
                    </div>
                    <div class="desc_list_item_videos" v-if="model.reportFileList && model.reportFileList.length > 0">
                        <div class="desc_list_item_imgs_video" v-for="(item, index) in model.reportFileList" :key="index">
                            <img :src="item.fileurlFull" v-if="item.type === 2" />
                            <video controls autoplay :src="item.fileurlFull" v-if="item.type === 1"></video>
                            <img :src="item.fileurlFull" v-if="item.type === 0" />
                            <video controls :src="item.fileurlFull" v-if="item.type === 1"></video>
                        </div>
                    </div>
                    <div v-else class="desc_list_item_videos">-</div>
@@ -173,8 +183,8 @@
                    <span class="desc_label_left_title">
                        理赔资料
                    </span>
                    <span v-if="doneFileDate!=null" class="desc_label_left_time" style="color: black">
                        资料完成日期:{{doneFileDate}}
                    <span v-if="model.finishDate!=null" class="desc_label_left_time" style="color: black">
                        资料完成日期:{{model.finishDate}}
                    </span>
                </div>
                <div class="desc_label_right">
@@ -204,7 +214,10 @@
                        </div>
                      </div>
                    </template>
                    <upload width="100px" height="100px" :list="[]" accept=".png,.jpg,.jpeg,.mp4,.word,.xlsx,.xls,.pdf,.excel" folder="settle" @success="claimsUploadFile($event, 2)" />
                  <template   v-if="(model.relationFileList==null|| model.relationFileList.length==0) && (model.status ==1 || model.status ==4)">
                    <span style="height: 40px; width:100%;text-align:center;color: #8c939d;font-size: 12px">暂无相关材料</span>
                  </template>
                    <upload v-if="model.status !=1 && model.status !=4" width="100px" height="100px" :list="[]" accept=".png,.jpg,.jpeg,.mp4,.word,.xlsx,.xls,.pdf,.excel" folder="settle" @loading="loading = true" @success="claimsUploadFile($event, 2)" />
<!--                    <div class="desc_data_list_item">-->
<!--                      <UploadFileCommon :uploadData="{ folder: 'settle' }" />-->
<!--                      <div class="desc_data_list_item_upload">-->
@@ -242,7 +255,10 @@
                      </div>
                    </div>
                  </template>
                    <upload width="100px" height="100px" :list="[]" accept=".png,.jpg,.jpeg,.mp4,.word,.xlsx,.xls,.pdf,.excel" folder="settle" @success="claimsUploadFile($event, 3)" />
                  <template   v-if="(model.outpatientFileList==null|| model.outpatientFileList.length==0) && (model.status ==2 || model.status ==4)">
                    <span style="height: 40px; width:100%;text-align:center;color: #8c939d;font-size: 12px">暂无相关材料</span>
                  </template>
                    <upload v-if="model.status !=1 && model.status !=4" width="100px" height="100px" :list="[]" accept=".png,.jpg,.jpeg,.mp4,.word,.xlsx,.xls,.pdf,.excel" folder="settle" @loading="loading = true" @success="claimsUploadFile($event, 3)" />
<!--                    <div class="desc_data_list_item">-->
<!--                        <div class="desc_data_list_item_img" style="cursor: pointer; background: #8c939d;">-->
<!--                            <i class="el-icon-plus"></i>-->
@@ -272,7 +288,10 @@
                      </div>
                    </div>
                  </template>
                    <upload width="100px" height="100px" :list="[]" accept=".png,.jpg,.jpeg,.mp4,.word,.xlsx,.xls,.pdf,.excel" folder="settle" @success="claimsUploadFile($event, 4)" />
                  <template   v-if="(model.hospitalFileList==null|| model.hospitalFileList.length==0) && (model.status ==2 || model.status ==4)">
                    <span style="height: 40px; width:100%;text-align:center;color: #8c939d;font-size: 12px">暂无相关材料</span>
                  </template>
                    <upload v-if="model.status !=1 && model.status !=4" width="100px" height="100px" :list="[]" accept=".png,.jpg,.jpeg,.mp4,.word,.xlsx,.xls,.pdf,.excel" folder="settle" @loading="loading = true" @success="claimsUploadFile($event, 4)" />
<!--                    <div class="desc_data_list_item">-->
<!--                        <div class="desc_data_list_item_img" style="cursor: pointer; background: #8c939d;">-->
<!--                            <i class="el-icon-plus"></i>-->
@@ -302,7 +321,10 @@
                      </div>
                    </div>
                  </template>
                    <upload width="100px" height="100px" :list="[]" accept=".png,.jpg,.jpeg,.mp4,.word,.xlsx,.xls,.pdf,.excel" folder="settle" @success="claimsUploadFile($event, 5)" />
                  <template   v-if="(model.disabilityFileList==null|| model.disabilityFileList.length==0) && (model.status ==2 || model.status ==4)">
                    <span style=" height: 40px;width:100%;text-align:center;color: #8c939d;font-size: 12px">暂无相关材料</span>
                  </template>
                    <upload  v-if="model.status !=1 && model.status !=4" width="100px" height="100px" :list="[]" accept=".png,.jpg,.jpeg,.mp4,.word,.xlsx,.xls,.pdf,.excel" folder="settle" @loading="loading = true" @success="claimsUploadFile($event, 5)" />
<!--                    <div class="desc_data_list_item">-->
<!--                      <UploadFileCommon :uploadData="{ folder: 'apply',fileType:'.pdf' }" :fileList="form.fileList1" @uploadSuccess="baoxianFileUploaded" />-->
<!--&lt;!&ndash;                      <div class="desc_data_list_item_img" style="cursor: pointer; background: #8c939d;">-->
@@ -336,7 +358,10 @@
                      </div>
                    </div>
                  </template>
                    <upload width="100px" height="100px" :list="[]" accept=".png,.jpg,.jpeg,.mp4,.word,.xlsx,.xls,.pdf,.excel" folder="settle" @success="claimsUploadFile($event, 6)" />
                  <template   v-if="(model.compensationFileList==null|| model.compensationFileList.length==0) && (model.status ==2 || model.status ==4)">
                    <span style=" height: 40px;width:100%;text-align:center;color: #8c939d;font-size: 12px">暂无相关材料</span>
                  </template>
                    <upload v-if="model.status !=1 && model.status !=4" width="100px" height="100px" :list="[]" accept=".png,.jpg,.jpeg,.mp4,.word,.xlsx,.xls,.pdf,.excel" folder="settle" @loading="loading = true" @success="claimsUploadFile($event, 6)" />
<!--                    <div class="desc_data_list_item">-->
<!--                        <div class="desc_data_list_item_img" style="cursor: pointer; background: #8c939d;">-->
<!--                            <i class="el-icon-plus"></i>-->
@@ -360,7 +385,7 @@
            <div class="desc_times">
                <el-timeline :reverse="reverse">
                    <el-timeline-item
                        v-for="(activity, index) in model.settleClaimsLogList"
                        v-for="(activity, index) in activeLogList"
                        :key="index"
                        :timestamp="activity.timestamp">
                      <div style="display: flex;  flex-direction: column;" v-if="activity.objType==3">
@@ -378,7 +403,7 @@
                                        {{activity.content}}
                                 </span>
                                 <span style="margin-top: 5px; font-size: 12px; font-weight: 400; color: #999999;">
                                    操作员-{{activity.creatorName}}({{activity.creatorType==1? activity.companyName: "平台端"}}){{activity.createDate}}
                                    操作员-{{activity.creatorName}}({{(activity.creatorType == 1||activity.creatorType == 2)? activity.companyName: "平台端"}}){{activity.createDate}}
                                </span>
                      </div>
                      <div style="display: flex; flex-direction: column;" v-else>
@@ -389,7 +414,7 @@
                                    </span>
                                </span>
                                 <span style="margin-top: 5px; font-size: 12px; font-weight: 400; color: #999999;">
                                    操作员-{{activity.creatorName}}({{activity.creatorType==1? activity.companyName: "平台端"}}){{activity.createDate}}
                                    操作员-{{activity.creatorName}}({{(activity.creatorType == 1||activity.creatorType == 2)? activity.companyName: "平台端"}}){{activity.createDate}}
                                </span>
                      </div>
                    </el-timeline-item>
@@ -404,165 +429,178 @@
        <onlineReporting ref="onlineReporting" @success="callback" />
        <!--    补充说明    -->
        <supplementaryExplanation ref="supplementaryExplanation" @success="callback" />
        <!--    投保详情    -->
        <OperaInsuranceApplyDetails ref="OperaInsuranceApplyDetails" @success="callback" />
    </GlobalWindow>
</template>
<script>
    import UploadFileCommon from '@/components/common/UploadFileCommon'
    import BaseOpera from '@/components/base/BaseOpera'
    import GlobalWindow from '@/components/common/GlobalWindow'
    import OperaSettleClaimsCheckWindow from '@/components/business/OperaSettleClaimsCheckWindow'
    import onlineReporting from '@/components/enterprise/onlineReporting'
    import supplementaryExplanation from '@/components/enterprise/supplementaryExplanation'
    import upload from '@/components/common/upload'
    import {confirmFile, findById,exportFiles,claimsUploadFile,delFile} from '@/api/business/settleClaims'
    import { mapState } from 'vuex'
    export default {
        name: 'OperaSettleClaimsWindow',
        extends: BaseOpera,
        components: { GlobalWindow, OperaSettleClaimsCheckWindow,UploadFileCommon, onlineReporting, supplementaryExplanation, upload },
        data () {
            return {
              doneFileDate: null,
              remarkLogList: [],
              list: [],
              model: {},
              activeName: 'first',
              reverse: true
            }
        },
        computed: {
            ...mapState(['userInfo'])
        },
        created () {
            this.config({
                api: '/business/settleClaims',
                'field.id': 'id'
            })
        },
        methods: {
          open(title,target){
            this.model = {}
            this.model = target
            this.title = title
            this.visible = true
            this.doneFileDate = null
            this.remarkLogList = []
            this.getDetail()
          },
            // 判断两个时间之间相差是否
            contrast24(time1, time2) {
              if (time1 && time2) {
                  let a = new Date(time1)
                  let b = new Date(time2)
                  let timeDiff = Math.abs(a.getTime() - b.getTime());
                  return Math.ceil(timeDiff / (3600 * 1000)) <= 24;
              } else {
                  return false
              }
            },
            contrast(time1, time2) {
              if (time1 && time2) {
                  let a = new Date(time1).getTime()
                  let b = new Date(time2).getTime()
                  return a > b
              } else {
                  return false
              }
            },
            edit() {
              let obj = JSON.parse(JSON.stringify(this.model))
                obj.areaId = obj.areaId.split(',').map(item => Number(item))
              this.$refs.onlineReporting.open('修改信息', obj)
            },
          openBaoxiandan(){
            window.open(this.model.baoxiandanFile.fileurlFull);
          },
          delFile(id){
            this.$dialog.messageConfirm('确认删除该附件吗,一旦删除无法撤回?')
                .then(() => {
                    delFile(this.model.id, id).then(response => {
                        this.getDetail()
                    }).catch(err => {
                        this.$tip.apiFailed(err)
                    })
                })
          },
          getDetail(){
            findById( this.model.id)
                .then(res => {
                  this.model = res
                  this.remarkLogList = []
                  var logList = this.model.settleClaimsLogList
                  if (logList) {
                    logList.forEach(item => {
                       if (item.objType == 2) {
                         this.doneFileDate = item.createDate
                       }
                      if (item.objType==7) {
                        this.remarkLogList.push(item)
                      }
                    })
                  }
                }).catch(err => {
                })
          },
            handleClick(tab) {
                this.activeName = tab.name
            },
          callback(){
            this.getDetail()
            this.$emit('success')
          },
          claimsUploadFile(e, objType) {
                claimsUploadFile({
                    id: this.model.id,
                    objType,
                    fileUrl: e.imgaddr,
                    fileName: e.originname,
                    fileType: e.type
                }).then(response => {
                    this.getDetail()
                }).catch(err => {
                    this.$tip.apiFailed(err)
                })
            },
            submit(type) {
              var that = this
              if (type == 0) {
                this.$dialog.messageConfirm('理赔材料收集完成,请及时提交保险公司!')
                    .then(() => {
                      // this.isWorking = true
                      confirmFile({id:that.model.id})
                          .then(response => {
                            that.getDetail()
                          }).catch(err => {
                        this.$tip.apiFailed(err)
                      })
                    })
              }else if(type == 1){
                //资料下载
                this.$dialog.exportConfirm('确认进行资料下载吗?')
                    .then(() => {
                      this.isWorking = true
                      exportFiles({ id: that.model.id })
                          .then(response => {
                            this.download(response)
                          }).catch(err => {
                            console.log(err)
                            this.$message.error("下载资料失败,请确认资料数据不为空")
                          }).finally(() => {
                            this.isWorking = false
                          })
                    })
                    .catch(() => {
                    })
              }
            }
        }
import UploadFileCommon from '@/components/common/UploadFileCommon'
import BaseOpera from '@/components/base/BaseOpera'
import GlobalWindow from '@/components/common/GlobalWindow'
import OperaSettleClaimsCheckWindow from '@/components/business/OperaSettleClaimsCheckWindow'
import onlineReporting from '@/components/enterprise/onlineReporting'
import supplementaryExplanation from '@/components/enterprise/supplementaryExplanation'
import OperaInsuranceApplyDetails from '@/components/business/OperaInsuranceApplyWindow'
import upload from '@/components/common/upload'
import { confirmFile, findById, exportFiles, claimsUploadFile, delFile } from '@/api/business/settleClaims'
import { mapState } from 'vuex'
export default {
  name: 'OperaSettleClaimsWindow',
  extends: BaseOpera,
  components: { GlobalWindow, OperaSettleClaimsCheckWindow, OperaInsuranceApplyDetails, UploadFileCommon, onlineReporting, supplementaryExplanation, upload },
  data () {
    return {
      loading: false,
      doneFileDate: null,
      remarkLogList: [],
      activeLogList:[],
      list: [],
      model: {},
      activeName: 'first',
      reverse: false
    }
  },
  computed: {
    ...mapState(['userInfo'])
  },
  created () {
    this.config({
      api: '/business/settleClaims',
      'field.id': 'id'
    })
  },
  methods: {
    open (title, target) {
      this.model = {}
      this.model = target
      this.title = title
      this.visible = true
      this.doneFileDate = null
      this.remarkLogList = []
      this.activeLogList = []
      this.getDetail()
    },
    // 判断两个时间之间相差是否
    contrast24 (time1, time2) {
      console.log(time1)
      console.log(time2)
      if (time1 && time2) {
        const a = new Date(time1)
        const b = new Date(time2)
        const timeDiff = Math.abs(a.getTime() - b.getTime())
        console.log(Math.ceil(timeDiff / (3600 * 1000)))
        return Math.ceil(timeDiff / (3600 * 1000)) <= 24
      } else {
        return false
      }
    },
    contrast (time1, time2) {
      if (time1 && time2) {
        const a = new Date(time1).getTime()
        const b = new Date(time2).getTime()
        return a > b
      } else {
        return false
      }
    },
    edit () {
      const obj = JSON.parse(JSON.stringify(this.model))
      obj.areaId = obj.areaId.split(',').map(item => Number(item))
      this.$refs.onlineReporting.open('修改信息', obj)
    },
    openBaoxiandan () {
      window.open(this.model.baoxiandanFile.fileurlFull)
    },
    delFile (id) {
      this.$dialog.messageConfirm('确认删除该附件吗,一旦删除无法撤回?')
        .then(() => {
          delFile(this.model.id, id).then(response => {
            this.getDetail()
          }).catch(err => {
            this.$tip.apiFailed(err)
          })
        })
    },
    getDetail () {
      findById(this.model.id)
        .then(res => {
          this.model = res
          this.remarkLogList = []
          this.activeLogList =[]
          var logList = this.model.settleClaimsLogList
          if (logList) {
            logList.forEach(item => {
              if (item.objType == 2) {
                this.doneFileDate = item.createDate
              }
              if (item.objType == 7) {
                this.remarkLogList.push(item)
              } else {
                this.activeLogList.push(item)
              }
            })
          }
        }).catch(err => {
        })
    },
    handleClick (tab) {
      this.activeName = tab.name
    },
    callback () {
      this.getDetail()
      this.$emit('success')
    },
    claimsUploadFile (e, objType) {
      claimsUploadFile({
        id: this.model.id,
        objType,
        fileUrl: e.imgaddr,
        fileName: e.originname,
        fileType: e.type
      }).then(response => {
        this.getDetail()
      }).catch(err => {
        this.$tip.apiFailed(err)
      }).finally(() => {
        this.loading = false
      })
    },
    submit (type) {
      var that = this
      if (type == 0) {
        this.$dialog.messageConfirm('理赔材料收集完成,请及时提交保险公司!')
          .then(() => {
            // this.isWorking = true
            confirmFile({ id: that.model.id })
              .then(response => {
                that.getDetail()
              }).catch(err => {
                this.$tip.apiFailed(err)
              })
          })
      } else if (type == 1) {
        // 资料下载
        this.$dialog.exportConfirm('确认进行资料下载吗?')
          .then(() => {
            this.isWorking = true
            exportFiles({ id: that.model.id })
              .then(response => {
                this.download(response)
              }).catch(err => {
                console.log(err)
                this.$message.error('下载资料失败,请确认资料数据不为空')
              }).finally(() => {
                this.isWorking = false
              })
          })
          .catch(() => {
          })
      }
    }
  }
}
</script>
<style>
    .v-modal {
@@ -788,7 +826,6 @@
                        }
                        img {
                            width: 100%;
                            height: 100%;
                        }
                        video {
                            width: 100%;
@@ -800,16 +837,27 @@
                        display: flex;
                        flex-direction: column;
                        justify-content: space-between;
                        word-break: break-all;
                        span {
                            &:nth-child(1) {
                                width: 160px;
                                white-space: nowrap;
                                overflow: hidden;
                                text-overflow: ellipsis;
                                font-size: 14px;
                                color: black;
                                padding-right: 30px;
                                box-sizing: border-box;
                            }
                            &:nth-child(2) {
                                width: 100%;
                                word-break: break-all;
                                font-size: 14px;
                                color: #888888;
                            }
                            &:nth-child(3) {
                                width: 100%;
                                word-break: break-all;
                                font-size: 14px;
                                color: #888888;
                            }