yxk-20260526-党委会查询督办流程:写一个通用的删除流程方法
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import { defHttp } from "/@/utils/http/axios";
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/bg/xispeak/bgXiSpeak/rootList',
|
||||
save='/bg/xispeak/bgXiSpeak/add',
|
||||
edit='/bg/xispeak/bgXiSpeak/edit',
|
||||
save = '/bg/xispeak/bgXiSpeak/add',
|
||||
edit = '/bg/xispeak/bgXiSpeak/edit',
|
||||
deleteBgXiSpeak = '/bg/xispeak/bgXiSpeak/delete',
|
||||
importExcel = '/bg/xispeak/bgXiSpeak/importExcel',
|
||||
exportXls = '/bg/xispeak/bgXiSpeak/exportXls',
|
||||
@@ -41,11 +41,11 @@ export const getRootListWithDept = (deptIds: string) => defHttp.get({ url: Api.g
|
||||
* @param params
|
||||
* @param handleSuccess
|
||||
*/
|
||||
export const deleteBgXiSpeak = (params,handleSuccess) => {
|
||||
export const deleteBgXiSpeak = (params, handleSuccess) => {
|
||||
return defHttp.delete({ url: Api.deleteBgXiSpeak, params }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
@@ -63,9 +63,9 @@ export const batchDeleteBgXiSpeak = (params, handleSuccess) => {
|
||||
return defHttp.delete({ url: Api.deleteBgXiSpeak, data: params }, { joinParamsToUrl: true }).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 保存或者更新
|
||||
@@ -73,27 +73,27 @@ export const batchDeleteBgXiSpeak = (params, handleSuccess) => {
|
||||
* @param isUpdate
|
||||
*/
|
||||
export const saveOrUpdateDict = (params, isUpdate) => {
|
||||
let url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({ url: url, params },{ isTransformResponse:false });
|
||||
}
|
||||
const url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询全部树形节点数据
|
||||
* @param params
|
||||
*/
|
||||
export const loadTreeData = (params) => defHttp.get({ url: Api.loadTreeData,params });
|
||||
export const loadTreeData = (params) => defHttp.get({ url: Api.loadTreeData, params });
|
||||
|
||||
/**
|
||||
* 查询子节点数据
|
||||
* @param params
|
||||
*/
|
||||
export const getChildList = (params) => defHttp.get({ url: Api.getChildList, params });
|
||||
|
||||
|
||||
/**
|
||||
* 批量查询子节点数据
|
||||
* @param params
|
||||
*/
|
||||
export const getChildListBatch = (params) => defHttp.get({ url: Api.getChildListBatch, params },{ isTransformResponse:false });
|
||||
export const getChildListBatch = (params) => defHttp.get({ url: Api.getChildListBatch, params }, { isTransformResponse: false });
|
||||
|
||||
// ====================== 子表反馈相关API ======================
|
||||
|
||||
@@ -153,7 +153,7 @@ export const bgXiSpeakFeedbackDeleteBatch = (params, handleSuccess) => {
|
||||
* @param isUpdate
|
||||
*/
|
||||
export const bgXiSpeakFeedbackSaveOrUpdate = (params, isUpdate) => {
|
||||
let url = isUpdate ? '/bg/xispeak/bgXiSpeak/editBgXiSpeakFeedback' : '/bg/xispeak/bgXiSpeak/addBgXiSpeakFeedback';
|
||||
const url = isUpdate ? '/bg/xispeak/bgXiSpeak/editBgXiSpeakFeedback' : '/bg/xispeak/bgXiSpeak/addBgXiSpeakFeedback';
|
||||
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
||||
};
|
||||
|
||||
@@ -185,10 +185,6 @@ export const withDrawXiSpeak = (params) => {
|
||||
return defHttp.post({ url: '/bg/xispeak/bgXiSpeak/withDrawXiSpeak', params }, { joinParamsToUrl: true, isTransformResponse: false });
|
||||
};
|
||||
|
||||
export const deleteSingleProcess = (params) => {
|
||||
return defHttp.post({ url: '/tasktask/taskTask/deleteSingleProcess', params }, { joinParamsToUrl: true, isTransformResponse: false });
|
||||
};
|
||||
|
||||
/**
|
||||
* 批量查询反馈统计数量(每个 xispeak 下的 feedback 总条数和已闭环数)
|
||||
* @param params { ids: "id1,id2,id3" }
|
||||
|
||||
@@ -83,7 +83,6 @@
|
||||
updateLaunchType,
|
||||
saveOrUpdateDict,
|
||||
withDrawXiSpeak,
|
||||
deleteSingleProcess,
|
||||
getRootListWithDept,
|
||||
bgXiSpeakFeedbackList,
|
||||
} from './BgXiSpeak.api';
|
||||
@@ -137,8 +136,11 @@
|
||||
},
|
||||
});
|
||||
|
||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource, setTableData }, { rowSelection, selectedRowKeys }] =
|
||||
tableContext;
|
||||
const [
|
||||
registerTable,
|
||||
{ reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource, setTableData },
|
||||
{ rowSelection, selectedRowKeys },
|
||||
] = tableContext;
|
||||
const mainId = computed(() => (unref(selectedRowKeys).length > 0 ? unref(selectedRowKeys)[0] : ''));
|
||||
provide('mainId', mainId);
|
||||
|
||||
@@ -593,20 +595,9 @@
|
||||
title: '流程列表',
|
||||
businessId: record.id,
|
||||
columns: '',
|
||||
onDeleteProcess: handleDeleteProcess,
|
||||
});
|
||||
}
|
||||
|
||||
async function handleDeleteProcess(processRecord, reload) {
|
||||
const res = await deleteSingleProcess({ processInstId: processRecord.processInstId });
|
||||
if (res.success) {
|
||||
createMessage.success(res.message || '删除流程成功');
|
||||
await reload();
|
||||
} else {
|
||||
createMessage.error(res.message || '删除流程失败');
|
||||
}
|
||||
}
|
||||
|
||||
async function handleFlowScheduleConfirm({ payload, options }) {
|
||||
const record = payload?.record || {};
|
||||
const flowCode = payload?.flowCode || FLOW_CODE;
|
||||
|
||||
Reference in New Issue
Block a user