This commit is contained in:
2026-03-02 16:52:12 +08:00
7 changed files with 194 additions and 23 deletions

View File

@@ -0,0 +1,123 @@
<template>
<Dialog v-model="visible" diaTitle="选择更新审核流程" :width="400" @close="closeFun">
<div class="content">
<div class="form">
<TableForm
ref="TableFormRef"
v-model:data="formData"
tableName="APPROVE_DEL_FORM"
:formAttrs="{
templateId: {
moduleCode,
},
}"
@change="changeFun"
/>
</div>
</div>
<template #footer>
<div>
<el-button @click="closeFun">{{ $t('通用.取消') }}</el-button>
<el-button type="primary" @click="submitFun">{{ $t('通用.确定') }}</el-button>
</div>
</template>
</Dialog>
</template>
<script setup lang="ts">
import { ref, watch } from 'vue';
// import { Warning } from '@element-plus/icons-vue';
import Dialog from '@/components/common/dialog/index.vue';
import TableForm from '@/components/common/table/tableForm.vue';
import { ElMessage } from 'element-plus';
interface Props {
modelValue: boolean;
api: any;
params?: any;
moduleCode?: string;
}
const props = withDefaults(defineProps<Props>(), {
modelValue: false,
api: null,
params: {},
moduleCode: '', // 审批流程模块code
});
watch(
() => props.modelValue,
(val: boolean) => {
visible.value = val;
if (!val) {
if (TableFormRef.value) {
TableFormRef.value.resetFun();
}
}
}
);
const emit = defineEmits(['update:modelValue', 'confirm']);
const TableFormRef = ref<any>();
const formData = ref<any>({});
const visible = ref(false);
const changeFun = (data: any) => {
const { key, val } = data;
if (key === 'templateId') {
formData.value.templateId = val.value;
formData.value.templateName = val.label;
}
};
const submitFun = async () => {
const valid = await TableFormRef.value.validateFun();
if (valid) {
if (props.api) {
const params = {
...props.params,
...formData.value,
};
props
.api(params)
.then((res: any) => {
if (res.code === 200) {
ElMessage.success('操作成功');
closeFun();
emit('confirm');
} else {
closeFun();
}
})
.catch(() => {
// 失败时也关闭弹窗
closeFun();
});
}
}
};
const closeFun = () => {
emit('update:modelValue', false);
};
</script>
<style lang="scss" scoped>
.content {
.tip {
display: flex;
align-items: center;
padding-bottom: 10px;
font-size: 12px;
line-height: 14px;
color: var(--el-text-color-secondary);
.icon {
color: var(--el-color-danger);
cursor: pointer;
}
span {
padding-left: 4px;
}
}
}
</style>

View File

@@ -84,13 +84,21 @@ const submitFun = async () => {
...props.params,
...formData.value,
};
props.api(params).then((res: any) => {
if (res.code === 200) {
ElMessage.success('操作成功');
props
.api(params)
.then((res: any) => {
if (res.code === 200) {
ElMessage.success('操作成功');
closeFun();
emit('confirm');
} else {
closeFun();
}
})
.catch(() => {
// 失败时也关闭弹窗
closeFun();
emit('confirm');
}
});
});
}
}
};

View File

@@ -63,7 +63,7 @@ onMounted(() => {
getlistDataFun();
});
const meg = inject('projectProvide');
const meg = inject('projectProvide', null);
const getlistDataFun = () => {
if (meg) return;
const params = {

View File

@@ -99,10 +99,12 @@ const { t } = useI18n();
interface Props {
projectUuid: string;
currentPhaseName?: string;
}
const props = withDefaults(defineProps<Props>(), {
projectUuid: '',
currentPhaseName: '',
});
const baseTableRef = ref();
@@ -125,8 +127,22 @@ const getPhaseListFun = async () => {
label: item.nodeName,
value: item.uuid,
}));
if (phaseListOptions.value.length && !phaseUuid.value) {
phaseUuid.value = phaseListOptions.value[0].value;
if (phaseListOptions.value.length) {
// 没选中阶段 或者 选中了阶段但是不在阶段列表中
if (
!phaseListOptions.value.some((item) => {
return phaseUuid.value === item.value;
})
) {
const phase = phaseListOptions.value.find(
(item) => item.label === props.currentPhaseName
)?.value;
if (phase && phaseUuid.value !== phase) {
phaseUuid.value = phase;
} else {
phaseUuid.value = phaseListOptions.value[0].value;
}
}
}
} else {
phaseListOptions.value = [];

View File

@@ -20,7 +20,7 @@
<el-icon class="icon-style" v-if="data.type != 3" :size="18"><Folder /></el-icon>
<el-icon class="icon-style" v-else :size="18"><Document /></el-icon>
<div class="name" :title="data.name">{{ data.name }}</div>
<!-- 审批中的节点 不允许修改删除 0-审核完成1-文件上传审核中3-文件删除审核中-->
<!-- 审批中的节点 不允许修改删除 0-审核完成1-文件上传审核中2-文件修改审核中 3-文件删除审核中-->
<div v-if="!pageType">
<div class="options" v-if="!data.approveType">
<div class="edit" @click.stop="openEditFun(data)">
@@ -177,6 +177,12 @@
:params="delParams"
@confirm="deleteConfirmFun"
/>
<ApproveUpdate
v-model="approveUpdateShow"
:api="updateSimulationParameterValuesApi"
:params="updateParams"
@confirm="updateConfirmFun"
/>
<Edit v-model="editShow" :data="editData" @confirm="resetTreeFun" />
<ParamDetail
v-model="paramDetailShow"
@@ -206,6 +212,7 @@ import addParamType from './components/addParamType.vue';
import addParamObject from './components/addParamObject.vue';
import { ElMessage, ElMessageBox } from 'element-plus';
import ApproveDel from '@/components/common/approveDel/index.vue';
import ApproveUpdate from '@/components/common/approveDel/approveUpdate.vue';
import Edit from './components/edit.vue';
import DragSplit from '@/components/common/dragSplit/index.vue';
import ParamDetail from './components/addParam.vue';
@@ -275,7 +282,6 @@ const actionList = ref([
]);
const loadMoreFun = async (node: any, resolve: any) => {
// console.log('node', node);
if (node.level === 0) {
const data = props.pageType ? props.pageParams : node.data;
const listData: any = await getSimulationParameterTreeDAtaFun(data);
@@ -439,6 +445,7 @@ const deleteConfirmFun = () => {
};
const deleteParamFun = async (flag: any, row?: any) => {
currentNode.value = { ...row };
// 如果删除的是参数,要走审批流程
if (flag === 'param') {
delParams.value = {
@@ -460,7 +467,6 @@ const deleteParamFun = async (flag: any, row?: any) => {
delParams.value = {
type: row.type,
id: row.id,
isApprove: false,
};
approveDelShow.value = true;
} else {
@@ -475,8 +481,9 @@ const deleteParamFun = async (flag: any, row?: any) => {
}
).then(async () => {
const res: any = await deleteSimulationParameterApi({
type: currentNode.value.type,
id: currentNode.value.id,
type: row.type,
id: row.id,
isApprove: false,
});
if (res && res.code === 200) {
ElMessage.success('删除成功!');
@@ -489,18 +496,23 @@ const deleteParamFun = async (flag: any, row?: any) => {
}
};
const updateParams = ref<any>({});
const approveUpdateShow = ref(false);
const updateParamFun = () => {
// dzh todo 增加审批
const params = {
// 增加审批
updateParams.value = {
fileId: currentNode.value.fileId,
parameterList: newParamTableData.value,
};
updateSimulationParameterValuesApi(params).then((res: any) => {
if (res.code === 200) {
ElMessage.success('操作成功');
currentChangeFun(currentNode.value);
}
});
approveUpdateShow.value = true;
};
const updateConfirmFun = () => {
currentChangeFun(currentNode.value);
const node = libTreeRef.value.getNode(currentNode.value.nodeKey);
// 参数对象节点 更新审批状态为删除中
if (node && node?.data?.type === 3) {
node.data.approveType = 2;
}
};
const openParamFun = () => {

View File

@@ -131,6 +131,7 @@
<WorkspaceTime
v-if="displayedTabs.includes('workspaceTime') && projectUuid"
:projectUuid="projectUuid"
:currentPhaseName="currentProjectInfo.currentPhase"
/>
</el-tab-pane>
<el-tab-pane label="文件数据" name="projectData">

View File

@@ -314,7 +314,7 @@ import { getFormConfigureApi } from '@/api/system/systemData';
import { NODE_TYPE, getTagKeyMap, tagSortList } from '@/utils/enum/node';
import nodeLevel2Select from '@/components/project/nodeLevel2Select.vue';
import { getTaskTreeFun } from '../../projectDetail/components/projectApi';
import { disposeTagKey } from '../../projectDetail/components/project';
import { disposeTagKey, getIdMap } from '../../projectDetail/components/project';
import { disposeTaskMembers, getTagMapList } from '@/utils/task';
import { modifyNodeTaskPerformanceApi, modifyWithApproveAPi } from '@/api/project/node';
import { TASK_CALCULATE_STATUS, TASK_PROCESS_STATUS } from '@/utils/enum/task';
@@ -328,6 +328,7 @@ import TableForm from '@/components/common/table/tableForm.vue';
import { CommonStore } from '@/stores/common';
import AddApprove from '@/views/competenceCenter/condition/components/addApprove.vue';
import { queryDesignVersionsApi } from '@/api/project/project';
import { getSeeDisciplines } from '@/tenants/lyric/views/task/lyricTask';
const commonStore = CommonStore();
@@ -872,6 +873,15 @@ const onAddApproveConfirmFun = async (formData: any) => {
phaseName: currentPhaseInfo?.nodeName || '',
};
const getTaskTreeReq = {
projectNodeId: props.nodeLevel1Uuid,
phaseNodeId: nodeLevel2Uuid.value,
idMap: getIdMap(props.nodeLevel1Uuid, nodeLevel2Uuid.value),
tagMap: getTagMapList(),
filterDiscipline: getSeeDisciplines(),
queryTaskFlag: 0,
};
const param = {
addNodeList: approveParam.value.insertTreeList,
editNodeList: approveParam.value.updateList,
@@ -882,6 +892,7 @@ const onAddApproveConfirmFun = async (formData: any) => {
phaseNodeId: nodeLevel2Uuid.value,
approvePreviewInfo,
...formData,
getTaskTreeReq,
};
try {