Scope.vue 4.56 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
<template>
    <div>
      <h3>检查范围</h3>
      <el-table v-loading="loading" :data="inforList">
        <el-table-column label="任务名称" align="center" prop="fName" :show-overflow-tooltip="true"/>
        <el-table-column label="对象分类" align="center" prop="fObjectType" :formatter="fObjectTypeFormat" :show-overflow-tooltip="true"/>
        <el-table-column label="抽查要求" align="center" prop="fSpotCheckType">
          <template slot-scope="scope">
            <span v-if="scope.row.fSpotCheckType">{{ fSpotCheckTypeFormat(scope.row) }}</span>
            <span v-else>-</span>
          </template>
        </el-table-column>
        <el-table-column label="城区标识" align="center" prop="fSpecialFlag" :formatter="fSpecialFlagFormat">
          <template slot-scope="scope">
            <span v-if="scope.row.fSpecialFlag">{{ fSpecialFlagFormat(scope.row) }}</span>
            <span v-else>-</span>
          </template>
        </el-table-column>
        <el-table-column label="此对象应检数据" align="center" prop="fLotCount">
          <template slot-scope="scope">
            <span v-if="scope.row.fLotCount">{{ scope.row.fLotCount }}</span>
            <span v-else>-</span>
          </template>
        </el-table-column>
        <el-table-column label="创建时间" align="center" prop="fCreateTime" :show-overflow-tooltip="true"/>
        <el-table-column label="创建人" align="center" prop="fCreateBy" />
        <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-document"
              @click="handleDetail(scope.row)"
            >详情</el-button>
          </template>
        </el-table-column>
      </el-table>

      <pagination
        v-show="total>0"
        :total="total"
        :page.sync="queryParams.pageNum"
        :limit.sync="queryParams.pageSize"
        :pageSizes="[5,10, 20, 30, 50]"
        @pagination="getList"
      />

      <!-- 详情 -->
      <DetailInfo ref="detail"/>
    </div>
</template>

<script>
  import { listInfor } from "@/api/supervision/scope";
  import DetailInfo from "../../scope/components/DetailInfo";
  export default {
    name: "scope",
    props:{
      fHazardCheckTaskId:{
        type:Number
      }
    },
    components:{
      DetailInfo
    },
    data(){
      return{
        loading: false,
        total: 0,
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 5,
        },
        inforList: [],
        // 对象分类
        fObjectTypeOptions: [],
        // 抽查要求 1:抽查;0-全覆盖字典
        fSpotCheckTypeOptions: [],
        // T-主城区(默认),F-三市字典
        fSpecialFlagOptions: [],
        // 删除标记,0-可用,1-已删除字典
        fDeleteFlagOptions: [],
      }
    },
    created() {
      this.queryParams.fHazardCheckTaskId = this.fHazardCheckTaskId;
      this.getList();
      this.getDicts("t_object_type").then(response => {
          this.fObjectTypeOptions = response.data;
      });
      this.getDicts("t_spot_check_type").then(response => {
          this.fSpotCheckTypeOptions = response.data;
      });
      this.getDicts("t_special_flag").then(response => {
          this.fSpecialFlagOptions = response.data;
      });
      this.getDicts("t_delete_flag").then(response => {
          this.fDeleteFlagOptions = response.data;
      });
    },
    methods:{
      getList() {
        this.loading = true;
        listInfor(this.queryParams).then(response => {
          this.inforList = response.rows;
          this.total = response.total;
          this.loading = false;
        });
      },
      // 对象分类
      fObjectTypeFormat(row, column) {
        return this.selectDictLabel(this.fObjectTypeOptions, row.fObjectType);
      },
      // 抽查要求 1:抽查;0-全覆盖字典翻译
      fSpotCheckTypeFormat(row, column) {
        return this.selectDictLabel(this.fSpotCheckTypeOptions, row.fSpotCheckType);
      },
      // T-主城区(默认),F-三市字典翻译
      fSpecialFlagFormat(row, column) {
        return this.selectDictLabel(this.fSpecialFlagOptions, row.fSpecialFlag);
      },
      // 删除标记,0-可用,1-已删除字典翻译
      fDeleteFlagFormat(row, column) {
        return this.selectDictLabel(this.fDeleteFlagOptions, row.fDeleteFlag);
      },
      //详情
      handleDetail(row){
        this.$refs.detail.getDetailInfo(row.fScopeInforId);
      },
    }
  }
</script>

<style scoped>

</style>