Blame view

src/views/workflow/workFrame.vue 18.3 KB
1 2 3 4 5 6
<template>
  <div class="container">
    <!-- 顶部内容框 -->
    <div class="topButton">
      <!-- 左侧业务功能按钮 -->
      <ul>
任超 committed
7
        <li @click="operation(index, item)" v-for="(item, index) in leftButtonList" :key="index">
任超 committed
8
          <svg-icon class="icon" :icon-class="item.icon" />
9 10 11 12 13
          <span class="iconName">{{ item.name }}</span>
        </li>
      </ul>
      <!-- 右侧流程按钮 -->
      <ul>
14
        <li @click="operation(index, item)" v-for="(item, index) in rightButtonList" :key="index">
15 16 17 18
          <svg-icon class="icon" :icon-class="item.icon" />
          <span class="iconName">{{ item.name }}</span>
        </li>
      </ul>
任超 committed
19
      <NoticeBar class="NoticeBar" :noticeList="noticeList" />
20 21
    </div>
    <!-- 内容框架 -->
任超 committed
22
    <div class="containerFrame">
23
      <!-- 左侧菜单栏 -->
任超 committed
24
      <div class="leftmenu" :class="{ 'animation-map-drawer': isShowdrawer }">
任超 committed
25
        <div class="title" @click="unitClick(-1)" v-if="showBatch">{{ batchButtonName }}</div>
任超 committed
26
        <div v-if="this.isShowdrawer">
27 28
          <div class="title">
            申请单元列表({{ unitData.length }})
29
            <el-button type="text" class="batchDel" @click="handleBatchDel" v-if="unitData.length > 1">批量删除</el-button>
任超 committed
30
          </div>
任超 committed
31
          <el-menu :default-active="activeIndex" @select="unitClick">
32
            <el-menu-item v-for="(item, index) in unitData" :index="index.toString()" :key="index">
任超 committed
33 34 35 36
              <div>
                <p>{{ item.bdcdyh }}</p>
                <p class="title-detail">{{ item.zl }}</p>
              </div>
37
              <i class="el-icon-delete" v-if="unitData.length > 1" @click.stop="handleDel(item)"></i>
任超 committed
38 39 40
            </el-menu-item>
          </el-menu>
        </div>
41 42 43 44 45 46 47 48 49 50
        <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>
51
      </div>
任超 committed
52 53 54 55 56 57 58
      <div class="leftCon">
        <!-- 分屏左侧预览 -->
        <div v-if="splitScreen" class="splitScreen-con">
          <component :is="clxxForm" v-bind="currentSelectProps" :key="fresh" />
        </div>
        <!-- 表单内容区域 -->
        <div class="rightContainer">
任超 committed
59
          <el-tabs v-model="tabName" :before-leave="beforeLeave">
60
            <el-tab-pane :label="item.name" :name="item.value" v-for="item in tabList" :key="item.value">
61 62
            </el-tab-pane>
          </el-tabs>
63
          <component :key="fresh" :is="componentTag" v-bind="currentSelectProps" />
64 65
        </div>
      </div>
66
    </div>
67
    <fqsqDialog v-model="isDialog" :djywbm="$route.query.sqywbm" :isJump="true" @updateDialog="updateDialog" />
68 69 70 71 72
  </div>
</template>

<style scoped lang='scss'>
@import "~@/styles/mixin.scss";
73
@import "./workFrame.scss";
74 75
</style>
<script>
田浩浩 committed
76 77 78 79 80 81
import {
  leftMenu,
  stepExpandInfo,
  record,
  getNextLinkInfo,
  completeTask,
82
  getStepFormInfo,
83
} from "@/api/fqsq.js";
任超 committed
84
import { mapGetters } from "vuex"
任超 committed
85
import NoticeBar from '@/components/NoticeBar/index'
任超 committed
86
import { deleteFlow, unClaimTask } from "@/api/ywbl.js";
任超 committed
87
import ProcessViewer from './components/processViewer.vue'
88 89 90 91
import { getWorkFlowImage } from "@/api/jsydsyqFlow.js";
import { getForm } from "./flowform.js";
import fqsqDialog from "@/views/ywbl/ywsq/slectBdc.vue";
import { queueDjywmc } from "@/views/ywbl/ywsq/slectBdcdata.js";
92
export default {
任超 committed
93
  components: {
94
    fqsqDialog,
任超 committed
95
    NoticeBar,
任超 committed
96
    ProcessViewer
任超 committed
97
  },
98
  data () {
99
    return {
任超 committed
100 101 102 103 104 105 106 107 108 109 110
      noticeList: [
        {
          title: '6666666666666666666'
        },
        {
          title: '3333333333333333333'
        },
        {
          title: '6666666666666666666'
        }
      ],
任超 committed
111
      isDialog: false,
任超 committed
112
      // 流程图
任超 committed
113 114
      // 折叠
      isShowdrawer: true,
任超 committed
115
      // 默认选中
116
      activeIndex: "0",
117
      //受理申请标识码
田浩浩 committed
118
      bsmSlsq: this.$route.query.bsmSlsq,
119
      //当前流程所在环节
田浩浩 committed
120
      bestepid: this.$route.query.bestepid,
蔡俊立 committed
121 122 123 124
      //是否展示批量按钮
      showBatch: false,
      //批量按钮名称
      batchButtonName: '',
125
      //顶部左侧按钮集合
126
      leftButtonList: [],
127
      //顶部右侧按钮集合
128
      rightButtonList: [],
129
      //左侧菜单数据集合
130
      unitData: [],
131 132 133
      //设置那个表单选中
      tabName: "",
      //表单集合
134
      tabList: [],
135
      //选择加载哪一个组件
136
      componentTag: "",
137
      //设置表单组件是否刷选值
田浩浩 committed
138
      fresh: 10,
139
      //设置表单传递数据
140
      currentSelectProps: {},
田浩浩 committed
141 142 143 144 145 146 147 148
      //是否开启材料分屏
      splitScreen: false,
      //材料分屏表单
      clxxForm: "",
      //材料信息选择卡索引
      clxxIndex: "",
      //材料信息选项卡对象
      clxxTab: {},
蔡俊立 committed
149 150
      //页面监听时间
      _beforeUnload_time: "",
151
    };
152
  },
153
  mounted () {
154 155
    this.loadBdcdylist();
    this.flowInitParam();
蔡俊立 committed
156 157 158 159
    //添加页面监听事件
    window.addEventListener('beforeunload', e => this.beforeunloadHandler(e))
    window.addEventListener('unload', e => this.unloadHandler(e))
  },
任超 committed
160
  destroyed () {
蔡俊立 committed
161 162
    window.removeEventListener('beforeunload', e => this.beforeunloadHandler(e))
    window.removeEventListener('unload', e => this.unloadHandler(e))
163
  },
任超 committed
164 165 166
  computed: {
    ...mapGetters(["oldDetail", "newDetail"])
  },
167
  methods: {
任超 committed
168 169
    beforeunloadHandler () {
      this._beforeUnload_time = new Date().getTime()
蔡俊立 committed
170
    },
任超 committed
171
    unloadHandler (e) {
172
      thsi.$alert("234234");
任超 committed
173 174 175 176 177 178 179
      this._gap_time = new Date().getTime() - this._beforeUnload_time
      //判断是窗口关闭还是刷新
      if (this._gap_time <= 10) {
        //取消认领
        unClaimTask(this.bsmSlsq, this.bestepid)
      }
    },
任超 committed
180 181 182 183 184 185
    changeLoadIndex () {
      this.loadIndex++
    },
    closeDialog () {
      this.myValue = false
    },
任超 committed
186
    // 更新列表
187
    updateDialog () {
任超 committed
188 189 190
      this.loadBdcdylist();
    },
    // 删除左侧列表
191
    handleDel (item) {
192 193 194 195
      this.$confirm("确定要删除吗, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
任超 committed
196
      })
197
        .then(() => {
蔡俊立 committed
198 199
          var formdata = new FormData();
          formdata.append("bsmSldyList", item.bsmSldy.split(","));
任超 committed
200
          formdata.append("bsmSlsq", this.bsmSlsq);
蔡俊立 committed
201
          deleteFlow(formdata).then((res) => {
202 203 204 205 206 207 208 209 210 211 212 213 214 215
            if (res.code == 200) {
              this.$message.success("删除成功");
              this.loadBdcdylist();
            } else {
              this.$message.error(res.message);
            }
          });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除",
          });
        });
任超 committed
216
    },
217
    handleBatchDel () {
蔡俊立 committed
218
      let that = this;
任超 committed
219
      this.$popup({
220 221
        title: "批量删除",
        width: "50%",
任超 committed
222
        btnShow: true,
223 224
        editItem: "workflow/components/batchDel",
        height: "600px",
蔡俊立 committed
225 226
        formData: {
          bsmSlsq: this.bsmSlsq,
227
          dataList: this.unitData,
蔡俊立 committed
228
        },
229
        cancel: function () { }, //取消事件的回调
230
        confirm: function () {
蔡俊立 committed
231
          that.loadBdcdylist();
蔡俊立 committed
232
        }, //确认事件的回调
233
      });
任超 committed
234
    },
235
    //加载流程初始参数
236
    flowInitParam () {
237 238 239 240 241 242 243
      var formdata = new FormData();
      formdata.append("bsmSlsq", this.bsmSlsq);
      formdata.append("bestepid", this.bestepid);
      stepExpandInfo(formdata).then((res) => {
        if (res.code === 200) {
          this.leftButtonList = res.result.button;
          this.rightButtonList = res.result.operation;
244
          //this.tabList = res.result.form;
245
          //默认选择第一个选项卡内容
246 247 248 249 250 251 252 253 254 255 256
          // this.tabName = res.result.form[0].value;
          // 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;
          //   }
          // });
          // //默认加载第一个选项卡的组件内容
          // this.getFromRouter(res.result.form[0].value);
257
        }
258
      });
259
    },
260
    //流程环节操作按钮
任超 committed
261
    operation (index, item) {
262
      //按钮 B0:选择不动产单元 B1:流程图 B2:材料分屏 B3:材料导入 B4:登记簿 B5:证书预览 B6:打印申请书 B7:证书领取 B8:楼盘表 B9:登簿
蔡俊立 committed
263
      //操作按钮 登簿:record  转件:transfer  退回:back  退出:signout
任超 committed
264
      let that = this;
265
      switch (item.value) {
任超 committed
266
        case "B0":
任超 committed
267
          // let type = queueDjywmc(this.$route.query.sqywbm)
268
          this.isDialog = true;
任超 committed
269
          break;
任超 committed
270
        case "B1":
任超 committed
271 272
          getWorkFlowImage(this.bsmSlsq, this.$route.query.bestepid).then(res => {
            let { result } = res
任超 committed
273
            this.$popup("流程图", "workflow/components/processViewer", {
274 275 276 277 278 279 280 281 282 283 284
              formData: {
                xml: result.xml,
                finishedInfo: {
                  finishedTaskSet: result.finishedTaskSet,
                  unfinishedTaskSet: result.unfinishedTaskSet,
                  rejectedTaskSet: result.rejectedTaskSet,
                  finishedSequenceFlowSet: result.finishedSequenceFlowSet
                },
                allCommentList: result.historyTaskList
              }
            })
任超 committed
285
          })
286
          break;
蔡俊立 committed
287
        case "B2": //材料分屏按钮
田浩浩 committed
288
          this.splitScreen = this.splitScreen ? false : true;
289 290
          this.$store.dispatch("app/settScreen", this.splitScreen);
          if (this.splitScreen) {
田浩浩 committed
291 292 293 294 295
            //如果当前选项卡为材料信息内容,递减到上一个选项卡内容
            if (this.tabName == this.clxxTab.value) {
              this.tabName = this.tabList[this.clxxIndex - 1].value;
              this.getFromRouter(this.tabList[this.clxxIndex - 1].value);
            }
296
            //删除材料信息选项卡数据
田浩浩 committed
297
            this.tabList.splice(this.clxxIndex, 1);
298
          } else {
299
            //新增材料信息选项卡数据
300
            this.tabList.splice(this.clxxIndex, 0, this.clxxTab);
301 302
          }
          break;
303
        case "B4":
任超 committed
304
          this.$popup("登记簿详情", "registerBook/djbFrame", {
305 306 307 308 309 310 311 312 313 314 315 316
            formData: this.currentSelectProps,
            width: "1220px",
            height: "790px",
            cancel: () => {
              console.log("取消回调");
            },
            confirm: () => {
              console.log("确认回调");
            },
          });
          break;
        case "B5":
任超 committed
317
          this.$popup("证书预览", "workflow/components/zsyl", {
蔡俊立 committed
318 319 320 321 322 323 324 325 326 327 328 329 330
            height: "600px",
            width: "800px",
            formData: {
              bsmSlsq: this.bsmSlsq,
              entryType: '1'
            },
            cancel: () => {
              console.log("取消回调");
            },
            confirm: () => {
              console.log("确认回调");
            },
          })
331
          break;
332
        case "B7":
任超 committed
333 334 335
          this.$popup("证书领取", "workflow/components/zslq", {
            width: '900px',
            formData: { bsmSlsq: this.$route.query.bsmSlsq },
336 337
          })
          break;
蔡俊立 committed
338
        case "back": //退回按钮
任超 committed
339 340 341
          this.$popup({
            title: "退回",
            editItem: "workflow/components/th",
蔡俊立 committed
342
            height: "400px",
任超 committed
343
            width: '30%',
蔡俊立 committed
344 345 346 347
            formData: {
              bsmSlsq: this.bsmSlsq,
              bestepid: this.bestepid
            },
任超 committed
348 349 350 351 352 353 354 355
            btnShow: true,
            cancel: () => {
              console.log("取消回调");
            },
            confirm: () => {
              console.log("确认回调");
            },
          })
356
          break;
357
        case "transfer": //转件按钮
田浩浩 committed
358 359 360 361 362 363 364 365
          getNextLinkInfo({
            bsmSlsq: this.bsmSlsq,
            bestepid: this.bestepid,
          }).then((res) => {
            if (res.code === 200) {
              this.send(res.result);
            }
          });
366
          break;
蔡俊立 committed
367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384
        case "stop": //终止按钮
          this.$popup({
            title: "终止",
            editItem: "workflow/components/stop",
            height: "330px",
            width: '30%',
            formData: {
              bsmSlsq: this.bsmSlsq,
              bestepid: this.bestepid,
            },
            btnShow: true,
            cancel: () => {
              console.log("取消回调");
            },
            confirm: () => {
              console.log("确认回调");
            },
          })
任超 committed
385
          break;
蔡俊立 committed
386
        case "signout":
387
          window.close();
蔡俊立 committed
388
          //取消认领
任超 committed
389
          unClaimTask(this.bsmSlsq, this.bestepid)
390
          break;
田浩浩 committed
391
        case "B9":
392 393 394 395 396 397 398 399 400 401 402
          var formdata = new FormData();
          formdata.append("bsmSlsq", this.bsmSlsq);
          formdata.append("bestepid", this.bestepid);
          this.$confirm("请确认是否登簿", "提示", {
            iconClass: "el-icon-question", //自定义图标样式
            confirmButtonText: "确认", //确认按钮文字更换
            cancelButtonText: "取消", //取消按钮文字更换
            showClose: true, //是否显示右上角关闭按钮
            type: "warning", //提示类型  success/info/warning/error
          }).then(function () {
            record(formdata).then((res) => {
任超 committed
403 404 405
              if (res.code === 200) {
                if (res.result.length === 1) {
                  res.result[0].state ? that.$alert("登簿成功!") : that.$alert(res.result[0].msg);;
406
                }
任超 committed
407 408 409 410 411 412
                else {
                  that.$alert('<div>' + res.result[0].ywh + ',' + res.result[0].msg + '</div>', '登簿明细', {
                    dangerouslyUseHTMLString: true
                  });
                }
              } else {
413 414 415 416 417 418 419
                that.$alert(res.message);
              }
            });
          });
          break;
      }
    },
420
    //读取申请单元信息
421
    loadBdcdylist () {
422 423 424 425 426
      var formdata = new FormData();
      formdata.append("bsmSlsq", this.bsmSlsq);
      formdata.append("bestepid", this.bestepid);
      leftMenu(formdata).then((res) => {
        if (res.code === 200) {
任超 committed
427
          if (res.result) {
蔡俊立 committed
428 429 430
            this.unitData = res.result;
            this.currentSelectProps = res.result[0];
            this.judgeBatchShow();
任超 committed
431
            if (this.showBatch) {
蔡俊立 committed
432 433
              //满足批量查封/批量抵押按钮出现 即先展示批量表单
              this.unitClick(-1);
任超 committed
434
            } else {
蔡俊立 committed
435 436 437 438
              //默认选择单元列表第一个
              this.unitClick(0);
            }
          }
439
        }
440
      });
441
    },
442
    //申请单元点击事件
443
    unitClick (index) {
任超 committed
444 445

      if (index >= 0) {
蔡俊立 committed
446 447
        this.currentSelectProps = this.unitData[index];
        this.currentSelectProps.batchOperation = false;
任超 committed
448
      } else {
蔡俊立 committed
449 450 451
        this.currentSelectProps.batchOperation = true;
      }
      getStepFormInfo(this.currentSelectProps).then((res) => {
任超 committed
452 453
        if (res.code === 200) {
          this.fresh += 1;
任超 committed
454 455 456 457 458 459
          //获取单元对应的所有表单信息
          this.tabList = res.result;
          //默认加载第一个表单信息
          this.tabName = res.result[0].value;
          //处理分屏材料信息
          let that = this;
460 461 462 463 464 465 466 467 468 469 470 471 472
          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;
            }
          });
        }
      });
      // if (this.currentSelectProps.bsmSldy != this.unitData[index].bsmSldy) {
      //   this.currentSelectProps = this.unitData[index];
      //   this.fresh += 1;
      // }
473
    },
蔡俊立 committed
474
    //批量按钮判断
任超 committed
475
    judgeBatchShow () {
蔡俊立 committed
476
      this.showBatch = false;
任超 committed
477 478 479
      let qllx = this.$route.query.sqywbm.substring(0, 3);
      if (this.unitData.length > 1) {
        switch (qllx) {
蔡俊立 committed
480 481 482 483 484 485 486
          case 'B39':
            this.showBatch = true;
            this.batchButtonName = '批量查封';
            break;
          case 'A37':
            this.showBatch = true;
            this.batchButtonName = '批量抵押';
任超 committed
487
            break;
蔡俊立 committed
488 489 490
        }
      }
    },
491
    //表单选项卡事件
任超 committed
492
    beforeLeave (activeName, oldActiveName) {
田浩浩 committed
493 494 495 496 497 498
      // if (!_.isEqual(this.oldDetail, this.newDetail)) {
      //   this.$message.error('界面内容有所变化,请先保存')
      //   return false
      // } else {
      //   if (activeName && activeName != 0) this.getFromRouter(activeName)
      // }
任超 committed
499
      if (activeName && activeName != 0) this.getFromRouter(activeName)
500 501
    },
    //切换选项卡内容组件
502
    getFromRouter (tabname) {
任超 committed
503
      console.log(tabname, 'tabnametabname');
504
      this.componentTag = getForm(tabname, this.$route.query.sqywbm);
505
    },
田浩浩 committed
506
    //发送下一个环节
507
    send (obj) {
田浩浩 committed
508 509 510
      const h = this.$createElement;
      this.$msgbox({
        title: "您确定转出吗?",
任超 committed
511
        message: h("div", { style: "margin: auto" }, [
田浩浩 committed
512 513 514 515 516 517 518 519 520 521 522 523
          h("span", null, "下个环节名称:"),
          h("i", { style: "color: teal" }, obj.taskName),
          h("div", null, ""),
          h("span", null, "下个环节经办人: "),
          h("i", { style: "color: teal" }, obj.usernames.join(",")),
        ]),
        showCancelButton: true,
        beforeClose: (action, instance, done) => {
          if (action === "confirm") {
            instance.confirmButtonLoading = true;
            instance.confirmButtonText = "执行中...";
            completeTask({
任超 committed
524 525
              bsmSlsq: this.bsmSlsq,
              shyj: "this.bestepid",
526
              stepform: JSON.stringify(this.tabList),
任超 committed
527
            }).then((res) => {
田浩浩 committed
528 529 530 531 532 533 534 535 536
              if (res.code === 200) {
                instance.confirmButtonLoading = false;
                this.$message.success("转件成功");
                setTimeout(() => {
                  window.opener = null;
                  window.open("about:blank", "_self");
                  window.close();
                  this.$emit("input", false);
                }, 1000);
任超 committed
537
              } else {
蔡俊立 committed
538 539 540
                instance.confirmButtonLoading = false;
                instance.confirmButtonText = "确定";
                this.$message.error(res.message);
田浩浩 committed
541 542 543 544 545 546 547 548 549
              }
            });
          } else {
            done();
          }
        },
      }).then((action) => {
        this.$message({
          type: "info",
550 551 552 553 554 555
          message: "action: " + action,
        });
      });
    },
  },
};
556
</script>