Blame view

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