Blame view

src/views/ywbl/ywsq/guidePage.vue 8.54 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 22 23 24
          <li :class="item.selected ? 'cactive' : ''" v-for="(item, index) in collectList" :key="index"
            @dblclick="dblclick(collectList, index)" @click="selectSqywClick(collectList, index)">
            <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>
      <!-- 一并申请 -->
任超 committed
32
      <div v-if="selectType == 'together'" class="right-title">一并申请</div>
33
      <!-- 登记簿补录 -->
任超 committed
34
      <div v-if="selectType == 'amend'" class="right-title">登记簿补录</div>
35
      <!-- 业务申请 -->
任超 committed
36
      <template v-if="selectType == 'apply'">
田浩浩 committed
37
        <div class="right-type el-card box-card is-always-shadow">
任超 committed
38 39 40 41 42 43 44 45 46 47 48 49 50
          <div class="right-title">登记类型</div>
          <ul class="type-content">
            <li :class="item.selected ? 'cactive' : ''" @dblclick="item.sffqlc == 1 && dblclick(djlxList, index)"
              @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
51
        </div>
任超 committed
52 53 54 55 56 57 58 59 60 61 62 63 64
        <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"
              @dblclick="dblclick(djqxList, index)" @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>
      </template>
65
      <div class="submit-button">
66
        <el-button type="primary" :disabled="btnDisabled" @click="dialogClick">选择不动产</el-button>
67 68
      </div>
    </div>
任超 committed
69
    <selectDialog v-model="isDialog" :sqywInfo="selectParam" />
70 71 72
  </div>
</template>
<script>
田浩浩 committed
73
import selectDialog from "./selectBdc.vue"
74 75 76 77
import { getCollectBiz, getleftMenu, getNextNode, addCollectBiz, deleteCollectBiz } from "@/api/ywbl"
export default {
  data () {
    return {
田浩浩 committed
78
      //申请业务类型集合
79
      sqywlxList: [
任超 committed
80 81 82
        { name: "常办业务", type: "collect" },
        { name: "一并申请", type: "together" },
        { name: "登记簿补录", type: "amend" }
83
      ],
田浩浩 committed
84
      //类型默认选择常办业务
85
      selectType: "collect",
田浩浩 committed
86
      //堆叠框选中第一个
87
      activeNames: ['1'],
田浩浩 committed
88
      //收藏业务集合
任超 committed
89
      collectList: [],
田浩浩 committed
90
      //申请权利类型集合  
任超 committed
91
      sqywQllxList: [],
田浩浩 committed
92
      //登记类型集合  
93
      djlxList: [],
田浩浩 committed
94
      //申请权利类型集合  
95
      djqxList: [],
田浩浩 committed
96
      //选中业务的参数  
任超 committed
97
      selectParam: {},
田浩浩 committed
98
      //弹框框架显示或隐藏
99
      isDialog: false,
田浩浩 committed
100
      //选择按钮显示或隐藏
101 102 103 104
      btnDisabled: true,
    }
  },
  components: {
105
    selectDialog
106 107
  },
  created () {
108
    this.getDataList();
109 110 111
  },
  methods: {
    getDataList () {
112
      //获取收藏信息集合
113
      getCollectBiz().then(res => {
田浩浩 committed
114 115
        this.collectList = res.result;
        this.collectList.forEach(item => {
任超 committed
116 117
          this.$set(item, 'selected', false);
        });
118 119
      });
      //获取申请权利信息集合
120
      getleftMenu().then(res => {
任超 committed
121
        this.sqywQllxList = res.result;
122 123 124 125
      })
    },
    //申请业务类型菜单事件
    sqywlxClick (item) {
任超 committed
126
      this.btnDisabled = true;
127 128 129 130 131 132
      this.selectType = item.type;
      this.sqywQllxList.forEach(item => {
        if (item.check) item.check = false;
      })
    },
    //权利类型菜单事件
任超 committed
133 134 135
    qllxClick (index) {
      this.btnDisabled = true;
      this.sqywQllxList.forEach(item => {
136
        if (item.check) item.check = false;
137
      })
任超 committed
138
      this.sqywQllxList[index].check = true;
139
      this.selectType = "apply";
任超 committed
140 141
      this.djlxList = [];
      this.djqxList = [];
142
      this.getNextNode(this.sqywQllxList[index].bsmSqyw);
143
    },
144
    //选择申请业务事件
任超 committed
145 146
    selectSqywClick (data, index) {
      data.forEach(item => {
田浩浩 committed
147 148 149
        item.selected = false;
      });
      data[index].selected = true;
任超 committed
150 151 152 153 154 155
      if (data[index].sffqlc == "1") {
        this.selectParam = data[index];
        this.btnDisabled = false;
      } else {
        this.btnDisabled = true;
        this.getNextNode(data[index].bsmSqyw);
156
      }
157 158 159 160
    },
    //获取下个节点类型数据
    getNextNode (bsmSqyw) {
      getNextNode(bsmSqyw).then(res => {
任超 committed
161
        if (res.result.djqx) {
田浩浩 committed
162 163
          this.djqxList = res.result.djqx;
          this.djqxList.forEach(item => {
任超 committed
164 165 166 167
            this.$set(item, 'selected', false);
          });
        }
        if (res.result.djlx) {
田浩浩 committed
168
          this.djlxList = res.result.djlx;
任超 committed
169 170 171 172
          this.djlxList.forEach(item => {
            this.$set(item, 'selected', false);
          });
        }
173
      })
174 175
    },
    //双击事件
任超 committed
176 177 178
    dblclick (data, index) {
      this.selectSqywClick(data, index);
      this.dialogClick();
179 180
    },
    //打开弹框内容
任超 committed
181
    dialogClick () {
182
      this.isDialog = true;
183
    },
田浩浩 committed
184
    //收藏操作
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229
    handleCollection (item) {
      let that = this
      if (item.userCollect == '2') {
        addCollectBiz(item.bsmSqyw).then(res => {
          if (res.code == 200) {
            item.userCollect = '1'
            that.$message({
              message: '收藏成功!',
              type: 'success'
            })
            that.getDataList()
          }
        })
      } 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()
            }
          })
        })
      }
    },
    handleSelect (item) {
      this.busList.forEach(item => {
        item.cselect = false
      })
      item.cselect = !item.cselect
    },
    // 登记类型
    handleDjlxSelect (item) {
      this.djlxList.forEach(item => {
        item.cselect = false
      })
      this.btnDisabled = true
      item.cselect = true;
任超 committed
230
      this.djqxObj = item;
231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278
      if (item.sffqlc == '1') {
        this.btnDisabled = false
        this.bsmSqyw = item.bsmSqyw
        this.djywbm = item.djywbm;
      } else {
        this.getNextNode(item.bsmSqyw, false)
      }
      this.djqxList = []
    },
    handleDjqxItem (item) {
      this.djlxList.forEach(item => {
        item.cselect = false
      })
      console.log(item);
      if (item.sffqlc == 1) {
        this.djywbm = item.djywbm
        this.bsmSqyw = item.bsmSqyw
        item.cselect = true
        this.isDialog = true
        this.btnDisabled = true
      }
    },
    handleSelectItem (item, list) {
      this.handleSelectYw(item, list)
      this.isDialog = true
    },
    // 选择不动产信息
    bthSelectClick () {
      this.isDialog = true
    },
    loadView (view) {
      return r => require.ensure([], () => r(require(`./components/${view}/${view}.vue`)))
    }
  }
}
</script>
<style scoped lang='scss'>
@import "~@/styles/mixin.scss";
@import './ywsq.scss';

/deep/.el-collapse-item__content {
  padding-bottom: 0;
}

/deep/.el-collapse-item__wrap {
  border-bottom: none;
}
</style>