Blame view

src/views/ywbl/ywsq/components/selectJsydsyq.vue 6.08 KB
任超 committed
1 2 3 4
<template>
  <div class="from-clues">
    <!-- 表单部分 -->
    <div class="from-clues-header">
5
      <el-form :model="queryForm" ref="queryForm" label-width="100px">
任超 committed
6
        <el-row>
7
          <el-col :span="8">
任超 committed
8
            <el-form-item label="不动产单元号">
9
              <el-input placeholder="请输入不动产单元号" v-model="queryForm.bdcdyh" clearable maxlength="28" class="width100">
任超 committed
10 11 12
              </el-input>
            </el-form-item>
          </el-col>
jiaozeping@pashanhoo.com committed
13
          <el-col :span="10">
田浩浩 committed
14
            <el-form-item label="不动产权证号">
15
              <el-input placeholder="请输入不动产权证号" v-model="queryForm.bdcqzh" clearable class="width100">
任超 committed
16 17 18
              </el-input>
            </el-form-item>
          </el-col>
jiaozeping@pashanhoo.com committed
19 20
        </el-row>
        <el-row>
21
          <el-col :span="8">
田浩浩 committed
22
            <el-form-item label="权利人">
23
              <el-input placeholder="请输入权利人" v-model="queryForm.qlr" clearable class="width100">
田浩浩 committed
24 25 26
              </el-input>
            </el-form-item>
          </el-col>
jiaozeping@pashanhoo.com committed
27
          <el-col :span="10">
田浩浩 committed
28
            <el-form-item label="坐落">
xiaomiao committed
29
              <el-input placeholder="请输入坐落" v-model.trim="queryForm.zl" clearable class="width100">
任超 committed
30 31 32
              </el-input>
            </el-form-item>
          </el-col>
33
          <el-col :span="6" class="btnColRight">
任超 committed
34
            <el-form-item>
35
              <el-button type="primary" @click="resetForm(true)">重置</el-button>
yangwei committed
36
              <el-button type="primary" @click="handleSearch">查询</el-button>
任超 committed
37 38 39 40 41 42
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </div>
    <!-- 表格 -->
43
    <div class="from-clues-content loadingtext">
44
      <lb-table ref="table" @row-click="handleRowClick" :page-size="pageData.pageSize" :calcHeight="300"
45
        :current-page.sync="pageData.currentPage" :total="tableData.total" @size-change="handleSizeChange" @select="select"
46 47
        @p-current-change="handleCurrentChange" @selection-change="handleSelectionChange" :column="tableData.columns"
        :data="tableData.data">
任超 committed
48 49
      </lb-table>
    </div>
任超 committed
50
    <div class="submit_button">
51
      <el-button @click="$popupCacel">取消</el-button>
任超 committed
52
      <el-button type="primary" plain @click="submitForm">发起申请</el-button>
任超 committed
53
    </div>
任超 committed
54 55 56
  </div>
</template>
<script>
57 58 59 60 61 62 63 64 65 66 67 68
  //首次登记
  import store from '@/store/index.js'
  import { datas, sendThis } from "../javascript/selectJsydsyq.js";
  import { defaultParameters } from "../javascript/publicDefaultPar.js";
  import table from "@/utils/mixin/table";
  import jump from "./mixin/jump";
  import { startBusinessFlow, selectJsydQlxx } from "@/api/ywbl.js";
  export default {
    mixins: [table, jump],
    props: {
      isJump: { type: Boolean, default: false },
      sqywInfo: { type: Object, default: () => { } },
任超 committed
69
    },
70 71 72 73 74 75 76 77 78
    data () {
      return {
        queryForm: defaultParameters.defaultParameters(),
        tableData: {
          total: 0,
          columns: datas.columns(),
          data: []
        },
        bdcdysz: []
任超 committed
79
      }
任超 committed
80
    },
81 82
    mounted () {
      sendThis(this);
田浩浩 committed
83
    },
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
    methods: {
      queryClick () {
        this.$startLoading();
        this.queryForm.sqywbm = this.sqywInfo.djywbm;
        selectJsydQlxx({ ...this.queryForm, ...this.pageData }).then((res) => {
          this.$endLoading();
          if (res.code === 200) {
            let { total, records } = res.result;
            this.tableData.total = total;
            this.tableData.data = records;
          }
        });
      },
      submitForm () {
        if (this.bdcdysz.length == 0) {
          this.$message.error("请至少选择一条数据");
          return;
        }
        startBusinessFlow({
          bsmSqyw: this.sqywInfo.parentid,
          bdcdysz: this.bdcdysz,
          djqxbm: this.sqywInfo.nodetype == "djqx" ? this.sqywInfo.nodecode : "",
          djqxmc: this.sqywInfo.nodetype == "djqx" ? this.sqywInfo.nodename : "",
        }).then((res) => {
          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);
            }
119
            this.$popupCacel()
120 121 122
          } else {
            this.$message.error(res.message);
          }
123
        })
124
      },
125
      handleSelectionChange (val) {
126 127 128 129 130 131 132 133 134 135 136 137
        this.bdcdysz = val;
      },
      openBook (row) {
        var param = {
          bdcdyid: row.bdcdyid,
          qllx: row.qllx,
          bdcdyh: row.bdcdyh,
          bsmQlxx: row.bsmQlxx,
        };
        this.$popup("登记簿详情", "registerBook/djbFrame", {
          formData: param
        })
138
      },
139 140 141 142 143 144 145 146 147
      select (selection, row) {
        if (this.sqywInfo.sqywdylx == "1") {
          // 清除 所有勾选项
          this.$refs.table.clearSelection()
          // 当表格数据都没有被勾选的时候 就返回
          // 主要用于将当前勾选的表格状态清除
          if (selection.length == 0) return
          this.$refs.table.toggleRowSelection(row, true);
        }
148
      },
149
      handleRowClick (row) {
150
        // 如果状态是1,那就是单选
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
        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 {
170
          this.$refs.table.toggleRowSelection(row);
171
        }
172
      },
173 174
    }
  }
任超 committed
175 176
</script>
<style scoped lang="scss">
177 178
  @import "~@/styles/mixin.scss";
  @import "~@/styles/public.scss";
任超 committed
179
</style>