Blame view

src/views/workflow/mixin/index.js 11 KB
1
/*
xiaomiao committed
2
 * @Description:
3
 * @Autor: renchao
renchao@pashanhoo.com committed
4
 * @LastEditTime: 2024-01-23 09:57:51
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
          getZdInfo(this.currentSelectProps.bdcdyid).then(res => {
            this.bsmZd = res?.result[0]?.bsmZd
renchao@pashanhoo.com committed
176
            console.log(this.bsmZd);
177 178
            this.$popupDialog('图形定位', 'workflow/components/dialog/txdw', { bsmZd: this.bsmZd }, '85%', true)
          })
179
          break;
任超 committed
180
        case "back": //退回按钮
181
          this.$popupDialog("退回", "workflow/components/th", {
182
            bsmSlsq: this.bsmSlsq,
183
            bestepid: this.bestepid ? this.bestepid : ''
184
          }, '800px', true)
任超 committed
185 186 187 188
          break;
        case "transfer": //转件按钮
          getNextLinkInfo({
            bsmSlsq: this.bsmSlsq,
189
            bestepid: this.bestepid ? this.bestepid : ''
任超 committed
190 191 192 193 194 195 196 197 198 199 200
          }).then((res) => {
            if (res.code === 200) {
              if (res.result) {
                this.sendToNext(res.result);
              } else {
                this.sendToEnd();
              }
            }
          });
          break;
        case "stop": //终止按钮
201
          this.$popupDialog("终止", "workflow/components/stop", {
任超 committed
202
            bsmSlsq: this.bsmSlsq,
203
            bestepid: this.bestepid ? this.bestepid : ''
204
          }, '600px', true)
任超 committed
205 206 207 208
          break;
        case "signout":
          window.close();
          //取消认领
209
          unClaimTask(this.bsmSlsq, this.bestepid ? this.bestepid : '')
任超 committed
210 211 212 213
          break;
        case "B9":
          var formdata = new FormData();
          formdata.append("bsmSlsq", this.bsmSlsq);
214
          formdata.append("bestepid", this.bestepid ? this.bestepid : '');
任超 committed
215
          this.$confirm("请确认是否登簿", "提示", {
216
            iconClass: "el-icon-info", //自定义图标样式
任超 committed
217 218 219 220 221 222 223 224
            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) {
225 226 227
                  res.result[0].state ? that.$message({
                    message: '登簿成功',
                    type: 'success'
228
                  }) : ywPopupDialog("登簿错误明细", "workflow/components/dialog/dblist", { result: res.result }, '30%', true)
任超 committed
229 230
                }
                else {
231
                  ywPopupDialog("登簿错误明细", "workflow/components/dialog/dblist", { result: res.result }, '30%', true)
任超 committed
232 233
                }
              } else {
234
                that.$message.error(res.message)
任超 committed
235
              }
236 237
            })
          })
任超 committed
238
          break;
239 240
        case "B10":
          break;
赵千 committed
241 242
        case "rm":
          this.del()
243
          break;
任超 committed
244 245
      }
    },
yuanbo committed
246 247 248 249
    /**
     * @description: del
     * @author: renchao
     */
赵千 committed
250 251 252 253 254 255
    del () {
      let formdata = new FormData();
      formdata.append("bsmSlsq", this.bsmSlsq);
      this.$confirm("确定要删除吗, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
256
        type: "warning"
赵千 committed
257 258 259 260 261 262 263 264 265
      })
        .then(() => {
          deleteFlow(formdata).then((res) => {
            if (res.code === 200) {
              this.$message({
                type: "success",
                message: "删除成功!",
              });
              window.close();
266
              window.opener.getBpageList();
赵千 committed
267 268 269
            } else {
              this.$message.error(res.message);
            }
270
          })
赵千 committed
271 272 273 274
        })
        .catch(() => {
          this.$message({
            type: "info",
275 276 277
            message: "已取消删除"
          })
        })
赵千 committed
278
    },
xiaomiao committed
279 280 281 282 283
    /**
     * @description: 发送下一个环节
     * @param {*} obj
     * @author: renchao
     */
284
    sendToNext (obj) {
xiaomiao committed
285
      this.$popupDialog("转出", "djbworkflow/components/zc", {
286
        obj: obj,
xiaomiao committed
287 288 289
        bsmSlsq: this.bsmSlsq,
        tabList: this.tabList
      }, '800px', true)
任超 committed
290
    },
xiaomiao committed
291 292
    /**
     * @description: 转出最后一个流程
xiaomiao committed
293
     * @param {*} obj
xiaomiao committed
294 295
     * @author: renchao
     */
296
    sendToEnd (obj) {
xiaomiao committed
297
      this.$popupDialog("转出", "djbworkflow/components/zc", {
298
        obj: "",
xiaomiao committed
299 300 301
        bsmSlsq: this.bsmSlsq,
        tabList: this.tabList
      }, '800px', true)
蔡俊立 committed
302
    },
yuanbo committed
303 304 305 306
    /**
     * @description: 批量操作
     * @author: renchao
     */
307
    handleBatchDel () {
xiaomiao committed
308
      this.$popupDialog("批量删除", "workflow/components/batchDel", {
蔡俊立 committed
309
        width: "50%",
xiaomiao committed
310 311
        btnShow: false,
        bsmSlsq: this.bsmSlsq,
1  
renchao@pashanhoo.com committed
312 313
        dataList: this.unitData,

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