<template>
  <div>
      <!--中登异常列表-->
      <el-row>
          <el-row>
              <!--第一行(表头)-->
              <el-row class="headRow">
                  <el-col class="head_col" :span="3">
                      <span>{{$t('traceMgr.theregistrationNumber')}}</span>
                  </el-col>
                  <el-col class="head_col" :span="3">
                      <span>{{$t('traceMgr.recordDate')}}</span>
                  </el-col>
                  <el-col class="head_col" :span="4">
                      <span>{{$t('common.assigneePledgee')}}</span>
                  </el-col>
                  <el-col class="head_col" :span="3">
                      <span>{{$t('traceMgr.pradeType')}}</span>
                  </el-col>
                  <el-col class="head_col" :span="5">
                      <span>{{$t('traceMgr.overdueSituation')}}</span>
                  </el-col>
                  <el-col class="head_col" :span="3">
                      <span>{{$t('traceMgr.feedbackPeople')}}</span>
                  </el-col>
                  <el-col class="head_col" :span="3">
                      <span>{{$t('traceMgr.feedbackTheDate')}}</span>
                  </el-col>
              </el-row>
              <!--第二行-->
              <el-row class="row">
                  <el-col class="col" :span="3"></el-col>
                  <el-col class="col" :span="3"></el-col>
                  <el-col class="col" :span="4"></el-col>
                  <el-col class="col" :span="3"></el-col>
                  <el-col class="col" :span="5"></el-col>
                  <el-col class="col" :span="3"></el-col>
                  <el-col class="col" :span="3"></el-col>
              </el-row>
              <!--第三行（表头）-->
              <el-row class="headRow">
                  <el-col class="head_col" :span="8">
                      <span>{{$t('traceMgr.descriptionProperty')}}</span>
                  </el-col>
                  <el-col class="head_col" :span="8">
                      <span>{{$t('traceMgr.abnormalSituation')}}</span>
                  </el-col>
                  <el-col class="head_col" :span="8">
                      <span>{{$t('traceMgr.chinaClearProposal')}}</span>
                  </el-col>
              </el-row>
              <!--第四行-->
              <el-row class="high_row">
                  <el-col class="col" :span="8"></el-col>
                  <el-col class="col" :span="8"></el-col>
                  <el-col class="col" :span="8"></el-col>
              </el-row>
              <!--第五行（表头）-->
              <el-row class="headRow">
                  <el-col class="head_col" :span="3">
                      <span>{{$t('common.factoringSolutions')}}</span>
                  </el-col>
                  <el-col class="head_col" :span="3">
                      <span>{{$t('common.fileUpload')}}</span>
                  </el-col>
                  <el-col class="head_col" :span="4">
                      <span>{{$t('common.exceptionResolutionStatus')}}</span>
                  </el-col>
                  <el-col class="head_col" :span="3">
                      <span>{{$t('traceMgr.auditOpinion')}}</span>
                  </el-col>
                  <el-col class="head_col" :span="5">
                      <span>{{$t('common.reviewers')}}</span>
                  </el-col>
                  <el-col class="head_col" :span="3">
                      <span>{{$t('traceMgr.checkTime')}}</span>
                  </el-col>
                  <el-col class="head_col" :span="3">
                      <span>{{$t('common.feedbackAndReviewResume')}}</span>
                  </el-col>
              </el-row>
              <!--第六行-->
              <el-row class="row_bottom">
                  <el-col class="col" :span="3">
                      <base-select></base-select>
                  </el-col>
                  <el-col class="col" :span="3">
                      <el-col :span="12">
                          <auth-button type="primary" size="small" :label="$t('common.upload')"></auth-button>
                      </el-col>
                      <el-col :span="12">
                          <auth-button type="primary" size="small" :label="$t('common.download')"></auth-button>
                      </el-col>
                  </el-col>
                  <el-col class="col" :span="4"></el-col>
                  <el-col class="col" :span="3"></el-col>
                  <el-col class="col" :span="5"></el-col>
                  <el-col class="col" :span="3"></el-col>
                  <el-col class="col" :span="3">
                      <auth-button type="primary" size="small" :label="$t('common.viewResume')"></auth-button>
                  </el-col>
              </el-row>
          </el-row>
      </el-row>
  </div>
</template>

<script>
import { DialogEdit, BaseSelect, DataTable, authButton } from 'newepoch-components'
export default {
  name: 'invoiceRow',
  components: {
    DialogEdit,
    DataTable,
    BaseSelect,
    authButton
  },
  data () {
    return {
      isFootView: false,
      form: {},
      api: {},
      searchFormQueryParas: {}
    }
  },
  props: {
    sourceData: {
      type: Array
    },
    columns: {
      type: Array
    },
    visible: {
      type: Boolean,
      default: function () {
        return false
      }
    }
  },
  computed: {
    dialogVisible: {
      get () {
        return this.visible
      },
      set (val) {
        this.$emit('update:visible', val)
      }
    }
  },
  methods: {
    // arraySpanMethod ({ row, column, rowIndex, columnIndex }) {
    //   if (rowIndex % 2 === 0) {
    //     if (columnIndex === 0) {
    //       return [1, 2]
    //     } else if (columnIndex === 1) {
    //       return [0, 0]
    //     }
    //   }
    // }
    getSummaries (param) {
      const { columns, data } = param
      const sums = []
      columns.forEach((column, index) => {
        if (index === 0) {
          sums[index] = this.$i18n.messages[this.$i18n.locale].projCompanyInfoManage.total
          return
        }
        const values = data.map(item => Number(item[column.property]))
        if (!values.every(value => isNaN(value))) {
          sums[index] = values.reduce((prev, curr) => {
            const value = Number(curr)
            if (!isNaN(value)) {
              return prev + curr
            } else {
              return prev
            }
          }, 0)
          // sums[index] += ' 元'
        } else {
          sums[index] = ''
        }
      })

      return sums
    }
  }
}
</script>

<style scoped>
    @import '~@/styles/tracemgr/factoringCommissioner/taskTable/chinaClear/invoiceRow.scss'
</style>
