Merge remote-tracking branch 'remotes/origin/master' into minJeecg

# Conflicts:
#	src/api/process/index.ts
This commit is contained in:
lagos 2025-05-27 17:32:23 +08:00
commit ca6c08b8c6
6 changed files with 222 additions and 91 deletions

View File

@ -96,3 +96,18 @@ export function histTasks(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
})
}

View File

@ -1,30 +1,30 @@
<template>
<view class="container">
<wd-loading v-if="loading && pageNo === 1" class="loading-tip">加载中...</wd-loading>
<template v-for="(item, i) in list" :key="i">
<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()
@ -95,7 +77,6 @@
const user = ref('')
const modalShow = ref(false)
const userTask = ref({}) //
const getList = () => {
taskListApi({
@ -104,64 +85,62 @@
}).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) => {
loading = false
})
}
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)
}
@ -169,21 +148,20 @@
})
}
}
onReachBottom(() => {
if (loading) return
pageNo++
getList()
})
onPullDownRefresh(() => {
pageNo = 1
list.value = []
getList()
uni.stopPullDownRefresh()
})
onShow(() => {
list.value = []
pageNo = 1
@ -199,22 +177,23 @@
min-height: 100vh;
background-color: #f7f7f7;
}
.card-content {
padding: 8px 0;
.meta-info {
display: flex;
align-items: center;
font-size: 12px;
color: #666;
.meta-text {
margin-left: 4px;
}
}
}
::v-deep .wd-card__title-content{
::v-deep .wd-card__title-content {
border-bottom: 1px solid #efefef;
}
</style>

View 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>

View File

@ -480,6 +480,15 @@
"navigationBarTitleText": "流程审批导航"
}
},
{
"path": "myApplyProcess",
"type": "page",
"layout": "default",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "我发起流程"
}
},
{
"path": "taskHandle",
"type": "page",

View File

@ -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'
@ -153,6 +138,12 @@
url: '/pages-process/approvalTabbar'
})
}
const goToMyApplyProcess = () => {
uni.navigateTo({
url: '/pages-process/myApplyProcess'
})
}
const goPageMore = (page) => {

View File

@ -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";
}