Blame view

src/views/djbworkflow/components/leftmenu/ordinaryMenu.vue 8.76 KB
1 2 3
<!--
 * @Description: workFrame左侧菜单列表-普通
 * @Autor: renchao
4
 * @LastEditTime: 2023-07-17 16:16:13
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
        class="title-batch">
xiaomiao committed
12 13
        <el-menu-item index="-1" key="-1" class="menus">
          <div>登记簿</div>
xiaomiao committed
14 15
        </el-menu-item>
      </el-menu>
xiaomiao committed
16 17 18
      <div class="blxx">
        <el-menu
          @select="blxxClick"
19
          class="title-batch">
xiaomiao committed
20 21 22 23 24 25 26 27
          <el-menu-item index="-1" key="-1" class="menus">
            <div>补录信息</div>
          </el-menu-item>
        </el-menu>
        <el-menu :default-active="activeIndex" @select="unitClick">
          <el-menu-item
            v-for="(item, index) in supplementarylist"
            :index="index.toString()"
28
            :key="index">
xiaomiao committed
29
            <div>
30
              <p v-if="item.operate=='D'">{{ item.qllxmc }} <span class="tpcolor">(删除)</span></p>
31
              <p v-else>{{ item.qllxmc }} <span class="tpcolor">({{ item.operate=="U"?"编辑":"新增" }})</span></p>
xiaomiao committed
32
              <div class="ywh">(业务号:{{ item.blywh}}</div>
xiaomiao committed
33
            </div>
xiaomiao committed
34
            <i class="el-icon-delete" @click.stop="handleDel(item)" v-if="delel"></i>
xiaomiao committed
35 36 37
          </el-menu-item>
        </el-menu>
      </div>
xiaomiao committed
38
    </div>
xiaomiao committed
39 40 41 42 43 44 45
    <div
      class="map-drawer-click map-drawer"
      v-if="!isShowdrawer"
      @click="
        () => {
          this.isShowdrawer = !this.isShowdrawer;
        }
46
      "></div>
xiaomiao committed
47 48 49 50 51 52 53
    <div
      class="map-drawer-expand map-drawer"
      v-else
      @click="
        () => {
          this.isShowdrawer = !this.isShowdrawer;
        }
54
      "></div>
55 56 57
  </div>
</template>
<script>
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
  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,
        //受理申请标识码
        bdcdyid: this.$route.query.bdcdyid,
        //当前流程所在环节
        bdcdyh: this.$route.query.bdcdyh,
        qllx: this.$route.query.qllx,
        // 默认选中
        activeIndex: "0",
xiaomiao committed
79
        clickindex:"",
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
        // 折叠
        isShowdrawer: true,
        delel: true,
        //批量操作按钮名称
        batchButtonName: "",
        //左侧菜单数据集合
        unitData: [],
        // 设置表单传递数据
        currentSelectProps: {},
        //左侧树形结构数据
        treedata: [],
        defaultNode: "",
        defaultProps: {
          value: "id",
          children: "children",
          label: "label",
        },
        showTab: "bdcqldjml", // 选中状态,根据表格中权利类型判断
      };
99
    },
100 101 102
    mounted () {
      this.delel = this.$parent.isEdit
      this.loadBdcdylist();
103
    },
104 105
    computed: {
      // ...mapGetters(["isRefresh"]),
xiaomiao committed
106
    },
107 108 109 110 111 112 113
    watch: {
      // isRefresh: {
      //   handler(newVal, oldVal) {
      //     if (newVal) this.loadBdcdylist();
      //   },
      //   immediate: true,
      // },
xiaomiao committed
114
    },
115 116
    methods: {
      //读取申请单元信息
yuanbo committed
117 118 119 120
      /**
       * @description: 读取申请单元信息
       * @author: renchao
       */
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
      loadBdcdylist () {
        var formdata = new FormData();
        if (this.bsmSlsq) {
          formdata.append("bsmSlsq", this.bsmSlsq);
          formdata.append("bestepid", this.bestepid);
          leftMenu(formdata).then((res) => {
            if (res.code === 200 && res.result) {
              this.currentSelectProps = res.result[0];
              this.$emit("getCurrentSelectProps", this.currentSelectProps);
            }
          });
        }


      },
      // 获取右侧菜单
yuanbo committed
137 138 139 140 141
      /**
       * @description: 获取右侧菜单
       * @param {*} row
       * @author: renchao
       */
142 143 144
      getleftMenubl (row) {
        leftMenubl(this.bsmSlsq).then((res) => {
          this.supplementarylist = res.result;
xiaomiao committed
145
          if (row) {
146 147 148 149 150
            this.supplementarylist.forEach((item, index) => {
              if (item.bsmRepair == row.bsmRepair) {
                this.activeIndex = index.toString()
                // 补录成功后定位到该条记录
                this.unitClick(index)
xiaomiao committed
151
              }
152
            })
xiaomiao committed
153 154 155 156
            if(row=="change"){
              this.unitClick(this.clickindex)

            }
xiaomiao committed
157 158
          }else{
             if (this.supplementarylist.length) {
159
            this.unitClick(0)
xiaomiao committed
160
             this.activeIndex = "0"
161
          } else {
xiaomiao committed
162 163
            this.loadBdcdylist()
            // this.$emit("getCurrentSelectProps", this.currentSelectProps);
164
          }
xiaomiao committed
165 166 167 168 169 170

       }




171 172
        });
      },
yuanbo committed
173 174 175 176 177 178 179
      /**
       * @description: handleNodeClick
       * @param {*} data
       * @param {*} node
       * @param {*} elem
       * @author: renchao
       */
180 181 182 183 184
      handleNodeClick (data, node, elem) {
        this.$parent.loadComponent(this.currentSelectProps, data);
        this.$parent.tabset();
      },
      //申请单元点击事件
yuanbo committed
185 186 187 188 189
      /**
       * @description: 申请单元点击事件
       * @param {*} index
       * @author: renchao
       */
190
      unitClick (index) {
xiaomiao committed
191
         this.clickindex=index
192 193 194 195
        this.currentSelectProps = this.supplementarylist[index];
        this.$emit("getCurrentSelectProps", this.currentSelectProps);
      },
      //登记簿点击事件
yuanbo committed
196 197 198 199
      /**
       * @description: 登记簿点击事件
       * @author: renchao
       */
200 201 202 203
      djbClick () {
        this.loadBdcdylist();
      },
      // 删除补录记录
yuanbo committed
204 205 206 207 208
      /**
       * @description: 删除补录记录
       * @param {*} row
       * @author: renchao
       */
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225
      handleDel (row) {
        this.$confirm("此操作将永久删除该条补录记录, 是否继续?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            deleteRepairRecord(row.bsmRepair).then((res) => {
              this.$message({
                type: "success",
                message: "删除成功!",
              });
              this.$nextTick(() => {
                this.getleftMenubl();
                if (!this.supplementarylist.length) {
                  getdjblist()
                }
xiaomiao committed
226

227 228 229 230 231 232 233
              });
            });
          })
          .catch(() => {
            this.$message({
              type: "info",
              message: "已取消删除",
xiaomiao committed
234 235
            });
          });
236 237
      },
      //补录信息点击事件默认展示第一条补录记录
yuanbo committed
238 239 240 241
      /**
       * @description: 补录信息点击事件默认展示第一条补录记录
       * @author: renchao
       */
242 243 244 245
      blxxClick () {
        if (this.supplementarylist.length) {
          this.unitClick(0);
        }
xiaomiao committed
246

247
      },
xiaomiao committed
248
    },
249
  };
250
</script>
xiaomiao committed
251
<style scoped lang="scss">
252 253 254 255
  @import "~@/styles/mixin.scss";
  @import "../../workFrame.scss";
  .leftmenu ul {
    height: calc(100vh - 120px);
256
  }
257 258
  /deep/.rollTable {
    height: calc(100vh - 240px) !important;
259 260
  }

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

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

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

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

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

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

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

304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325
  /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;
    }
xiaomiao committed
326 327 328
    .ywh{
    font-size: 12px;
    }
329
    .el-icon-delete {
xiaomiao committed
330
      margin-top: 10px;
331 332 333 334 335
      margin-right: 3px;
      // background-color: saddlebrown;
      height: 27px;
      float: left;
    }
xiaomiao committed
336 337 338
    .el-icon-delete:hover{
      color: #0079fe;
    }
xiaomiao committed
339
  }
340
</style>