From 48cd03dbbda51a5f42267e6f3cea4fc238c37615 Mon Sep 17 00:00:00 2001 From: yunuo970428 <405378304@qq.com> Date: Wed, 21 Jun 2023 17:08:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=AD=98=E6=94=BE=E5=9C=B0?= =?UTF-8?q?=E7=82=B9=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cunfangdidianbiangeng.vue | 179 ++++++------------ 1 file changed, 62 insertions(+), 117 deletions(-) diff --git a/anrui-scm/anrui-scm-ui/src/views/workFlow/cunfangdidianbiangengFlow/cunfangdidianbiangeng.vue b/anrui-scm/anrui-scm-ui/src/views/workFlow/cunfangdidianbiangengFlow/cunfangdidianbiangeng.vue index 42c4cb905b..6ae56fcc02 100644 --- a/anrui-scm/anrui-scm-ui/src/views/workFlow/cunfangdidianbiangengFlow/cunfangdidianbiangeng.vue +++ b/anrui-scm/anrui-scm-ui/src/views/workFlow/cunfangdidianbiangengFlow/cunfangdidianbiangeng.vue @@ -128,24 +128,25 @@ - - - 当前环节 - - {{ current.taskName }}->{{ nextNode.name }} - + + + + 当前环节: + + + {{ current.taskName }}->{{ nextNode.name }} - - 意见 - - - - + + + 意见: + + +
- 确 定 + 确 定 取 消
@@ -170,12 +171,10 @@ export default { temp: {}, // 添加和修改 rules: {}, // ------流程所需------------------------------ - currentLink: true, // 控制当前环节一行的显示隐藏 + operation: '', // 点击操作按钮 dialogList: { comment: '' }, - xmlData: '', // 模型xml数据 - taskList: [], startTask: true, current: { taskDefKey: '', @@ -183,8 +182,9 @@ export default { }, nextNode: {}, // 下一环节 nodeDialogVisible: false, - // 同意办理列表 - agreeList: { + currentLink: true, + // 环节所需参数 + linkByParameter: { businessSid: '', comment: '', instanceId: '', @@ -192,22 +192,6 @@ export default { orgSidPath: '', taskDefKey: '', userSid: '' - }, - // 驳回列表 - regectList: { - businessSid: '', - comment: '', - instanceId: '', - taskId: '', - userSid: '' - }, - // 终止列表 - stopList: { - businessSid: '', - comment: '', - instanceId: '', - taskId: '', - userSid: '' } } }, @@ -227,31 +211,17 @@ export default { const data = window.location.href.substr(one) // url解码unescape()已从web中移除,尽量不使用 const obj = JSON.parse(decodeURIComponent(data)) console.log('获取到的obj', obj) - // 同意列表 - this.agreeList.businessSid = obj.businessSid - this.agreeList.instanceId = obj.instanceId - this.agreeList.taskId = obj.taskId - this.agreeList.taskDefKey = obj.taskDefKey - this.agreeList.userSid = window.sessionStorage.getItem('userSid') - this.agreeList.orgSidPath = window.sessionStorage.getItem('orgSidPath') + // 点击(同意、终止、驳回、驳回)操作时所需的参数 + this.linkByParameter.businessSid = obj.businessSid + this.linkByParameter.instanceId = obj.instanceId + this.linkByParameter.taskId = obj.taskId + this.linkByParameter.taskDefKey = obj.taskDefKey + this.linkByParameter.orgSidPath = window.sessionStorage.getItem('orgSidPath') + this.linkByParameter.userSid = window.sessionStorage.getItem('userSid') this.current.taskDefKey = obj.taskDefKey this.current.taskName = obj.taskName - // 驳回列表 - this.regectList.businessSid = obj.businessSid - this.regectList.instanceId = obj.instanceId - this.regectList.taskId = obj.taskId - this.regectList.userSid = window.sessionStorage.getItem('userSid') - // 终止列表 - this.stopList.businessSid = obj.businessSid - this.stopList.instanceId = obj.instanceId - this.stopList.taskId = obj.taskId - this.stopList.userSid = window.sessionStorage.getItem('userSid') - // 办理状态 - this.transactState = obj.transactState - // 加载流程图相关的数据 + // 加载表单数据 this.showInfo(obj.businessSid) - // this.getModelDetail(obj.deployId) - // this.getFlowViewer(obj.instanceId) }, methods: { handleReturn() { @@ -279,12 +249,9 @@ export default { // 同意 openAgree(val) { this.operation = val + this.currentLink = true this.dialogList.comment = '同意' - this.currentLink = true // 控制当前环节一行的显示隐藏 - const formVariables = { - businessSid: this.agreeList.businessSid - } - req.getNextNodesForSubmit({ taskDefKey: this.current.taskDefKey, formVariables }).then((resp) => { + req.getNextNodesForSubmit({ taskDefKey: this.current.taskDefKey, businessSid: this.linkByParameter.businessSid }).then((resp) => { if (resp.success) { var arr = resp.data this.nextNode = arr[0] @@ -296,12 +263,9 @@ export default { // 驳回 openReject(val) { this.operation = val + this.currentLink = true this.dialogList.comment = '' - this.currentLink = true // 控制当前环节一行的显示隐藏 - const formVariables = { - businessSid: this.regectList.businessSid - } - req.getPreviousNodesForReject({ taskDefKey: this.current.taskDefKey, formVariables }).then((resp) => { + req.getPreviousNodesForReject({ taskDefKey: this.current.taskDefKey, businessSid: this.linkByParameter.businessSid }).then((resp) => { if (resp.success) { var arr = resp.data this.nextNode = arr[0] @@ -313,37 +277,37 @@ export default { // 终止 openStop(val) { this.operation = val + this.currentLink = false this.dialogList.comment = '' - this.currentLink = false // 控制当前环节一行的显示隐藏 this.nodeDialogVisible = true }, - /** 选择代办人确认 */ - confirm() { + reject() { if (this.operation === '同意') { this.handleAgree() } else if (this.operation === '驳回') { - this.handleReject() + if (this.dialogList.comment === '') { + this.$message({ showClose: true, type: 'error', message: '请填写审批意见' }) + } else { + this.handleReject() + } } else if (this.operation === '终止') { - this.handleStop() + if (this.dialogList.comment === '') { + this.$message({ showClose: true, type: 'error', message: '请填写审批意见' }) + } else { + this.handleStop() + } } }, /** 同意任务 */ handleAgree() { - this.agreeList.comment = this.dialogList.comment - if (this.agreeList.comment === '') { - this.$message({ - showClose: true, - message: '请填写同意意见!', - type: 'error' - }) - return - } - req.agreeTask(this.agreeList).then((response) => { + this.linkByParameter.comment = this.dialogList.comment + req.agreeTask(this.linkByParameter).then((response) => { if (response.success) { - this.$message({ - showClose: true, + this.$notify({ + title: '提示', message: '执行成功', - type: 'success' + type: 'success', + duration: 2000 }) this.nodeDialogVisible = false // 子页面向父级页面传递值 @@ -359,21 +323,14 @@ export default { }, /** 驳回任务 */ handleReject() { - this.regectList.comment = this.dialogList.comment - if (this.regectList.comment === '') { - this.$message({ - showClose: true, - message: '请填写驳回意见!', - type: 'error' - }) - return - } - req.rejectTask(this.regectList).then((response) => { + this.linkByParameter.comment = this.dialogList.comment + req.revokeTask(this.linkByParameter).then((response) => { if (response.success) { - this.$message({ - showClose: true, + this.$notify({ + title: '提示', message: '执行成功', - type: 'success' + type: 'success', + duration: 2000 }) this.nodeDialogVisible = false // 子页面向父级页面传递值 @@ -389,21 +346,14 @@ export default { }, /** 终止任务 */ handleStop() { - this.stopList.comment = this.dialogList.comment - if (this.stopList.comment === '') { - this.$message({ - showClose: true, - message: '请填写终止意见!', - type: 'error' - }) - return - } - req.breakTask(this.stopList).then((response) => { + this.linkByParameter.comment = this.dialogList.comment + req.breakTask(this.linkByParameter).then((response) => { if (response.success) { - this.$message({ - showClose: true, + this.$notify({ + title: '提示', message: '执行成功', - type: 'success' + type: 'success', + duration: 2000 }) this.nodeDialogVisible = false // 子页面向父级页面传递值 @@ -441,12 +391,7 @@ export default { padding: 30px 0 20px 0; } -.tleftb { - border-bottom: 0 !important; - border-top: 1px solid #e0e3eb; -} -.trightb{ - border-bottom: 0 !important; - border-top: 1px solid #e0e3eb; +.rowClass{ + border-top: 1px solid #E0E3EB; }