提交
This commit is contained in:
1 parent
87dbbf1247
commit
5254eea4a2
39 files changed
+1296
-2988
No files matched your search
@@ -12,9 +12,6 @@
|
||||
<DialogFormBody
|
||||
:loading="dialogFormLoading"
|
||||
body-class="protocol-dialog-body min-h-[200px]"
|
||||
skeleton-variant="tabs-form"
|
||||
:skeleton-tab-count="formTabs.length"
|
||||
:skeleton-section-count="4"
|
||||
>
|
||||
<div class="detail-tabs">
|
||||
<div
|
||||
|
||||
@@ -24,13 +24,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<DialogDetailSkeleton
|
||||
v-if="detailLoading && !bundle"
|
||||
variant="tabs-detail"
|
||||
:tab-count="formTabs.length"
|
||||
/>
|
||||
|
||||
<template v-else-if="bundle">
|
||||
<template v-if="bundle">
|
||||
<div v-loading="detailLoading && !bundle">
|
||||
<!-- KPI 摘要条 -->
|
||||
<div class="kpi-strip">
|
||||
<div class="kpi-card">
|
||||
@@ -768,6 +763,7 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
@@ -800,7 +796,6 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, nextTick, ref, watch } from 'vue'
|
||||
import { Calendar, CircleCheck, Close, Document, User } from '@element-plus/icons-vue'
|
||||
import DialogDetailSkeleton from '@/components/business/dialog-detail-skeleton/index.vue'
|
||||
import ProtocolAttachmentReadonly from './ProtocolAttachmentReadonly.vue'
|
||||
import SampleQcInfoCards from '@/components/business/sample-qc-info-cards/index.vue'
|
||||
import {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
>
|
||||
<div class="channel-view-body" :class="{ 'is-sub-loading': loading && channel }">
|
||||
<template v-if="channel">
|
||||
<div class="detail-tabs">
|
||||
<div v-loading="loading" class="detail-tabs">
|
||||
<div
|
||||
v-for="tab in viewTabs"
|
||||
:key="tab.key"
|
||||
@@ -304,14 +304,8 @@
|
||||
<el-empty v-else description="暂无协议信息" :image-size="48" />
|
||||
</div>
|
||||
|
||||
<DialogDetailSkeleton
|
||||
v-if="loading"
|
||||
variant="simple"
|
||||
:section-count="2"
|
||||
class="channel-view-sub-skeleton"
|
||||
/>
|
||||
</template>
|
||||
<DialogDetailSkeleton v-else variant="tabs-detail" :tab-count="viewTabs.length" />
|
||||
<div v-else v-loading="true" style="min-height: 200px"></div>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
@@ -344,7 +338,6 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, nextTick, ref, watch } from 'vue'
|
||||
import { Calendar, Close, CollectionTag, OfficeBuilding, User } from '@element-plus/icons-vue'
|
||||
import DialogDetailSkeleton from '@/components/business/dialog-detail-skeleton/index.vue'
|
||||
import ProtocolAttachmentReadonly from '@/views/cell-storage/protocol/ProtocolAttachmentReadonly.vue'
|
||||
import { downloadAttachmentFile } from '@/utils/download-attachment'
|
||||
import {
|
||||
|
||||
@@ -261,11 +261,10 @@
|
||||
<!-- 中间:步骤列表 -->
|
||||
<div
|
||||
class="route-config-center"
|
||||
v-loading="stepListLoading"
|
||||
@dragover.prevent
|
||||
@drop="onDropToCenter"
|
||||
>
|
||||
<el-skeleton v-if="stepListLoading" animated :rows="6" class="route-config-step-skeleton" />
|
||||
<template v-else>
|
||||
<div class="route-config-center-header">
|
||||
<h3>工序步骤</h3>
|
||||
<span class="route-config-step-count">共 {{ stepList.length }} 步</span>
|
||||
@@ -316,7 +315,6 @@
|
||||
<p>从左侧拖拽工序到此处,添加路线步骤</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<!-- 右侧:步骤详情 -->
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -75,9 +75,7 @@
|
||||
<el-empty v-if="!editor.filteredProcessLibrary.value.length" description="暂无工艺数据" :image-size="48" />
|
||||
</div>
|
||||
|
||||
<div class="route-config-center" @dragover.prevent @drop="editor.onDropToCenter">
|
||||
<el-skeleton v-if="editor.stepListLoading.value" animated :rows="6" />
|
||||
<template v-else>
|
||||
<div class="route-config-center" v-loading="editor.stepListLoading.value" @dragover.prevent @drop="editor.onDropToCenter">
|
||||
<div class="route-config-center-header">
|
||||
<h3>工序步骤</h3>
|
||||
<span class="route-config-step-count">共 {{ editor.stepList.value.length }} 步</span>
|
||||
@@ -108,7 +106,6 @@
|
||||
<p>从左侧拖拽工序到此处,添加任务步骤</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<StepDetailPanel :editor="editor" />
|
||||
|
||||
@@ -2,7 +2,31 @@
|
||||
<template>
|
||||
<div class="route-config-right">
|
||||
<template v-if="editor.selectedStep.value">
|
||||
<div class="route-config-right-header"><h3>步骤详情</h3></div>
|
||||
<div class="route-config-right-header">
|
||||
<h3>步骤详情</h3>
|
||||
<div v-if="editor.mode.value === 'execution' && editor.selectedStep.value" class="step-status-bar">
|
||||
<el-tag :type="editor.stepStatusTag(editor.selectedStep.value.stepStatus || 'dzx').type" size="small">
|
||||
{{ editor.stepStatusTag(editor.selectedStep.value.stepStatus || 'dzx').label }}
|
||||
</el-tag>
|
||||
<el-button
|
||||
v-if="editor.selectedStep.value.stepStatus === 'dzx'"
|
||||
class="btn-op-item primary"
|
||||
size="small"
|
||||
@click="editor.handleStartStep(editor.selectedStep.value)"
|
||||
>
|
||||
<el-icon><VideoPlay /></el-icon>开始执行
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="editor.selectedStep.value.stepStatus === 'jxz'"
|
||||
class="btn-op-item"
|
||||
size="small"
|
||||
type="success"
|
||||
@click="editor.handleCompleteStep(editor.selectedStep.value)"
|
||||
>
|
||||
<el-icon><Check /></el-icon>完成步骤
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="route-config-right-body">
|
||||
<el-form label-position="top" class="route-config-step-form">
|
||||
<div class="form-grid-2">
|
||||
@@ -70,6 +94,11 @@
|
||||
<el-input v-model="row.standardUsage" placeholder="用量" class="inner-cell-input" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="editor.mode.value === 'execution'" label="实际用量" min-width="110" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.actualUsage" placeholder="实际用量" class="inner-cell-input" @change="editor.saveReagents" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位" min-width="120" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-select v-model="row.unit" placeholder="请选择单位" clearable filterable remote
|
||||
@@ -133,6 +162,11 @@
|
||||
<el-input v-model="row.standardUsage" placeholder="用量" class="inner-cell-input" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="editor.mode.value === 'execution'" label="实际用量" min-width="110" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.actualUsage" placeholder="实际用量" class="inner-cell-input" @change="editor.saveConsumables" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位" min-width="120" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-select v-model="row.unit" placeholder="请选择单位" clearable filterable remote
|
||||
@@ -231,6 +265,11 @@
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="editor.mode.value === 'execution'" label="采集值" min-width="140" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.collectionValue" placeholder="输入采集值" class="inner-cell-input" @change="editor.saveDataCollections" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" min-width="120" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.remark" placeholder="备注" class="inner-cell-input"
|
||||
@@ -264,7 +303,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Check, Plus, Rank } from '@element-plus/icons-vue'
|
||||
import { Check, Plus, Rank, VideoPlay } from '@element-plus/icons-vue'
|
||||
import { useTaskStepEditor } from './useTaskStepEditor'
|
||||
|
||||
defineProps<{
|
||||
@@ -274,4 +313,11 @@
|
||||
|
||||
<style scoped lang="scss">
|
||||
@use '../../../styles/route-config' as *;
|
||||
|
||||
.step-status-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-left: 12px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,335 @@
|
||||
<!-- 生产任务执行弹窗 -->
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
:title="`任务执行 — ${taskName}`"
|
||||
width="96vw"
|
||||
class="dialog-form-layout execution-dialog"
|
||||
align-center
|
||||
destroy-on-close
|
||||
:close-on-click-modal="false"
|
||||
@close="handleClose"
|
||||
>
|
||||
<!-- 顶部:任务基本信息一行展示 -->
|
||||
<div v-if="editor.taskDetail.value" class="execution-header">
|
||||
<div class="execution-header-row">
|
||||
<span class="execution-header-item">任务号:<b>{{ editor.taskDetail.value.taskNo }}</b></span>
|
||||
<span class="execution-header-item">工单号:{{ editor.taskDetail.value.workOrderNo || '—' }}</span>
|
||||
<span class="execution-header-item">任务名称:{{ editor.taskDetail.value.taskName || '—' }}</span>
|
||||
<el-tag :type="editor.taskStatusTag(editor.taskDetail.value.taskStatus).type">
|
||||
{{ editor.taskStatusTag(editor.taskDetail.value.taskStatus).label }}
|
||||
</el-tag>
|
||||
<div class="execution-header-actions">
|
||||
<el-button
|
||||
v-if="editor.taskDetail.value.taskStatus === 'dpz'"
|
||||
class="btn-main"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="editor.handleStartTask"
|
||||
>
|
||||
<el-icon><VideoPlay /></el-icon>开始执行
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="editor.taskDetail.value.taskStatus === 'jxz'"
|
||||
class="btn-main"
|
||||
type="success"
|
||||
size="small"
|
||||
@click="editor.handleCompleteTask"
|
||||
>
|
||||
<el-icon><Check /></el-icon>完成任务
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="editor.taskDetail.value.remark" class="execution-header-remark">{{ editor.taskDetail.value.remark }}</div>
|
||||
</div>
|
||||
|
||||
<!-- 四栏布局:工艺库 + 任务I/O(上下叠放) + 步骤列表 + 步骤详情 -->
|
||||
<div class="route-config-body execution-route-config-body">
|
||||
<!-- 最左侧:任务输入/输出上下叠放 -->
|
||||
<div class="execution-io-column">
|
||||
<!-- 任务输入 -->
|
||||
<div class="execution-io-block">
|
||||
<div class="execution-io-header">
|
||||
<h4><span class="section-bar"></span>任务输入</h4>
|
||||
<div class="execution-io-actions">
|
||||
<el-button class="btn-main" type="primary" size="small" @click="editor.addTaskInputRow"><el-icon><Plus /></el-icon>添加</el-button>
|
||||
<el-button class="btn-main" type="primary" size="small" :loading="editor.inputSaving.value" @click="editor.saveTaskInputs"><el-icon><Check /></el-icon>保存</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table :data="editor.taskInputs.value" stripe class="inner-table" max-height="200">
|
||||
<el-table-column type="index" label="序号" width="50" align="center" :index="(i: number) => i + 1" />
|
||||
<el-table-column label="输入类型" min-width="100" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-select v-model="row.inputType" placeholder="选择类型" class="inner-cell-select">
|
||||
<el-option label="样本" value="sample" />
|
||||
<el-option label="细胞产品" value="cell_product" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="输入编码" min-width="110" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.inputCode" placeholder="输入编码" class="inner-cell-input" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="输入名称" min-width="110" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.inputName" placeholder="输入名称" class="inner-cell-input" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="60" align="center">
|
||||
<template #default="{ $index }">
|
||||
<el-button link type="danger" size="small" @click="editor.removeTaskInputRow($index)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-empty v-if="!editor.taskInputs.value.length" description="暂无输入项" :image-size="28" />
|
||||
</div>
|
||||
|
||||
<!-- 任务输出 -->
|
||||
<div class="execution-io-block">
|
||||
<div class="execution-io-header">
|
||||
<h4><span class="section-bar"></span>任务输出</h4>
|
||||
<div class="execution-io-actions">
|
||||
<el-button class="btn-main" type="primary" size="small" @click="editor.addTaskOutputRow"><el-icon><Plus /></el-icon>添加</el-button>
|
||||
<el-button class="btn-main" type="primary" size="small" :loading="editor.outputSaving.value" @click="editor.saveTaskOutputs"><el-icon><Check /></el-icon>保存</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table :data="editor.taskOutputs.value" stripe class="inner-table" max-height="200">
|
||||
<el-table-column type="index" label="序号" width="50" align="center" :index="(i: number) => i + 1" />
|
||||
<el-table-column label="输出名称" min-width="100" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.outputName" placeholder="输出名称" class="inner-cell-input" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="输出条码" min-width="100" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.outputBarcode" placeholder="扫码或输入" class="inner-cell-input" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" min-width="80" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-input-number v-model="row.quantity" :min="0" :precision="2" controls-position="right" style="width: 100%" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位" min-width="70" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-input v-model="row.unit" placeholder="单位" class="inner-cell-input" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="60" align="center">
|
||||
<template #default="{ $index }">
|
||||
<el-button link type="danger" size="small" @click="editor.removeTaskOutputRow($index)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-empty v-if="!editor.taskOutputs.value.length" description="暂无输出项" :image-size="28" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 工艺库 -->
|
||||
<div class="route-config-left">
|
||||
<div class="route-config-left-header">
|
||||
<h3>工艺库</h3>
|
||||
<el-input v-model="editor.processSearchKeyword.value" placeholder="搜索工序" clearable size="small" class="route-config-search" />
|
||||
</div>
|
||||
<el-collapse v-model="editor.expandedCategories.value" class="route-config-collapse">
|
||||
<el-collapse-item v-for="cat in editor.filteredProcessLibrary.value" :key="cat.categoryId" :name="cat.categoryId">
|
||||
<template #title>
|
||||
<span class="route-config-cat-bar"></span>
|
||||
<span>{{ cat.categoryName }}</span>
|
||||
</template>
|
||||
<div v-for="(proc, procIndex) in cat.processes" :key="proc.id" class="route-config-process-card" draggable="true" @dragstart="editor.onDragStart($event, proc)">
|
||||
<div class="route-config-process-info">
|
||||
<div class="route-config-process-name">
|
||||
<span class="route-config-process-seq">{{ procIndex + 1 }}</span>{{ proc.processName }}
|
||||
</div>
|
||||
<div class="route-config-process-code">{{ proc.processCode }}</div>
|
||||
</div>
|
||||
<el-icon class="route-config-process-drag"><Rank /></el-icon>
|
||||
</div>
|
||||
<el-empty v-if="!cat.processes.length" description="该分类暂无工序" :image-size="32" />
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
<el-empty v-if="!editor.filteredProcessLibrary.value.length" description="暂无工艺数据" :image-size="48" />
|
||||
</div>
|
||||
|
||||
<!-- 中间:步骤列表 -->
|
||||
<div class="route-config-center" v-loading="editor.stepListLoading.value" @dragover.prevent @drop="editor.onDropToCenter">
|
||||
<div class="route-config-center-header">
|
||||
<h3>工序步骤</h3>
|
||||
<span class="route-config-step-count">共 {{ editor.stepList.value.length }} 步</span>
|
||||
</div>
|
||||
<div class="route-config-center-dropzone">
|
||||
<draggable v-model="editor.stepList.value" handle=".route-config-step-handle" :animation="200" @end="editor.onStepDragEnd">
|
||||
<div v-for="(element, index) in editor.stepList.value" :key="element.id" class="route-config-step-card" :class="{ 'is-active': editor.selectedStepId.value === element.id }" @click="editor.selectStep(element)">
|
||||
<div class="route-config-step-handle"><el-icon><Rank /></el-icon></div>
|
||||
<div class="route-config-step-order">{{ index + 1 }}</div>
|
||||
<div class="route-config-step-info">
|
||||
<div class="route-config-step-name">{{ element.processName || '未命名步骤' }}</div>
|
||||
<div class="route-config-step-desc">{{ element.description || '' }}</div>
|
||||
</div>
|
||||
<el-tag v-if="element.stepStatus" :type="editor.stepStatusTag(element.stepStatus).type" size="small" style="margin-right:4px">{{ editor.stepStatusTag(element.stepStatus).label }}</el-tag>
|
||||
<el-button link type="primary" size="small" title="复制步骤" @click.stop="editor.handleCopyStep(element)">
|
||||
<el-icon><CopyDocument /></el-icon>
|
||||
</el-button>
|
||||
<el-button link type="danger" size="small" @click.stop="editor.handleDeleteStep(element)">
|
||||
<el-icon><Delete /></el-icon>
|
||||
</el-button>
|
||||
</div>
|
||||
</draggable>
|
||||
<div v-if="!editor.stepList.value.length" class="route-config-center-empty">
|
||||
<el-icon :size="32" color="#a7f3d0"><Plus /></el-icon>
|
||||
<p>从左侧拖拽工序到此处,添加任务步骤</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 右侧:步骤详情 -->
|
||||
<StepDetailPanel :editor="editor" />
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Rank, Plus, Check, VideoPlay, CopyDocument, Delete } from '@element-plus/icons-vue'
|
||||
import { VueDraggable as draggable } from 'vue-draggable-plus'
|
||||
import { useTaskStepEditor } from './useTaskStepEditor'
|
||||
import StepDetailPanel from './StepDetailPanel.vue'
|
||||
|
||||
const props = defineProps<{
|
||||
visible: boolean
|
||||
taskId: string
|
||||
taskName: string
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:visible', val: boolean): void
|
||||
(e: 'success'): void
|
||||
}>()
|
||||
|
||||
const dialogVisible = computed({
|
||||
get: () => props.visible,
|
||||
set: (val) => emit('update:visible', val)
|
||||
})
|
||||
|
||||
const editor = useTaskStepEditor()
|
||||
|
||||
function handleClose() {
|
||||
dialogVisible.value = false
|
||||
emit('success')
|
||||
}
|
||||
|
||||
watch(() => props.visible, async (val) => {
|
||||
if (val && props.taskId) {
|
||||
await editor.initEditor(props.taskId, { mode: 'execution' })
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@use '../../../styles/route-config' as *;
|
||||
|
||||
.execution-dialog {
|
||||
:deep(.el-dialog) {
|
||||
margin: 2vh auto !important;
|
||||
}
|
||||
:deep(.el-dialog__body) {
|
||||
max-height: calc(96vh - 54px);
|
||||
overflow-y: auto;
|
||||
padding: 12px 16px;
|
||||
}
|
||||
}
|
||||
|
||||
/* 顶部信息一行展示,极致压缩 */
|
||||
.execution-header {
|
||||
padding: 6px 16px;
|
||||
background: #f0fdf4;
|
||||
border-radius: 6px;
|
||||
margin-bottom: 8px;
|
||||
border: 1px solid #d1fae5;
|
||||
}
|
||||
|
||||
.execution-header-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
font-size: 13px;
|
||||
color: #475569;
|
||||
|
||||
b { color: #1e293b; }
|
||||
}
|
||||
|
||||
.execution-header-item {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.execution-header-actions {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.execution-header-remark {
|
||||
margin-top: 4px;
|
||||
font-size: 12px;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
/* 工艺库右侧 I/O 列 */
|
||||
.execution-io-column {
|
||||
width: 320px;
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.execution-io-block {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border: 1px solid #e5e7eb;
|
||||
border-radius: 8px;
|
||||
padding: 8px;
|
||||
overflow: hidden;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.execution-io-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 6px;
|
||||
flex-shrink: 0;
|
||||
|
||||
h4 {
|
||||
margin: 0;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: #1e293b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.execution-io-actions {
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.section-bar {
|
||||
display: inline-block;
|
||||
width: 3px;
|
||||
height: 14px;
|
||||
background: #10b981;
|
||||
border-radius: 2px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.execution-route-config-body {
|
||||
height: calc(96vh - 110px);
|
||||
min-height: 400px;
|
||||
}
|
||||
</style>
|
||||
@@ -8,7 +8,10 @@ import {
|
||||
fetchReplaceStepReagents,
|
||||
fetchReplaceStepConsumables,
|
||||
fetchReplaceStepDataCollection,
|
||||
fetchReplaceStepOutputs
|
||||
fetchReplaceStepOutputs,
|
||||
fetchUpdateProductionTaskStatus,
|
||||
fetchSetTaskInputs,
|
||||
fetchSetTaskOutputs
|
||||
} from '@/api/production-task'
|
||||
import {
|
||||
fetchAllProcesses,
|
||||
@@ -59,6 +62,14 @@ export function useTaskStepEditor() {
|
||||
const processSearchKeyword = ref('')
|
||||
const configSuppressSave = ref(false)
|
||||
|
||||
// ── execution-mode state ────────────────────────────────────────────
|
||||
const mode = ref<'edit' | 'execution'>('edit')
|
||||
const taskDetail = ref<Record<string, any> | null>(null)
|
||||
const taskInputs = ref<Record<string, any>[]>([])
|
||||
const taskOutputs = ref<Record<string, any>[]>([])
|
||||
const inputSaving = ref(false)
|
||||
const outputSaving = ref(false)
|
||||
|
||||
const processLibrary = ref<Record<string, any>[]>([])
|
||||
const expandedCategories = ref<string[]>([])
|
||||
const categoryOptions = ref<Record<string, any>[]>([])
|
||||
@@ -341,16 +352,22 @@ export function useTaskStepEditor() {
|
||||
processLibrary.value = Object.values(catMap)
|
||||
await Promise.all([searchItemUnitOptions(''), searchReagentOptions(''), searchConsumableOptions('')])
|
||||
}
|
||||
async function loadTaskDetail() {
|
||||
if (!taskId.value) return
|
||||
async function loadTaskDetail(overrideId?: string) {
|
||||
const id = overrideId || taskId.value
|
||||
if (!id) return
|
||||
try {
|
||||
const detail = await fetchProductionTaskDetail(taskId.value)
|
||||
const detail = await fetchProductionTaskDetail(id)
|
||||
stepList.value = (detail.steps || []).map(normalizeStepSubTables)
|
||||
ensureAllStepReagentOptions()
|
||||
ensureAllStepConsumableOptions()
|
||||
ensureAllStepUnitOptions()
|
||||
if (stepList.value.length > 0 && !selectedStepId.value)
|
||||
selectedStepId.value = stepList.value[0].id
|
||||
if (mode.value === 'execution') {
|
||||
taskDetail.value = detail
|
||||
taskInputs.value = (detail.inputs || []).map((i: Record<string, any>) => ({ ...i }))
|
||||
taskOutputs.value = (detail.outputs || []).map((o: Record<string, any>) => ({ ...o }))
|
||||
}
|
||||
} catch {
|
||||
stepList.value = []
|
||||
}
|
||||
@@ -365,7 +382,7 @@ export function useTaskStepEditor() {
|
||||
if (!processId || !taskId.value) return
|
||||
stepListLoading.value = true
|
||||
try {
|
||||
const newStep = await fetchAddTaskStep(taskId.value, { processId })
|
||||
const newStep = await fetchAddTaskStep(taskId.value, { process_id: processId })
|
||||
await loadTaskDetail()
|
||||
if (newStep?.id) selectedStepId.value = newStep.id
|
||||
ElMessage.success('步骤添加成功')
|
||||
@@ -524,7 +541,82 @@ export function useTaskStepEditor() {
|
||||
}
|
||||
}
|
||||
|
||||
async function initEditor(id: string) {
|
||||
async function handleStartStep(step: Record<string, any>) {
|
||||
if (!taskId.value || !step.id) return
|
||||
await fetchUpdateTaskStep(taskId.value, step.id, { step_status: 'jxz' })
|
||||
ElMessage.success('步骤已开始执行')
|
||||
await loadTaskDetail()
|
||||
}
|
||||
|
||||
async function handleCompleteStep(step: Record<string, any>) {
|
||||
if (!taskId.value || !step.id) return
|
||||
await ElMessageBox.confirm('确定完成该步骤吗?', '提示', { type: 'warning' })
|
||||
await fetchUpdateTaskStep(taskId.value, step.id, { step_status: 'ywc' })
|
||||
ElMessage.success('步骤已完成')
|
||||
await loadTaskDetail()
|
||||
}
|
||||
|
||||
async function handleStartTask() {
|
||||
if (!taskDetail.value?.id) return
|
||||
await ElMessageBox.confirm('确定开始执行该任务吗?', '提示', { type: 'warning' })
|
||||
await fetchUpdateProductionTaskStatus(taskDetail.value.id, { taskStatus: 'jxz' })
|
||||
ElMessage.success('任务已开始执行')
|
||||
await loadTaskDetail(taskDetail.value.id)
|
||||
}
|
||||
|
||||
async function handleCompleteTask() {
|
||||
if (!taskDetail.value?.id) return
|
||||
await ElMessageBox.confirm('确定完成该任务吗?完成后不可恢复。', '提示', { type: 'warning' })
|
||||
await fetchUpdateProductionTaskStatus(taskDetail.value.id, { taskStatus: 'ywc' })
|
||||
ElMessage.success('任务已完成')
|
||||
await loadTaskDetail(taskDetail.value.id)
|
||||
}
|
||||
|
||||
function addTaskInputRow() {
|
||||
taskInputs.value.push({ inputType: 'sample', inputCode: '', inputName: '' })
|
||||
}
|
||||
function removeTaskInputRow(i: number) { taskInputs.value.splice(i, 1) }
|
||||
async function saveTaskInputs() {
|
||||
if (!taskDetail.value?.id) return
|
||||
inputSaving.value = true
|
||||
try {
|
||||
await fetchSetTaskInputs(taskDetail.value.id, { items: taskInputs.value })
|
||||
ElMessage.success('输入已保存')
|
||||
} catch { /* global error handling */ } finally { inputSaving.value = false }
|
||||
}
|
||||
|
||||
function addTaskOutputRow() {
|
||||
taskOutputs.value.push({ cellProductId: '', storageSlotId: '', outputName: '', outputBarcode: '', quantity: 0, unit: '', remark: '' })
|
||||
}
|
||||
function removeTaskOutputRow(i: number) { taskOutputs.value.splice(i, 1) }
|
||||
async function saveTaskOutputs() {
|
||||
if (!taskDetail.value?.id) return
|
||||
outputSaving.value = true
|
||||
try {
|
||||
await fetchSetTaskOutputs(taskDetail.value.id, { items: taskOutputs.value })
|
||||
ElMessage.success('输出已保存')
|
||||
} catch { /* global error handling */ } finally { outputSaving.value = false }
|
||||
}
|
||||
|
||||
function taskStatusTag(status: string) {
|
||||
const map: Record<string, { label: string; type: string }> = {
|
||||
dpz: { label: '待配置', type: 'info' },
|
||||
jxz: { label: '进行中', type: 'warning' },
|
||||
ywc: { label: '已完成', type: 'success' }
|
||||
}
|
||||
return map[status] || { label: status, type: 'info' }
|
||||
}
|
||||
function stepStatusTag(status: string) {
|
||||
const map: Record<string, { label: string; type: string }> = {
|
||||
dzx: { label: '待执行', type: 'info' },
|
||||
jxz: { label: '进行中', type: 'warning' },
|
||||
ywc: { label: '已完成', type: 'success' }
|
||||
}
|
||||
return map[status] || { label: status, type: 'info' }
|
||||
}
|
||||
|
||||
async function initEditor(id: string, options?: { mode?: 'edit' | 'execution' }) {
|
||||
mode.value = options?.mode || 'edit'
|
||||
taskId.value = id
|
||||
selectedStepId.value = ''
|
||||
activeSubTab.value = 'reagent'
|
||||
@@ -542,6 +634,7 @@ export function useTaskStepEditor() {
|
||||
return {
|
||||
taskId, stepList, selectedStepId, selectedStep, stepListLoading,
|
||||
activeSubTab, processSearchKeyword, configSuppressSave,
|
||||
mode, taskDetail, taskInputs, taskOutputs, inputSaving, outputSaving,
|
||||
processLibrary, filteredProcessLibrary, expandedCategories,
|
||||
categoryOptions, sopOptions, outputTypeOptions,
|
||||
itemUnitOptions, itemUnitOptionsLoading,
|
||||
@@ -550,6 +643,11 @@ export function useTaskStepEditor() {
|
||||
sopIdsArr,
|
||||
onDragStart, onDropToCenter, onStepDragEnd, selectStep,
|
||||
handleCopyStep, handleDeleteStep,
|
||||
handleStartStep, handleCompleteStep,
|
||||
handleStartTask, handleCompleteTask,
|
||||
addTaskInputRow, removeTaskInputRow, saveTaskInputs,
|
||||
addTaskOutputRow, removeTaskOutputRow, saveTaskOutputs,
|
||||
taskStatusTag, stepStatusTag,
|
||||
saveStepBasic, onSopIdsChange,
|
||||
searchItemUnitOptions, searchReagentOptions, searchConsumableOptions,
|
||||
onReagentRowSelect, onConsumableRowSelect,
|
||||
|
||||
@@ -153,10 +153,6 @@
|
||||
>
|
||||
<DialogFormBody
|
||||
:loading="resultLoading"
|
||||
skeleton-variant="form"
|
||||
:skeleton-section-count="2"
|
||||
:skeleton-field-count="6"
|
||||
:skeleton-grid-columns="3"
|
||||
>
|
||||
<el-form label-position="top" class="biz-dialog-form">
|
||||
<div class="form-section">
|
||||
|
||||
@@ -12,9 +12,6 @@
|
||||
<DialogFormBody
|
||||
:loading="dialogFormLoading"
|
||||
body-class="protocol-dialog-body min-h-[200px]"
|
||||
skeleton-variant="tabs-form"
|
||||
:skeleton-tab-count="formTabs.length"
|
||||
:skeleton-section-count="4"
|
||||
>
|
||||
<div class="detail-tabs">
|
||||
<div
|
||||
|
||||
@@ -24,13 +24,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<DialogDetailSkeleton
|
||||
v-if="loading && !bundle"
|
||||
variant="tabs-detail"
|
||||
:tab-count="formTabs.length"
|
||||
/>
|
||||
|
||||
<template v-else-if="bundle">
|
||||
<template v-if="bundle">
|
||||
<div v-loading="loading && !bundle">
|
||||
<!-- KPI 摘要条 -->
|
||||
<div class="kpi-strip">
|
||||
<div class="kpi-card">
|
||||
@@ -547,6 +542,7 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
@@ -579,7 +575,6 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, nextTick, ref, watch } from 'vue'
|
||||
import { Calendar, CircleCheck, Close, Document, User } from '@element-plus/icons-vue'
|
||||
import DialogDetailSkeleton from '@/components/business/dialog-detail-skeleton/index.vue'
|
||||
import ProtocolAttachmentReadonly from '@/views/cell-storage/protocol/ProtocolAttachmentReadonly.vue'
|
||||
import SampleQcInfoCards from '@/components/business/sample-qc-info-cards/index.vue'
|
||||
import {
|
||||
|
||||
@@ -295,15 +295,7 @@
|
||||
class="order-module-dialog order-detail-dialog"
|
||||
modal-class="order-module-dialog-mask"
|
||||
>
|
||||
<div class="dialog-scroll order-detail-dialog-scroll" :class="{ 'is-view-loading': detailLoading }">
|
||||
<DialogDetailSkeleton
|
||||
v-if="detailLoading"
|
||||
variant="system-view"
|
||||
:section-count="4"
|
||||
:field-count="8"
|
||||
:grid-columns="3"
|
||||
/>
|
||||
<template v-else>
|
||||
<div class="dialog-scroll order-detail-dialog-scroll" v-loading="detailLoading">
|
||||
<div class="view-hero order-view-hero">
|
||||
<div class="order-view-hero-icon">
|
||||
<el-icon><ShoppingBag /></el-icon>
|
||||
@@ -818,7 +810,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button class="btn-ghost" @click="viewVisible = false"><el-icon><Close /></el-icon>关闭</el-button>
|
||||
@@ -839,15 +830,7 @@
|
||||
</el-dialog>
|
||||
|
||||
<div v-else v-show="viewVisible" class="order-embedded-detail">
|
||||
<div class="dialog-scroll order-detail-dialog-scroll" :class="{ 'is-view-loading': detailLoading }">
|
||||
<DialogDetailSkeleton
|
||||
v-if="detailLoading"
|
||||
variant="system-view"
|
||||
:section-count="4"
|
||||
:field-count="8"
|
||||
:grid-columns="3"
|
||||
/>
|
||||
<template v-else>
|
||||
<div class="dialog-scroll order-detail-dialog-scroll" v-loading="detailLoading">
|
||||
<div class="view-hero order-view-hero">
|
||||
<div class="order-view-hero-icon">
|
||||
<el-icon><ShoppingBag /></el-icon>
|
||||
@@ -1152,7 +1135,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1400,14 +1382,8 @@
|
||||
modal-class="order-module-dialog-mask"
|
||||
@opened="loadOrderPriceVersionDetail"
|
||||
>
|
||||
<div class="order-pv-body" :class="{ 'is-view-loading': orderPriceVersionLoading }">
|
||||
<DialogDetailSkeleton
|
||||
v-if="orderPriceVersionLoading"
|
||||
variant="system-view"
|
||||
:section-count="2"
|
||||
:field-count="6"
|
||||
/>
|
||||
<template v-else-if="orderPriceVersionDetail">
|
||||
<div class="order-pv-body" v-loading="orderPriceVersionLoading">
|
||||
<template v-if="orderPriceVersionDetail">
|
||||
<div class="view-hero order-pv-hero">
|
||||
<div class="order-view-hero-icon">
|
||||
<el-icon><Setting /></el-icon>
|
||||
@@ -1540,7 +1516,6 @@
|
||||
} from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import DialogDetailSkeleton from '@/components/business/dialog-detail-skeleton/index.vue'
|
||||
import { withFullscreenLoading, fullscreenLoadingText } from '@/utils/fullscreen-loading'
|
||||
import {
|
||||
ArrowDown,
|
||||
|
||||
@@ -168,9 +168,6 @@
|
||||
<DialogFormBody
|
||||
:loading="postBindLoading"
|
||||
body-class="post-bind-dialog-body"
|
||||
skeleton-variant="form"
|
||||
:skeleton-section-count="1"
|
||||
:skeleton-field-count="4"
|
||||
>
|
||||
<p v-if="postBindPostName" class="post-bind-subtitle">
|
||||
职位:<strong>{{ postBindPostName }}</strong>
|
||||
|
||||
@@ -197,7 +197,7 @@
|
||||
destroy-on-close
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<DialogFormBody :loading="menuDialogLoading" skeleton-variant="simple" :skeleton-section-count="1">
|
||||
<DialogFormBody :loading="menuDialogLoading">
|
||||
<!-- 父子关联勾选:选父级全选子级,选子级自动带上父级(与 check-strictly 互斥,故不加) -->
|
||||
<el-tree
|
||||
ref="menuTreeRef"
|
||||
@@ -363,9 +363,8 @@
|
||||
:sections="viewSections"
|
||||
>
|
||||
<template #menuTree>
|
||||
<div class="role-view-tree-block">
|
||||
<el-skeleton v-if="viewDetailLoading" animated :rows="5" class="role-view-tree-skeleton" />
|
||||
<div v-else-if="viewMenuTreeData.length" class="role-view-tree-scroll">
|
||||
<div class="role-view-tree-block" v-loading="viewDetailLoading">
|
||||
<div v-if="viewMenuTreeData.length" class="role-view-tree-scroll">
|
||||
<el-tree
|
||||
:key="'menu-' + viewTreeRenderKey"
|
||||
ref="viewMenuTreeRef"
|
||||
@@ -382,9 +381,8 @@
|
||||
</div>
|
||||
</template>
|
||||
<template #customDeptTree>
|
||||
<div class="role-view-tree-block">
|
||||
<el-skeleton v-if="viewDetailLoading" animated :rows="5" class="role-view-tree-skeleton" />
|
||||
<div v-else-if="viewDeptTreeData.length" class="role-view-tree-scroll">
|
||||
<div class="role-view-tree-block" v-loading="viewDetailLoading">
|
||||
<div v-if="viewDeptTreeData.length" class="role-view-tree-scroll">
|
||||
<el-tree
|
||||
:key="'dept-' + viewTreeRenderKey"
|
||||
ref="viewDeptTreeRef"
|
||||
|
||||
@@ -10,10 +10,7 @@
|
||||
:show-close="false"
|
||||
style="backdrop-filter: none"
|
||||
>
|
||||
<div v-if="bizLoading" class="dialog-scroll is-view-loading" style="min-height: 120px">
|
||||
<DialogDetailSkeleton variant="simple" :section-count="2" :field-count="4" />
|
||||
</div>
|
||||
<div v-else class="dialog-scroll">
|
||||
<div v-loading="bizLoading" class="dialog-scroll">
|
||||
<!-- Hero header -->
|
||||
<div class="view-hero">
|
||||
<div class="view-hero-icon">
|
||||
@@ -77,7 +74,6 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import DialogDetailSkeleton from '@/components/business/dialog-detail-skeleton/index.vue'
|
||||
import { fetchApproveTask, fetchRejectTask, fetchInstanceDetail } from '@/api/workflow'
|
||||
import { Checked, Close, Check } from '@element-plus/icons-vue'
|
||||
|
||||
|
||||
@@ -126,14 +126,8 @@
|
||||
:show-close="false"
|
||||
style="backdrop-filter: none"
|
||||
>
|
||||
<div class="dialog-scroll" :class="{ 'is-view-loading': detailLoading }">
|
||||
<DialogDetailSkeleton
|
||||
v-if="detailLoading"
|
||||
variant="system-view"
|
||||
:section-count="2"
|
||||
:field-count="6"
|
||||
/>
|
||||
<template v-else-if="detailData">
|
||||
<div class="dialog-scroll" v-loading="detailLoading">
|
||||
<template v-if="detailData">
|
||||
<div class="view-hero">
|
||||
<div class="view-hero-icon">
|
||||
<el-icon :size="28"><Document /></el-icon>
|
||||
@@ -200,7 +194,6 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import DialogDetailSkeleton from '@/components/business/dialog-detail-skeleton/index.vue'
|
||||
import { fetchMyInstances, fetchBusinessAllTasks } from '@/api/workflow'
|
||||
import ProcessStatusTag from '../components/ProcessStatusTag.vue'
|
||||
import { Document, View, Search, RefreshLeft, Close } from '@element-plus/icons-vue'
|
||||
|
||||
@@ -127,14 +127,8 @@
|
||||
:show-close="false"
|
||||
style="backdrop-filter: none"
|
||||
>
|
||||
<div class="dialog-scroll" :class="{ 'is-view-loading': detailLoading }">
|
||||
<DialogDetailSkeleton
|
||||
v-if="detailLoading"
|
||||
variant="system-view"
|
||||
:section-count="2"
|
||||
:field-count="6"
|
||||
/>
|
||||
<template v-else-if="detailData">
|
||||
<div class="dialog-scroll" v-loading="detailLoading">
|
||||
<template v-if="detailData">
|
||||
<div class="view-hero">
|
||||
<div class="view-hero-icon">
|
||||
<el-icon :size="28"><Document /></el-icon>
|
||||
@@ -203,7 +197,6 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import DialogDetailSkeleton from '@/components/business/dialog-detail-skeleton/index.vue'
|
||||
import { fetchCompletedTasks, fetchInstanceDetail } from '@/api/workflow'
|
||||
import ProcessStatusTag from '../components/ProcessStatusTag.vue'
|
||||
import { Document, View, Search, RefreshLeft, Close } from '@element-plus/icons-vue'
|
||||
|
||||
@@ -124,14 +124,8 @@
|
||||
:show-close="false"
|
||||
style="backdrop-filter: none"
|
||||
>
|
||||
<div class="dialog-scroll" :class="{ 'is-view-loading': detailLoading }">
|
||||
<DialogDetailSkeleton
|
||||
v-if="detailLoading"
|
||||
variant="system-view"
|
||||
:section-count="2"
|
||||
:field-count="6"
|
||||
/>
|
||||
<template v-else-if="detailData">
|
||||
<div class="dialog-scroll" v-loading="detailLoading">
|
||||
<template v-if="detailData">
|
||||
<div class="view-hero">
|
||||
<div class="view-hero-icon">
|
||||
<el-icon :size="28"><Document /></el-icon>
|
||||
@@ -200,7 +194,6 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import DialogDetailSkeleton from '@/components/business/dialog-detail-skeleton/index.vue'
|
||||
import { fetchPendingTasks, fetchInstanceDetail } from '@/api/workflow'
|
||||
import ApprovalDialog from '../components/ApprovalDialog.vue'
|
||||
import ProcessStatusTag from '../components/ProcessStatusTag.vue'
|
||||
|
||||
Reference in new issue
Block a user