diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/customform.js b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/customform.js index 4171ab6fa..2902e6a6d 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/customform.js +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/common/customform.js @@ -255,7 +255,7 @@ export default { case 'checkbox': const validValue = item.__sourceData__.map(t => t.value) - const checkboxVal = val.split(',') || [] + const checkboxVal = val?val.split(','):[] return checkboxVal.filter(t => validValue.includes(t)) case 'datetime': diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/releasetask/single.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/releasetask/single.vue index 83c8f34be..ec47bdde6 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/releasetask/single.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/releasetask/single.vue @@ -8,6 +8,13 @@ + + + + 确定指派 + 取消 + @@ -42,7 +49,15 @@ export default { level: '0', levelRange: [{ value: '0', text: '普通' }, { value: '1', text: '重要' }, { value: '2', text: '紧急' }], title: '', - needTitle: false + needTitle: false, + + // 指派审核人数据 + modal: false, + userAssignData:{},//收集数据用来判断是否需要审核人 + reviewerListId:'', + reviewerList:[], + submitPostData:{}, + reviewer: [], } }, @@ -60,6 +75,7 @@ export default { this.LOADING('加载表单中…') this.type = type const currentTask = this.GET_PARAM() + this.userAssignData.currentTask = currentTask const { F_Code: code, F_Id: pid } = currentTask // 设置页面标题 @@ -74,6 +90,8 @@ export default { const processId = this.type === 'create' ? this.GUID('-') : pid const processInfo = await this.fetchProcessInfo({ code, processId: this.type === 'create' ? null : processId }) const currentNode = this.getCurrentNode(processInfo) + + this.userAssignData.currentNode =currentNode // wfForms 的数组成员 t,表示表单数据项(TAB页),t.type 表示类别,注意它是字符串型,用 Number(t.type) 转换 // 为 1 则使用工作流表单,依据它的 .formId @@ -152,7 +170,49 @@ export default { this.TOAST('草稿已保存', 'success') }) }, - + + + // 指派审核人 + async userAssign() { + this.modal = false + if(!this.reviewer.length){ + this.TOAST('请选择审核人') + return + } + + // const res = await this.HTTP_POST('learun/adms/newwf/instance', this.submitPostData.formreq, `指派审核人时发生错误`) + // if(!res){ + // return + // } + // delete this.submitPostData.formreq + + const isAgain = this.type === 'again' + // if (!(await this.CONFIRM('提交确认', `确定要${isAgain ? '重新' : ''}发起流程吗?`, true))) { + // return + // } + this.LOADING('正在提交…') + // this.submitPostData.schemeCode = this.submitPostData.code + // delete this.submitPostData.code + // this.submitPostData.title = '' + // this.submitPostData.createUserId = '' + if (this.needTitle) { + this.submitPostData.title = this.title + } + this.submitPostData.level = this.level + this.submitPostData.auditors = JSON.stringify({[this.reviewerListId]:this.reviewer.toString()}) + + const url = isAgain ? 'learun/adms/newwf/againcreate' : 'learun/adms/newwf/create' + const tips = `流程${isAgain ? '重新' : ''}发起失败` + this.HTTP_POST(url, this.submitPostData, tips).then(success => { + this.HIDE_LOADING() + if (!success) { + return + } + this.EMIT('task-list-change') + this.NAV_BACK() + this.TOAST(`流程${isAgain ? '重新' : ''}发起成功`, 'success') + }) + }, // 发起流程按钮 async submit() { const isAgain = this.type === 'again' @@ -163,6 +223,45 @@ export default { this.CONFIRM('表单验证失败', verifyResult.join('\n')) return } + + const formValue = this.$refs.form.getFormValue() + const postData = await this.getPostData(this.formValue, this.scheme) + + // 判断是否指派审核人 + let isNext = this.userAssignData.currentNode.isNext + Object.assign(this.userAssignData,{ code: 'agree' }) + if (this.userAssignData.next == '2') { + isNext = '1'; + } + if (isNext == '1') { + let params = { + code: this.code, + processId: this.processId, + taskId: this.userAssignData.currentTask.taskId, + nodeId: this.userAssignData.currentNode.id, + operationCode: this.userAssignData.code, + } + this.LOADING('正在获取审核人…') + const userList = await this.HTTP_GET('learun/adms/newwf/auditer', params, `获取审核人时发生错误`) + this.HIDE_LOADING() + 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 + if(this.reviewerList.length>1){ + this.modal = true + return + } + } if (!(await this.CONFIRM('提交确认', `确定要${isAgain ? '重新' : ''}发起流程吗?`, true))) { return @@ -170,8 +269,8 @@ export default { this.LOADING('正在提交…') - const formValue = this.$refs.form.getFormValue() - const postData = await this.getPostData(formValue, this.scheme) + // const formValue = this.$refs.form.getFormValue() + // const postData = await this.getPostData(formValue, this.scheme) if (this.needTitle) { postData.title = this.title }