diff --git a/src/views/bg/xispeak/BgXiSpeak.api.ts b/src/views/bg/xispeak/BgXiSpeak.api.ts index 61b6683..c6fb834 100644 --- a/src/views/bg/xispeak/BgXiSpeak.api.ts +++ b/src/views/bg/xispeak/BgXiSpeak.api.ts @@ -166,3 +166,7 @@ export const setProcessVariable = (params) => { export const updateLaunchType = (params) => { return defHttp.post({ url: '/bg/xispeak/bgXiSpeak/edit', params }, { isTransformResponse: false }); }; + +export const withDrawXiSpeak = (params) => { + return defHttp.post({ url: '/bg/xispeak/bgXiSpeak/withDrawXiSpeak', params }, { joinParamsToUrl: true, isTransformResponse: false }); +}; diff --git a/src/views/bg/xispeak/BgXiSpeak.data.ts b/src/views/bg/xispeak/BgXiSpeak.data.ts index 9f7b973..56b38b2 100644 --- a/src/views/bg/xispeak/BgXiSpeak.data.ts +++ b/src/views/bg/xispeak/BgXiSpeak.data.ts @@ -85,30 +85,30 @@ export const columns: BasicColumn[] = [ dataIndex: 'delayRiskMitigation', }, { - title: '完成状态(0推进中,1已完成)', + title: '完成状态', align: 'center', - dataIndex: 'completionStatus', + dataIndex: 'completionStatus_dictText', }, { - title: '落实部门id', + title: '落实部门', align: 'center', dataIndex: 'implDept_dictText', }, - { - title: '层深(最顶层节点层深为0)', - align: 'center', - dataIndex: 'treeDepth', - }, - { - title: '同级数据排序号', - align: 'center', - dataIndex: 'sortOrder', - }, - { - title: '流程引擎状态字段', - align: 'center', - dataIndex: 'bpmStatus', - }, + // { + // title: '层深(最顶层节点层深为0)', + // align: 'center', + // dataIndex: 'treeDepth', + // }, + // { + // title: '同级数据排序号', + // align: 'center', + // dataIndex: 'sortOrder', + // // }, + // { + // title: '流程引擎状态字段', + // align: 'center', + // dataIndex: 'bpmStatus', + // }, { title: '督办次数', align: 'center', @@ -250,7 +250,7 @@ export const superQuerySchema = { reportFeedbackStatus: { title: '报告反馈情况', order: 13, view: 'text', type: 'string' }, isCompletionRisk: { title: '是否存在完成风险(0不存在,1存在)', order: 14, view: 'number', type: 'number' }, delayRiskMitigation: { title: '拖期风险应对措施', order: 15, view: 'text', type: 'string' }, - completionStatus: { title: '完成状态(0推进中,1已完成)', order: 16, view: 'number', type: 'number' }, + completionStatus: { title: '完成状态(督办中,1已完成)', order: 16, view: 'number', type: 'number' }, implDept: { title: '落实部门id', order: 17, view: 'sel_depart', type: 'string' }, treeDepth: { title: '层深(最顶层节点层深为0)', order: 18, view: 'number', type: 'number' }, sortOrder: { title: '同级数据排序号', order: 19, view: 'number', type: 'number' }, diff --git a/src/views/bg/xispeak/BgXiSpeakList.vue b/src/views/bg/xispeak/BgXiSpeakList.vue index 2660bf0..1676970 100644 --- a/src/views/bg/xispeak/BgXiSpeakList.vue +++ b/src/views/bg/xispeak/BgXiSpeakList.vue @@ -1,8 +1,6 @@ @@ -116,6 +105,7 @@ import SUploadFile from '/@/components/semri/fileComponent/SUploadFile.vue'; import BusinessProcessListModal from '/src/components/semri/process/BusinessProcessListModal.vue'; import FlowScheduleStartModal from '/src/components/semri/process/FlowScheduleStartModal.vue'; + import FeedbackRightNowModal from './components/FeedbackRightNowModal.vue'; import { columns as taskTaskColumns } from '/@/views/taskProcess/TaskTask.data'; import { columns, superQuerySchema, bgXiSpeakFeedbackColumns } from './BgXiSpeak.data'; import { @@ -127,7 +117,9 @@ getChildList, getChildListBatch, updateLaunchType, + saveOrUpdateDict, bgXiSpeakFeedbackList, + withDrawXiSpeak, } from './BgXiSpeak.api'; const FLOW_CODE = 'dev_bg_xi_speak_001'; @@ -143,7 +135,9 @@ const toggleSearchStatus = ref(false); const registerModal = ref(); const flowScheduleModalRef = ref(); + const feedbackRightNowModalRef = ref(); const businessProcessListModalRef = ref(); + const pendingFeedbackRightNow = ref(0); const processColumns = taskTaskColumns; const selectedFeedbackId = ref(null); const feedbackTableData = reactive>({}); @@ -166,6 +160,7 @@ const showSdwLeaderSelect = computed(() => queryParam.value.needSdwApproval === '1'); const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({ + designScope: 'bg-xispeak-template', tableProps: { title: '习总书记重要讲话指示批示情况', api: list, @@ -173,13 +168,7 @@ canResize: false, useSearchForm: false, isTreeTable: true, - indentSize: 24, // 和 Jeecg 原生树形缩进保持一致 - expandIconColumnIndex: 0, clickToRowSelect: true, - treeProps: { - children: 'children', - indent: 24, // 和 indentSize 保持一致,保证缩进对齐 - }, actionColumn: { width: 120, fixed: 'right', @@ -190,7 +179,6 @@ }, afterFetch: (result) => { if (result && result.length > 0) { - // 为有子节点的记录设置 children(用于显示展开图标) result.forEach((item) => { if (item.hasChild == '1' && (!item.children || item.children.length === 0)) { item.children = [{ id: item.id + '_loadChild', name: 'loading...', isLoading: true }]; @@ -274,6 +262,16 @@ await deleteBgXiSpeak({ id: record.id }, success); } + async function handleWithDraw(record) { + const res = await withDrawXiSpeak({ id: record.id }); + if (res.success) { + createMessage.success(res.message || '删除流程成功'); + reload(); + } else { + createMessage.error(res.message || '删除流程失败'); + } + } + /** * 批量删除事件 */ @@ -471,6 +469,15 @@ label: '查询督办流程', onClick: handleQueryProcess.bind(null, record), }, + { + label: '删除关联流程', + popConfirm: { + title: '确定删除该记录关联的所有运行中流程吗?', + confirm: handleWithDraw.bind(null, record), + placement: 'topLeft', + }, + ifShow: !!record.bpmStatus && record.bpmStatus !== '1', + }, { label: selectedFeedbackId.value === record.id ? '收起反馈信息' : '查看反馈', onClick: handleViewFeedback.bind(null, record), @@ -487,14 +494,62 @@ onClick: handleProcessJbr.bind(null, record), }); } + if (record.bpmStatus == '2') { + dropDownAction.push({ + label: '再次发起经办人执行反馈流程', + onClick: handleProcessJbr.bind(null, record), + }); + } return dropDownAction; } + function splitDeptValue(value) { + if (Array.isArray(value)) { + return value.map((item) => String(item || '').trim()).filter(Boolean); + } + return String(value || '') + .split(/[,\uFF0C]/) + .map((item) => item.trim()) + .filter(Boolean); + } + + function getImplDeptOptions(record) { + const deptIds = splitDeptValue(record?.implDept); + const deptNames = splitDeptValue(record?.implDept_dictText); + return deptIds.map((deptId, index) => ({ + value: deptId, + label: deptNames[index] || deptId, + })); + } + + function getLeadDeptOptions(record) { + const deptIds = splitDeptValue(record?.leadDepartment); + const deptNames = splitDeptValue(record?.leadDepartment_dictText); + return deptIds.map((deptId, index) => ({ + value: deptId, + label: deptNames[index] || deptId, + })); + } + + function getNextSuperviseCount(value) { + const count = Number(value || 0); + return Number.isFinite(count) ? count + 1 : 1; + } + function handleProcess(record) { + feedbackRightNowModalRef.value?.open(record); + } + + function handleFeedbackRightNowConfirm({ record, feedbackRightNow }) { + pendingFeedbackRightNow.value = feedbackRightNow; flowScheduleModalRef.value?.open({ title: '发起督办计划收集流程', payload: { record }, + deptOptions: getLeadDeptOptions(record), + showSuoleaderFields: true, + isNeedAppro: record?.needSdwApproval, + supDeptleaderid: record?.sdwLeaderList, }); } @@ -502,6 +557,10 @@ flowScheduleModalRef.value?.open({ title: '发起落实部门经办人执行反馈流程', payload: { record, flowCode: FLOW_CODE_JBR }, + deptOptions: getImplDeptOptions(record), + showSuoleaderFields: true, + isNeedAppro: record?.needSdwApproval, + supDeptleaderid: record?.sdwLeaderList, }); } @@ -520,46 +579,33 @@ return value ? dateUtil(value).format(format) : undefined; }; - // triggerType: 1=立即发起, 2=重复发起; launchType: 0=收集后直接发起, 1=收集后周期性发起 const launchType = options.triggerType === 2 ? 1 : 0; - // 先保存 launchType 到主表 if (flowCode === FLOW_CODE) { await updateLaunchType({ id: record.id, launchType }); } - // 合并选中的DW领导列表到record中 - const recordWithSdwLeader = { + const nextSuperviseCount = getNextSuperviseCount(record.supervisionCount); + + const flowJsonData = { ...record, - sdwLeaderList: queryParam.value.sdwLeaderList || '', - needSdwApproval: queryParam.value.needSdwApproval || '', + isNeedAppro: options.isNeedAppro ?? record.needSdwApproval ?? '', + supDeptleaderid: options.supDeptleaderid ?? record.sdwLeaderList ?? '', + supervisionCount: nextSuperviseCount, + feedback_right_now: flowCode === FLOW_CODE ? pendingFeedbackRightNow.value : undefined, }; - // 如果是经办人执行反馈流程,需要遍历每个部门单独发起 if (flowCode === FLOW_CODE_JBR) { - let approveInfo = {}; - if (record.approveInfo) { - try { - approveInfo = typeof record.approveInfo === 'string' ? JSON.parse(record.approveInfo) : record.approveInfo; - } catch (e) { - createMessage.error('审批信息解析失败'); - return; - } - } - const deptKeys = Object.keys(approveInfo); - if (deptKeys.length === 0) { - createMessage.warning('没有可用的部门审批信息'); + const selectedDeptIds = options.deptIds || []; + if (selectedDeptIds.length === 0) { + createMessage.warning('请选择落实部门'); return; } let successCount = 0; - const total = deptKeys.length; - - for (const deptId of deptKeys) { - const deptApproveDetail = approveInfo[deptId]; - const implUserIdList = deptApproveDetail.implUserIdList || []; - const implUserNameList = deptApproveDetail.implUserNameList || []; + const total = selectedDeptIds.length; + for (const deptId of selectedDeptIds) { const params = { intervalType: options.intervalType, startCount: options.startCount, @@ -570,21 +616,16 @@ formUrl: FORM_URL, flowName: '落实部门经办人执行反馈流程', jsonData: { - ...recordWithSdwLeader, + ...flowJsonData, currentDeptId: deptId, - currentApproverId: deptApproveDetail.approverId, - currentApproverName: deptApproveDetail.approverName, - implUserIdList: implUserIdList.join(','), - implUserNameList: implUserNameList.join(','), }, businessTablename: BUSINESS_TABLE_NAME, businessId: record.id, - deptHandlerName: deptApproveDetail.implUserNameList.join(','), title: record.speakStatus, content: record.implStatus, urgencyLevel: record.completionStatus, deptId: deptId, - deptLeaderId: deptApproveDetail.approverId, + deptLeaderId: deptId, requireFinishDate: formatDate(record.time, 'YYYY-MM-DD'), deadline: formatDate(record.time, 'YYYY-MM-DD HH:mm:ss'), }, @@ -594,6 +635,7 @@ await startProcessSchedules(params); successCount++; if (successCount === total) { + await saveOrUpdateDict({ id: record.id, bpmStatus: '2', supervisionCount: nextSuperviseCount, completionStatus: 0 }, true); createMessage.success(`成功发起 ${total} 个经办人执行反馈流程`); reload(); } @@ -604,7 +646,6 @@ return; } - // 原有的督办计划收集流程逻辑 const params = { intervalType: options.intervalType, startCount: options.startCount, @@ -614,13 +655,13 @@ flowCode: flowCode, formUrl: FORM_URL, flowName: FLOW_NAME, - jsonData: recordWithSdwLeader, + jsonData: flowJsonData, businessTablename: BUSINESS_TABLE_NAME, businessId: record.id, title: record.speakStatus, content: record.implStatus, urgencyLevel: record.completionStatus, - deptId: record.leadDepartment, + deptId: options.deptId || record.leadDepartment, deptLeaderId: record.responsiblePerson, requireFinishDate: formatDate(record.time, 'YYYY-MM-DD'), deadline: formatDate(record.time, 'YYYY-MM-DD HH:mm:ss'), @@ -628,6 +669,7 @@ }; await startProcessSchedules(params); + await saveOrUpdateDict({ id: record.id, bpmStatus: '2', supervisionCount: nextSuperviseCount, completionStatus: 0 }, true); createMessage.success('发起成功'); reload(); } @@ -715,199 +757,6 @@ diff --git a/src/views/bg/xispeak/components/BgXiSpeakBPMFeedbackModal.vue b/src/views/bg/xispeak/components/BgXiSpeakBPMFeedbackModal.vue new file mode 100644 index 0000000..f525702 --- /dev/null +++ b/src/views/bg/xispeak/components/BgXiSpeakBPMFeedbackModal.vue @@ -0,0 +1,305 @@ + + + + + diff --git a/src/views/bg/xispeak/components/BgXiSpeakBPMForm.vue b/src/views/bg/xispeak/components/BgXiSpeakBPMForm.vue index 0b2142c..1c78f20 100644 --- a/src/views/bg/xispeak/components/BgXiSpeakBPMForm.vue +++ b/src/views/bg/xispeak/components/BgXiSpeakBPMForm.vue @@ -1,276 +1,202 @@ diff --git a/src/views/bg/xispeak/components/FeedbackRightNowModal.vue b/src/views/bg/xispeak/components/FeedbackRightNowModal.vue new file mode 100644 index 0000000..8248adb --- /dev/null +++ b/src/views/bg/xispeak/components/FeedbackRightNowModal.vue @@ -0,0 +1,55 @@ + + +