1.添加历史任务

This commit is contained in:
lagos 2025-05-27 17:31:39 +08:00
parent 16ecf59e80
commit c5edb1ef5a
7 changed files with 276 additions and 44 deletions

View File

@ -42,15 +42,6 @@ export function getProcessNodeInfo(config : Object) { // 获取节点信息
data: config
})
}
export function getHisProcessNodeInfo(config : Object) { //
return http({
url: '/process/extActProcessNode/getHisProcessNodeInfo',
method: 'GET',
data: config
})
}
export function getNodePositionInfo(config : Object) {
return http({
url: '/act/task/getNodePositionInfo',
@ -76,14 +67,20 @@ export function taskEntrust(config : Object) { //委托
})
}
export function getProcessTaskTransInfo(config : Object) { //ID
export function getProcessTaskTransInfo(config : Object) { //
return http({
url: '/act/task/getProcessTaskTransInfo',
method: 'GET',
data: config
})
}
export function getHisProcessNodeInfo(config : Object) { //
return http({
url: '/process/extActProcessNode/getHisProcessNodeInfo',
method: 'GET',
data: config
})
}
export function processComplete(config : Object) { //
return http({
url: '/act/task/processComplete',
@ -91,3 +88,11 @@ export function processComplete(config : Object) { //流程任务完成
data: config
})
}
export function histTasks(config : Object) { //
return http({
url: '/act/task/taskHistoryList',
method: 'GET',
data: config
})
}

View File

@ -1,6 +1,6 @@
<template>
<wd-cell-group>
<wd-cell title="申请信息" value="历史查询" size="large" clickable @click="onClick"/>
<wd-cell title="申请信息" value="历史查询" size="large" clickable @click="onClick"/>
<wd-cell title="职工姓名" :value="info.username_dictText" />
<wd-cell title="所属单位" :value="info.sysOrgCode_dictText" />
<wd-cell title="联系方式" :value="info.phone" />

View File

@ -14,7 +14,7 @@
<myTask></myTask>
</wd-tab>
<wd-tab title="历史任务">
<view class="content">内容1</view>
<historicalTasks></historicalTasks>
</wd-tab>
</wd-tabs>
</PageLayout>
@ -32,6 +32,7 @@
onShow
} from '@dcloudio/uni-app';
import myTask from './components/myTask.vue'
import historicalTasks from './components/historicalTasks.vue'
const appStore = useAppStore();
const tab = ref(0)

View File

@ -1,7 +1,10 @@
<!-- component标签可以变换组件 -->
<template>
<component :is="asyncComponent" :formData="formData" :history="history" :activeKey="activeKey" v-if="asyncComponent"
@getStampSuc="getStampSuccess"></component>
<view>
<component :is="asyncComponent" :formData="formData" :history="history" :activeKey="activeKey" v-if="asyncComponent"
@getStampSuc="getStampSuccess"></component>
<view v-else>该模块暂未建立审批页面</view>
</view>
</template>
<script setup lang="ts">
import { ref, reactive, onMounted, computed, watch, nextTick } from 'vue';
@ -37,7 +40,13 @@
})
// option
watch(() => props.path, (newVal) => {
if (newVal) compName.value = newVal;
if (newVal){
compName.value = newVal;
if(newVal.indexOf('index.vue')==-1){
compName.value = newVal+'/index'
}
}
console.log(compName.value)
//
const comp = modules[`/src/pages-bpm/${compName.value}.vue`]
comp().then((myModule) => {

View File

@ -0,0 +1,191 @@
<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="6">
<text>当前环节:</text>
</wd-col>
<wd-col :span="18">
{{item.taskName}}
</wd-col>
</wd-row>
<wd-row style="color: #666666;">
<wd-col :span="6">
<text>流程名称:</text>
</wd-col>
<wd-col :span="18">
{{item.processDefinitionName}}
</wd-col>
</wd-row>
<wd-row style="color: #666666;">
<wd-col :span="6">
<text>发起人:</text>
</wd-col>
<wd-col :span="18">
{{item.processApplyUserName}}
</wd-col>
</wd-row>
<wd-row style="color: #666666;">
<wd-col :span="6">
<text>开始时间:</text>
</wd-col>
<wd-col :span="18">
{{item.taskBeginTime?item.taskBeginTime.substring(0,10):''}}
</wd-col>
</wd-row>
<wd-row style="padding-bottom: 2px;color: #666666;">
<wd-col :span="6">
<text>结束时间:</text>
</wd-col>
<wd-col :span="18">
{{item.taskEndTime?item.taskEndTime.substring(0,10):''}}
</wd-col>
</wd-row>
</view>
</wd-card>
</template>
<view class="load-more" v-if="loading && pageNo > 1">
<wd-loading size="16px">正在加载...</wd-loading>
</view>
<wd-message-box></wd-message-box>
<wd-toast></wd-toast>
</view>
</template>
<script setup lang="ts">
import { taskListApi,claim,histTasks } from '@/api/process'
import {
ref
} from 'vue'
import {
onLoad,
onShow,
onReachBottom,
onPullDownRefresh
} from '@dcloudio/uni-app';
import { useToast, useMessage } from 'wot-design-uni'
import SelectUserModal from '@/components/SelectUser/components/SelectUserModal.vue'
defineOptions({
name: 'historicalTasks',
options: {
styleIsolation: 'shared',
},
})
const toast = useToast()
const message = useMessage()
let pageNo = 1
let pageSize = 10
let loading = false
const list = ref([])
const user = ref('')
const modalShow = ref(false)
const userTask = ref({}) //
const getList = () => {
histTasks({
pageNo,
pageSize
}).then((res) => {
console.log(res)
if (res.success) {
list.value = [...list.value,...res.result.records];
}
loading = false
}).catch((err) => {
loading = false
})
}
const entrust = (item)=>{ //
modalShow.value = true;
userTask.value = {};
userTask.value = item;
}
const goToPage = (item)=>{
//
if(item.taskAssigneeName&&item.taskAssigneeName!=''){
console.log(item)
//
uni.navigateTo({
url:`/pages-process/taskHandle?data=history`,
success:(res) =>{
res.eventChannel.emit('taskData',JSON.stringify(item))
}
})
}else{
message
.confirm({
msg: '是否签收该任务?',
title: '确认签收吗',
})
.then(() => {
claim({taskId:item.id}).then((res)=>{
if(res.success){
toast.success(res.message)
uni.redirectTo({
url: './approvalTabbar'
});
}else{
toast.error(res.message)
}
})
})
}
}
onReachBottom(() => {
if (loading) return
pageNo++
getList()
})
onPullDownRefresh(() => {
pageNo = 1
list.value = []
getList()
uni.stopPullDownRefresh()
})
onShow(() => {
list.value = []
pageNo = 1
pageSize = 10
loading = false
getList()
})
</script>
<style lang="scss" scoped>
.container {
padding: 5px 0 5px;
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{
border-bottom: 1px solid #efefef;
}
</style>

View File

@ -403,7 +403,7 @@
model.fileList = JSON.stringify(fileListTemp.value)
processComplete(model.value).then(res => {
if (res.success) {//
toast.success("委托成功!")
toast.success(res.message)
setTimeout(() => { //0.5s
uni.navigateBack()
}, 1000)

View File

@ -8,12 +8,12 @@
}
</route>
<template>
<PageLayout nav-title="流程办理">
<PageLayout :nav-title="type=='history'?'历史任务':'流程办理'">
<wd-tabs v-model="tab" color="#39b54a" autoLineWidth>
<wd-tab title="单据">
<DynamicLink ref="linkRef" :path="path" :formData="formData" ></DynamicLink>
</wd-tab>
<wd-tab title="任务处理">
<wd-tab title="任务处理" v-if="type!='history'">
<taskDeal :formData="formData"></taskDeal>
</wd-tab>
<wd-tab title="流程图">
@ -31,7 +31,7 @@
<wd-step v-for="item in dataSource" >
<template #title>
<view :class="{'content':true, 'shadow-blur':true, 'text-sm':true,'bg-green':item.endTime,'bg-gray':!item.endTime}">
<text>流程节点{{item.name=='start'?'开始':item.name}}<br></text>
<text>流程节点{{item.name=='start'?'开始':item.name=='end'?'结束':item.name}}<br></text>
<text>负责人{{item.assigneeName}}<br></text>
<text>开始时间{{item.startTime}}<br></text>
<text v-if="item.endTime">结束时间{{item.endTime}}<br></text>
@ -78,7 +78,7 @@
import taskDeal from './components/taskDeal.vue'
const { proxy } = getCurrentInstance()
const type = ref('');
const formData = ref({})
const nodePositionInfo = ref({})
@ -99,32 +99,58 @@
}
onLoad((options) => {
console.log(options)
type.value = '';
if(options.data){
type.value = options.data
}
const eventChannel = proxy.getOpenerEventChannel();
eventChannel.on('taskData',(params)=>{
let useData = JSON.parse(params);
getProcessNodeInfo({taskId:useData.id}).then(res=>{
if(res.success){
let data = {
dataId:res.result.dataId,
taskId:useData.id,
taskDefKey:useData.taskId,
procInsId:useData.processInstanceId,
tableName:res.result.tableName,
permissionList:res.result.permissionList,
vars:res.result.records,
if(type.value!='history'){
getProcessNodeInfo({taskId:useData.id}).then(res=>{
if(res.success){
let data = {
dataId:res.result.dataId,
taskId:useData.id,
taskDefKey:useData.taskId,
procInsId:useData.processInstanceId,
tableName:res.result.tableName,
permissionList:res.result.permissionList,
vars:res.result.records,
}
formData.value = data;//
let tempFormUrl = res.result.formUrlMobile;
path.value = tempFormUrl; //url
}
})
}else{
getHisProcessNodeInfo({procInstId:useData.processInstanceId}).then(res=>{
if(res.success){
let data = {
dataId:res.result.dataId,
taskId:useData.id,
taskDefKey:useData.taskId,
procInsId:useData.processInstanceId,
tableName:res.result.tableName,
vars:res.result.records
}
formData.value = data;//
console.log(res)
let tempFormUrl = res.result.formUrlMobile;
path.value = tempFormUrl; //url
}
formData.value = data;//
let tempFormUrl = res.result.formUrlMobile;
})
}
path.value = tempFormUrl; //url
}
})
getNodePositionInfo({processInstanceId:useData.processInstanceId}).then((res)=>{
if (res.success) {
nodePositionInfo.value = res.result
}
})
// getNodePositionInfo({processInstanceId:useData.processInstanceId}).then((res)=>{
// if (res.success) {
// nodePositionInfo.value = res.result
// }
// })
getHisInfo({processInstanceId:useData.processInstanceId}).then((res)=>{
if (res.success) {