<template>
  <div>
    <el-dialog
      title="扫描记录"
      :visible.sync="isShow"
      width="800px"
      :destroy-on-close="true"
    >
      <el-table :data="tableData" border>
        <el-table-column
          label="履职区域"
          align="center"
          :show-overflow-tooltip="true"
          prop="areaName"
        >
        </el-table-column>
        <el-table-column
          label="NFC点位名称"
          align="center"
          :show-overflow-tooltip="true"
          prop="collectionAreaName"
        >
        </el-table-column>

        <el-table-column
          label="扫描时间"
          align="center"
          :show-overflow-tooltip="true"
          prop="executeTime"
        >
        </el-table-column>
        <el-table-column
          label="扫描方式"
          align="center"
          :show-overflow-tooltip="true"
          prop="scanMethod"
        >
        </el-table-column>
        <el-table-column
          label="扫描方式"
          align="center"
          :show-overflow-tooltip="true"
          prop="img"
        >
          <template slot-scope="r">
            <label v-if="r.row.scanMethod == 0">-</label>
            <el-image
              v-else
              style="width: 50px; height: 50px"
              :src="r.row.img"
              :preview-src-list="[r.row.img]"
            ></el-image>
          </template>
        </el-table-column>
      </el-table>
      <div slot="footer" class="dialog-footer">
        <el-button @click="onHide">取消</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import * as api from "@/api/resumption/taskManger.js";
export default {
  data() {
    return {
      isShow: false,
      tableData: [],
    };
  },
  methods: {
    async refresh(id, orgId) {
      let detail = await api.findNfcScanRecord({
        orgId: orgId,
        resumptionId: id,
      });
      // console.log(detail);
      if (detail) {
        this.tableData = detail;
      } else {
        this.tableData = [];
      }
    },
    async show(id, orgId) {
      await this.refresh(id, orgId);
      this.isShow = true;
    },
    onHide() {
      this.isShow = false;
    },
    reset() {
      this.tableData = [];
    },
  },
};
</script>

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