<template>
  <!-- 数据接收table -->
  <div>
    <el-table
      v-loading="tableLoading"
      tooltip-effect="dark"
      :data="tableData"
      :header-cell-style="tableHeaderCellStyle"
      :max-height="tableHeigt"
      border
      @selection-change="handleSelectionChange"
    >
      <!-- <el-table-column type="selection" width="55"></el-table-column> -->
      <el-table-column align="center" prop="operatorChn" label="操作" width="150" fixed>
        <template slot-scope="scope">
          <el-button :disabled="scope.row.receivingstate!=1" type="text"  @click="handleClickBtn('receive',scope.row)">接收<i class="el-icon-caret-right"></i></el-button>
          <el-button :disabled="scope.row.receivingstate==1" type="text" @click="handleClickBtn('detail',scope.row)">接收详情<i class="el-icon-caret-right"></i></el-button>
          <el-button :disabled="scope.row.receivingstate==1" type="text" @click="handleClickBtn('fourResult',scope.row)">四性检测结果<i class="el-icon-caret-right"></i></el-button>
          <el-button :disabled="scope.row.receivingstate==1" type="text" @click="handleClickBtn('report',scope.row)">登记表<i class="el-icon-caret-right"></i></el-button>
        </template>
      </el-table-column>
      <el-table-column align="center" prop="receptiontime" label="接收时间" width="100" />
      <el-table-column  align="center" prop="detectionresult" label="检测结果" width="90">
        <template slot-scope="scope">
          <el-tag effect="dark" :type="scope.row.detectionresult==2?'success':'warning'">{{scope.row.detectionresult==1?'未检测':scope.row.detectionresult==2?'通过':'未通过'}}</el-tag>
        </template>
      </el-table-column>
      <el-table-column  align="center" prop="receivingstate" label="接收状态" width="100">
        <template slot-scope="scope">
          <el-tag effect="dark" :type="scope.row.receivingstate==1?'danger':'success'">{{scope.row.receivingstate==1?'未接收':'已接收'}}</el-tag>
        </template>
      </el-table-column>
      <el-table-column  align="center" prop="receivingtype" label="接收类型" width="100">
        <template slot-scope="scope">
          <el-tag type="info">{{scope.row.receivingtype==1?'在线接收':'离线接收'}}</el-tag>
        </template>
      </el-table-column>
      <el-table-column show-overflow-tooltip align="center" prop="operator" label="操作员" />
      <el-table-column show-overflow-tooltip width="200" align="center" prop="savepath" label="保存路径" />
      <el-table-column width="100"  align="center" prop="classname" label="门类名称" />
      <el-table-column label="条目数" align="center">
        <el-table-column show-overflow-tooltip align="center" prop="ajfileentry" label="案卷">
          <template slot-scope="scope">
            <span>{{ scope.row.receivingstate==1?'-':scope.row.ajfileentry }}</span>
          </template>
        </el-table-column>
        <el-table-column show-overflow-tooltip align="center" prop="fileentry" label="文件">
          <template slot-scope="scope">
            <span>{{ scope.row.receivingstate==1?'-':scope.row.fileentry }}</span>
          </template>
        </el-table-column>
        <el-table-column show-overflow-tooltip align="center" label="合计">
          <template slot-scope="scope">
            <span>{{ scope.row.receivingstate==1?'-':(Number(scope.row.ajfileentry) + Number(scope.row.fileentry)) }}</span>
          </template>
        </el-table-column>
      </el-table-column>
      <el-table-column label="原文数" align="center">
        <el-table-column show-overflow-tooltip align="center" prop="ajoriginalquantity" label="案卷">
          <template slot-scope="scope">
            <span>{{ scope.row.receivingstate==1?'-':scope.row.ajoriginalquantity }}</span>
          </template>
        </el-table-column>
        <el-table-column show-overflow-tooltip align="center" prop="originalquantity" label="文件">
          <template slot-scope="scope">
            <span>{{ scope.row.receivingstate==1?'-':scope.row.originalquantity }}</span>
          </template>
        </el-table-column>
        <el-table-column show-overflow-tooltip align="center" label="合计">
          <template slot-scope="scope">
            <span>{{ scope.row.receivingstate==1?'-':(Number(scope.row.ajoriginalquantity) + Number(scope.row.originalquantity)) }}</span>
          </template>
        </el-table-column>
      </el-table-column>
      <el-table-column label="原文大小(GB)" align="center">
        <el-table-column show-overflow-tooltip align="center" prop="ajtextsize" label="案卷">
          <template slot-scope="scope">
            <span>{{ scope.row.receivingstate==1?'-':scope.row.ajtextsize }}</span>
          </template>
        </el-table-column>
        <el-table-column show-overflow-tooltip width="100" align="center" prop="textsize" label="文件">
          <template slot-scope="scope">
            <span>{{ scope.row.receivingstate==1?'-':scope.row.textsize }}</span>
          </template>
        </el-table-column>
        <el-table-column show-overflow-tooltip align="center" prop="" label="合计" />
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
export default {
  props: {
    tableData: {
      type: Array,
      default: () => []
    },
    tableLoading: {
      type: Boolean,
      default: () => false
    }
  },
  data() {
    return {
      tableHeigt: window.innerHeight - 250
    }
  },
  methods: {
    tableCellStyle() {
      return "border-color:#396183";
    },
    tableHeaderCellStyle() {
      return "border-color:#ccc";
    },
    handleSelectionChange(val) {
      this.$emit('handleSelectionChange', val)
    },
    handleClickBtn(type,row){
      this.$emit('clickBtn',type,row)
    }
  }
}

</script>
<style lang="scss" scoped>
</style>
