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' 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', path: '/bpm/task/todo',
component: () => import('@/views/bpm/task/todo/index.vue'), 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'] DocAlert: typeof import('./../components/DocAlert/index.vue')['default']
Echart: typeof import('./../components/Echart/src/Echart.vue')['default'] Echart: typeof import('./../components/Echart/src/Echart.vue')['default']
Editor: typeof import('./../components/Editor/src/Editor.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'] ElBadge: typeof import('element-plus/es')['ElBadge']
ElButton: typeof import('element-plus/es')['ElButton'] ElButton: typeof import('element-plus/es')['ElButton']
ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup'] ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup']
@ -72,6 +73,7 @@ declare module '@vue/runtime-core' {
ElTimeline: typeof import('element-plus/es')['ElTimeline'] ElTimeline: typeof import('element-plus/es')['ElTimeline']
ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem'] ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
ElTooltip: typeof import('element-plus/es')['ElTooltip'] ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
ElUpload: typeof import('element-plus/es')['ElUpload'] ElUpload: typeof import('element-plus/es')['ElUpload']
Error: typeof import('./../components/Error/src/Error.vue')['default'] Error: typeof import('./../components/Error/src/Error.vue')['default']
FlowCondition: typeof import('./../components/bpmnProcessDesigner/package/penal/flow-condition/FlowCondition.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>
<el-form-item label="流程分类" prop="category"> <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 <el-option
v-for="dict in getIntDictOptions(DICT_TYPE.BPM_MODEL_CATEGORY)" v-for="dict in getIntDictOptions(DICT_TYPE.BPM_MODEL_CATEGORY)"
:key="dict.value" :key="dict.value"
@ -37,7 +42,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <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 <el-option
v-for="dict in getIntDictOptions(DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS)" v-for="dict in getIntDictOptions(DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS)"
:key="dict.value" :key="dict.value"
@ -47,7 +52,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="结果" prop="result"> <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 <el-option
v-for="dict in getIntDictOptions(DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT)" v-for="dict in getIntDictOptions(DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT)"
:key="dict.value" :key="dict.value"
@ -70,21 +75,16 @@
<el-form-item> <el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button> <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 @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
</el-form-item>
</el-form>
<el-col>
<el-row>
<el-col>
<!-- 操作新增 -->
<el-button <el-button
type="primary" type="primary"
plain
v-hasPermi="['bpm:process-instance:query']" v-hasPermi="['bpm:process-instance:query']"
@click="handleCreate" @click="handleCreate"
>发起流程</el-button
> >
</el-col> 发起流程
</el-row> </el-button>
</el-col> </el-form-item>
</el-form>
</ContentWrap> </ContentWrap>
<!-- 列表 --> <!-- 列表 -->
@ -135,16 +135,18 @@
type="primary" type="primary"
v-hasPermi="['bpm:process-instance:cancel']" v-hasPermi="['bpm:process-instance:cancel']"
@click="handleDetail(scope.row)" @click="handleDetail(scope.row)"
>详情</el-button
> >
详情
</el-button>
<el-button <el-button
link link
type="primary" type="primary"
v-if="scope.row.result === 1" v-if="scope.row.result === 1"
v-hasPermi="['bpm:process-instance:query']" v-hasPermi="['bpm:process-instance:query']"
@click="handleCancel(scope.row)" @click="handleCancel(scope.row)"
>取消</el-button
> >
取消
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -158,14 +160,14 @@
</ContentWrap> </ContentWrap>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
// import
import { ElMessageBox } from 'element-plus'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' 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 { 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 loading = ref(true) //
const total = ref(0) // const total = ref(0) //
const list = ref([]) // const list = ref([]) //
@ -179,10 +181,8 @@ const queryParams = reactive({
result: undefined, result: undefined,
createTime: [] createTime: []
}) })
const router = useRouter() //
const message = useMessage() //
const { t } = useI18n() //
const queryFormRef = ref() // const queryFormRef = ref() //
/** 查询列表 */ /** 查询列表 */
const getList = async () => { const getList = async () => {
loading.value = true loading.value = true
@ -194,6 +194,7 @@ const getList = async () => {
loading.value = false loading.value = false
} }
} }
/** 搜索按钮操作 */ /** 搜索按钮操作 */
const handleQuery = () => { const handleQuery = () => {
queryParams.pageNo = 1 queryParams.pageNo = 1
@ -205,11 +206,6 @@ const resetQuery = () => {
queryFormRef.value.resetFields() queryFormRef.value.resetFields()
handleQuery() handleQuery()
} }
// ========== ==========
// const [reload] = useXTable({
// allSchemas: allSchemas,
// getListApi: ProcessInstanceApi.getMyProcessInstancePage
// })
/** 发起流程操作 **/ /** 发起流程操作 **/
const handleCreate = () => { const handleCreate = () => {
@ -218,7 +214,7 @@ const handleCreate = () => {
}) })
} }
// /** 查看详情 */
const handleDetail = (row) => { const handleDetail = (row) => {
router.push({ router.push({
name: 'BpmProcessInstanceDetail', name: 'BpmProcessInstanceDetail',
@ -229,18 +225,21 @@ const handleDetail = (row) => {
} }
/** 取消按钮操作 */ /** 取消按钮操作 */
const handleCancel = (row) => { const handleCancel = async (row) => {
ElMessageBox.prompt('请输入取消原因', '取消流程', { //
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: t('common.ok'), confirmButtonText: t('common.ok'),
cancelButtonText: t('common.cancel'), cancelButtonText: t('common.cancel'),
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // inputPattern: /^[\s\S]*.*\S[\s\S]*$/, //
inputErrorMessage: '取消原因不能为空' inputErrorMessage: '取消原因不能为空'
}).then(async ({ value }) => { })
//
await ProcessInstanceApi.cancelProcessInstance(row.id, value) await ProcessInstanceApi.cancelProcessInstance(row.id, value)
message.success('取消成功') message.success('取消成功')
// reload() //
}) await getList()
} }
/** 初始化 **/ /** 初始化 **/
onMounted(() => { onMounted(() => {
getList() getList()

View File

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

View File

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