selectJsydsyqSplitMerge.vue 10.5 KB
<!--
 * @Description:
 * @Autor: renchao
 * @LastEditTime: 2023-08-02 09:56:41
-->
<template>
  <div class="from-clues">
    <!-- 表单部分 -->
    <div class="from-clues-header">
      <el-form :model="queryForm" ref="queryForm" label-width="100px">
        <el-row>
          <el-col :span="8">
            <el-form-item label="不动产单元号">
              <el-input placeholder="请输入不动产单元号" v-model="queryForm.bdcdyh" clearable maxlength="28" class="width100">
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="10">
            <el-form-item label="不动产权证号">
              <el-input placeholder="请输入不动产权证号" v-model="queryForm.bdcqzh" clearable class="width100">
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="权利人">
              <el-input placeholder="请输入权利人" v-model="queryForm.qlr" clearable class="width100">
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="10">
            <el-form-item label="坐落">
              <el-input placeholder="请输入坐落" v-model.trim="queryForm.zl" clearable class="width100">
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="6" class="btnColRight">
            <el-form-item>
              <el-button type="primary" @click="handleSearch">查询</el-button>
              <el-button type="primary" @click="resetForm(true)">重置</el-button>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </div>
    <!-- 表格 -->
    <div class="from-clues-content loadingtext">
      分割合并前权利信息
      <el-table
        :data="tableData.data"
        height="230"
        border
        :cell-style="{ textAlign: 'center' }"
        :header-cell-style="{textAlign: 'center'}"
        @row-click="handleRowClick"
        style="width: 100%">
        <el-table-column
          label="选择"
          width="50">
          <template slot-scope="scope">
            <el-radio v-model="radioVal" :label="scope.row.bhqkbsm">{{''}}</el-radio>
          </template>
        </el-table-column>
        <el-table-column
          type="index"
          label="序号"
          width="50">
        </el-table-column>
        <el-table-column
          label="状态"
          width="150">
          <template slot-scope="scope">
            <a style='color:#3498db;' v-show="scope.row.djblzt==1">正在办理</a>
            <span v-show="scope.row.zjgcdyzt==1">>,在建工程抵押</span>
            <span v-show="scope.row.ycfzt==1">>,已预查封</span>
            <span v-show="scope.row.ycfzt==1">>,已预查封</span>
            <span v-show="scope.row.cfzt==1">>,已查封</span>
            <span v-show="scope.row.diyizt==1">>,已地役</span>
            <span v-show="scope.row.yyzt==1">>,异议中</span>
            <span v-show="scope.row.xzzt==1">,已限制</span>
            <span v-show="scope.row.ygmmzt==1">>,已预告买卖</span>
            <span v-show="scope.row.ygdyzt==1">>,已预告抵押</span>
            <span v-show="scope.row.dyzt==1">>,已抵押</span>
          </template>
        </el-table-column>
        <el-table-column
          property="qllxmc"
          label="权利类型">
        </el-table-column>
        <el-table-column
          property="bdcdyh"
          label="不动产单元号"
          width="150">
        </el-table-column>
        <el-table-column
          property="bdcqzh"
          label="不动产权证号"
          width="160">
        </el-table-column>
        <el-table-column
          property="qlrmc"
          label="使用权人">
        </el-table-column>
        <el-table-column
          property="qlrzjhm"
          label="证件号">
        </el-table-column>
        <el-table-column
          property="qlxzmc"
          label="权利性质">
        </el-table-column>
        <el-table-column
          property="mj"
          label="使用权面积">
        </el-table-column>
        <el-table-column
          label="操作"
          width="80">
          <template slot-scope="scope">
            <el-button type="text" icon="el-icon-edit-outline" @click="openBook(scope.row)">登记薄</el-button>
          </template>
        </el-table-column>
      </el-table>

    </div>
    <div class="from-clues-content loadingtext">
      分割合并后宗地信息
      <lb-table ref="table" :pagination=false :calcHeight="500" :column="tableData.columns1"
        :data="tableData.datastwo">
      </lb-table>
    </div>
    <div class="submit_button">
      <el-button @click="$popupCacel">取消</el-button>
      <el-button type="primary" plain @click="submitForm" :loading="loading">发起申请</el-button>
    </div>
  </div>
</template>
<script>
  //首次登记
  import jump from "./mixin/jump";
  import store from '@/store/index.js'
  import table from "@/utils/mixin/table";
  import { ywPopupDialog } from "@/utils/popup.js";
  import { datas, datastwo, sendThis } from "../javascript/selectJsydsyqhbfg.js";
  import { defaultParameters } from "../javascript/publicDefaultPar.js";
  import { selectJsydQlxxSplitMergeBefore, selectZdjbxxSplitMergeLast } from "@/api/ywsq.js";
  import { startBusinessFlow } from "@/api/workFlow.js";
  export default {
    mixins: [table, jump],
    props: {
      isJump: { type: Boolean, default: false },
      sqywInfo: { type: Object, default: () => { } },
    },
    data () {
      return {
        loading: false,
        queryForm: defaultParameters.defaultParameters(),
        // 表格数据
        tableData: {
          columns: [{
            label: '选择',
            width: '50px',
            render: (h, scope) => {
              return (
                <div class="orgColumn">
                  <el-radio v-model={this.radioVal} label={scope.row.bhqkbsm}>
                    &ensp;
                  </el-radio>
                </div>
              )
            }
          },].concat(datas.columns()),
          data: [],
          columns1: datastwo.columns1(),
          datastwo: []
        },
        bdcdysz: [],
        radioVal: ""
      }
    },
    watch: {
      radioVal: {
        deep: true,
        handler (newVal, oldVal) {
          this.close()
        }
      }
    },
    mounted () {
      sendThis(this)
    },
    methods: {
      // 单选事件
      /**
       * @description: 单选事件
       * @author: renchao
       */
      close () {
        this.tableData.data.forEach(item => {
          if (this.radioVal == item.bhqkbsm) {
            item.bglx = '1'
            this.bdcdysz[0] = item
          }
        })
        this.queryForm.bhqkbsm = this.radioVal
        selectZdjbxxSplitMergeLast({ ...this.queryForm }).then((res) => {
          this.$endLoading();
          if (res.code === 200) {
            this.tableData.datastwo = res.result
            this.tableData.datastwo.forEach(item => {
              item.bsm = item.zdbsm;
              item.bglx = '2'
            })
            this.bdcdysz = [this.bdcdysz[0], ...this.tableData.datastwo]
          }
        })
      },
      /**
       * @description: queryClick
       * @author: renchao
       */
      queryClick () {
        this.$startLoading();
        this.queryForm.sqywbm = this.sqywInfo.djywbm;
        selectJsydQlxxSplitMergeBefore({ ...this.queryForm, ...this.pageData }).then((res) => {
          this.$endLoading();
          if (res.code === 200) {
            this.tableData.data = res.result
          }
        });
      },
      /**
       * @description: submitForm
       * @author: renchao
       */
      submitForm () {
        this.loading = true
        startBusinessFlow({
          bsmSqyw: this.sqywInfo.bsmSqyw,
          bdcdysz: this.bdcdysz,
        }).then((res) => {
          this.loading = false
          if (res.code == 200) {
            this.$message({
              showClose: true,
              message: "发起申请成功",
              type: "success",
            });
            if (!this.isJump) {
              this.jump(res.result, this.sqywInfo.djywbm);
            } else {
              store.dispatch('user/refreshPage', true);
            }
            this.$popupCacel()
          } else {
            ywPopupDialog("申请错误明细", "components/ywdialog", { message: res.message, result: res.result }, '36%', true)
          }
        }).catch(() => {
          this.loading = false
        })
      },
      /**
       * @description: openBook
       * @param {*} row
       * @author: renchao
       */
      openBook (row) {
        var param = {
          bdcdyid: row.bdcdyid,
          qllx: row.qllx,
          bdcdyh: row.bdcdyh,
          bsmQlxx: row.bsmQlxx,
        };
        this.$popup("登记簿详情", "registerBook/djbFrame", {
          formData: param
        })
      },
      /**
       * @description: select
       * @param {*} selection
       * @param {*} row
       * @author: renchao
       */
      select (selection, row) {
        if (this.sqywInfo.sqywdylx == "1") {
          // 清除 所有勾选项
          this.$refs.table.clearSelection()
          // 当表格数据都没有被勾选的时候 就返回
          // 主要用于将当前勾选的表格状态清除
          if (selection.length == 0) return
          this.$refs.table.toggleRowSelection(row, true);
        }
      },
      /**
       * @description: handleRowClick
       * @param {*} row
       * @author: renchao
       */
      handleRowClick (row) {
        // 如果状态是1,那就是单选
        if (this.sqywInfo.sqywdylx == "1") {
          const bdcdysz = this.bdcdysz
          this.$refs.table.clearSelection()
          if (bdcdysz.length == 1) {
            bdcdysz.forEach(item => {
              // 判断 如果当前的一行被勾选, 再次点击的时候就会取消选中
              if (item == row) {
                this.$refs.table.toggleRowSelection(row, false);
              }
              // 不然就让当前的一行勾选
              else {
                this.$refs.table.toggleRowSelection(row, true);
              }
            })
          }
          else {
            this.$refs.table.toggleRowSelection(row, true);
          }
        } else {
          this.$refs.table.toggleRowSelection(row);
        }
      },
    }
  }
</script>
<style scoped lang="scss">
  @import "~@/styles/mixin.scss";
  @import "~@/styles/public.scss";
  /deep/.el-radio__label {
    display: none;
  }
</style>