This commit is contained in:
2026-01-29 10:43:47 +08:00
15 changed files with 277 additions and 67 deletions

View File

@@ -189,3 +189,18 @@ export const syncPhaseApi = (params: any) => {
export const getRunListByRunIdListApi = (params: { runIdList: string[] }) => {
return post(`${PREFIX}node/getRunListByRunIdList`, params);
};
export const getDedicatedTimeApi = (params: any) => {
return post(`${PREFIX}node/getDedicatedTime`, params);
};
export const batchUpdateWorkspaceExtraApi = (params: any) => {
return post(`${PREFIX}node/batchUpdateWorkspaceExtra`, params);
};
/**
* 仿真策划提交审批接口
* @param params
* @returns
*/
export const modifyWithApproveAPi = (params: any) => {
return post(`${PREFIX}node/modifyWithApprove`, params);
};

View File

@@ -1,4 +1,4 @@
import { download, post } from '@/api/request';
import { download, post, get } from '@/api/request';
const env = import.meta.env;
const PREFIX = env.VITE_API_PREFIX_PROJECT;
@@ -27,3 +27,12 @@ export const queryProjectInfoListApi = (params: any) => {
export const getTaskTreeListApi = (params: any) => {
return post(`${PREFIX}project/getTaskTreeList`, params);
};
/**
* 查询项目阶段的仿真策划版本
* @param params
* @returns projectId phaseId
*/
export const queryDesignVersionsApi = (params: any) => {
return get(`${PREFIX}project/queryDesignVersions`, params);
};

View File

@@ -30,5 +30,15 @@ export const systemQueryAddApproveFlowMapApi = (params: any) => {
// 获取模块评审流程映射
export const systemQueryAllApproveFlowMapApi = (params: any) => {
return post(`${PREFIX}systemApprove/queryAllApproveFlowMap`, params);
return get(`${PREFIX}systemApprove/queryAllApproveFlowMap`, params);
};
// 更新模块评审流程映射
export const systemUpdateApproveFlowMapApi = (params: any) => {
return post(`${PREFIX}systemApprove/updateApproveFlowMap`, params);
};
// 删除模块评审流程映射
export const systemDeleteApproveFlowMapApi = (params: any) => {
return get(`${PREFIX}systemApprove/deleteApproveFlowMap`, params);
};

View File

@@ -7,6 +7,7 @@
:placeholder="disabled ? '' : '请选择'"
filterable
clearable
:multiple="multiple"
:disabled="disabled"
@change="changeFun"
@clear="clearFun"
@@ -17,27 +18,34 @@
<script lang="ts" setup>
import { ref, onMounted, watch } from 'vue';
import { systemApproveQueryApproveFlowTempalteApi } from '@/api/system/systemApprove';
import { debounce } from 'lodash-es';
interface Props {
modelValue: string;
disabled?: boolean;
multiple?: boolean;
attrs?: any;
}
const props = withDefaults(defineProps<Props>(), {
modelValue: '',
disabled: false,
multiple: false,
attrs: {},
});
const listData = ref<any>([]);
const choseData = ref<any>('');
const choseData = ref<any>([]);
const emit = defineEmits(['update:modelValue', 'change', 'clear']);
watch(
() => props.modelValue,
(val: any) => {
choseData.value = val;
if (props.multiple) {
choseData.value = val ? val.split(',') : [];
} else {
choseData.value = val;
}
},
{ deep: true, immediate: true }
);
@@ -48,7 +56,7 @@ onMounted(() => {
const getlistDataFun = () => {
const params = {
templatePrefix: props.attrs.templatePrefix || '',
moduleCode: props.attrs.moduleCode || '',
};
systemApproveQueryApproveFlowTempalteApi(params).then((res: any) => {
if (res.code === 200) {
@@ -60,23 +68,41 @@ const getlistDataFun = () => {
});
listData.value = build;
if (build[0]) {
choseData.value = build[0].value;
changeFun();
if (!props.multiple) {
choseData.value = build[0].value;
changeFun();
}
}
}
});
};
const changeFun = () => {
emit('update:modelValue', choseData.value);
let changeData: any = {};
listData.value.some((item: any) => {
if (choseData.value === item.value) {
changeData = item;
return true;
const multiplyChangeFun = debounce(() => {
const ids = choseData.value.join(',');
emit('update:modelValue', ids);
const changeData: any[] = [];
listData.value.forEach((item: any) => {
if (choseData.value.includes(item.value)) {
changeData.push(item);
}
});
emit('change', changeData);
}, 500);
const changeFun = () => {
if (props.multiple) {
multiplyChangeFun();
} else {
emit('update:modelValue', choseData.value);
let changeData: any = {};
listData.value.some((item: any) => {
if (choseData.value === item.value) {
changeData = item;
return true;
}
});
emit('change', changeData);
}
};
const clearFun = () => {

View File

@@ -160,10 +160,25 @@ const openDefaultExpandedFun = (baseData: any) => {
navList.value = navListStorageData;
expandedKeys.value = navList.value.map((i: any) => i.id);
currentKey.value = navList.value[navList.value.length - 1]?.id || '';
scrollToNodeFun(currentKey.value);
}, 0);
}
};
const scrollToNodeFun = (key: any) => {
if (!currentKey.value) {
return;
}
setTimeout(() => {
const dom = treeRef.value?.$el;
if (!dom) return;
const node = dom.querySelector(`.el-tree-node[data-key="${key}"]`);
if (node) {
node.scrollIntoView({ behavior: 'smooth' });
}
}, 1000);
};
// 加载节点
const loadMoreFun = async (node: any, resolve: any) => {
loading.value = true;

View File

@@ -2,6 +2,7 @@
<div class="img-content">
<div v-if="mode === 'edit'" class="pic">
<el-icon :size="100"><Picture /></el-icon>
<div class="key-name">{{ titleKey || '请输入图片key' }}</div>
</div>
<div
v-else
@@ -184,10 +185,16 @@ const closeFun = () => {
height: 200px;
border-radius: 4px;
background-color: var(--el-bg-color);
color: var(--el-border-color);
color: var(--el-text-color-placeholder);
display: flex;
align-items: center;
justify-content: center;
align-content: center;
flex-wrap: wrap;
.key-name {
width: 100%;
text-align: center;
}
}
.paste-content {
padding: 20px;

View File

@@ -1,5 +1,6 @@
<template>
<div class="table-content">
<div v-if="mode === 'edit'" class="key-name">{{ titleKey || '请输入表格key ' }}</div>
<el-table :data="tableData">
<el-table-column
v-for="(item, index) in head"
@@ -155,6 +156,12 @@ const closeFun = () => {
opacity: 1;
}
}
.key-name {
background-color: var(--el-bg-color);
color: var(--el-text-color-placeholder);
text-align: center;
padding-top: 10px;
}
.setting-btn {
opacity: 0;
position: absolute;

View File

@@ -174,6 +174,7 @@
v-if="item.inputMode === 'approveList'"
:attrs="attrs"
v-model="formData[item.searchKey || item.key]"
:multiple="attrs.multiple"
:disabled="attrs.disabled || (item.disabled && showDisabled)"
@change="(val: any) => changeFun(item.key, val)"
@clear="clearFun"

View File

@@ -206,6 +206,7 @@ const setValidateFun = (data: any) => {
};
const changeFun = (val: any) => {
formRef.value?.clearValidate(val.key);
emit('change', val);
};

View File

@@ -211,7 +211,7 @@
/>
</template>
</vxe-column>
<vxe-column
<!-- <vxe-column
field="disabled"
title="不可编辑"
align="center"
@@ -221,7 +221,7 @@
<template #default="{ row }">
<el-switch v-model="row.disabled" :disabled="disabled" />
</template>
</vxe-column>
</vxe-column> -->
<vxe-column
field="width"
title="表格列宽"

View File

@@ -29,4 +29,8 @@ export enum TABLE_NAME {
DATA_FORECAST_OUTPUT = 'DATA_FORECAST_OUTPUT',
/** EP 项目列表 */
EP_PROJECT_LIST = 'EP_PROJECT_LIST',
/** 工位时间维护 - 列表 */
WORKSPACE_TIME = 'WORKSPACE_TIME',
/** 工位时间维护 - 批量修改 */
BATCH_UPDATE_WORKSPACE_TIME = 'BATCH_UPDATE_WORKSPACE_TIME',
}

View File

@@ -10,7 +10,7 @@
@change="changeFun"
:formAttrs="{
templateId: {
templatePrefix: '参数库',
moduleCode: 'PARAM_APPROVAL',
},
files: {
accept: '.json',

View File

@@ -2,6 +2,7 @@
<div class="comp-review">
<div class="table">
<BaseTable
ref="baseTableRef"
showIndex
:api="systemQueryAllApproveFlowMapApi"
tableName="APPROVAL_CONFIG"
@@ -9,15 +10,30 @@
:actionList="actionList"
>
<template #leftOptions>
<el-button type="primary" :icon="Plus" @click="dialogVisible = true">新增配置</el-button>
<el-button type="primary" :icon="Plus" @click="opoenFun({})">新增配置</el-button>
</template>
<template #flowList="{ row }">
<div class="tag-list">
<el-tag v-for="(item, index) in row.flowList" :key="index" class="tag" type="primary">
{{ item.flowName }}
</el-tag>
</div>
</template>
</BaseTable>
</div>
<Dialog v-model="dialogVisible" diaTitle="新增" :width="400">
<Dialog v-model="dialogVisible" :diaTitle="`${editId ? '编辑' : '新增'}`" :width="400">
<div class="content">
<TableForm
ref="tableFormRef"
v-model:data="formData"
:formAttrs="{
moduleCode: {
disabled: editId,
},
flowList: {
multiple: true,
},
}"
:itemNum="3"
tableName="APPROVAL_CONFIG"
@change="changeFun"
@@ -43,36 +59,75 @@ import { useI18n } from 'vue-i18n';
import {
systemQueryAddApproveFlowMapApi,
systemQueryAllApproveFlowMapApi,
systemUpdateApproveFlowMapApi,
systemDeleteApproveFlowMapApi,
} from '@/api/system/systemApprove';
import { ElMessage } from 'element-plus';
const { t } = useI18n();
const dialogVisible = ref(false);
const formData = ref<any>({
flowName: '',
});
const formData = ref<any>({});
const flowList = ref<any>([]);
const baseTableRef = ref<any>();
const tableFormRef = ref<any>();
const actionList = ref([
{
title: t('通用.编辑'),
type: 'primary',
click: (row: any) => {
opoenFun(row);
},
},
{
title: t('通用.删除'),
needConfirm: true,
confirmTip: t('通用.确认删除吗'),
type: 'danger',
click: (row: any) => {
delFun(row.moduleCode);
},
},
]);
const editId = ref('');
const opoenFun = (data: any) => {
const { id, flowList = [], moduleCode, moduleName } = data;
editId.value = id;
if (id) {
formData.value = {
moduleCode,
moduleName,
flowList: flowList.map((item: any) => item.flowCode).join(','),
};
flowList.value = flowList.map((item: any) => {
return {
flowCode: item.value,
flowName: item.label,
};
});
} else {
formData.value = {};
tableFormRef.value?.resetFun();
}
dialogVisible.value = true;
};
const editFun = async () => {
const valid = await tableFormRef.value.validateFun();
if (valid) {
const params = formData.value;
systemQueryAddApproveFlowMapApi(params).then((res: any) => {
const params = {
...formData.value,
flowList: flowList.value,
};
let api: any = systemQueryAddApproveFlowMapApi;
if (editId.value) {
api = systemUpdateApproveFlowMapApi;
}
api(params).then((res: any) => {
if (res.code === 200) {
ElMessage.success('操作成功');
resetFun();
closeFun();
}
});
@@ -80,14 +135,34 @@ const editFun = async () => {
};
const changeFun = (data: any) => {
if (data.key === 'flowCode') {
formData.value.flowName = data.val.label;
if (data.key === 'flowList') {
flowList.value = data.val?.map((item: any) => {
return {
flowCode: item.value,
flowName: item.label,
};
});
}
};
const delFun = (moduleCode: any) => {
const params = {
moduleCode,
};
systemDeleteApproveFlowMapApi(params).then((res: any) => {
if (res.code === 200) {
resetFun();
}
});
};
const closeFun = () => {
dialogVisible.value = false;
};
const resetFun = () => {
baseTableRef.value?.resetFun();
};
</script>
<style lang="scss" scoped>
@@ -97,6 +172,14 @@ const closeFun = () => {
.table {
width: 100%;
height: 100%;
.tag-list {
max-width: 100%;
overflow-x: auto;
.tag {
margin-right: 5px;
margin-bottom: 5px;
}
}
}
}
</style>

View File

@@ -148,6 +148,7 @@ import { getFileBaseInfoApi } from '@/api/data/data';
import Dialog from '@/components/common/dialog/index.vue';
import { downloadFileById, fileUploadAllocationTypeFun, formatFileSize } from '@/utils/file';
import { useI18n } from 'vue-i18n';
import { updateTaskStatusApi } from '@/api/project/task';
const env = import.meta.env;
@@ -400,11 +401,32 @@ const submitFun = async () => {
});
}
if (props.taskInfo.exeStatus != 8) {
await updateTaskExeStatusFun();
}
closeFun();
}
}
};
const updateTaskExeStatusFun = async () => {
const task = cloneDeep(props.taskInfo);
delete task.children;
const param = {
taskIds: [props.taskInfo.uuid],
req: {
// ...task,
exeStatus: '8',
},
};
try {
const res: any = await updateTaskStatusApi(param);
if (res && res.code === 200) {
}
} catch {}
};
const getImgPathFun = (fileId: any) => {
const url = `${env.VITE_API_IMAGE_PREVIEW_URL}/data/previewImage?fileId=${fileId}`;
return url;

View File

@@ -86,46 +86,31 @@
/>
</el-tab-pane>
<el-tab-pane label="项目详情" name="projectDetail">
<baseInfo
ref="basePageRef"
@update:projectInfo="updateProjectInfo"
@loaded="projectInfoLoadCompleteFun"
v-if="projectUuid"
:nodeId="projectUuid"
/>
</el-tab-pane>
<el-tab-pane
v-if="enableConfigByTenant([TENANT_ENUM.LYRIC])"
label="方案维护"
name="schemeMaintain"
>
<SchemeMaintain
ref="schemeMaintainRef"
v-if="displayedTabs.includes('schemeMaintain') && projectUuid"
:nodeId="projectUuid"
/>
</el-tab-pane>
<el-tab-pane
v-if="enableConfigByTenant([TENANT_ENUM.LYRIC])"
label="批次信息"
name="batchInfo"
>
<BatchInfo
ref="batchInfoRef"
v-if="displayedTabs.includes('batchInfo') && projectUuid"
:nodeId="projectUuid"
/>
</el-tab-pane>
<el-tab-pane
v-if="enableConfigByTenant([TENANT_ENUM.LYRIC])"
label="产线信息"
name="productionLine"
>
<productionLine
ref="productionLineRef"
v-if="displayedTabs.includes('productionLine') && projectUuid"
:nodeCode="currentProjectInfo.nodeCode"
/>
<div class="project-detail-content">
<div class="section-block">
<div class="section-title">基本信息</div>
<baseInfo
ref="basePageRef"
@update:projectInfo="updateProjectInfo"
@loaded="projectInfoLoadCompleteFun"
:nodeId="projectUuid"
/>
</div>
<template v-if="enableConfigByTenant([TENANT_ENUM.LYRIC])">
<div class="section-block">
<div class="section-title">方案维护</div>
<SchemeMaintain ref="schemeMaintainRef" :nodeId="projectUuid" />
</div>
<div class="section-block">
<div class="section-title">批次信息</div>
<BatchInfo ref="batchInfoRef" :nodeId="projectUuid" />
</div>
<div class="section-block">
<div class="section-title">产线信息</div>
<productionLine ref="productionLineRef" :nodeCode="currentProjectInfo.nodeCode" />
</div>
</template>
</div>
</el-tab-pane>
<el-tab-pane v-if="enableConfigByTenant([TENANT_ENUM.LYRIC])" label="项目PDT" name="PDT">
<PDT
@@ -418,4 +403,29 @@ const projectInfoLoadCompleteFun = () => {
height: 100%;
}
}
.project-detail-content {
height: 100%;
overflow-y: auto;
padding-right: 10px;
}
.section-block {
margin-bottom: 24px;
padding-bottom: 20px;
&:last-child {
border-bottom: none;
margin-bottom: 0;
}
}
.section-title {
font-size: 16px;
font-weight: 600;
color: var(--el-text-color-primary);
margin-bottom: 12px;
padding-left: 10px;
border-left: 3px solid var(--el-color-primary);
}
</style>