update:新增代办改版

This commit is contained in:
2026-04-02 08:55:23 +08:00
parent b4c81f9325
commit 9958b6f412
8 changed files with 938 additions and 0 deletions

View File

@@ -0,0 +1,116 @@
<template>
<div class="comp-animation">
<div class="content">
<div class="tips">
<PlanningInformation data="动画仿真" />
</div>
<div class="form">
<TableForm
ref="TableFormRef"
tableName="SIMULATION_TASK_DEMAND_CREATE"
v-model:data="editFormInfo"
:formAttrs="{
projectId: {
auth: false,
},
endTime: {
remarkText: endTimeRemark,
},
attachments: {
remarkText: attachmentRemark,
},
}"
:hideKeys="hideKeys"
:colNum="3"
@change="changeFun"
>
<template #form-pMemberList v-if="enableConfigByTenant([TENANT_ENUM.LYRIC])">
<el-select v-model="editFormInfo.pMemberList" filterable placeholder="请选择">
<el-option
v-for="item in deptOptions"
:key="item.value + item.label"
:label="item.label + '(' + item.userName + ')'"
:value="item.value + '-' + item.label"
/>
</el-select>
</template>
</TableForm>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import PlanningInformation from '@/tenants/lyric/views/task/components/planningInformation.vue';
import TableForm from '@/components/common/table/tableForm.vue';
import { enableConfigByTenant, TENANT_ENUM } from '@/tenants/tenant';
import {
getDeptListData,
setPhaseListByProjectId,
setWorkspaceListByPhaseId,
getSimTypeList,
} from './lib';
const emits = defineEmits(['submit']);
const TableFormRef = ref();
const hideKeys = ref([
'downAttachments',
'simulationPurpose',
'fluidPurpose',
'useType',
'styleRequirements',
'viewRequirements',
'referenceData',
'deviceMessage',
'materialAndCraftsmanship',
'colorRequirements',
'isMoldMaking',
'materialNo',
'designExp',
]);
const endTimeRemark = ref('【需求时间】请参考发图时间或客户评审时间');
const attachmentRemark = ref(
'【动画仿真待办需上传以下3类附件参考资料、3D、动画制作交接资料点检表】'
);
const editFormInfo = ref<any>({});
const deptOptions = ref<any>([]);
onMounted(async () => {
deptOptions.value = await getDeptListData();
TableFormRef.value.setOptionsFun('simType', getSimTypeList('机器人仿真'));
});
const changeFun = async (cbData: any) => {
const { key, data } = cbData;
if (key === 'projectId') {
await setPhaseListByProjectId({
nodeId: data.projectId,
formData: editFormInfo.value,
ref: TableFormRef.value,
cbData,
});
if (editFormInfo.value.phaseId) {
await setWorkspaceListByPhaseId({
nodeId: editFormInfo.value.phaseId,
formData: editFormInfo.value,
ref: TableFormRef.value,
cbData,
});
}
}
};
const submitFun = async () => {
if (await TableFormRef.value.validateFun()) {
emits('submit', editFormInfo.value);
}
};
defineExpose({
submitFun,
});
</script>
<style lang="scss" scoped></style>

View File

@@ -0,0 +1,125 @@
<template>
<div class="comp-finite-element">
<div class="content">
<div class="tips">
<PlanningInformation data="有限元仿真" />
</div>
<div class="form">
<TableForm
ref="TableFormRef"
tableName="SIMULATION_TASK_DEMAND_CREATE"
v-model:data="editFormInfo"
:formAttrs="{
projectId: {
auth: false,
},
endTime: {
remarkText: endTimeRemark,
},
attachments: {
remarkText: attachmentRemark,
},
simType: {
tipText: simTypeTipText,
},
}"
:hideKeys="hideKeys"
:colNum="3"
@change="changeFun"
>
<template #form-pMemberList v-if="enableConfigByTenant([TENANT_ENUM.LYRIC])">
<el-select v-model="editFormInfo.pMemberList" filterable placeholder="请选择">
<el-option
v-for="item in deptOptions"
:key="item.value + item.label"
:label="item.label + '(' + item.userName + ')'"
:value="item.value + '-' + item.label"
/>
</el-select>
</template>
</TableForm>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import PlanningInformation from '@/tenants/lyric/views/task/components/planningInformation.vue';
import TableForm from '@/components/common/table/tableForm.vue';
import { enableConfigByTenant, TENANT_ENUM } from '@/tenants/tenant';
import {
getDeptListData,
setPhaseListByProjectId,
setWorkspaceListByPhaseId,
getSimTypeList,
} from './lib';
const emits = defineEmits(['submit']);
const TableFormRef = ref();
const hideKeys = ref([
'downAttachments',
'animationPurpose',
'fluidPurpose',
'robotBrand',
'axis',
'beatDemand',
'useType',
'styleRequirements',
'viewRequirements',
'referenceData',
'deviceMessage',
'materialAndCraftsmanship',
'robotNum',
'robotNum6',
'colorRequirements',
]);
const endTimeRemark = ref('【需求时间】请参考发图时间或客户评审时间');
const attachmentRemark = ref('需要上传工位截图');
const simTypeTipText = ref(`
流体仿真:(结构风速、除尘、氮气保护等分析)
结构仿真:(结构受力、变形、校核、应力、支反力、扭矩等分析)
热力学仿真:(结构加热、散热、热变形分析)
其他类型:(激光焊接、冲坑等其他类型和工艺仿真分析)
`);
const editFormInfo = ref<any>({});
const deptOptions = ref<any>([]);
onMounted(async () => {
deptOptions.value = await getDeptListData();
TableFormRef.value.setOptionsFun('simType', getSimTypeList('机器人仿真'));
});
const changeFun = async (cbData: any) => {
const { key, data } = cbData;
if (key === 'projectId') {
await setPhaseListByProjectId({
nodeId: data.projectId,
formData: editFormInfo.value,
ref: TableFormRef.value,
cbData,
});
if (editFormInfo.value.phaseId) {
await setWorkspaceListByPhaseId({
nodeId: editFormInfo.value.phaseId,
formData: editFormInfo.value,
ref: TableFormRef.value,
cbData,
});
}
}
};
const submitFun = async () => {
if (await TableFormRef.value.validateFun()) {
emits('submit', editFormInfo.value);
}
};
defineExpose({
submitFun,
});
</script>
<style lang="scss" scoped></style>

View File

@@ -0,0 +1,199 @@
<template>
<div class="gl-page-content-full">
<div class="card-list">
<div class="card-item">
<div class="content" @click="openFun('robot')">
<div class="pic">
<el-image class="img" fit="cover" :src="greenBg" />
</div>
<div class="title">机器人仿真待办</div>
</div>
</div>
<div class="card-item">
<div class="content" @click="openFun('animation')">
<div class="pic">
<el-image class="img" fit="cover" :src="blueBg" />
</div>
<div class="title">动画仿真待办</div>
</div>
</div>
<div class="card-item">
<div class="content" @click="openFun('industry')">
<div class="pic">
<el-image class="img" fit="cover" :src="blueBg" />
</div>
<div class="title">工业设计待办</div>
</div>
</div>
<div class="card-item">
<div class="content" @click="openFun('tolerance')">
<div class="pic">
<el-image class="img" fit="cover" :src="blueBg" />
</div>
<div class="title">公差分析待办</div>
</div>
</div>
<div class="card-item">
<div class="content" @click="openFun('finiteElement')">
<div class="pic">
<el-image class="img" fit="cover" :src="greenBg" />
</div>
<div class="title">有限元仿真待办</div>
</div>
</div>
<div class="card-item">
<div class="content" @click="openFun('logistics')">
<div class="pic">
<el-image class="img" fit="cover" :src="greenBg" />
</div>
<div class="title">物流仿真待办</div>
</div>
</div>
</div>
</div>
<Dialog
v-model="diaVisible"
:diaTitle="`${diaTitle}待办`"
width="80%"
height="90%"
@close="closeFun"
>
<div>
<Animation v-if="currentName === 'animation'" ref="CurrentRef" @submit="submitFun" />
<FiniteElement v-if="currentName === 'finiteElement'" ref="CurrentRef" @submit="submitFun" />
<Industry v-if="currentName === 'industry'" ref="CurrentRef" @submit="submitFun" />
<Logistics v-if="currentName === 'logistics'" ref="CurrentRef" @submit="submitFun" />
<Robot v-if="currentName === 'robot'" ref="CurrentRef" @submit="submitFun" />
<Tolerance v-if="currentName === 'tolerance'" ref="CurrentRef" @submit="submitFun" />
</div>
<template #footer>
<div>
<el-button @click="closeFun">{{ $t('通用.取消') }}</el-button>
<el-button type="primary" @click="sureFun">{{ $t('通用.确定') }}</el-button>
</div>
</template>
</Dialog>
</template>
<script setup lang="ts">
import { nextTick, ref } from 'vue';
import Dialog from '@/components/common/dialog/index.vue';
import Animation from './animation.vue';
import FiniteElement from './finiteElement.vue';
import Industry from './industry.vue';
import Logistics from './logistics.vue';
import Robot from './robot.vue';
import Tolerance from './tolerance.vue';
import blueBg from '@/assets/imgs/projectList/project-blue.png';
import greenBg from '@/assets/imgs/projectList/project-green.png';
import { addDemandNoPermissionApi } from '@/api/project/demand';
import { ElMessage } from 'element-plus';
import { enableConfigByTenant, TENANT_ENUM } from '@/tenants/tenant';
const diaVisible = ref(false);
const currentName = ref('');
const diaTitle = ref('');
const CurrentRef = ref();
const titleMap: any = {
animation: '动画仿真',
finiteElement: '有限元仿真',
industry: '工业设计',
logistics: '物流仿真',
robot: '机器人仿真',
tolerance: '公差分析',
};
const openFun = (name: string) => {
currentName.value = name;
diaTitle.value = titleMap[name];
diaVisible.value = true;
nextTick(() => {
CurrentRef.value = ref();
});
};
const sureFun = () => {
CurrentRef.value.submitFun();
};
const submitFun = (data: any) => {
const params = {
pid: data.nodeId,
eMemberList: '',
...data,
pMemberList: getPMemberId(data),
demandStatus: '0',
machineId: data.machineId,
workspaceId: data.workspaceId,
// 待办所属类型
demandType: diaTitle.value,
// 是否走利元亨创建待办直接创建任务逻辑
isLyric: enableConfigByTenant([TENANT_ENUM.LYRIC]),
};
addDemandNoPermissionApi(params).then((res: any) => {
if (res.code === 200) {
ElMessage.success('创建成功');
closeFun();
}
});
};
const getPMemberId = (data: any) => {
const pMemberIdArr = data.pMemberList.split('-');
let pMemberId = '';
if (pMemberIdArr.length > 0) {
pMemberId = pMemberIdArr[0];
}
return pMemberId;
};
const closeFun = () => {
diaVisible.value = false;
};
</script>
<style lang="scss" scoped>
.card-list {
width: 100%;
height: 100%;
display: flex;
flex-wrap: wrap;
.card-item {
width: 25%;
height: 50%;
padding: 10px;
.content {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
border: solid 1px var(--el-border-color);
border-radius: 8px;
overflow: hidden;
cursor: pointer;
&:hover {
box-shadow: 0 0 20px var(--el-border-color);
}
.pic {
height: calc(100% - 40px);
flex: 1;
border-bottom: solid 1px var(--el-border-color);
.img {
width: 100%;
height: 100%;
}
}
.title {
display: flex;
align-items: center;
padding: 0 15px;
height: 40px;
font-size: 16px;
color: var(--el-text-color-primary);
font-weight: bold;
}
}
}
}
</style>

View File

@@ -0,0 +1,65 @@
<template>
<div class="comp-industry">
<div class="content">
<div class="tips">
<PlanningInformation data="工业设计" />
</div>
<div class="form">
<TableForm
ref="TableFormRef"
tableName="SIMULATION_TASK_DEMAND_INDUSTRIAL_CREATE"
v-model:data="editFormInfo"
:formAttrs="{
endTime: {
remarkText: endTimeRemark,
},
attachments: {
remarkText: attachmentRemark,
},
}"
:hideKeys="hideKeys"
:colNum="3"
/>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import PlanningInformation from '@/tenants/lyric/views/task/components/planningInformation.vue';
import TableForm from '@/components/common/table/tableForm.vue';
const emits = defineEmits(['submit']);
const TableFormRef = ref();
const hideKeys = ref([
'downAttachments',
'simulationPurpose',
'animationPurpose',
'fluidPurpose',
'robotBrand',
'axis',
'beatDemand',
'robotNum',
'robotNum6',
'isMoldMaking',
'materialNo',
'designExp',
]);
const endTimeRemark = ref('【需求时间】请参考发图时间或客户评审时间');
const attachmentRemark = ref('必须上传附件!');
const editFormInfo = ref<any>({});
const submitFun = async () => {
if (await TableFormRef.value.validateFun()) {
emits('submit', editFormInfo.value);
}
};
defineExpose({
submitFun,
});
</script>
<style lang="scss" scoped></style>

View File

@@ -0,0 +1,76 @@
import { listDeptApi } from '@/api/system/departMent';
import { getChildrenNodeListApi } from '@/api/project/node';
import { CommonStore } from '@/stores/common';
// 获取确认人列表
export const getDeptListData = async () => {
const params = {
current: 1,
size: 9999,
};
const res: any = await listDeptApi(params);
let data: any = [];
if (res.code === 200) {
data = res.data?.data?.map((item: any) => {
return {
label: item.deptName,
value: String(item.userId),
userName: item.userResp.nickname,
};
});
}
return data;
};
// 获取阶段列表
export const getNodeListData = async (nodeId: any, nodeType: any) => {
const params = {
current: 1,
size: 9999,
nodeType,
nodeId,
};
const res: any = await getChildrenNodeListApi(params);
let data: any = [];
if (res.code === 200) {
data = res.data?.map((item: any) => {
return {
label: item.nodeName,
value: item.uuid,
};
});
}
return data;
};
// 根据项目设置阶段
export const setPhaseListByProjectId = async (data: any) => {
const { nodeId, formData, ref, cbData } = data;
const options = await getNodeListData(nodeId, 'phase');
ref.setOptionsFun('phaseName', options);
ref.setOptionsFun('phaseId', options);
const current = options[0];
formData.phaseId = current.value;
formData.phaseName = current.label;
formData.selectPhaseName = current.label;
for (let index = 0; index < cbData.val.extras.length; index++) {
if (cbData.val.extras[index]?.propertyName === 'produceLine') {
formData.produceLine = cbData.val.extras[index]?.propertyValue;
}
}
};
// 根据阶段设置工位
export const setWorkspaceListByPhaseId = async (data: any) => {
const { nodeId, formData, ref } = data;
const options = await getNodeListData(nodeId, 'workspace');
ref.setOptionsFun('workspaceCode', options);
const current = options[0];
formData.workspaceId = current.value;
formData.workspaceCode = current.value;
formData.workspaceName = current.label;
};
export const getSimTypeList = (name: any) => {
return CommonStore().getDictData(name)?.A || [];
};

View File

@@ -0,0 +1,118 @@
<template>
<div class="comp-logistics">
<div class="content">
<div class="tips">
<PlanningInformation data="物流仿真" />
</div>
<div class="form">
<TableForm
ref="TableFormRef"
tableName="SIMULATION_TASK_DEMAND_CREATE"
v-model:data="editFormInfo"
:formAttrs="{
projectId: {
auth: false,
},
endTime: {
remarkText: endTimeRemark,
},
attachments: {
remarkText: attachmentRemark,
},
}"
:hideKeys="hideKeys"
:colNum="3"
@change="changeFun"
>
<template #form-pMemberList v-if="enableConfigByTenant([TENANT_ENUM.LYRIC])">
<el-select v-model="editFormInfo.pMemberList" filterable placeholder="请选择">
<el-option
v-for="item in deptOptions"
:key="item.value + item.label"
:label="item.label + '(' + item.userName + ')'"
:value="item.value + '-' + item.label"
/>
</el-select>
</template>
</TableForm>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import PlanningInformation from '@/tenants/lyric/views/task/components/planningInformation.vue';
import TableForm from '@/components/common/table/tableForm.vue';
import { enableConfigByTenant, TENANT_ENUM } from '@/tenants/tenant';
import {
getDeptListData,
setPhaseListByProjectId,
setWorkspaceListByPhaseId,
getSimTypeList,
} from './lib';
const emits = defineEmits(['submit']);
const TableFormRef = ref();
const hideKeys = ref([
'downAttachments',
'simulationPurpose',
'animationPurpose',
'beatDemand',
'useType',
'styleRequirements',
'viewRequirements',
'referenceData',
'deviceMessage',
'materialAndCraftsmanship',
'colorRequirements',
'isMoldMaking',
'materialNo',
'designExp',
]);
const endTimeRemark = ref('【需求时间】请参考发图时间或客户评审时间');
const attachmentRemark = ref(`物流仿真待办需上传以下3类附件类型
CAD布局
工艺流程说明
时序节拍参数`);
const editFormInfo = ref<any>({});
const deptOptions = ref<any>([]);
onMounted(async () => {
deptOptions.value = await getDeptListData();
TableFormRef.value.setOptionsFun('simType', getSimTypeList('机器人仿真'));
});
const changeFun = async (cbData: any) => {
const { key, data } = cbData;
if (key === 'projectId') {
await setPhaseListByProjectId({
nodeId: data.projectId,
formData: editFormInfo.value,
ref: TableFormRef.value,
cbData,
});
if (editFormInfo.value.phaseId) {
await setWorkspaceListByPhaseId({
nodeId: editFormInfo.value.phaseId,
formData: editFormInfo.value,
ref: TableFormRef.value,
cbData,
});
}
}
};
const submitFun = async () => {
if (await TableFormRef.value.validateFun()) {
emits('submit', editFormInfo.value);
}
};
defineExpose({
submitFun,
});
</script>
<style lang="scss" scoped></style>

View File

@@ -0,0 +1,123 @@
<template>
<div class="comp-robot">
<div class="content">
<div class="tips">
<PlanningInformation data="机器人仿真" />
</div>
<div class="form">
<TableForm
ref="TableFormRef"
tableName="SIMULATION_TASK_DEMAND_CREATE"
v-model:data="editFormInfo"
:formAttrs="{
projectId: {
auth: false,
},
endTime: {
remarkText: endTimeRemark,
},
attachments: {
remarkText: attachmentRemark,
},
}"
:hideKeys="hideKeys"
:colNum="3"
@change="changeFun"
>
<template #form-pMemberList v-if="enableConfigByTenant([TENANT_ENUM.LYRIC])">
<el-select v-model="editFormInfo.pMemberList" filterable placeholder="请选择">
<el-option
v-for="item in deptOptions"
:key="item.value + item.label"
:label="item.label + '(' + item.userName + ')'"
:value="item.value + '-' + item.label"
/>
</el-select>
</template>
</TableForm>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import PlanningInformation from '@/tenants/lyric/views/task/components/planningInformation.vue';
import TableForm from '@/components/common/table/tableForm.vue';
import { enableConfigByTenant, TENANT_ENUM } from '@/tenants/tenant';
import {
getDeptListData,
setPhaseListByProjectId,
setWorkspaceListByPhaseId,
getSimTypeList,
} from './lib';
const emits = defineEmits(['submit']);
const TableFormRef = ref();
const hideKeys = ref([
'downAttachments',
'simulationPurpose',
'animationPurpose',
'fluidPurpose',
'beatDemand',
'useType',
'styleRequirements',
'viewRequirements',
'referenceData',
'deviceMessage',
'materialAndCraftsmanship',
'colorRequirements',
'isMoldMaking',
'materialNo',
'designExp',
]);
const endTimeRemark = ref('【需求时间】请参考发图时间或客户评审时间');
const attachmentRemark = ref(`
机器人仿真待办必须上传以下五类附件:
动作说明书
时序表
3D最新模型
2D最新布局
项目技术协议
`);
const editFormInfo = ref<any>({});
const deptOptions = ref<any>([]);
onMounted(async () => {
deptOptions.value = await getDeptListData();
TableFormRef.value.setOptionsFun('simType', getSimTypeList('机器人仿真'));
});
const changeFun = async (cbData: any) => {
const { key, data } = cbData;
if (key === 'projectId') {
await setPhaseListByProjectId({
nodeId: data.projectId,
formData: editFormInfo.value,
ref: TableFormRef.value,
cbData,
});
if (editFormInfo.value.phaseId) {
await setWorkspaceListByPhaseId({
nodeId: editFormInfo.value.phaseId,
formData: editFormInfo.value,
ref: TableFormRef.value,
cbData,
});
}
}
};
const submitFun = async () => {
if (await TableFormRef.value.validateFun()) {
emits('submit', editFormInfo.value);
}
};
defineExpose({
submitFun,
});
</script>
<style lang="scss" scoped></style>

View File

@@ -0,0 +1,116 @@
<template>
<div class="comp-tolerance">
<div class="content">
<div class="tips">
<PlanningInformation data="公差分析" />
</div>
<div class="form">
<TableForm
ref="TableFormRef"
tableName="SIMULATION_TASK_DEMAND_CREATE"
v-model:data="editFormInfo"
:formAttrs="{
projectId: {
auth: false,
},
endTime: {
remarkText: endTimeRemark,
},
}"
:hideKeys="hideKeys"
:colNum="3"
@change="changeFun"
>
<template #form-pMemberList v-if="enableConfigByTenant([TENANT_ENUM.LYRIC])">
<el-select v-model="editFormInfo.pMemberList" filterable placeholder="请选择">
<el-option
v-for="item in deptOptions"
:key="item.value + item.label"
:label="item.label + '(' + item.userName + ')'"
:value="item.value + '-' + item.label"
/>
</el-select>
</template>
</TableForm>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import PlanningInformation from '@/tenants/lyric/views/task/components/planningInformation.vue';
import TableForm from '@/components/common/table/tableForm.vue';
import { enableConfigByTenant, TENANT_ENUM } from '@/tenants/tenant';
import {
getDeptListData,
setPhaseListByProjectId,
setWorkspaceListByPhaseId,
getSimTypeList,
} from './lib';
const emits = defineEmits(['submit']);
const TableFormRef = ref();
const hideKeys = ref([
'downAttachments',
'simulationPurpose',
'animationPurpose',
'fluidPurpose',
'robotBrand',
'axis',
'beatDemand',
'useType',
'styleRequirements',
'viewRequirements',
'referenceData',
'deviceMessage',
'materialAndCraftsmanship',
'robotNum',
'robotNum6',
'colorRequirements',
'isMoldMaking',
'materialNo',
'designExp',
]);
const endTimeRemark = ref('【需求时间】请参考发图时间或客户评审时间');
const editFormInfo = ref<any>({});
const deptOptions = ref<any>([]);
onMounted(async () => {
deptOptions.value = await getDeptListData();
TableFormRef.value.setOptionsFun('simType', getSimTypeList('机器人仿真'));
});
const changeFun = async (cbData: any) => {
const { key, data } = cbData;
if (key === 'projectId') {
await setPhaseListByProjectId({
nodeId: data.projectId,
formData: editFormInfo.value,
ref: TableFormRef.value,
cbData,
});
if (editFormInfo.value.phaseId) {
await setWorkspaceListByPhaseId({
nodeId: editFormInfo.value.phaseId,
formData: editFormInfo.value,
ref: TableFormRef.value,
cbData,
});
}
}
};
const submitFun = async () => {
if (await TableFormRef.value.validateFun()) {
emits('submit', editFormInfo.value);
}
};
defineExpose({
submitFun,
});
</script>
<style lang="scss" scoped></style>