ソースを参照

app2.0我的工作流程

娄底高职分支
ndbs 2年前
コミット
e50555e983
2個のファイルの変更139行の追加46行の削除
  1. +81
    -2
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/myflow/sign.vue
  2. +58
    -44
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/myflow/single.vue

+ 81
- 2
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/myflow/sign.vue ファイルの表示

@@ -33,7 +33,15 @@
</view>
</template>

<l-textarea v-model="remark" :placeholder="`输入${typeText}备注`" title="备注:" />
<l-textarea v-model="remark" :placeholder="`输入${typeText}意见`" title="审核意见:" />
<!-- 弹层 -->
<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 class="padding margin-top bg-white">
<l-button @click="submit" class="block" size="lg" color="green" block>提交流程{{ typeText }}</l-button>
@@ -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',


+ 58
- 44
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/nworkflow/myflow/single.vue ファイルの表示

@@ -14,8 +14,6 @@
:currentNode="currentNode"
:currentTask="currentTask"
/>
</view>
<!-- Tab #2:流程图页 -->
<view v-if="ready && tab === 1" class="progress"><l-workflow-timeline :processList="processList" /></view>
@@ -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__') {


読み込み中…
キャンセル
保存