Blame view

src/views/ywbl/ywsq/components/fwsyq.vue 12.9 KB
1
<!--
2
 * @Description:
3
 * @Autor: renchao
4
 * @LastEditTime: 2023-09-13 11:19:54
5
-->
6 7
<template>
  <div class="from-clues">
任超 committed
8 9
    <el-tabs type="card" v-model="activeName" @tab-click="handleTabClick" v-if="!isJump">
      <el-tab-pane label="自然幢" name="zrz"></el-tab-pane>
xiaomiao committed
10
      <el-tab-pane label="多幢" name="dz"></el-tab-pane>
任超 committed
11
    </el-tabs>
12
    <div v-show="activeName == 'zrz'">
13
      <div class="from-clues-header">
14
        <el-form :model="queryzrzForm" ref="queryzrzForm" label-width="110px">
15 16 17
          <el-row>
            <el-col :span="7">
              <el-form-item label="宗地代码">
18
                <el-input placeholder="请输入宗地代码" v-model="queryzrzForm.zddm" clearable>
19 20 21 22 23
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="7">
              <el-form-item label="土地证号">
24
                <el-input placeholder="请输入土地证号" v-model="queryzrzForm.bdcqzh" clearable>
25 26 27 28 29
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="7">
              <el-form-item label="土地坐落">
30
                <el-input placeholder="请输入土地坐落" v-model="queryzrzForm.zl" clearable>
31 32 33 34 35 36 37
                </el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="7">
              <el-form-item label="自然幢号">
38
                <el-input placeholder="请输入自然幢号" v-model="queryzrzForm.zrzh" clearable>
39 40 41 42 43
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="7">
              <el-form-item label="项目名称">
44
                <el-input placeholder="请输入项目名称" v-model="queryzrzForm.xmmc"></el-input>
45 46 47 48
              </el-form-item>
            </el-col>
            <el-col :span="7">
              <el-form-item label="建筑物名称">
49
                <el-input placeholder="请输入建筑物名称" v-model="queryzrzForm.jzwmc" clearable>
50 51 52
                </el-input>
              </el-form-item>
            </el-col>
1  
jiaozeping@pashanhoo.com committed
53

54 55
            <el-col :span="3" class="btnColRight">
              <el-form-item>
56
                <el-button type="primary" @click="resetForm(true)">重置</el-button>
57 58 59 60 61 62
                <el-button type="primary" @click="handleSearch">查询</el-button>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </div>
63
      <div class="from-clues-content loadingtext">
64
        <lb-table ref="table1" @row-click="handleRowClick" :page-size="pageData.pageSize" :calcHeight="300"
65
          :current-page.sync="pageData.currentPage" :total="zrztableData.total" @size-change="handleSizeChange" @select="select"
66 67
          @p-current-change="handleCurrentChange" @selection-change="handleSelectionChange" :column="zrztableData.columns"
          :data="zrztableData.data">
68 69 70
        </lb-table>
      </div>
      <div class="submit_button">
71
        <el-button @click="$popupCacel">取消</el-button>
72
        <el-button type="primary" plain @click="submitForm" :loading="loading">发起申请</el-button>
73
      </div>
74
    </div>
75
    <div v-show="activeName == 'dz'">
76
      <div class="from-clues-header">
77
        <el-form :model="querydzForm" ref="querydzForm" label-width="110px">
78 79
          <el-row>
            <el-col :span="7">
80
              <el-form-item label="宗地代码">
81
                <el-input placeholder="请输入宗地代码" v-model="querydzForm.zddm" clearable>
82 83 84 85
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="7">
tianhaohao@pashanhoo.com committed
86
              <el-form-item label="坐落">
87
                <el-input placeholder="请输入土地坐落" v-model="querydzForm.zl" clearable>
88 89 90
                </el-input>
              </el-form-item>
            </el-col>
tianhaohao@pashanhoo.com committed
91
               <el-col :span="10" class="btnColRight">
92
              <el-form-item>
93
                <el-button type="primary" @click="resetForm(true)">重置</el-button>
94
                <el-button type="primary" @click="handleSearch">查询</el-button>
95 96 97
              </el-form-item>
            </el-col>
          </el-row>
yuanbo committed
98

99 100
        </el-form>
      </div>
101
      <div class="from-clues-content loadingtext">
102
        <lb-table ref="table" @row-click="handleRowClick" :page-size="pageData.pageSize" :calcHeight="300"
103
          :current-page.sync="pageData.currentPage" :total="dztableData.total" @size-change="handleSizeChange" @select="select"
104 105
          @p-current-change="handleCurrentChange" @selection-change="handleSelectionChange" :column="dztableData.columns"
          :data="dztableData.data">
106 107 108
        </lb-table>
      </div>
      <div class="submit_button">
109
        <el-button @click="$popupCacel">取消</el-button>
110
        <el-button type="primary" plain @click="submitForm" :loading="loading">发起申请</el-button>
111
      </div>
112 113 114 115
    </div>
  </div>
</template>
<script>
116
  import Vue from 'vue'
117
  import store from '@/store/index.js'
118
  import table from "@/utils/mixin/table";
119
  //国有建设用地使用权/房屋使用权
120
  import { ywPopupDialog } from "@/utils/popup.js";
121 122
  import { datas, sendThis } from "../javascript/fwsyq.js";
  import jump from "@/views/ywbl/ywsq/components/mixin/jump";
123
  import { selectOtherH, selectZrz, selectDz } from "@/api/ywsq.js";
124
  import { startBusinessFlow, choiceBdcdy } from "@/api/workFlow.js";
125 126 127 128 129 130 131 132
  export default {
    mixins: [table, jump],
    props: {
      isJump: { type: Boolean, default: false },
      sqywInfo: { type: Object, default: () => { } },
    },
    data () {
      return {
133
        loading: false,
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
        activeName: 'zrz',
        queryzrzForm: {
          qllx: '',
          bdcdyh: '',
          ywh: '',
          bdcqzh: ''
        },
        querydzForm: {
          qllx: '',
          bdcdyh: '',
          ywh: '',
          bdcqzh: ''
        },
        zrztableData: {
          total: 0,
          columns: datas.zrzcolumns(),
          data: [],
        },
        dztableData: {
          total: 0,
          columns: datas.dzcolumns(),
          data: [],
        },
        bdcdysz: [],
      };
    },
    mounted () {
      sendThis(this)
    },
    methods: {
yuanbo committed
164 165 166 167
      /**
       * @description: queryClick
       * @author: renchao
       */
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
      queryClick () {
        this.$startLoading();
        if (!this.isJump) {
          //从业务办理进入
          if (this.activeName == "zrz") {
            this.queryzrzForm.sqywbm = this.sqywInfo.djywbm;
            this.queryzrzForm.fwfl = this.activeName;
            selectZrz({ ...this.queryzrzForm, ...this.pageData }).then((res) => {
              this.$endLoading();
              if (res.code === 200) {
                this.zrztableData.total = res.result.total;
                this.zrztableData.data = res.result.records;
              }
            });
          } else {
            this.querydzForm.sqywbm = this.sqywInfo.djywbm;
            this.querydzForm.fwfl = this.activeName;
            selectDz({ ...this.querydzForm, ...this.pageData }).then((res) => {
              this.$endLoading();
              if (res.code === 200) {
                this.dztableData.total = res.result.total;
                this.dztableData.data = res.result.records;
              }
            })
          }

        } else {
          //从办理框架选择不动产单元进入
          //房屋首次办理选择不动产需找出对应自然幢下未选择的户
197
          this.queryzrzForm.bsmSlsq = Vue.prototype.$currentRoute.query.bsmSlsq;
198
          selectOtherH({ ...this.queryzrzForm, ...this.pageData }).then((res) => {
199
            this.$endLoading();
200
            if (res.code === 200) {
201 202 203
              let { total, records } = res.result;
              this.zrztableData.total = total;
              this.zrztableData.data = records;
任超 committed
204
            }
205 206 207
          })
        }
      },
yuanbo committed
208 209 210 211
      /**
       * @description: handleTabClick
       * @author: renchao
       */
212 213 214 215 216
      handleTabClick () {
        this.bdcdysz = [],
          this.pageData.currentPage = 1;
        this.queryClick();
      },
yuanbo committed
217 218 219 220
      /**
       * @description: submitForm
       * @author: renchao
       */
221 222 223 224 225 226
      submitForm () {
        if (this.bdcdysz.length == 0) {
          this.$message.error("请至少选择一条数据");
          return;
        }
        if (!this.isJump) {
227
          this.loading = true
228
          startBusinessFlow({
229
            bsmSqyw: this.sqywInfo.bsmSqyw,
230 231
            //sjlx: 'zrz',
            sjlx: this.activeName,
232 233
            bdcdysz: this.bdcdysz,
          }).then((res) => {
234
            this.loading = false
235 236 237 238 239 240
            if (res.code == 200) {
              this.$message({
                showClose: true,
                message: '发起申请成功',
                type: 'success'
              })
241 242 243 244 245 246
              if (!this.isJump) {
                this.jump(res.result, this.sqywInfo.djywbm);
              } else {
                store.dispatch('user/refreshPage', true);
              }
              this.$popupCacel()
247
            } else {
248
              if (res.result && res.result.length > 0) {
249 250 251 252
                ywPopupDialog("申请错误明细", "components/ywdialog", { result: res.result }, '36%', true)
              } else {
                ywPopupDialog("申请错误明细", "components/ywdialog", { message: res.message }, '36%', true)
              }
253
            }
254 255
          }).catch(() => {
            this.loading = false
256
          })
任超 committed
257
        } else {
258
          this.loading = true
259
          choiceBdcdy({
260
            bsmSlsq: Vue.prototype.$currentRoute.query.bsmSlsq,
261 262
            bdcdysz: this.bdcdysz
          }).then(res => {
263
            this.loading = false
264 265 266 267 268 269 270
            if (res.code == 200) {
              this.$message({
                showClose: true,
                message: '发起申请成功',
                type: 'success'
              })
              store.dispatch('user/refreshPage', true);
271
              this.$popupCacel()
272
            } else {
273
              if (res.result && res.result.length > 0) {
274 275 276 277
                ywPopupDialog("申请错误明细", "components/ywdialog", { result: res.result }, '36%', true)
              } else {
                ywPopupDialog("申请错误明细", "components/ywdialog", { message: res.message }, '36%', true)
              }
任超 committed
278
            }
279 280
          }).catch(() => {
            this.loading = false
任超 committed
281
          })
田浩浩 committed
282
        }
283
      },
yuanbo committed
284 285 286 287 288
      /**
       * @description: handleSelectionChange
       * @param {*} val
       * @author: renchao
       */
289
      handleSelectionChange (val) {
290 291 292 293 294 295 296 297 298
        if (this.sqywInfo.sqywdylx == "1") {
          if (val.length > 1) {
            this.bdcdysz = [...val[val.length - 1]];
          } else {
            this.bdcdysz = val;
          }
        } else {
          this.bdcdysz = val;
        }
299
      },
yuanbo committed
300 301 302 303 304
      /**
       * @description: handleLpbClick
       * @param {*} item
       * @author: renchao
       */
305
      handleLpbClick (item) {
306
        ywPopupDialog('楼盘表', 'lpb/index', {
xiaomiao committed
307
            bsm: item.bsm,
308 309 310
            bsmSqyw:this.sqywInfo.bsmSqyw,
            scyclx:1
        }, '85%', true,false)
311
      },
yuanbo committed
312 313 314 315 316 317
      /**
       * @description: select
       * @param {*} selection
       * @param {*} row
       * @author: renchao
       */
318 319 320 321 322 323 324 325 326
      select (selection, row) {
        if (this.sqywInfo.sqywdylx == "1") {
          // 清除 所有勾选项
          this.$refs.table.clearSelection()
          // 当表格数据都没有被勾选的时候 就返回
          // 主要用于将当前勾选的表格状态清除
          if (selection.length == 0) return
          this.$refs.table.toggleRowSelection(row, true);
        }
327
      },
yuanbo committed
328 329 330 331 332
      /**
       * @description: handleRowClick
       * @param {*} row
       * @author: renchao
       */
333
      handleRowClick (row) {
334
        // 自然幢多选,多幢单选
335
        let refs = 'table1';
336
        if (this.activeName == 'dz') {
337 338
          refs = 'table';
          this.$refs[refs].clearSelection()
339
        } else {
340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355
        }
        const bdcdysz = this.bdcdysz
        if (bdcdysz.length > 0) {
          bdcdysz.forEach(item => {
            // 判断 如果当前的一行被勾选, 再次点击的时候就会取消选中
            if (item == row) {
              this.$nextTick(()=>{this.$refs[refs].toggleRowSelection(row, false);})
            }
            // 不然就让当前的一行勾选
            else {
              this.$refs[refs].toggleRowSelection(row, true);
            }
          })
        }
        else {
          this.$refs[refs].toggleRowSelection(row, true);
356
        }
357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372
      },
      /**
       * @description: openBook
       * @param {*} row
       * @author: miaofang
       */
      openBook (row) {
        var param = {
          bdcdyid: row.bdcdyid,
          qllx: row.qllx,
          bdcdyh: row.bdcdyh,
          bsmQlxx: row.bsmQlxx,
        };
        this.$popup("登记簿详情", "registerBook/djbFrame", {
          formData: param
        })
373
      }
任超 committed
374
    }
任超 committed
375
  }
376 377
</script>
<style scoped lang="scss">
378 379
  @import "~@/styles/mixin.scss";
  @import "~@/styles/public.scss";
380
</style>