<template>
<div>
  <h1>{{ materialBhProp }}</h1>
  <el-table
    :data="operlogData"
    height="500"
    style="width: 100%">
    <el-table-column
      prop="operlog_date"
      label="时间"
      width="200"
      fixed>
    </el-table-column>
    <el-table-column
      prop="operlog_user_name"
      label="操作人"
      width="100"
      fixed>
    </el-table-column>
    <el-table-column
      prop="operlog_event"
      label="事件"
      width="120"
      fixed>
    </el-table-column>
    <el-table-column label="录入信息">
      <el-table-column
        prop="operlog_zlh"
        label="指令号"
        width="150">
      </el-table-column>
      <el-table-column
        prop="operlog_xingh"
        label="型号"
        width="150">
      </el-table-column>
      <el-table-column
        prop="operlog_guig"
        label="规格"
        width="150">
      </el-table-column>
      <el-table-column
        prop="operlog_diany"
        label="电压等级"
        width="100">
      </el-table-column>
      <el-table-column
        prop="operlog_ms"
        label="米数"
        width="100">
      </el-table-column>
    </el-table-column>
  </el-table>
</div>
</template>
<script>
import { listOperlog } from "@/api/storageLocation/operlog";
  export default {
    name: 'Operlog',
    props: {
      materialBhProp: String
    },
    data() {
      return {
        queryParams: {
          operlog_kw: null,
        },
        operlogData: [],
      }
    },
    watch: {
      materialBhProp(value,oldvalue){
        this.getOperlogData();
      }
    },
    created() {
      /*获取库位信息*/
      this.getOperlogData();
    },
    methods: {
      /*获取操作记录*/
      getOperlogData() {
        this.queryParams.operlog_kw = this._props.materialBhProp;
        this.operlogData = [];
        listOperlog(this.queryParams).then(response => {
          this.operlogData = response.operlogData;
        });
      }
    }
  }
</script>
