Pārlūkot izejas kodu

暂存页面多开问题

shenqilong 7 mēneši atpakaļ
vecāks
revīzija
895d716f71

+ 16 - 11
src/business/platform/bpmn/form/action.js

@@ -290,18 +290,23 @@ export default {
                 this.proInstId = proInstId
                 this.bizKey = bizKey
                 // 后置事件
-                this.afterScript(this.actionName, {
-                    data: response.data,
-                    variables: response.variables
-                }, () => {
+                if (response.state === 103) {
                     loading.close()
-                    this.$alert(`保存成功!`, {
-                        showClose: false
-                    }).then(() => {
-                        // 回调上个页面
-                        // this.callbackPage()
-                    }).catch(() => { })
-                })
+                    this.$message.error(response.message)
+                } else {
+                    this.afterScript(this.actionName, {
+                        data: response.data,
+                        variables: response.variables
+                    }, () => {
+                        loading.close()
+                        this.$alert(`保存成功!`, {
+                            showClose: false
+                        }).then(() => {
+                            // 回调上个页面
+                            // this.callbackPage()
+                        }).catch(() => { })
+                    })
+                }
             }).catch(() => {
                 loading.close()
             })

+ 17 - 12
src/views/platform/office/bpmInitiatedProcess/myDraft.vue

@@ -170,18 +170,23 @@ export default {
                     })
                     // 删除选中记录
                     removeDraft({ ids: idList.join(',') }).then(() => {
-                        ActionUtils.removeSuccessMessage()
-                        this.selection = []
-                        // 循环删除对应数据表数据
-                        defKeyArr.forEach(k => {
-                            const deleteParams = {
-                                tableName: `t_${codes[k]}`,
-                                paramWhere: { id_: delList[k].join(',') }
-                            }
-                            this.$common.request('delete', deleteParams, 'post', true)
-                        })
-                        this.$message.success('删除成功!')
-                        this.search()
+                        if (res.state === 103) {
+                            this.$message.warning(res.message)
+                        } else {
+                            ActionUtils.removeSuccessMessage()
+                            this.selection = []
+                            this.$refs.crud.clearSelection()
+                            // 循环删除对应数据表数据
+                            defKeyArr.forEach(k => {
+                                const deleteParams = {
+                                    tableName: `t_${codes[k]}`,
+                                    paramWhere: { id_: delList[k].join(',') }
+                                }
+                                this.$common.request('delete', deleteParams, 'post', true)
+                            })
+                            this.$message.success('删除成功!')
+                            this.search()
+                        }
                     })
                 }).catch(() => {
                     this.$message.error('获取数据表key值出错,请联系开发人员!')