Blame view

src/views/workflow/workFrameView.vue 5.25 KB
1
<!--
xiaomiao committed
2
 * @Description:
3
 * @Autor: renchao
4
 * @LastEditTime: 2023-07-25 16:15:46
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 }} {{ item.value }}</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 31
      <!-- 左侧菜单栏 区分业务-->
      <segmentMenu v-if="['A0320099','A0330099' ].includes(slsq.djqxbm)" @getCurrentSelectProps="getCurrentSelectProps" />
      <ordinaryMenu v-else @getCurrentSelectProps="getCurrentSelectProps" />

任超 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
          <component :key="fresh" :is="componentTag" v-bind="currentSelectProps" />
任超 committed
44 45 46 47 48
        </div>
      </div>
    </div>
  </div>
</template>
49
<style scoped lang="scss">
50 51
  @import "~@/styles/mixin.scss";
  @import "./workFrame.scss";
任超 committed
52 53
</style>
<script>
54 55
  import WorkFlow from "./mixin/index"
  import publicFlow from "./mixin/public.js"
56
  import { getStepFormInfo } from "@/api/workFlow.js"
57
  import { getForm } from "./flowform"
58
  import NoticeBar from "@/components/NoticeBar/index";
59 60 61 62
  // 引入左侧菜单
  import ordinaryMenu from "./components/leftmenu/ordinaryMenu.vue"
  // 引入左侧菜单
  import segmentMenu from "./components/leftmenu/segmentMenu.vue"
63
  export default {
64
    mixins: [WorkFlow, publicFlow],
65 66
    components: {
      NoticeBar,
67 68
      ordinaryMenu,
      segmentMenu
任超 committed
69
    },
70 71 72 73 74 75 76 77 78 79 80 81
    data () {
      return {
        // 流程图
        imgSrc: "",
        // 折叠
        isShowdrawer: true,
        // 默认选中
        activeIndex: "0",
        //受理申请标识码
        bsmSlsq: this.$route.query.bsmSlsq,
        //当前流程所在环节
        bestepid: this.$route.query.bestepid,
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 102 103 104 105
        //材料分屏表单
        clxxForm: "",
        //材料信息选择卡索引
        clxxIndex: "",
        //材料信息选项卡对象
        clxxTab: {},
      };
    },
    methods: {
yuanbo committed
106 107 108 109 110
      /**
       * @description: getCurrentSelectProps
       * @param {*} val
       * @author: renchao
       */
111 112
      getCurrentSelectProps (val) {
        this.currentSelectProps = val
113 114
      },
      //申请单元点击事件
yuanbo committed
115 116 117 118 119
      /**
       * @description: 申请单元点击事件
       * @param {*} index
       * @author: renchao
       */
120
      stepForm (index) {
121
        this.currentSelectProps.type = "READ_ONLY"
122 123 124 125 126 127
        getStepFormInfo(this.currentSelectProps).then((res) => {
          if (res.code === 200) {
            this.fresh++;
            //获取单元对应的所有表单信息
            this.tabList = res.result;
            //默认加载第一个表单信息
128 129 130 131 132 133 134
            //默认加载第一个表单信息
            let arr = res.result.filter(item => item.defaultForm)
            if (arr.length > 0) {
              this.tabName = arr[0].value;
            } else {
              this.tabName = res.result[0].value;
            }
135
            this.ableOperation = this.tabList[0].ableOperation
136 137 138 139 140 141 142 143 144 145 146 147
            //批量操作无分屏按钮
            if (index != null) {
              //处理分屏材料信息
              let that = this;
              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;
                }
              })
            }
148
          }
149
        })
150
      },
xiaomiao committed
151 152 153 154 155 156 157 158 159 160 161 162 163 164
         //选项卡切换事件
    /**
     * @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;
      }
    },
165 166
    }
  }
167
</script>
168