Blame view

src/views/workflow/workFrame.vue 7.86 KB
1
<!--
2
 * @Description:
3
 * @Autor: renchao
4
 * @LastEditTime: 2023-08-09 14:54:20
5
-->
任超 committed
6 7 8 9 10 11
<template>
  <div class="container">
    <!-- 顶部内容框 -->
    <div class="topButton">
      <!-- 左侧业务功能按钮 -->
      <ul>
12
        <li @click="operation(item)" v-for="(item, index) in leftButtonList" :key="index">
任超 committed
13 14 15 16 17 18
          <svg-icon class="icon" :icon-class="item.icon" />
          <span class="iconName">{{ item.name }}</span>
        </li>
      </ul>
      <!-- 右侧流程按钮 -->
      <ul>
19
        <li @click="operation(item)" v-for="(item, index) in rightButtonList" :key="index">
任超 committed
20 21 22 23
          <svg-icon class="icon" :icon-class="item.icon" />
          <span class="iconName">{{ item.name }}</span>
        </li>
      </ul>
24
      <NoticeBar class="NoticeBar" :noticeList="noticeList" v-if="noticeList.length > 0" />
任超 committed
25 26 27
    </div>
    <!-- 内容框架 -->
    <div class="containerFrame">
28
      <!-- 左侧菜单栏 区分业务-->
29
      <segmentMenu v-if="['A0320099','A0330099' ].includes(slsq.djqxbm)" @getCurrentSelectProps="getCurrentSelectProps" />
30
      <ordinaryMenu v-else @getCurrentSelectProps="getCurrentSelectProps" />
任超 committed
31 32 33 34 35 36 37
      <div class="leftCon">
        <!-- 分屏左侧预览 -->
        <div v-if="splitScreen" class="splitScreen-con">
          <component :is="clxxForm" v-bind="currentSelectProps" :key="fresh" />
        </div>
        <!-- 表单内容区域 -->
        <div class="rightContainer">
38
          <div class="count">
xiaomiao committed
39 40 41
            当前流程所在环节:
            <span>{{ this.zbhj }}</span>
          </div>
xiaomiao committed
42
          <el-tabs v-model="tabName" :before-leave="beforeLeave" @tab-click="handleClick">
43
            <el-tab-pane :label="item.name" :name="item.value" v-for="item in tabList" :key="item.value">
任超 committed
44 45
            </el-tab-pane>
          </el-tabs>
46
          <component :key="fresh" :is="componentTag" v-bind="currentSelectProps" />
任超 committed
47 48 49
        </div>
      </div>
    </div>
蔡俊立 committed
50
    <!-- 打印模板需要此模块 -->
51 52
    <object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" v-show="false">
      <embed id="LODOP_EM" type="application/x-print-lodop" width="820" height="450" pluginspage="install_lodop32.exe" />
53
    </object>
54 55 56
    <el-upload class="fileUpdate" action="" :show-file-list="false" multiple :auto-upload="false"
      :on-change="handleChange" :before-upload="beforeUpload">
      <el-button id="cldr" icon="el-icon-upload" type="primary" v-show="false">上传</el-button>
57
    </el-upload>
任超 committed
58 59
  </div>
</template>
60
<style scoped lang="scss">
61 62
  @import "~@/styles/mixin.scss";
  @import "./workFrame.scss";
任超 committed
63 64
</style>
<script>
65 66
  import WorkFlow from "./mixin/index"
  import publicFlow from "./mixin/public.js"
67
  import { getStepFormInfo, unClaimTask, getZdInfo } from "@/api/workFlow.js"
68 69
  import { getForm } from "./flowform"
  import NoticeBar from "@/components/NoticeBar/index"
xiaomiao committed
70
  // import ProcessViewer from "./components/processViewer.vue"
71 72 73 74 75
  // 引入左侧菜单
  import ordinaryMenu from "./components/leftmenu/ordinaryMenu.vue"
  // 引入左侧菜单
  import segmentMenu from "./components/leftmenu/segmentMenu.vue"
  import selectBdc from "@/views/ywbl/ywsq/selectBdc.vue"
76 77 78 79
  export default {
    components: {
      selectBdc,
      NoticeBar,
80 81
      ordinaryMenu,
      segmentMenu
任超 committed
82
    },
83 84 85 86 87 88 89 90
    mixins: [WorkFlow, publicFlow],
    data () {
      return {
        isDialog: false,
        //受理申请标识码
        bsmSlsq: this.$route.query.bsmSlsq,
        //当前流程所在环节
        bestepid: this.$route.query.bestepid,
xiaomiao committed
91 92
        //当前流程所在环节
        zbhj: this.$route.query.zbhj,
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
        //设置那个表单选中
        tabName: "",
        //设置那个表单选择
        currentSelectTab: {},
        //表单集合
        tabList: [],
        //选择加载哪一个组件
        componentTag: "",
        //设置表单传递数据
        currentSelectProps: {},
        //材料分屏表单
        clxxForm: "",
        //材料信息选择卡索引
        clxxIndex: "",
        //材料信息选项卡对象
        clxxTab: {},
109
        ableOperation: false,
110
        //页面监听时间
111 112 113
        _beforeUnload_time: "",
        // 宗地id
        bsmZd: ''
114
      }
任超 committed
115
    },
116
    mounted () {
117
      this.$store.dispatch('user/refreshPage', false);
118 119 120
      //添加页面监听事件
      window.addEventListener("beforeunload", (e) => this.beforeunloadHandler(e));
      window.addEventListener("unload", (e) => this.unloadHandler(e));
任超 committed
121
    },
122 123 124 125 126
    destroyed () {
      window.removeEventListener("beforeunload", (e) =>
        this.beforeunloadHandler(e)
      );
      window.removeEventListener("unload", (e) => this.unloadHandler(e));
任超 committed
127
    },
128
    methods: {
yuanbo committed
129 130 131 132 133
      /**
       * @description: getCurrentSelectProps
       * @param {*} val
       * @author: renchao
       */
134
      getCurrentSelectProps (val) {
135
        console.log(val, 'valvalvalval');
136
        this.currentSelectProps = val
137 138 139
        getZdInfo(val.bdcdyid).then(res => {
          this.bsmZd = res?.result[0]?.bsmZd
        })
140
      },
yuanbo committed
141 142 143 144
      /**
       * @description: beforeunloadHandler
       * @author: renchao
       */
145 146 147
      beforeunloadHandler () {
        this._beforeUnload_time = new Date().getTime();
      },
yuanbo committed
148 149 150 151 152
      /**
       * @description: unloadHandler
       * @param {*} e
       * @author: renchao
       */
153 154 155 156 157 158 159 160 161
      unloadHandler (e) {
        this._gap_time = new Date().getTime() - this._beforeUnload_time;
        //判断是窗口关闭还是刷新
        if (this._gap_time <= 10) {
          //取消认领
          unClaimTask(this.bsmSlsq, this.bestepid);
        }
      },
      //申请单元点击事件
yuanbo committed
162 163 164 165 166
      /**
       * @description: 申请单元点击事件
       * @param {*} index
       * @author: renchao
       */
167 168 169 170 171 172 173
      stepForm (index) {
        getStepFormInfo(this.currentSelectProps).then((res) => {
          if (res.code === 200) {
            this.fresh++;
            //获取单元对应的所有表单信息
            this.tabList = res.result;
            //默认加载第一个表单信息
174 175 176 177 178 179
            let arr = res.result.filter(item => item.defaultForm)
            if (arr.length > 0) {
              this.tabName = arr[0].value;
            } else {
              this.tabName = res.result[0].value;
            }
180
            this.ableOperation = this.tabList[0].ableOperation
181 182 183 184
            //批量操作无分屏按钮
            if (index != null) {
              //处理分屏材料信息
              let that = this;
xiaomiao committed
185

186 187 188 189 190 191
              this.tabList.forEach(function (item, index) {
                if (item.value == "clxx") {
                  that.clxxIndex = index;
                  that.clxxForm = getForm(item.value, that.$route.query.sqywbm);
                  that.clxxTab = item;
                }
192
              })
193
            }
蔡俊立 committed
194
          }
195
        })
196
      },
yuanbo committed
197 198 199 200
      /**
       * @description: openDialog
       * @author: renchao
       */
201 202 203 204 205 206 207 208
      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
任超 committed
209
        }
210

211
        this.$popupDialog(title, "ywbl/ywsq/selectBdc", { 'djywbm': this.$route.query.sqywbm, 'isJump': true, 'sqywInfo': data }, "80%", true)
xiaomiao committed
212
      },
213 214 215 216 217 218 219 220 221 222 223 224 225 226
      //选项卡切换事件
      /**
       * @description: 右侧表单选项卡事件
       * @param {*} handleClick
       * @author: renchao
       */
      handleClick (a) {
        let p = Object.keys(this.tabList[0]).filter(
          (item) => item == "ableOperation"
        );
        if (p) {
          this.ableOperation = this.tabList[a.index].ableOperation;
        }
      },
227 228
    }
  }
任超 committed
229
</script>
xiaomiao committed
230
<style scoped lang="scss">
231 232 233 234 235 236 237 238 239 240 241 242 243
  .rightContainer {
    position: relative;
  }
  .count {
    font-size: 14px;
    position: absolute;
    right: 25px;
    top: 12px;
    height: 30px;
    span {
      font-weight: 600;
      color: #3498db;
    }
xiaomiao committed
244 245
  }
</style>