ywsq.vue 5.06 KB
<template>
  <div class="ywsq">
    <div class="ywsq-left">
      <p v-for="(item, index) in leftList" @click="handleleftTitle(index)" :key="index"
        :class="{ 'active': n == index }">{{ item }}</p>
      <el-collapse disabled v-model="activeNames">
        <el-collapse-item title="业务申请" name="1">
          <ul class="item-list">
            <li v-for="(obj, key) in list" :key="key" @click="handleList(list, obj)" :class="obj.check ? 'active' : ''">
              {{ obj.nodename }}</li>
          </ul>
        </el-collapse-item>
      </el-collapse>
    </div>

    <!-- right -->
    <div class="ywsq-right">
      <div class="right-type el-card box-card is-always-shadow" v-if="n == -1">
        <div class="right-title">登记类型</div>
        <ul class="type-content">
          <li :class="item.select ? 'cactive' : ''" @click="handleDjlxSelect(item)" v-for="(item, index) in djlxList"
            :key="index">
            <p>
              {{ item.nodename }}
            </p>
            <p v-if="item.sffqlc == 1" :class="item.select ? 'active' : ''">
              <i class="el-icon-star-off" :class="item.select ? 'active' : ''"></i>
            </p>
          </li>
        </ul>
      </div>
      <div class="right-situation el-card box-card is-always-shadow">
        <div v-if="n >= 0">
          <div class="right-title">业务列表</div>
          <ul>
            <li v-for="(item, index) in ywList" :key="index" @click="handleYwSelect(item)"
              :class="item.cselect ? 'cactive' : ''">
              <p>
                {{ item.nodename }}
              </p>
              <p v-if="item.sffqlc == 1" :class="item.select ? 'active' : ''" @click="handleCollection(item)">
                <i class="el-icon-star-off" :class="item.select ? 'active' : ''"></i>
              </p>
            </li>
          </ul>
        </div>
        <div v-if="n == -1">
          <div class="right-title">登记情形</div>
          <ul class="registration">
            <li v-for="(item, index) in djqxList" @click="handleSelect(item)" :class="item.cselect ? 'cactive' : ''"
              :key="index">
              <p>
                {{ item.name }}
              </p>
              <p :class="item.select ? 'active' : ''" @click.stop="handleCollection(item)">
                <i class="el-icon-star-off" :class="item.select ? 'active' : ''"></i>
              </p>
            </li>
          </ul>
        </div>
      </div>
      <div class="submit-button">
        <el-button type="primary" :disabled="btnDisabled" @click="btnClick()">选择不动产信息</el-button>
      </div>
    </div>
    <choiceDialog v-model="isDialog" />
  </div>
</template>
<script>
import { getCollectBiz, getleftMenu, getNextNode } from "@/api/ywbl"
import choiceDialog from "./components/selectql.vue"
export default {
  data () {
    return {
      n: 0,
      activeNames: ['1'],
      leftList: [
        '常办业务', '一并申请', '补申请',
      ],
      list: [],
      djlxList: [{}],
      ywList: [
        {
          name: '国有建设用地使用权 || 首次登记+ 以出让方式取得',
          select: false,
          cselect: false,
        }
      ],
      djqxList: [],
      isDialog: false,
      btnDisabled: true
    }
  },
  components: {
    choiceDialog
  },
  created () {
    this.getDataList()
  },
  methods: {
    getDataList () {
      getCollectBiz().then(res => {
        let { result } = res
        this.ywList = result
        this.ywList.forEach(item => {
          this.$set(item, 'cselect', false)
        })
      })
      getleftMenu().then(res => {
        let { result } = res
        this.list = result
      })
    },
    handleleftTitle (index) {
      this.n = index
      this.list.forEach(item => {
        if (item.check) item.check = false
      })
    },
    // 业务列表选择
    handleYwSelect (item) {
      this.ywList.forEach(item => {
        item.cselect = false
      })
      item.cselect = !item.cselect
      if (item.sffqlc == '1') {
        this.btnDisabled = false
      }
    },

    handleList (list, obj) {
      list.forEach(item => {
        if (item.check) item.check = false
      })
      this.n = -1
      this.$set(obj, 'check', true)
      this.getNextNode(obj.bsmSqyw)
    },
    // 获取下个节点类型
    getNextNode (bsmSqyw) {
      getNextNode(bsmSqyw).then(res => {
        let { djqx, djlx } = res.result
        this.djqxList = djqx
        this.djlxList = djlx
      })
    },
    handleCollection (item) {
      item.select = !item.select
    },
    handleSelect (item) {
      this.busList.forEach(item => {
        item.cselect = false
      })
      item.cselect = !item.cselect
    },
    // 登记类型
    handleDjlxSelect (item) {
      this.djlxList.forEach(item => {
        if (item.select) item.select = false
      })
      this.$set(item, 'select', true)
      if (item.sffqlc == '1') {
        this.btnDisabled = false
      }
    },
    // 选择不动产信息
    btnClick () {
      this.isDialog = true
    },
  }
}
</script>
<style scoped lang='scss'>
@import "~@/styles/mixin.scss";
@import './ywsq.scss';
</style>