Blame view

src/views/registerBook/yydj.vue 4.52 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 () {
xiaomiao committed
64 65 66 67 68
        if(this.$parent.addRepairRecord){
        this.columns.unshift({prop:"cz",
           label:"操作"
        })
      }
田浩浩 committed
69
      getYydjList({
田浩浩 committed
70 71 72 73 74 75
        bdcdyid: this.propsParam.bdcdyid,
        qllx: this.propsParam.qllx,
        qszt: this.checkList,
      }).then((res) => {
        if (res.code === 200) {
          this.tableData = res.result;
田浩浩 committed
76 77 78 79 80 81
          if (this.tableData.length < datas.columns().emptycolNum) {
            this.emptycolNum =
              datas.columns().emptycolNum - this.tableData.length;
          } else {
            this.emptycolNum = 0;
          }
田浩浩 committed
82 83 84
        }
      });
    },
任超 committed
85
    checkChange () {
田浩浩 committed
86 87 88 89 90 91
      if (this.checkList.length === 0) {
        this.tableData = [];
        this.emptycolNum = datas.columns().emptycolNum;
      } else {
        this.loadData();
      }
田浩浩 committed
92
    },
任超 committed
93
    getQsztName (code) {
田浩浩 committed
94 95 96 97 98 99 100 101 102
      let name = "";
      for (let item of this.qsztList) {
        if (item.value == code) {
          name = item.label;
          break;
        }
      }
      return name;
    },
xiaomiao committed
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 152 153 154 155 156 157 158
     // 编辑
        editDialog(row){
            this.$confirm('此操作将新增一条补录信息, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.$parent.addRepairRecord(row)

          this.$message({
            type: 'success',
            message: '补录成功!'
          });
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '取消编辑'
          });
        });

      //   this.$popupDialog("编辑", "djbworkflow/djbBook/components/djbeditDialog", {
      //   datalist:this.columns,
      //   data: row,

      // })

      },
     // 删除
      deleteDialog(row){
        this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
           // let bsmClmx = this.previewImg.imgList[this.previewImg.index].bsmClmx
          // deleteClmx(bsmClmx).then(res => {
          //   if (res.code == 200) {
          //     that.$emit('updateList', res.result)
          //     that.$message({
          //       message: '删除成功!',
          //       type: 'success'
          //     })
          //   }
          // })
          this.$message({
            type: 'success',
            message: '删除成功!'
          });
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消删除'
          });
        });

      }
田浩浩 committed
159 160 161 162 163 164 165
  },
};
</script>

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