Blame view

src/views/djbworkflow/workFrame.vue 6.36 KB
1 2 3 4 5 6 7 8 9 10
<!--
 * @Description:
 * @Autor: renchao
 * @LastEditTime: 2023-05-24 15:31:00
-->
<template>
  <div class="container">
    <!-- 顶部内容框 -->
    <div class="topButton">
      <!-- 左侧业务功能按钮 -->
xiaomiao committed
11 12 13 14 15 16
      <ul>
        <li
          @click="operation(item)"
          v-for="(item, index) in leftButtonList"
          :key="index"
        >
17 18 19 20 21
          <svg-icon class="icon" :icon-class="item.icon" />
          <span class="iconName">{{ item.name }}</span>
        </li>
      </ul>
      <ul>
xiaomiao committed
22 23 24 25 26
        <li
          @click="operation(item)"
          v-for="(item, index) in rightButtonList"
          :key="index"
        >
27 28 29 30
          <svg-icon class="icon" :icon-class="item.icon" />
          <span class="iconName">{{ item.name }}</span>
        </li>
      </ul>
xiaomiao committed
31 32 33 34 35
      <NoticeBar
        class="NoticeBar"
        :noticeList="noticeList"
        v-if="noticeList.length > 0"
      />
36 37 38 39 40 41 42 43 44 45 46 47 48
    </div>
    <!-- 内容框架 -->
    <div class="containerFrame">
      <!-- 左侧菜单栏 区分业务-->
      <ordinaryMenu @getCurrentSelectProps="getCurrentSelectProps" />
      <div class="leftCon">
        <!-- 分屏左侧预览 -->
        <div v-if="splitScreen" class="splitScreen-con">
          <component :is="clxxForm" v-bind="currentSelectProps" :key="fresh" />
        </div>
        <!-- 表单内容区域 -->
        <div class="rightContainer">
          <el-tabs v-model="tabName" :before-leave="beforeLeave">
xiaomiao committed
49 50 51 52 53 54
            <el-tab-pane
              :label="item.name"
              :name="item.value"
              v-for="item in tabList"
              :key="item.value"
            >
55 56
            </el-tab-pane>
          </el-tabs>
xiaomiao committed
57 58 59 60 61
          <component
            :key="fresh"
            :is="componentTag"
            v-bind="currentSelectProps"
          />
62 63 64 65 66 67
        </div>
      </div>
    </div>
  </div>
</template>
<style scoped lang="scss">
xiaomiao committed
68 69
@import "~@/styles/mixin.scss";
@import "./workFrame.scss";
70 71
</style>
<script>
xiaomiao committed
72 73 74 75 76 77 78 79 80 81 82
import WorkFlow from "./mixin/index";
import publicFlow from "./mixin/public.js";
// import { getStepFormInfo } from "@/api/fqsq.js"
// import { getForm } from "./flowform"
import NoticeBar from "@/components/NoticeBar/index";
import { unClaimTask } from "@/api/ywbl.js";
import ProcessViewer from "./components/processViewer.vue";
// 引入左侧菜单
import ordinaryMenu from "./components/leftmenu/ordinaryMenu.vue";
import selectBdc from "@/views/ywbl/ywsq/selectBdc.vue";
import { loadTreeData, getNode } from "./components/leftmenu/djbFrameData";
83 84
// 登记簿数据信息

xiaomiao committed
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
import { getBdcqljqtsx } from "@/api/registerBook.js";
export default {
  components: {
    selectBdc,
    NoticeBar,
    ProcessViewer,
    ordinaryMenu,
  },
  mixins: [WorkFlow, publicFlow],
  data() {
    return {
      isDialog: false,
      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,
      //设置那个表单选中
      tabName: "",
      //设置那个表单选择
      currentSelectTab: {},
      //表单集合
      tabList: [],
      //选择加载哪一个组件
      componentTag: "",
      //设置表单传递数据
      currentSelectProps: {},
      //材料分屏表单
      clxxForm: "",
      //材料信息选择卡索引
      clxxIndex: "",
      //材料信息选项卡对象
      clxxTab: {},
      //页面监听时间
      _beforeUnload_time: "",
    };
  },
  mounted() {
    this.$store.dispatch("user/refreshPage", false);
    //添加页面监听事件
    window.addEventListener("beforeunload", (e) => this.beforeunloadHandler(e));
    window.addEventListener("unload", (e) => this.unloadHandler(e));
  this.tabset()
  },
  destroyed() {

    window.removeEventListener("beforeunload", (e) =>
      this.beforeunloadHandler(e)
    );
    window.removeEventListener("unload", (e) => this.unloadHandler(e));
  },
  methods: {
    getCurrentSelectProps(val) {
      // this.loadData();
142
    },
xiaomiao committed
143 144 145

    beforeunloadHandler() {
      this._beforeUnload_time = new Date().getTime();
146
    },
xiaomiao committed
147 148 149 150 151 152 153
    unloadHandler(e) {
      this._gap_time = new Date().getTime() - this._beforeUnload_time;
      //判断是窗口关闭还是刷新
      if (this._gap_time <= 10) {
        //取消认领
        unClaimTask(this.bsmSlsq, this.bestepid);
      }
154
    },
xiaomiao committed
155 156 157 158 159 160 161 162 163 164 165 166 167 168
    tabset(){
     this.tabList = [
          {
            name: "受理情况",
            value: "plfdcq2",
            sort: 1,
          },
          {
            name: "材料信息",
            value: "clxx",
            sort: 2,
          },
        ];
        this.tabName = 'plfdcq2';
169 170
    },

xiaomiao committed
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198
    // 获取登记簿菜单
    // loadData() {
    //   getBdcqljqtsx({
    //     bdcdyid: this.bdcdyid,
    //     bdcdyh: this.bdcdyh,
    //   }).then((res) => {
    //     if (res.code === 200) {
    //       this.treedata = loadTreeData(res.result, this.bdcdyh);
    //       this.$nextTick(function () {
    //         this.defaultNode = getNode(
    //           this.qllx,
    //           { linShi: 0, xianShi: 0, liShi: 0 },
    //           ""
    //         );
    //         this.$refs.tree.setCurrentKey(this.defaultNode.id); //data[0].id为默认选中的节点
    //         // this.$parent.loadComponent(this.currentSelectProps,this.defaultNode);
    //       });
    //     }

    //   });
    //   this.currentSelectProps = {
    //     bdcdyid: this.bdcdyid,
    //     bdcdyh: this.bdcdyh,
    //     qllx: this.qllx,
    //     bsmQlxx: this.bsmQlxx,
    //   };
    //   // this.$parent.stepForm();
    // },
199

xiaomiao committed
200 201 202 203
    loadComponent(currentSelectProps, data) {
       this.tabset()
      this.currentSelectProps = currentSelectProps;
      this.componentTag = (r) =>
204
        require.ensure([], () => r(require("@/views/djbBook/" + data.form)));
xiaomiao committed
205

206
    },
xiaomiao committed
207 208 209 210 211 212 213 214 215
    // openDialog() {
    //   this.$store.dispatch("user/refreshPage", false);
    //   let data = JSON.parse(localStorage.getItem("ywbl"));
    //   let title;
    //   if (data?.sqywmc) {
    //     title = "申请业务:" + data?.sqywmc;
    //   } else {
    //     title = "申请业务:" + data?.djywmc;
    //   }
216

xiaomiao committed
217 218 219 220 221 222 223 224 225 226
    //   this.$popupDialog(
    //     title,
    //     "ywbl/ywsq/selectBdc",
    //     { djywbm: this.$route.query.sqywbm, isJump: true, sqywInfo: data },
    //     "80%",
    //     true
    //   );
    // },
  },
};
227
</script>