소스 검색

app 会议管理流程

应县
yxq 1 년 전
부모
커밋
f33c43ea30
2개의 변경된 파일708개의 추가작업 그리고 0개의 파일을 삭제
  1. +270
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/PersonnelManagement/MeetingManagement/singleFlow.vue
  2. +438
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/PersonnelManagement/MeetingManagement/single_.vue

+ 270
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/PersonnelManagement/MeetingManagement/singleFlow.vue 파일 보기

@@ -0,0 +1,270 @@
<template>
<view id="notice" class="page">
<!-- 顶部页签 -->
<l-nav v-model="tab" :items="['表单信息', '流程信息']" type="flex" class="solid-bottom" />
<view v-if="ready && tab == 0">
<l-input
:value="formData.MeetingManagement.MeetingTitle"
disabled
title="会议主题"
/>
<l-select
:value="formData.MeetingManagement.MeetingPlace"
disabled
:range="dataSource.MeetingManagement.MeetingPlace"
title="会议地点"
/>
<l-datetime-picker
:value="formData.MeetingManagement.BeginTime"
disabled
title="开始时间"
/>
<l-datetime-picker
:value="formData.MeetingManagement.EndTime"
disabled
title="结束时间"
/>
<l-organize-picker
:value="formData.MeetingManagement.CreateUser"
readonly
type="user"
title="申请人"
/>
<l-input
:value="formData.MeetingManagement.Linkman"
readonly
title="联系人"
/>
<l-input
:value="formData.MeetingManagement.LinkPhone"
readonly
title="联系方式"
/>
<l-organize-picker
:value="formData.MeetingManagement.InternalParticipants"
readonly
type="user"
title="参会人员"
:multiple="true"
/>
<l-organize-picker
:value="formData.MeetingManagement.RecordPerson"
readonly
type="user"
title="会议记录者"
/>
<l-textarea
:value="formData.MeetingManagement.Content"
readonly
title="会议内容"
/>
<l-upload-file
:value="fileList"
readonly
title="附件上传"
/>
</view>
<view v-if="ready && tab == 1" class="progress"><l-workflow-timeline :processList="processList" /></view>
<!-- <view class="padding-sm text-grey notice-info">
<view class="text-right">本页内容发布于 {{ time }}</view>
<view class="text-right">{{ date }}</view>
</view> -->
</view>
</template>

<script>
import moment from 'moment'
import workflowFormMixins from '@/pages/nworkflow/workflow.js'

export default {
mixins: [workflowFormMixins],
data() {
return {
tab:0,
type:'view',
currentNode:null,
currentTask:null,
taskId:'',
processId:'',
processInfo:null,
processList:[],
formData:{},
ready: false,
content: '',
time: '',
date: '',
fileList:[],
// 数据源
dataSource: {
MeetingManagement: {
MeetingPlace: [],
},
} ,
}
},

async onLoad({type}) {
await this.init(type)
},

methods: {
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.formValue = noticeItem.formValue
this.scheme = noticeItem.scheme
// 拉取表单数据,同时拉取所有来自数据源的选单数据
await Promise.all([
this.FETCH_DATASOURCE('ConferenceRoom').then(result => {
this.dataSource.MeetingManagement.MeetingPlace = result.data.map(t => ({ text: t.name, value: t.id }))
}),
() => {}
])
await this.getFormData(this.processList[0].F_ProcessId)
this.HIDE_LOADING();
// 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.HIDE_LOADING()
},
// 获取表单数据
getFormData(ProcessId){
return this.HTTP_GET("learun/adms/purchaseservice/shList",{ProcessId},"加载数据时出错").then(async res=>{
if(res){
// res.F_SourceName = res.F_SourceName&&this.GET_GLOBAL('department')[res.F_SourceName]? this.GET_GLOBAL('department')[res.F_SourceName].name : res.F_SourceName
this.formData = res
let fileList = await this.getFileListById(res.Purchase_Service.Files)
if(fileList&&fileList.length){
this.fileList = fileList
}
// 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,
currentNode:this.currentNode,
code:this.code||''
}
// 不是加签
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
}
},
}
}
</script>

+ 438
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/PersonnelManagement/MeetingManagement/single_.vue 파일 보기

@@ -0,0 +1,438 @@
<template>
<view class="page">
<view v-if="ready">
<l-input
@input="setValue('MeetingManagement.MeetingTitle', $event)"
:value="getValue('MeetingManagement.MeetingTitle')"
:disabled="!edit"
title="会议主题"
/>
<l-select
@input="setValue('MeetingManagement.MeetingPlace', $event)"
:value="getValue('MeetingManagement.MeetingPlace')"
:disabled="!edit"
:range="dataSource.MeetingManagement.MeetingPlace"
title="会议地点"
/>
<l-datetime-picker
@input="setValue('MeetingManagement.BeginTime', $event)"
:value="getValue('MeetingManagement.BeginTime')"
:disabled="!edit"
title="开始时间"
/>
<l-datetime-picker
@input="setValue('MeetingManagement.EndTime', $event)"
:value="getValue('MeetingManagement.EndTime')"
:disabled="!edit"
title="结束时间"
/>
<!-- <l-organize-picker
@input="setValue('MeetingManagement.CreateUser', $event)"
:value="getValue('MeetingManagement.CreateUser')"
:readonly="!edit"
type="user"
title="申请人"
/> -->
<l-input
@input="setValue('MeetingManagement.Linkman', $event)"
:value="getValue('MeetingManagement.Linkman')"
:readonly="!edit"
title="联系人"
/>
<l-input
@input="setValue('MeetingManagement.LinkPhone', $event)"
:value="getValue('MeetingManagement.LinkPhone')"
:readonly="!edit"
title="联系方式"
/>
<l-organize-picker
@input="setValue('MeetingManagement.InternalParticipants', $event)"
:value="getValue('MeetingManagement.InternalParticipants')"
:readonly="!edit"
type="user"
title="参会人员"
:multiple="true"
/>
<l-organize-picker
@input="setValue('MeetingManagement.RecordPerson', $event)"
:value="getValue('MeetingManagement.RecordPerson')"
:readonly="!edit"
type="user"
title="会议记录者"
/>
<l-textarea
@input="setValue('MeetingManagement.Content', $event)"
:value="getValue('MeetingManagement.Content')"
:readonly="!edit"
title="会议内容"
/>
<l-upload-file
@input="setValue('MeetingManagement.Files', $event)"
:value="getValue('MeetingManagement.Files')"
:readonly="!edit"
:number="9"
title="附件上传"
/>
</view>
<!-- 指派审核人弹窗 -->
<l-modal v-model="modal" @close="reviewer = ''" title="指派审核人">
<l-checkbox-picker @input="(e)=>{reviewer = e}" :value="reviewer" :readonly="false" :range="reviewerList"
required title="审核人" />
<l-button @click="userAssign" color="blue" class="block" block>确定指派</l-button>
<l-button @click="()=>{modal = false;reviewer = ''}" line="blue" class="block margin-top-sm" block>取消</l-button>
</l-modal>
<view v-if="ready && current.Purchase_Service && current.Purchase_Service.status != '1'" class="bg-white margin-tb padding" style="padding-top: 0; overflow: hidden;">
<l-button v-if="edit" @click="action('save')" size="lg" color="green" class="block margin-top" block>
保存
</l-button>
<l-button v-if="edit" @click="action('save',true)" size="lg" color="orange" class="block margin-top" block>
保存并提交
</l-button>
<!-- <l-button v-if="!edit && mode !== 'create'" @click="action('edit')" size="lg" line="orange" class="block margin-top" block>
编辑本页
</l-button>
<l-button v-if="edit && mode !== 'create'" @click="action('reset')" size="lg" line="red" class="block margin-top" block>
取消编辑
</l-button>
<l-button v-if="!edit && mode !== 'create'" @click="action('delete')" size="lg" line="red" class="block margin-top" block>
删除
</l-button> -->
</view>
</view>
</template>
<script>
/*
* 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 上海力软信息技术有限公司
* 创建人:超级管理员
* 日 期:2020-10-20 09:25
* 描 述:活动安排
*/
/**
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录:
* { "path": "pages/PersonnelManagement/BookBorrow/single", "style": { "navigationBarTitleText": "表单详情页" } }
*
* (navigationBarTitleText 字段为本页面的标题文本,可以修改)
* (必须自行操作该步骤,力软代码生成器不会自动帮您修改 /pages.json 文件)
*/
import get from 'lodash/get'
import set from 'lodash/set'
import moment from 'moment'
import customPageMixins from '@/common/custompage.js'
import workflowFormMixins from '@/pages/nworkflow/workflow.js'
export default {
mixins: [workflowFormMixins,customPageMixins,],
data() {
return {
// 页面相关参数
id: null,
mode: null,
edit: null,
ready: false,
// 表单数据
current: {},
origin: {},
// 表单项数据结构
scheme: {
MeetingManagement: {
MeetingTitle: { type: 'text', title: '会议主题' ,verify:"NotNull"},
MeetingPlace: { type: 'select', title: '会议地点', dataSource: '0',verify:"NotNull" },
BeginTime: { type: 'datetime', title: '开始时间', dateformat: '1',verify:"NotNull" },
EndTime: { type: 'datetime', title: '结束时间', dateformat: '1',verify:"NotNull" },
InternalParticipants: { type: 'organize', title: '参会人员', dataType: 'user',verify:"NotNull" },
RecordPerson: { type: 'organize', title: '会议记录者', dataType: 'user' },
Content: { type: 'texteditor', title: '会议内容',verify:"NotNull" },
Linkman: { type: 'text', title: '联系人',verify:"NotNull" },
LinkPhone: { type: 'text', title: '联系方式',verify:"Mobile" },
Files: { type: 'upload', title: '附件上传' },
// CreateUser: { type: 'organize', title: '申请人', dataType: 'user',verify:"NotNull" },
},
},
// 数据源
dataSource: {
MeetingManagement: {
MeetingPlace: [],
},
},
type:null,
code:null,
level: '1',
processId:null,
// 指派审核人数据
modal: false,
userAssignData:{},//收集数据用来判断是否需要审核人
reviewerListId:'',
reviewerList:[],
submitPostData:{},
reviewer: [],
}
},
async onLoad({ type, id }) {
await this.init(type, id)
},
methods: {
// 页面初始化
async init(type, id) {
this.LOADING('加载数据中...')
this.id = id
this.mode = type
this.edit = ['create', 'edit'].includes(this.mode)
this.type = type
this.code = '1-14'
const currentTask = this.GET_PARAM()
// 新建表单则生成
this.processId = this.GUID('-')
const processInfo = await this.fetchProcessInfo({ code:this.code })
const currentNode = this.getCurrentNode(processInfo)
this.userAssignData.currentTask = currentTask
this.userAssignData.currentNode = currentNode
// wfForms 的数组成员 t,表示表单数据项(TAB页),t.type 表示类别,注意它是字符串型,用 Number(t.type) 转换
// 为 1 则使用工作流表单,依据它的 .formId
// 不为 1 则使用系统表单,依据它的 .appurl
const { wfForms } = currentNode
// 处理没有有效表单的情况,停止加载
if (!wfForms || wfForms.length <= 0) {
this.HIDE_LOADING()
this.TOAST('移动表单数据(wfForms)中无有效表单')
return
}
// 拉取表单数据,同时拉取所有来自数据源的选单数据
await Promise.all([
this.FETCH_DATASOURCE('ConferenceRoom').then(result => {
this.dataSource.MeetingManagement.MeetingPlace = result.data.map(t => ({ text: t.name, value: t.id }))
}),
() => {}
])
await this.fetchForm()
this.ready = true
this.HIDE_LOADING()
},
// 加载表单数据
async fetchForm() {
if (this.mode === 'create') {
this.origin = await this.getDefaultForm()
let userInfo = this.GET_GLOBAL('loginUser');
this.origin.Purchase_Service.DepartmentId = userInfo.departmentId
this.origin.Purchase_Service.CreatorId = userInfo.userId
} else {
const result = await this.HTTP_GET('learun/adms/PersonnelManagement/MeetingManagement/form', this.id)
this.origin = await this.formatFormData(result)
}
this.current = this.COPY(this.origin)
},
// 指派审核人
async userAssign() {
this.modal = false
if(!this.reviewer.length){
this.TOAST('请选择审核人')
return
}
this.LOADING('正在提交…')
let postData = {
auditors :JSON.stringify({[this.reviewerListId]:this.reviewer.toString()}),
level : this.level,
code: this.code,
processId: this.processId,
}
const url = 'learun/adms/newwf/createnoform'
const tips = `流程发起失败`
this.HTTP_POST(url, postData, tips).then(success => {
this.HIDE_LOADING()
if (!success) {
return
}
this.submit1()
})
},
// 发起流程
async submit() {
// 判断是否指派审核人
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: '',
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
}
})
if(this.reviewerList.length>1){
this.modal = true
return
}
}
this.LOADING('正在提交…')
let postData = {
auditors :JSON.stringify({}),
level : this.level,
code: this.code,
processId: this.processId,
}
const url = 'learun/adms/newwf/createnoform'
const tips = `流程发起失败`
this.HTTP_POST(url, postData, tips).then(success => {
this.HIDE_LOADING()
if (!success) {
return
}
this.submit1()
})
},
// 提交
async submit1(){
// if (!(await this.CONFIRM('提交项目', '是否确认提交该项?', true))) {
// return
// }
this.LOADING('正在提交...')
this.HTTP_POST('/learun/adms/PersonnelManagement/MeetingManagement/submit', {Id:this.id, ProcessId:this.processId} , '提交失败').then(
success => {
this.HIDE_LOADING()
if (!success) {
return
}
this.TOAST('提交成功', 'success')
this.EMIT('LogisticsManagement-Purchase_Service-list-change')
this.NAV_BACK()
})
return
},

// 点击 「编辑」、「重置」、「保存」、「删除」 按钮
async action(type,isSubmit=false) {
switch (type) {
case 'edit':
this.edit = true
break
case 'reset':
this.current = this.COPY(this.origin)
this.edit = false
break
case 'save':
if(!this.current.Purchase_Service.TotalAmount){
this.CONFIRM('表单验证失败', '[劳务维修详情]:价格为空或错误')
return
}
const verifyResult = this.verifyForm()
if (verifyResult.length > 0) {
this.CONFIRM('表单验证失败', verifyResult.join('\n'))
return
}
if (!(await this.CONFIRM('提交确认', '确定要提交本页表单内容吗?', true))) {
return
}
this.LOADING('正在提交...')
const postData = await this.getPostData(this.id)
// 处理采购列表数据
let strEntity = JSON.parse(postData.strEntity)
for (let s of strEntity.Purchase_Service_Details) {
s.Price = Number(s.Price);
// s.Quantity = Number(s.Quantity)
}
postData.DetailList = JSON.stringify(strEntity.Purchase_Service_Details)
delete strEntity.Purchase_Service_Details
// 赋值部门和人员数据
let userInfo = this.GET_GLOBAL('loginUser');
let obj = this.dataSource.Purchase_Service.DepartmentId.find(e=>e.value == this.origin.Purchase_Service.DepartmentId)
strEntity.DepartmentName = obj?obj.text:''
strEntity.CreatorName = userInfo.realName
postData.strEntity = JSON.stringify(strEntity)
// console.log(postData,JSON.parse(postData.strEntity))
this.HTTP_POST('learun/adms/PersonnelManagement/MeetingManagement/save', postData, '表单提交保存失败').then(success => {
this.HIDE_LOADING()
if (!success) {
return
}
this.id = success.Id
if(isSubmit){
this.submit()
return
}
this.EMIT('LogisticsManagement-Purchase_Service-list-change')
setTimeout(()=>this.NAV_BACK(),500)
this.TOAST('提交保存成功')
})
break
case 'delete':
if (!(await this.CONFIRM('删除项目', '确定要删除本项吗?', true))) {
return
}
this.LOADING('提交删除中...')
this.HTTP_POST('learun/adms/PersonnelManagement/MeetingManagement/delete', this.id, '删除失败').then(success => {
this.HIDE_LOADING()
if (!success) {
return
}
this.EMIT('LogisticsManagement-Purchase_Service-list-change')
this.NAV_BACK()
this.this.TOAST('删除成功', 'success')
})
break
default: break
}
},
// 获取表单值
getValue(path) {
return get(this.current, path)
},
// 设置表单值
setValue(path, val) {
set(this.current, path, val)
},
}
}
</script>

불러오는 중...
취소
저장