Blame view

src/views/workflow/components/leftmenu/segmentMenu.vue 10.8 KB
1 2 3
<!--
 * @Description: workFrame左侧菜单列表-分割
 * @Autor: renchao
4
 * @LastEditTime: 2023-10-17 10:54:39
5 6 7
-->
<template>
  <div class="leftmenu" :class="{ 'animation-map-drawer': isShowdrawer }">
8
    <el-menu :default-active="activeBatchIndex" @select="batchUnitClick" class="title-batch" v-if="showBatch">
9 10 11 12 13 14
      <el-menu-item index="-1" key="-1" class="menus">
        <div>{{ batchButtonName }}</div>
      </el-menu-item>
    </el-menu>
    <div v-if="this.isShowdrawer">
      <!-- 变更前单元 -->
15
      <div class="title" v-if="aroundShow">
16 17 18 19 20 21
        <b>变更前单元</b>/申请单元列表({{ aroundUnitData.length }})
      </div>
      <el-menu :default-active="activeIndex" @select="unitClick">
        <el-menu-item v-for="(item, index) in aroundUnitData" :index="index.toString()" :key="index">
          <div>
            <p>{{ item.bdcdyh }}</p>
22 23 24
            <el-tooltip effect="dark" :content="item.zl" placement="top">
              <p class="title-detail">{{ item.zl }}</p>
            </el-tooltip>
25
          </div>
26
          <i class="el-icon-delete" v-if="aroundUnitData.length > 1" @click.stop="handleDel(item,'around')"></i>
27 28 29
        </el-menu-item>
      </el-menu>
      <!-- 变更后单元 -->
30
      <div class="title" v-if="afterShow">
31 32 33 34
        <b>变更后单元</b>/申请单元列表({{ afterUnitData.length }})
      </div>
      <el-menu :default-active="activeHIndex" @select="handleAfterunitClick">
        <el-menu-item v-for="(item, index) in afterUnitData" :index="index.toString()" :key="index">
35
          <span class="dot" v-if="item.issave == '0'"></span>
36 37
          <div>
            <p>{{ item.bdcdyh }}</p>
38 39 40
            <el-tooltip effect="dark" :content="item.zl" placement="top">
              <p class="title-detail">{{ item.zl }}</p>
            </el-tooltip>
41
          </div>
42
          <i class="el-icon-delete" v-if="afterUnitData.length > 1" @click.stop="handleDel(item, 'after')"></i>
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
        </el-menu-item>
      </el-menu>
    </div>
    <div class="map-drawer-click map-drawer" v-if="!isShowdrawer" @click="
          () => {
            this.isShowdrawer = !this.isShowdrawer;
          }
        "></div>
    <div class="map-drawer-expand map-drawer" v-else @click="
          () => {
            this.isShowdrawer = !this.isShowdrawer;
          }
        "></div>
  </div>
</template>
<script>
59
  import { mapGetters } from 'vuex'
60
  import { leftMenu, deleteFlow, jdcxLeftMenu } from "@/api/workFlow.js"
61 62 63
  export default {
    data () {
      return {
64 65
        aroundShow: false,
        afterShow: false,
66 67 68
        bsmSlsq: this.$route.query.bsmSlsq,
        bsmBusiness: this.$route.query.bsmBusiness,
        bestepid: this.$route.query.bestepid,
69
        type: this.$route.query.type,
70 71
        // 批量操作
        activeBatchIndex: '0',
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
        // 变更前单元默认选中
        activeIndex: '0',
        // 变更后单元默认选中
        activeHIndex: '-1',
        // 折叠
        isShowdrawer: true,
        // 批量操作
        showBatch: false,
        //批量操作按钮名称
        batchButtonName: '',
        //左侧菜单数据集合-变更前单元
        aroundUnitData: [],
        //左侧菜单数据集合-变更后单元
        afterUnitData: [],
        // 设置表单传递数据
        currentSelectProps: {}
      }
    },
    mounted () {
      this.loadBdcdylist();
    },
93 94 95 96 97 98
    computed: {
      ...mapGetters(['isRefresh'])
    },
    watch: {
      isRefresh: {
        handler (newVal, oldVal) {
99
          if (newVal) this.loadBdcdylist(true)
100 101
        },
        immediate: true
102 103
      }
    },
104
    methods: {
yuanbo committed
105 106 107 108
      /**
       * @description: 读取申请单元信息
       * @author: renchao
       */
109
      loadBdcdylist (status = false) {
110
        let that = this
111
        var formdata = new FormData();
112
        // 受理申请标识码
113
        formdata.append("bsmSlsq", this.$route.query.bsmSlsq);
114 115
        formdata.append("bsmBusiness", this.bsmBusiness ? this.bsmBusiness : '');
        formdata.append("bestepid", this.bestepid ? this.bestepid : '');
116
        if (this.type) {
117 118 119
          jdcxLeftMenu(formdata).then((res) => {
            if (res.code === 200 && res.result) {
              this.aroundUnitData = res.result.filter(item => item.bglx == '1')
120 121 122 123 124
              if (this.aroundUnitData.length > 0) {
                this.aroundShow = true
              } else {
                this.aroundShow = false
              }
125
              this.afterUnitData = res.result.filter(item => item.bglx == '2')
126 127 128 129 130
              if (this.afterUnitData.length > 0) {
                this.afterShow = true
              } else {
                this.afterShow = false
              }
131 132 133
              this.currentSelectProps = res.result[0];
              this.$emit('getCurrentSelectProps', this.currentSelectProps);
              this.judgeBatchShow();
134 135
              if (!status) {
                if (sessionStorage.getItem('keyPath')) {
136 137 138 139 140
                  if (this.aroundShow) {
                    that.unitClick(sessionStorage.getItem('keyPath') - 0)
                  } else {
                    that.handleAfterunitClick(sessionStorage.getItem('keyPath') - 0)
                  }
141
                } else {
142 143 144 145 146
                  if (this.aroundShow) {
                    that.unitClick(0)
                  } else {
                    that.handleAfterunitClick(0)
                  }
147 148 149 150
                  if (that.showBatch) {
                    //满足批量查封/批量抵押按钮出现 即先展示批量表单
                    that.batchUnitClick();
                  }
151
                }
152
              }
153
            }
154 155 156 157 158
          })
        } else {
          leftMenu(formdata).then((res) => {
            if (res.code === 200 && res.result) {
              this.aroundUnitData = res.result.filter(item => item.bglx == '1')
159 160 161 162 163
              if (this.aroundUnitData.length > 0) {
                this.aroundShow = true
              } else {
                this.aroundShow = false
              }
164
              this.afterUnitData = res.result.filter(item => item.bglx == '2')
165 166 167 168 169
              if (this.afterUnitData.length > 0) {
                this.afterShow = true
              } else {
                this.afterShow = false
              }
170 171 172
              this.currentSelectProps = res.result[0];
              this.$emit('getCurrentSelectProps', this.currentSelectProps);
              this.judgeBatchShow();
173 174
              if (!status) {
                if (sessionStorage.getItem('keyPath')) {
175 176 177 178 179
                  if (this.aroundShow) {
                    that.unitClick(sessionStorage.getItem('keyPath') - 0)
                  } else {
                    that.handleAfterunitClick(sessionStorage.getItem('keyPath') - 0)
                  }
180
                } else {
181 182 183 184 185
                  if (this.aroundShow) {
                    that.unitClick(0)
                  } else {
                    that.handleAfterunitClick(0)
                  }
186 187 188 189
                  if (that.showBatch) {
                    //满足批量查封/批量抵押按钮出现 即先展示批量表单
                    that.batchUnitClick();
                  }
190
                }
191 192 193 194
              }
            }
          })
        }
195
      },
yuanbo committed
196 197 198 199
      /**
       * @description: 批量按钮判断
       * @author: renchao
       */
200 201 202
      judgeBatchShow () {
        this.showBatch = false;
        if (this.afterUnitData.length > 1) {
203
          let qllx = this.$route.query?.djywbm?.substring(0, 3);
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218
          switch (qllx) {
            case 'B39':
              this.showBatch = true;
              this.batchButtonName = '批量查封清单信息';
              break;
            case 'A37':
              this.showBatch = true;
              this.batchButtonName = '批量抵押';
              break;
            default:
              this.batchButtonName = '批量操作';
          }
        }
      },
      /**
219
       * @description: 删除左侧列表-变更前
220 221 222
       * @param {*} item
       * @author: renchao
       */
223 224
      handleDel (item, type) {
        let that = this
225 226 227 228 229 230 231 232 233 234 235
        this.$confirm("确定要删除吗, 是否继续?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            var formdata = new FormData();
            formdata.append("bsmSldyList", item.bsmSldy.split(","));
            formdata.append("bsmSlsq", this.bsmSlsq);
            deleteFlow(formdata).then((res) => {
              if (res.code == 200) {
236 237 238 239 240 241 242 243 244
                that.$message.success("删除成功");
                that.loadBdcdylist()
                if (type == 'around') {
                  that.activeIndex = '0'
                  sessionStorage.setItem('keyPath', '0');
                } else {
                  that.activeIndex = '0'
                  sessionStorage.setItem('keyPath', '0');
                }
245 246 247 248 249 250 251 252
              } else {
                this.$message.error(res.message);
              }
            });
          })
          .catch(() => {
            this.$message({
              type: "info",
253 254 255
              message: "已取消删除"
            })
          })
256
      },
yuanbo committed
257 258 259 260
      /**
       * @description: 批量按钮点击事件
       * @author: renchao
       */
261
      batchUnitClick () {
262
        window.currentSelect = {}
263 264 265 266 267
        this.currentSelectProps.batchOperation = true
        this.activeIndex = "-1"
        this.activeHIndex = "-1"
        this.activeBatchIndex = "0"
        this.$parent.stepForm(0)
268
      },
yuanbo committed
269
      /**
270
       * @description: 申请单元点击事件-变更前
yuanbo committed
271 272 273
       * @param {*} index
       * @author: renchao
       */
274
      unitClick (index) {
275
        this.activeBatchIndex = "-1"
renchao@pashanhoo.com committed
276
        window.currentSelect = this.aroundUnitData[index]
277 278
        this.activeHIndex = '-1'
        this.currentSelectProps = this.aroundUnitData[index];
279
        this.currentSelectProps.issave = '1'
280 281
        this.currentSelectProps.batchOperation = false;
        this.activeIndex = index.toString();
282
        sessionStorage.setItem('keyPath', this.activeIndex);
283 284
        //选中表单传递数据
        this.$emit('getCurrentSelectProps', this.currentSelectProps);
285 286
        this.$parent.stepForm(index);
      },
yuanbo committed
287
      /**
renchao@pashanhoo.com committed
288
       * @description: 变更后单元
yuanbo committed
289 290 291
       * @param {*} index
       * @author: renchao
       */
292
      handleAfterunitClick (index) {
293
        this.activeBatchIndex = "-1"
renchao@pashanhoo.com committed
294
        window.currentSelect = this.afterUnitData[index]
295 296 297 298
        this.activeIndex = '-1'
        this.currentSelectProps = this.afterUnitData[index];
        this.currentSelectProps.batchOperation = false;
        this.activeHIndex = index.toString();
299
        sessionStorage.setItem('keyPath', this.activeHIndex);
300 301
        //选中表单传递数据
        this.$emit('getCurrentSelectProps', this.currentSelectProps);
302
        this.$parent.stepForm(index);
303
        this.$store.dispatch('user/refreshPage', false);
304 305 306 307 308 309 310
      }
    }
  }
</script>
<style scoped lang='scss'>
  @import "~@/styles/mixin.scss";
  @import "../../workFrame.scss";
311
</style>