+
+
+
diff --git a/src/views/task/projectList/components/taskDialog.vue b/src/views/task/projectList/components/taskDialog.vue
index acb3e8b..28b39f4 100644
--- a/src/views/task/projectList/components/taskDialog.vue
+++ b/src/views/task/projectList/components/taskDialog.vue
@@ -343,6 +343,7 @@ const props = defineProps<{
}>();
const dialogApproveUserVisible = ref(false);
const isEmptyPool = ref(true);
+let originalSnapshot: any = null;
const dialogVisible = computed(() => {
return props.showTaskDialog;
@@ -427,8 +428,14 @@ const getNodeLevel3TreeByLevel2Uuid = async () => {
rightTableLoading.value = true;
rightTableData.value = await getTaskTreeFun(props.nodeLevel1Uuid, nodeLevel2Uuid.value);
rightTableLoading.value = false;
+ nextTick(() => {
+ originalSnapshot = cloneDeep(rightTableData.value);
+ });
+ isEmptyPool.value = !rightTableData.value || rightTableData.value.length === 0;
} else {
rightTableData.value = [];
+ originalSnapshot = null;
+ isEmptyPool.value = true;
}
nextTick(() => {
// 待修改
@@ -812,6 +819,7 @@ const addOrEditTaskFun = async () => {
// } else {
approveParam.value = {
insertTreeList,
+ insertRecords: insertList,
removeRecords,
updateList,
};
@@ -853,6 +861,25 @@ const onAddApproveConfirmFun = async (formData: any) => {
return;
}
+ const { fullData } = getRightVxeRef()?.getTableData() || { fullData: [] };
+ const columns = getRightVxeRef()?.getColumns() || [];
+
+ const currentPhaseInfo = nodeLevel2SelectRef.value?.getNodeInfo();
+
+ const approvePreviewInfo = {
+ isCreate: isEmptyPool.value,
+ isUpdate: !isEmptyPool.value,
+ columns,
+ originalFullData: cloneDeep(originalSnapshot),
+ finalFullData: cloneDeep(fullData),
+ insertRecords: approveParam.value.insertRecords,
+ updateRecords: approveParam.value.updateList,
+ removeRecords: approveParam.value.removeRecords,
+ projectName: props.nodeLevel1Name,
+ projectCode: props.nodeLevel1Info?.nodeCode,
+ phaseName: currentPhaseInfo?.nodeName || '',
+ };
+
const param = {
addNodeList: approveParam.value.insertTreeList,
editNodeList: approveParam.value.updateList,
@@ -861,6 +888,7 @@ const onAddApproveConfirmFun = async (formData: any) => {
tagMap: getTagMapList(),
projectNodeId: props.nodeLevel1Uuid,
phaseNodeId: nodeLevel2Uuid.value,
+ approvePreviewInfo,
...formData,
};
@@ -1277,12 +1305,7 @@ const queryDesignVersionsFun = async () => {
if (res.data?.length) {
projectPhaseVersionList.value = [res.data.at(-1)];
-
currentProjectPhaseTaskTreeVersion.value = projectPhaseVersionList.value[0]?.currentVersion;
-
- isEmptyPool.value = false;
- } else {
- isEmptyPool.value = true;
}
}
} catch {}