Files
jnpf_app/pages/workFlow/flowTodo/flowList.vue

181 lines
5.0 KiB
Vue
Raw Normal View History

2026-01-04 11:09:06 +08:00
<template>
<view class="flowLaunch-v">
<view class="flow-list" v-if="list.length > 0">
<view class="flow-list-box">
<SwipeItem :list="list" :buttons="options" @action="handleClick" ref="swipeItem" :marginB="20"
:borderR="10">
<template v-slot="{ item,index }">
<view class="item" @click="goDetail(item)" :id="'item'+index" ref="mydom">
<view class="item-left">
<view class="item-left-top">
<view class='common-lable-entrust' v-if="item.delegateUser">
{{!category ? '委托' : '代理' }}
</view>
2026-01-19 17:34:15 +08:00
<view class='common-lable'>
单号
2026-01-04 11:09:06 +08:00
</view>
2026-01-20 18:07:35 +08:00
<text class="title u-font-28 u-line-1">{{item.businessInfo && item.businessInfo.billNo}}</text>
2026-01-04 11:09:06 +08:00
</view>
2026-01-19 17:34:15 +08:00
<text class="title u-line-1 u-font-24">单据类型{{item.name || item.processInstanceName}}<text
2026-01-04 11:09:06 +08:00
class="titInner">{{item.thisStep ? item.thisStep : ''}}</text></text>
<text class="time title u-font-24">发起时间<text
2026-01-19 17:34:15 +08:00
class="titInner">{{item.createTime?$u.timeFormat(item.createTime, 'yyyy-mm-dd hh:MM:ss'):''}}</text></text>
2026-01-04 11:09:06 +08:00
</view>
2026-01-19 17:34:15 +08:00
<view v-if="category == 2" class="item-right">
2026-01-20 18:07:35 +08:00
<image v-if="item.suspensionState == 1" src="./img/jihuo.png" mode="widthFix" class="item-right-img" />
2026-01-19 17:34:15 +08:00
<image v-else src="./img/wanc.png" mode="widthFix" class="item-right-img" />
</view>
<view v-else class="item-right">
<image v-if="item.result == 1" src="./img/doing.png" mode="widthFix" class="item-right-img" />
<image v-if="item.result == 2" src="./img/togo.png" mode="widthFix" class="item-right-img" />
<image v-if="item.result == 3" src="./img/pass.png" mode="widthFix" class="item-right-img" />
<image v-if="item.result == 4" src="./img/quxiao.png" mode="widthFix" class="item-right-img" />
<image v-if="item.result == 5" src="./img/REJECTED.png" mode="widthFix" class="item-right-img" />
<image v-if="item.result == 6" src="./img/weipai.png" mode="widthFix" class="item-right-img" />
2026-01-04 11:09:06 +08:00
</view>
</view>
</template>
</SwipeItem>
</view>
</view>
</view>
</template>
<script>
2026-01-20 18:07:35 +08:00
import {
getProcessBusinessInfo
} from '@/api/apply/visualDev'
2026-01-04 11:09:06 +08:00
import {
delFlowLaunch
} from '@/api/workFlow/template'
import SwipeItem from "@/components/SwipeItem/index"
export default {
name: "FlowList",
components: {
SwipeItem
},
props: {
list: {
type: Array,
default: () => []
},
swipeAction: {
type: Boolean,
default: false
},
category: {
type: [String, Number],
default: '0'
},
},
data() {
return {
options: [{
text: '删除',
style: {
backgroundColor: '#dd524d'
}
}],
title: '',
};
},
methods: {
open(index) {
// 先将正在被操作的swipeAction标记为打开状态否则由于props的特性限制
// 原本为'false',再次设置为'false'会无效
this.list[index].show = true;
this.list.map((val, idx) => {
if (index != idx) this.list[idx].show = false;
})
},
goDetail(item) {
2026-01-22 11:01:19 +08:00
const {processInstance,processDefinitionId,processInstanceId,processInstanceName} = item
const id = this.category == 4 ? processInstanceId :(!!processDefinitionId ? item.id :processInstance.id)
const name = this.category == 4 ? processInstanceName : !!processDefinitionId ? item.name : processInstance.name
2026-01-20 18:07:35 +08:00
getProcessBusinessInfo(id).then(res=>{
if(res.code == 0){
const {dbformId,businessId} = res.data
const config = {
modelId: dbformId,
id: businessId,
name: name,
btnType: 'btn_process',
current: this.category
}
uni.navigateTo({
url: '/pages/apply/dynamicModelList/form?config=' +
this.jnpf.base64.encode(JSON.stringify(config))
})
}
2026-01-04 11:09:06 +08:00
})
},
handleClick(data) {
const {
index
} = data
const item = this.list[index]
if ([1, 2, 3, 5].includes(item.status)) {
this.$u.toast("流程正在审核,请勿删除")
this.list[index].show = false
return
}
delFlowLaunch(item.id).then(res => {
this.$u.toast(res.msg)
this.list.splice(index, 1)
})
},
}
};
</script>
<style scoped lang="scss">
.flowLaunch-v {
width: 100%;
.flow-list-box {
width: 95%;
.item-left-top {
display: flex;
width: 100%;
.common-lable {
font-size: 24rpx;
padding: 2rpx 8rpx;
margin-right: 8rpx;
border-radius: 8rpx;
color: #409EFF;
border: 1px solid #409EFF;
background-color: #e5f3fe;
&-entrust {
margin-right: 8rpx;
font-size: 24rpx;
padding: 2rpx 8rpx;
border-radius: 8rpx;
background-color: #dbf1e1;
color: #19be6b;
border: 1px solid #19be6b;
}
}
.urgent-lable {
color: #E6A23C;
border: 1px solid #E6A23C;
background-color: #fef6e5;
}
.important-lable {
color: #F56C6C;
border: 1px solid #F56C6C;
background-color: #fee5e5;
}
.title {
width: unset;
flex: 1;
min-width: 0;
}
}
}
}
</style>