<!--
  @description: 服务费单管理-查看详情弹框
  @Modifier：王俊楠
  @routerPath:
  @date：  2020-11-03 09:31:27
-->
<template>
  <el-dialog
    :visible.sync="dialogDataVisible"
    :close-on-click-modal="false"
    :lock-scroll="false"
    :title="dialogTitle"
    width="1080px"
    append-to-body
    custom-class="el-dialog__body-p8 el-dialog_table"
  >
    <template v-if="dialogDataVisible">
      <!--服务费单管理-生成收款单详情-->
      <orderReceiptCreateDetail
        v-if="orderReceiptInfo.skType==='00'"
        :order-receipt-info="orderReceiptInfo"
      />
      <!--服务费单管理-减免收费单详情-->
      <orderReceiptCancelDetail
        v-if="orderReceiptInfo.skType==='01'"
        :order-receipt-info="orderReceiptInfo"
      />
      <!--异常订单缴费处理（关联订单）详情-->
      <orderReceiptAbnormalDetail
        v-if="orderReceiptInfo.skType==='02' || orderReceiptInfo.status==='00'"
        :detail-type="detailType"
        :order-receipt-info="orderReceiptInfo"
      />
      <!--异常缴费处理-详情-->
      <!--00 关联订单、01 异常缴费-->
      <serviceOrderAbnormalPayProcessingDetail
        v-if="orderReceiptInfo.skType==='03' || orderReceiptInfo.status==='01'"
        :detail-type="detailType"
        :order-receipt-info="orderReceiptInfo"
      />
    </template>
    <flowAuditList v-if="bizId" :biz-id="bizId" flow-type="00" class="mt10" />
    <span slot="footer" class="dialog-footer">
      <el-button @click="handelClose">关 闭</el-button>
    </span>
  </el-dialog>
</template>

<script>
import { filterDictText } from '@/assets/js/utils' // 字典方法
import orderReceiptCreateDetail from '../serveFeeReceipt/orderReceiptCreate-detail' // 服务费单管理-生成收款单详情
import orderReceiptAbnormalDetail from '../serveFeePayAbnormalOrders/orderReceiptAbnormal-detail' // 异常订单缴费处理（关联订单）详情
import orderReceiptCancelDetail from '../serveFeeBreaksSingle/orderReceiptCancel-detail' // 服务费单管理-减免收费单详情
import serviceOrderAbnormalPayProcessingDetail
  from '../serveFeeAbnormalPay/serviceOrderAbnormalPayProcessing-detail' // 异常缴费处理-详情
import flowAuditList from '@views/work/process/flowAudit-list'

import { orderServeFeeMixins } from '../../mixins/orderServeFeeMixins'
export default {
  name: 'OrderReceiptCreateDialog',
  components: {
    flowAuditList, // 审核信息组件
    serviceOrderAbnormalPayProcessingDetail, // 异常缴费处理-详情
    orderReceiptCancelDetail, // 服务费单管理-减免收费单详情
    orderReceiptAbnormalDetail, // 异常订单缴费处理（关联订单）详情
    orderReceiptCreateDetail // 服务费单管理-生成收款单详情
  },
  mixins: [orderServeFeeMixins],
  data() {
    return {
      dialogDataVisible: false,
      orderReceiptInfo: {
        skType: '' // 业务类型：(00:收款单 01:减免收款单 02: 异常缴纳关联订单 03: 异常缴纳处理)
      },
      detailType: '', // 详情类型 00审核中服务费查看 01异常处理记录查看
      dialogTitle: '', // 弹框标题
      bizId: ''
    }
  },
  methods: {
    filterDictText, // 引入字典值替换文本通用方法
    // 生成收款单打开弹框
    openDialogDetail(data, type) {
      this.bizId = data.bizId // 业务id
      this.detailType = type // 00审核中服务费查看 01异常处理记录查看
      if (type === '00') {
        const skType = this.formatterSkType(data.skType)
        this.dialogTitle = skType + '详情'
      }
      if (type === '01') {
        const status = this.processingTypeStatus(data.status)
        this.dialogTitle = status + '详情'
      }
      this.orderReceiptInfo = data
      this.dialogDataVisible = true
    },
    // 业务类型：(00:收款单 01:减免收款单 02: 异常缴纳关联订单 03: 异常缴纳处理)
    formatterSkType(cellValue) {
      return filterDictText(this.skTypeList, cellValue)
    },
    // 处理类型：00 关联订单、01 异常缴费
    processingTypeStatus(cellValue) {
      return filterDictText(this.processingTypeList, cellValue)
    },
    handelClose() {
      this.dialogDataVisible = false
    }
  }
}
</script>

<style scoped lang="less">
</style>
