emptyContainerDialog.vue 4.42 KB
<template>
  <el-dialog
    title="空托盘选取"
    :visible.sync="visible"
    :showcontainer="showcontainer"
    width="800px"
    append-to-body
    @close="$emit('update:showcontainer', false)"
  >
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="容器编码" prop="containerCode">
        <el-input
          v-model="queryParams.containerCode"
          placeholder="请输入容器编码"
          clearable
          size="small"
          style="width: 240px"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="库位编码" prop="locationCode">
        <el-input
          v-model="queryParams.locationCode"
          placeholder="请输入库位编码"
          clearable
          size="small"
          style="width: 240px"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> 
      <el-form-item>
        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="containerList">
        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit-outline"
            @click="handleSelect(scope.row)"
          >选取</el-button>
        </template>
      </el-table-column>
      <el-table-column label="库位编码" align="center" prop="code" />
      <el-table-column label="容器编码" align="center" prop="containerCode" />
      <el-table-column label="仓库编码" align="center" prop="warehouseCode" />
      <el-table-column label="行" align="center" prop="iRow" />
      <el-table-column label="列" align="center" prop="iColumn" />
      <el-table-column label="层" align="center" prop="iLayer" />
      <el-table-column label="格" align="center" prop="iGrid" />
      <el-table-column label="库位类型" align="center" prop="locationType" />
      <el-table-column label="库区" align="center" prop="zoneCode" />
      <el-table-column label="状态" align="center" prop="status" />
      <el-table-column label="创建时间" align="center" prop="created" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.created) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="创建用户" align="center" prop="createdBy" />
      <el-table-column label="更新时间" align="center" prop="lastUpdated" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.lastUpdated) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="更新用户" align="center" prop="lastUpdatedBy" />
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
   
</el-dialog>
</template>

<script>

import { listEmptyContainer } from '@/api/inventory/inventoryHeader/header'
export default {
  props: {
    showcontainer: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
        loading: true,
      showSearch: true,
       total: 0,
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        containerCode: undefined,
        locationCode: undefined,
      },
      containerList: []
    }
  },
  watch: {
    showcontainer() {
      this.visible = this.showcontainer
    }
  },
  created() {
    this.getList();
  },
  methods: {
    getList() {
     listEmptyContainer(this.queryParams).then(response=>{
         console.log(response)
        //  this.containerList = response.rows;
         this.total = response.total;
         this.loading = true;
     })
    },
   
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    resetQuery() {
     
      this.resetForm("queryForm");
      this.handleQuery();
    },
    handleSelect(row) {
      this.visible = false
      this.$emit('passValue',row.code,row.containerCode)
    }
  }
}
</script>

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