<template>
  <div>
    <span class="account-title1">{{$t('enterpriseInfoManage.supplierInfoManage.historyInfos')}}</span>
    <dym-form :componentList="billList" :formValue="historyForm" class="bill-form"></dym-form>
    <data-table :operateBtnLayout="operateBtnLayout" :queryParas="queryParas" :sourceData="sourceHistoryData"
                :toolMenuFlag="false" :columns="billColumns" :showPage="false"></data-table>
  </div>
</template>

<script>
import { dymForm, DataTable } from 'newepoch-components'
import * as format from '@/filters/index.js'
export default {
  name: 'historyInfo',
  components: {
    dymForm,
    DataTable
  },
  props: {
    sourceHistoryData: {
      type: [Array, Object],
      default: () => {
        return []
      }
    },
    historyForm: {
      type: [Array, Object],
      default: () => {
        return {}
      }
    }
  },
  data () {
    return {
      operateBtnLayout: '',
      // formitem文字宽度
      labelWidthLeft: '150px',
      queryParas: {},
      // queryParas: {
      //   keyId: this.form.accountId
      // },
      billList: [
        // 提单数量
        {
          value: 'billAmount',
          disabled: true,
          componentName: 'el-input',
          label: this.$i18n.messages[this.$i18n.locale].enterpriseInfoManage.supplierInfoManage.billAmount,
          placeholder: '', // this.$i18n.messages[this.$i18n.locale].common.pleaseInput,
          cols: [24, 24, 24, 8],
          labelWidth: this.labelWidthLeft,
          prop: 'billAmount'
        },
        // 提单频率(数据处理)
        {
          value: 'billTimes',
          disabled: true,
          componentName: 'el-input',
          label: this.$i18n.messages[this.$i18n.locale].enterpriseInfoManage.supplierInfoManage.billTimes,
          placeholder: '', // this.$i18n.messages[this.$i18n.locale].common.pleaseInput,
          cols: [24, 24, 24, 8],
          labelWidth: this.labelWidthLeft,
          prop: 'billTimes'
        }
      ],
      billColumns: [
        // 合同名称
        {
          prop: 'contractName',
          align: 'left',
          disabled: false,
          label: this.$i18n.messages[this.$i18n.locale].enterpriseInfoManage.supplierInfoManage.contractName,
          width: '2'
        },
        // 合同金额(元)
        {
          prop: 'contractAmount',
          align: 'right',
          disabled: false,
          label: this.$i18n.messages[this.$i18n.locale].enterpriseInfoManage.supplierInfoManage.contractMoney,
          width: '1',
          format: (row) => { return format.thousandFilter(row.contractAmount) }
        },
        // 已提单金额(元)
        {
          prop: 'factoringMoney',
          align: 'right',
          disabled: false,
          label: this.$i18n.messages[this.$i18n.locale].enterpriseInfoManage.supplierInfoManage.billedAmount,
          width: '1',
          format: (row) => { return format.thousandFilter(row.factoringMoney) }
        },
        // 款项性质
        {
          prop: 'paymentInfo',
          align: 'center',
          disabled: false,
          label: this.$i18n.messages[this.$i18n.locale].enterpriseInfoManage.supplierInfoManage.sumProperties,
          width: '1'
          // format: (row) => { return format.formatDict(row.paymentInfo, '') }
        }
      ]
    }
  }
}
</script>

<style scoped lang="scss">
  @import '~@/styles/enterpriseInfoManage/supplierInfoManage/contactInfoEdit.scss';
</style>
