<template>
  <div>
    <el-table
            border
            style="width: 100%;"
            :data="tableData"
            v-loading="loading"
            header-row-class-name="custom-table-header"
            :default-sort="{ prop : 'date', order: 'descending' }">
            <el-table-column prop="patentNo"  label="专利号" sortable width="200" align="center">
              <template slot-scope="scope">
                <div>
                  <el-link @click.native="toContrast(scope.row,scope.$index)" :reportId="reportId">{{scope.row.patentNo}}</el-link>
                </div>
              </template>
            </el-table-column>
            <el-table-column prop="name" label="专利标题" sortable width="300" align="center"></el-table-column>
            <el-table-column prop="abstractStr" label="摘要" sortable  align="center"></el-table-column>
				  </el-table>
        <div style="text-align: center;">
          <el-pagination background layout="total, prev, pager, next, jumper" :current-page.sync="queryParams.current"
            :page-size.sync="queryParams.size" @current-change="handleCurrentChange" :total="queryParams.total">
          </el-pagination>
        </div>
  </div>
</template>

<script>
import { Contrast } from './mixins';
export default {
  mixins:[Contrast],
  props:["activeName","taskId","reportId","onChangesIn","formS","taskStatus",'type','signPatentNo','reportType',"coordination","taskWorkRemak"],
  data() {
    return {
      tableData: [],
      loading: false,
      queryParams: {
        signPatentNo:this.signPatentNo,
        taskId: this.taskId,
        reportId: this.reportId,
        // applicationName: "",//申请人
        // obligeeName: "",//权利人
        // patentNo:"",
        // applicationNo:"",
        // numberIpc:"",
        // numberCpc:"",
        // numberUpc:"",
        // patentName:"",
        // abstractStr:"",
        filedOptions: [],//数组，用来存放自定义字段勾选项进行筛选
        taskStatus:"3",//0未、1已、3全部
        current: 1,
        size: 10,
        total: 0,
        type:this.type,
        reportType:this.reportType
      }
    }
  },
  created() {
  },
  mounted() {
    this.getList();
  },
  computed: {
    formTed() {
      return JSON.stringify(this.formS);
    }
  },
  methods: {
    handleCurrentChange(val) {
      this.queryParams.current=val
      this.getList()
    },
    getList() {
      this.loading=true
      this.$api.reTaskPatents(this.queryParams).then(res => {
        console.log(res);
        if (res.code == 200) {
          this.queryParams.total=res.data.total
          this.tableData = res.data.records
          this.loading=false
        }
      })
    },
  },
  watch: {
    activeName(val){
      this.queryParams.taskStatus = this.activeName=='first'?0:1
      this.getList()
    },
    onChangesIn(val) {
      console.log(val);
      this.queryParams.filedOptions = val
      this.getList()
    },
    formTed(val) {
      let value=JSON.parse(val)
      if (Object.keys(value).length != 0) {
        // console.log(value);
        // console.log("you");
        for (let key in value) {
          this.queryParams[key]=value[key]
        } 
        this.getList()
      } else {
        // console.log("空");
        this.getList()
      }
      
      // this.queryParams.applicationName=val.applicationName
      // this.queryParams.obligeeName = val.obligeeName
      // this.queryParams.patentNo = val.patentNo
      // this.queryParams.applicationNo = val.applicationNo
      // this.queryParams.numberIpc = val.numberIpc
      // this.queryParams.numberCpc = val.numberCpc
      // this.queryParams.numberUpc = val.numberUpc
      // this.queryParams.patentName = val.patentName
      // this.queryParams.abstractStr = val.abstractStr
      // this.getList()
    },
    taskStatus(val) {
      this.queryParams.taskStatus = val
      this.getList()
    }
  }
}
</script>

<style lang="scss" scoped>

</style>