Blame view

src/views/registerBook/jsydsyq.vue 5.32 KB
1
<!--
yuanbo committed
2
 * @Description:
3 4 5
 * @Autor: renchao
 * @LastEditTime: 2023-07-19 15:01:40
-->
田浩浩 committed
6 7 8 9 10 11 12
<template>
  <div class="djxxTable">
    <div class="tableBox">
      <div class="title">
        {{ title }}
        <div class="checkbox">
          <el-checkbox-group v-model="checkList" @change="checkChange">
任超 committed
13
            <el-checkbox v-for="item in qsztList" :key="item.value" :label="item.value">{{ item.label }}</el-checkbox>
田浩浩 committed
14 15 16
          </el-checkbox-group>
        </div>
      </div>
17
      <div class="xxTableBox rollTable">
任超 committed
18
        <!-- 固定前三个 -->
田浩浩 committed
19
        <table class="xxTable">
20
          <tr v-for="(item, colindex) in columns" :key="colindex">
任超 committed
21 22 23 24 25 26
            <td>
              {{ item.label }}
            </td>
            <td v-for="(row, index) in tableData" :key="index" :class="[
              row.qszt == '2' ? 'lishi' : '',
              row.qszt == '0' ? 'linshi' : '',
27 28
              row.qlzt == '4' ? 'linshi' : '',

29 30 31
              item.prop == 'qszt' && row.qlzt == '3' ? 'linshiIcon' : '',
              item.prop == 'qszt' && row.qlzt == '2' ? 'linshiIcon' : '',
              item.prop == 'qszt' && row.qlzt == '1' ? 'xianshiIcon' : '',
32
              item.prop == 'qszt' && row.qlzt == '4' ? 'zhuxiaoIcon' : ''
任超 committed
33
            ]">
34 35 36
              <div class="setbut" v-if="item.prop == 'cz'&&row.sjlx !='系统数据'">
                <el-button type="text" icon="el-icon-edit-outline" @click="editDialog(row)">编辑</el-button>
                <el-button type="text" icon="el-icon-edit-outline" @click="editDialog(row,'D')">删除</el-button>
xiaomiao committed
37
              </div>
38
              <div class="icon" v-if="item.prop == 'qszt' &&row.qlzt == '1'">
39 40
                有效
              </div>
41 42 43 44 45 46 47 48 49
              <div class="icon" v-if="item.prop == 'qszt' && row.qlzt == '2'">
                正在补录
              </div>
              <div class="icon" v-if="item.prop == 'qszt' && row.qlzt == '3'">
                正在申请
              </div>
              <div class="icon" v-if="item.prop == 'qszt' && row.qlzt == '4'">
                正在注销
              </div>
田浩浩 committed
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
              <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>
65
  import { datas } from "./qlxxFormData.js";
66
  import { getSjlx } from "@/utils/dictionary.js";
67
  import { getJsydsyqList } from "@/api/djbDetail.js";
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
  export default {
    data () {
      return {
        title: "建设用地使用权、宅基地使用权登记信息",
        qsztList: datas.columns().qsztList,
        checkList: datas.columns().checkList,
        //传递参数
        propsParam: this.$attrs,
        //列表数据
        tableData: [],
        //空列值个数
        emptycolNum: datas.columns().emptycolNum,
        //列名称对象
        columns: datas.columns().JSYDSYQ,
      };
田浩浩 committed
83
    },
84 85
    created () {
      this.loadData();
田浩浩 committed
86
    },
87
    methods: {
yuanbo committed
88 89 90 91
      /**
       * @description: loadData
       * @author: renchao
       */
92
      loadData () {
93

94 95 96 97 98 99
        if (this.$parent.addRepairRecord) {
          this.columns.unshift({
            prop: "cz",
            label: "操作"
          })
        }
100 101 102 103 104 105 106
        getJsydsyqList({
          bdcdyid: this.propsParam.bdcdyid,
          qllx: this.propsParam.qllx,
          qszt: this.checkList,
        }).then((res) => {
          if (res.code === 200) {
            this.tableData = res.result;
107 108 109
            this.tableData.forEach(item => {
              item.sjlx = getSjlx(item.sjlx)
            })
110 111 112 113 114 115 116 117 118
            if (this.tableData.length < datas.columns().emptycolNum) {
              this.emptycolNum =
                datas.columns().emptycolNum - this.tableData.length;
            } else {
              this.emptycolNum = 0;
            }
          }
        });
      },
yuanbo committed
119 120 121 122
      /**
       * @description: checkChange
       * @author: renchao
       */
123 124 125 126 127 128 129 130
      checkChange () {
        if (this.checkList.length === 0) {
          this.tableData = [];
          this.emptycolNum = datas.columns().emptycolNum;
        } else {
          this.loadData();
        }
      },
yuanbo committed
131 132 133 134 135
      /**
       * @description: getQsztName
       * @param {*} code
       * @author: renchao
       */
136 137 138 139 140 141 142
      getQsztName (code) {
        let name = "";
        for (let item of this.qsztList) {
          if (item.value == code) {
            name = item.label;
            break;
          }
田浩浩 committed
143
        }
144 145
        return name;
      },
146
      // 新增一条补录信息
yuanbo committed
147 148 149 150 151 152
      /**
       * @description: 新增一条补录信息
       * @param {*} row
       * @param {*} del
       * @author: renchao
       */
153 154
      editDialog (row, del) {
        this.$confirm('此操作将新增一条补录信息, 是否继续?', '提示', {
155 156 157 158
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
159
          this.$parent.addRepairRecord(row, del)
160 161 162 163 164 165 166 167 168 169 170 171 172

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

      },
田浩浩 committed
173
    },
174
  };
田浩浩 committed
175 176 177
</script>

<style lang="scss" scoped>
178
  @import "./qlxxCommon.scss";
田浩浩 committed
179
</style>