Blame view

src/views/djbworkflow/components/leftmenu/ordinaryMenu.vue 9.64 KB
1 2 3
<!--
 * @Description: workFrame左侧菜单列表-普通
 * @Autor: renchao
4
 * @LastEditTime: 2023-10-31 10:42:21
5 6 7 8
-->
<template>
  <div class="leftmenu" :class="{ 'animation-map-drawer': isShowdrawer }">
    <div v-if="this.isShowdrawer">
xiaomiao committed
9 10
      <el-menu
        @select="djbClick"
11
        :default-active="activeIndex"
12
        class="title-batch">
xiaomiao committed
13 14
        <el-menu-item index="-1" key="-1" class="menus">
          <div>登记簿</div>
xiaomiao committed
15 16
        </el-menu-item>
      </el-menu>
xiaomiao committed
17 18 19
      <div class="blxx">
        <el-menu
          @select="blxxClick"
20
          class="title-batch">
xiaomiao committed
21 22 23 24
          <el-menu-item index="-1" key="-1" class="menus">
            <div>补录信息</div>
          </el-menu-item>
        </el-menu>
25
        <el-menu v-model="activeIndex" :default-active="activeIndex" @select="unitClick">
xiaomiao committed
26 27 28
          <el-menu-item
            v-for="(item, index) in supplementarylist"
            :index="index.toString()"
29
            :key="index">
30
            <p class="dot" v-if="item.isSave == '0'"></p>
xiaomiao committed
31
            <div>
32
              <p v-if="item.operate=='D'">{{ item.qllxmc }} <span class="tpcolor">(删除)</span></p>
33
              <p v-else>{{ item.qllxmc }} <span class="tpcolor">({{ item.operate=="U"?"编辑":"新增" }})</span></p>
xiaomiao committed
34
              <div class="ywh">(业务号:{{ item.blywh}}</div>
xiaomiao committed
35
            </div>
xiaomiao committed
36
            <i class="el-icon-delete" @click.stop="handleDel(item)" v-if="delel"></i>
xiaomiao committed
37 38 39
          </el-menu-item>
        </el-menu>
      </div>
xiaomiao committed
40
    </div>
xiaomiao committed
41 42 43 44 45 46 47
    <div
      class="map-drawer-click map-drawer"
      v-if="!isShowdrawer"
      @click="
        () => {
          this.isShowdrawer = !this.isShowdrawer;
        }
48
      "></div>
xiaomiao committed
49 50 51 52 53 54 55
    <div
      class="map-drawer-expand map-drawer"
      v-else
      @click="
        () => {
          this.isShowdrawer = !this.isShowdrawer;
        }
56
      "></div>
57 58 59
  </div>
</template>
<script>
60 61 62 63 64 65 66 67 68 69 70 71 72 73
  import { mapGetters } from "vuex";
  import { leftMenu, deleteSlbdcdy } from "@/api/workFlow.js";
  import { deleteRepairRecord } from "@/api/djbRepair.js";
  import { leftMenubl } from "@/api/djbRepair.js";
  import { getBdcqljqtsx } from "@/api/djbDetail.js";
  import { loadTreeData, getNode } from "./djbFrameData.js";
  export default {
    data () {
      return {
        supplementarylist: [],
        //受理申请标识码
        bsmSlsq: this.$route.query.bsmSlsq,
        //当前流程所在环节
        bestepid: this.$route.query.bestepid,
74
        bsmBusiness: this.$route.query.bsmBusiness,
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
        //受理申请标识码
        bdcdyid: this.$route.query.bdcdyid,
        //当前流程所在环节
        bdcdyh: this.$route.query.bdcdyh,
        qllx: this.$route.query.qllx,
        // 默认选中
        activeIndex: "0",
        // 折叠
        isShowdrawer: true,
        delel: true,
        //批量操作按钮名称
        batchButtonName: "",
        //左侧菜单数据集合
        unitData: [],
        // 设置表单传递数据
        currentSelectProps: {},
        //左侧树形结构数据
        treedata: [],
        defaultNode: "",
        defaultProps: {
          value: "id",
          children: "children",
          label: "label",
        },
        showTab: "bdcqldjml", // 选中状态,根据表格中权利类型判断
      };
101
    },
102 103
    mounted () {
      this.delel = this.$parent.isEdit
104
      this.djbClick();
105
    },
106 107
    beforeDestroy () {
      sessionStorage.removeItem('keyPath')
xiaomiao committed
108
    },
109
    methods: {
yuanbo committed
110 111 112 113
      /**
       * @description: 读取申请单元信息
       * @author: renchao
       */
114 115 116 117
      loadBdcdylist () {
        var formdata = new FormData();
        if (this.bsmSlsq) {
          formdata.append("bsmSlsq", this.bsmSlsq);
118 119
          formdata.append("bestepid", this.bestepid ? this.bestepid : '');
          formdata.append("bsmBusiness", this.bsmBusiness ? this.bsmBusiness : '');
120 121 122 123 124
          leftMenu(formdata).then((res) => {
            if (res.code === 200 && res.result) {
              this.currentSelectProps = res.result[0];
              this.$emit("getCurrentSelectProps", this.currentSelectProps);
            }
125
          });
126 127
        }
      },
yuanbo committed
128 129 130 131 132
      /**
       * @description: 获取右侧菜单
       * @param {*} row
       * @author: renchao
       */
133
      getleftMenubl (row) {
134
        let that = this
135 136
        leftMenubl(this.bsmSlsq).then((res) => {
          this.supplementarylist = res.result;
xiaomiao committed
137
          if (row) {
138 139 140
            this.supplementarylist.forEach((item, index) => {
              if (item.bsmRepair == row.bsmRepair) {
                this.activeIndex = index.toString()
141
                this.unitClick(this.activeIndex)
xiaomiao committed
142
              }
143
            })
144 145 146 147 148 149 150 151 152
            // if (row == "change") {
            //   if (sessionStorage.getItem('keyPath') && sessionStorage.getItem('keyPath') >= 0) {
            //     that.unitClick(sessionStorage.getItem('keyPath') - 0)
            //     that.activeIndex = sessionStorage.getItem('keyPath')
            //   } else {
            //     that.unitClick(0)
            //     that.activeIndex = "0"
            //   }
            // }
153
          } else {
154
            if (this.supplementarylist.length) {
155 156 157 158 159
              if (sessionStorage.getItem('keyPath') && sessionStorage.getItem('keyPath') >= 0) {
                that.unitClick(sessionStorage.getItem('keyPath') - 0)
                that.activeIndex = sessionStorage.getItem('keyPath')
              } else {
                that.loadBdcdylist()
160
                that.activeIndex = "-1";
161 162 163
                // that.unitClick(0)
                // that.activeIndex = "0"
              }
164
            } else {
165
              // this.loadBdcdylist()
166
            }
167
          }
168
        })
169
      },
yuanbo committed
170 171 172 173 174 175 176
      /**
       * @description: handleNodeClick
       * @param {*} data
       * @param {*} node
       * @param {*} elem
       * @author: renchao
       */
177 178 179 180
      handleNodeClick (data, node, elem) {
        this.$parent.loadComponent(this.currentSelectProps, data);
        this.$parent.tabset();
      },
yuanbo committed
181 182 183 184 185
      /**
       * @description: 申请单元点击事件
       * @param {*} index
       * @author: renchao
       */
186
      unitClick (index) {
187 188
        this.activeIndex = index.toString();
        sessionStorage.setItem('keyPath', this.activeIndex);
189
        this.currentSelectProps = this.supplementarylist[index];
190
        window.currentSelect = this.supplementarylist[index]
191 192
        this.$emit("getCurrentSelectProps", this.currentSelectProps);
      },
yuanbo committed
193 194 195 196
      /**
       * @description: 登记簿点击事件
       * @author: renchao
       */
197
      djbClick () {
198 199 200
        this.loadBdcdylist()
        window.currentSelect = {}
        this.activeIndex = "-1";
201
        sessionStorage.removeItem('keyPath')
202
      },
yuanbo committed
203 204 205 206 207
      /**
       * @description: 删除补录记录
       * @param {*} row
       * @author: renchao
       */
208
      handleDel (row) {
209
        let that = this
210 211 212 213 214 215 216 217 218 219 220 221
        this.$confirm("此操作将永久删除该条补录记录, 是否继续?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            deleteRepairRecord(row.bsmRepair).then((res) => {
              this.$message({
                type: "success",
                message: "删除成功!",
              });
              this.$nextTick(() => {
222 223 224 225
                if (that.activeIndex != '-1') {
                  this.activeIndex = "0"
                  sessionStorage.setItem('keyPath', '0');
                }
226 227 228 229
                this.getleftMenubl();
                if (!this.supplementarylist.length) {
                  getdjblist()
                }
230 231
              })
            })
232 233 234 235
          })
          .catch(() => {
            this.$message({
              type: "info",
236 237 238
              message: "已取消删除"
            })
          })
239
      },
yuanbo committed
240 241 242 243
      /**
       * @description: 补录信息点击事件默认展示第一条补录记录
       * @author: renchao
       */
244 245
      blxxClick () {
        if (this.supplementarylist.length) {
246
          this.unitClick(0)
247
        }
248 249 250
      }
    }
  }
251
</script>
xiaomiao committed
252
<style scoped lang="scss">
253 254 255 256
  @import "~@/styles/mixin.scss";
  @import "../../workFrame.scss";
  .leftmenu ul {
    height: calc(100vh - 120px);
257
  }
258 259
  /deep/.rollTable {
    height: calc(100vh - 240px) !important;
260 261
  }

262 263 264 265
  .content {
    width: 100%;
    height: 100%;
    display: flex;
266

267 268 269 270 271 272 273
    .left {
      width: 256px;
      height: 704px;
      background-color: #f5f5f5;
      color: #333;
      border: 1px solid rgb(228, 228, 228);
    }
274

275 276 277 278 279 280 281 282 283
    .right {
      width: calc(100% - 256px);
      height: 704px;
      // overflow-y: scroll;
      overflow: auto;
      background-color: #f5f5f5;
      border: 1px solid rgb(228, 228, 228);
    }
  }
284

285 286 287 288
  /deep/ .expanded.el-tree-node__expand-icon,
  /deep/ .el-tree-node__expand-icon {
    visibility: hidden;
  }
289

290 291 292
  /deep/ .el-tree-node__content {
    border: 1px solid rgb(228, 228, 228);
    height: 45px;
xiaomiao committed
293 294
  }

295 296 297 298
  /deep/ .el-tree-node:focus > .el-tree-node__content {
    background-color: #f5f5f5;
    color: #0079fe;
    border-right: 4px solid #0079fe;
xiaomiao committed
299
  }
300 301 302

  /deep/.el-tree-node {
    white-space: pre-wrap;
xiaomiao committed
303 304
  }

305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326
  /deep/ .is-current > .el-tree-node__content {
    background-color: #f5f5f5;
    color: #0079fe;
    border-right: 4px solid #0079fe;
  }
  .menus {
    background-color: #e7f4fe;
    div {
      font-size: 16px;
      font-weight: 600;
    }
  }
  .blxx {
    .el-menu-item {
      display: flex;
      justify-content: space-between;
    }
    border: #b0d9f8 solid 1px;
    .tpcolor {
      color: red;
      line-height: 22px;
    }
327 328
    .ywh {
      font-size: 12px;
xiaomiao committed
329
    }
330
    .el-icon-delete {
xiaomiao committed
331
      margin-top: 10px;
332 333 334 335 336
      margin-right: 3px;
      // background-color: saddlebrown;
      height: 27px;
      float: left;
    }
337
    .el-icon-delete:hover {
xiaomiao committed
338 339
      color: #0079fe;
    }
xiaomiao committed
340
  }
341
</style>