待办兼容多仿真类型

This commit is contained in:
weibl
2026-02-03 17:52:38 +08:00
parent 7050b9abc8
commit f626fcafdd
2 changed files with 60 additions and 54 deletions

View File

@@ -30,7 +30,7 @@ export const getDemandHideKeys = (key: string) => {
];
keys = allKeys.filter((item) => !industrialKeys.includes(item));
} else if (key.indexOf('机器人') !== -1) {
const robotKeys = ['robotBrand', 'axis'];
const robotKeys = ['robotBrand', 'axis', 'robotNum'];
keys = allKeys.filter((item) => !robotKeys.includes(item));
} else if (key.indexOf('公差') !== -1) {
const toleranceKeys = [''];

View File

@@ -38,6 +38,23 @@
@close="closeFun"
show-footer
>
<div class="tabs">
<el-tabs @tab-change="changeSimulationType" v-model="simulationType" type="card">
<el-tab-pane
v-for="item in simulationTypeList"
:label="item.label + '待办'"
:name="item.value"
:key="item.value"
/>
</el-tabs>
</div>
<!-- <div class="message-info">
<div v-if="simulationType === SIMULATION_TYPE.FINITE_ELEMENT" class="message-item">
1有限元仿真登记提醒 若不清楚本待办需求如何填写请看<span class="down-file"
>填写指导书</span
>
</div>
</div> -->
<TableForm
ref="tableFormRef"
tableName="SIMULATION_TASK_DEMAND_CREATE"
@@ -57,9 +74,6 @@
/>
</el-select>
</template>
<!-- <template v-for="name in Object.keys($slots)" :key="name" #[name]="scope">
<slot :name="name" v-bind="scope" />
</template> -->
</TableForm>
<template #footer>
<div>
@@ -92,6 +106,7 @@ import { syncDemandList } from '../taskPage';
import { getChildrenNodeListApi } from '@/api/project/node';
import { listDeptApi } from '@/api/system/departMent';
import { uploadBigFile } from '@/utils/file';
import { getDemandHideKeys } from '@/tenants/lyric/views/task/lyricTask';
// import emitter from '@/utils/eventBus';
// const env = import.meta.env;
@@ -110,6 +125,17 @@ defineProps({
const emits = defineEmits(['visibleDialog', 'loadTableForm', 'changeForm']);
enum SIMULATION_TYPE {
/** 有限元仿真待办 */
FINITE_ELEMENT = 'finiteElement',
/** 机器人仿真待办 */
ROBOT = 'robot',
/** 动画仿真待办 */
DYNAMIC = 'dynamic',
/** 外观设计待办 */
INDUSTRIAL_DESIGN = 'industrialDesign',
}
const demandParams = ref({ type: 0 });
const commonStore = CommonStore();
@@ -173,14 +199,17 @@ const visibleDialog = async (isCreate: boolean, row?: any) => {
nextTick(() => {
tableFormRef.value.resetFun();
});
formHideKeys.value = ['materialNo'];
// formHideKeys.value = ['materialNo'];
}
nextTick(() => {
changeSimulationType(simulationType.value);
});
if (!isCreateDialog.value) {
if (row?.isMoldMaking === 'Y') {
formHideKeys.value = [];
} else {
formHideKeys.value = ['materialNo'];
}
// if (row?.isMoldMaking === 'Y') {
// formHideKeys.value = [];
// } else {
// formHideKeys.value = ['materialNo'];
// }
const res: any = await dataQueryDirApi({ uuid: row.uuid, current: 1, size: 99 });
row.attachments =
res.data?.data?.map((item: { originalName: any; fileSize: any; id: number }) => {
@@ -305,42 +334,6 @@ const confirmFun = async () => {
}
};
// const batchUploadFile = async (files: any[], projectUuid: string, uuid: string) => {
// const sourceFiles = [];
// for (let index = 0; index < files.length; index++) {
// sourceFiles.push({
// fileName: files[index].name,
// size: files[index].size,
// fileType: await fileUploadAllocationTypeFun(files[index].name),
// });
// }
// if (sourceFiles.length > 0) {
// const params = {
// sourceFiles,
// uploadTaskId: new Date().getTime(),
// projectId: projectUuid,
// uuid: uuid,
// type: 0,
// remarks: '',
// };
// batchAddFileInfoApi(params).then((res: any) => {
// if (res.code === 200) {
// res.data.forEach((item: any, index: number) => {
// emitter.emit('ADD_UPLOAD_FILE', {
// file: files[index]?.raw,
// data: {
// ...item,
// isApprove: 0,
// taskType: 5,
// callbackFlag: '/task/sponsor',
// },
// });
// });
// }
// });
// }
// };
const createDemandApiFun = async (fromData: any) => {
const params = {
pid: fromData.nodeId,
@@ -362,6 +355,9 @@ const createDemandApiFun = async (fromData: any) => {
machineId: fromData.machineId,
workspaceId: fromData.workspace,
// 待办所属类型
demandType: simulationType.value,
// 是否走利元亨创建需求直接创建任务逻辑
isLyric: enableConfigByTenant([TENANT_ENUM.LYRIC]),
};
@@ -452,10 +448,20 @@ const deleteFileList = ref<number[]>([]);
const oldAttachments = ref<any[]>([]);
const formHideKeys = ref<any[]>(['materialNo']);
const formHideKeys = ref<any[]>([]);
const currentProjectUndertaker = ref('');
const simulationTypeList = ref(commonStore.getDictData('SIMULATION_TYPE').A);
const simulationType = ref(simulationTypeList.value[0].value);
const changeSimulationType = (val: string) => {
let simTypeList = [];
simTypeList = commonStore.getDictData(val).A;
tableFormRef.value.setOptionsFun('simType', simTypeList);
formHideKeys.value = getDemandHideKeys(val);
};
const changeFun = async (val: any, type: string) => {
const formData = tableFormRef.value.getFormDataFun();
// editFormInfo.value = { ...formData };
@@ -560,13 +566,13 @@ const changeFun = async (val: any, type: string) => {
}
}
if (val.key === 'isMoldMaking') {
if (val.val?.value === 'Y') {
formHideKeys.value = [];
} else {
formHideKeys.value = ['materialNo'];
}
}
// if (val.key === 'isMoldMaking') {
// if (val.val?.value === 'Y') {
// formHideKeys.value = [];
// } else {
// formHideKeys.value = ['materialNo'];
// }
// }
emits('changeForm', { val, type });
};