Blame view

src/views/workflow/workFrame1.vue 7.35 KB
任超 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
<template>
  <div class="container">
    <!-- 顶部内容框 -->
    <div class="topButton">
      <!-- 左侧业务功能按钮 -->
      <ul>
        <li @click="operation(item)" v-for="(item, index) in leftButtonList" :key="index">
          <svg-icon class="icon" :icon-class="item.icon" />
          <span class="iconName">{{ item.name }}</span>
        </li>
      </ul>
      <!-- 右侧流程按钮 -->
      <ul>
        <li @click="operation(item)" v-for="(item, index) in rightButtonList" :key="index">
          <svg-icon class="icon" :icon-class="item.icon" />
          <span class="iconName">{{ item.name }}</span>
        </li>
      </ul>
      <NoticeBar class="NoticeBar" :noticeList="noticeList" />
    </div>
    <!-- 内容框架 -->
    <div class="containerFrame">
      <!-- 左侧菜单栏 -->
      <div class="leftmenu" :class="{ 'animation-map-drawer': isShowdrawer }">
蔡俊立 committed
25 26 27 28 29
        <el-menu :default-active="activeIndex" @select="batchUnitClick" class="title-batch" v-if="showBatch">
          <el-menu-item index="-1" key="-1" class="menus">
            <div>{{ batchButtonName }}</div>
          </el-menu-item> 
        </el-menu>
任超 committed
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
        <div v-if="this.isShowdrawer">
          <div class="title">
            申请单元列表({{ unitData.length }})
            <el-button type="text" class="batchDel" @click="handleBatchDel" v-if="unitData.length > 1">批量删除</el-button>
          </div>
          <el-menu :default-active="activeIndex" @select="unitClick">
            <el-menu-item v-for="(item, index) in unitData" :index="index.toString()" :key="index">
              <div>
                <p>{{ item.bdcdyh }}</p>
                <p class="title-detail">{{ item.zl }}</p>
              </div>
              <i class="el-icon-delete" v-if="unitData.length > 1" @click.stop="handleDel(item)"></i>
            </el-menu-item>
          </el-menu>
        </div>
        <div class="map-drawer-click map-drawer" v-if="!isShowdrawer" @click="
          () => {
            this.isShowdrawer = !this.isShowdrawer;
          }
        "></div>
        <div class="map-drawer-expand map-drawer" v-else @click="
          () => {
            this.isShowdrawer = !this.isShowdrawer;
          }
        "></div>
      </div>
      <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">
            <el-tab-pane :label="item.name" :name="item.value" v-for="item in tabList" :key="item.value">
            </el-tab-pane>
          </el-tabs>
          <component :key="fresh" :is="componentTag" v-bind="currentSelectProps" />
        </div>
      </div>
    </div>
    <fqsqDialog v-model="isDialog" :djywbm="$route.query.sqywbm" :isJump="true" @updateDialog="updateDialog" />
  </div>
</template>
<style scoped lang='scss'>
@import "~@/styles/mixin.scss";
@import "./workFrame.scss";
</style>
<script>
import WorkFlow from "./mixin/index"
任超 committed
80
import publicFlow from "./mixin/public.js"
任超 committed
81
import { getStepFormInfo } from "@/api/fqsq.js";
任超 committed
82
import { getForm } from './flowform'
任超 committed
83 84 85
import NoticeBar from '@/components/NoticeBar/index'
import { deleteFlow, unClaimTask } from "@/api/ywbl.js";
import ProcessViewer from './components/processViewer.vue'
86
import fqsqDialog from "@/views/ywbl/ywsq/selectBdc.vue";
任超 committed
87 88 89 90 91 92
export default {
  components: {
    fqsqDialog,
    NoticeBar,
    ProcessViewer
  },
任超 committed
93
  mixins: [WorkFlow, publicFlow],
任超 committed
94 95 96 97 98 99 100 101 102 103 104 105 106
  data () {
    return {
      isDialog: false,
      // 折叠
      isShowdrawer: true,
      // 默认选中
      activeIndex: "0",
      //受理申请标识码
      bsmSlsq: this.$route.query.bsmSlsq,
      //当前流程所在环节
      bestepid: this.$route.query.bestepid,
      //设置那个表单选中
      tabName: "",
蔡俊立 committed
107 108
      //设置那个表单选择
      currentSelectTab: {},
任超 committed
109 110 111 112 113 114 115 116 117 118 119 120 121
      //表单集合
      tabList: [],
      //选择加载哪一个组件
      componentTag: "",
      //设置表单传递数据
      currentSelectProps: {},
      //材料分屏表单
      clxxForm: "",
      //材料信息选择卡索引
      clxxIndex: "",
      //材料信息选项卡对象
      clxxTab: {},
      //页面监听时间
蔡俊立 committed
122 123 124 125 126
      _beforeUnload_time: "",
      //批量操作
      showBatch: false,
      //批量操作按钮名称
      batchButtonName: '',
任超 committed
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 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
    }
  },
  mounted () {
    //添加页面监听事件
    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: {
    beforeunloadHandler () {
      this._beforeUnload_time = new Date().getTime()
    },
    unloadHandler (e) {
      this._gap_time = new Date().getTime() - this._beforeUnload_time
      //判断是窗口关闭还是刷新
      if (this._gap_time <= 10) {
        //取消认领
        unClaimTask(this.bsmSlsq, this.bestepid)
      }
    },
    changeLoadIndex () {
      this.loadIndex++
    },
    closeDialog () {
      this.myValue = false
    },
    // 更新列表
    updateDialog () {
      this.loadBdcdylist();
    },
    // 删除左侧列表
    handleDel (item) {
      this.$confirm("确定要删除吗, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          var formdata = new FormData();
          formdata.append("bsmSldyList", item.bsmSldy.split(","));
          formdata.append("bsmSlsq", this.bsmSlsq);
          deleteFlow(formdata).then((res) => {
            if (res.code == 200) {
              this.$message.success("删除成功");
              this.loadBdcdylist();
            } else {
              this.$message.error(res.message);
            }
          });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除",
          });
        });
    },
    //申请单元点击事件
蔡俊立 committed
188
    stepForm (index) {
任超 committed
189 190
      getStepFormInfo(this.currentSelectProps).then((res) => {
        if (res.code === 200) {
任超 committed
191
          this.fresh++;
任超 committed
192 193 194 195
          //获取单元对应的所有表单信息
          this.tabList = res.result;
          //默认加载第一个表单信息
          this.tabName = res.result[0].value;
蔡俊立 committed
196 197 198 199 200 201 202 203 204 205 206 207
          //批量操作无分屏按钮 
          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;
              }
            })
          }
任超 committed
208 209
        }
      })
蔡俊立 committed
210 211 212 213 214
    },
    //申请单元点击事件
    unitClick (index) {
      this.currentSelectProps = this.unitData[index];
      this.currentSelectProps.batchOperation = false;
蔡俊立 committed
215
      this.activeIndex = index.toString();
蔡俊立 committed
216 217 218 219 220
      this.stepForm(index);
    },
    //批量按钮点击事件
    batchUnitClick(){
      this.currentSelectProps.batchOperation = true;
蔡俊立 committed
221
      this.activeIndex = "-1";
蔡俊立 committed
222
      this.stepForm();
任超 committed
223 224 225 226
    }
  }
}
</script>