// 订单时间信息
<template>
  <dym-form :formValue.sync="form"
            :componentList="componentList"
            editModel="V">
  </dym-form>
</template>
<script>
import { dymForm } from 'newepoch-components'
import factoringBusinessInfoApi from '@/api/factoringBusinessInfoApi'
export default {
  components: {
    dymForm
  },
  props: {
    queryData: {
      type: Object,
      default () {
        return {}
      }
    }
  },
  data () {
    const { factoringBusinessInfo } = this.$i18n.messages[this.$i18n.locale]
    return {
      queryParas: {
        assetInfoId: null
      },
      form: {
        // export_time: 2209017600000,
        // notice_time: 2209017600000,
        // creditor_entry_time: 2209017600000,
        // notice_creditor_seal_time: 2209017600000,
        // creditor_seal_time: 2209017600000,
        // finalized: 2209017600000,
        // lending_time: 2209017600000,
        // invoice_issue_time: 2209017600000,
        // creditor_download_invoice_time: 2209017600000
      },
      componentList: [
        // 导入时间
        {
          label: factoringBusinessInfo.export_time,
          value: 'importTime',
          disabled: true,
          componentName: 'el-date-picker',
          type: 'datetime',
          cols: [8, 8, 8, 8],
          labelWidth: '140px',
          prop: 'importTime'
        },
        // 通知时间
        {
          label: factoringBusinessInfo.notice_time,
          value: 'noticeCreditorEntryTime',
          disabled: true,
          componentName: 'el-date-picker',
          type: 'datetime',
          cols: [8, 8, 8, 8],
          labelWidth: '110px',
          prop: 'noticeCreditorEntryTime'
        },
        // 供应商录入时间
        {
          label: factoringBusinessInfo.creditor_entry_time,
          value: 'creditorEntryTime',
          disabled: true,
          componentName: 'el-date-picker',
          type: 'datetime',
          cols: [8, 8, 8, 8],
          labelWidth: '140px',
          prop: 'creditorEntryTime'
        },
        // 通知供应商盖章时间
        {
          label: factoringBusinessInfo.notice_creditor_seal_time,
          value: 'noticeCreditorStampTime',
          disabled: true,
          componentName: 'el-date-picker',
          type: 'datetime',
          cols: [8, 8, 8, 8],
          labelWidth: '140px',
          prop: 'noticeCreditorStampTime'
        },
        // 供应商盖章时间
        {
          label: factoringBusinessInfo.creditor_seal_time,
          value: 'creditorStampTime',
          disabled: true,
          componentName: 'el-date-picker',
          type: 'datetime',
          cols: [8, 8, 8, 8],
          labelWidth: '110px',
          prop: 'creditorStampTime'
        },
        // 定稿时间
        {
          label: factoringBusinessInfo.finalized,
          value: 'finalizedTime',
          disabled: true,
          componentName: 'el-date-picker',
          type: 'datetime',
          cols: [8, 8, 8, 8],
          labelWidth: '140px',
          prop: 'finalizedTime'
        },
        // 放款时间
        {
          label: factoringBusinessInfo.lending_time,
          value: 'loanDateFactoring',
          disabled: true,
          componentName: 'el-date-picker',
          type: 'datetime',
          cols: [8, 8, 8, 8],
          labelWidth: '140px',
          prop: 'loanDateFactoring'
        },
        // 发票开具时间
        {
          label: factoringBusinessInfo.invoice_issue_time,
          value: 'openDate',
          disabled: true,
          componentName: 'el-date-picker',
          cols: [8, 8, 8, 8],
          labelWidth: '110px',
          prop: 'openDate'
        },
        // 供应商下载发票时间
        {
          label: factoringBusinessInfo.creditor_download_invoice_time,
          value: 'downloadInvoiceFirstTime',
          disabled: true,
          componentName: 'el-date-picker',
          cols: [8, 8, 8, 8],
          labelWidth: '140px',
          prop: 'downloadInvoiceFirstTime'
        }
      ]
    }
  },
  mounted () {
    this.queryParas.assetInfoId = this.queryData.assetInfoId
    // this.handleFilter()
  },
  methods: {
    handleFilter () {
      var _this = this
      factoringBusinessInfoApi.searchApi.orderTimeInformation(this.queryParas).then(res => {
        if (res && res.data) {
          _this.form = res.data
        }
      })
    }
  },
  watch: {
    'queryData.assetInfoId': {
      handler: function (val) {
        this.queryParas.assetInfoId = val
      },
      immediate: true
    }
  }

}
</script>
