Blame view

src/views/workflow/workFrame.vue 9.25 KB
1
<!--
2
 * @Description:
3
 * @Autor: renchao
4
 * @LastEditTime: 2023-10-08 14:48:23
5
-->
任超 committed
6 7 8 9 10 11
<template>
  <div class="container">
    <!-- 顶部内容框 -->
    <div class="topButton">
      <!-- 左侧业务功能按钮 -->
      <ul>
xiaomiao committed
12 13 14 15 16 17 18 19 20
        <li v-for="(item, index) in leftButtonList" :key="index">
          <div v-if="item.value == 'B10'" @click="openPrint()">
            <svg-icon class="icon" :icon-class="item.icon" />
            <span class="iconName">{{ item.name }}</span>
          </div>
          <div v-else @click="operation(item)">
            <svg-icon class="icon" :icon-class="item.icon" />
            <span class="iconName">{{ item.name }}</span>
          </div>
任超 committed
21 22 23 24
        </li>
      </ul>
      <!-- 右侧流程按钮 -->
      <ul>
xiaomiao committed
25 26 27
        <li
          @click="operation(item)"
          v-for="(item, index) in rightButtonList"
renchao@pashanhoo.com committed
28
          :key="index">
任超 committed
29 30 31 32
          <svg-icon class="icon" :icon-class="item.icon" />
          <span class="iconName">{{ item.name }}</span>
        </li>
      </ul>
xiaomiao committed
33 34 35
      <NoticeBar
        class="NoticeBar"
        :noticeList="noticeList"
renchao@pashanhoo.com committed
36
        v-if="noticeList.length > 0" />
任超 committed
37 38 39
    </div>
    <!-- 内容框架 -->
    <div class="containerFrame">
40
      <!-- 左侧菜单栏 区分业务-->
1  
renchao@pashanhoo.com committed
41
      <segmentMenu v-if="['A0320099', 'A0330099'].includes(slsq.djqxbm)"
renchao@pashanhoo.com committed
42
        @getCurrentSelectProps="getCurrentSelectProps" />
43
      <ordinaryMenu v-else @getCurrentSelectProps="getCurrentSelectProps" />
任超 committed
44 45 46 47 48 49 50
      <div class="leftCon">
        <!-- 分屏左侧预览 -->
        <div v-if="splitScreen" class="splitScreen-con">
          <component :is="clxxForm" v-bind="currentSelectProps" :key="fresh" />
        </div>
        <!-- 表单内容区域 -->
        <div class="rightContainer">
51
          <div class="count">
xiaomiao committed
52
            当前流程所在环节:
53
            <span>{{ $route.query.zbhj }}</span>
xiaomiao committed
54
          </div>
xiaomiao committed
55 56 57
          <el-tabs
            v-model="tabName"
            :before-leave="beforeLeave"
renchao@pashanhoo.com committed
58
            @tab-click="handleClick">
xiaomiao committed
59 60 61 62
            <el-tab-pane
              :label="item.name"
              :name="item.value"
              v-for="item in tabList"
renchao@pashanhoo.com committed
63
              :key="item.value">
任超 committed
64 65
            </el-tab-pane>
          </el-tabs>
xiaomiao committed
66
          <div v-show="false">
renchao@pashanhoo.com committed
67 68 69
            <div v-if="shows">
              <receipt :Receiptdata="Receiptdata" id="boxaaa" />
            </div>
xiaomiao committed
70 71 72 73
          </div>
          <component
            :key="fresh"
            :is="componentTag"
renchao@pashanhoo.com committed
74
            v-bind="currentSelectProps" />
任超 committed
75 76 77
        </div>
      </div>
    </div>
蔡俊立 committed
78
    <!-- 打印模板需要此模块 -->
xiaomiao committed
79 80 81
    <object
      id="LODOP_OB"
      classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA"
renchao@pashanhoo.com committed
82
      v-show="false">
xiaomiao committed
83 84 85 86 87
      <embed
        id="LODOP_EM"
        type="application/x-print-lodop"
        width="820"
        height="450"
renchao@pashanhoo.com committed
88
        pluginspage="install_lodop32.exe" />
89
    </object>
xiaomiao committed
90 91 92 93 94 95 96
    <el-upload
      class="fileUpdate"
      action=""
      :show-file-list="false"
      multiple
      :auto-upload="false"
      :on-change="handleChange"
renchao@pashanhoo.com committed
97 98
      :before-upload="beforeUpload">
      <el-button id="cldr" icon="el-icon-upload" type="primary" v-show="false">上传</el-button>
99
    </el-upload>
任超 committed
100 101
  </div>
</template>
102
<style scoped lang="scss">
renchao@pashanhoo.com committed
103 104
  @import "~@/styles/mixin.scss";
  @import "./workFrame.scss";
任超 committed
105 106
</style>
<script>
renchao@pashanhoo.com committed
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 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
  import printJS from 'print-js'
  import WorkFlow from "./mixin/index";
  import publicFlow from "./mixin/public.js";
  import { getStepFormInfo, unClaimTask, getZdInfo } from "@/api/workFlow.js";
  import { getForm } from "./flowform";
  import NoticeBar from "@/components/NoticeBar/index";
  // import ProcessViewer from "./components/processViewer.vue"
  // 引入左侧菜单
  import ordinaryMenu from "./components/leftmenu/ordinaryMenu.vue";
  // 引入左侧菜单
  import segmentMenu from "./components/leftmenu/segmentMenu.vue";
  // 回执单
  import receipt from "./components/receipt.vue";
  import selectBdc from "@/views/ywbl/ywsq/selectBdc.vue";
  import { BatchInit } from "@/api/workflow/cfdjFlow.js";
  export default {
    components: {
      selectBdc,
      NoticeBar,
      ordinaryMenu,
      segmentMenu,
      receipt,
    },
    mixins: [WorkFlow, publicFlow],
    data () {
      return {
        //受理申请标识码
        bsmSlsq: this.$route.query.bsmSlsq,
        //当前流程所在环节
        bestepid: this.$route.query.bestepid,
        //当前流程所在环节
        zbhj: this.$route.query.zbhj,
        //设置那个表单选中
        tabName: "",
        //设置那个表单选择
        currentSelectTab: {},
        //表单集合
        tabList: [],
        //选择加载哪一个组件
        componentTag: "",
        //设置表单传递数据
        currentSelectProps: {},
        //材料分屏表单
        clxxForm: "",
        //材料信息选择卡索引
        clxxIndex: "",
        //材料信息选项卡对象
        clxxTab: {},
        ableOperation: false,
        //页面监听时间
        _beforeUnload_time: "",
        // 宗地id
        bsmZd: "",
        Receiptdata: {},
        shows: false
162
      }
renchao@pashanhoo.com committed
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
    },
    mounted () {
      this.$store.dispatch("user/refreshPage", false);
      //添加页面监听事件
      window.addEventListener("beforeunload", (e) => this.beforeunloadHandler(e));
      window.addEventListener("unload", (e) => this.unloadHandler(e));
    },
    destroyed () {
      window.removeEventListener("beforeunload", (e) =>
        this.beforeunloadHandler(e)
      );
      window.removeEventListener("unload", (e) => this.unloadHandler(e));
    },
    methods: {
      openPrint () {
xiaomiao committed
178
        //  获取打印回执数据
renchao@pashanhoo.com committed
179 180
        var formdata = new FormData();
        formdata.append("bsmSldy", this.currentSelectProps.bsmSldy);
181
        formdata.append("bsmSlsq", this.$route.query.bsmSlsq);
renchao@pashanhoo.com committed
182 183 184 185 186 187 188 189
        formdata.append("djlx", this.currentSelectProps.djlx);
        BatchInit(formdata).then((res) => {
          if (res.code === 200 && res.result) {
            this.Receiptdata = res.result
            this.shows = true
            setTimeout(() => {
              this.prinsss()
            }, 100)
190
          } else {
191
            this.$message.error(res.message)
renchao@pashanhoo.com committed
192 193 194 195 196 197 198 199 200 201
          }
        })
      },
      prinsss () {
        printJS({
          printable: "boxaaa", // // 文档来源:pdf或图像的url,html元素的id或json数据的对象
          type: "html",
          maxWidth: 800, // 最大宽度
          font_size: "", // 不设置则使用默认字体大小
          style: `@font-face {
xiaomiao committed
202 203 204
          font-family: "STZHONGS";
          src: url(${window.ttf}) format("truetype");
        }`,
renchao@pashanhoo.com committed
205 206
          // 继承原来的所有样式
          targetStyles: ["*"]
207
        })
renchao@pashanhoo.com committed
208 209 210 211 212 213 214
      },
      /**
       * @description: getCurrentSelectProps
       * @param {*} val
       * @author: renchao
       */
      getCurrentSelectProps (val) {
215
        this.currentSelectProps = val
renchao@pashanhoo.com committed
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
      },
      /**
       * @description: beforeunloadHandler
       * @author: renchao
       */
      beforeunloadHandler () {
        this._beforeUnload_time = new Date().getTime();
      },
      /**
       * @description: unloadHandler
       * @param {*} e
       * @author: renchao
       */
      unloadHandler (e) {
        this._gap_time = new Date().getTime() - this._beforeUnload_time;
        //判断是窗口关闭还是刷新
        if (this._gap_time <= 10) {
          //取消认领
234
          unClaimTask(this.$route.query.bsmSlsq, this.bestepid ? this.bestepid : '')
renchao@pashanhoo.com committed
235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253
        }
      },
      /**
       * @description: 申请单元点击事件
       * @param {*} index
       * @author: renchao
       */
      stepForm (index) {
        getStepFormInfo(this.currentSelectProps).then((res) => {
          if (res.code === 200) {
            //获取单元对应的所有表单信息
            this.tabList = res.result;
            //默认加载第一个表单信息
            let arr = res.result.filter((item) => item.defaultForm);
            if (arr.length > 0) {
              this.tabName = arr[0].value;
            } else {
              this.tabName = res.result[0].value;
            }
254 255 256
            if (sessionStorage.getItem('activeName') == this.tabName) {
              this.fresh++;
            }
renchao@pashanhoo.com committed
257 258 259 260 261
            this.ableOperation = this.tabList[0].ableOperation;
            //批量操作无分屏按钮
            if (index != null) {
              //处理分屏材料信息
              let that = this;
xiaomiao committed
262

renchao@pashanhoo.com committed
263 264
              this.tabList.forEach(function (item, index) {
                if (item.value == "clxx") {
265 266 267
                  that.clxxIndex = index
                  that.clxxForm = getForm(item.value)
                  that.clxxTab = item
renchao@pashanhoo.com committed
268
                }
269
              })
renchao@pashanhoo.com committed
270
            }
蔡俊立 committed
271
          }
272
        })
renchao@pashanhoo.com committed
273 274 275 276 277 278 279 280 281 282 283 284 285
      },
      /**
       * @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;
        }
xiaomiao committed
286
      }
renchao@pashanhoo.com committed
287 288
    }
  }
任超 committed
289
</script>
xiaomiao committed
290
<style scoped lang="scss">
renchao@pashanhoo.com committed
291 292 293 294 295 296
  @page {
    size: auto;
    margin: 0mm;
  }
  .rightContainer {
    position: relative;
xiaomiao committed
297
  }
xiaomiao committed
298

renchao@pashanhoo.com committed
299 300 301 302 303 304 305 306 307 308 309
  .count {
    font-size: 14px;
    position: absolute;
    right: 25px;
    top: 12px;
    height: 30px;
    span {
      font-weight: 600;
      color: #3498db;
    }
  }
xiaomiao committed
310
</style>