Blame view

src/views/ywbl/ywsq/guidePage.vue 12.4 KB
1 2 3
<template>
  <div class="ywsq" id="ywsq">
    <div class="ywsq-left">
任超 committed
4
      <p v-for="(item, index) in sqywlxList" @click="sqywlxClick(item)" :key="index"
5
        :class="{ 'active': selectType == item.type }">{{ item.name }}</p>
6 7 8
      <el-collapse disabled v-model="activeNames">
        <el-collapse-item title="业务申请" name="1">
          <ul class="item-list">
任超 committed
9 10
            <li v-for="(item, index) in sqywQllxList" :key="index" @click="qllxClick(index)"
              :class="item.check ? 'active' : ''">
11
              {{ item.nodename }}</li>
12 13 14
          </ul>
        </el-collapse-item>
      </el-collapse>
任超 committed
15
    </div>
16
    <div class="ywsq-right">
17
      <!-- 常办业务 -->
任超 committed
18
      <div v-show="selectType == 'collect'" class="right-situation el-card">
19 20
        <div class="right-title">常办业务列表</div>
        <ul>
任超 committed
21
          <li :class="item.selected ? 'cactive' : ''" v-for="(item, index) in collectList" :key="index"
22
            @dblclick="dblclick(collectList, index, item)" @click="selectSqywClick(collectList, index)">
任超 committed
23 24
            <p v-if="item.nodetype == 'djqx'">{{ item.djywmc }}<br>{{ item.nodename }}</p>
            <dt v-else>{{ item.djywmc }}</dt>
25
            <p class="active" @click.stop="handleCollection(item)">
田浩浩 committed
26
              <i class="el-icon-star-off"></i>
27 28 29 30 31
            </p>
          </li>
        </ul>
      </div>
      <!-- 一并申请 -->
tianhaohao@pashanhoo.com committed
32
      <div v-if="selectType == 'together'" class="right-situation el-card">
33 34
        <div class="right-title">一并申请</div>
        <ul>
tianhaohao@pashanhoo.com committed
35 36 37 38 39 40 41 42 43
          <li :class="item.selected ? 'cactive' : ''" v-for="(item, index) in djqxList" :key="index"
            @dblclick="dblclick(djqxList, index, item)" @click="selectSqywClick(djqxList, index)">
            <dt>{{ item.nodename }}</dt>
            <p :class="item.userCollect == 1 ? 'active' : ''" @click.stop="handleCollection(item)">
              <i class="el-icon-star-off"></i>
            </p>
          </li>
        </ul>
      </div>
44
      <!-- 登记簿补录 -->
xiaomiao committed
45 46 47
      <div v-if="selectType == 'amend'" class="right-situation el-card">
        <div class="right-title">登记簿补录</div>
        <ul>
48 49 50 51 52 53 54 55
          <li :class="item.selected ? 'cactive' : ''" v-for="(item, index) in djqxList" :key="index"
            @dblclick="dblclick(djqxList, index, item)" @click="selectSqywClick(djqxList, index)">
            <dt>{{ item.nodename }}</dt>
            <p :class="item.userCollect == 1 ? 'active' : ''" @click.stop="handleCollection(item)">
              <i class="el-icon-star-off"></i>
            </p>
          </li>
        </ul>
xiaomiao committed
56
      </div>
57
      <!-- 业务申请 -->
任超 committed
58
      <template v-if="selectType == 'apply'">
田浩浩 committed
59
        <div class="right-type el-card box-card is-always-shadow">
任超 committed
60 61
          <div class="right-title">登记类型</div>
          <ul class="type-content">
62
            <li :class="item.selected ? 'cactive' : ''" @dblclick="item.sffqlc == 1 && dblclick(djlxList, index, item)"
任超 committed
63 64 65 66 67 68 69 70 71 72
              @click="selectSqywClick(djlxList, index)" v-for="(item, index) in djlxList" :key="index">
              <p>
                {{ item.nodename }}
              </p>
              <p v-if="item.sffqlc == 1" :class="item.userCollect == 1 ? 'active' : ''"
                @click.stop="handleCollection(item)">
                <i class="el-icon-star-off"></i>
              </p>
            </li>
          </ul>
田浩浩 committed
73
        </div>
任超 committed
74 75 76 77
        <div class="right-situation el-card box-card is-always-shadow">
          <div class="right-title">登记情形</div>
          <ul>
            <li :class="item.selected ? 'cactive' : ''" v-for="(item, index) in djqxList" :key="index"
78
              @dblclick="dblclick(djqxList, index, item)" @click="selectSqywClick(djqxList, index)">
任超 committed
79 80 81 82 83 84 85 86
              <dt>{{ item.nodename }}</dt>
              <p :class="item.userCollect == 1 ? 'active' : ''" @click.stop="handleCollection(item)">
                <i class="el-icon-star-off"></i>
              </p>
            </li>
          </ul>
        </div>
      </template>
87
      <div class="submit-button">
88
        <el-button type="primary" :disabled="btnDisabled" @click="dialogClick">选择不动产</el-button>
89 90 91 92 93
      </div>
    </div>
  </div>
</template>
<script>
94
  import { getCollectBiz, getleftMenu, getNextNode, getRepairBiz, getTogetherBiz, addCollectBiz, deleteCollectBiz } from "@/api/businessApply.js"
95
  export default {
96
    name: 'ywsq',
97 98 99 100 101 102 103 104 105 106 107 108 109 110
    data () {
      return {
        //申请业务类型集合
        sqywlxList: [
          { name: "常办业务", type: "collect" },
          { name: "一并申请", type: "together" },
          { name: "登记簿补录", type: "amend" }
        ],
        //类型默认选择常办业务
        selectType: "collect",
        //堆叠框选中第一个
        activeNames: ['1'],
        //收藏业务集合
        collectList: [],
xiaomiao committed
111
        //申请权利类型集合
112
        sqywQllxList: [],
xiaomiao committed
113
        //登记类型集合
114
        djlxList: [],
xiaomiao committed
115
        //申请权利类型集合
116
        djqxList: [],
xiaomiao committed
117
        //选中业务的参数
118 119 120
        selectParam: {},
        //选择按钮显示或隐藏
        btnDisabled: true,
121
      }
122
    },
123 124 125 126
    created () {
      this.getDataList();
    },
    methods: {
yuanbo committed
127 128 129 130
      /**
       * @description: getDataList
       * @author: renchao
       */
131 132 133 134 135
      getDataList () {
        //获取收藏信息集合
        getCollectBiz().then(res => {
          this.collectList = res.result;
          this.collectList.forEach(item => {
任超 committed
136 137
            this.$set(item, 'selected', false);
          });
138 139 140 141 142 143 144
        });
        //获取申请权利信息集合
        getleftMenu().then(res => {
          this.sqywQllxList = res.result;
        })
      },
      //申请业务类型菜单事件
yuanbo committed
145 146 147 148 149
      /**
       * @description: 申请业务类型菜单事件
       * @param {*} item
       * @author: renchao
       */
150
      sqywlxClick (item) {
151
        console.log("item", item);
152 153 154 155
        this.btnDisabled = true;
        this.selectType = item.type;
        this.sqywQllxList.forEach(item => {
          if (item.check) item.check = false;
xiaomiao committed
156
        });
157
        if (this.selectType == 'amend') {
xiaomiao committed
158 159
          this.getRepairBiz();
        }
160
        if (this.selectType == 'together') {
tianhaohao@pashanhoo.com committed
161
          getTogetherBiz().then(res => {
162 163 164 165 166
            if (res) {
              console.log("res", res);
              this.djqxList = res.result;
            }
          })
tianhaohao@pashanhoo.com committed
167
        }
168 169
      },
      //权利类型菜单事件
yuanbo committed
170 171 172 173 174
      /**
       * @description: 权利类型菜单事件
       * @param {*} index
       * @author: renchao
       */
175
      qllxClick (index) {
176
        console.log("业务", index);
177 178 179 180 181 182 183 184 185 186
        this.btnDisabled = true;
        this.sqywQllxList.forEach(item => {
          if (item.check) item.check = false;
        })
        this.sqywQllxList[index].check = true;
        this.selectType = "apply";
        this.djlxList = [];
        this.djqxList = [];
        this.getNextNode(this.sqywQllxList[index].bsmSqyw);
      },
yuanbo committed
187 188 189 190 191 192
      /**
       * @description: 选择申请业务事件
       * @param {*} data
       * @param {*} index
       * @author: renchao
       */
193 194 195 196 197 198 199 200
      selectSqywClick (data, index) {
        data.forEach(item => {
          item.selected = false;
        });
        data[index].selected = true;
        if (data[index].sffqlc == "1") {
          this.selectParam = data[index];
          this.btnDisabled = false;
201
          this.djqxList = []
202 203 204
        } else {
          this.btnDisabled = true;
          this.getNextNode(data[index].bsmSqyw);
任超 committed
205
        }
206 207
      },
      //获取下个节点类型数据
yuanbo committed
208 209 210 211 212
      /**
       * @description: 获取下个节点类型数据
       * @param {*} bsmSqyw
       * @author: renchao
       */
213 214 215 216 217 218 219 220 221 222 223 224 225
      getNextNode (bsmSqyw) {
        getNextNode(bsmSqyw).then(res => {
          if (res.result.djqx) {
            this.djqxList = res.result.djqx;
            this.djqxList.forEach(item => {
              this.$set(item, 'selected', false);
            });
          }
          if (res.result.djlx) {
            this.djlxList = res.result.djlx;
            this.djlxList.forEach(item => {
              this.$set(item, 'selected', false);
            });
226 227
          }
        })
228
      },
xiaomiao committed
229

230
      //获取下个节点类型数据
yuanbo committed
231 232 233 234
      /**
       * @description: 获取下个节点类型数据
       * @author: renchao
       */
235 236
      getRepairBiz () {
        getRepairBiz().then(res => {
xiaomiao committed
237
          if (res) {
238
            console.log("res", res);
xiaomiao committed
239
            this.djqxList = res.result;
240 241
          }
        })
xiaomiao committed
242
      },
243
      //双击事件
yuanbo committed
244 245 246 247 248 249 250
      /**
       * @description: 双击事件
       * @param {*} data
       * @param {*} index
       * @param {*} item
       * @author: renchao
       */
251 252 253 254 255 256
      dblclick (data, index, item) {
        localStorage.setItem('ywbl', JSON.stringify(item));
        this.selectSqywClick(data, index);
        this.dialogClick();
      },
      //打开弹框内容
yuanbo committed
257 258 259 260
      /**
       * @description: 打开弹框内容
       * @author: renchao
       */
261 262 263 264
      dialogClick () {
        this.openDialog();
      },
      //收藏操作
yuanbo committed
265 266 267 268 269
      /**
       * @description: 收藏操作
       * @param {*} item
       * @author: renchao
       */
270 271 272 273
      handleCollection (item) {
        let that = this
        if (item.userCollect == '2') {
          addCollectBiz(item.bsmSqyw).then(res => {
274
            if (res.code == 200) {
275
              item.userCollect = '1'
276
              that.$message({
277
                message: '收藏成功!',
278 279 280 281 282
                type: 'success'
              })
              that.getDataList()
            }
          })
283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301
        } else {
          this.$confirm('此操作将取消收藏, 是否继续?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            deleteCollectBiz(item.bsmSqyw).then(res => {
              if (res.code == 200) {
                item.userCollect = '2'
                that.$message({
                  message: '取消收藏成功!',
                  type: 'success'
                })
                that.getDataList()
              }
            })
          })
        }
      },
yuanbo committed
302 303 304 305 306
      /**
       * @description: handleSelect
       * @param {*} item
       * @author: renchao
       */
307 308 309 310 311 312 313
      handleSelect (item) {
        this.busList.forEach(item => {
          item.cselect = false
        })
        item.cselect = !item.cselect
      },
      // 登记类型
yuanbo committed
314 315 316 317 318
      /**
       * @description: 登记类型
       * @param {*} item
       * @author: renchao
       */
319 320 321
      handleDjlxSelect (item) {
        this.djlxList.forEach(item => {
          item.cselect = false
322 323
        })
        this.btnDisabled = true
324 325 326 327 328 329 330 331 332 333 334
        item.cselect = true;
        this.djqxObj = item;
        if (item.sffqlc == '1') {
          this.btnDisabled = false
          this.bsmSqyw = item.bsmSqyw
          this.djywbm = item.djywbm;
        } else {
          this.getNextNode(item.bsmSqyw, false)
        }
        this.djqxList = []
      },
yuanbo committed
335 336 337 338 339
      /**
       * @description: handleDjqxItem
       * @param {*} item
       * @author: renchao
       */
340 341 342 343 344 345 346 347 348 349 350 351
      handleDjqxItem (item) {
        this.djlxList.forEach(item => {
          item.cselect = false
        })
        if (item.sffqlc == 1) {
          this.djywbm = item.djywbm
          this.bsmSqyw = item.bsmSqyw
          item.cselect = true
          this.openDialog()
          this.btnDisabled = true
        }
      },
yuanbo committed
352 353 354 355 356 357
      /**
       * @description: handleSelectItem
       * @param {*} item
       * @param {*} list
       * @author: renchao
       */
358 359 360 361 362
      handleSelectItem (item, list) {
        this.handleSelectYw(item, list)
        this.openDialog()
      },
      // 选择不动产信息
yuanbo committed
363 364 365 366
      /**
       * @description: 选择不动产信息
       * @author: renchao
       */
367 368 369
      bthSelectClick () {
        this.openDialog()
      },
yuanbo committed
370 371 372 373
      /**
       * @description: openDialog
       * @author: renchao
       */
374
      openDialog () {
375
        console.log("this.selectParam", this.selectParam);
376
        let title = "申请业务:" + this.selectParam?.djywmc ? this.selectParam?.djywmc : '';
xiaomiao committed
377

378
        this.$popupDialog(title, "ywbl/ywsq/selectBdc", { 'sqywInfo': this.selectParam }, "85%")
379
      },
yuanbo committed
380 381 382 383 384
      /**
       * @description: loadView
       * @param {*} view
       * @author: renchao
       */
385 386
      loadView (view) {
        return r => require.ensure([], () => r(require(`./components/${view}/${view}.vue`)))
387 388 389 390 391
      }
    }
  }
</script>
<style scoped lang='scss'>
392 393 394 395 396
  @import "~@/styles/mixin.scss";
  @import "./ywsq.scss";
  /deep/.el-collapse-item__content {
    padding-bottom: 0;
  }
397

398 399 400
  /deep/.el-collapse-item__wrap {
    border-bottom: none;
  }
xiaomiao committed
401
</style>