addjtfc.vue 6.13 KB
<template>
  <dialogBox title="家庭房产查询" @closeDialog="closeDialog" width="70%" :isButton="false" v-model="myValue">
    <div class="jtfccx-edit">
      <div class="jtfccx-edit-con">
        <b class="title">申请信息</b>
        <el-form :model="form" label-width="120px">
          <el-row>
            <el-col :span="8">
              <el-form-item label="查询用途" label-width="90px">
                <el-input v-model="form.djSqcxDO.cxyt" class="width200px"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="16">
              <el-form-item label="与产权人的关系">
                <el-radio-group v-model="form.djSqcxDO.ycyrgx">
                  <el-radio label="1">房屋权利人</el-radio>
                  <el-radio label="2">产权利害关系人</el-radio>
                  <el-radio label="3">委托人</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
        <!-- <personInfoTable @getInfoList="handleGetSqList" :dataList="form.sqrList" /> -->
        <lb-table border :column="sqrColumns" key="sqr1" :data="form.sqrList" :maxHeight="200" heightNumSetting
          :pagination="false">
        </lb-table>

        <b class="title">权利人</b>
        <!-- <personInfoTable @getInfoList="handleGetQlList" :dataList="form.qlrList" :isGanged="isGanged" /> -->
        <lb-table border :column="qlrColumns" key="ql2r" :data="form.qlrList" :maxHeight="200" heightNumSetting
          :pagination="false">
        </lb-table>
        <div v-show="isSearch">
          <b class="title">查询结果</b>
          <p>查询编号:{{ form.djSqcxDO.cxbh }}</p>
          <lb-table :column="cxjgColumns" :data="form.cxjgList" :maxHeight="200" heightNumSetting :pagination="false">
          </lb-table>
        </div>
      </div>
      <el-divider></el-divider>
      <div class="submit-button" style="padding-bottom:50px">
        <el-button @click="resetClick">重置</el-button>
        <el-button type="primary" v-show="isSearch==false" @click="queryChick">查询</el-button>
        <el-button type="primary" v-show="isSearch&&form.dyjlList.length > 0">房产结果打印({{form.dyjlList.length}}
        </el-button>
        <el-button type="primary" v-show="isSearch&&form.dyjlList.length == 0">无房证明打印({{form.dyjlList.length}}
        </el-button>
        <el-button @click="closeDialog">关闭</el-button>
      </div>
    </div>
  </dialogBox>
</template>

<script>
import personInfoTable from "./personInfoTable";
import { addJtfcCxjgXx, getJtfcInfo } from "@/api/sqcx";
import { datas, sendThis } from "./addjtfcdata";
import { mapGetters } from "vuex";
export default {
  components: {
    personInfoTable,
  },
  computed: {
    ...mapGetters(["dictData"]),
  },
  props: {
    value: { type: Boolean, default: false },
    bsmSqcx: { type: String, default: "" },
    addOrUpdateVisible:{      type: Boolean,     default: false    }
  },
  mounted() {
    sendThis(this);
  },
  data() {
    return {
      myValue: this.value,
      //是否查询
      isSearch: false,
      //查询结果列表字段
      cxjgColumns: datas.columns(),
      //申请人列表字段
      sqrColumns: datas.sqrCol(),
      //权利人列表字段
      qlrColumns: datas.qlrCol(),
      newData: {
        sqrxm: "",
        sqrzjlxbm: "",
        sqrzjhm: "",
        lxdh: "",
        inputErr: false,
      },
      form: {
        djSqcxDO: { ycyrgx: "1", cxyt: "" },
        sqrList: [],
        qlrList: [],
        cxjgList: [],
        dyjlList: [],
      },
    };
  },
  watch: {
    value(val) {
      this.myValue = val;
      if (val) {
        this.$alert(this.bsmSqcx);
        if (this.bsmSqcx == "") {
          this.add("sqr");
          this.add("qlr");
        } else {
          this.loadData();
        }
      } 
    },
    "form.djSqcxDO.ycyrgx"(val) {
      if (val == "1") {
        this.form.qlrList = this.form.sqrList;
      } else {
        this.form.qlrList = [];
        this.add("qlr");
      }
    },
    "form.sqrList"(val) {
      //this.$alert(val);
    },
  },
  methods: {
    closeDialog() {
      this.$emit("input", false);
    },
    loadData() {
      this.$startLoading();
      getJtfcInfo({ sqcxBsm: sqcxBsm }).then((res) => {
        this.$endLoading();
        if (res.code == 200) {
          this.form = res.result;
          this.isSearch = true;
        }
      });
    },
    queryChick() {
      this.$startLoading();
      addJtfcCxjgXx(this.form).then((res) => {
        this.$endLoading();
        if (res.code == 200) {
          this.form = res.result;
          this.isSearch = true;
          this.$parent.queryClick();
        }
      });
    },
    resetClick() {
      this.form.djSqcxDO = { ycyrgx: "1", cxyt: "" };
      this.form.sqrList = _.cloneDeep([this.newData]);
      this.form.qlrList =_.cloneDeep([this.newData]);
      this.form.cxjgList = [];
      this.form.dyjlList = [];
      this.isSearch = false;
    },
    handleRead(scope) {},
    add(type) {
      if (type == "sqr") {
        this.form.sqrList.push(this.newData);
      } else {
        this.form.qlrList.push(this.newData);
      }
    },
    remove(index, row, type) {
      if (type == "sqr") {
        this.form.sqrList.splice(index, 1);
      } else {
        this.form.qlrList.splice(index, 1);
      }
    },
    teltest(row) {
      const reg = /^1([38]\d|5[0-35-9]|7[3678])\d{8}$/;
      if (row.lxdh == "" || row.lxdh.length <= 10 || !reg.test(row.lxdh)) {
        row.inputErr = true;
        return false;
      } else {
        row.inputErr = false;
        return true;
      }
    },
  },
};
</script>
<style scoped lang="scss">
@import "~@/styles/mixin.scss";
@import "~@/styles/public.scss";

.title {
  padding-bottom: 10px;
  margin-bottom: 10px;
  display: block;
  border-bottom: 1px solid $borderColor;
}

.jtfccx-edit {
  @include flex;
  flex-direction: column;
  overflow-y: hidden;
  max-height: 87vh;
  padding: 0 2px;

  .jtfccx-edit-con {
    flex: 1;
    height: 100%;
    overflow-y: scroll;
  }

  .submit-button {
    text-align: center;
    height: 52px;
    padding-top: 10px;
    background-color: #fff;
  }
}
</style>