取回流程
This commit is contained in:
parent
401101ddd2
commit
63a564a391
@ -91,3 +91,20 @@ export function processComplete(config : Object) { //流程任务完成
|
||||
data: config
|
||||
})
|
||||
}
|
||||
|
||||
export function myApplyProcessListApi(config : object) { // 本人发起列表
|
||||
return http({
|
||||
url: '/act/task/myApplyProcessList',
|
||||
method: 'GET',
|
||||
data: config
|
||||
})
|
||||
}
|
||||
|
||||
export function callBackProcessApi(config : object) { // 取回流程
|
||||
return http({
|
||||
url: '/act/task/callBackProcess',
|
||||
method: 'PUT',
|
||||
data: config
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -6,25 +6,25 @@
|
||||
<wd-card :title="item.bpmBizTitle" title-bold border-radius="8" use-footer-slot @click="goToPage(item)">
|
||||
<view class="card-content">
|
||||
<wd-row style="color: #666666;">
|
||||
<wd-col :span="4">
|
||||
<wd-col :span="6">
|
||||
<text>当前环节:</text>
|
||||
</wd-col>
|
||||
<wd-col :span="20">
|
||||
<wd-col :span="18">
|
||||
{{item.taskName}}
|
||||
</wd-col>
|
||||
</wd-row>
|
||||
<wd-row style="padding-bottom: 2px;color: #666666;">
|
||||
<wd-col :span="4">
|
||||
<wd-row style="padding: 10px 0 10px 0;color: #666666;">
|
||||
<wd-col :span="6">
|
||||
<text>流程名称:</text>
|
||||
</wd-col>
|
||||
<wd-col :span="20">
|
||||
<wd-col :span="18">
|
||||
{{item.processDefinitionName}}
|
||||
</wd-col>
|
||||
</wd-row>
|
||||
<view class="meta-info">
|
||||
<wd-icon name="time" size="14px" color="#999"></wd-icon>
|
||||
<wd-icon name="time" size="18px" color="#999"></wd-icon>
|
||||
<text class="meta-text">{{item.taskBeginTime?item.taskBeginTime.substring(0,10):''}}</text>
|
||||
<wd-icon name="user" size="14px" color="#999" style="margin-left: auto;"></wd-icon>
|
||||
<wd-icon name="user" size="18px" color="#999" style="margin-left: auto;"></wd-icon>
|
||||
<text class="meta-text">{{item.processApplyUserName}}</text>
|
||||
</view>
|
||||
<wd-row style="padding-top: 10px;">
|
||||
@ -52,39 +52,21 @@
|
||||
</view>
|
||||
<wd-message-box></wd-message-box>
|
||||
<wd-toast></wd-toast>
|
||||
<SelectUserModal
|
||||
v-if="modalShow"
|
||||
:selected="user"
|
||||
modalTitle="用户选择"
|
||||
:multi="false"
|
||||
@change="handleChange"
|
||||
@close="() => (modalShow = false)"
|
||||
></SelectUserModal>
|
||||
<SelectUserModal v-if="modalShow" :selected="user" modalTitle="用户选择" :multi="false" @change="handleChange"
|
||||
@close="() => (modalShow = false)"></SelectUserModal>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { taskListApi,claim } from '@/api/process'
|
||||
import {
|
||||
ref
|
||||
} from 'vue'
|
||||
import {
|
||||
onLoad,
|
||||
onShow,
|
||||
onReachBottom,
|
||||
onPullDownRefresh
|
||||
} from '@dcloudio/uni-app';
|
||||
import {
|
||||
taskEntrust
|
||||
} from '@/api/process'
|
||||
<script setup>
|
||||
import { taskListApi, claim, taskEntrust } from '@/api/process'
|
||||
import { useToast, useMessage } from 'wot-design-uni'
|
||||
import SelectUserModal from '@/components/SelectUser/components/SelectUserModal.vue'
|
||||
|
||||
defineOptions({
|
||||
name: 'myTask',
|
||||
options: {
|
||||
styleIsolation: 'shared',
|
||||
},
|
||||
name: 'myTask',
|
||||
options: {
|
||||
styleIsolation: 'shared',
|
||||
},
|
||||
})
|
||||
const toast = useToast()
|
||||
const message = useMessage()
|
||||
@ -96,7 +78,6 @@
|
||||
const modalShow = ref(false)
|
||||
const userTask = ref({}) //点击的流程节点
|
||||
|
||||
|
||||
const getList = () => {
|
||||
taskListApi({
|
||||
pageNo,
|
||||
@ -104,7 +85,7 @@
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
if (res.success) {
|
||||
list.value = [...list.value,...res.result.records];
|
||||
list.value = [...list.value, ...res.result.records];
|
||||
}
|
||||
loading = false
|
||||
}).catch((err) => {
|
||||
@ -112,56 +93,54 @@
|
||||
})
|
||||
}
|
||||
|
||||
const entrust = (item)=>{ //委托
|
||||
const entrust = (item) => { //委托
|
||||
modalShow.value = true;
|
||||
userTask.value = {};
|
||||
userTask.value = item;
|
||||
}
|
||||
|
||||
const handleChange = (data) => {
|
||||
const rowkey = data.map((item) => item.username).join(',')
|
||||
console.log(rowkey)
|
||||
var params = {
|
||||
taskId:userTask.value.id,
|
||||
taskAssignee:rowkey
|
||||
};//查询条件
|
||||
taskEntrust(params).then(res=>{
|
||||
if(res.success){
|
||||
toast.success(res.message)
|
||||
uni.redirectTo({
|
||||
url: './approvalTabbar'
|
||||
});
|
||||
}else{
|
||||
toast.error(res.message)
|
||||
}
|
||||
})
|
||||
const rowkey = data.map((item) => item.username).join(',')
|
||||
var params = {
|
||||
taskId: userTask.value.id,
|
||||
taskAssignee: rowkey
|
||||
};//查询条件
|
||||
taskEntrust(params).then(res => {
|
||||
if (res.success) {
|
||||
toast.success(res.message)
|
||||
uni.redirectTo({
|
||||
url: './approvalTabbar'
|
||||
});
|
||||
} else {
|
||||
toast.error(res.message)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const goToPage = (item)=>{
|
||||
const goToPage = (item) => {
|
||||
//判断是否是签收项目,提示是否签收
|
||||
if(item.taskAssigneeName&&item.taskAssigneeName!=''){
|
||||
console.log(item)
|
||||
if (item.taskAssigneeName && item.taskAssigneeName != '') {
|
||||
//办理任务,直接进入办理页面
|
||||
uni.navigateTo({
|
||||
url:`/pages-process/taskHandle`,
|
||||
success:(res) =>{
|
||||
res.eventChannel.emit('taskData',JSON.stringify(item))
|
||||
url: `/pages-process/taskHandle`,
|
||||
success: (res) => {
|
||||
res.eventChannel.emit('taskData', JSON.stringify(item))
|
||||
}
|
||||
})
|
||||
}else{
|
||||
} else {
|
||||
message
|
||||
.confirm({
|
||||
msg: '是否签收该任务?',
|
||||
title: '确认签收吗',
|
||||
})
|
||||
.then(() => {
|
||||
claim({taskId:item.id}).then((res)=>{
|
||||
if(res.success){
|
||||
claim({ taskId: item.id }).then((res) => {
|
||||
if (res.success) {
|
||||
toast.success(res.message)
|
||||
uni.redirectTo({
|
||||
url: './approvalTabbar'
|
||||
});
|
||||
}else{
|
||||
} else {
|
||||
toast.error(res.message)
|
||||
}
|
||||
|
||||
@ -183,7 +162,6 @@
|
||||
uni.stopPullDownRefresh()
|
||||
})
|
||||
|
||||
|
||||
onShow(() => {
|
||||
list.value = []
|
||||
pageNo = 1
|
||||
@ -214,7 +192,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
::v-deep .wd-card__title-content{
|
||||
|
||||
::v-deep .wd-card__title-content {
|
||||
border-bottom: 1px solid #efefef;
|
||||
}
|
||||
</style>
|
136
src/pages-process/myApplyProcess.vue
Normal file
136
src/pages-process/myApplyProcess.vue
Normal file
@ -0,0 +1,136 @@
|
||||
<route lang="json5" type="page">
|
||||
{
|
||||
layout: 'default',
|
||||
style: {
|
||||
navigationStyle: 'custom',
|
||||
navigationBarTitleText: '我发起流程',
|
||||
},
|
||||
}
|
||||
</route>
|
||||
<template>
|
||||
<PageLayout nav-title="我发起流程">
|
||||
<view class="container">
|
||||
<template v-for="(item, i) in list" :key="i">
|
||||
<wd-card :title="item.bpmBizTitle" title-bold border-radius="8" use-footer-slot>
|
||||
<wd-row class="row">
|
||||
<wd-col :span="6">
|
||||
<text>申请理由:</text>
|
||||
</wd-col>
|
||||
<wd-col :span="18">
|
||||
{{item.bpmBizTitle}}
|
||||
</wd-col>
|
||||
</wd-row>
|
||||
<wd-row class="row">
|
||||
<wd-col :span="6">
|
||||
<text>流程名称:</text>
|
||||
</wd-col>
|
||||
<wd-col :span="18">
|
||||
{{item.prcocessDefinitionName}}
|
||||
</wd-col>
|
||||
</wd-row>
|
||||
<wd-row class="row">
|
||||
<wd-col :span="6">
|
||||
<text>发起人:</text>
|
||||
</wd-col>
|
||||
<wd-col :span="18">
|
||||
{{item.startUserName}}
|
||||
</wd-col>
|
||||
</wd-row>
|
||||
<wd-row class="row">
|
||||
<wd-col :span="6">
|
||||
<text>开始时间:</text>
|
||||
</wd-col>
|
||||
<wd-col :span="18">
|
||||
{{item.startTime}}
|
||||
</wd-col>
|
||||
</wd-row>
|
||||
<wd-row class="row" v-show="item.endTime">
|
||||
<wd-col :span="6">
|
||||
<text>结束时间:</text>
|
||||
</wd-col>
|
||||
<wd-col :span="18">
|
||||
{{item.endTime}}
|
||||
</wd-col>
|
||||
</wd-row>
|
||||
<wd-row style="padding-top: 10px;">
|
||||
<view v-if="!item.endTime">
|
||||
<wd-button @click.stop="callBackProcess(item.processInstanceId)">取回流程</wd-button>
|
||||
</view>
|
||||
</wd-row>
|
||||
</wd-card>
|
||||
</template>
|
||||
</view>
|
||||
</PageLayout>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
myApplyProcessListApi,
|
||||
callBackProcessApi,
|
||||
} from '@/api/process'
|
||||
import {
|
||||
useToast
|
||||
} from 'wot-design-uni'
|
||||
|
||||
const toast = useToast()
|
||||
let pageNo = 1
|
||||
let pageSize = 10
|
||||
const list = ref([])
|
||||
const taskInfo = ref({})
|
||||
|
||||
const getList = () => {
|
||||
myApplyProcessListApi({
|
||||
pageNo,
|
||||
pageSize
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
if (res.success) {
|
||||
list.value = [...list.value, ...res.result.records];
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**流程取回*/
|
||||
const callBackProcess = (id) => {
|
||||
callBackProcessApi({
|
||||
processInstanceId: id
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
list.value = []
|
||||
getList()
|
||||
toast.success(res.message)
|
||||
}else{
|
||||
toast.warning(res.message)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
onReachBottom(() => {
|
||||
pageNo++
|
||||
getList()
|
||||
})
|
||||
|
||||
onShow(() => {
|
||||
list.value = []
|
||||
pageNo = 1
|
||||
pageSize = 10
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.container {
|
||||
padding: 5px 0 5px;
|
||||
min-height: 100vh;
|
||||
background-color: #f7f7f7;
|
||||
}
|
||||
|
||||
.row {
|
||||
color: #666666;
|
||||
padding: 5px 0 5px 0;
|
||||
}
|
||||
|
||||
::v-deep .wd-card__title-content {
|
||||
border-bottom: 1px solid #efefef;
|
||||
}
|
||||
</style>
|
@ -480,6 +480,15 @@
|
||||
"navigationBarTitleText": "流程审批导航"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "myApplyProcess",
|
||||
"type": "page",
|
||||
"layout": "default",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "我发起流程"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "taskHandle",
|
||||
"type": "page",
|
||||
|
@ -48,22 +48,13 @@
|
||||
</wd-badge>
|
||||
</view>
|
||||
</wd-col>
|
||||
<wd-col :span="12" @click="goToProcess">
|
||||
<wd-col :span="12" @click="goToMyApplyProcess">
|
||||
<wd-img :width="50" :height="50"
|
||||
:src="getFileAccessHttpUrl('https://static.jeecg.com/upload/test/line2_icon2_1595818070168.png')"></wd-img>
|
||||
<view class="textBox">
|
||||
<wd-text text="我发起流程"></wd-text>
|
||||
</view>
|
||||
</wd-col>
|
||||
<!-- <wd-col :span="12" v-for="(item, index) in middleApps" :key="index" @click="goToProcess">
|
||||
<wd-img :width="50" :height="50" :src="getFileAccessHttpUrl(item.icon)"></wd-img>
|
||||
<view class="textBox">
|
||||
<wd-badge modelValue="12">
|
||||
<wd-text :text="item.title"></wd-text>
|
||||
</wd-badge>
|
||||
<wd-text :text="item.subTitle"></wd-text>
|
||||
</view>
|
||||
</wd-col> -->
|
||||
</wd-row>
|
||||
|
||||
<view class="serveBox">
|
||||
@ -86,15 +77,9 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref
|
||||
} from 'vue'
|
||||
import {
|
||||
getFileAccessHttpUrl
|
||||
} from '@/common/uitls'
|
||||
import {
|
||||
onLoad
|
||||
} from '@dcloudio/uni-app'
|
||||
import {
|
||||
useToast
|
||||
} from 'wot-design-uni'
|
||||
@ -154,6 +139,12 @@
|
||||
})
|
||||
}
|
||||
|
||||
const goToMyApplyProcess = () => {
|
||||
uni.navigateTo({
|
||||
url: '/pages-process/myApplyProcess'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const goPageMore = (page) => {
|
||||
router.replace({
|
||||
|
1
src/types/uni-pages.d.ts
vendored
1
src/types/uni-pages.d.ts
vendored
@ -53,6 +53,7 @@ interface NavigateToOptions {
|
||||
"/pages-integrated/duty/index" |
|
||||
"/pages-politics/health/add" |
|
||||
"/pages-process/approvalTabbar" |
|
||||
"/pages-process/myApplyProcess" |
|
||||
"/pages-process/taskHandle" |
|
||||
"/pages-bpm/leaveApplication/index";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user