Blame view

src/views/djbworkflow/djbBook/diyaq.vue 4.46 KB
xiaomiao committed
1 2 3
<!--
 * @Description  :抵押权登记信息
 * @Autor        : miaofang
xiaomiao committed
4
 * @LastEditTime : 2023-06-13 13:56:37
xiaomiao committed
5
-->
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
<template>
  <div class="djxxTable">
    <div class="tableBox">
      <div class="title">
        {{ title }}
        <div class="checkbox">
          <el-checkbox-group v-model="checkList" @change="checkChange">
            <el-checkbox v-for="item in qsztList" :key="item.value" :label="item.value">{{ item.label }}</el-checkbox>
          </el-checkbox-group>
        </div>
      </div>
      <div class="xxTableBox rollTable">
        <table class="xxTable">
          <tr v-for="(item, colindex) in columns" :key="colindex">
            <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' : '',
            ]">
xiaomiao committed
28 29 30 31
             <div class="setbut" v-if="item.prop == 'cz'">
                   <el-button type="text" icon="el-icon-edit-outline" @click="editDialog(row)">编辑</el-button>
                   <el-button type="text" icon="el-icon-edit-outline" @click="deleteDialog(row)">删除</el-button>
              </div>
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
              <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>
import { getDiyaqList } from "@/api/registerBook.js";
import { datas } from "./qlxxFormData.js";
export default {
  data () {
    return {
      title: "抵押权登记信息",
      qsztList: datas.columns().qsztList,
      checkList: datas.columns().checkList,
      //传递参数
      propsParam: this.$attrs,
      //列表数据
      tableData: [],
      //空列值个数
      emptycolNum: datas.columns().emptycolNum,
      //列名称对象
      columns: datas.columns().DYAQ,
    };
  },
  created () {
    this.loadData();
  },
  methods: {
    loadData () {
      getDiyaqList({
        bdcdyid: this.propsParam.bdcdyid,
        qllx: this.propsParam.qllx,
        qszt: this.checkList,
      }).then((res) => {
        if (res.code === 200) {
          this.tableData = res.result;
          if (this.tableData.length < datas.columns().emptycolNum) {
            this.emptycolNum =
              datas.columns().emptycolNum - this.tableData.length;
          } else {
            this.emptycolNum = 0;
          }
        }
      });
    },
    checkChange () {
      if (this.checkList.length === 0) {
        this.tableData = [];
        this.emptycolNum = datas.columns().emptycolNum;
      } else {
        this.loadData();
      }
    },
    getQsztName (code) {
      let name = "";
      for (let item of this.qsztList) {
        if (item.value == code) {
          name = item.label;
          break;
        }
      }
      return name;
    },
xiaomiao committed
107
      AddDialog(row){
108
        this.$popupDialog("新增", "djbworkflow/djbBook/components/djbeditDialog", {
xiaomiao committed
109 110 111 112
        data: ''
      })
      },
        editDialog(row){
113
        this.$popupDialog("编辑", "djbworkflow/djbBook/components/djbeditDialog", {
xiaomiao committed
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
        datalist:this.columns,
        data: row,

      })
      },
      // 删除
      deleteDialog(row){
            let that = this
        this.$confirm('此操作将永久删除, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(async () => {
         // 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'
          //     })
          //   }
          // })
           that.$message({
                message: '删除成功!',
                type: 'success'
              })
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消删除'
          })
        })

      }
149 150 151 152 153 154 155
  },
};
</script>

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