From 64f9cbcc1b47ec511841f1af29e4dc638ef822ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=99=93=E7=90=AA?= Date: Wed, 24 Aug 2022 16:55:42 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E7=9F=A5=E5=85=AC=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/learun-app/upload-file.vue | 4 + .../pages/LR_OAModule/noticeExamine.vue | 198 ++++++++++++++++-- .../pages/nworkflow/myflow/single.vue | 3 +- 3 files changed, 187 insertions(+), 18 deletions(-) diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/components/learun-app/upload-file.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/components/learun-app/upload-file.vue index 969f835be..158427de7 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/components/learun-app/upload-file.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/components/learun-app/upload-file.vue @@ -106,6 +106,10 @@ export default { }, async fileClick(index) { + if(typeof this.value[index] == "string"){ + uni.previewImage({ urls: this.value.filter(item=>typeof this.value[index] == "string"), current: this.value[index] }) + return + } const { path, type, uid, size = 0 } = this.value[index] if (this.isImgFile(type)) { uni.previewImage({ urls: [path], current: path }) diff --git a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LR_OAModule/noticeExamine.vue b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LR_OAModule/noticeExamine.vue index 00d89e6e7..397fcc0df 100644 --- a/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LR_OAModule/noticeExamine.vue +++ b/Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/LR_OAModule/noticeExamine.vue @@ -1,12 +1,41 @@ @@ -16,31 +45,166 @@ import moment from 'moment' export default { data() { return { + tab:0, + type:'view', + currentNode:null, + currentTask:null, + taskId:'', + processId:'', + processInfo:null, + processList:[], + formData:{}, ready: false, content: '', + time: '', date: '' } }, - async onLoad() { - await this.init() + async onLoad({type}) { + await this.init(type) }, methods: { - async init() { + async init(type) { + if(type){this.type = type} this.LOADING('加载中…') const noticeItem = this.GET_PARAM() + this.processList = noticeItem.logList + this.currentNode = noticeItem.currentNode + this.currentTask = noticeItem.currentTask + this.processInfo = noticeItem.processInfo + this.taskId = this.currentTask.F_TaskId + this.processId = this.currentTask.F_Id + this.LOADING('加载数据中…') + await this.getFormData(this.processList[0].F_ProcessId) + this.HIDE_LOADING(); + + // this.content = this.CONVERT_HTML(noticeItem.f_content) - this.content = this.CONVERT_HTML(noticeItem.f_content) - - this.time = moment(noticeItem.f_time).format('HH : mm') - this.date = moment(noticeItem.f_time).format('YYYY年 M月 D日') - this.SET_TITLE(noticeItem.f_title) - - this.ready = true - this.HIDE_LOADING() - } + // this.time = moment(noticeItem.f_time).format('HH : mm') + // this.date = moment(noticeItem.f_time).format('YYYY年 M月 D日') + // this.SET_TITLE(noticeItem.f_title) + // this.HIDE_LOADING() + }, + // 获取表单数据 + getFormData(ProgressId){ + return this.HTTP_GET("learun/news/shList",{ProgressId},"加载数据时出错").then(res=>{ + if(res){ + this.formData = res + this.content = res.F_NewsContent + this.ready = true + } + }) + }, + + // 点击审批相关按钮 + async audit(action) { + this.LOADING('加载中…') + const currentTask = this.processInfo.task.find(t => t.F_NodeId === this.currentNode.id) + const postData = await this.getPostData(this.formValue, this.scheme) + const pageParam = { + type: 'sign', + processId: currentTask.F_ProcessId, + taskId: currentTask.F_Id, + formreq: postData.formreq, + taskName: this.currentTask.F_Title + } + // 不是加签 + if (action.code !== '__sign__') { + Object.assign(pageParam, action) + pageParam.type = 'verify' + pageParam.auditors = JSON.stringify({}) + pageParam.isFromSignAudit = Number(this.currentTask.F_TaskType) === 3 + } + this.HIDE_LOADING() + this.NAV_TO('/pages/nworkflow/myflow/sign', pageParam, true) + }, + // 点击操作按钮(非审批类按钮) + async action(taskType) { + switch (taskType) { + // 点击「催办」/「撤销流程」/「标记已阅」按钮 + case 'urge': + case 'revoke': + case 'refer': + const actionText = { urge: '催办', revoke: '撤销', refer: '已阅' }[taskType] + const actionUrl = { urge: '/urge', revoke: '/revoke', refer: '/refer' }[taskType] + + let actionData = this.processId + if (taskType === 'refer') { + actionData = { processId: this.processId, taskId: this.taskId } + } + + if (!(await this.CONFIRM(`${actionText}确认`, `确定要提交${actionText}吗?`, true))) { + return + } + this.LOADING(`提交${actionText}中…`) + this.HTTP_POST(`/newwf${actionUrl}`, actionData, `提交${actionText}失败`).then(success => { + this.HIDE_LOADING() + if (success) { + this.EMIT('task-list-change') + this.TOAST(`成功提交${actionText}`, 'success') + if (taskType === 'revoke') { + this.NAV_BACK() + } + } + }) + break + // 点击「提交草稿」按钮 + case 'draft': + this.CONFIRM('不支持此操作') + return + if (!(await this.CONFIRM('提交确认', '确定要提交草稿吗?', true))) { + return + } + this.LOADING('正在提交…') + const draftFormValue = this.$refs.form.getFormValue() + const draftPostData = await this.getPostData(draftFormValue, this.scheme) + this.HTTP_POST('/newwf​/draft', draftPostData, '提交草稿失败').then(success => { + this.HIDE_LOADING() + if (success) { + this.EMIT('task-list-change') + this.NAV_BACK() + this.TOAST('草稿已保存', 'success') + } + }) + break + // 点击「发起流程」按钮 + case 'submit': + this.CONFIRM('不支持此操作') + return + const verifyResult = this.$refs.form.verifyValue() + if (verifyResult.length > 0) { + this.CONFIRM('表单验证失败', verifyResult.join('\n')) + return + } + if (!(await this.CONFIRM('提交确认', '确定要发起流程吗?', true))) { + return + } + this.LOADING('正在提交…') + const formValue = this.$refs.form.getFormValue() + const postData = await this.getPostData(formValue, this.scheme) + postData.auditors = JSON.stringify({}) + + if (this.type === 'child') { + postData.parentProcessId = this.processId + postData.parentTaskId = this.taskId + } + const errorTips = '流程发起失败' + this.HTTP_POST('/newwf/createchildflow', postData, errorTips).then(success => { + this.HIDE_LOADING() + if (success) { + this.EMIT('task-list-change') + this.NAV_BACK() + this.TOAST('流程发起成功', 'success') + } + }) + break + default: + break + } + }, } } 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 565660754..46313e97d 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 @@ -110,7 +110,8 @@ export default { this.sysFormJump(appSysPage.appurl, { currentNode: this.currentNode, currentTask: this.currentTask, - logList: this.processList + logList: this.processList, + processInfo:this.processInfo }) return }