Browse Source

app 会议管理流程开发

应县
yxq 1 year ago
parent
commit
bc1af0c00a
6 changed files with 673 additions and 647 deletions
  1. +1
    -1
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js
  2. +6
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages.json
  3. +42
    -4
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/PersonnelManagement/MeetingManagement/list.vue
  4. +352
    -204
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/PersonnelManagement/MeetingManagement/single.vue
  5. +0
    -438
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/PersonnelManagement/MeetingManagement/single_.vue
  6. +272
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/PersonnelManagement/MeetingManagement/single_old.vue

+ 1
- 1
Learun.Framework.Ultimate V7/LearunApp-2.2.0/config.js View File

@@ -21,7 +21,7 @@ export default {
// "http://192.168.2.98:8088/"
// ],
"apiHost": [
"http://cyzjzx.gnway.cc:31218/"//测试地址接口
"http://192.168.10.58:8012/"//测试地址接口
// "http://219.139.155.38:8687/"//正式地址接口
// "http://192.168.10.175:8088/"
],


+ 6
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages.json View File

@@ -1032,6 +1032,12 @@
"navigationBarTitleText": "详情"
}
},
{
"path": "pages/PersonnelManagement/MeetingManagement/singleFlow",
"style": {
"navigationBarTitleText": "会议工作管理"
}
},
//会议纪要
{
"path": "pages/PersonnelManagement/MeetingMinutes/list",


+ 42
- 4
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/PersonnelManagement/MeetingManagement/list.vue View File

@@ -68,15 +68,41 @@

<!-- showButton
buttonText="会议纪要" -->
<l-customlist-action
:showButton="item.CheckStatus==0 && user.userId == item.CreateUser" buttonText="提交"
@join="action('check', item.Id)"
<!-- <l-customlist-action
:showButton="item.CheckStatus==0 && user.userId == item.CreateUser"
:showEdit="item.CheckStatus=='0'"
@edit="action('edit', item.Id)"
:showDelete="item.CheckStatus=='0'"
@delete="action('delete', item.Id)"
@view="action('view', item.Id)"
/>
/> -->
<view class="customlist-banner-action">
<view
v-if="item.CheckStatus==0 && user.userId == item.CreateUser"
@click="action('delete', item.Id)"
class="customlist-banner-action-btn line-red text-sm"
style="border: currentColor 1px solid">
<l-icon type="delete" />
删除
</view>
<view
v-if="item.CheckStatus==0 && user.userId == item.CreateUser"
@click="action('edit', item.Id, item)"
class="customlist-banner-action-btn line-blue text-sm"
style="border: currentColor 1px solid">
<l-icon type="edit" />
编辑
</view>
<view @click="action('view', item.Id, item)"
class="customlist-banner-action-btn line-blue text-sm"
style="border: currentColor 1px solid">
<l-icon type="search" />
查看
</view>
</view>
</view>
</l-customlist>
</l-scroll-list>
@@ -420,4 +446,16 @@ export default {
<style lang="less" scoped>
@import "~@/common/css/sidepage.less";
@import "~@/common/css/customlist.less";
.customlist-banner-action {
margin-top: 20rpx;
text-align: right;

.customlist-banner-action-btn {
display: inline-block;
padding: 4px 6px;
margin: 0 3px;
border-radius: 3px;
text-align: center;
}
}
</style>

+ 352
- 204
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/PersonnelManagement/MeetingManagement/single.vue View File

@@ -1,38 +1,38 @@
<template>
<view class="page">
<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.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')"
@@ -53,220 +53,368 @@
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>

<view v-if="ready&&(origin.MeetingManagement.CheckStatus=='0'||edit)" 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 && 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-2021 上海力软信息技术有限公司
* 创建人:超级管理员
* 日 期:2021-02-21 10:07
* 描 述:会议管理
<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.MeetingManagement && current.MeetingManagement.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/MeetingManagement/single", "style": { "navigationBarTitleText": "表单详情页" } }
*
* (navigationBarTitleText 字段为本页面的标题文本,可以修改)
* (必须自行操作该步骤,力软代码生成器不会自动帮您修改 /pages.json 文件)
/**
* 本段代码由移动端代码生成器输出,移动端须 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'

export default {
mixins: [customPageMixins],

data() {
return {
// 页面相关参数
id: null,
mode: null,
edit: null,
ready: false,

// 表单数据
current: {},
origin: {},

// 表单项数据结构
scheme: {
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" },
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" },
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: {
// 数据源
dataSource: {
MeetingManagement: {
MeetingPlace: [],
},

}
}
},

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)

// 拉取表单数据,同时拉取所有来自数据源的选单数据
},
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 = 'MeetingManagementApply'
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 }))
}),
this.FETCH_DATASOURCE('ConferenceRoom').then(result => {
this.dataSource.MeetingManagement.MeetingPlace = result.data.map(t => ({ text: t.name, value: t.id }))
}),
() => {}
])
await this.fetchForm()

await this.fetchForm()
this.ready = true
this.HIDE_LOADING()
},

// 加载表单数据
async fetchForm() {
if (this.mode === 'create') {
this.HIDE_LOADING()
},
// 加载表单数据
async fetchForm() {
if (this.mode === 'create') {
this.origin = await this.getDefaultForm()
} else {
} else {
const result = await this.HTTP_GET('learun/adms/PersonnelManagement/MeetingManagement/form', this.id)
this.origin = await this.formatFormData(result)
console.log(this.origin,this.origin.prototype)
}
this.current = this.COPY(this.origin)
},

// 点击 「编辑」、「重置」、「保存」、「删除」 按钮
async action(type) {
switch (type) {
case 'edit':
// 指派审核人
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('正在提交...')
alert(this.id)
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('PersonnelManagementMeetingManagement-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)
case 'reset':
this.current = this.COPY(this.origin)
this.edit = false
break

case 'save':
// if(!this.current.MeetingManagement.TotalAmount){
// this.CONFIRM('表单验证失败', '[劳务维修详情]:价格为空或错误')
// return
// }
const verifyResult = this.verifyForm()
if (verifyResult.length > 0) {
this.CONFIRM('表单验证失败', verifyResult.join('\n'))
if (verifyResult.length > 0) {
this.CONFIRM('表单验证失败', verifyResult.join('\n'))
return
}

if (!(await this.CONFIRM('提交确认', '确定要提交本页表单内容吗?', true))) {
if (!(await this.CONFIRM('提交确认', '确定要提交本页表单内容吗?', true))) {
return
}

this.LOADING('正在提交...')
}
this.LOADING('正在提交...')
const postData = await this.getPostData(this.id)

this.HTTP_POST('learun/adms/PersonnelManagement/MeetingManagement/save', postData, '表单提交保存失败').then(success => {
this.HIDE_LOADING()
if (!success) {
this.HTTP_POST('learun/adms/PersonnelManagement/MeetingManagement/save', postData, '表单提交保存失败').then(success => {
this.HIDE_LOADING()
if (!success) {
return
}

this.EMIT('PersonnelManagementMeetingManagement-list-change')
this.NAV_BACK()
this.TOAST('提交保存成功')
})
this.id = success.Id
if(isSubmit){
this.submit()
return
}
this.EMIT('PersonnelManagementMeetingManagement-list-change')
setTimeout(()=>this.NAV_BACK(),500)
this.TOAST('提交保存成功')
})
break

case 'delete':
if (!(await this.CONFIRM('删除项目', '确定要删除本项吗?', true))) {
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) {
}
this.LOADING('提交删除中...')
this.HTTP_POST('learun/adms/PersonnelManagement/MeetingManagement/delete', this.id, '删除失败').then(success => {
this.HIDE_LOADING()
if (!success) {
return
}

this.EMIT('PersonnelManagementMeetingManagement-list-change')
this.NAV_BACK()
this.this.TOAST('删除成功', 'success')
})
}
this.EMIT('PersonnelManagementMeetingManagement-list-change')
this.NAV_BACK()
this.this.TOAST('删除成功', 'success')
})
break

default: break
}
},

// 获取表单值
getValue(path) {
return get(this.current, path)
}
},
// 获取表单值
getValue(path) {
return get(this.current, path)
},
// 设置表单值
setValue(path, val) {
set(this.current, path, val)
},

// 设置表单值
setValue(path, val) {
set(this.current, path, val)
}
}
}
</script>


}
}
</script>

+ 0
- 438
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/PersonnelManagement/MeetingManagement/single_.vue View File

@@ -1,438 +0,0 @@
<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>

+ 272
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/PersonnelManagement/MeetingManagement/single_old.vue View File

@@ -0,0 +1,272 @@
<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>

<view v-if="ready&&(origin.MeetingManagement.CheckStatus=='0'||edit)" 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 && 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-2021 上海力软信息技术有限公司
* 创建人:超级管理员
* 日 期:2021-02-21 10:07
* 描 述:会议管理
*/

/**
* 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用
* 请在移动端 /pages.json 中的 pages 字段中添加一条记录:
* { "path": "pages/PersonnelManagement/MeetingManagement/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'

export default {
mixins: [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: [],
},

}
}
},

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)

// 拉取表单数据,同时拉取所有来自数据源的选单数据
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()
} else {
const result = await this.HTTP_GET('learun/adms/PersonnelManagement/MeetingManagement/form', this.id)
this.origin = await this.formatFormData(result)
console.log(this.origin,this.origin.prototype)
}
this.current = this.COPY(this.origin)
},

// 点击 「编辑」、「重置」、「保存」、「删除」 按钮
async action(type) {
switch (type) {
case 'edit':
this.edit = true
break

case 'reset':
this.current = this.COPY(this.origin)
this.edit = false
break

case 'save':
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)

this.HTTP_POST('learun/adms/PersonnelManagement/MeetingManagement/save', postData, '表单提交保存失败').then(success => {
this.HIDE_LOADING()
if (!success) {
return
}

this.EMIT('PersonnelManagementMeetingManagement-list-change')
this.NAV_BACK()
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('PersonnelManagementMeetingManagement-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>



Loading…
Cancel
Save