Blame view

src/views/ywbl/ywsq/ywsq.vue 6.59 KB
赵千 committed
1
<template>
任超 committed
2 3
  <div class="ywsq">
    <div class="ywsq-left">
任超 committed
4 5 6 7
      <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">
任超 committed
8
          <ul class="item-list">
任超 committed
9
            <li v-for="(obj, key) in list" :key="key" @click="handleList(list, obj)" :class="obj.check ? 'active' : ''">
任超 committed
10
              {{ obj.nodename }}</li>
任超 committed
11
          </ul>
任超 committed
12 13
        </el-collapse-item>
      </el-collapse>
任超 committed
14 15 16 17
    </div>

    <!-- right -->
    <div class="ywsq-right">
任超 committed
18
      <div class="right-type el-card box-card is-always-shadow" v-if="n == -1">
任超 committed
19 20
        <div class="right-title">登记类型</div>
        <ul class="type-content">
任超 committed
21
          <li :class="item.cselect ? 'cactive' : ''" @click="handleDjlxSelect(item)" v-for="(item, index) in djlxList"
任超 committed
22 23 24 25
            :key="index">
            <p>
              {{ item.nodename }}
            </p>
任超 committed
26 27 28
            <p v-if="item.sffqlc == 1" :class="item.userCollect==1 ? 'active' : ''"
              @click.stop="handleCollection(item)">
              <i class="el-icon-star-off" :class="item.userCollect==1 ? 'active' : ''"></i>
任超 committed
29 30
            </p>
          </li>
任超 committed
31 32 33
        </ul>
      </div>
      <div class="right-situation el-card box-card is-always-shadow">
任超 committed
34 35 36
        <div v-if="n >= 0">
          <div class="right-title">业务列表</div>
          <ul>
任超 committed
37
            <li v-for="(item, index) in ywList" :key="index" @click="handleSelectYw(item, ywList)"
任超 committed
38
              :class="item.cselect ? 'cactive' : ''">
任超 committed
39
              <p>
任超 committed
40
                {{ item.nodename }}
任超 committed
41
              </p>
任超 committed
42 43 44
              <p v-if="item.sffqlc == 1" :class="item.userCollect==1 ? 'active' : ''"
                @click.stop="handleCollection(item)">
                <i class="el-icon-star-off" :class="item.userCollect==1 ? 'active' : ''"></i>
任超 committed
45 46 47 48 49 50
              </p>
            </li>
          </ul>
        </div>
        <div v-if="n == -1">
          <div class="right-title">登记情形</div>
任超 committed
51
          <ul class="registration">
任超 committed
52 53
            <li v-for="(item, index) in djqxList" @click="handleSelectYw(item, djqxList)"
              :class="item.cselect ? 'cactive' : ''" :key="index">
任超 committed
54
              <p>
任超 committed
55
                {{ item.nodename }}
任超 committed
56
              </p>
任超 committed
57 58
              <p :class="item.userCollect==1 ? 'active' : ''" @click.stop="handleCollection(item)">
                <i class="el-icon-star-off" :class="item.userCollect==1 ? 'active' : ''"></i>
任超 committed
59 60 61 62 63 64
              </p>
            </li>
          </ul>
        </div>
      </div>
      <div class="submit-button">
65
        <el-button type="primary" :disabled="btnDisabled" @click="bthSelectClick">选择不动产</el-button>
任超 committed
66 67
      </div>
    </div>
任超 committed
68
    <fqsqDialog v-model="isDialog" :djywbm="djywbm" />
任超 committed
69
  </div>
赵千 committed
70 71
</template>
<script>
任超 committed
72
import Cookies from 'js-cookie'
73
import fqsqDialog from "./slectBdc.vue"
任超 committed
74
import { getCollectBiz, getleftMenu, getNextNode, addCollectBiz, deleteCollectBiz } from "@/api/ywbl"
赵千 committed
75 76 77
export default {
  data () {
    return {
任超 committed
78
      n: 0,
任超 committed
79
      activeNames: ['1'],
任超 committed
80
      leftList: [
81
        '常办业务', '一并申请', '登记簿补录',
任超 committed
82
      ],
任超 committed
83
      list: [],
任超 committed
84
      djlxList: [],
任超 committed
85
      ywList: [],
任超 committed
86
      djqxList: [],
liangyifan committed
87
      isDialog: false,
任超 committed
88
      btnDisabled: true,
任超 committed
89
      djywbm: ''
任超 committed
90 91
    }
  },
liangyifan committed
92
  components: {
任超 committed
93
    fqsqDialog
liangyifan committed
94
  },
任超 committed
95 96 97
  created () {
    this.getDataList()
  },
任超 committed
98
  methods: {
任超 committed
99 100 101 102 103 104 105 106 107 108 109 110 111
    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
      })
    },
任超 committed
112 113 114 115 116 117
    handleleftTitle (index) {
      this.n = index
      this.list.forEach(item => {
        if (item.check) item.check = false
      })
    },
任超 committed
118 119 120
    // 业务-登记情形选择
    handleSelectYw (item, list) {
      list.forEach(item => {
任超 committed
121
        this.$set(item, 'cselect', false)
任超 committed
122
      })
任超 committed
123
      item.cselect = true
任超 committed
124
      Cookies.set("djqxObj", JSON.stringify({
任超 committed
125
        'djqxbm': item.nodecode,
任超 committed
126 127
        'djqxmc': item.nodename
      }))
任超 committed
128 129
      if (item.sffqlc == '1') {
        this.btnDisabled = false
130
        Cookies.set("bsmSqyw", item.bsmSqyw)
任超 committed
131
        this.djywbm = item.djywbm
任超 committed
132 133
      }
    },
任超 committed
134
    handleList (list, obj) {
任超 committed
135
      this.btnDisabled = true
任超 committed
136
      list.forEach(item => {
任超 committed
137
        if (item.check) item.check = false
任超 committed
138
      })
任超 committed
139
      this.n = -1
任超 committed
140
      this.$set(obj, 'check', true)
任超 committed
141
      this.getNextNode(obj.bsmSqyw)
任超 committed
142 143
      this.djqxList = []
      this.djlxList = []
任超 committed
144 145
    },
    // 获取下个节点类型
任超 committed
146
    getNextNode (bsmSqyw, type) {
任超 committed
147
      getNextNode(bsmSqyw).then(res => {
任超 committed
148 149
        if (res.result.djqx) this.djqxList = res.result.djqx
        if (res.result.djlx) this.djlxList = res.result.djlx
任超 committed
150 151 152 153 154 155 156 157
        if (type) {
          this.djqxList.forEach(item => {
            this.$set(item, 'cselect', false)
          })
          this.djlxList.forEach(item => {
            this.$set(item, 'cselect', false)
          })
        }
任超 committed
158
      })
任超 committed
159
    },
任超 committed
160
    handleCollection (item) {
任超 committed
161 162 163 164 165 166 167 168 169
      let that = this
      if (item.userCollect == '2') {
        addCollectBiz(item.bsmSqyw).then(res => {
          if (res.code == 200) {
            item.userCollect = '1'
            that.$message({
              message: '收藏成功!',
              type: 'success'
            })
任超 committed
170
            that.getDataList()
任超 committed
171 172 173 174 175 176 177 178 179 180
          }
        })
      } else {
        deleteCollectBiz(item.bsmSqyw).then(res => {
          if (res.code == 200) {
            item.userCollect = '2'
            that.$message({
              message: '取消收藏成功!',
              type: 'success'
            })
任超 committed
181
            that.getDataList()
任超 committed
182 183 184
          }
        })
      }
任超 committed
185
    },
任超 committed
186 187 188 189 190 191
    handleSelect (item) {
      this.busList.forEach(item => {
        item.cselect = false
      })
      item.cselect = !item.cselect
    },
任超 committed
192
    // 登记类型
任超 committed
193
    handleDjlxSelect (item) {
任超 committed
194
      this.btnDisabled = true
任超 committed
195
      this.djlxList.forEach(item => {
任超 committed
196
        if (item.cselect) item.cselect = false
任超 committed
197
      })
任超 committed
198
      this.$set(item, 'cselect', true)
任超 committed
199 200
      if (item.sffqlc == '1') {
        this.btnDisabled = false
任超 committed
201
        Cookies.set("bsmSqyw", item.bsmSqyw)
任超 committed
202
        this.djywbm = item.djywbm
任超 committed
203
      } else {
任超 committed
204
        this.getNextNode(item.bsmSqyw, false)
任超 committed
205
      }
任超 committed
206
      this.djqxList = []
liangyifan committed
207 208
    },
    // 选择不动产信息
209
    bthSelectClick () {
liangyifan committed
210 211
      this.isDialog = true
    },
任超 committed
212 213 214
    loadView (view) {
      return r => require.ensure([], () => r(require(`./components/${view}/${view}.vue`)))
    },
赵千 committed
215 216 217 218
  }
}
</script>
<style scoped lang='scss'>
任超 committed
219
@import "~@/styles/mixin.scss";
任超 committed
220
@import './ywsq.scss';
赵千 committed
221
</style>