<template>
  <dialog-edit :visible.sync="dialogVisible"
               :title="$t('factoringBusinessInfo.order_record')"
               :editModel="editModel"
               :form="form"
               width="1480px"
               :appendToBody="true"
               :api="api">
    <!-- 订单基本信息 -->
    <span class="typefaceSize">{{$t('factoringBusinessInfo.order_basic_info')}}</span>
    <div class="divider"></div>
    <orderBasicInfo :orderForm="form"></orderBasicInfo>

    <!-- 订单时间信息 -->
    <span class="typefaceSize">{{$t('factoringBusinessInfo.order_time_info')}}</span>
    <div class="divider"></div>
    <orderTimeInfo :queryData.sync="queryData" ref='order'></orderTimeInfo>

    <!-- 资料审核列表 -->
    <span class="typefaceSize">{{$t('factoringBusinessInfo.asset_review_table')}}</span>
    <div class="divider"></div>
    <assetReviewTable :orderList.sync="orderList" :orderInfo.sync="orderInfo" ref='clearArr'></assetReviewTable>

    <!-- 中等异常信息 -->
    <span class="typefaceSize">{{$t('factoringBusinessInfo.zd_exception_info')}}</span>
    <div class="divider"></div>
    <zdExceptionInfo :queryData.sync="zdQueryData" ref="zhongdeng"></zdExceptionInfo>

    <!-- 快递接收信息 -->
    <span class="typefaceSize">{{$t('factoringBusinessInfo.expresss_receive_info')}}</span>
    <div class="divider"></div>
    <expresssReceiveInfo :queryData.sync="queryData"  ref="express"></expresssReceiveInfo>

    <!-- 律所反馈信息 -->
    <span class="typefaceSize">{{$t('factoringBusinessInfo.law_feedback_infos')}}</span>
    <div class="divider"></div>
    <lawFeedbackInfo :queryDataNum.sync="queryDataNum"  ref='lawyer'></lawFeedbackInfo>

    <!-- 保理信息修改履历 -->
    <span class="typefaceSize">{{$t('factoringBusinessInfo.factoring_info_modify')}}</span>
    <div class="divider"></div>
    <factoringInfoModify :query.sync="query"></factoringInfoModify>
  </dialog-edit>
</template>
<script>
import BaseEditPage from '@/pages/baseEditPage'
import { DialogEdit } from 'newepoch-components'
import orderBasicInfo from './components/orderBasicInfo'
import orderTimeInfo from './components/orderTimeInfo'
import assetReviewTable from './components/assetReviewTable'
import zdExceptionInfo from './components/zdExceptionInfo'
import expresssReceiveInfo from './components/expresssReceiveInfo'
import lawFeedbackInfo from './components/lawFeedbackInfo'
import factoringInfoModify from './components/factoringInfoModify'
import factoringBusinessInfoApi from '@/api/factoringBusinessInfoApi'
export default {
  name: 'orderDetail',
  extends: new BaseEditPage(''),
  components: {
    DialogEdit,
    orderBasicInfo,
    orderTimeInfo,
    assetReviewTable,
    zdExceptionInfo,
    expresssReceiveInfo,
    lawFeedbackInfo,
    factoringInfoModify
  },
  computed: {
    api () {
      return factoringBusinessInfoApi.searchApi
    }
  },
  data () {
    return {
      initFlag: false,
      query: {},
      queryData: {},
      zdQueryData: {},
      orderList: {},
      orderInfo: {},
      queryDataNum: {}
    }
  },
  watch: {
    dialogVisible (val) {
      if (val) {
        this.initFlag = true
        this.query = Object.assign({}, { assetInfoId: this.form.assetInfoId, assetPoolId: this.form.assetPoolId })
        this.queryData = Object.assign({}, { assetInfoId: this.form.assetInfoId })
        this.zdQueryData = Object.assign({}, { assetCode: this.form.assetCode })
        this.queryDataNum = Object.assign({}, { assetCode: this.form.assetCode })
        this.orderList = Object.assign({}, { assetInfoId: this.form.assetInfoId })
        this.orderInfo = Object.assign({}, { assetsId: this.form.assetInfoId })
        this.$nextTick(() => {
          this.$refs.express.handleFilter()
          this.$refs.order.handleFilter()
          this.$refs.clearArr.handerData()
          this.$refs.lawyer.handleFilter()
          this.$refs.zhongdeng.handleFilter()
          // this.$refs.clearArr.handerData()
        })
      } else {
        this.initFlag = false
        this.$refs.clearArr.clearArr()
      }
    }
  }
}
</script>
