yxk-20260605-我为四所把把脉

1、改造 BgTakepulseList.vue 的流程发起方式,由原来的普通 startProcess 改为复用 FlowScheduleStartModalForBG 调度弹窗,支持立即督办和重复督办。
2、行操作中新增/调整“发起督办流程”“再次督办”“查询督办流程”,并按 bpmStatus 控制显示。
3、发起流程时组装与 BgPartymatterList.vue 一致的督办流程参数,流程编码使用 dev_task_task_001,流程名称为“我为四所把把脉”。
4、被督办部门改为牵头部门加协办部门,自动去重后带入弹窗。
5、发起成功后回写完成状态为督办中,并自动累加督办次数。
6、新增 BgTakepulseBPMForm.vue,作为“我为四所把把脉”专用 BPM 办理表单。
7、新增 BgTakepulseBPMFeedbackModal.vue,支持流程中新增、编辑、删除执行情况反馈,并支持附件上传。
8、扩展 BgTakepulse.api.ts,新增 BPM 表单保存、流程变量保存、反馈列表和反馈 CRUD 相关接口。
This commit is contained in:
ye1023
2026-06-05 16:41:09 +08:00
parent 703be0d85c
commit aad7944baf
4 changed files with 1213 additions and 29 deletions
+155 -28
View File
@@ -86,35 +86,38 @@
<BgTakepulseModal @register="registerModal" @success="handleSuccess"></BgTakepulseModal>
<!-- 审批记录 -->
<BpmPictureModal @register="registerBpmModal" />
<FlowScheduleStartModalForBG ref="flowScheduleModalRef" @confirm="handleFlowScheduleConfirm" />
<BusinessProcessListModal ref="businessProcessListModalRef" />
</div>
</template>
<script lang="ts" name="bqtakepulse-bgTakepulse" setup>
import {ref, reactive, computed, unref} from 'vue';
import {BasicTable, useTable, TableAction} from '/@/components/Table';
import {ref, reactive} from 'vue';
import {BasicTable, TableAction} from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage'
import {useModal} from '/@/components/Modal';
import BgTakepulseModal from './components/BgTakepulseModal.vue'
import {columns, superQuerySchema} from './BgTakepulse.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './BgTakepulse.api';
import {downloadFile} from '/@/utils/common/renderUtils';
import { useMessage } from '/@/hooks/web/useMessage';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import JSwitch from '/@/components/Form/src/jeecg/components/JSwitch.vue';
import {list, deleteOne, batchDelete, getImportUrl, getExportUrl, saveOrUpdate} from './BgTakepulse.api';
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
import JSelectDept from '/@/components/Form/src/jeecg/components/JSelectDept.vue';
import JSelectUser from '/@/components/Form/src/jeecg/components/JSelectUser.vue';
import { startProcess } from '/@/api/common/api';
import { startProcessSchedules } from '/@/api/common/api';
import { dateUtil } from '/@/utils/dateUtil';
import FlowScheduleStartModalForBG from '/src/components/semri/process/FlowScheduleStartModalForBG.vue';
import BusinessProcessListModal from '/src/components/semri/process/BusinessProcessListModal.vue';
const [registerBpmModal, { openModal: bpmPicModal }] = useModal();
import { useUserStore } from '/@/store/modules/user';
const FLOW_CODE = 'dev_task_task_001';
const BUSINESS_TABLE_NAME = 'bg_takepulse';
const FORM_URL = 'bg/bqtakepulse/components/BgTakepulseBPMForm';
const FLOW_NAME = '我为四所把把脉';
const formRef = ref();
const queryParam = reactive<any>({});
const checkedKeys = ref<Array<string | number>>([]);
//注册model
const [registerModal, {openModal}] = useModal();
const userStore = useUserStore();
const { createMessage } = useMessage();
const flowScheduleModalRef = ref();
const businessProcessListModalRef = ref();
//注册table数据
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
@@ -144,6 +147,11 @@
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
interface DeptOption {
label: string;
value: string;
}
// 高级查询配置
const superQueryConfig = reactive(superQuerySchema);
@@ -236,16 +244,22 @@
label: '审批进度',
onClick: handlePreviewPic.bind(null, record),
ifShow: !!record.bpmStatus && record.bpmStatus !== '1',
},
{
label: '查询督办流程',
onClick: handleQueryProcess.bind(null, record),
}
];
if(record.bpmStatus == '1' || !record.bpmStatus){
dropDownAction.push({
label: '发起流程',
popConfirm: {
title: '确认提交流程吗?',
confirm: handleProcess.bind(null, record),
placement: 'topLeft',
}
label: '发起督办流程',
onClick: handleProcess.bind(null, record),
})
}
if(record.bpmStatus == '2' || !record.bpmStatus){
dropDownAction.push({
label: '再次督办',
onClick: handleProcess.bind(null, record),
})
}
return dropDownAction;
@@ -254,14 +268,127 @@
/**
* 提交流程
*/
async function handleProcess(record) {
let params = {
flowCode: 'dev_bg_takepulse_001',
id: record.id,
formUrl: 'bqtakepulse/components/BgTakepulseForm',
formUrlMobile: ''
function handleProcess(record) {
flowScheduleModalRef.value?.open({
title: '发起流程',
taskTitle: record?.title,
payload: { record },
deptOptions: getResponsibleDeptOptions(record),
showSuoleaderFields: true,
isNeedAppro: record?.isNeedAppro,
supDeptleaderid: record?.supDeptleaderid,
showDeadlineField: true,
deadline: record?.deadline,
showUrgencyLevelField: true,
urgencyLevel: record?.urgencyLevel,
});
}
function splitDeptValue(value) {
if (Array.isArray(value)) {
return value.map((item) => String(item || '').trim()).filter(Boolean);
}
await startProcess(params);
return String(value || '')
.split(/[,\uFF0C]/)
.map((item) => item.trim())
.filter(Boolean);
}
function getResponsibleDeptOptions(record): DeptOption[] {
const optionMap = new Map<string, DeptOption>();
[
{
ids: splitDeptValue(record?.responDeptid),
names: splitDeptValue(record?.responDeptid_dictText || record?.responDeptname),
},
{
ids: splitDeptValue(record?.assistDeptid),
names: splitDeptValue(record?.assistDeptid_dictText || record?.assistDeptname),
},
].forEach(({ ids, names }) => {
ids.forEach((deptId, index) => {
if (optionMap.has(deptId)) {
return;
}
optionMap.set(deptId, {
value: deptId,
label: names[index] || deptId,
});
});
});
return Array.from(optionMap.values());
}
function getResponsibleDeptIds(record) {
return getResponsibleDeptOptions(record)
.map((item) => item.value)
.join(',');
}
function getNextSuperviseCount(value) {
const count = Number(value || 0);
return Number.isFinite(count) ? count + 1 : 1;
}
function handleQueryProcess(record) {
businessProcessListModalRef.value?.open({
title: '流程列表',
businessId: record.id,
columns: '',
});
}
async function handleFlowScheduleConfirm({ payload, options }) {
const record = payload?.record || {};
const formatDate = (value, format) => {
return value ? dateUtil(value).format(format) : undefined;
};
const formatDeadlineDateTime = (value) => {
const deadlineDate = formatDate(value, 'YYYY-MM-DD');
return deadlineDate ? `${deadlineDate} 00:00:00` : undefined;
};
const nextSuperviseCount = getNextSuperviseCount(record.superviseCount);
const selectedTitle = options.title || record.title || '';
const selectedDeadline = options.deadline || record.deadline;
const selectedUrgencyLevel = options.urgencyLevel ?? record.urgencyLevel ?? '0';
const defaultDeptIds = getResponsibleDeptIds(record);
const flowJsonData = {
...record,
isNeedAppro: options.isNeedAppro ?? record.isNeedAppro ?? '',
supDeptleaderid: options.supDeptleaderid ?? record.supDeptleaderid ?? '',
superviseCount: nextSuperviseCount,
// 用户可在发起前确认本次督办标题,仅影响流程数据,不回写台账标题。
title: selectedTitle,
deadline: selectedDeadline,
// 紧急标记随本次流程发起传出,业务表只回写状态和督办次数。
urgencyLevel: selectedUrgencyLevel,
};
const params = {
intervalType: options.intervalType,
startCount: options.startCount,
taskTask: {
// 重复督办参数与党委会事项保持一致。
triggerType: options.triggerType,
startTime: options.intervalStartTime,
flowCode: FLOW_CODE,
formUrl: FORM_URL,
flowName: FLOW_NAME,
jsonData: flowJsonData,
businessTablename: BUSINESS_TABLE_NAME,
businessId: record.id,
title: selectedTitle,
content: record.content,
urgencyLevel: selectedUrgencyLevel,
deptId: options.deptId || defaultDeptIds,
deptLeaderId: record.responDeptid,
requireFinishDate: formatDate(selectedDeadline, 'YYYY-MM-DD'),
deadline: formatDeadlineDateTime(selectedDeadline),
},
};
await startProcessSchedules(params);
await saveOrUpdate({ id: record.id, bpmStatus: '2', superviseCount: nextSuperviseCount }, true);
handleSuccess();
}
@@ -270,7 +397,7 @@
*/
async function handlePreviewPic(record) {
bpmPicModal(true, {
flowCode: 'dev_bg_takepulse_001',
flowCode: FLOW_CODE,
dataId: record.id,
});
}
@@ -334,4 +461,4 @@
width: 100%;
}
}
</style>
</style>