vehicleDamageDetail.vue 9.25 KB
<!-- 报价单详情 -->

<template>
  <d2-container class="order-detail">
    <div class="d2-container-content">
      <p class="edit-title">报价单详情</p>
      <div class="form_gp">
        <p class="edit-sub-title">车辆信息</p>
        <el-form class="edit-sub-block" :inline="true">
          <el-form-item label="车架号:">
            {{ $$(detail.ownerDTO, "carVin") }}
          </el-form-item>
          <el-form-item label="座位数:">
            {{ $$(detail.ownerDTO, "seat") }}
          </el-form-item>
          <el-form-item label="车辆发票价/元:">
            {{ $$(detail.ownerDTO, "price") / 100 }}
          </el-form-item>
        </el-form>
      </div>
      <div class="form_gp">
        <p class="edit-sub-title">车主信息</p>
        <el-form class="edit-sub-block" :inline="true">
          <el-form-item label="姓名:">
            {{ $$(detail.ownerDTO, "owner") }}
          </el-form-item>
          <el-form-item label="车主来源:">
            {{ detail.ownerDTO.salesType == 1 ? "售后" : "售前" }}
          </el-form-item>
          <el-form-item label="手机号:">
            {{ $$(detail.ownerDTO, "phone") }}
          </el-form-item>
          <el-form-item label="证件号:">
            {{ $$(detail.ownerDTO, "certificateNo") }}
          </el-form-item>
        </el-form>
      </div>
      <div class="form_table_gp">
        <p class="edit-sub-title">商业险信息</p>
        <el-table
          :data="commerceInsureList"
          border
          :header-cell-style="{
            'text-align': 'center',
            'background-color': '#fafafa'
          }"
          style="width: 100%"
        >
          <el-table-column prop="company" align="center" label="保险公司" />
          <el-table-column prop="base" align="center" label="基础车损险">
            <template slot-scope="scope">
              {{ scope.row.base / 100 }}元
            </template>
          </el-table-column>
          <el-table-column prop="three" align="center" label="第三方责任险" />
          <el-table-column prop="threePremium" align="center" label="保费">
            <template slot-scope="scope">
              {{ scope.row.threePremium / 100 }}元
            </template>
          </el-table-column>
          <el-table-column
            prop="driver"
            align="center"
            label="车上人员责任险(司机)"
          />
          <el-table-column prop="carInsidePremium" align="center" label="保费">
            <template slot-scope="scope">
              {{ scope.row.carInsidePremium / 100 }}元
            </template>
          </el-table-column>
          <el-table-column
            prop="passenger"
            align="center"
            label="车上人员责任险(乘客)"
          />
          <el-table-column prop="passengerPremium" align="center" label="保费">
            <template slot-scope="scope">
              {{ scope.row.passengerPremium / 100 }}元
            </template>
          </el-table-column>
        </el-table>
      </div>
      <div class="form_gp">
        <p class="edit-sub-title">其他商业险</p>
        <el-table
          :data="otherInsuranceList"
          border
          :header-cell-style="{
            'text-align': 'center',
            'background-color': '#fafafa'
          }"
          style="width: 100%"
        >
          <el-table-column prop="typeName" align="center" label="商业险名称" />
          <el-table-column
            prop="compensation"
            align="center"
            label="险种保额"
          />
          <el-table-column prop="payPrice" align="center" label="保费">
            <template slot-scope="scope">
              {{ scope.row.payPrice | divideByHundred }}元
            </template>
          </el-table-column>
        </el-table>
      </div>
      <div class="form_gp">
        <p class="edit-sub-title">交强和车船税</p>
        <el-form class="edit-sub-block" :inline="true">
          <el-form-item label="交强险:">
            {{ $$(compulsoryInsure, "compensation") }} / 保费:{{
              $$(compulsoryInsure, "payPrice") / 100
            }}元
          </el-form-item>
          <el-form-item label="车船税:">
            {{ $$(vehicleInsure, "compensation") }}年 / 保费:{{
              $$(compulsoryInsure, "payPrice") / 100
            }}元
          </el-form-item>
        </el-form>
      </div>
      <div class="form_gp">
        <p class="edit-sub-title">增值车损险服务</p>
        <el-form class="edit-sub-block" :inline="true">
          <el-form-item label="商品:" class="goods">
            <img
              v-if="$$(detail.quotationGoodsInfo, 'titlePictureUrl')"
              class="order-img"
              :src="$$(detail.quotationGoodsInfo, 'titlePictureUrl')"
              @click="handleEnlargeImg"
            />
            {{ $$(detail, "goodsName") }}
          </el-form-item>
          <el-form-item label="商品别名:" class="goods">
            {{ $$(detail, "goodsNameAlias") }}
          </el-form-item>
          <el-form-item label="增值权益价格/元:">
            {{ detail.quotedPriceUpdate / 100 }}
          </el-form-item>
        </el-form>
      </div>
      <p style="text-align: left; padding-left: 30px; margin: 20px 0 16px 0">
        <el-button type="primary" @click="handleClose"> 返回 </el-button>
      </p>
    </div>

    <el-dialog :visible="imgVisible" :before-close="handleEnlargeImg">
      <img
        width="100%"
        :src="$$(detail.quotationGoodsInfo, 'titlePictureUrl')"
        alt="图片"
      />
    </el-dialog>
  </d2-container>
</template>

<script>
import { mapActions } from "vuex"
// import { deepClone } from '@/common/util'
// import { payType } from '@/common/constants.js'
// import dayjs from 'dayjs'
import { quotationFindById } from "@api/vehicleDamage"
export default {
  name: "VehicleDamageDetail",
  filters: {
    // 除以100保留两位小数点
    divideByHundred: (str) => {
      let floatVal = parseFloat(str)
      if (isNaN(floatVal)) {
        return 0
      }
      floatVal = Math.round(str * 100) / 10000
      let strVal = floatVal.toString()
      let searchVal = strVal.indexOf(".")
      if (searchVal < 0) {
        searchVal = strVal.length
        strVal += "."
      }
      while (strVal.length <= searchVal + 2) {
        strVal += "0"
      }
      return parseFloat(strVal)
    },
    // 乘以100保留两位小数点
    multipliedByHundred: (str) => {
      let floatVal = parseFloat(str)
      if (isNaN(floatVal)) {
        return 0
      }
      floatVal = Math.round(str * 10000) / 100
      let strVal = floatVal.toString()
      let searchVal = strVal.indexOf(".")
      if (searchVal < 0) {
        searchVal = strVal.length
        strVal += "."
      }
      while (strVal.length <= searchVal + 2) {
        strVal += "0"
      }
      return parseFloat(strVal)
    }
  },
  data() {
    return {
      userInfo: this.$store.state.d2admin.user.info,
      imgVisible: false,
      detail: {},
      commerceInsureList: [], // 商业险
      compulsoryInsure: {}, // 交强险
      vehicleInsure: {}, // 车船税,
      otherInsuranceList: []
    }
  },
  computed: {},
  mounted() {
    this.detail = this.$route.params.detail
    this.quotationFindById()
  },

  methods: {
    ...mapActions({ close: "d2admin/page/close" }),
    handleEnlargeImg() {
      this.imgVisible = !this.imgVisible
    },
    handleClose() {
      this.$router.push({ name: "vehicleDamageTabList" })
      this.close({ tagName: "/vehicleDamageDetail" })
    },

    quotationFindById() {
      quotationFindById({ id: this.detail.id }).then((res) => {
        this.detail = res
        if (this.detail.insureDTOList && this.detail.insureDTOList.length > 0) {
          this.detail.insureDTOList.forEach((item) => {
            // 保险类型(0-商业,1-交强,2-车船,3-增值车损,4-other)
            if (item.type == 0) {
              this.commerceInsureList.push(item)
            } else if (item.type == 1) {
              this.compulsoryInsure = item
            } else if (item.type == 2) {
              this.vehicleInsure = item
            } else if (item.type == 4) {
              this.otherInsuranceList.push(item)
            }
          })
        }
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.order-detail {
  .d2-container-content {
    margin-top: 0 !important;
  }

  .edit-title {
    // padding-left: 0;
  }

  .form_gp {
    color: #333333;
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
    // h4{
    //   margin: 0 0 10px;
    // }

    .edit-sub-title {
      font-weight: bold;
      margin-bottom: 10px;
    }

    .edit-sub-block {
      padding: 0 16px;
    }

    .el-form-item {
      width: 300px;
      margin-bottom: 0px;
    }

    .goods {
      // height: 100px;

      ::v-deep .el-form-item__content {
        max-width: 240px;
        word-break: break-all;
      }
    }

    .order-img {
      width: 80px;
      height: 80px;
      vertical-align: middle;
      cursor: pointer;
    }
  }

  .form_table_gp {
    padding: 20px 30px;
    margin-bottom: 20px;
  }
}

.signRefundBtn {
  margin-left: 10px;

  .signRefundIcon {
    width: 12px;
    margin-right: 5px;
  }

  span {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
</style>