This commit is contained in:
2026-03-03 14:10:58 +08:00
2 changed files with 65 additions and 4 deletions

View File

@@ -6,17 +6,20 @@
@changeForm="changeFun"
:hideKeys="hideKeys"
:deptOptions="deptOptions"
:finiteElementPurposeOptions="finiteElementPurposeOptions"
>
</demandVue>
</template>
<script lang="ts" setup>
import { onMounted, ref } from 'vue';
import demandVue from '@/views/task/simulationTask/newDemand/index.vue';
import { CommonStore } from '@/stores/common';
// import { CommonStore } from '@/stores/common';
import { listDeptApi } from '@/api/system/departMent';
import { useDict } from '@/utils/useDict';
const commonStore = CommonStore();
const demandRef = ref();
const { FINITE_ELEMENT_SIMULATION_PURPOSE_ALL, FINITE_ELEMENT_SIMULATION_PURPOSE_URGENCY } =
useDict('FINITE_ELEMENT_SIMULATION_PURPOSE_ALL', 'FINITE_ELEMENT_SIMULATION_PURPOSE_URGENCY');
const visibleDialog = ({ isCreate, row }: any) => {
// if (!isCreate) {
@@ -26,10 +29,22 @@ const visibleDialog = ({ isCreate, row }: any) => {
// }
// }
// }
if (isCreate) {
hideKeys.value.push('materialNo');
} else {
if (row.isMoldMaking === 'Y') {
hideKeys.value = hideKeys.value.filter((item) => {
return item !== 'materialNo';
});
} else {
hideKeys.value.push('materialNo');
}
}
};
const loadTableForm = () => {};
const hideKeys = ref(['downAttachments']);
const finiteElementPurposeOptions = ref<any[]>(FINITE_ELEMENT_SIMULATION_PURPOSE_ALL.value.A);
/**
* DEMAND_TYPE1 机器人仿真
@@ -37,9 +52,39 @@ const hideKeys = ref(['downAttachments']);
* DEMAND_TYPE3 动画
* DEMAND_TYPE4 物流仿真
* @param val
* @param type
*/
const changeFun = async (val: any) => {
console.log('val', val);
// if (val.type === 'form') {
if (val.val.key === 'endTime') {
// 超过2天就走所有下拉
if (new Date(val.val.val).getTime() - new Date().getTime() > 2 * 24 * 60 * 60 * 1000) {
finiteElementPurposeOptions.value = FINITE_ELEMENT_SIMULATION_PURPOSE_ALL.value.A;
// hideKeys.value = ['urgencyDesc'];
hideKeys.value.push('urgencyDesc');
} else {
finiteElementPurposeOptions.value = FINITE_ELEMENT_SIMULATION_PURPOSE_URGENCY.value.A;
// hideKeys.value = [];
hideKeys.value = hideKeys.value.filter((item) => {
return item !== 'urgencyDesc';
});
}
if (finiteElementPurposeOptions.value.length) {
demandRef.value.editFormInfo.simulationPurpose = finiteElementPurposeOptions.value[0].value;
} else {
demandRef.value.editFormInfo.simulationPurpose = '';
}
}
if (val.val.key === 'isMoldMaking') {
if (val.val.val.value === 'Y') {
hideKeys.value = hideKeys.value.filter((item) => {
return item !== 'materialNo';
});
} else {
hideKeys.value.push('materialNo');
}
}
// }
// if (val.type === 'form') {
// if (val.val.key === 'demandType') {
// const formData = demandRef.value.tableFormRef.getFormDataFun();
@@ -83,6 +128,7 @@ const getListDept = async () => {
});
}
};
onMounted(() => {
getListDept();
});

View File

@@ -85,6 +85,17 @@
/>
</el-select>
</template>
<!-- ep 的仿真用途 -->
<template #form-simulationPurpose>
<el-select v-model="editFormInfo.simulationPurpose" filterable placeholder="请选择">
<el-option
v-for="item in finiteElementPurposeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</TableForm>
<template #footer>
<div>
@@ -138,6 +149,10 @@ defineProps({
type: Array<any>,
default: () => [],
},
finiteElementPurposeOptions: {
type: Array<any>,
default: () => [],
},
});
const emits = defineEmits(['visibleDialog', 'loadTableForm', 'changeForm']);
@@ -619,7 +634,7 @@ const changeFun = async (val: any, type: string) => {
// formHideKeys.value = ['materialNo'];
// }
// }
emits('changeForm', { val, type });
emits('changeForm', { val, editFormInfo: editFormInfo.value });
};
const deptList = ref<any[]>([]);