Blame view

src/views/registerBook/yydj.vue 2.81 KB
田浩浩 committed
1 2 3 4 5 6 7
<template>
  <div class="djxxTable">
    <div class="tableBox">
      <div class="title">
        {{ title }}
        <div class="checkbox">
          <el-checkbox-group v-model="checkList" @change="checkChange">
任超 committed
8
            <el-checkbox v-for="item in qsztList" :key="item.value" :label="item.value">{{ item.label }}</el-checkbox>
田浩浩 committed
9 10 11
          </el-checkbox-group>
        </div>
      </div>
任超 committed
12 13
      <div class="xxTableBox rollTable">
        <table class="xxTable">
14
          <tr v-for="(item, colindex) in columns" :key="colindex">
任超 committed
15 16 17 18 19 20 21 22
            <td>
              {{ item.label }}
            </td>
            <td v-for="(row, index) in tableData" :key="index" :class="[
              row.qszt == '2' ? 'lishi' : '',
              row.qszt == '0' ? 'linshi' : '',
              item.prop == 'qszt' && row.qszt == '0' ? 'linshiIcon' : '',
            ]">
田浩浩 committed
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
              <div class="icon" v-if="item.prop == 'qszt' && row.qszt == '0'">
                正在办理
              </div>
              <span v-if="item.prop == 'qszt'">
                {{ getQsztName(row[item.prop]) }}
              </span>

              <span v-else> {{ row[item.prop] }}</span>
            </td>
            <td v-for="count in emptycolNum" :key="~count"></td>
          </tr>
        </table>
      </div>
    </div>
  </div>
</template>

<script>
田浩浩 committed
41
import { getYydjList } from "@/api/registerBook.js";
田浩浩 committed
42 43
import { datas } from "./qlxxFormData.js";
export default {
任超 committed
44
  data () {
田浩浩 committed
45 46 47 48 49 50 51 52 53
    return {
      title: "异议登记信息",
      qsztList: datas.columns().qsztList,
      checkList: datas.columns().checkList,
      //传递参数
      propsParam: this.$attrs,
      //列表数据
      tableData: [],
      //空列值个数
田浩浩 committed
54
      emptycolNum: datas.columns().emptycolNum,
田浩浩 committed
55 56 57 58
      //列名称对象
      columns: datas.columns().YYDJ,
    };
  },
任超 committed
59
  created () {
田浩浩 committed
60 61 62
    this.loadData();
  },
  methods: {
任超 committed
63
    loadData () {
田浩浩 committed
64
      getYydjList({
田浩浩 committed
65 66 67 68 69 70
        bdcdyid: this.propsParam.bdcdyid,
        qllx: this.propsParam.qllx,
        qszt: this.checkList,
      }).then((res) => {
        if (res.code === 200) {
          this.tableData = res.result;
田浩浩 committed
71 72 73 74 75 76
          if (this.tableData.length < datas.columns().emptycolNum) {
            this.emptycolNum =
              datas.columns().emptycolNum - this.tableData.length;
          } else {
            this.emptycolNum = 0;
          }
田浩浩 committed
77 78 79
        }
      });
    },
任超 committed
80
    checkChange () {
田浩浩 committed
81 82 83 84 85 86
      if (this.checkList.length === 0) {
        this.tableData = [];
        this.emptycolNum = datas.columns().emptycolNum;
      } else {
        this.loadData();
      }
田浩浩 committed
87
    },
任超 committed
88
    getQsztName (code) {
田浩浩 committed
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
      let name = "";
      for (let item of this.qsztList) {
        if (item.value == code) {
          name = item.label;
          break;
        }
      }
      return name;
    },
  },
};
</script>

<style lang="scss" scoped>
@import "./qlxxCommon.scss";
</style>