Files
lc_frontend/src/views/bpm/task/copy/index.vue
yang chen 256edf264e feat(bpm): 添加抄送任务流程查看功能
- 在抄送任务列表中增加“流程”按钮,跳转至流程实例详情页
- 调整流程编号字段显示逻辑,默认展示并支持搜索
-优化抄送时间字段格式化方式,并调整搜索类型为时间范围选择
- 禁用规则类型下拉框编辑状态,并默认选中固定值30- 设置任务名称、ID及流程实例名称回填逻辑
2025-10-27 10:37:57 +08:00

176 lines
3.8 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!-- 工作流抄送我的流程 -->
<template>
<ContentWrap>
<avue-crud
ref="crudRef"
v-model="tableForm"
v-model:page="tablePage"
v-model:search="tableSearch"
:data="tableData"
:option="tableOption"
:permission="permission"
@search-change="searchChange"
@search-reset="resetChange"
@refresh-change="getTableData"
@size-change="sizeChange"
@current-change="currentChange"
>
<template #menu="{ row }">
<el-button link type="primary" @click="handleAudit(row)">流程</el-button>
</template>
</avue-crud>
</ContentWrap>
</template>
<script lang="ts" setup>
import {dateFormatter} from '@/utils/formatTime'
import * as ProcessInstanceApi from '@/api/bpm/processInstance'
defineOptions({
name: 'BpmCopyTask'
})
// 路由
const {push} = useRouter()
// 列表的加载中
const loading = ref(true)
const {getCurrPermi} = useCrudPermi()
// 表格的配置
const tableOption = reactive({
addBtn: false,
editBtn: false,
delBtn: false,
viewBtn: true,
viewBtnText: '详情',
viewBtnIcon: 'none',
align: 'center',
headerAlign: 'center',
searchMenuSpan: 6,
searchMenuPosition: 'left',
labelSuffix: ' ',
span: 24,
dialogWidth: '50%',
column: {
taskId: {
label: '任务编号'
},
taskName: {
label: '任务名称'
},
processInstanceId: {
label: '流程编号',
search: true,
},
processInstanceName: {
label: '所属流程',
search: true,
},
startUserNickname: {
label: '流程发起人',
},
reason: {
label: '抄送原因'
},
creatorNickname: {
label: '抄送人'
},
createTime: {
label: '抄送时间',
type: 'datetime',
width: 180,
formatter: (row: any, value: any, rowv: any, column: any) => {
return dateFormatter(row, column, value)
}
},
searchCreateTime: {
label: '抄送时间',
display: false,
hide: true,
search: true,
searchType: 'datetimerange',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
searchRange: true,
}
}
})
const tableForm = ref<any>({})
const tableData = ref([])
const tableSearch = ref<any>({})
const tablePage = ref({
currentPage: 1,
pageSize: 10,
total: 0
})
const permission = getCurrPermi(['bpm:task'])
const crudRef = ref()
useCrudHeight(crudRef)
const getTableData = async () => {
// 列表的加载中...
loading.value = true
// 拼接查询参数
let searchObj = {
...tableSearch.value,
pageNo: tablePage.value.currentPage,
pageSize: tablePage.value.pageSize
}
// 处理时间参数,如果为空则去掉这个属性
if (!searchObj.createTime?.length) delete searchObj.createTime
// 去掉空字符串属性
for (let key in searchObj) if (searchObj[key] === '') delete searchObj[key]
// 请求我的待阅数据
try {
const data = await ProcessInstanceApi.getProcessInstanceCCPage(searchObj)
tableData.value = data.list
tablePage.value.total = data.total
} finally {
// 无论请求成功或者失败,这里都需要将加载中关闭
loading.value = false
}
}
const searchChange = (params: any, done: any) => {
tablePage.value.currentPage = 1
// 获取数据
getTableData().finally(() => done())
}
const resetChange = () => {
searchChange({}, () => {
})
}
const sizeChange = (pageSize) => {
tablePage.value.pageSize = pageSize
resetChange()
}
const currentChange = (currentPage) => {
tablePage.value.currentPage = currentPage
getTableData()
}
const handleAudit = (row: any) => {
push({
name: 'BpmProcessInstanceDetail',
query: {
id: row.processInstanceId
}
})
}
/** 初始化 **/
onMounted(async () => {
await getTableData()
})
</script>