<template>
  <div class="table-wrap">
    <el-table :data="tableData" ref="tableRef" highlight-current-row size="mini" stripe border >
      <el-table-column type="index" label="序号"  width="60" show-overflow-tooltip>
      </el-table-column>

      <el-table-column v-for="(item, index) in colunms" :key="index"
            :prop="item.prop"
            :label="item.label"
            :fixed="item.fixed"
            :class-name="item.prop =='reviewStatusKey'?'c357F':'' "
            :show-overflow-tooltip="item.tooltip"
            :min-width="item.width"
            >
      </el-table-column>
    </el-table>
    <ls-pagination :pager.sync="pager"  @query="doQuery"></ls-pagination>
  </div>
</template>

<script>
  export default {
    name: 'project-process-table',
    created() {
       this.doQuery();
    },
    mounted() {

    },
    methods: {
      // 查询数据
      doQuery () {

       let param = {
         currPage: this.pager.curPage,
         pageSize: this.pager.size,
         queryParam: {
            projectId: this.projectid,
         }
       };
        this.$ajax.post({
          domain: 'crmUrl',
          url: 'project.projectWorklist',
          data: param,
          requestType: 'body',
          showLoad: true,
          success: function (res) {
            if (res.errorCode === 200) {
                 this.tableData = res.data.records || [];
                 this.pager.totals = res.data.total || 0;
            }
          }.bind(this),
          error: function (res) {
            this.$message(res.body.msg || res.msg)
          }.bind(this)
        })
      },
    },
    props: ['projectid'],
    data() {
      return {
        //分页参数
        pager: {
          curPage: 1,
          size: 10,
          pageOptions: [10, 20, 30],
          totals: 0
        },
        tableData: [],
        //表格列
        colunms: [
           { prop: 'startDate', label: '记录日期',   width: 100, fixed: false,  tooltip: true },
           { prop: 'creater', label: '提交人员',   width: 100, fixed: false,  tooltip: true },
           { prop: 'theme', label: '进展主题',   width: 100, fixed: false,  tooltip: true },
           { prop: 'reviewStatusKey', label: '批阅状态',   width: 100, fixed: false,  tooltip: true },
           { prop: 'createTime', label: '提交时间',   width: 100, fixed: false,  tooltip: true },
        ]
      }
    },

  }
</script>

<style>
</style>
