<template>
  <div class="pane-box">
    <HeaderTitle title="生产详情表"> </HeaderTitle>
    <ele-pro-table
      ref="table"
      :columns="columns"
      :needPage="false"
      :initLoad="false"
      :datasource="datasource"
    >
    </ele-pro-table>
  </div>
</template>
<script>
  import { queryTaskDetail } from '@/api/productionPlan/index';
  export default {
    props: {
      planId: {
        type: [String, Number],
        default: ''
      }
    },
    data () {
      return {
        columns: [
          {
            type: 'index',
            label: '序号',
            width: '80'
          },
          {
            prop: 'total',
            label: '排程数量(块)'
          },
          {
            prop: 'total',
            label: '完成数量(块)'
          },
          {
            prop: 'qualified',
            label: '合格数(块)'
          },
          {
            prop: 'taskTime',
            label: '排程日期'
          },
          {
            prop: 'libraryTime',
            label: '完成日期'
          },
    
          {
            prop: 'remark',
            label: '完结原因'
          },
          {
            prop: 'job',
            label: '班组'
          }
          ,
          {
            prop: 'returnNum1',
            label: '合格率'
          }
        ]
      };
    },
    watch: {
      planId: {
        immediate: true,
        handler (val) {
          console.log(val, 'planId');
          if (val) {
            this.$nextTick(() => {
              this.$refs.table.reload();
            });
          }
        }
      }
    },
    methods: {
      async datasource () {
        return queryTaskDetail(this.planId);
      }
    }
  };
</script>
