From e50555e9836e7a5b20a3bf08048c3d53eed4b43e Mon Sep 17 00:00:00 2001 From: ndbs Date: Thu, 27 Oct 2022 12:19:10 +0800 Subject: [PATCH] =?UTF-8?q?app2.0=E6=88=91=E7=9A=84=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/nworkflow/myflow/sign.vue | 83 +++++++++++++- .../pages/nworkflow/myflow/single.vue | 102 ++++++++++-------- 2 files changed, 139 insertions(+), 46 deletions(-) diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/myflow/sign.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/myflow/sign.vue index 0496ef9c4..599dcc739 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/myflow/sign.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/myflow/sign.vue @@ -33,7 +33,15 @@ - + + + + + + 确定指派 + 取消 + 提交流程{{ typeText }} @@ -56,7 +64,13 @@ export default { staff: '', remark: '', taskParam: {}, - canvas: true + canvas: true, + + modal: false, + reviewer: [], + reviewerList: [], + reviewerListId:'', + submitPostData:null, } }, @@ -86,6 +100,40 @@ export default { context.setLineJoin('round') touchs = [] }, + + // 指派审核人 + async userAssign() { + if(!this.reviewer.length){ + this.modal = false + this.TOAST('请选择审核人') + return + } + // let formdata = new FormData() + // formdata.append("data",this.taskParam.formreq) + const res = await this.HTTP_POST('learun/adms/newwf/instance', this.taskParam.formreq, `指派审核人时发生错误`) + if(!res){ + return + } + + this.submitPostData.auditors = JSON.stringify({[this.reviewerListId]:this.reviewer.toString()}) + delete this.submitPostData.formreq + // this.submitPostData.auditors[this.reviewerListId] = this.reviewer + console.log(this.submitPostData) + const success = await this.HTTP_POST( + this.type === 'sign' ? 'learun/adms/newwf/sign' : 'learun/adms/newwf/auditors', + this.submitPostData, + `提交[${this.typeText}]时发生错误` + ) + + if (!success) { + return + } + + this.EMIT('task-list-change') + this.NAV_BACK(2) + this.TOAST(`已成功提交${this.typeText}`, 'success') + + }, // 点击「提交」按钮 async submit() { @@ -155,6 +203,37 @@ export default { // #endif // #endif } + + // 是否需要指派审核人 + let isNext = this.taskParam.currentNode.isNext + if (this.taskParam.next == '2') { + isNext = '1'; + } + if (isNext == '1') { + let params = { + code: this.taskParam.schemeCode, + processId: this.taskParam.processId, + taskId: this.taskParam.taskId, + nodeId: this.taskParam.currentNode.id, + operationCode: this.taskParam.code, + } + const userList = await this.HTTP_GET('learun/adms/newwf/auditer', params, `获取审核人时发生错误`) + if (!userList) { + return + } + + let arr = Object.entries(userList) + this.reviewerListId = arr[0][0] + this.reviewerList = arr[0][1].map(item => { + return { + text: item.Name, + value: item.Id + } + }) + this.submitPostData = postData + this.modal = true + return + } const success = await this.HTTP_POST( this.type === 'sign' ? 'learun/adms/newwf/sign' : 'learun/adms/newwf/audit', diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/myflow/single.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/myflow/single.vue index a6521be89..28eae1ff5 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/myflow/single.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/myflow/single.vue @@ -14,8 +14,6 @@ :currentNode="currentNode" :currentTask="currentTask" /> - - @@ -30,7 +28,6 @@ import workflowFormMixins from '../workflow.js' export default { data() { return { - tab: 0, editMode: false, type: 'view', @@ -75,7 +72,6 @@ export default { // 需要字段: mark (是 my 或者不是,表示是否自「我的」列打开) this.type = type this.currentTask = this.GET_PARAM() - console.log(this.type,this.currentTask); this.LOADING('加载表单中…') this.SET_TITLE(this.currentTask.F_Title) // 未完成的子流程,可以编辑 @@ -93,49 +89,38 @@ export default { processId: this.processId, taskId: this.taskId }) - console.log(this.processInfo) + this.currentTask = { + ...this.currentTask, + F_TaskType:(this.processInfo.task&&this.processInfo.task[0])?this.processInfo.task[0].F_Type:undefined, + } this.currentNode = this.getCurrentNode(this.processInfo) - console.log(this.currentNode) this.processList = get(this.processInfo, 'info.TaskLogList', []) - console.log(this.processList) // wfForms 的数组成员 t,表示表单数据项(TAB页) // t.formId 使用表单,根据这个 formId 来获取 scheme 等信息 // t.appurl 使用移动页面,直接跳转到本地的页面;表单结构等均写死在页面里 const { wfForms } = this.currentNode - console.log(wfForms); - // 处理没有有效表单的情况,停止加载 - //if (!wfForms || wfForms.every(t => !t.formId && !t.appurl)) { - //this.HIDE_LOADING() - //this.TOAST('移动表单数据(wfForms)中无有效表单') - //return - //} - //2022-02-14修改 - if (this.type !== 'child') { - if (!wfForms || wfForms.every(t => !t.formId && !t.appurl)) { - this.HIDE_LOADING() - this.TOAST('移动表单数据(wfForms)中无有效表单') - //return - } - } - //2022-02-14修改end - - // 处理移动端本地表单(也就是系统表单)的情况,直接跳转过去 - //const appSysPage = wfForms.find(t => t.appurl) - //2022-02-14修改 - var appSysPage = null - if(wfForms && wfForms.every(t => t.formId && t.appurl)){ - appSysPage = wfForms.find(t => t.appurl) - } - //2022-02-14修改end - if (this.type !== 'child' && appSysPage) { - this.sysFormJump(appSysPage.appurl, { - currentNode: this.currentNode, - currentTask: this.currentTask, - logList: this.processList - }) + if (!wfForms || wfForms.every(t => !t.formId && !t.appurl)) { + this.HIDE_LOADING() + this.TOAST('移动表单数据(wfForms)中无有效表单') return } + + const fetchFolderkeyData=await this.fetchFolderkeyData(this.currentNode , this.processId); + uni.setStorageSync('guids',JSON.stringify(fetchFolderkeyData)); + + // // 处理移动端本地表单(也就是系统表单)的情况,直接跳转过去 + // const appSysPage = wfForms.find(t => t.appurl) + // if (this.type !== 'child' && appSysPage) { + // this.sysFormJump(appSysPage.appurl, { + // currentNode: this.currentNode, + // currentTask: this.currentTask, + // logList: this.processList, + // processInfo:this.processInfo + // }) + // return + // } + if (this.type === 'child') { // 发起子流程的场合 // 获取子流程的流程信息,提取出时间线和表单模板 code @@ -166,6 +151,21 @@ export default { code: this.code, useDefault: true }) + + // 处理移动端本地表单(也就是系统表单)的情况,直接跳转过去 + const appSysPage = wfForms.find(t => t.appurl) + if (this.type !== 'child' && appSysPage) { + this.sysFormJump(appSysPage.appurl, { + currentNode: this.currentNode, + currentTask: this.currentTask, + logList: this.processList, + processInfo:this.processInfo, + formValue, + scheme, + }) + return + } + this.scheme = scheme this.formValue = formValue this.rel = rel @@ -173,8 +173,6 @@ export default { // 不是子流程,可以直接渲染 const schemeData = await this.fetchSchemeData(this.currentNode) const formData = await this.fetchFormData(this.currentNode, this.processId) - console.log(schemeData) - console.log(formData) const { formValue, scheme, rel } = await this.getCustomForm({ formData, schemeData, @@ -182,8 +180,22 @@ export default { processId: this.processId, code: null }) + + // 处理移动端本地表单(也就是系统表单)的情况,直接跳转过去 + const appSysPage = wfForms.find(t => t.appurl) + if (this.type !== 'child' && appSysPage) { + this.sysFormJump(appSysPage.appurl, { + currentNode: this.currentNode, + currentTask: this.currentTask, + logList: this.processList, + processInfo:this.processInfo, + formValue, + scheme, + }) + return + } + this.scheme = scheme - console.log(scheme) this.formValue = formValue this.rel = rel } @@ -242,7 +254,7 @@ export default { this.LOADING('正在提交…') const draftFormValue = this.$refs.form.getFormValue() const draftPostData = await this.getPostData(draftFormValue, this.scheme) - this.HTTP_POST('learun/adms/newwf/draft', draftPostData, '提交草稿失败').then(success => { + this.HTTP_POST('/learun/adms/newwf/draft', draftPostData, '提交草稿失败').then(success => { this.HIDE_LOADING() if (success) { this.EMIT('task-list-change') @@ -271,7 +283,7 @@ export default { postData.parentTaskId = this.taskId } const errorTips = '流程发起失败' - this.HTTP_POST('learun/adms/newwf/childcreate', postData, errorTips).then(success => { + this.HTTP_POST('/learun/adms/newwf/createchildflow', postData, errorTips).then(success => { this.HIDE_LOADING() if (success) { this.EMIT('task-list-change') @@ -295,7 +307,9 @@ export default { processId: currentTask.F_ProcessId, taskId: currentTask.F_Id, formreq: postData.formreq, - taskName: this.currentTask.F_Title + taskName: this.currentTask.F_Title, + currentNode:this.currentNode, + schemeCode:this.code||'' } // 不是加签 if (action.code !== '__sign__') {