Blame view

src/views/workflow/workFrameView.vue 5.51 KB
1
<!--
xiaomiao committed
2
 * @Description:
3
 * @Autor: renchao
4
 * @LastEditTime: 2024-01-25 14:22:07
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">
13
          <svg-icon class="icon" :icon-class="item.icon" />
任超 committed
14 15 16 17 18
          <span class="iconName">{{ item.name }}</span>
        </li>
      </ul>
      <!-- 右侧流程按钮 -->
      <ul>
19
        <li @click="operation(item)" v-for="(item, index) in rightButtonList" :key="index">
任超 committed
20
          <svg-icon class="icon" :icon-class="item.icon" />
21
          <span class="iconName">{{ item.name }}</span>
任超 committed
22 23
        </li>
      </ul>
24
      <NoticeBar class="NoticeBar" :noticeList="noticeList" v-if="noticeList.length > 0" />
任超 committed
25 26 27
    </div>
    <!-- 内容框架 -->
    <div class="containerFrame">
28
      <!-- 左侧菜单栏 区分业务-->
29 30
      <segmentMenu v-if="['A0320099','A0330099' ,'A04300S1','A04200S2','A0830S1'].includes(slsq.djqxbm)" :isDel="false" @getCurrentSelectProps="getCurrentSelectProps" />
      <ordinaryMenu v-else @getCurrentSelectProps="getCurrentSelectProps" :isDel="false" />
31

任超 committed
32 33 34 35 36 37 38
      <div class="leftCon">
        <!-- 分屏左侧预览 -->
        <div v-if="splitScreen" class="splitScreen-con">
          <component :is="clxxForm" v-bind="currentSelectProps" :key="fresh" />
        </div>
        <!-- 表单内容区域 -->
        <div class="rightContainer">
xiaomiao committed
39
          <el-tabs v-model="tabName" :before-leave="beforeLeave" @tab-click="handleClick">
40
            <el-tab-pane :label="item.name" :name="item.value" v-for="item in tabList" :key="item.value">
任超 committed
41 42
            </el-tab-pane>
          </el-tabs>
43 44 45
          <div style="height:94%">
            <component :key="fresh" :is="componentTag" v-bind="currentSelectProps" />
          </div>
任超 committed
46 47 48 49 50
        </div>
      </div>
    </div>
  </div>
</template>
51
<style scoped lang="scss">
52 53
  @import "~@/styles/mixin.scss";
  @import "./workFrame.scss";
任超 committed
54 55
</style>
<script>
56 57
  import WorkFlow from "./mixin/index"
  import publicFlow from "./mixin/public.js"
58
  import { getStepFormInfo } from "@/api/workFlow.js"
59
  import { getForm } from "./flowform"
60
  import NoticeBar from "@/components/NoticeBar/index";
61 62 63 64
  // 引入左侧菜单
  import ordinaryMenu from "./components/leftmenu/ordinaryMenu.vue"
  // 引入左侧菜单
  import segmentMenu from "./components/leftmenu/segmentMenu.vue"
65
  export default {
66
    mixins: [WorkFlow, publicFlow],
67 68
    components: {
      NoticeBar,
69 70
      ordinaryMenu,
      segmentMenu
任超 committed
71
    },
72 73
    data () {
      return {
1  
renchao@pashanhoo.com committed
74 75
        //受理申请标识码
        bsmSlsq: this.$route.query.bsmSlsq,
76 77 78 79 80 81
        // 流程图
        imgSrc: "",
        // 折叠
        isShowdrawer: true,
        // 默认选中
        activeIndex: "0",
82 83
        // 判断类型
        type: "READ_ONLY",
84 85 86 87 88 89 90 91 92 93 94 95
        //设置那个表单选中
        tabName: "",
        //表单集合
        tabList: [],
        //选择加载哪一个组件
        componentTag: "",
        //设置表单组件是否刷选值
        fresh: 10,
        //设置表单传递数据
        currentSelectProps: {},
        //是否开启材料分屏
        splitScreen: false,
96
        ableOperation: false,
97 98 99 100 101
        //材料分屏表单
        clxxForm: "",
        //材料信息选择卡索引
        clxxIndex: "",
        //材料信息选项卡对象
102
        clxxTab: {}
103 104
      };
    },
105 106 107
    created () {
      console.log(this.$route.query.type);
    },
108
    methods: {
yuanbo committed
109 110 111 112 113
      /**
       * @description: getCurrentSelectProps
       * @param {*} val
       * @author: renchao
       */
114 115
      getCurrentSelectProps (val) {
        this.currentSelectProps = val
116
      },
yuanbo committed
117 118 119 120 121
      /**
       * @description: 申请单元点击事件
       * @param {*} index
       * @author: renchao
       */
122
      stepForm (index) {
123
        let that = this
124 125 126
        if (Object.keys(this.currentSelectProps).length == 0) {
          return
        }
127
        this.currentSelectProps.type = "READ_ONLY"
128 129 130 131
        getStepFormInfo(this.currentSelectProps).then((res) => {
          if (res.code === 200) {
            //获取单元对应的所有表单信息
            this.tabList = res.result;
renchao@pashanhoo.com committed
132
            var indexTab = 0
133
            //默认加载第一个表单信息
renchao@pashanhoo.com committed
134 135 136 137 138
            res.result.forEach((item, index) => {
              if (item.defaultForm) {
                indexTab = index
              }
            })
139 140
            if (res.result.length > 0) {
              that.tabName = res.result[0].value;
141
            }
142
            if (sessionStorage.getItem('activeName') == this.tabName) {
143
              that.fresh++;
144
            }
renchao@pashanhoo.com committed
145 146
            this.ableOperation = this.tabList[indexTab].ableOperation
            this.currentSelectTab = this.tabList[indexTab];
147 148 149
            //批量操作无分屏按钮
            if (index != null) {
              //处理分屏材料信息
150
              that.tabList.forEach(function (item, index) {
151
                if (item.value == "clxx") {
152 153 154
                  that.clxxIndex = index
                  that.clxxForm = getForm(item.value)
                  that.clxxTab = item
155 156 157
                }
              })
            }
158
          }
159
        })
160
      },
161 162 163 164 165 166 167 168 169 170 171 172
      /**
       * @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
173
      }
174 175
    }
  }
176
</script>
177