Blame view

src/views/djbworkflow/mixin/index.js 9.94 KB
1
/*
2 3
 * @Description:workFramezu.vue组件的方法  头部按钮弹框方法
 * @Autor: miaofang
4
 * @LastEditTime: 2024-01-31 17:09:45
5
 */
6
import { getPrintTemplateByCode } from "@/api/print";
xiaomiao committed
7
import { getQllxByBdcdyid } from "@/api/djbDetail.js";
8
import { uploadUndo } from "@/api/clxx";
xiaomiao committed
9
import { deleteFlow } from "@/api/djbRepair";
10 11 12 13 14 15
import { getLodop } from "@/utils/LodopFuncs"
import {
  stepExpandInfo,
  record,
  completeTask,
  getNextLinkInfo,
16
  getWorkFlowImage,
17
  getPrintApplicationForm,
18 19
  unClaimTask
} from "@/api/workFlow.js";
20
export default {
21
  data () {
22 23 24 25
    return {
      //是否开启材料分屏
      splitScreen: false,
      //设置表单组件是否刷选值
26 27
      bsmSlsq: this.$route.query.bsmSlsq,
      bestepid: this.$route.query.bestepid,
28 29 30 31 32 33 34 35 36 37
      fresh: 10,
      //左侧菜单数据集合
      unitData: [],
      //顶部左侧按钮集合
      leftButtonList: [],
      //顶部右侧按钮集合
      rightButtonList: [],
      //批量按钮名称
      batchButtonName: '',
      // 受理申请信息
xiaomiao committed
38
      slsq: {},
xiaomiao committed
39 40 41
      ableOperation: true,
      showidea: false

42 43
    }
  },
44
  mounted () {
45 46 47
    this.flowInitParam();
  },
  methods: {
yuanbo committed
48 49 50 51
    /**
     * @description: 加载流程初始参数
     * @author: renchao
     */
52
    flowInitParam () {
xiaomiao committed
53
      var formdata = new FormData();
54 55
      formdata.append("bsmSlsq", this.bsmSlsq)
      formdata.append("bestepid", this.bestepid ? this.bestepid : '')
xiaomiao committed
56 57 58
      if (this.type) {
        formdata.append("type", "READ_ONLY");
      }
xiaomiao committed
59 60
      stepExpandInfo(formdata).then((res) => {
        if (res.code === 200) {
61
          this.leftButtonList = res.result.button;
62
          if (res.result.properties && res.result.properties.length) {
xiaomiao committed
63 64 65
            this.showidea = res.result.properties[0].value
          }

66 67 68 69
          this.rightButtonList = res.result.operation;
          let arr = this.rightButtonList.filter((item) => {
            return item.name == "删除"
          })
xiaomiao committed
70 71 72
          this.$refs.Menu.getleftMenubl();
          if (!arr.length) {
            this.isEdit = false
73
          }
xiaomiao committed
74 75
        }
      })
76
    },
yuanbo committed
77 78 79 80 81
    /**
     * @description: 流程环节操作按钮
     * @param {*} item
     * @author: renchao
     */
82
    operation (item) {
83 84 85 86 87
      //按钮 B0:选择不动产单元 B1:流程图 B2:材料分屏 B3:材料导入 B4:登记簿 B5:证书预览 B6:打印申请书 B7:证书领取 B8:楼盘表 B9:登簿
      //操作按钮 登簿:record  转件:transfer  退回:back  退出:signout
      let that = this;
      switch (item.value) {
        case "B0":
88
          this.openDialog()
89 90
          break;
        case "B1":
91
          getWorkFlowImage(this.bsmSlsq, this.bestepid ? this.bestepid : '').then(res => {
92
            let { result } = res
93
            this.$popupDialog("流程图", "workflow/top/processViewer/index", {
94 95 96 97
              xml: result.xml,
              finishedInfo: {
                finishedTaskSet: result.finishedActivityIds,
                unfinishedTaskSet: result.runningActivityIds,
xiaomiao committed
98
                rejectedTaskSet: result.rejectedActivityIds,
99 100 101 102 103 104
                finishedSequenceFlowSet: result.finishedSequenceFlowIds
              },
              handlinglist: result.runningTasks,
              allCommentList: result.finishedTasks
            }, '80%', true)
          })
105 106
          break;
        case "B2": //材料分屏按钮
xiaomiao committed
107 108 109
          this.splitScreen = this.splitScreen ? false : true;
          this.$store.dispatch("app/settScreen", this.splitScreen);
          if (this.splitScreen) {
xiaomiao committed
110

xiaomiao committed
111 112 113 114 115 116 117 118 119 120
            //如果当前选项卡为材料信息内容,递减到上一个选项卡内容
            if (this.tabName == this.clxxTab.value) {
              this.tabName = this.tabList[this.clxxIndex - 1].value;
              this.getFromRouter(this.tabList[this.clxxIndex - 1].value);
            }
            //删除材料信息选项卡数据
            this.tabList.splice(this.clxxIndex, 1);
          } else {
            //新增材料信息选项卡数据
            this.tabList.splice(this.clxxIndex, 0, this.clxxTab);
xiaomiao committed
121
          }
122 123 124 125 126 127 128
          break;
        case "B3": //材料导入
          document.getElementById("cldr").click();
          break;
        case "B4":
          this.$popupDialog("登记簿详情", "registerBook/djbFrame", this.currentSelectProps, '80%', true)
          break;
129 130 131 132 133 134 135
        case "B5":
          if (this.currentSelectProps.bdcdyid) {
            getQllxByBdcdyid({ bdcdyid: this.currentSelectProps.bdcdyid }).then(
              (res) => {
                if (res.code === 200) {
                  this.$refs.qllxlist.qllxlistdata = res.result;
                  this.$refs.qllxlist.dialogVisible = true;
xiaomiao committed
136
                }
137 138 139 140
              }
            );
          }
          break;
141
        case "B6":
142 143 144
          this.$popupDialog("打印申请书", "workflow/components/dialog/sqs",
            { bsmSldy: this.currentSelectProps.bsmSldy }, '30%', true
          )
145 146 147 148 149 150 151 152
          break;
        case "B7":
          this.$popupDialog("证书领取", "workflow/components/dialog/zslq",
            { bsmSlsq: this.$route.query.bsmSlsq }, '70%', true
          )
          break;
        case "B8":
          this.$popupDialog('楼盘表', 'lpb/index', {
153 154
            bsm: '',
            onlyShow: true,
155 156 157
          }, '90%', true)
          break;
        case "back": //退回按钮
158
          this.$popupDialog("退回", "workflow/top/back/index", {
159
            bsmSlsq: this.bsmSlsq,
160
            bestepid: this.bestepid ? this.bestepid : ''
161 162 163 164 165
          }, '800px', true)
          break;
        case "transfer": //转件按钮
          getNextLinkInfo({
            bsmSlsq: this.bsmSlsq,
166
            bestepid: this.bestepid ? this.bestepid : ''
167 168 169 170 171 172 173 174 175 176 177 178 179
          }).then((res) => {
            if (res.code === 200) {
              if (res.result) {
                this.sendToNext(res.result);
              } else {
                this.sendToEnd();
              }
            }
          });
          break;
        case "stop": //终止按钮
          this.$popupDialog("终止", "workflow/components/stop", {
            bsmSlsq: this.bsmSlsq,
180
            bestepid: this.bestepid ? this.bestepid : ''
181 182 183 184 185
          }, '600px', true)
          break;
        case "signout":
          window.close();
          //取消认领
186
          unClaimTask(this.bsmSlsq, this.bestepid ? this.bestepid : '')
187 188 189 190
          break;
        case "B9":
          var formdata = new FormData();
          formdata.append("bsmSlsq", this.bsmSlsq);
191
          formdata.append("bestepid", this.bestepid ? this.bestepid : '');
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219
          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) {
                if (res.result.length === 1) {
                  res.result[0].state ? that.$alert("登簿成功!") : that.$alert(res.result[0].msg);;
                }
                else {
                  that.$alert('<div>' + res.result[0].ywh + ',' + res.result[0].msg + '</div>', '登簿明细', {
                    dangerouslyUseHTMLString: true
                  });
                }
              } else {
                that.$alert(res.message);
              }
            });
          });
          break;
        case "rm":
          this.del()
          break;
      }
    },
yuanbo committed
220 221 222 223
    /**
     * @description: del
     * @author: renchao
     */
224
    del () {
225 226 227 228 229 230 231 232
      let formdata = new FormData();
      formdata.append("bsmSlsq", this.bsmSlsq);
      this.$confirm("确定要删除吗, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
xiaomiao committed
233
          deleteFlow(this.bsmSlsq).then((res) => {
xiaomiao committed
234 235 236 237 238 239 240 241 242 243 244
            if (res.code === 200) {
              this.$message({
                type: "success",
                message: "删除成功!",
              });
              window.close();
              window.opener.getBpageList();
            } else {
              this.$message.error(res.message);
            }
          });
245 246 247 248 249 250 251 252
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除",
          });
        });
    },
yuanbo committed
253 254 255 256 257
    /**
     * @description: 发送下一个环节
     * @param {*} obj
     * @author: renchao
     */
258
    sendToNext (obj) {
xiaomiao committed
259
      this.$popupDialog("转出", "djbworkflow/components/zc", {
xiaomiao committed
260
        obj: obj,
xiaomiao committed
261
        bsmSlsq: this.bsmSlsq,
xiaomiao committed
262 263 264
        tabList: this.tabList,
        tshowidea: this.showidea
      }, '600px', true)
265
    },
yuanbo committed
266
    /**
xiaomiao committed
267
     * @description: 转出最后一个流程
yuanbo committed
268 269
     * @author: renchao
     */
270
    sendToEnd () {
xiaomiao committed
271
      this.$popupDialog("转出", "djbworkflow/components/zc", {
xiaomiao committed
272
        obj: "",
xiaomiao committed
273
        bsmSlsq: this.bsmSlsq,
xiaomiao committed
274 275 276 277
        tabList: this.tabList,
        showidea: this.showidea

      }, '600px', true)
278
    },
yuanbo committed
279 280 281 282
    /**
     * @description: 批量操作
     * @author: renchao
     */
283
    handleBatchDel () {
284 285 286 287 288 289 290 291
      this.$popupDialog("批量删除", "workflow/components/batchDel", {
        width: "50%",
        btnShow: false,
        bsmSlsq: this.bsmSlsq,
        dataList: this.unitData,

      })
    },
yuanbo committed
292 293 294 295 296
    /**
     * @description: handleChange
     * @param {*} file
     * @author: renchao
     */
297
    handleChange (file) {
298 299 300 301 302 303 304 305 306 307 308 309
      var formdata = new FormData();
      formdata.append("file", file.raw);
      formdata.append("bsmSldy", this.currentSelectProps.bsmSldy);
      formdata.append("bsmSlsq", this.bsmSlsq);
      uploadUndo(formdata).then(res => {
        if (res.code == 200) {
          this.$message.success("导入成功");
        } else {
          this.$message.error(res.message)
        }
      })
    },
yuanbo committed
310 311 312 313
    /**
     * @description: 上传
     * @author: renchao
     */
314
    beforeUpload (file) {
315 316 317 318
      return true;
    }
  }
}