yxk-20260424-新增通用查询流程组件v1,传入businessid查询所有相关流程
This commit is contained in:
+11
-2
@@ -16,6 +16,7 @@ enum Api {
|
|||||||
getCategoryData = '/sys/category/loadAllData',
|
getCategoryData = '/sys/category/loadAllData',
|
||||||
startProcess = '/act/process/extActProcess/startMutilProcess',
|
startProcess = '/act/process/extActProcess/startMutilProcess',
|
||||||
startProcessSchedules = '/tasktask/taskTask/flow-schedules',
|
startProcessSchedules = '/tasktask/taskTask/flow-schedules',
|
||||||
|
queryByBusinessId = '/tasktask/taskTask/queryByBusinessId',
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -165,8 +166,16 @@ export const startProcess = (params) => {
|
|||||||
return defHttp.post({
|
return defHttp.post({
|
||||||
url: Api.startProcess,
|
url: Api.startProcess,
|
||||||
params,
|
params,
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据业务ID查询流程列表
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const queryByBusinessId = (params) =>
|
||||||
|
defHttp.get({ url: Api.queryByBusinessId, params }, { isTransformResponse: false });
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 【用于评论功能】自定义文件上传-方法
|
* 【用于评论功能】自定义文件上传-方法
|
||||||
|
|||||||
@@ -0,0 +1,124 @@
|
|||||||
|
<template>
|
||||||
|
<j-modal
|
||||||
|
:title="title"
|
||||||
|
:width="1400"
|
||||||
|
:visible="visible"
|
||||||
|
:footer="null"
|
||||||
|
@cancel="handleCancel"
|
||||||
|
cancelText="关闭"
|
||||||
|
>
|
||||||
|
<div class="business-process-list-modal">
|
||||||
|
<BasicTable @register="registerTable">
|
||||||
|
<template #action="{ record }">
|
||||||
|
<TableAction :actions="getTableAction(record)" />
|
||||||
|
</template>
|
||||||
|
</BasicTable>
|
||||||
|
</div>
|
||||||
|
<BpmPictureModal @register="registerBpmModal" />
|
||||||
|
</j-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { BasicTable, TableAction, useTable } from '/@/components/Table';
|
||||||
|
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||||
|
import { useModal } from '/@/components/Modal';
|
||||||
|
import { columns } from '/@/views/taskProcess/TaskTask.data';
|
||||||
|
import { queryByBusinessId } from '/@/api/common/api';
|
||||||
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
|
|
||||||
|
interface OpenParams {
|
||||||
|
businessId?: string;
|
||||||
|
title?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const title = ref('流程列表');
|
||||||
|
const visible = ref(false);
|
||||||
|
const currentBusinessId = ref('');
|
||||||
|
const { createMessage } = useMessage();
|
||||||
|
const [registerBpmModal, { openModal: bpmPicModal }] = useModal();
|
||||||
|
|
||||||
|
const [registerTable, { setTableData, setLoading, clearSelectedRowKeys }] = useTable({
|
||||||
|
rowKey: 'id',
|
||||||
|
columns,
|
||||||
|
useSearchForm: false,
|
||||||
|
canResize: false,
|
||||||
|
pagination: false,
|
||||||
|
showIndexColumn: true,
|
||||||
|
bordered: true,
|
||||||
|
actionColumn: {
|
||||||
|
title: '操作',
|
||||||
|
dataIndex: 'action',
|
||||||
|
width: 120,
|
||||||
|
fixed: 'right',
|
||||||
|
slots: { customRender: 'action' },
|
||||||
|
},
|
||||||
|
scroll: {
|
||||||
|
x: 3600,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
async function loadData() {
|
||||||
|
if (!currentBusinessId.value) {
|
||||||
|
setTableData([]);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
setLoading(true);
|
||||||
|
try {
|
||||||
|
const res = await queryByBusinessId({ businessId: currentBusinessId.value });
|
||||||
|
const list = Array.isArray(res?.result) ? res.result : [];
|
||||||
|
setTableData(list);
|
||||||
|
if (!list.length) {
|
||||||
|
createMessage.warning(res?.message || '未查询到流程数据');
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
setTableData([]);
|
||||||
|
} finally {
|
||||||
|
setLoading(false);
|
||||||
|
clearSelectedRowKeys();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function open(params: OpenParams = {}) {
|
||||||
|
currentBusinessId.value = params.businessId || '';
|
||||||
|
title.value = params.title || '流程列表';
|
||||||
|
visible.value = true;
|
||||||
|
loadData();
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleCancel() {
|
||||||
|
visible.value = false;
|
||||||
|
currentBusinessId.value = '';
|
||||||
|
setTableData([]);
|
||||||
|
clearSelectedRowKeys();
|
||||||
|
}
|
||||||
|
|
||||||
|
function handlePreviewPic(record) {
|
||||||
|
bpmPicModal(true, {
|
||||||
|
flowCode: record.flowCode,
|
||||||
|
dataId: record.id,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function getTableAction(record) {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: '审批历史',
|
||||||
|
onClick: handlePreviewPic.bind(null, record),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
open,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.business-process-list-modal {
|
||||||
|
:deep(.vben-basic-table) {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -24,8 +24,8 @@
|
|||||||
</a-menu-item>
|
</a-menu-item>
|
||||||
</a-menu>
|
</a-menu>
|
||||||
</template>
|
</template>
|
||||||
<a-button v-auth="'bgpartymatter:bg_partymatter:deleteBatch'"
|
<a-button v-auth="'bgpartymatter:bg_partymatter:deleteBatch'">
|
||||||
>批量操作
|
批量操作
|
||||||
<Icon icon="mdi:chevron-down"></Icon>
|
<Icon icon="mdi:chevron-down"></Icon>
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-dropdown>
|
</a-dropdown>
|
||||||
@@ -52,11 +52,12 @@
|
|||||||
<!-- 审批记录 -->
|
<!-- 审批记录 -->
|
||||||
<BpmPictureModal @register="registerBpmModal" />
|
<BpmPictureModal @register="registerBpmModal" />
|
||||||
<FlowScheduleStartModal ref="flowScheduleModalRef" @confirm="handleFlowScheduleConfirm" />
|
<FlowScheduleStartModal ref="flowScheduleModalRef" @confirm="handleFlowScheduleConfirm" />
|
||||||
|
<BusinessProcessListModal ref="businessProcessListModalRef" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" name="bgpartymatter-bgPartymatter" setup>
|
<script lang="ts" name="bgpartymatter-bgPartymatter" setup>
|
||||||
import { ref, reactive, computed, unref, provide } from 'vue';
|
import { computed, reactive, ref, unref, provide } from 'vue';
|
||||||
import { BasicTable, TableAction } from '/@/components/Table';
|
import { BasicTable, TableAction } from '/@/components/Table';
|
||||||
import { useListPage } from '/@/hooks/system/useListPage';
|
import { useListPage } from '/@/hooks/system/useListPage';
|
||||||
import { useModal } from '/@/components/Modal';
|
import { useModal } from '/@/components/Modal';
|
||||||
@@ -65,17 +66,22 @@
|
|||||||
import { startProcessSchedules } from '/@/api/common/api';
|
import { startProcessSchedules } from '/@/api/common/api';
|
||||||
import BgPartymatterModal from './components/BgPartymatterModal.vue';
|
import BgPartymatterModal from './components/BgPartymatterModal.vue';
|
||||||
import BgPartymatterFeedbackList from './BgPartymatterFeedbackList.vue';
|
import BgPartymatterFeedbackList from './BgPartymatterFeedbackList.vue';
|
||||||
|
import BusinessProcessListModal from '/src/components/semri/process/BusinessProcessListModal.vue';
|
||||||
import FlowScheduleStartModal from '/src/components/semri/process/FlowScheduleStartModal.vue';
|
import FlowScheduleStartModal from '/src/components/semri/process/FlowScheduleStartModal.vue';
|
||||||
import { columns, superQuerySchema } from './BgPartymatter.data';
|
import { columns, superQuerySchema } from './BgPartymatter.data';
|
||||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './BgPartymatter.api';
|
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './BgPartymatter.api';
|
||||||
|
|
||||||
|
const FLOW_CODE = 'dev_task_task_001';
|
||||||
|
const FLOW_NAME = '党委会决议事项';
|
||||||
|
const BUSINESS_TABLE_NAME = 'bg_partymatter';
|
||||||
|
const FORM_URL = 'bgpartymatter/components/BgPartymatterForm';
|
||||||
|
|
||||||
const [registerBpmModal, { openModal: bpmPicModal }] = useModal();
|
const [registerBpmModal, { openModal: bpmPicModal }] = useModal();
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const registerModal = ref();
|
const registerModal = ref();
|
||||||
const flowScheduleModalRef = ref();
|
const flowScheduleModalRef = ref();
|
||||||
|
const businessProcessListModalRef = ref();
|
||||||
const queryParam = reactive<any>({});
|
const queryParam = reactive<any>({});
|
||||||
const { createMessage } = useMessage();
|
|
||||||
//注册table数据
|
//注册table数据
|
||||||
const { tableContext, onExportXls, onImportXls } = useListPage({
|
const { tableContext, onExportXls, onImportXls } = useListPage({
|
||||||
tableProps:{
|
tableProps:{
|
||||||
@@ -108,9 +114,9 @@
|
|||||||
url: getImportUrl,
|
url: getImportUrl,
|
||||||
success: handleSuccess,
|
success: handleSuccess,
|
||||||
},
|
},
|
||||||
})
|
});
|
||||||
|
|
||||||
const [registerTable, { reload },{ rowSelection, selectedRowKeys }] = tableContext
|
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||||
const mainId = computed(() => (unref(selectedRowKeys).length > 0 ? unref(selectedRowKeys)[0] : ''));
|
const mainId = computed(() => (unref(selectedRowKeys).length > 0 ? unref(selectedRowKeys)[0] : ''));
|
||||||
//下发 mainId,子组件接收
|
//下发 mainId,子组件接收
|
||||||
provide('mainId', mainId);
|
provide('mainId', mainId);
|
||||||
@@ -208,6 +214,10 @@
|
|||||||
onClick: handlePreviewPic.bind(null, record),
|
onClick: handlePreviewPic.bind(null, record),
|
||||||
ifShow: !!record.bpmStatus && record.bpmStatus !== '1',
|
ifShow: !!record.bpmStatus && record.bpmStatus !== '1',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '查询督办流程',
|
||||||
|
onClick: handleQueryProcess.bind(null, record),
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
if (record.bpmStatus == '1' || !record.bpmStatus) {
|
if (record.bpmStatus == '1' || !record.bpmStatus) {
|
||||||
@@ -227,6 +237,13 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleQueryProcess(record) {
|
||||||
|
businessProcessListModalRef.value?.open({
|
||||||
|
title: '流程列表',
|
||||||
|
businessId: record.id,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async function handleFlowScheduleConfirm({ payload, options }) {
|
async function handleFlowScheduleConfirm({ payload, options }) {
|
||||||
const record = payload?.record || {};
|
const record = payload?.record || {};
|
||||||
const formatDate = (value, format) => {
|
const formatDate = (value, format) => {
|
||||||
@@ -241,16 +258,13 @@
|
|||||||
triggerType: options.triggerType,
|
triggerType: options.triggerType,
|
||||||
startTime: options.intervalStartTime,
|
startTime: options.intervalStartTime,
|
||||||
//流程相关字段
|
//流程相关字段
|
||||||
flowCode: 'dev_task_task_001',
|
flowCode: FLOW_CODE,
|
||||||
formUrl: 'bgpartymatter/components/BgPartymatterForm',
|
formUrl: FORM_URL,
|
||||||
flowName: '党委会决议事项',
|
flowName: FLOW_NAME,
|
||||||
// jsonData: { deptid: 'xxx', deptname: 'xxxx1' },
|
|
||||||
jsonData: record,
|
jsonData: record,
|
||||||
//台账相关字段
|
//台账相关字段
|
||||||
businessTablename: 'bg_partymatter',
|
businessTablename: BUSINESS_TABLE_NAME,
|
||||||
businessId: record.id,
|
businessId: record.id,
|
||||||
// deptLeaderId: 'sdw01',
|
|
||||||
|
|
||||||
title: record.title,
|
title: record.title,
|
||||||
content: record.content,
|
content: record.content,
|
||||||
urgencyLevel: record.urgencyLevel,
|
urgencyLevel: record.urgencyLevel,
|
||||||
@@ -262,13 +276,12 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
await startProcessSchedules(params);
|
await startProcessSchedules(params);
|
||||||
// createMessage.success('流程发起成功');
|
|
||||||
handleSuccess();
|
handleSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handlePreviewPic(record) {
|
async function handlePreviewPic(record) {
|
||||||
bpmPicModal(true, {
|
bpmPicModal(true, {
|
||||||
flowCode: 'dev_task_task_001',
|
flowCode: FLOW_CODE,
|
||||||
dataId: record.id,
|
dataId: record.id,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -322,18 +335,23 @@
|
|||||||
.query-group-split-cust{
|
.query-group-split-cust{
|
||||||
width: 30px;
|
width: 30px;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
text-align: center
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-form-item:not(.ant-form-item-with-help) {
|
.ant-form-item:not(.ant-form-item-with-help) {
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
}
|
}
|
||||||
:deep(.ant-picker),:deep(.ant-input-number){
|
|
||||||
|
:deep(.ant-picker),
|
||||||
|
:deep(.ant-input-number) {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.erpNativeList {
|
.erpNativeList {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|||||||
Reference in New Issue
Block a user