Blame view

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

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