<template>
  <div class="wrapper">
    <!-- 盘点记录 -->
    <div class="basic-details" id="check">
      <div class="basic-details-title">
        <span class="border-span"> 盘点记录</span>
      </div>
      <el-table
        :data="tableData"
        border
        tooltip-effect="dark"
        style="width: 100%"
        :header-cell-style="{ background: '#F0F3F3', border: 'none' }"
      >
        <el-table-column type="index" label="序号" />
        <el-table-column prop="planCode" width="180px" label="计划单号" />
        <el-table-column prop="workOrderCode" width="180px" label="工单单号" />
        <el-table-column prop="executeUserName" label="执行人" />
        <el-table-column prop="createTime" width="160px" label="计划创建时间" />
        <el-table-column prop="issuedTime" width="180px" label="计划下发时间" />
        <el-table-column prop="acceptTime" width="180px" label="执行开始时间" />
        <el-table-column prop="finishTime" width="180px" label="执行结束时间" />
        <el-table-column prop="code" label="执行工时(分钟)">
          <template slot-scope="{ row }">
            <span>{{ row ? time(row.acceptTime, row.finishTime) : '' }}</span>
          </template>
        </el-table-column>
        <el-table-column prop="status" label="状态">
          <template slot-scope="{ row }">
            <span>{{ row ? statusObj[row.status] : '' }}</span>
          </template>
        </el-table-column>
      </el-table>
      <div class="page-wrapper">
        <el-pagination
          background
          layout="total, sizes, prev, pager, next, jumper"
          :total="total"
          :page-sizes="[10, 20, 50, 100]"
          :page-size.sync="size"
          :current-page.sync="page"
          @current-change="_getRepairRecord"
          @size-change="_getRepairRecord"
        >
        </el-pagination>
      </div>
    </div>
  </div>
</template>

<script>
  // import mixins from '../mixins/index'
  // import { getWorkOrderRecord } from '@/api/ledgerAssets/booksList'
  export default {
    // mixins: [mixins],
    data() {
      return {
        tableData: [],
        size: 10,
        page: 1,
        total: 0,
        statusObj: {
          0: '待接收',
          1: '执行中',
          2: '待审核',
          3: '完成'
        }
      };
    },
    created() {
      this._getRepairRecord();
    },
    methods: {
      // async _getRepairRecord () {
      //   const res = await getWorkOrderRecord({
      //     equiId: this.$route.query.id,
      //     workOrderType: 4,
      //     size: this.size,
      //     page: this.page
      //   })
      //   if (res?.success) {
      //     this.tableData = res.data?.records || []
      //     this.total = res.data?.total || 0
      //   }
      // }
    }
  };
</script>

<style lang="scss" scoped>
  .wrapper {
    background: #fff;
    padding: 20px;
  }
  .page-wrapper {
    padding-top: 12px;
    text-align: right;
  }
</style>
