|
@@ -43,17 +43,22 @@
|
|
|
<el-form :inline="true" :model="searchForm" class="demo-form-inline">
|
|
|
<el-form-item label="流程名称">
|
|
|
<el-tree-select
|
|
|
- v-model="value"
|
|
|
- :data="flowTemplateNameTree"
|
|
|
+ :data="flowTemplates"
|
|
|
+ :props="defaultProps"
|
|
|
:render-after-expand="false"
|
|
|
- show-checkbox
|
|
|
- default-expand-all
|
|
|
- :props="{ label: 'name', value: 'id', children: 'children' }"
|
|
|
+ ref="treeRef"
|
|
|
style="width: 240px"
|
|
|
+ default-expand-all
|
|
|
+ show-checkbox
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="">
|
|
|
- <el-input type="text" />
|
|
|
+ <el-input
|
|
|
+ type="text"
|
|
|
+ style="width: 280px"
|
|
|
+ v-model="sendData['searchVal']"
|
|
|
+ placeholder="业务编号/流程描述/流程名称"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" @click="searchHandle">查询</el-button>
|
|
@@ -72,7 +77,7 @@
|
|
|
color: '#233755',
|
|
|
height: '50px'
|
|
|
}"
|
|
|
- @row-dblclick="dblclickHandle"
|
|
|
+ @row-dblclick="(item) => openFlowHandle(item)"
|
|
|
>
|
|
|
<el-table-column
|
|
|
v-for="(item, index) in currentColumn"
|
|
@@ -92,7 +97,11 @@
|
|
|
split-button
|
|
|
type="primary"
|
|
|
@click="flowApplyHandle(scope.row)"
|
|
|
- @command="commandHandle"
|
|
|
+ @command="
|
|
|
+ (name) => {
|
|
|
+ commandHandle(name, scope.row)
|
|
|
+ }
|
|
|
+ "
|
|
|
>
|
|
|
办理
|
|
|
<template #dropdown>
|
|
@@ -109,7 +118,7 @@
|
|
|
</el-dropdown>
|
|
|
</template>
|
|
|
<template v-else-if="currentTab === '90'">
|
|
|
- <el-button type="primary" icon="Search" @click="lookHandle(scope.row)">
|
|
|
+ <el-button type="primary" icon="Search" @click="openFlowHandle(scope.row)">
|
|
|
查看
|
|
|
</el-button>
|
|
|
<el-popconfirm title="是否确定追回?" @confirm="recoverActivityHandle(scope.row)">
|
|
@@ -119,12 +128,12 @@
|
|
|
</el-popconfirm>
|
|
|
</template>
|
|
|
<template v-else-if="currentTab === '40'">
|
|
|
- <el-button type="primary" icon="Search" @click="lookHandle(scope.row)">
|
|
|
+ <el-button type="primary" icon="Search" @click="openFlowHandle(scope.row)">
|
|
|
查看
|
|
|
</el-button>
|
|
|
</template>
|
|
|
<template v-else-if="currentTab === '20'">
|
|
|
- <el-button type="primary" icon="Search" @click="lookHandle(scope.row)">
|
|
|
+ <el-button type="primary" icon="Search" @click="openFlowHandle(scope.row)">
|
|
|
查看
|
|
|
</el-button>
|
|
|
<el-popconfirm title="是否确定解挂?" @confirm="addIHangUpHandle(scope.row)">
|
|
@@ -134,14 +143,16 @@
|
|
|
</el-popconfirm>
|
|
|
</template>
|
|
|
<template v-else-if="currentTab === '160'">
|
|
|
- <el-button type="primary" icon="Search" @click="lookHandle(scope.row)">
|
|
|
+ <el-button type="primary" icon="Search" @click="openFlowHandle(scope.row, '160')">
|
|
|
查看
|
|
|
</el-button>
|
|
|
- <el-popconfirm title="是否确定恢复?" @confirm="addINullyApplyHandle(scope.row)">
|
|
|
- <template #reference>
|
|
|
- <el-button type="warning" icon="RefreshRight"> 恢复 </el-button>
|
|
|
- </template>
|
|
|
- </el-popconfirm>
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ icon="RefreshRight"
|
|
|
+ @click="recoverINullyApplyHandle(scope.row)"
|
|
|
+ >
|
|
|
+ 恢复
|
|
|
+ </el-button>
|
|
|
<el-popconfirm
|
|
|
title="是否确定彻底作废?"
|
|
|
@confirm="completelyVoidINullyApplyHandle(scope.row)"
|
|
@@ -166,30 +177,97 @@
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <!-- 作废表单Dialog -->
|
|
|
+ <el-dialog v-model="nullyApplyVisible" :title="nullyApplyTitle" width="40%">
|
|
|
+ <el-form v-model="inullyApplyForm" label-width="100px">
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="申请人:">
|
|
|
+ <el-input v-model="inullyApplyForm.nickname" disabled />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="申请时间:">
|
|
|
+ <el-input v-model="inullyApplyForm.nullyApplyTime" disabled />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="申请原因:">
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ rows="5"
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="inullyApplyForm.nullyReason"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button @click="nullyApplyVisible = false">关闭</el-button>
|
|
|
+ <el-button type="primary" @click="nullyApplySubmit">提交</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 退回表单Dialog -->
|
|
|
+ <el-dialog v-model="callbackVisible" title="退回" width="40%">
|
|
|
+ <el-form v-model="callbackForm" label-width="100px">
|
|
|
+ <div class="callback_header">
|
|
|
+ <span class="title">{{ callbackTitle }}</span>
|
|
|
+ <ul class="callback_process">
|
|
|
+ <li
|
|
|
+ v-for="(item, index) in callbacks"
|
|
|
+ :key="index"
|
|
|
+ :class="{ active: index === 0 }"
|
|
|
+ :icon="Edit"
|
|
|
+ >
|
|
|
+ <el-icon style="margin-right: 2px">
|
|
|
+ <DArrowRight />
|
|
|
+ </el-icon>
|
|
|
+ <span>{{ item['name'] }}</span>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ <div class="callback_header">
|
|
|
+ <span class="title">请填写退回原因</span>
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ rows="5"
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="callbackForm.callbackRemark"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </el-form>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button @click="callbackVisible = false">关闭</el-button>
|
|
|
+ <el-button type="primary" @click="callbackSumbit">提交</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { listToTree } from '@/utils/tree'
|
|
|
-import { openFlow } from '@/utils/flow'
|
|
|
+import { Edit } from '@element-plus/icons-vue'
|
|
|
+import { defaultProps, handleTree } from '@/utils/tree'
|
|
|
import {
|
|
|
getHandlerCaseCenterList,
|
|
|
getHandlerCaseCenterCount,
|
|
|
getFlowTemplateTreeDataByUser,
|
|
|
getFlowTemplateTree,
|
|
|
- addTProcessEngine,
|
|
|
recoverActivity,
|
|
|
- addIHangUp,
|
|
|
- addINullyApply,
|
|
|
- completelyVoidINullyApply,
|
|
|
- isFlowVoid,
|
|
|
- saveINullyApply,
|
|
|
- openOfficeTip,
|
|
|
- saveAndGetUrl
|
|
|
+ addIHangUp
|
|
|
} from '@/api/oa/workflow'
|
|
|
import { TabColumns } from './common'
|
|
|
+import { InullyApplyEnum, InullyApplyEnumType } from './inullyApply'
|
|
|
+import useLookAndApplyFlow from './lookAndApplyFlow'
|
|
|
+import useInullyApply from './inullyApply'
|
|
|
+import useCallback from './callback'
|
|
|
|
|
|
-const router = useRouter()
|
|
|
const message = useMessage()
|
|
|
const currentTab = ref<string>('1')
|
|
|
const currentColumn = ref<any[]>(TabColumns[currentTab.value])
|
|
@@ -202,7 +280,7 @@ const pageParam = reactive<{
|
|
|
pageNo: 1,
|
|
|
pageSize: 10
|
|
|
})
|
|
|
-const sendData = {
|
|
|
+const sendData = reactive({
|
|
|
_search: false,
|
|
|
status: 1,
|
|
|
flowTemIds: [],
|
|
@@ -210,20 +288,17 @@ const sendData = {
|
|
|
isMobile: false,
|
|
|
queryMethod: 0,
|
|
|
toSystemId: '',
|
|
|
- excludedSystemId: ''
|
|
|
-}
|
|
|
+ excludedSystemId: '',
|
|
|
+ page: 1,
|
|
|
+ rows: 10
|
|
|
+})
|
|
|
/**
|
|
|
* 初始化流程列表
|
|
|
*/
|
|
|
const queryHandlerCaseCenterList = () => {
|
|
|
sendData['page'] = pageParam['pageNo']
|
|
|
sendData['rows'] = pageParam['pageSize']
|
|
|
- const formData = new FormData()
|
|
|
- const keys = Object.keys(sendData)
|
|
|
- for (let key of keys) {
|
|
|
- formData.set(key, sendData[key])
|
|
|
- }
|
|
|
- getHandlerCaseCenterList(formData).then((result: any) => {
|
|
|
+ getHandlerCaseCenterList(sendData).then((result: any) => {
|
|
|
if (result.rows && result.rows.length > 0) {
|
|
|
result.rows.forEach((item) => {
|
|
|
item['btnArrJson'] = item['btnArrJson'] ? JSON.parse(item['btnArrJson']) : []
|
|
@@ -314,26 +389,10 @@ const initFlowTemplateTree = () => {
|
|
|
}
|
|
|
initFlowTemplateTree()
|
|
|
|
|
|
-/**
|
|
|
- * 通过流程模板发起流程
|
|
|
- */
|
|
|
-const addTProcessHandle = (item) => {
|
|
|
- addTProcessEngine(item['id']).then((result) => {
|
|
|
- router.push({
|
|
|
- path: '/processContainer',
|
|
|
- query: {
|
|
|
- iframe: '1',
|
|
|
- iFrameId: item['id'],
|
|
|
- url: result,
|
|
|
- title: item['name']
|
|
|
- }
|
|
|
- })
|
|
|
- })
|
|
|
-}
|
|
|
/**
|
|
|
* 初始化搜索条件中流程名称Tree结构数据
|
|
|
*/
|
|
|
-const flowTemplateNameTree = ref<any>()
|
|
|
+const flowTemplates = ref<any[]>([])
|
|
|
const queryFlowTemplateTreeDataByUser = (officeStatus = '1') => {
|
|
|
const formData = new FormData()
|
|
|
formData.append('isRight', '0')
|
|
@@ -341,115 +400,67 @@ const queryFlowTemplateTreeDataByUser = (officeStatus = '1') => {
|
|
|
formData.append('excludedSystemId', '') //后台获取
|
|
|
formData.append('officeStatus', officeStatus)
|
|
|
getFlowTemplateTreeDataByUser(formData).then((result: any) => {
|
|
|
- flowTemplateNameTree.value = listToTree(result)
|
|
|
+ flowTemplates.value = handleTree(result, 'id', 'pid')
|
|
|
})
|
|
|
}
|
|
|
queryFlowTemplateTreeDataByUser()
|
|
|
const searchForm = ref({
|
|
|
name: ''
|
|
|
})
|
|
|
+const treeRef = ref()
|
|
|
const searchHandle = () => {
|
|
|
+ sendData.flowTemIds = treeRef.value.getCheckedNodes(false).map((item) => item['id'])
|
|
|
handleCurrentChange(1)
|
|
|
}
|
|
|
-/**
|
|
|
- * 流程办理
|
|
|
- */
|
|
|
-const flowApplyHandle = (item) => {
|
|
|
- const saveAndGetUrlReqParam = {
|
|
|
- activityInsId: item['ACTIVITYINSID'],
|
|
|
- flowInsId: item['FLOWINSID'],
|
|
|
- particiPantId: item['PARTICIPANTID'],
|
|
|
- status: item['STATUS'],
|
|
|
- userId: '',
|
|
|
- isView: false
|
|
|
+const { addTProcessHandle, openFlowHandle, flowApplyHandle } = useLookAndApplyFlow()
|
|
|
+
|
|
|
+const commandHandle = (name, item) => {
|
|
|
+ if (name === '作废') {
|
|
|
+ cancelFlow(item)
|
|
|
+ } else if (name === '退回') {
|
|
|
+ callbackActivity(item)
|
|
|
}
|
|
|
- openOfficeTip({
|
|
|
- activityInsId: item['ACTIVITYINSID'],
|
|
|
- particiPantId: item['PARTICIPANTID'],
|
|
|
- isView: false
|
|
|
- }).then((res: any) => {
|
|
|
- saveAndGetUrl(saveAndGetUrlReqParam).then((result: any) => {
|
|
|
- const officeUrl = result.officeUrl
|
|
|
- openFlow(router, officeUrl, '流程办理')
|
|
|
- })
|
|
|
- })
|
|
|
-}
|
|
|
-const commandHandle = (item) => {
|
|
|
- console.log(item)
|
|
|
return
|
|
|
- saveINullyApply({
|
|
|
- id: '',
|
|
|
- nullyApplyUserId: '91507848-736f-4327-887e-22aec122d5c7',
|
|
|
- flowInstanceId: '0191021ed6a800011ab09091724c091b',
|
|
|
- voidFlowInstanceId: '0191020bbc9c00011ab09091724c0912',
|
|
|
- iNullied: '10',
|
|
|
- voidFlowCode: 'LX2024070011',
|
|
|
- voidFlowDesc: '',
|
|
|
- voidFlowName: '立项申请',
|
|
|
- nullyApplyTime: '2024-07-30',
|
|
|
- nullyReason: ''
|
|
|
- })
|
|
|
}
|
|
|
/**
|
|
|
- * 待办组合操作:退回、挂起、作废
|
|
|
+ * 初始化作废Hook
|
|
|
*/
|
|
|
-const flowOperateGroup = () => {}
|
|
|
-/***
|
|
|
- * 双击查看流程详情
|
|
|
- */
|
|
|
-const dblclickHandle = (item) => {
|
|
|
- lookHandle(item)
|
|
|
-}
|
|
|
-const isEmpty = (content) => {
|
|
|
- if (!content || content.replace(/\s*/g, '') == '') {
|
|
|
- return true
|
|
|
- } else {
|
|
|
- return false
|
|
|
- }
|
|
|
-}
|
|
|
-const lookHandle = (item: any) => {
|
|
|
- const saveAndGetUrlReqParam = {
|
|
|
- activityInsId: item['ACTIVITYINSID'],
|
|
|
- flowInsId: item['FLOWINSID'],
|
|
|
- particiPantId: item['PARTICIPANTID'],
|
|
|
- status: item['STATUS'],
|
|
|
- userId: '',
|
|
|
- isView: true
|
|
|
+const {
|
|
|
+ nullyApplyTitle,
|
|
|
+ nullyApplyVisible,
|
|
|
+ inullyApplyForm,
|
|
|
+ cancelFlow,
|
|
|
+ nullyApplySubmit,
|
|
|
+ recoverINullyApplyHandle,
|
|
|
+ completelyVoidINullyApplyHandle
|
|
|
+} = useInullyApply({
|
|
|
+ success: (type: InullyApplyEnumType) => {
|
|
|
+ message.success(
|
|
|
+ type === InullyApplyEnum.Recover
|
|
|
+ ? '恢复作废成功!'
|
|
|
+ : type === InullyApplyEnum.Nully
|
|
|
+ ? '作废成功!'
|
|
|
+ : '彻底作废成功!'
|
|
|
+ )
|
|
|
+ initHandleCaseCenterData()
|
|
|
}
|
|
|
- //非待办件、委托直接打开
|
|
|
- if (item['STATUS'] !== '1' && item['STATUS'] !== '2') {
|
|
|
- saveAndGetUrl(saveAndGetUrlReqParam).then((result: any) => {
|
|
|
- const officeUrl = result.officeUrl
|
|
|
- openFlow(router, officeUrl, '流程查看')
|
|
|
- })
|
|
|
- } else {
|
|
|
- openOfficeTip({
|
|
|
- activityInsId: item['ACTIVITYINSID'],
|
|
|
- particiPantId: item['PARTICIPANTID'],
|
|
|
- isView: true
|
|
|
- }).then((res: any) => {
|
|
|
- if (!res.msg && res.isTip && !isEmpty(res.tipMsg)) {
|
|
|
- ElMessageBox.confirm(res.tipMsg, 'Warning', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- saveAndGetUrl(saveAndGetUrlReqParam).then((result: any) => {
|
|
|
- const officeUrl = result.officeUrl
|
|
|
- openFlow(router, officeUrl, '流程查看')
|
|
|
- })
|
|
|
- })
|
|
|
- .catch(() => {})
|
|
|
- } else {
|
|
|
- saveAndGetUrl(saveAndGetUrlReqParam).then((result: any) => {
|
|
|
- const officeUrl = result.officeUrl
|
|
|
- openFlow(router, officeUrl, '流程查看')
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
+})
|
|
|
+/**
|
|
|
+ * 初始化退回Hook
|
|
|
+ */
|
|
|
+const {
|
|
|
+ callbackVisible,
|
|
|
+ callbackTitle,
|
|
|
+ callbacks,
|
|
|
+ callbackForm,
|
|
|
+ callbackActivity,
|
|
|
+ callbackSumbit
|
|
|
+} = useCallback({
|
|
|
+ success: (msg: string) => {
|
|
|
+ message.success(msg)
|
|
|
+ initHandleCaseCenterData()
|
|
|
}
|
|
|
-}
|
|
|
+})
|
|
|
/***
|
|
|
* 追回
|
|
|
*/
|
|
@@ -478,32 +489,6 @@ const addIHangUpHandle = (item: any) => {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
-/***
|
|
|
- * 恢复作废
|
|
|
- */
|
|
|
-const addINullyApplyHandle = (item: any) => {
|
|
|
- addINullyApply({
|
|
|
- activityInstanceId: item['ACTIVITYINSID'],
|
|
|
- voidFlowInstanceId: item['FLOWINSID'],
|
|
|
- isRecover: 1
|
|
|
- }).then((res) => {
|
|
|
- if (res) {
|
|
|
- message.success('解挂成功!')
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
-/***
|
|
|
- * 彻底作废
|
|
|
- */
|
|
|
-const completelyVoidINullyApplyHandle = (item: any) => {
|
|
|
- completelyVoidINullyApply({
|
|
|
- flowInstanceId: item['FLOWINSID']
|
|
|
- }).then((res) => {
|
|
|
- if (res) {
|
|
|
- message.success('解挂成功!')
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
const tableRef: any = ref(null)
|
|
|
const tableHeight: any = ref(0)
|
|
|
onMounted(() => {
|