Survey.vue 3.65 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
<template>
    <div>
      <h3>调查项</h3>
      <el-table v-loading="loading" :data="inforList">
        <el-table-column label="检查任务编码" align="center" prop="fCheckTaskCode" />
        <el-table-column label="检查对象分类" align="center" prop="fTypeCode" :formatter="fTypeCodeFormat" />
        <el-table-column label="调查内容" align="center" prop="fContents">
          <template slot-scope="scope">
            <span v-if="scope.row.fContents">{{ scope.row.fContents }}</span>
            <span v-else>-</span>
          </template>
        </el-table-column>
        <el-table-column label="结果填写类型" align="center" prop="fResType" :formatter="fResTypeFormat" />
        <el-table-column label="结果填写选项" align="center" prop="fResOption">
          <template slot-scope="scope">
            <span v-if="scope.row.fResOption">{{ scope.row.fResOption }}</span>
            <span v-else>-</span>
          </template>
        </el-table-column>
        <el-table-column label="顺序号" align="center" prop="ord">
          <template slot-scope="scope">
            <span v-if="scope.row.ord">{{ scope.row.ord }}</span>
            <span v-else>-</span>
          </template>
        </el-table-column>
        <el-table-column label="最后修改时间" align="center" prop="fLastUpdateTime" :show-overflow-tooltip="true"/>
        <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/survey";
  import DetailInfo from "../../survey/components/DetailInfo";
  export default {
    name: "survey",
    props:{
      fCheckTaskCode:{
        type: String
      }
    },
    components:{
      DetailInfo
    },
    data(){
      return{
        loading: false,
        total: 0,
        queryParams: {
          pageNum: 1,
          pageSize: 5,
        },
        inforList:[],
        // 检查对象分类
        fTypeCodeOptions: [],
        // 结果填写类型
        fResTypeOptions: [],
      }
    },
    created() {
      this.queryParams.fCheckTaskCode = this.fCheckTaskCode;
      this.getList();
      this.getDicts("t_type_code").then(response => {
          this.fTypeCodeOptions = response.data;
      });
      this.getDicts("f_res_type").then(response => {
          this.fResTypeOptions = response.data;
      });
    },
    methods:{
      getList() {
        this.loading = true;
        listInfor(this.queryParams).then(response => {
          this.inforList = response.rows;
          this.total = response.total;
          this.loading = false;
        });
      },
      // 检查对象分类
      fTypeCodeFormat(row, column) {
        return this.selectDictLabel(this.fTypeCodeOptions, row.fTypeCode);
      },
      // 结果填写类型,1单选、2-多选、3 输入字典翻译
      fResTypeFormat(row, column) {
        return this.selectDictLabel(this.fResTypeOptions, row.fResType);
      },
      //详情
      handleDetail(row){
        this.$refs.detail.getDetailInfo(row.fInsSurListInforId);
      },
    }
  }
</script>

<style scoped>

</style>