新增待办的拓展字段处理,项目详情的处理,文件传tagReq的处理

This commit is contained in:
weibl
2026-03-12 18:55:24 +08:00
parent 0413a6db15
commit 6982855be5
7 changed files with 197 additions and 81 deletions

View File

@@ -38,18 +38,6 @@
<td>方案制作部门</td>
<td>{{ nodeInfo.programTeam }}</td>
</tr>
<tr>
<td>参考项目</td>
<td>{{ nodeInfo.referenceItem }}</td>
</tr>
<tr>
<td>方案成交或关闭日期</td>
<td>{{ nodeInfo.schemesFinishOrCloseTime }}</td>
</tr>
<tr>
<td>营销实际签单数量</td>
<td>{{ nodeInfo?.signNum }}</td>
</tr>
</tbody>
</table>
@@ -63,35 +51,6 @@
<td>领域</td>
<td>{{ nodeInfo.domain }}</td>
</tr>
<tr>
<td>方案关闭原因</td>
<td>{{ nodeInfo.schemesClosingReasons }}</td>
</tr>
<tr>
<td>预估图纸数</td>
<td>{{ nodeInfo?.drawings }}</td>
</tr>
<tr>
<td>预估零件数</td>
<td>{{ nodeInfo.reuseDrawings }}</td>
</tr>
<tr>
<td>io数量</td>
<td>{{ nodeInfo.planIo }}</td>
</tr>
<tr>
<td>外够件材质要求</td>
<td>{{ nodeInfo.materialQuality }}</td>
</tr>
<tr>
<td>输入输出方式</td>
<td>{{ nodeInfo.putMode }}</td>
</tr>
<tr>
<td>螺钉材质</td>
<td>{{ nodeInfo.screwMaterial }}</td>
</tr>
<tr>
<td>机型</td>
<td>{{ nodeInfo.machineType }}</td>
@@ -100,6 +59,18 @@
<td>订单量</td>
<td>{{ nodeInfo?.orderQuantity }}</td>
</tr>
<tr>
<td>参考项目</td>
<td>{{ nodeInfo.referenceItem }}</td>
</tr>
<tr>
<td>方案成交或关闭日期</td>
<td>{{ nodeInfo.schemesFinishOrCloseTime }}</td>
</tr>
<tr>
<td>营销实际签单数量</td>
<td>{{ nodeInfo?.signNum }}</td>
</tr>
</tbody>
</table>
</div>

View File

@@ -19,13 +19,21 @@ export const getDemandHideKeys = (key: string) => {
'colorRequirements',
'isMoldMaking',
'materialNo',
'designExp',
];
let keys: string[] = [];
if (key.indexOf('有限元') !== -1 || key.indexOf('DISCIPLINE_TYPE') !== -1) {
const finiteElementKeys = ['simulationPurpose', 'isMoldMaking', 'materialNo'];
const finiteElementKeys = ['simulationPurpose', 'isMoldMaking', 'materialNo', 'designExp'];
keys = allKeys.filter((item) => !finiteElementKeys.includes(item));
} else if (key.indexOf('动画') !== -1) {
const animationKeys = ['animationPurpose', 'robotBrand', 'axis', 'beatDemand'];
const animationKeys = [
'animationPurpose',
'robotBrand',
'axis',
'beatDemand',
'robotNum',
'robotNum6',
];
keys = allKeys.filter((item) => !animationKeys.includes(item));
} else if (key.indexOf('工业') !== -1) {
const industrialKeys = [

View File

@@ -51,6 +51,26 @@ export const tagSortList = [
// 'tag10',
];
/**
*
* @param params
* @returns tagReq
*/
export const getTagReq = (params: any) => {
const tagReq: any = {
taskId: null,
runId: null,
};
tagSortList.forEach((item) => {
tagReq[item] = null;
});
for (const key in params) {
tagReq[key] = params[key];
}
// console.log('tagReq', tagReq);
return tagReq;
};
export const getTagKeyMap = () => {
if (categoryList.length === 0 && !noCategoryList) {
categoryList = commonStore.getDictData('TAG_TYPE_MAP_LIST').A;

View File

@@ -1,5 +1,35 @@
<template>
<div class="info-grid">
<div class="info-grid" v-if="enableConfigByTenant([TENANT_ENUM.LYRIC])">
<table class="info-table">
<tbody>
<tr>
<td>项目名称</td>
<td>{{ nodeInfo.nodeName }}</td>
</tr>
<tr>
<td>当前阶段</td>
<td>
{{ nodeInfo.currentPhase || '未设置' }}
</td>
</tr>
</tbody>
</table>
<table class="info-table">
<tbody>
<tr>
<td>项目代号</td>
<td>{{ nodeInfo.nodeCode }}</td>
</tr>
<tr>
<td>仿真专项代表</td>
<td>{{ nodeInfo.pMemberNames }}</td>
</tr>
</tbody>
</table>
</div>
<div class="info-grid" v-else>
<table class="info-table">
<tbody>
<tr>
@@ -10,7 +40,7 @@
<td>仿真专项代表</td>
<td>{{ nodeInfo.pMemberNames }}</td>
</tr>
<tr v-if="!enableConfigByTenant([TENANT_ENUM.LYRIC])">
<tr>
<td>项目状态</td>
<td>
<StatusDot

View File

@@ -81,6 +81,7 @@ import { downloadFileById } from '@/utils/file';
import emitter from '@/utils/eventBus';
// import FileTypeChange from '@/components/common/fileTable/fileTypeChange.vue';
import { useDict } from '@/utils/useDict';
import { getTagReq } from '@/utils/enum/node';
const { ALL_FILE_TYPE, DISCIPLINE_TYPE } = useDict('ALL_FILE_TYPE', 'DISCIPLINE_TYPE');
@@ -296,6 +297,7 @@ const confirmUploadFun = async () => {
fileTypeDictValue: fromData.fileTypeDictValue || '',
disciplineTypeDictClass: 'DISCIPLINE_TYPE',
disciplineDictValue: fromData.disciplineDictValue || '',
tagReq: getTagReq({ tag1: props.projectUuid }),
};
batchAddFileInfoApi(params).then((res: any) => {
if (res.code === 200) {

View File

@@ -243,7 +243,7 @@ const currentProjectBaseInfo = reactive<any>({
memberList: [],
});
const viewType = ref('card');
const viewType = ref(enableConfigByTenant([TENANT_ENUM.LYRIC]) ? 'list' : 'card');
const searchParams = ref({
type: props.projectType,
});

View File

@@ -61,6 +61,7 @@
>
</div>
</div> -->
<!-- {{ editFormInfo }} -->
<TableForm
ref="tableFormRef"
tableName="SIMULATION_TASK_DEMAND_CREATE"
@@ -122,7 +123,7 @@ import {
editDemandApi,
} from '@/api/project/demand';
import { getChildrenNodeList } from '../../projectDetail/components/projectApi';
import { NODE_TYPE } from '@/utils/enum/node';
import { getTagReq, NODE_TYPE } from '@/utils/enum/node';
// import { upload } from '@/api/request';
import { CommonStore } from '@/stores/common';
import attachments from '@/views/task/simulationTask/components/attachments.vue';
@@ -138,6 +139,8 @@ import { listDeptApi } from '@/api/system/departMent';
import { uploadBigFile } from '@/utils/file';
import { getDemandHideKeys } from '@/tenants/lyric/views/task/lyricTask';
import PlanningInformation from '@/tenants/lyric/views/task/components/planningInformation.vue';
import { FILE_TYPE } from '@/utils/enum/file';
import { delayTime } from '@/utils/common';
// import emitter from '@/utils/eventBus';
// const env = import.meta.env;
@@ -260,6 +263,9 @@ const visibleDialog = async (isCreate: boolean, row?: any) => {
if (row.phaseId) {
phaseList = await getChildrenNodeList(NODE_TYPE.PHASE, row.projectId);
phaseList = phaseList.map((item: any) => {
if (row.phaseId === item.uuid) {
row.selectPhaseName = item.nodeName;
}
return {
label: item.nodeName,
value: item.uuid,
@@ -278,6 +284,15 @@ const visibleDialog = async (isCreate: boolean, row?: any) => {
};
});
}
if (enableConfigByTenant([TENANT_ENUM.LYRIC])) {
const projectUndertaker = row.extras.find((item: any) => {
return item.propertyName === 'projectUndertaker';
});
if (projectUndertaker) {
currentProjectUndertaker.value = projectUndertaker.propertyValue;
}
}
let simList: any;
if (row.simType) {
simList = commonStore.getDictData(row.demandType);
@@ -351,7 +366,20 @@ const confirmFun = async () => {
projectId: editFormInfo.value.projectId, // 项目id
callbackFlag: '/task/sponsor', // 回调标识
uuid: demandId,
tagReq: {},
tagReq: getTagId({
tag1: editFormInfo.value.projectId,
tag2: editFormInfo.value.phaseId,
}),
fileTypeDictValue: FILE_TYPE.DEMAND_ATTACHMENTS || '',
disciplineDictValue: editFormInfo.value.simType || '',
fileTypeDictClass: 'ALL_FILE_TYPE',
disciplineTypeDictClass: 'DISCIPLINE_TYPE',
dictTags: [
'fileTypeDictClass',
'fileTypeDictValue',
'disciplineTypeDictClass',
'disciplineDictValue',
],
};
await uploadBigFile(params, batchAddFileInfoApi);
}
@@ -454,8 +482,26 @@ const editDemandApiFun = async (fromData: any) => {
// isApprove: 0, // 0不需要审批 1需要审批 默认0
// type: 0,
uuid: fromData.uuid,
tagReq: {},
tagReq: getTagReq({ tag1: fromData.projectId, tag2: fromData.phaseId }),
fileTypeDictValue: FILE_TYPE.DEMAND_ATTACHMENTS || '',
disciplineDictValue: fromData.simType || '',
fileTypeDictClass: 'ALL_FILE_TYPE',
disciplineTypeDictClass: 'DISCIPLINE_TYPE',
dictTags: [
'fileTypeDictClass',
'fileTypeDictValue',
'disciplineTypeDictClass',
'disciplineDictValue',
],
};
if (enableConfigByTenant([TENANT_ENUM.LYRIC])) {
params.tagReq = getTagReq({
tag1: fromData.projectId,
tag2: fromData.phaseId,
tag4: fromData.machineId,
tag5: fromData.workspaceId,
});
}
await uploadBigFile(params, batchAddFileInfoApi);
// batchUploadFile(
@@ -522,24 +568,62 @@ const changeFun = async (val: any, type: string) => {
nodeId = val.data.projectId;
if (enableConfigByTenant([TENANT_ENUM.LYRIC])) {
currentProjectUndertaker.value = '';
// if (val.val?.projectUndertaker) {
// currentProjectUndertaker.value = val.val?.projectUndertaker;
// }
// if (val.val?.produceLine) {
// editFormInfo.value.produceLine = val.val?.produceLine;
// }
for (let index = 0; index < val.val.extras.length; index++) {
if (val.val.extras[index]?.propertyName === 'projectUndertaker') {
currentProjectUndertaker.value = val.val.extras[index].propertyValue;
currentProjectUndertaker.value = val.val.extras[index]?.propertyValue || '';
}
if (val.val.extras[index]?.propertyName === 'produceLine') {
editFormInfo.value.produceLine = val.val.extras[index].propertyValue;
editFormInfo.value.produceLine = val.val.extras[index]?.propertyValue;
}
}
// 将项目的项目承接主体的数据存入到待办里
editFormInfo.value.projectUndertaker = currentProjectUndertaker.value;
// editFormInfo.value.extras.map((item: any) => {
// if (item.propertyName === 'projectUndertaker') {
// item.propertyValue = currentProjectUndertaker.value;
// }
// return {
// ...item,
// };
// });
}
if (editFormInfo.value.simType) {
await disposeDeptMember();
}
// console.log('projectUndertaker 111', editFormInfo.value.projectUndertaker);
// await delayTime(2000);
// console.log('projectUndertaker 222', editFormInfo.value.projectUndertaker);
}
if (nodeId) {
const optionList = await getPhaseList(nodeType, nodeId);
// if (editFormInfo.value.extras.length > 0) {
// console.log('projectUndertaker 604', editFormInfo.value.projectUndertaker);
// }
tableFormRef.value.setOptionsFun(nextKey, optionList);
if (nextKey === 'phaseId' && optionList.length > 0) {
editFormInfo.value.phaseId = optionList[0].value;
// 阶段默认选择当前阶段
if (val.val?.currentPhase) {
const currentPhase = optionList.find((item: any) => {
return item.label === val.val?.currentPhase;
});
if (currentPhase) {
editFormInfo.value.phaseId = currentPhase.value;
editFormInfo.value.selectPhaseName = currentPhase.label;
} else {
editFormInfo.value.phaseId = optionList[0].value;
editFormInfo.value.selectPhaseName = optionList[0].label;
}
} else {
editFormInfo.value.phaseId = optionList[0].value;
editFormInfo.value.selectPhaseName = optionList[0].label;
}
const workspaceInfo = await getWorkSpaceList(editFormInfo.value.phaseId);
editFormInfo.value.workspaceId = workspaceInfo.uuid;
editFormInfo.value.workspaceCode = workspaceInfo.value;
@@ -556,6 +640,7 @@ const changeFun = async (val: any, type: string) => {
}
if (optionList.length === 0) {
editFormInfo.value.phaseId = '';
editFormInfo.value.selectPhaseName = '';
// 清空工位数据
editFormInfo.value.machineId = '';
editFormInfo.value.workspaceId = '';
@@ -567,6 +652,7 @@ const changeFun = async (val: any, type: string) => {
} else {
tableFormRef.value.setOptionsFun(nextKey, []);
editFormInfo.value.phaseId = '';
editFormInfo.value.selectPhaseName = '';
editFormInfo.value.machineId = '';
editFormInfo.value.workspaceId = '';
editFormInfo.value.workspaceCode = '';
@@ -652,6 +738,9 @@ const deptList = ref<any[]>([]);
const disposeDeptMember = async () => {
let pMemberId = '';
editFormInfo.value.pMemberList = '';
if (!currentProjectUndertaker.value) {
return '';
}
if (deptList.value.length === 0) {
const res = await listDeptApi({ current: 1, size: 999 });
deptList.value = res.data.data;
@@ -666,40 +755,36 @@ const disposeDeptMember = async () => {
}
return pMemberId;
}
// const disFun = (simType: string) => {
// for (let index = 0; index < deptList.value.length; index++) {
// if (deptList.value[index].deptName.includes(simType)) {
// editFormInfo.value.pMemberList =
// deptList.value[index].userId + '-' + deptList.value[index].deptName;
// pMemberId = deptList.value[index].userId;
// }
// }
// return pMemberId;
// };
// if (editFormInfo.value.simType.includes('流体')) {
// return disFun('流体');
// }
// if (editFormInfo.value.simType.includes('热力学')) {
// return disFun('热力学');
// }
const matchingDeptList = deptList.value.filter((item: any) => {
return item.deptName.indexOf(currentProjectUndertaker.value) !== -1;
// 非设计阶段 走技术中心 设计阶段不走技术中心
if (editFormInfo.value?.selectPhaseName.indexOf('设计') !== -1) {
return (
item.deptName.indexOf(currentProjectUndertaker.value) !== -1 &&
item.deptName.indexOf('技术中心') === -1
);
} else {
return (
item.deptName.indexOf(currentProjectUndertaker.value) !== -1 &&
item.deptName.indexOf('技术中心') !== -1
);
}
});
if (matchingDeptList.length > 0) {
if (matchingDeptList.length === 1) {
pMemberId = matchingDeptList[0].userId;
editFormInfo.value.pMemberList =
matchingDeptList[0].userId + '-' + matchingDeptList[0].deptName;
} else {
const machDept = matchingDeptList.find((item: any) => {
return item.deptName.indexOf(editFormInfo.value.simType) !== -1;
});
if (machDept) {
pMemberId = machDept.userId;
editFormInfo.value.pMemberList = machDept.userId + '-' + machDept.deptName;
}
// if (matchingDeptList.length === 1) {
// pMemberId = matchingDeptList[0].userId;
// editFormInfo.value.pMemberList =
// matchingDeptList[0].userId + '-' + matchingDeptList[0].deptName;
// } else {
const machDept = matchingDeptList.find((item: any) => {
// if()
return item.deptName.indexOf(editFormInfo.value.simType) !== -1;
});
if (machDept) {
pMemberId = machDept.userId;
editFormInfo.value.pMemberList = machDept.userId + '-' + machDept.deptName;
}
// }
}
return pMemberId;
};