index.vue 4.21 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
<template>
    <div class="app-container">
      <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
        <el-form-item label="储配站" prop="stationId">
          <el-select v-model="queryParams.stationId" placeholder="请选择储配站">
            <el-option
              v-for="item in stationList"
              :key="item.stationId"
              :label="item.stationName"
              :value="item.stationId"
            />
          </el-select>
        </el-form-item>

        <el-form-item label="充装人" prop="operator">
          <el-input
            v-model="queryParams.operator"
            placeholder="请输入充装人"
            clearable
            size="small"
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>

        <el-form-item label="充装时间" prop="operateTime">
          <el-date-picker
            v-model="operateTime"
            type="datetimerange"
            value-format="yyyy-MM-dd HH:mm:ss"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            @change="timeChange"
          >
          </el-date-picker>
        </el-form-item>

        <el-form-item>
          <el-button type="primary" 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">
        <el-col :span="1.5">
          <el-button
            plain
            icon="el-icon-download"
            size="mini"
            :loading="exportLoading"
            @click="handleExport"
            style="color: #1890ff"
          >导出</el-button>
        </el-col>
        <right-toolbar :showSearch.sync="showSearch" @queryTable="getInfo"></right-toolbar>
      </el-row>

      <el-tabs v-model="statisticsType" @tab-click="handleClick">
        <el-tab-pane label="储配站" name="station">
          <StationList
            ref="station"
            :queryParams="queryParams"
          />
        </el-tab-pane>
        <el-tab-pane label="充装人员" name="operator">
          <Operator
            ref="operator"
            :queryParams="queryParams"
          />
        </el-tab-pane>
      </el-tabs>
    </div>
</template>

<script>
  import { gasStorageStationList } from "@/api/gasBottleTrack/gasHolderStationManage";
  import StationList from "./StationList";
  import Operator from "./Operator";
  export default {
    name: "air-charge",
    components: {
      StationList,
      Operator
    },
    data(){
      return{
        statisticsType: 'station',
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          stationId: null,
          operator: null,
          operateBeginTime: null,
          operateEndTime: null
        },
        operateTime: [],
        exportLoading: false,
        // 显示搜索条件
        showSearch: true,
        stationList: []
      }
    },
    mounted(){
      this.getInfo();
      this.getStationInfo();
    },
    methods: {
      handleClick(){
        this.queryParams.pageNum = 1;
        this.queryParams.pageSize = 10;
        this.$refs[this.statisticsType].queryDataInfo();
      },
      //查询
      getInfo(){
        this.$refs[this.statisticsType].queryDataInfo();
      },
      //导出
      handleExport(){
        this.$refs[this.statisticsType].importData();
      },
      getStationInfo(){
        gasStorageStationList().then(res =>{
          if(res.code == 200){
            this.stationList = res.data;
          }
        })
      },
      timeChange(value){
        this.queryParams.operateBeginTime =  value[0];
        this.queryParams.operateEndTime =  value[1];
      },
      /** 搜索按钮操作 */
      handleQuery() {
        this.queryParams.pageNum = 1;
        this.getInfo();
      },
      /** 重置按钮操作 */
      resetQuery() {
        this.resetForm("queryForm");
        this.operateTime = [];
        this.queryParams.operateBeginTime =  null;
        this.queryParams.operateEndTime =  null;
        this.handleQuery();
      },
    }
  }
</script>

<style scoped>

</style>