REVIEW 工作流 - 我的流程、待办任务

This commit is contained in:
YunaiV 2023-04-07 09:09:05 +08:00
parent 8f2acea7a5
commit 5fb61f8cb8
5 changed files with 47 additions and 72 deletions

View File

@ -306,30 +306,6 @@ const remainingRouter: AppRouteRecordRaw[] = [
activeMenu: 'bpm/oa/leave/create'
}
},
{
path: '/bpm/oa/leave/detail',
component: () => import('@/views/bpm/oa/leave/detail.vue'),
name: 'OALeaveDetail',
meta: {
noCache: true,
hidden: true,
canTo: true,
title: '查看 OA 请假',
activeMenu: 'bpm/oa/leave/detail'
}
},
{
path: '/bpm/task/done',
component: () => import('@/views/bpm/task/done/index.vue'),
name: 'TaskDone',
meta: {
noCache: true,
hidden: true,
canTo: true,
title: '已办任务',
activeMenu: 'bpm/task/done/index'
}
},
{
path: '/bpm/task/todo',
component: () => import('@/views/bpm/task/todo/index.vue'),

View File

@ -24,6 +24,7 @@ declare module '@vue/runtime-core' {
DocAlert: typeof import('./../components/DocAlert/index.vue')['default']
Echart: typeof import('./../components/Echart/src/Echart.vue')['default']
Editor: typeof import('./../components/Editor/src/Editor.vue')['default']
ElAlert: typeof import('element-plus/es')['ElAlert']
ElBadge: typeof import('element-plus/es')['ElBadge']
ElButton: typeof import('element-plus/es')['ElButton']
ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup']
@ -72,6 +73,7 @@ declare module '@vue/runtime-core' {
ElTimeline: typeof import('element-plus/es')['ElTimeline']
ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
ElUpload: typeof import('element-plus/es')['ElUpload']
Error: typeof import('./../components/Error/src/Error.vue')['default']
FlowCondition: typeof import('./../components/bpmnProcessDesigner/package/penal/flow-condition/FlowCondition.vue')['default']

View File

@ -27,7 +27,12 @@
/>
</el-form-item>
<el-form-item label="流程分类" prop="category">
<el-select v-model="queryParams.category" placeholder="请选择" clearable>
<el-select
v-model="queryParams.category"
placeholder="请选择流程分类"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.BPM_MODEL_CATEGORY)"
:key="dict.value"
@ -37,7 +42,7 @@
</el-select>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择" clearable>
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable class="!w-240px">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS)"
:key="dict.value"
@ -47,7 +52,7 @@
</el-select>
</el-form-item>
<el-form-item label="结果" prop="result">
<el-select v-model="queryParams.result" placeholder="请选择" clearable>
<el-select v-model="queryParams.result" placeholder="请选择结果" clearable class="!w-240px">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT)"
:key="dict.value"
@ -70,21 +75,16 @@
<el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button
type="primary"
plain
v-hasPermi="['bpm:process-instance:query']"
@click="handleCreate"
>
发起流程
</el-button>
</el-form-item>
</el-form>
<el-col>
<el-row>
<el-col>
<!-- 操作新增 -->
<el-button
type="primary"
v-hasPermi="['bpm:process-instance:query']"
@click="handleCreate"
>发起流程</el-button
>
</el-col>
</el-row>
</el-col>
</ContentWrap>
<!-- 列表 -->
@ -135,16 +135,18 @@
type="primary"
v-hasPermi="['bpm:process-instance:cancel']"
@click="handleDetail(scope.row)"
>详情</el-button
>
详情
</el-button>
<el-button
link
type="primary"
v-if="scope.row.result === 1"
v-hasPermi="['bpm:process-instance:query']"
@click="handleCancel(scope.row)"
>取消</el-button
>
取消
</el-button>
</template>
</el-table-column>
</el-table>
@ -158,14 +160,14 @@
</ContentWrap>
</template>
<script setup lang="ts">
// import
import { ElMessageBox } from 'element-plus'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
// import
import * as ProcessInstanceApi from '@/api/bpm/processInstance'
// import { allSchemas } from './process.data'
import { dateFormatter } from '@/utils/formatTime'
import { ElMessageBox } from 'element-plus'
import * as ProcessInstanceApi from '@/api/bpm/processInstance'
const router = useRouter() //
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
@ -179,10 +181,8 @@ const queryParams = reactive({
result: undefined,
createTime: []
})
const router = useRouter() //
const message = useMessage() //
const { t } = useI18n() //
const queryFormRef = ref() //
/** 查询列表 */
const getList = async () => {
loading.value = true
@ -194,6 +194,7 @@ const getList = async () => {
loading.value = false
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
@ -205,11 +206,6 @@ const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
}
// ========== ==========
// const [reload] = useXTable({
// allSchemas: allSchemas,
// getListApi: ProcessInstanceApi.getMyProcessInstancePage
// })
/** 发起流程操作 **/
const handleCreate = () => {
@ -218,7 +214,7 @@ const handleCreate = () => {
})
}
//
/** 查看详情 */
const handleDetail = (row) => {
router.push({
name: 'BpmProcessInstanceDetail',
@ -229,18 +225,21 @@ const handleDetail = (row) => {
}
/** 取消按钮操作 */
const handleCancel = (row) => {
ElMessageBox.prompt('请输入取消原因', '取消流程', {
const handleCancel = async (row) => {
//
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: t('common.ok'),
cancelButtonText: t('common.cancel'),
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, //
inputErrorMessage: '取消原因不能为空'
}).then(async ({ value }) => {
await ProcessInstanceApi.cancelProcessInstance(row.id, value)
message.success('取消成功')
// reload()
})
//
await ProcessInstanceApi.cancelProcessInstance(row.id, value)
message.success('取消成功')
//
await getList()
}
/** 初始化 **/
onMounted(() => {
getList()

View File

@ -72,10 +72,10 @@
</template>
<script setup lang="tsx">
// import
import * as TaskApi from '@/api/bpm/task'
import { dateFormatter } from '@/utils/formatTime'
const { push } = useRouter() //
import * as TaskApi from '@/api/bpm/task'
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
@ -98,17 +98,20 @@ const getList = async () => {
loading.value = false
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
}
//
/** 处理审批按钮 */
const handleAudit = (row) => {
push({
name: 'BpmProcessInstanceDetail',
@ -117,6 +120,7 @@ const handleAudit = (row) => {
}
})
}
/** 初始化 **/
onMounted(() => {
getList()

View File

@ -174,9 +174,3 @@ onBeforeMount(() => {
readRedisInfo()
})
</script>
<style scoped>
.redis {
height: 600px;
max-height: 860px;
}
</style>