Blame view

src/views/workflow/mixin/index.js 11 KB
1
/*
xiaomiao committed
2
 * @Description:
3
 * @Autor: renchao
4
 * @LastEditTime: 2023-12-19 10:02:03
5
 */
6
import Vue from 'vue'
7
import { getPrintTemplateByCode } from "@/api/print";
8
import { uploadUndo } from "@/api/clxx";
9 10
import { getLodop } from "@/utils/LodopFuncs";
import adapter from "@/utils/sqs/adapter";
任超 committed
11 12 13
import {
  stepExpandInfo,
  record,
任超 committed
14
  completeTask,
任超 committed
15
  getNextLinkInfo,
16
  getWorkFlowImage,
17
  getPrintApplicationForm,
18
  deleteFlow,
19 20
  unClaimTask,
  getZdInfo
21
} from "@/api/workFlow.js";
xiaomiao committed
22

23
import { getZrzbsmList } from "@/api/search.js";
24
import { ywPopupDialog } from "@/utils/popup.js";
xiaomiao committed
25

任超 committed
26
export default {
27
  data () {
任超 committed
28 29 30 31 32 33 34 35 36 37 38 39 40
    return {
      //是否开启材料分屏
      splitScreen: false,
      //设置表单组件是否刷选值
      fresh: 10,
      //左侧菜单数据集合
      unitData: [],
      //顶部左侧按钮集合
      leftButtonList: [],
      //顶部右侧按钮集合
      rightButtonList: [],
      //批量按钮名称
      batchButtonName: '',
41
      // 受理申请信息
xiaomiao committed
42
      slsq: {},
1  
renchao@pashanhoo.com committed
43
      dqhj: ""
任超 committed
44 45
    }
  },
1  
renchao@pashanhoo.com committed
46 47
  mounted () {
    this.flowInitParam();
任超 committed
48 49
  },
  methods: {
yuanbo committed
50 51 52 53
    /**
     * @description: 加载流程初始参数
     * @author: renchao
     */
54
    flowInitParam () {
任超 committed
55
      var formdata = new FormData();
1  
renchao@pashanhoo.com committed
56
      formdata.append("bsmSlsq", this.bsmSlsq);
57
      formdata.append("bestepid", this.bestepid ? this.bestepid : '');
58 59 60
      if (this.type) {
        formdata.append("type", "READ_ONLY");
      }
任超 committed
61 62 63
      stepExpandInfo(formdata).then((res) => {
        if (res.code === 200) {
          this.leftButtonList = res.result.button;
64
          if (res.result.properties && res.result.properties.length) {
xiaomiao committed
65
            this.dqhj = res.result.properties[0].value
xiaomiao committed
66
            this.$store.dispatch('getdqhj/setdqjh', this.dqhj);
xiaomiao committed
67
          }
任超 committed
68
          this.rightButtonList = res.result.operation;
69
          this.slsq = res.result.slsq
任超 committed
70
        }
71
      })
任超 committed
72
    },
yuanbo committed
73 74 75 76 77
    /**
     * @description: 流程环节操作按钮
     * @param {*} item
     * @author: renchao
     */
78
    operation (item) {
79 80
      //按钮 B0:选择不动产单元 B1:流程图 B2:材料分屏 B3:材料导入 B4:登记簿 B5:证书预览 B6:打印申请书 B7:证书领取 B8:楼盘表 B9:登簿,B10:打印回执 ZSXG: 证书修改
      //操作按钮 登簿:record  转件:transfer  退回:back  退出:signout 
任超 committed
81 82 83
      let that = this;
      switch (item.value) {
        case "B0":
84
          // this.openDialog()
85
          this.$alert('此功能正在开发', '提示', {
86 87
            confirmButtonText: '确定',
          })
任超 committed
88 89
          break;
        case "B1":
90
          getWorkFlowImage(this.bsmSlsq, this.bestepid ? this.bestepid : '').then(res => {
任超 committed
91
            let { result } = res
92
            this.$popupDialog("流程图", "workflow/components/processViewer", {
任超 committed
93 94
              xml: result.xml,
              finishedInfo: {
xiaomiao committed
95 96
                finishedTaskSet: result.finishedActivityIds,
                unfinishedTaskSet: result.runningActivityIds,
xiaomiao committed
97
                rejectedTaskSet: result.rejectedActivityIds,
xiaomiao committed
98
                finishedSequenceFlowSet: result.finishedSequenceFlowIds
任超 committed
99
              },
100
              handlinglist: result.runningTasks,
xiaomiao committed
101
              allCommentList: result.finishedTasks
102
            }, '80%', true)
任超 committed
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
          })
          break;
        case "B2": //材料分屏按钮
          this.splitScreen = this.splitScreen ? false : true;
          this.$store.dispatch("app/settScreen", this.splitScreen);
          if (this.splitScreen) {
            //如果当前选项卡为材料信息内容,递减到上一个选项卡内容
            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);
          }
          break;
121 122
        case "B3": //材料导入
          document.getElementById("cldr").click();
123
          break;
任超 committed
124
        case "B4":
125
          this.$popupDialog("登记簿详情", "registerBook/djbFrame", this.currentSelectProps, '80%', true)
任超 committed
126 127
          break;
        case "B5":
128
          this.$popupDialog("证书证明预览", "workflow/components/dialog/zsyl", {
任超 committed
129 130
            bsmSlsq: this.bsmSlsq,
            entryType: '1'
“miaofang committed
131
          }, '1230px', true)
任超 committed
132
          break;
133 134 135
        case "B-ZSXG":
          this.$popupDialog("证书修改", "workflow/components/dialog/zsxg", { bsmSlsq: this.bsmSlsq, }, '55%', true)
          break;
蔡俊立 committed
136
        case "B6":
137 138 139
          this.$popupDialog("打印申请书", "workflow/components/dialog/sqs",
            { bsmSldy: this.currentSelectProps.bsmSldy }, '30%', true
          )
140
          break;
任超 committed
141
        case "B7":
142 143
          this.$popupDialog("证书领取", "workflow/components/dialog/zslq",
            { bsmSlsq: this.$route.query.bsmSlsq }, '70%', true
144
          )
任超 committed
145
          break;
146
        case "B8":
147
          !window.djlx && getZrzbsmList(this.bsmSlsq).then((res) => {
yangwei committed
148
            if (res.code === 200) {
149
              ywPopupDialog('楼盘表', 'lpb/index', {
yangwei committed
150
                bsm: res.result[0],
151
                onlyShow: false,
152
                unitData: window.unitData,
153 154
                bsmSlsq: this.bsmSlsq,
                showSave: true,
155
                djlx: window.djlx
156
              }, '85%', true, false)
157
            } else {
yangwei committed
158 159 160
              this.$message.error(res.message)
            }
          })
161 162 163
            .catch((err) => {
              this.$message.error(err)
            });
164
          window.djlx && ywPopupDialog('楼盘表', 'lpb/zjgcdy', {
165 166
            onlyShow: false,
            unitData: window.unitData,
167 168
            bsmSlsq: this.bsmSlsq,
            showSave: true,
169
            djlx: window.djlx
170
          }, '85%', true, false)
171
          break;
172 173
        // 图形定位
        case "B-TXDW":
174 175 176 177
          getZdInfo(this.currentSelectProps.bdcdyid).then(res => {
            this.bsmZd = res?.result[0]?.bsmZd
            this.$popupDialog('图形定位', 'workflow/components/dialog/txdw', { bsmZd: this.bsmZd }, '85%', true)
          })
178
          break;
任超 committed
179
        case "back": //退回按钮
180
          this.$popupDialog("退回", "workflow/components/th", {
181
            bsmSlsq: this.bsmSlsq,
182
            bestepid: this.bestepid ? this.bestepid : ''
183
          }, '800px', true)
任超 committed
184 185 186 187
          break;
        case "transfer": //转件按钮
          getNextLinkInfo({
            bsmSlsq: this.bsmSlsq,
188
            bestepid: this.bestepid ? this.bestepid : ''
任超 committed
189 190 191 192 193 194 195 196 197 198 199
          }).then((res) => {
            if (res.code === 200) {
              if (res.result) {
                this.sendToNext(res.result);
              } else {
                this.sendToEnd();
              }
            }
          });
          break;
        case "stop": //终止按钮
200
          this.$popupDialog("终止", "workflow/components/stop", {
任超 committed
201
            bsmSlsq: this.bsmSlsq,
202
            bestepid: this.bestepid ? this.bestepid : ''
203
          }, '600px', true)
任超 committed
204 205 206 207
          break;
        case "signout":
          window.close();
          //取消认领
208
          unClaimTask(this.bsmSlsq, this.bestepid ? this.bestepid : '')
任超 committed
209 210 211 212
          break;
        case "B9":
          var formdata = new FormData();
          formdata.append("bsmSlsq", this.bsmSlsq);
213
          formdata.append("bestepid", this.bestepid ? this.bestepid : '');
任超 committed
214
          this.$confirm("请确认是否登簿", "提示", {
215
            iconClass: "el-icon-info", //自定义图标样式
任超 committed
216 217 218 219 220 221 222 223
            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) {
224 225 226
                  res.result[0].state ? that.$message({
                    message: '登簿成功',
                    type: 'success'
227
                  }) : ywPopupDialog("登簿错误明细", "workflow/components/dialog/dblist", { result: res.result }, '30%', true)
任超 committed
228 229
                }
                else {
230
                  ywPopupDialog("登簿错误明细", "workflow/components/dialog/dblist", { result: res.result }, '30%', true)
任超 committed
231 232
                }
              } else {
233
                that.$message.error(res.message)
任超 committed
234
              }
235 236
            })
          })
任超 committed
237
          break;
238 239
        case "B10":
          break;
赵千 committed
240 241
        case "rm":
          this.del()
242
          break;
任超 committed
243 244
      }
    },
yuanbo committed
245 246 247 248
    /**
     * @description: del
     * @author: renchao
     */
赵千 committed
249 250 251 252 253 254
    del () {
      let formdata = new FormData();
      formdata.append("bsmSlsq", this.bsmSlsq);
      this.$confirm("确定要删除吗, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
255
        type: "warning"
赵千 committed
256 257 258 259 260 261 262 263 264
      })
        .then(() => {
          deleteFlow(formdata).then((res) => {
            if (res.code === 200) {
              this.$message({
                type: "success",
                message: "删除成功!",
              });
              window.close();
265
              window.opener.getBpageList();
赵千 committed
266 267 268
            } else {
              this.$message.error(res.message);
            }
269
          })
赵千 committed
270 271 272 273
        })
        .catch(() => {
          this.$message({
            type: "info",
274 275 276
            message: "已取消删除"
          })
        })
赵千 committed
277
    },
xiaomiao committed
278 279 280 281 282
    /**
     * @description: 发送下一个环节
     * @param {*} obj
     * @author: renchao
     */
283
    sendToNext (obj) {
xiaomiao committed
284
      this.$popupDialog("转出", "djbworkflow/components/zc", {
285
        obj: obj,
xiaomiao committed
286 287 288
        bsmSlsq: this.bsmSlsq,
        tabList: this.tabList
      }, '800px', true)
任超 committed
289
    },
xiaomiao committed
290 291
    /**
     * @description: 转出最后一个流程
xiaomiao committed
292
     * @param {*} obj
xiaomiao committed
293 294
     * @author: renchao
     */
295
    sendToEnd (obj) {
xiaomiao committed
296
      this.$popupDialog("转出", "djbworkflow/components/zc", {
297
        obj: "",
xiaomiao committed
298 299 300
        bsmSlsq: this.bsmSlsq,
        tabList: this.tabList
      }, '800px', true)
蔡俊立 committed
301
    },
yuanbo committed
302 303 304 305
    /**
     * @description: 批量操作
     * @author: renchao
     */
306
    handleBatchDel () {
xiaomiao committed
307
      this.$popupDialog("批量删除", "workflow/components/batchDel", {
蔡俊立 committed
308
        width: "50%",
xiaomiao committed
309 310
        btnShow: false,
        bsmSlsq: this.bsmSlsq,
1  
renchao@pashanhoo.com committed
311 312
        dataList: this.unitData,

蔡俊立 committed
313
      })
314
    },
yuanbo committed
315 316 317 318 319
    /**
     * @description: handleChange
     * @param {*} file
     * @author: renchao
     */
320
    handleChange (file) {
321 322 323 324 325
      var formdata = new FormData();
      formdata.append("file", file.raw);
      formdata.append("bsmSldy", this.currentSelectProps.bsmSldy);
      formdata.append("bsmSlsq", this.bsmSlsq);
      uploadUndo(formdata).then(res => {
326
        if (res.code == 200) {
327
          this.$message.success("导入成功")
328
        } else {
329 330 331
          this.$message.error(res.message)
        }
      })
332
    },
yuanbo committed
333 334 335 336 337
    /**
     * @description: 上传
     * @param {*} file
     * @author: renchao
     */
338
    beforeUpload (file) {
339
      return true;
340
    }
任超 committed
341 342
  }
}