Blame view

src/views/workflow/workFrame.vue 8.59 KB
任超 committed
1 2 3 4 5 6
<template>
  <div class="container">
    <!-- 顶部内容框 -->
    <div class="topButton">
      <!-- 左侧业务功能按钮 -->
      <ul>
7 8 9 10 11
        <li
          @click="operation(item)"
          v-for="(item, index) in leftButtonList"
          :key="index"
        >
任超 committed
12 13 14 15 16 17
          <svg-icon class="icon" :icon-class="item.icon" />
          <span class="iconName">{{ item.name }}</span>
        </li>
      </ul>
      <!-- 右侧流程按钮 -->
      <ul>
18 19 20 21 22
        <li
          @click="operation(item)"
          v-for="(item, index) in rightButtonList"
          :key="index"
        >
任超 committed
23 24 25 26 27 28 29 30 31 32
          <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 }">
33 34 35 36 37 38
        <el-menu
          :default-active="activeIndex"
          @select="batchUnitClick"
          class="title-batch"
          v-if="showBatch"
        >
蔡俊立 committed
39 40
          <el-menu-item index="-1" key="-1" class="menus">
            <div>{{ batchButtonName }}</div>
任超 committed
41
          </el-menu-item>
蔡俊立 committed
42
        </el-menu>
任超 committed
43 44 45
        <div v-if="this.isShowdrawer">
          <div class="title">
            申请单元列表({{ unitData.length }})
46 47 48 49 50 51 52
            <el-button
              type="text"
              class="batchDel"
              @click="handleBatchDel"
              v-if="unitData.length > 1"
              >批量删除</el-button
            >
任超 committed
53 54
          </div>
          <el-menu :default-active="activeIndex" @select="unitClick">
55 56 57 58 59
            <el-menu-item
              v-for="(item, index) in unitData"
              :index="index.toString()"
              :key="index"
            >
任超 committed
60 61 62 63
              <div>
                <p>{{ item.bdcdyh }}</p>
                <p class="title-detail">{{ item.zl }}</p>
              </div>
64 65 66 67 68
              <i
                class="el-icon-delete"
                v-if="unitData.length > 1"
                @click.stop="handleDel(item)"
              ></i>
任超 committed
69 70 71
            </el-menu-item>
          </el-menu>
        </div>
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
        <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>
任超 committed
90 91 92 93 94 95 96 97 98
      </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">
99 100 101 102 103 104
            <el-tab-pane
              :label="item.name"
              :name="item.value"
              v-for="item in tabList"
              :key="item.value"
            >
任超 committed
105 106
            </el-tab-pane>
          </el-tabs>
107 108 109 110 111
          <component
            :key="fresh"
            :is="componentTag"
            v-bind="currentSelectProps"
          />
任超 committed
112 113 114
        </div>
      </div>
    </div>
蔡俊立 committed
115
    <!-- 打印模板需要此模块 -->
116 117 118 119 120 121 122 123 124 125 126 127
    <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"
      />
128
    </object>
129 130 131 132 133 134 135 136 137 138 139 140
    <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
      >
141
    </el-upload>
142 143 144 145 146 147
    <selectBdc
      v-model="isDialog"
      :djywbm="$route.query.sqywbm"
      :isJump="true"
      @updateDialog="updateDialog"
    />
任超 committed
148 149
  </div>
</template>
150
<style scoped lang="scss">
任超 committed
151 152 153 154
@import "~@/styles/mixin.scss";
@import "./workFrame.scss";
</style>
<script>
155 156
import WorkFlow from "./mixin/index";
import publicFlow from "./mixin/public.js";
任超 committed
157
import { getStepFormInfo } from "@/api/fqsq.js";
158 159
import { getForm } from "./flowform";
import NoticeBar from "@/components/NoticeBar/index";
任超 committed
160
import { deleteFlow, unClaimTask } from "@/api/ywbl.js";
161
import ProcessViewer from "./components/processViewer.vue";
162
import selectBdc from "@/views/ywbl/ywsq/selectBdc.vue";
任超 committed
163 164
export default {
  components: {
165
    selectBdc,
任超 committed
166
    NoticeBar,
167
    ProcessViewer,
任超 committed
168
  },
任超 committed
169
  mixins: [WorkFlow, publicFlow],
170
  data() {
任超 committed
171 172 173 174 175 176 177 178 179 180 181 182
    return {
      isDialog: false,
      // 折叠
      isShowdrawer: true,
      // 默认选中
      activeIndex: "0",
      //受理申请标识码
      bsmSlsq: this.$route.query.bsmSlsq,
      //当前流程所在环节
      bestepid: this.$route.query.bestepid,
      //设置那个表单选中
      tabName: "",
蔡俊立 committed
183 184
      //设置那个表单选择
      currentSelectTab: {},
任超 committed
185 186 187 188 189 190 191 192 193 194 195 196 197
      //表单集合
      tabList: [],
      //选择加载哪一个组件
      componentTag: "",
      //设置表单传递数据
      currentSelectProps: {},
      //材料分屏表单
      clxxForm: "",
      //材料信息选择卡索引
      clxxIndex: "",
      //材料信息选项卡对象
      clxxTab: {},
      //页面监听时间
蔡俊立 committed
198 199 200 201
      _beforeUnload_time: "",
      //批量操作
      showBatch: false,
      //批量操作按钮名称
202 203
      batchButtonName: "",
    };
任超 committed
204
  },
205
  mounted() {
任超 committed
206
    //添加页面监听事件
207 208
    window.addEventListener("beforeunload", (e) => this.beforeunloadHandler(e));
    window.addEventListener("unload", (e) => this.unloadHandler(e));
任超 committed
209
  },
210 211 212 213 214 215

  destroyed() {
    window.removeEventListener("beforeunload", (e) =>
      this.beforeunloadHandler(e)
    );
    window.removeEventListener("unload", (e) => this.unloadHandler(e));
任超 committed
216 217
  },
  methods: {
218 219
    beforeunloadHandler() {
      this._beforeUnload_time = new Date().getTime();
任超 committed
220
    },
221 222
    unloadHandler(e) {
      this._gap_time = new Date().getTime() - this._beforeUnload_time;
任超 committed
223 224 225
      //判断是窗口关闭还是刷新
      if (this._gap_time <= 10) {
        //取消认领
226
        unClaimTask(this.bsmSlsq, this.bestepid);
任超 committed
227 228
      }
    },
229 230
    changeLoadIndex() {
      this.loadIndex++;
任超 committed
231
    },
232 233
    closeDialog() {
      this.myValue = false;
任超 committed
234 235
    },
    // 更新列表
236
    updateDialog() {
任超 committed
237 238 239
      this.loadBdcdylist();
    },
    // 删除左侧列表
240
    handleDel(item) {
任超 committed
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266
      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: "已取消删除",
          });
        });
    },
    //申请单元点击事件
267
    stepForm(index) {
任超 committed
268 269
      getStepFormInfo(this.currentSelectProps).then((res) => {
        if (res.code === 200) {
任超 committed
270
          this.fresh++;
任超 committed
271 272 273 274
          //获取单元对应的所有表单信息
          this.tabList = res.result;
          //默认加载第一个表单信息
          this.tabName = res.result[0].value;
275
          //批量操作无分屏按钮
任超 committed
276
          if (index != null) {
277
            //处理分屏材料信息
蔡俊立 committed
278 279 280 281 282 283 284
            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;
              }
285
            });
蔡俊立 committed
286
          }
任超 committed
287
        }
288
      });
蔡俊立 committed
289 290
    },
    //申请单元点击事件
291
    unitClick(index) {
蔡俊立 committed
292 293
      this.currentSelectProps = this.unitData[index];
      this.currentSelectProps.batchOperation = false;
蔡俊立 committed
294
      this.activeIndex = index.toString();
蔡俊立 committed
295 296 297
      this.stepForm(index);
    },
    //批量按钮点击事件
298
    batchUnitClick() {
蔡俊立 committed
299
      this.currentSelectProps.batchOperation = true;
蔡俊立 committed
300
      this.activeIndex = "-1";
蔡俊立 committed
301
      this.stepForm();
302 303 304
    },
  },
};
任超 committed
305
</script>