diyaq.vue 2.07 KB
<!--
 * @Description:
 * @Autor: renchao
 * @LastEditTime: 2023-10-09 10:44:26
-->
<template>
  <div class="djxxTable">
    <djbDetail :title="title" ref="djbDetail" :shows="shows" :propsParam="propsParam"
      :columns="columns" :tableData="tableData" />
  </div>
</template>

<script>
  import djbDetail from "./components/djbDetail.vue"
  import { datas } from "./qlxxFormData.js";
  import { getSjlx, getDictLeabel } from "@/utils/dictionary.js";
  import { getDiyaqList } from "@/api/djbDetail.js";
  export default {
    components: {
      djbDetail
    },
    data () {
      return {
        shows: false,
        title: "抵押权登记信息",
        //传递参数
        propsParam: this.$attrs,
        //列表数据
        tableData: [],
        //列名称对象
        columns: datas.columns().DYAQ,
        render: false,
      };
    },
    created () {
      this.loadData();
      if (this.$parent.addRepairRecord) {
        this.columns.unshift({ prop: "cz", label: "操作" });
      }
    },
    methods: {
      /**
       * @description: loadData
       * @author: renchao
       */
      loadData (checkList = []) {
        getDiyaqList({
          bdcdyid: this.propsParam.bdcdyid,
          qllx: this.propsParam.qllx,
          qszt: checkList
        }).then((res) => {
          if (res.code === 200) {
            this.tableData = res.result;
            this.shows = this.tableData.length > 0
            this.tableData.forEach((item) => {
              item.sjlx = getSjlx(item.sjlx);
              item.dybdclx = getDictLeabel(item.dybdclx, "A27");
            });
            if (this.tableData.length < datas.columns().emptycolNum) {
              this.$refs.djbDetail.emptycolNum = datas.columns().emptycolNum - this.tableData.length;
            } else {
              this.$refs.djbDetail.emptycolNum = 0
            }
          }
        })
      }
    }
  }
</script>
<style lang="scss" scoped>
  @import "./qlxxCommon.scss";
  .title {
    position: relative;
    .print {
      z-index: 10;
      position: absolute;
      left: 11px;
      top: 5px;
    }
  }
</style>