<template>
  <!-- 气瓶流转步骤 -->
  <div>
    <actionBar menuTitle="气瓶流转步骤" :formList="formList" :ruleForm="searchRuleForm" @searchProtocol="searchProtocol">
    </actionBar>
    <tables :key="Math.random()" :suspension="false" :tableList="tableList" :tableData="tableData"></tables>
    <!-- 分页 -->
    <div class="paging_bottom" v-if="Total">
      <pagination :total="Total" :currentPage="Pagination.PageIndex" @changeSize="changeSize"
        @changeCurrent="changeCurrent">
      </pagination>
    </div>
  </div>
</template>

<script>
  import {
    getOperationLog
  } from '@/api/inspection'
  import actionBar from '@/components/actionBar'
  import tables from '@/components/tables'
  import pagination from '@/components/pagination'
  import {
    employee
  } from "./roam.js"
  import {
    process
  } from '@/assets/js/blockSort'
  export default {
    components: {
      actionBar,
      tables,
      pagination
    },
    data() {
      return {
        staffTitle: '添加',
        staffDialogVisible: false,
        Pagination: {
          PageIndex: 1,
          PageSize: 10,
        },
        formList: [{
          type: 'input',
          label: '单位内编码',
          field: 'innerCode',
          placeholder: '单位内编码',
        }, {
          type: 'select',
          label: '步骤',
          field: 'optType',
          placeholder: '选择步骤',
          options: process(),
        }, ],
        searchRuleForm: {
          innerCode: '',
          optType: '',
        },
        tableList: employee(),
        tableData: [],
        Total: 0,
        operationType: '',
        searchValue: {},
        ruleForm: {}
      }
    },
    mounted() {
      this.getList()
    },
    methods: {
      // 搜索
      searchProtocol(value) {
        this.searchValue = value
        this.getList()
      },
      // 获取气瓶流转步骤列表
      getList() {
        var params = {
          page: this.Pagination.PageIndex,
          pageSize: this.Pagination.PageSize,
          ...this.searchValue
        }
        getOperationLog(params).then(res => {
          if (res.code == 200) {
            this.tableData = res.data.list
            this.Total = res.data.count
          }
        })
      },
      changeSize(val) {
        this.Pagination.PageSize = val
        this.getList()
      },
      changeCurrent(val) {
        this.Pagination.PageIndex = val
        this.getList()
      },
    }
  }
</script>

<style lang="scss" scoped>
  ::v-deep .el-dialog {
    margin-top: 8vh !important;
  }
</style>
