提交
This commit is contained in:
1 parent
7cec1f2190
commit
13e4c9530a
85 files changed
+23079
-15736
No files matched your search
@@ -97,7 +97,7 @@
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" min-width="260" fixed="right" align="center" header-align="center">
|
||||
<el-table-column label="操作" min-width="360" fixed="right" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button class="btn-op-item primary" @click="handleView(row)">
|
||||
<el-icon><View /></el-icon>查看
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
<el-table-column prop="newbornInfo" label="新生儿信息" min-width="200" align="center" header-align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="sampleInfo" label="样本信息" min-width="200" align="center" header-align="center" show-overflow-tooltip />
|
||||
<el-table-column prop="storageInDate" label="入库日期" min-width="120" align="center" header-align="center">
|
||||
<template #default="{ row }">{{ row.storageInDate || '—' }}</template>
|
||||
<template #default="{ row }">{{ formatStorageInDate(row.storageInDate) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="makeStatus" label="制作状态" min-width="100" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
@@ -89,7 +89,9 @@
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="makeDate" label="制作日期" min-width="120" align="center" header-align="center" />
|
||||
<el-table-column prop="makeDate" label="制作日期" min-width="120" align="center" header-align="center">
|
||||
<template #default="{ row }">{{ formatStorageInDate(row.makeDate) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" min-width="260" fixed="right" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button class="btn-op-item primary" @click="handleUpload(row)">
|
||||
@@ -371,6 +373,16 @@
|
||||
return isStorageCertMakePendingRow(row) ? 'row-storage-cert-pending' : ''
|
||||
}
|
||||
|
||||
function formatStorageInDate(val: unknown) {
|
||||
const s = String(val || '').trim()
|
||||
if (!s) return '—'
|
||||
const digits = s.replace(/\D/g, '')
|
||||
if (digits.length >= 8) {
|
||||
return `${digits.slice(0, 4)}-${digits.slice(4, 6)}-${digits.slice(6, 8)}`
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// 数据加载
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" min-width="260" fixed="right" align="center" header-align="center">
|
||||
<el-table-column label="操作" min-width="360" fixed="right" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button class="btn-op-item primary" @click="handleView(row)">
|
||||
<el-icon><View /></el-icon>查看
|
||||
|
||||
@@ -91,15 +91,30 @@
|
||||
<el-tag :type="taskStatusTag(row.taskStatus).type" size="small">{{ taskStatusTag(row.taskStatus).label }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="conclusion" label="生产结论" min-width="100" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag
|
||||
v-if="productionConclusionTagType(row.conclusion)"
|
||||
:type="productionConclusionTagType(row.conclusion)"
|
||||
size="small"
|
||||
>
|
||||
{{ row.conclusionLabel || productionConclusionLabel(row.conclusion) }}
|
||||
</el-tag>
|
||||
<span v-else>—</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="startedTime" label="开始时间" min-width="170" align="center">
|
||||
<template #default="{ row }">{{ row.startedTime || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="completedTime" label="完成时间" min-width="170" align="center">
|
||||
<template #default="{ row }">{{ row.completedTime || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" min-width="320" fixed="right" align="center">
|
||||
<el-table-column label="操作" min-width="400" fixed="right" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button class="btn-op-item primary" @click="handleEnterExecution(row)"><el-icon><VideoPlay /></el-icon>进入执行</el-button>
|
||||
<el-button class="btn-op-item" @click="handleEditTask(row)">
|
||||
<el-icon><EditPen /></el-icon>编辑
|
||||
</el-button>
|
||||
<el-button class="btn-op-item" @click="handleViewDetail(row)"><el-icon><View /></el-icon>查看详情</el-button>
|
||||
<el-button v-if="row.taskStatus === 'dpz'" class="btn-op-item" @click="handleDelete(row)">删除</el-button>
|
||||
</template>
|
||||
@@ -190,13 +205,19 @@
|
||||
:work-order-row="addDispatchRow"
|
||||
@success="loadData"
|
||||
/>
|
||||
|
||||
<EditTaskInfoDialog
|
||||
v-model:visible="editTaskInfoVisible"
|
||||
:task-id="editTaskInfoId"
|
||||
@success="loadData"
|
||||
/>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { RefreshLeft, Search, VideoPlay, View, Plus, Close, Check } from '@element-plus/icons-vue'
|
||||
import { RefreshLeft, Search, VideoPlay, View, Plus, Close, Check, EditPen } from '@element-plus/icons-vue'
|
||||
import { fetchProductionTaskList, fetchDeleteProductionTask } from '@/api/production-task'
|
||||
import { fetchProductionWorkOrderList } from '@/api/production-work-order'
|
||||
import {
|
||||
@@ -208,6 +229,11 @@
|
||||
import type { TagType } from '@/utils/status-tag-registry'
|
||||
import TaskExecutionDialog from '../production-work-order/TaskExecutionDialog.vue'
|
||||
import DispatchTaskDialog from '../production-work-order/DispatchTaskDialog.vue'
|
||||
import EditTaskInfoDialog from '../production-work-order/EditTaskInfoDialog.vue'
|
||||
import {
|
||||
productionConclusionLabel,
|
||||
productionConclusionTagType
|
||||
} from '@/utils/production-labels'
|
||||
|
||||
/** 根据来源类型返回协议状态标签 */
|
||||
function protocolStatusLabelBySource(status: string, source: string): string {
|
||||
@@ -361,6 +387,14 @@
|
||||
executionDialogVisible.value = true
|
||||
}
|
||||
|
||||
const editTaskInfoVisible = ref(false)
|
||||
const editTaskInfoId = ref('')
|
||||
|
||||
function handleEditTask(row: Record<string, any>) {
|
||||
editTaskInfoId.value = row.id
|
||||
editTaskInfoVisible.value = true
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// 初始化(支持从工单页面跳转带 keyword 筛选)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
<!-- 完成任务 — 生产结论 -->
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
:title="isCompletedEdit ? '修改生产结论' : '完成任务'"
|
||||
width="520px"
|
||||
class="dialog-form-layout"
|
||||
align-center
|
||||
destroy-on-close
|
||||
:close-on-click-modal="false"
|
||||
:append-to-body="true"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-position="top" class="biz-dialog-form">
|
||||
<el-form-item label="生产结论" prop="conclusion">
|
||||
<el-radio-group v-model="form.conclusion">
|
||||
<el-radio value="cg">成功</el-radio>
|
||||
<el-radio value="sb">失败</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="选填"
|
||||
maxlength="512"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button class="btn-ghost" @click="handleClose"><el-icon><Close /></el-icon>取消</el-button>
|
||||
<el-button class="btn-main" type="primary" :loading="submitting" @click="handleSubmit">
|
||||
<el-icon><Check /></el-icon>{{ isCompletedEdit ? '保存' : '确认完成' }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, watch } from 'vue'
|
||||
import { Close, Check } from '@element-plus/icons-vue'
|
||||
import type { FormInstance, FormRules } from 'element-plus'
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
visible: boolean
|
||||
submitting?: boolean
|
||||
isCompletedEdit?: boolean
|
||||
initialConclusion?: string
|
||||
initialRemark?: string
|
||||
}>(),
|
||||
{
|
||||
isCompletedEdit: false,
|
||||
initialConclusion: '',
|
||||
initialRemark: ''
|
||||
}
|
||||
)
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:visible', val: boolean): void
|
||||
(e: 'submit', payload: { conclusion: string; remark?: string }): void
|
||||
}>()
|
||||
|
||||
const dialogVisible = computed({
|
||||
get: () => props.visible,
|
||||
set: (val) => emit('update:visible', val)
|
||||
})
|
||||
|
||||
const formRef = ref<FormInstance>()
|
||||
const form = reactive({ conclusion: '', remark: '' })
|
||||
const rules: FormRules = {
|
||||
conclusion: [{ required: true, message: '请选择生产结论', trigger: 'change' }]
|
||||
}
|
||||
|
||||
function handleClose() {
|
||||
dialogVisible.value = false
|
||||
}
|
||||
|
||||
async function handleSubmit() {
|
||||
if (!formRef.value) return
|
||||
await formRef.value.validate()
|
||||
emit('submit', {
|
||||
conclusion: form.conclusion,
|
||||
remark: form.remark.trim() || undefined
|
||||
})
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(val) => {
|
||||
if (val) {
|
||||
form.conclusion = props.initialConclusion || ''
|
||||
form.remark = props.initialRemark || ''
|
||||
formRef.value?.clearValidate()
|
||||
}
|
||||
}
|
||||
)
|
||||
</script>
|
||||
@@ -1,4 +1,5 @@
|
||||
<template>
|
||||
<div class="task-execution-dialog-root">
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
:title="readonly ? `任务详情 — ${taskName}` : `任务执行 — ${taskName}`"
|
||||
@@ -25,6 +26,17 @@
|
||||
<el-tag :type="editor.taskStatusTag(editor.taskDetail.value.taskStatus).type">
|
||||
{{ editor.taskStatusTag(editor.taskDetail.value.taskStatus).label }}
|
||||
</el-tag>
|
||||
<span class="execution-header-item execution-header-conclusion">
|
||||
生产结论:
|
||||
<el-tag
|
||||
v-if="productionConclusionTagType(executionTaskConclusion)"
|
||||
:type="productionConclusionTagType(executionTaskConclusion)"
|
||||
size="small"
|
||||
>
|
||||
{{ productionConclusionLabel(executionTaskConclusion) }}
|
||||
</el-tag>
|
||||
<template v-else>—</template>
|
||||
</span>
|
||||
<div v-if="!readonly" class="execution-header-actions">
|
||||
<el-button
|
||||
v-if="editor.taskDetail.value.taskStatus === 'dpz'"
|
||||
@@ -37,7 +49,7 @@
|
||||
<el-icon><VideoPlay /></el-icon>开始执行
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="editor.taskDetail.value.taskStatus === 'jxz'"
|
||||
v-if="editor.taskDetail.value.taskStatus === 'jxz' || editor.taskDetail.value.taskStatus === 'ywc'"
|
||||
class="btn-main"
|
||||
type="success"
|
||||
size="small"
|
||||
@@ -303,6 +315,16 @@
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<CompleteProductionTaskDialog
|
||||
v-model:visible="completeConclusionVisible"
|
||||
:submitting="taskActionLoading"
|
||||
:is-completed-edit="completeConclusionIsEdit"
|
||||
:initial-conclusion="completeConclusionInitial.conclusion"
|
||||
:initial-remark="completeConclusionInitial.remark"
|
||||
@submit="submitCompleteWithConclusion"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -312,6 +334,11 @@
|
||||
import StepDetailPanel from './StepDetailPanel.vue'
|
||||
import TaskInputEnhancedTable from './TaskInputEnhancedTable.vue'
|
||||
import TaskOutputList from './TaskOutputList.vue'
|
||||
import CompleteProductionTaskDialog from './CompleteProductionTaskDialog.vue'
|
||||
import {
|
||||
productionConclusionLabel,
|
||||
productionConclusionTagType
|
||||
} from '@/utils/production-labels'
|
||||
|
||||
const props = defineProps<{
|
||||
visible: boolean
|
||||
@@ -333,6 +360,19 @@
|
||||
})
|
||||
|
||||
const editor = useTaskStepEditor()
|
||||
/** 顶层解构 Ref,避免 v-model 收到 Ref 对象被当成 truthy 而误开弹窗 */
|
||||
const {
|
||||
completeConclusionVisible,
|
||||
completeConclusionIsEdit,
|
||||
completeConclusionInitial,
|
||||
taskActionLoading,
|
||||
submitCompleteWithConclusion,
|
||||
taskDetail
|
||||
} = editor
|
||||
|
||||
const executionTaskConclusion = computed(
|
||||
() => (taskDetail.value as { conclusion?: string } | null)?.conclusion || ''
|
||||
)
|
||||
|
||||
function handleClose() {
|
||||
dialogVisible.value = false
|
||||
@@ -348,7 +388,11 @@
|
||||
watch(
|
||||
() => props.visible,
|
||||
async (val) => {
|
||||
if (val && props.taskId) {
|
||||
if (!val) {
|
||||
completeConclusionVisible.value = false
|
||||
return
|
||||
}
|
||||
if (props.taskId) {
|
||||
await editor.initEditor(props.taskId, { mode: 'execution' })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
<el-table-column prop="createTime" label="创建时间" min-width="170" align="center" />
|
||||
<el-table-column
|
||||
label="操作"
|
||||
min-width="540"
|
||||
min-width="600"
|
||||
fixed="right"
|
||||
align="center"
|
||||
header-align="center"
|
||||
@@ -141,6 +141,9 @@
|
||||
<el-button class="btn-op-item" @click="handleView(row)"
|
||||
><el-icon><View /></el-icon>查看详情</el-button
|
||||
>
|
||||
<el-button class="btn-op-item" @click="handleEditRemark(row)">
|
||||
<el-icon><EditPen /></el-icon>编辑
|
||||
</el-button>
|
||||
<el-button class="btn-op-item" @click="handleEditTask(row)"
|
||||
><el-icon><EditPen /></el-icon>编辑任务</el-button
|
||||
>
|
||||
@@ -249,6 +252,18 @@
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="conclusion" label="生产结论" min-width="100" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag
|
||||
v-if="productionConclusionTagType(row.conclusion)"
|
||||
:type="productionConclusionTagType(row.conclusion)"
|
||||
size="small"
|
||||
>
|
||||
{{ row.conclusionLabel || productionConclusionLabel(row.conclusion) }}
|
||||
</el-tag>
|
||||
<span v-else>—</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" min-width="140">
|
||||
<template #default="{ row }">{{ row.remark || '—' }}</template>
|
||||
</el-table-column>
|
||||
@@ -320,6 +335,14 @@
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<WorkOrderRemarkDialog
|
||||
v-model:visible="remarkEditVisible"
|
||||
:title="remarkEditTitle"
|
||||
:initial-remark="remarkEditInitialRemark"
|
||||
:submitting="remarkEditLoading"
|
||||
@submit="submitRemarkEdit"
|
||||
/>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
@@ -344,6 +367,7 @@
|
||||
fetchProductionWorkOrderDetail,
|
||||
fetchCompleteProductionWorkOrder,
|
||||
fetchCreateProductionWorkOrder,
|
||||
fetchUpdateProductionWorkOrder,
|
||||
fetchDeleteProductionWorkOrder,
|
||||
type ProductionWorkOrderDetail
|
||||
} from '@/api/production-work-order'
|
||||
@@ -381,6 +405,11 @@
|
||||
import { downloadAttachmentFile } from '@/utils/download-attachment'
|
||||
import DispatchTaskDialog from './DispatchTaskDialog.vue'
|
||||
import EditTaskInfoDialog from './EditTaskInfoDialog.vue'
|
||||
import WorkOrderRemarkDialog from '@/components/business/work-order-remark-dialog/index.vue'
|
||||
import {
|
||||
productionConclusionLabel,
|
||||
productionConclusionTagType
|
||||
} from '@/utils/production-labels'
|
||||
import {
|
||||
fetchProductionTaskList,
|
||||
fetchDeleteProductionTask
|
||||
@@ -440,6 +469,32 @@
|
||||
}
|
||||
}
|
||||
|
||||
const remarkEditVisible = ref(false)
|
||||
const remarkEditLoading = ref(false)
|
||||
const remarkEditRow = ref<{ id: string; workOrderNo?: string; remark?: string } | null>(null)
|
||||
const remarkEditTitle = computed(
|
||||
() => `编辑备注${remarkEditRow.value?.workOrderNo ? ` — ${remarkEditRow.value.workOrderNo}` : ''}`
|
||||
)
|
||||
const remarkEditInitialRemark = computed(() => remarkEditRow.value?.remark || '')
|
||||
|
||||
function handleEditRemark(row: { id: string; workOrderNo?: string; remark?: string }) {
|
||||
remarkEditRow.value = row
|
||||
remarkEditVisible.value = true
|
||||
}
|
||||
|
||||
async function submitRemarkEdit(remark: string) {
|
||||
if (!remarkEditRow.value?.id) return
|
||||
remarkEditLoading.value = true
|
||||
try {
|
||||
await fetchUpdateProductionWorkOrder(remarkEditRow.value.id, { remark })
|
||||
ElMessage.success('保存成功')
|
||||
remarkEditVisible.value = false
|
||||
loadData()
|
||||
} finally {
|
||||
remarkEditLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const woStatusTag = (status: string) => {
|
||||
const map: Record<string, { label: string; type: string }> = {
|
||||
dpz: { label: '待配置', type: 'info' },
|
||||
|
||||
@@ -938,22 +938,38 @@ export function useTaskStepEditor() {
|
||||
return null
|
||||
}
|
||||
|
||||
const completeConclusionVisible = ref(false)
|
||||
const completeConclusionIsEdit = ref(false)
|
||||
const completeConclusionInitial = reactive({ conclusion: '', remark: '' })
|
||||
|
||||
async function handleCompleteTask() {
|
||||
if (!taskDetail.value?.id || taskActionLoading.value) return
|
||||
const ioErr = validateTaskIoRequired()
|
||||
if (ioErr) {
|
||||
await ElMessageBox.alert(ioErr, '无法完成任务', { type: 'warning' })
|
||||
return
|
||||
}
|
||||
try {
|
||||
await ElMessageBox.confirm('确定完成该任务吗?完成后不可恢复。', '提示', { type: 'warning' })
|
||||
} catch {
|
||||
return
|
||||
const isCompleted = taskDetail.value.taskStatus === 'ywc'
|
||||
completeConclusionIsEdit.value = isCompleted
|
||||
completeConclusionInitial.conclusion = (taskDetail.value as { conclusion?: string }).conclusion || ''
|
||||
completeConclusionInitial.remark = taskDetail.value.remark || ''
|
||||
if (!isCompleted) {
|
||||
const ioErr = validateTaskIoRequired()
|
||||
if (ioErr) {
|
||||
await ElMessageBox.alert(ioErr, '无法完成任务', { type: 'warning' })
|
||||
return
|
||||
}
|
||||
}
|
||||
completeConclusionVisible.value = true
|
||||
}
|
||||
|
||||
async function submitCompleteWithConclusion(payload: { conclusion: string; remark?: string }) {
|
||||
if (!taskDetail.value?.id || taskActionLoading.value) return
|
||||
const isCompleted = taskDetail.value.taskStatus === 'ywc'
|
||||
taskActionLoading.value = true
|
||||
try {
|
||||
await fetchUpdateProductionTaskStatus(taskDetail.value.id, { taskStatus: 'ywc' })
|
||||
ElMessage.success('任务已完成')
|
||||
await fetchUpdateProductionTaskStatus(taskDetail.value.id, {
|
||||
taskStatus: 'ywc',
|
||||
conclusion: payload.conclusion,
|
||||
remark: payload.remark
|
||||
})
|
||||
ElMessage.success(isCompleted ? '结论与备注已更新' : '任务已完成')
|
||||
completeConclusionVisible.value = false
|
||||
await loadTaskDetail(taskDetail.value.id)
|
||||
} catch {
|
||||
/* global error handling */
|
||||
@@ -1118,6 +1134,11 @@ export function useTaskStepEditor() {
|
||||
handleCompleteStep,
|
||||
handleStartTask,
|
||||
handleCompleteTask,
|
||||
completeConclusionVisible,
|
||||
completeConclusionIsEdit,
|
||||
completeConclusionInitial,
|
||||
submitCompleteWithConclusion,
|
||||
taskActionLoading,
|
||||
addTaskInputRow,
|
||||
removeTaskInputRow,
|
||||
saveTaskInputs,
|
||||
@@ -1149,7 +1170,6 @@ export function useTaskStepEditor() {
|
||||
saveDataCollections,
|
||||
manualSaveLoading,
|
||||
stepActionLoading,
|
||||
taskActionLoading,
|
||||
handleManualSave,
|
||||
initEditor
|
||||
}
|
||||
|
||||
@@ -136,16 +136,23 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="创建时间" min-width="170" align="center" />
|
||||
<el-table-column label="操作" :min-width="activeTypeTab === 'temporary' ? 380 : 320" fixed="right" align="center">
|
||||
<el-table-column label="操作" min-width="380" fixed="right" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button class="btn-op-item" @click="handleView(row)"><el-icon><View /></el-icon>查看</el-button>
|
||||
<el-button
|
||||
v-if="activeTypeTab === 'temporary'"
|
||||
v-if="activeTypeTab === 'temporary' || (activeTypeTab === 'all' && row.workOrderType === 'temporary')"
|
||||
class="btn-op-item"
|
||||
@click="handleEdit(row)"
|
||||
>
|
||||
<el-icon><EditPen /></el-icon>编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="activeTypeTab === 'inbound' || (activeTypeTab === 'all' && row.workOrderType !== 'temporary')"
|
||||
class="btn-op-item"
|
||||
@click="handleEditRemark(row)"
|
||||
>
|
||||
<el-icon><EditPen /></el-icon>编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="row.workOrderStatus === 'dpz' || row.workOrderStatus === 'ypz'"
|
||||
class="btn-op-item primary"
|
||||
@@ -316,6 +323,14 @@
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<WorkOrderRemarkDialog
|
||||
v-model:visible="remarkEditVisible"
|
||||
:title="remarkEditTitle"
|
||||
:initial-remark="remarkEditInitialRemark"
|
||||
:submitting="remarkEditLoading"
|
||||
@submit="submitRemarkEdit"
|
||||
/>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
@@ -376,6 +391,7 @@
|
||||
import SystemViewDialog from '@/components/business/system-view-dialog/index.vue'
|
||||
import type { ViewField, ViewSection } from '@/components/business/system-view-dialog/index.vue'
|
||||
import { downloadAttachmentFile } from '@/utils/download-attachment'
|
||||
import WorkOrderRemarkDialog from '@/components/business/work-order-remark-dialog/index.vue'
|
||||
|
||||
defineOptions({ name: 'QualityInspectionQcWorkOrder' })
|
||||
|
||||
@@ -500,6 +516,32 @@
|
||||
addVisible.value = true
|
||||
}
|
||||
|
||||
const remarkEditVisible = ref(false)
|
||||
const remarkEditLoading = ref(false)
|
||||
const remarkEditRow = ref<QcWorkOrder | null>(null)
|
||||
const remarkEditTitle = computed(
|
||||
() => `编辑备注${remarkEditRow.value?.workOrderNo ? ` — ${remarkEditRow.value.workOrderNo}` : ''}`
|
||||
)
|
||||
const remarkEditInitialRemark = computed(() => remarkEditRow.value?.remark || '')
|
||||
|
||||
function handleEditRemark(row: QcWorkOrder) {
|
||||
remarkEditRow.value = row
|
||||
remarkEditVisible.value = true
|
||||
}
|
||||
|
||||
async function submitRemarkEdit(remark: string) {
|
||||
if (!remarkEditRow.value?.id) return
|
||||
remarkEditLoading.value = true
|
||||
try {
|
||||
await fetchUpdateQcWorkOrder(remarkEditRow.value.id, { remark })
|
||||
ElMessage.success('保存成功')
|
||||
remarkEditVisible.value = false
|
||||
loadData()
|
||||
} finally {
|
||||
remarkEditLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function handleTypeTabChange() {
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
|
||||
+24
-192
@@ -29,72 +29,12 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #qc-tasks>
|
||||
<div v-if="detail?.qcInfo?.tasks?.length" class="view-section-slot">
|
||||
<div class="qc-task-cards">
|
||||
<div v-for="task in detail.qcInfo.tasks" :key="task.id" class="qc-task-card">
|
||||
<div class="qc-task-card__header">
|
||||
<span class="qc-task-card__type">
|
||||
<el-tag type="info" size="small">{{
|
||||
task.taskTypeLabel || task.taskType || '—'
|
||||
}}</el-tag>
|
||||
</span>
|
||||
<span class="qc-task-card__conclusion">
|
||||
<el-tag
|
||||
v-if="task.conclusion"
|
||||
:type="task.conclusion === 'tg' ? 'success' : 'danger'"
|
||||
size="small"
|
||||
>{{ task.conclusionLabel || task.conclusion }}</el-tag
|
||||
>
|
||||
<span v-else class="qc-kv__muted">—</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="qc-task-card__body">
|
||||
<div class="qc-kv">
|
||||
<span class="qc-kv__label">任务状态</span>
|
||||
<span class="qc-kv__value">
|
||||
<el-tag :type="taskStatusTagType(task.taskStatus)" size="small">{{
|
||||
task.taskStatusLabel || taskStatusLabel(task.taskStatus || '') || '—'
|
||||
}}</el-tag>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="view-section-slot"><p class="view-empty-hint">暂无质检任务</p></div>
|
||||
<template #qc-info>
|
||||
<SampleQcInfoCards :qc-info="detail?.qcInfo" :sample-reception="viewReceptionBrief" />
|
||||
</template>
|
||||
|
||||
<template #production-tasks>
|
||||
<div v-if="detail?.productionInfo?.tasks?.length" class="view-section-slot">
|
||||
<div class="qc-task-cards">
|
||||
<div v-for="task in detail.productionInfo.tasks" :key="task.id" class="qc-task-card">
|
||||
<div class="qc-task-card__header">
|
||||
<span class="qc-task-card__name">{{ task.taskName || task.taskNo || '—' }}</span>
|
||||
<span class="qc-task-card__conclusion">
|
||||
<el-tag :type="taskStatusTagType(task.taskStatus)" size="small">{{
|
||||
task.taskStatusLabel || productionTaskStatusLabel(task.taskStatus || '') || '—'
|
||||
}}</el-tag>
|
||||
</span>
|
||||
</div>
|
||||
<div class="qc-task-card__body">
|
||||
<div class="qc-kv">
|
||||
<span class="qc-kv__label">任务号</span>
|
||||
<span class="qc-kv__value">{{ task.taskNo || '—' }}</span>
|
||||
</div>
|
||||
<div class="qc-kv">
|
||||
<span class="qc-kv__label">开始时间</span>
|
||||
<span class="qc-kv__value">{{ task.startedTime || '—' }}</span>
|
||||
</div>
|
||||
<div class="qc-kv">
|
||||
<span class="qc-kv__label">完成时间</span>
|
||||
<span class="qc-kv__value">{{ task.completedTime || '—' }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="view-section-slot"><p class="view-empty-hint">暂无生产任务</p></div>
|
||||
<template #production-info>
|
||||
<SampleProductionInfoCards :production-info="detail?.productionInfo" />
|
||||
</template>
|
||||
|
||||
<template #review-attachments>
|
||||
@@ -114,6 +54,8 @@
|
||||
import SystemViewDialog from '@/components/business/system-view-dialog/index.vue'
|
||||
import type { ViewSection } from '@/components/business/system-view-dialog/index.vue'
|
||||
import ProtocolAttachmentReadonly from '@/views/cell-storage/protocol/ProtocolAttachmentReadonly.vue'
|
||||
import SampleQcInfoCards from '@/components/business/sample-qc-info-cards/index.vue'
|
||||
import SampleProductionInfoCards from '@/components/business/sample-production-info-cards/index.vue'
|
||||
import type { QcWorkOrderReceptionDetail } from '@/api/qc-work-order'
|
||||
import {
|
||||
fetchStorageReleaseReviewDetail,
|
||||
@@ -131,14 +73,7 @@
|
||||
donationStatusLabel,
|
||||
donationStatusTagType
|
||||
} from '@/utils/status-tag-registry'
|
||||
import {
|
||||
workOrderStatusLabel,
|
||||
workOrderStatusTagType,
|
||||
acceptConclusionLabel,
|
||||
transportTypeLabel,
|
||||
taskStatusLabel,
|
||||
taskStatusTagType
|
||||
} from '@/utils/qc-labels'
|
||||
import { acceptConclusionLabel, transportTypeLabel } from '@/utils/qc-labels'
|
||||
import { downloadAttachmentFile } from '@/utils/download-attachment'
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -160,35 +95,6 @@
|
||||
|
||||
const minioBaseUrl = (import.meta.env.VITE_MINIO_BASE_URL || '').replace(/\/$/, '')
|
||||
|
||||
const PRODUCTION_WO_STATUS_LABELS: Record<string, string> = {
|
||||
dpz: '待配置',
|
||||
jxz: '进行中',
|
||||
ywc: '已完成'
|
||||
}
|
||||
|
||||
const PRODUCTION_TASK_STATUS_LABELS: Record<string, string> = {
|
||||
dpz: '待配置',
|
||||
dzx: '待执行',
|
||||
jxz: '执行中',
|
||||
ywc: '已完成'
|
||||
}
|
||||
|
||||
function productionWorkOrderStatusLabel(status?: string) {
|
||||
const s = status || ''
|
||||
return PRODUCTION_WO_STATUS_LABELS[s] || s || '—'
|
||||
}
|
||||
|
||||
function productionWorkOrderStatusTagType(status?: string) {
|
||||
if (status === 'ywc') return 'success' as const
|
||||
if (status === 'jxz') return 'warning' as const
|
||||
return 'info' as const
|
||||
}
|
||||
|
||||
function productionTaskStatusLabel(status?: string) {
|
||||
const s = status || ''
|
||||
return PRODUCTION_TASK_STATUS_LABELS[s] || s || '—'
|
||||
}
|
||||
|
||||
watch(
|
||||
() => [props.visible, props.reviewId] as const,
|
||||
async ([vis, id]) => {
|
||||
@@ -250,6 +156,12 @@
|
||||
} as QcWorkOrderReceptionDetail
|
||||
})
|
||||
|
||||
const viewReceptionBrief = computed(() => {
|
||||
const r = viewReception.value
|
||||
if (!r?.acceptConclusion) return null
|
||||
return { acceptConclusion: r.acceptConclusion }
|
||||
})
|
||||
|
||||
const viewReceptionAttachmentFiles = computed(() => {
|
||||
const r = viewReception.value
|
||||
if (!r) return []
|
||||
@@ -289,8 +201,6 @@
|
||||
const rev: Partial<StorageReleaseReview> = d.review || {}
|
||||
const proto: Partial<ProtocolInfo> = d.protocolInfo || {}
|
||||
const r = viewReception.value
|
||||
const qc = d.qcInfo || {}
|
||||
const production = d.productionInfo || {}
|
||||
const source = rev.receptionSource || 'cell_storage'
|
||||
const protocolStatus = protocolStatusDisplay(proto, source)
|
||||
|
||||
@@ -327,9 +237,6 @@
|
||||
? [{ title: '运输信息', fields: transportFields }]
|
||||
: []
|
||||
|
||||
const qcWoStatus = qc.workOrderStatus || ''
|
||||
const prodWoStatus = production.workOrderStatus || ''
|
||||
|
||||
return [
|
||||
{
|
||||
title: '基础信息',
|
||||
@@ -378,35 +285,13 @@
|
||||
},
|
||||
{
|
||||
title: '质检信息',
|
||||
slot: 'qc-tasks',
|
||||
fields: [
|
||||
{ label: '工单号', value: qc.workOrderNo || '—' },
|
||||
{
|
||||
label: '工单状态',
|
||||
value:
|
||||
qc.workOrderStatusLabel ||
|
||||
workOrderStatusLabel(qcWoStatus) ||
|
||||
qcWoStatus ||
|
||||
'—',
|
||||
tagType: workOrderStatusTagType(qcWoStatus)
|
||||
}
|
||||
]
|
||||
slot: 'qc-info',
|
||||
fields: []
|
||||
},
|
||||
{
|
||||
title: '生产信息',
|
||||
slot: 'production-tasks',
|
||||
fields: [
|
||||
{ label: '工单号', value: production.workOrderNo || '—' },
|
||||
{
|
||||
label: '工单状态',
|
||||
value:
|
||||
production.workOrderStatusLabel ||
|
||||
productionWorkOrderStatusLabel(prodWoStatus) ||
|
||||
prodWoStatus ||
|
||||
'—',
|
||||
tagType: productionWorkOrderStatusTagType(prodWoStatus)
|
||||
}
|
||||
]
|
||||
slot: 'production-info',
|
||||
fields: []
|
||||
},
|
||||
{
|
||||
title: '放行审核',
|
||||
@@ -451,68 +336,15 @@
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.view-empty-hint {
|
||||
margin: 0;
|
||||
font-size: 13px;
|
||||
color: #94a3b8;
|
||||
.view-section-slot :deep(.sample-card__section-label) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.qc-task-cards {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.qc-task-card {
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 8px;
|
||||
background: #fff;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.qc-task-card__header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 8px;
|
||||
padding: 10px 12px;
|
||||
border-bottom: 1px solid #f1f5f9;
|
||||
}
|
||||
|
||||
.qc-task-card__name {
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: #1e293b;
|
||||
}
|
||||
|
||||
.qc-task-card__body {
|
||||
padding: 10px 12px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.qc-kv {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 8px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.qc-kv__label {
|
||||
color: #94a3b8;
|
||||
flex-shrink: 0;
|
||||
min-width: 56px;
|
||||
}
|
||||
|
||||
.qc-kv__value {
|
||||
color: #1e293b;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.qc-kv__muted {
|
||||
color: #94a3b8;
|
||||
font-weight: 400;
|
||||
.view-section-slot :deep(.sample-card__section--qc),
|
||||
.view-section-slot :deep(.sample-card__section--production) {
|
||||
margin-top: 0;
|
||||
padding-top: 0;
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
.view-reception-attachments {
|
||||
|
||||
Reference in new issue
Block a user