<template>
  <div class="app-container">
    <!-- 搜索 -->
    <SearchBlock v-model="query" :menus="queryOption" @change="queryTable"></SearchBlock>
    <!-- 表格工具按钮 -->
    <div class="table-operate">
      <el-button
        type="primary"
        plain
        icon="el-icon-plus"
        size="mini"
        @click="handleAdd"
        v-hasPermi="['gangkou:workequip:add']"
        >新增</el-button
      >
      <el-button
        type="danger"
        plain
        icon="el-icon-delete"
        size="mini"
        :disabled="selection.length === 0"
        @click="handleMultDelete"
        v-hasPermi="['gangkou:workequip:remove']"
        >删除选中</el-button
      >
    </div>
    <!-- 表格 -->
    <el-table
      ref="table"
      tooltip-effect="dark"
      v-loading="loading"
      :data="list"
      @selection-change="handleSelectionChange"
      border
      @sort-change="sortChange"
      :default-sort="sort"
    >
      <el-table-column v-hasPermi="['gangkou:workequip:remove']" type="selection" width="50" />
      <el-table-column label="指令" align="center" prop="workTitle" show-overflow-tooltip min-width='120' />
      <el-table-column label="班次" align="center" prop="shiftName" show-overflow-tooltip min-width='120' />
      <el-table-column label="设备类型" align="center" prop="equipType" show-overflow-tooltip min-width='120' />
      <el-table-column label="设备名称" align="center" prop="equipName" show-overflow-tooltip min-width='120' />
      <el-table-column label="作业内容" align="center" prop="workContent" show-overflow-tooltip min-width='120' />
      <el-table-column label="计划作业量" align="center" prop="planWt" sortable='custom' show-overflow-tooltip min-width='120' />
      <el-table-column label="实际作业量" align="center" prop="actWt" sortable='custom' show-overflow-tooltip min-width='120' />
      <el-table-column label="计划开始日期" align="center" prop="planStart" sortable='custom' show-overflow-tooltip min-width='120' />
      <el-table-column label="计划结束日期" align="center" prop="planEnd" sortable='custom' show-overflow-tooltip min-width='120' />
      <el-table-column label="实际开始日期" align="center" prop="actStart" sortable='custom' show-overflow-tooltip min-width='120' />
      <el-table-column label="实际结束日期" align="center" prop="actEnd" sortable='custom' show-overflow-tooltip min-width='120' />
      <el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip min-width='160' />
      <el-table-column width="86px" align="center" label="操作" fixed="right">
        <template slot-scope="scope">
          <el-link type="primary" v-hasPermi="['gangkou:workequip:edit']" @click="handleEdit(scope.row)">编辑</el-link>
          <el-link type="danger" v-hasPermi="['gangkou:workequip:remove']" @click="handleDelete(scope.row)">删除</el-link>
        </template>
      </el-table-column>
    </el-table>
    <!-- 表格页脚 -->
    <pagination
      hide-on-single-page
      :total="total"
      :page.sync="page.pageNum"
      :limit.sync="page.pageSize"
      @pagination="getTableList"
    />
    <!-- <EditDialog ref="editDialog" @refresh="getTableList"></EditDialog> -->
  </div>
</template>

<script>
import TableMixin from "@/mixins/table-mixin";
// import EditDialog from "./components/EditDialog";
import { pageListEquip, delEquip } from "@/api/gangkou/work/equip.js";

export default {
  name: 'Equip',
  mixins: [TableMixin],
  // components: { EditDialog },
  data() {
    return {
      queryOption: [
        {
          label: '指令', 
          prop: 'orderId',
          type: 'select',
          default: '',
        },
        {
          label: '班次', 
          prop: 'shiftId',
          type: 'select',
          default: '',
        },
        {
          label: '设备名称', 
          prop: 'equipName',
          type: 'text',
          default: '',
        },
        {
          label: '设备类型', 
          prop: 'equipType',
          type: 'text',
          default: '',
        },
        {
          label: '作业内容', 
          prop: 'workContent',
          type: 'text',
          default: '',
        },
        {
          label: '计划作业量', 
          prop: 'planWt',
          type: 'text',
          default: '',
        },
        {
          label: '实际作业量', 
          prop: 'actWt',
          type: 'text',
          default: '',
        },
        {
          label: '计划开始日期', 
          prop: 'planStart',
          type: 'date',
          default: '',
        },
        {
          label: '计划结束日期', 
          prop: 'planEnd',
          type: 'date',
          default: '',
        },
        {
          label: '实际开始日期', 
          prop: 'actStart',
          type: 'date',
          default: '',
        },
        {
          label: '实际结束日期', 
          prop: 'actEnd',
          type: 'date',
          default: '',
        },
        
      ]
    };
  },
  methods: {
    mx_pageInfo() {
      return {
        title: '工班设备作业记录',
        exportUrl: '',
        pageListApi: pageListEquip,
        deleteApi: delEquip,
        query: {},
      };
    },
  },
};
</script>

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

