This commit is contained in:
zlwu committed 2026-09-01 13:43:14 +08:00
1 parent 2fd826dbe1
commit 2cd1194d17
24 files changed
+12379 -11222

No files matched your search

@@ -28,6 +28,11 @@ export interface ProductionWorkOrderItem {
/** 门禁质检结论:tg=合格 / btg=不合格(细胞存储/科研捐赠入库) */
qcConclusion?: string
qcConclusionLabel?: string
/** 样本接收触发的门禁质检工单号 */
qcWorkOrderNo?: string
/** 门禁质检工单状态:dpz/ypz/ywc/yzf */
qcWorkOrderStatus?: string
qcWorkOrderStatusLabel?: string
createTime?: string
/** 卡片展示:工单下全部工艺步骤计划开始时间区间(前端聚合) */
plannedStartTimeRange?: string
@@ -134,6 +139,12 @@ export function fetchCompleteProductionWorkOrder(
})
}
export function fetchVoidProductionWorkOrder(id: string) {
return request.put<ProductionWorkOrderItem>({
url: `/web/admin/production-work-orders/${id}/void`
})
}
export function fetchCreateProductionWorkOrder(data: {
workOrderType?: string
protocolNo?: string
@@ -5,7 +5,9 @@ import {
donationStatusDisplayLabel,
donationStatusTagType,
protocolStatusDisplayLabel,
protocolStatusTagType
protocolStatusTagType,
workOrderStatusLabel,
workOrderStatusTagType
} from '@/utils/status-tag-registry'
import type { TagType } from '@/utils/status-tag-registry'
import type { ProductionWorkOrderTabKey } from '@/utils/production-work-order-tabs'
@@ -98,6 +100,21 @@ function buildInboundMetaFields(tabKey: ProductionWorkOrderTabKey): CardMetaFiel
getTagType: (row) => protocolStatusTagTypeForTab(row, tabKey),
visible: (row) => !!String(row.protocolStatus || '').trim()
},
{
label: '质检工单号',
getValue: (row) => row.qcWorkOrderNo || '—'
},
{
label: '质检工单状态',
kind: 'tag',
getValue: (row) =>
row.qcWorkOrderStatusLabel ||
workOrderStatusLabel(String(row.qcWorkOrderStatus || '')) ||
'—',
getTagType: (row) =>
workOrderStatusTagType(String(row.qcWorkOrderStatus || '')) || 'info',
visible: (row) => !!String(row.qcWorkOrderStatus || '').trim()
},
{
label: '质检结论',
kind: 'tag',
@@ -16,6 +16,7 @@
:tab-key="activeTabKey"
page-mode="mine"
@complete="handleCompleteSingle"
@void="handleVoidSingle"
@data-changed="reloadTabCounts"
/>
@@ -32,9 +33,10 @@
<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { ElMessage } from 'element-plus'
import { ElMessage, ElMessageBox } from 'element-plus'
import {
fetchCompleteProductionWorkOrder,
fetchVoidProductionWorkOrder,
type ProductionWorkOrderItem
} from '@/api/production-work-order'
import {
@@ -110,6 +112,21 @@
}
}
async function handleVoidSingle(row: ProductionWorkOrderItem) {
if (row.workOrderStatus !== 'dpz' && row.workOrderStatus !== 'jxz') {
ElMessage.warning('仅待配置或进行中的工单可作废')
return
}
await ElMessageBox.confirm(
'确定作废该生产工单吗?未完成的任务将一并作废,已登记产出不受影响。',
'作废工单',
{ type: 'warning' }
)
await fetchVoidProductionWorkOrder(row.id)
ElMessage.success('工单已作废')
await refreshActiveTab()
}
function handleTabChange(key: ProductionWorkOrderTabKey) {
if (activeTabKey.value === key) return
activeTabKey.value = key
@@ -112,6 +112,15 @@
>
<el-icon><Check /></el-icon>完成工单
</el-button>
<el-button
v-if="showCardComplete(row) && canVoidWorkOrder(row)"
class="btn-op-item"
type="danger"
plain
@click="emit('void', row)"
>
<el-icon><Close /></el-icon>作废工单
</el-button>
<el-dropdown
v-if="!isMineMode && hasMoreActions(row)"
trigger="hover"
@@ -298,6 +307,7 @@
Position,
Document,
Check,
Close,
More,
EditPen,
Delete,
@@ -438,6 +448,7 @@
dispatch: [row: ProductionWorkOrderItem]
'dispatch-qc': [row: ProductionWorkOrderItem]
complete: [row: ProductionWorkOrderItem]
void: [row: ProductionWorkOrderItem]
command: [cmd: string, row: ProductionWorkOrderItem]
'toggle-select': [row: ProductionWorkOrderItem, checked: boolean]
'tasks-changed': [detail?: { workOrderId?: string; reloadWorkOrders?: boolean }]
@@ -537,6 +548,10 @@
return row.workOrderStatus === 'dpz' || row.workOrderStatus === 'jxz'
}
function canVoidWorkOrder(row: ProductionWorkOrderItem) {
return row.workOrderStatus === 'dpz' || row.workOrderStatus === 'jxz'
}
function canEditWorkOrder(row: ProductionWorkOrderItem) {
if (!rowCardMeta(row).allowEditRemark) return false
const effectiveTabKey = resolveEffectiveRowTabKey(listTabKey.value, row)
@@ -319,7 +319,8 @@
const map: Record<string, { label: string; type: string }> = {
dpz: { label: '待配置', type: 'info' },
jxz: { label: '进行中', type: 'warning' },
ywc: { label: '已完成', type: 'success' }
ywc: { label: '已完成', type: 'success' },
yzf: { label: '已作废', type: 'danger' }
}
return map[status] || { label: status, type: 'info' }
}
@@ -520,6 +521,7 @@
function canEnterExecution(row: Record<string, any>) {
if (isMineHistoryRow(row)) return false
if (row.taskStatus === 'yzf') return false
if (isMineMode.value) return isCurrentAssignee(row)
return true
}
@@ -531,6 +533,7 @@
function canEditTask(row: Record<string, any>) {
if (isMineHistoryRow(row)) return false
if (row.taskStatus === 'yzf') return false
if (isMineMode.value) return isCurrentAssignee(row)
return row.taskStatus === 'dpz' || row.taskStatus === 'jxz'
}
@@ -18,6 +18,7 @@
@dispatch="handleOpenDispatch"
@dispatch-qc="handleOpenDispatchQc"
@complete="handleCompleteSingle"
@void="handleVoidSingle"
@command="handleDropdownCommand"
@add-temporary="handleAddTemporary"
@open-sample-reception="handleOpenSampleReception"
@@ -113,6 +114,7 @@
import { Close, Check } from '@element-plus/icons-vue'
import {
fetchCompleteProductionWorkOrder,
fetchVoidProductionWorkOrder,
fetchCreateProductionWorkOrder,
fetchUpdateProductionWorkOrder,
fetchDeleteProductionWorkOrder,
@@ -316,6 +318,21 @@
}
}
async function handleVoidSingle(row: ProductionWorkOrderItem) {
if (row.workOrderStatus !== 'dpz' && row.workOrderStatus !== 'jxz') {
ElMessage.warning('仅待配置或进行中的工单可作废')
return
}
await ElMessageBox.confirm(
'确定作废该生产工单吗?未完成的任务将一并作废,已登记产出不受影响。',
'作废工单',
{ type: 'warning' }
)
await fetchVoidProductionWorkOrder(row.id)
ElMessage.success('工单已作废')
await refreshActiveTab()
}
onMounted(() => {
activeTabKey.value = parseProductionWorkOrderTabKey(route.query.tab as string)
})
@@ -192,6 +192,7 @@
@dispatch="(row) => emit('dispatch', row)"
@dispatch-qc="(row) => emit('dispatch-qc', row)"
@complete="(row) => emit('complete', row)"
@void="(row) => emit('void', row)"
@command="handleCommand"
@toggle-select="handleCardToggleSelect"
@tasks-changed="onTasksChanged"
@@ -260,6 +261,7 @@
(e: 'dispatch', row: ProductionWorkOrderItem): void
(e: 'dispatch-qc', row: ProductionWorkOrderItem): void
(e: 'complete', row: ProductionWorkOrderItem): void
(e: 'void', row: ProductionWorkOrderItem): void
(e: 'command', command: string, row: ProductionWorkOrderItem): void
(e: 'add-temporary'): void
(e: 'open-sample-reception', row: ProductionWorkOrderItem): void
@@ -2335,7 +2335,8 @@ export function useTaskStepEditor() {
const map: Record<string, { label: string; type: string }> = {
dpz: { label: '待配置', type: 'info' },
jxz: { label: '进行中', type: 'warning' },
ywc: { label: '已完成', type: 'success' }
ywc: { label: '已完成', type: 'success' },
yzf: { label: '已作废', type: 'danger' }
}
return map[status] || { label: status, type: 'info' }
}