feat: 质检工单结论、库位批量/筛选与协议样本接收质检摘要
落库并展示质检工单级结论(可编辑/任务派生),库位树支持批量新增子节点与货架格子检索,协议/捐赠列表补充接收与门禁质检摘要,并同步生产物料与工单卡片展示优化。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
f554d77e59
commit
a3af039e74
54 files changed
+42429
-35006
No files matched your search
@@ -1409,6 +1409,22 @@ export function fetchCreateStorageFacility(data: Record<string, any>) {
|
||||
return request.post({ url: '/web/admin/storage-facilities', params: data })
|
||||
}
|
||||
|
||||
export function fetchBatchCreateStorageFacilities(data: {
|
||||
parentId?: string
|
||||
namePrefix?: string
|
||||
nameSuffix?: string
|
||||
startNum: number
|
||||
endNum: number
|
||||
padWidth?: number
|
||||
codePrefix?: string
|
||||
codeSuffix?: string
|
||||
nodeType?: string
|
||||
isLeaf?: number
|
||||
remark?: string
|
||||
}) {
|
||||
return request.post({ url: '/web/admin/storage-facilities/batch', params: data })
|
||||
}
|
||||
|
||||
export function fetchUpdateStorageFacility(id: string, data: Record<string, any>) {
|
||||
return request.put({ url: `/web/admin/storage-facilities/${id}`, params: data })
|
||||
}
|
||||
|
||||
@@ -25,6 +25,9 @@ export interface ProductionWorkOrderItem {
|
||||
handlerName?: string
|
||||
receptionTime?: string
|
||||
workOrderStatus: string
|
||||
/** 门禁质检结论:tg=合格 / btg=不合格(细胞存储/科研捐赠入库) */
|
||||
qcConclusion?: string
|
||||
qcConclusionLabel?: string
|
||||
createTime?: string
|
||||
/** 卡片展示:工单下全部工艺步骤计划开始时间区间(前端聚合) */
|
||||
plannedStartTimeRange?: string
|
||||
|
||||
@@ -114,6 +114,9 @@ export type QcWorkOrder = {
|
||||
receptionTime?: string
|
||||
handlerName?: string
|
||||
workOrderStatus: string
|
||||
/** 工单级质检结论:tg=合格 / btg=不合格 / 空=尚无 */
|
||||
qcConclusion?: string
|
||||
qcConclusionLabel?: string
|
||||
hasLab: boolean
|
||||
hasThirdParty: boolean
|
||||
configuredTime?: string
|
||||
@@ -292,7 +295,7 @@ export function fetchCreateQcWorkOrder(data: {
|
||||
|
||||
export function fetchUpdateQcWorkOrder(
|
||||
id: string,
|
||||
data: { cellProductId?: string; workOrderStatus?: string; remark?: string }
|
||||
data: { cellProductId?: string; workOrderStatus?: string; qcConclusion?: string; remark?: string }
|
||||
) {
|
||||
return request.put<QcWorkOrder>({
|
||||
url: `/web/admin/qc-work-orders/${id}`,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!-- 工单编辑(备注;质检工单可选工单状态) -->
|
||||
<!-- 工单编辑(备注;质检工单可选工单状态、质检结论) -->
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
@@ -24,6 +24,21 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="showQcConclusion" label="质检结论" class="form-col-span-2">
|
||||
<el-select
|
||||
v-model="qcConclusion"
|
||||
placeholder="请选择"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="opt in qcConclusionOptions"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" class="form-col-span-2">
|
||||
<el-input
|
||||
v-model="remark"
|
||||
@@ -50,11 +65,17 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, watch } from 'vue'
|
||||
import { Close, Check } from '@element-plus/icons-vue'
|
||||
import { workOrderStatus as workOrderStatusRegistry, workOrderStatusLabel } from '@/utils/status-tag-registry'
|
||||
import {
|
||||
workOrderStatus as workOrderStatusRegistry,
|
||||
workOrderStatusLabel,
|
||||
qcWorkOrderConclusionLabelMap,
|
||||
qcWorkOrderConclusionLabel
|
||||
} from '@/utils/status-tag-registry'
|
||||
|
||||
export type WorkOrderRemarkSubmitPayload = {
|
||||
remark: string
|
||||
workOrderStatus?: string
|
||||
qcConclusion?: string
|
||||
}
|
||||
|
||||
const props = withDefaults(
|
||||
@@ -63,14 +84,18 @@
|
||||
title?: string
|
||||
initialRemark?: string
|
||||
initialWorkOrderStatus?: string
|
||||
initialQcConclusion?: string
|
||||
showWorkOrderStatus?: boolean
|
||||
showQcConclusion?: boolean
|
||||
submitting?: boolean
|
||||
}>(),
|
||||
{
|
||||
title: '编辑备注',
|
||||
initialRemark: '',
|
||||
initialWorkOrderStatus: '',
|
||||
initialQcConclusion: '',
|
||||
showWorkOrderStatus: false,
|
||||
showQcConclusion: false,
|
||||
submitting: false
|
||||
}
|
||||
)
|
||||
@@ -87,6 +112,7 @@
|
||||
|
||||
const remark = ref('')
|
||||
const workOrderStatus = ref('')
|
||||
const qcConclusion = ref('')
|
||||
|
||||
const workOrderStatusOptions = computed(() =>
|
||||
Object.keys(workOrderStatusRegistry).map((value) => ({
|
||||
@@ -95,6 +121,13 @@
|
||||
}))
|
||||
)
|
||||
|
||||
const qcConclusionOptions = computed(() =>
|
||||
Object.keys(qcWorkOrderConclusionLabelMap).map((value) => ({
|
||||
value,
|
||||
label: qcWorkOrderConclusionLabel(value)
|
||||
}))
|
||||
)
|
||||
|
||||
function handleClose() {
|
||||
dialogVisible.value = false
|
||||
}
|
||||
@@ -106,6 +139,9 @@
|
||||
if (props.showWorkOrderStatus) {
|
||||
payload.workOrderStatus = workOrderStatus.value
|
||||
}
|
||||
if (props.showQcConclusion) {
|
||||
payload.qcConclusion = qcConclusion.value || ''
|
||||
}
|
||||
emit('submit', payload)
|
||||
}
|
||||
|
||||
@@ -115,6 +151,7 @@
|
||||
if (val) {
|
||||
remark.value = props.initialRemark || ''
|
||||
workOrderStatus.value = props.initialWorkOrderStatus || ''
|
||||
qcConclusion.value = props.initialQcConclusion || ''
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
@@ -51,7 +51,7 @@ function keywordMatchesWorkOrder(
|
||||
const tab = getProductionWorkOrderTab(tabKey)!
|
||||
const fields =
|
||||
tabKey === 'temporary'
|
||||
? [row.workOrderNo]
|
||||
? [row.remark]
|
||||
: tabKey === 'outbound_basic_experiment'
|
||||
? [
|
||||
row.workOrderNo,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { formatDisplayOrDash } from '@/utils/datetime-display'
|
||||
import type { ProductionWorkOrderItem } from '@/api/production-work-order'
|
||||
import { receptionSourceLabel } from '@/utils/qc-labels'
|
||||
import { receptionSourceLabel, receptionSourceTagType } from '@/utils/qc-labels'
|
||||
import {
|
||||
donationStatusDisplayLabel,
|
||||
donationStatusTagType,
|
||||
@@ -78,18 +78,19 @@ function protocolStatusTagTypeForTab(
|
||||
}
|
||||
|
||||
function buildInboundMetaFields(tabKey: ProductionWorkOrderTabKey): CardMetaField[] {
|
||||
const fields: CardMetaField[] = []
|
||||
if (tabKey === 'inbound_cell_storage') {
|
||||
fields.push({
|
||||
const defaultSource = tabKey === 'inbound_research_donation' ? 'research_donation' : 'cell_storage'
|
||||
return [
|
||||
{ label: '实验室入库编码', getValue: (row) => row.labStorageCode || '—' },
|
||||
{ label: '样本类型', getValue: (row) => row.sampleTypeName || '—' },
|
||||
{ label: '接收经手人', getValue: (row) => row.handlerName || '—' },
|
||||
{ label: '接收时间', getValue: (row) => formatDisplayOrDash(row.receptionTime) },
|
||||
{
|
||||
label: '来源类型',
|
||||
kind: 'tag',
|
||||
getValue: (row) => row.receptionSourceLabel || receptionSourceLabel(row.receptionSource || 'cell_storage'),
|
||||
getTagType: () => 'success'
|
||||
})
|
||||
}
|
||||
fields.push(
|
||||
{ label: '母亲姓名', getValue: (row) => row.motherName || '—' },
|
||||
{ label: '新生儿姓名', getValue: (row) => row.newbornName || '—' },
|
||||
getValue: (row) =>
|
||||
row.receptionSourceLabel || receptionSourceLabel(row.receptionSource || defaultSource),
|
||||
getTagType: (row) => receptionSourceTagType(row.receptionSource || defaultSource)
|
||||
},
|
||||
{
|
||||
label: tabKey === 'inbound_research_donation' ? '捐赠状态' : '协议状态',
|
||||
kind: 'tag',
|
||||
@@ -97,21 +98,24 @@ function buildInboundMetaFields(tabKey: ProductionWorkOrderTabKey): CardMetaFiel
|
||||
getTagType: (row) => protocolStatusTagTypeForTab(row, tabKey),
|
||||
visible: (row) => !!String(row.protocolStatus || '').trim()
|
||||
},
|
||||
{ label: '样本类型', getValue: (row) => row.sampleTypeName || '—' },
|
||||
{ label: '接收经手人', getValue: (row) => row.handlerName || '—' },
|
||||
{ label: '接收时间', getValue: (row) => formatDisplayOrDash(row.receptionTime) },
|
||||
plannedStartTimeRangeField,
|
||||
{ label: '工单号', getValue: (row) => row.workOrderNo || '—' },
|
||||
{ label: '样本编码', getValue: (row) => row.sampleCode || '—' },
|
||||
{ label: '实验室入库编码', getValue: (row) => row.labStorageCode || '—' },
|
||||
{
|
||||
label: '备注',
|
||||
getValue: (row) => row.remark || '—',
|
||||
visible: (row) => !!row.remark,
|
||||
wide: true
|
||||
label: '质检结论',
|
||||
kind: 'tag',
|
||||
getValue: (row) =>
|
||||
row.qcConclusionLabel ||
|
||||
(row.qcConclusion === 'tg'
|
||||
? '合格'
|
||||
: row.qcConclusion === 'btg'
|
||||
? '不合格'
|
||||
: '—'),
|
||||
getTagType: (row) => {
|
||||
const c = String(row.qcConclusion || '').trim()
|
||||
if (c === 'tg') return 'success'
|
||||
if (c === 'btg') return 'danger'
|
||||
return 'info'
|
||||
}
|
||||
}
|
||||
)
|
||||
return fields
|
||||
]
|
||||
}
|
||||
|
||||
const outboundPilotClinicalFields: CardMetaField[] = [
|
||||
@@ -157,10 +161,7 @@ const outboundBasicExperimentFields: CardMetaField[] = [
|
||||
}
|
||||
]
|
||||
|
||||
const temporaryFields: CardMetaField[] = [
|
||||
{ label: '工单号', getValue: (row) => row.workOrderNo || '—' },
|
||||
plannedStartTimeRangeField
|
||||
]
|
||||
const temporaryFields: CardMetaField[] = []
|
||||
|
||||
const CARD_META_BY_TAB: Record<ProductionWorkOrderTabKey, ProductionWorkOrderCardMetaConfig> = {
|
||||
all: {
|
||||
|
||||
@@ -137,7 +137,7 @@ export function resolveTabKeyFromWorkOrder(row: {
|
||||
|
||||
export function keywordPlaceholderForTab(tab: ProductionWorkOrderTabConfig): string {
|
||||
if (tab.key === 'all') return '工单号 / 样本编码 / 申请单号 / 产品名称等'
|
||||
if (tab.key === 'temporary') return '工单号'
|
||||
if (tab.key === 'temporary') return '备注'
|
||||
if (tab.key === 'outbound_basic_experiment') {
|
||||
return '工单号/申请单号/课题名称/客户'
|
||||
}
|
||||
|
||||
@@ -15,6 +15,8 @@ export {
|
||||
qcTaskConclusionTagType,
|
||||
qcConclusionDisplayLabel,
|
||||
qcConclusionDisplayTagType,
|
||||
qcWorkOrderConclusionLabel,
|
||||
qcWorkOrderConclusionTagType,
|
||||
taskStatusLabel,
|
||||
taskStatusTagType
|
||||
} from './status-tag-registry'
|
||||
@@ -250,6 +250,14 @@ export const qcConclusion: StatusRegistry = {
|
||||
export const qcTaskConclusionLabel = createLabelGetter(qcConclusion)
|
||||
export const qcTaskConclusionTagType = createTagTypeGetter(qcConclusion)
|
||||
|
||||
/** 工单级质检结论(列表卡片):合格 / 不合格;无结论返回空串 */
|
||||
export const qcWorkOrderConclusionLabelMap: StatusRegistry = {
|
||||
tg: { label: '合格', tagType: 'success' },
|
||||
btg: { label: '不合格', tagType: 'danger' }
|
||||
}
|
||||
export const qcWorkOrderConclusionLabel = createLabelGetter(qcWorkOrderConclusionLabelMap)
|
||||
export const qcWorkOrderConclusionTagType = createTagTypeGetter(qcWorkOrderConclusionLabelMap)
|
||||
|
||||
/** 无 tg/btg 时展示「待结论」(待办醒目,用 danger) */
|
||||
export function qcConclusionDisplayLabel(code?: string | null): string {
|
||||
const c = (code || '').trim()
|
||||
|
||||
@@ -247,6 +247,47 @@
|
||||
formatTransportSummary(item.transport)
|
||||
}}</span>
|
||||
</div>
|
||||
<div class="protocol-card__sample-line">
|
||||
<span class="protocol-card__sample-label">接收</span>
|
||||
<span class="protocol-card__sample-value protocol-card__sample-value--reception">
|
||||
<el-tag
|
||||
:type="
|
||||
item.receptionAcceptConclusion
|
||||
? acceptConclusionTagType(item.receptionAcceptConclusion)
|
||||
: 'info'
|
||||
"
|
||||
size="small"
|
||||
>
|
||||
{{
|
||||
item.receptionAcceptConclusion
|
||||
? acceptConclusionLabel(item.receptionAcceptConclusion)
|
||||
: '未接收'
|
||||
}}
|
||||
</el-tag>
|
||||
<span
|
||||
class="protocol-card__sample-remark"
|
||||
:title="item.receptionRemark || undefined"
|
||||
>
|
||||
备注:{{ item.receptionRemark || '—' }}
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="protocol-card__sample-line">
|
||||
<span class="protocol-card__sample-label">质检</span>
|
||||
<span class="protocol-card__sample-value">
|
||||
<el-tag
|
||||
v-if="item.qcConclusion"
|
||||
:type="qcWorkOrderConclusionTagType(item.qcConclusion)"
|
||||
size="small"
|
||||
>
|
||||
{{
|
||||
item.qcConclusionLabel ||
|
||||
qcWorkOrderConclusionLabel(item.qcConclusion)
|
||||
}}
|
||||
</el-tag>
|
||||
<span v-else>—</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -259,6 +300,7 @@
|
||||
:summary="getPaymentSummary(row)"
|
||||
compact
|
||||
embedded
|
||||
default-expanded
|
||||
hide-overall-pay-status
|
||||
hide-installment-detail-amounts
|
||||
/>
|
||||
@@ -381,7 +423,11 @@
|
||||
newbornSexLabel,
|
||||
sampleStatusLabel,
|
||||
sampleStatusTagType,
|
||||
transportTypeLabel
|
||||
transportTypeLabel,
|
||||
acceptConclusionLabel,
|
||||
acceptConclusionTagType,
|
||||
qcWorkOrderConclusionLabel,
|
||||
qcWorkOrderConclusionTagType
|
||||
} from '@/utils/status-tag-registry'
|
||||
import { maskIdCard } from '@/utils/mask-sensitive'
|
||||
|
||||
@@ -405,6 +451,10 @@
|
||||
isSpecial?: boolean
|
||||
specialRemark?: string
|
||||
transport?: ProtocolSampleTransport | null
|
||||
receptionAcceptConclusion?: string
|
||||
receptionRemark?: string
|
||||
qcConclusion?: string
|
||||
qcConclusionLabel?: string
|
||||
}
|
||||
|
||||
function getPaymentSummary(row: CollectionProtocolRow): QcProtocolPaymentSummary | null {
|
||||
@@ -451,7 +501,11 @@
|
||||
labStorageCode: String(rec.labStorageCode || '').trim(),
|
||||
isSpecial: !!rec.isSpecial,
|
||||
specialRemark: String(rec.specialRemark || '').trim(),
|
||||
transport
|
||||
transport,
|
||||
receptionAcceptConclusion: String(rec.receptionAcceptConclusion || '').trim(),
|
||||
receptionRemark: String(rec.receptionRemark || '').trim(),
|
||||
qcConclusion: String(rec.qcConclusion || '').trim(),
|
||||
qcConclusionLabel: String(rec.qcConclusionLabel || '').trim()
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -956,6 +1010,24 @@
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
&--reception {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 6px 8px;
|
||||
word-break: normal;
|
||||
}
|
||||
}
|
||||
|
||||
.protocol-card__sample-remark {
|
||||
min-width: 0;
|
||||
flex: 1 1 120px;
|
||||
overflow: hidden;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
font-size: 12px;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.protocol-card__sample-status {
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
<span v-if="data.isLeaf === 1" class="storage-tree-node__leaf">存</span>
|
||||
<div class="storage-tree-node__actions">
|
||||
<button title="新增子节点" @click.stop="handleAddChild(data)">+</button>
|
||||
<button title="批量新增子节点" @click.stop="handleBatchAddChild(data)">批+</button>
|
||||
<button title="编辑" @click.stop="handleEditNode(data)">✎</button>
|
||||
<button title="删除" @click.stop="handleDeleteNode(data)">×</button>
|
||||
</div>
|
||||
@@ -100,10 +101,25 @@
|
||||
<span
|
||||
>占用 <strong>{{ slotStats.occupied }}</strong></span
|
||||
>
|
||||
<template v-if="slotFilterActive">
|
||||
<span class="stats-dot">·</span>
|
||||
<span
|
||||
>共命中 <strong>{{ slotFilterHitCount }}</strong> 格</span
|
||||
>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="storage-slot-filter">
|
||||
<el-input
|
||||
v-model="slotFilterKeyword"
|
||||
placeholder="物品名称 / 产品类型 / 批次号"
|
||||
clearable
|
||||
class="storage-slot-filter__input"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="storage-toolbar">
|
||||
<el-button
|
||||
type="primary"
|
||||
@@ -126,6 +142,13 @@
|
||||
<el-empty description="暂无格子" />
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-else-if="slotFilterActive && slotFilterHitCount === 0"
|
||||
class="storage-empty-cells"
|
||||
>
|
||||
<el-empty description="未找到匹配的库位格子" />
|
||||
</div>
|
||||
|
||||
<div v-else class="shelf-scroll-wrapper" v-loading="slotLoading">
|
||||
<div class="shelf-container">
|
||||
<div v-for="(row, ri) in shelfRows" :key="ri" class="shelf-row-wrapper">
|
||||
@@ -152,27 +175,29 @@
|
||||
title="删除"
|
||||
>×</button
|
||||
>
|
||||
<span class="cell-code">{{ cell.fullSlotCode || cell.slotCode || '—' }}</span>
|
||||
<template v-if="cell.storedCellProduct">
|
||||
<span
|
||||
class="cell-product-code"
|
||||
:title="cell.storedCellProduct.productCode"
|
||||
>
|
||||
{{ cell.storedCellProduct.productCode }}
|
||||
</span>
|
||||
<span
|
||||
class="cell-product-name"
|
||||
:title="cell.storedCellProduct.productName"
|
||||
>
|
||||
{{ cell.storedCellProduct.productName }}
|
||||
{{ cell.storedCellProduct.productName || '—' }}
|
||||
</span>
|
||||
<span
|
||||
class="cell-product-type"
|
||||
:title="cell.storedCellProduct.productTypeName"
|
||||
>
|
||||
{{ cell.storedCellProduct.productTypeName || '—' }}
|
||||
</span>
|
||||
</template>
|
||||
<span v-else-if="cell.storedItemCode" class="cell-product-code">{{
|
||||
cell.storedItemCode
|
||||
}}</span>
|
||||
<span v-if="cell.occupiedCount > 0" class="cell-badge">{{
|
||||
cell.occupiedCount
|
||||
}}</span>
|
||||
<template v-else-if="cell.storedItemName || cell.storedItemCode">
|
||||
<span
|
||||
class="cell-product-name"
|
||||
:title="cell.storedItemName || cell.storedItemCode"
|
||||
>
|
||||
{{ cell.storedItemName || cell.storedItemCode }}
|
||||
</span>
|
||||
</template>
|
||||
<span v-else class="cell-empty">—</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -278,6 +303,182 @@
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 批量新增子节点弹窗 -->
|
||||
<el-dialog
|
||||
v-model="batchChildDialogVisible"
|
||||
title="批量新增子节点"
|
||||
width="1160px"
|
||||
class="dialog-form-layout"
|
||||
align-center
|
||||
append-to-body
|
||||
modal-class="protocol-dialog-mask"
|
||||
destroy-on-close
|
||||
:close-on-click-modal="false"
|
||||
@close="handleBatchChildDialogClose"
|
||||
>
|
||||
<el-form
|
||||
ref="batchChildFormRef"
|
||||
:model="batchChildForm"
|
||||
:rules="batchChildFormRules"
|
||||
label-position="top"
|
||||
class="storage-dialog-form"
|
||||
scroll-to-error
|
||||
:scroll-into-view-options="{ behavior: 'smooth', block: 'center' }"
|
||||
>
|
||||
<div class="form-grid-2">
|
||||
<el-form-item label="上级节点">
|
||||
<el-input :model-value="batchChildParentPath" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item prop="startNum">
|
||||
<template #label>
|
||||
节点名称<span class="form-label-tip">名称 = 前缀 + 序号 + 后缀</span>
|
||||
</template>
|
||||
<div class="storage-name-compose">
|
||||
<div class="storage-compose-field storage-compose-field--affix">
|
||||
<span class="storage-compose-label">前缀</span>
|
||||
<el-input
|
||||
v-model="batchChildForm.namePrefix"
|
||||
class="storage-affix-input"
|
||||
placeholder="如:盒"
|
||||
/>
|
||||
</div>
|
||||
<div class="storage-compose-field storage-compose-field--seq">
|
||||
<span class="storage-compose-label">起始序号</span>
|
||||
<el-input-number
|
||||
v-model="batchChildForm.startNum"
|
||||
class="storage-seq-input"
|
||||
:min="0"
|
||||
:step="1"
|
||||
:controls="false"
|
||||
/>
|
||||
</div>
|
||||
<span class="storage-compose-sep">~</span>
|
||||
<div class="storage-compose-field storage-compose-field--seq">
|
||||
<span class="storage-compose-label">结束序号</span>
|
||||
<el-input-number
|
||||
v-model="batchChildForm.endNum"
|
||||
class="storage-seq-input"
|
||||
:min="0"
|
||||
:step="1"
|
||||
:controls="false"
|
||||
/>
|
||||
</div>
|
||||
<div class="storage-compose-field storage-compose-field--pad">
|
||||
<span class="storage-compose-label">补零位数</span>
|
||||
<el-input-number
|
||||
v-model="batchChildForm.padWidth"
|
||||
class="storage-pad-input"
|
||||
:min="0"
|
||||
:max="8"
|
||||
:step="1"
|
||||
:controls="false"
|
||||
/>
|
||||
</div>
|
||||
<div class="storage-compose-field storage-compose-field--affix">
|
||||
<span class="storage-compose-label">后缀</span>
|
||||
<el-input
|
||||
v-model="batchChildForm.nameSuffix"
|
||||
class="storage-affix-input"
|
||||
placeholder="如:号"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<template #label>
|
||||
节点编号<span class="form-label-tip">可选,与名称共用序号</span>
|
||||
</template>
|
||||
<div class="storage-name-compose">
|
||||
<div class="storage-compose-field storage-compose-field--affix">
|
||||
<span class="storage-compose-label">前缀</span>
|
||||
<el-input
|
||||
v-model="batchChildForm.codePrefix"
|
||||
class="storage-affix-input"
|
||||
placeholder="如:B"
|
||||
/>
|
||||
</div>
|
||||
<span class="storage-compose-mid">+ 序号 +</span>
|
||||
<div class="storage-compose-field storage-compose-field--affix">
|
||||
<span class="storage-compose-label">后缀</span>
|
||||
<el-input
|
||||
v-model="batchChildForm.codeSuffix"
|
||||
class="storage-affix-input"
|
||||
placeholder="可空"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="节点类型" prop="nodeType">
|
||||
<el-select v-model="batchChildForm.nodeType" placeholder="请选择节点类型">
|
||||
<el-option label="设施" value="facility" />
|
||||
<el-option label="层" value="layer" />
|
||||
<el-option label="盒" value="box" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否存储格">
|
||||
<el-switch v-model="batchChildForm.isLeaf" :active-value="1" :inactive-value="0" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<template #label>
|
||||
排序<span class="form-label-tip">按序号自动写入</span>
|
||||
</template>
|
||||
<el-input-number
|
||||
:model-value="batchChildForm.startNum"
|
||||
disabled
|
||||
:min="0"
|
||||
:step="1"
|
||||
controls-position="right"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" class="form-col-span-2">
|
||||
<el-input v-model="batchChildForm.remark" placeholder="可选" />
|
||||
<div class="storage-batch-preview">
|
||||
<template v-if="batchChildPreview.count > 0">
|
||||
将创建 <strong>{{ batchChildPreview.count }}</strong> 个子节点
|
||||
<template v-if="batchChildPreview.samples.length">
|
||||
,示例:
|
||||
<span
|
||||
v-for="(item, idx) in batchChildPreview.samples"
|
||||
:key="idx"
|
||||
class="storage-batch-chip"
|
||||
>
|
||||
<span class="storage-batch-chip__name">名称 {{ item.name }}</span>
|
||||
<template v-if="item.code">
|
||||
<span class="storage-batch-chip__sep">·</span>
|
||||
<span class="storage-batch-chip__code">编号 {{ item.code }}</span>
|
||||
</template>
|
||||
</span>
|
||||
<span
|
||||
v-if="batchChildPreview.count > batchChildPreview.samples.length"
|
||||
class="storage-batch-chip storage-batch-chip--more"
|
||||
>
|
||||
…共 {{ batchChildPreview.count }} 个
|
||||
</span>
|
||||
</template>
|
||||
</template>
|
||||
<template v-else>请填写有效的序号范围(结束 ≥ 起始,单次最多 200 个)</template>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button class="btn-ghost" @click="batchChildDialogVisible = false">
|
||||
<el-icon><Close /></el-icon>
|
||||
取消
|
||||
</el-button>
|
||||
<el-button
|
||||
class="btn-main"
|
||||
type="primary"
|
||||
:loading="batchChildSubmitLoading"
|
||||
@click="handleBatchChildSubmit"
|
||||
>
|
||||
<el-icon><Check /></el-icon>
|
||||
确定创建
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 格子编辑弹窗 -->
|
||||
<el-dialog
|
||||
v-model="slotDialogVisible"
|
||||
@@ -851,6 +1052,7 @@
|
||||
import {
|
||||
fetchStorageFacilityList,
|
||||
fetchCreateStorageFacility,
|
||||
fetchBatchCreateStorageFacilities,
|
||||
fetchUpdateStorageFacility,
|
||||
fetchDeleteStorageFacility,
|
||||
fetchStorageSlotList,
|
||||
@@ -1028,6 +1230,7 @@
|
||||
|
||||
const handleNodeClick = (data: any) => {
|
||||
selectedNode.value = data
|
||||
resetSlotFilter()
|
||||
if (data.isLeaf === 1) {
|
||||
loadSlots(data.id)
|
||||
} else {
|
||||
@@ -1048,6 +1251,39 @@
|
||||
}
|
||||
}
|
||||
|
||||
// ==================== 右侧格子检索 ====================
|
||||
const slotFilterKeyword = ref('')
|
||||
|
||||
const slotFilterActive = computed(() => !!slotFilterKeyword.value.trim())
|
||||
|
||||
function slotMatchesFilter(slot: any): boolean {
|
||||
const q = slotFilterKeyword.value.trim().toLowerCase()
|
||||
if (!q) return true
|
||||
|
||||
const cp = slot.storedCellProduct
|
||||
const haystacks = [
|
||||
String(cp?.productName || ''),
|
||||
String(slot.storedItemName || ''),
|
||||
String(cp?.productTypeName || ''),
|
||||
String(cp?.batchNo || '')
|
||||
].map((s) => s.toLowerCase())
|
||||
|
||||
return haystacks.some((text) => text.includes(q))
|
||||
}
|
||||
|
||||
const filteredSlotList = computed(() => {
|
||||
if (!slotFilterActive.value) return slotList.value
|
||||
return slotList.value.filter(slotMatchesFilter)
|
||||
})
|
||||
|
||||
const slotFilterHitCount = computed(() =>
|
||||
slotFilterActive.value ? filteredSlotList.value.length : 0
|
||||
)
|
||||
|
||||
function resetSlotFilter() {
|
||||
slotFilterKeyword.value = ''
|
||||
}
|
||||
|
||||
// ==================== 货架行计算(按 order_num 布局分组) ====================
|
||||
const batchForm = reactive({
|
||||
rows: 4,
|
||||
@@ -1073,7 +1309,7 @@
|
||||
})
|
||||
|
||||
const shelfRows = computed(() => {
|
||||
const sorted = sortSlotsForShelf(slotList.value)
|
||||
const sorted = sortSlotsForShelf(filteredSlotList.value)
|
||||
const hasLayoutOrder = sorted.some((slot) => getStorageSlotOrderNum(slot) >= SLOT_LAYOUT_ROW_STRIDE)
|
||||
|
||||
if (hasLayoutOrder) {
|
||||
@@ -1195,6 +1431,180 @@
|
||||
nextTick(() => nodeFormRef.value?.clearValidate?.())
|
||||
}
|
||||
|
||||
// ==================== 批量新增子节点 ====================
|
||||
const batchChildDialogVisible = ref(false)
|
||||
const batchChildSubmitLoading = ref(false)
|
||||
const batchChildFormRef = ref()
|
||||
const batchChildParentId = ref('')
|
||||
const batchChildForm = reactive({
|
||||
namePrefix: '',
|
||||
nameSuffix: '',
|
||||
startNum: 1,
|
||||
endNum: 10,
|
||||
padWidth: 2,
|
||||
codePrefix: '',
|
||||
codeSuffix: '',
|
||||
nodeType: 'box',
|
||||
isLeaf: 1 as 0 | 1,
|
||||
remark: ''
|
||||
})
|
||||
|
||||
const batchChildParentPath = computed(() => {
|
||||
if (!batchChildParentId.value) return '(根节点)'
|
||||
return (
|
||||
buildTreePathLabelFromFlat(batchChildParentId.value, flatList.value, {
|
||||
nameKey: 'nodeName'
|
||||
}) || '—'
|
||||
)
|
||||
})
|
||||
|
||||
function formatBatchSeq(num: number, padWidth: number) {
|
||||
const s = String(num)
|
||||
const width = Number(padWidth) || 0
|
||||
if (width <= 0) return s
|
||||
return s.padStart(width, '0')
|
||||
}
|
||||
|
||||
const batchChildPreview = computed(() => {
|
||||
const start = Number(batchChildForm.startNum)
|
||||
const end = Number(batchChildForm.endNum)
|
||||
if (!Number.isFinite(start) || !Number.isFinite(end) || end < start) {
|
||||
return { count: 0, samples: [] as Array<{ name: string; code: string }> }
|
||||
}
|
||||
const count = end - start + 1
|
||||
if (count > 200) {
|
||||
return { count: 0, samples: [] as Array<{ name: string; code: string }> }
|
||||
}
|
||||
const genCode = !!(batchChildForm.codePrefix.trim() || batchChildForm.codeSuffix.trim())
|
||||
const samples: Array<{ name: string; code: string }> = []
|
||||
const showMax = Math.min(count, 12)
|
||||
for (let i = 0; i < showMax; i++) {
|
||||
const num = start + i
|
||||
const seq = formatBatchSeq(num, batchChildForm.padWidth)
|
||||
const name = `${batchChildForm.namePrefix}${seq}${batchChildForm.nameSuffix}`.trim()
|
||||
const code = genCode
|
||||
? `${batchChildForm.codePrefix}${seq}${batchChildForm.codeSuffix}`.trim()
|
||||
: ''
|
||||
samples.push({ name: name || '(空名称)', code })
|
||||
}
|
||||
return { count, samples }
|
||||
})
|
||||
|
||||
const validateBatchChildName = (_rule: any, _value: any, callback: (e?: Error) => void) => {
|
||||
const start = Number(batchChildForm.startNum)
|
||||
const end = Number(batchChildForm.endNum)
|
||||
if (!Number.isFinite(start) || !Number.isFinite(end) || end < start) {
|
||||
callback()
|
||||
return
|
||||
}
|
||||
const seq = formatBatchSeq(start, batchChildForm.padWidth)
|
||||
const name = `${batchChildForm.namePrefix}${seq}${batchChildForm.nameSuffix}`.trim()
|
||||
if (!name) {
|
||||
callback(new Error('拼出的节点名称不能为空,请填写前缀或后缀'))
|
||||
return
|
||||
}
|
||||
callback()
|
||||
}
|
||||
|
||||
const validateBatchChildRange = (_rule: any, _value: any, callback: (e?: Error) => void) => {
|
||||
const start = Number(batchChildForm.startNum)
|
||||
const end = Number(batchChildForm.endNum)
|
||||
if (!Number.isFinite(start) || !Number.isFinite(end)) {
|
||||
callback(new Error('请输入有效序号'))
|
||||
return
|
||||
}
|
||||
if (end < start) {
|
||||
callback(new Error('结束序号不能小于起始序号'))
|
||||
return
|
||||
}
|
||||
if (end - start + 1 > 200) {
|
||||
callback(new Error('单次最多创建 200 个子节点'))
|
||||
return
|
||||
}
|
||||
callback()
|
||||
}
|
||||
|
||||
const batchChildFormRules = {
|
||||
startNum: [
|
||||
{ required: true, message: '请输入起始序号', trigger: 'change' },
|
||||
{ validator: validateBatchChildRange, trigger: 'change' },
|
||||
{ validator: validateBatchChildName, trigger: 'change' }
|
||||
],
|
||||
endNum: [{ validator: validateBatchChildRange, trigger: 'change' }],
|
||||
nodeType: [{ required: true, message: '请选择节点类型', trigger: 'change' }]
|
||||
}
|
||||
|
||||
const handleBatchAddChild = (data: any) => {
|
||||
batchChildParentId.value = data.id
|
||||
Object.assign(batchChildForm, {
|
||||
namePrefix: '',
|
||||
nameSuffix: '',
|
||||
startNum: 1,
|
||||
endNum: 10,
|
||||
padWidth: 2,
|
||||
codePrefix: '',
|
||||
codeSuffix: '',
|
||||
nodeType: data.nodeType === 'facility' ? 'layer' : 'box',
|
||||
isLeaf: data.nodeType === 'layer' || data.nodeType === 'box' ? 1 : 0,
|
||||
remark: ''
|
||||
})
|
||||
batchChildDialogVisible.value = true
|
||||
nextTick(() => batchChildFormRef.value?.clearValidate?.())
|
||||
}
|
||||
|
||||
const handleBatchChildSubmit = async () => {
|
||||
await batchChildFormRef.value?.validate?.()
|
||||
if (batchChildPreview.value.count <= 0) {
|
||||
ElMessage.warning('请填写有效的序号范围')
|
||||
return
|
||||
}
|
||||
const sampleName = batchChildPreview.value.samples[0]?.name
|
||||
if (!sampleName || sampleName === '(空名称)') {
|
||||
ElMessage.warning('拼出的节点名称不能为空,请填写前缀或后缀')
|
||||
return
|
||||
}
|
||||
batchChildSubmitLoading.value = true
|
||||
try {
|
||||
await fetchBatchCreateStorageFacilities({
|
||||
parentId: batchChildParentId.value || undefined,
|
||||
namePrefix: batchChildForm.namePrefix,
|
||||
nameSuffix: batchChildForm.nameSuffix,
|
||||
startNum: Number(batchChildForm.startNum),
|
||||
endNum: Number(batchChildForm.endNum),
|
||||
padWidth: Number(batchChildForm.padWidth) || 0,
|
||||
codePrefix: batchChildForm.codePrefix,
|
||||
codeSuffix: batchChildForm.codeSuffix,
|
||||
nodeType: batchChildForm.nodeType,
|
||||
isLeaf: batchChildForm.isLeaf,
|
||||
remark: batchChildForm.remark?.trim() || undefined
|
||||
})
|
||||
ElMessage.success(`批量创建 ${batchChildPreview.value.count} 个子节点成功`)
|
||||
batchChildDialogVisible.value = false
|
||||
await loadData()
|
||||
} catch {
|
||||
/* 接口错误已由全局处理 */
|
||||
} finally {
|
||||
batchChildSubmitLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const handleBatchChildDialogClose = () => {
|
||||
batchChildParentId.value = ''
|
||||
Object.assign(batchChildForm, {
|
||||
namePrefix: '',
|
||||
nameSuffix: '',
|
||||
startNum: 1,
|
||||
endNum: 10,
|
||||
padWidth: 2,
|
||||
codePrefix: '',
|
||||
codeSuffix: '',
|
||||
nodeType: 'box',
|
||||
isLeaf: 1,
|
||||
remark: ''
|
||||
})
|
||||
batchChildFormRef.value?.clearValidate?.()
|
||||
}
|
||||
|
||||
const handleEditNode = (data: any) => {
|
||||
isNodeEdit.value = true
|
||||
nodeDialogTitle.value = '编辑节点'
|
||||
@@ -1829,6 +2239,17 @@
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
}
|
||||
|
||||
.storage-slot-filter {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.storage-slot-filter__input {
|
||||
width: 100%;
|
||||
max-width: 420px;
|
||||
}
|
||||
|
||||
.storage-content-stats {
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
@@ -1869,7 +2290,94 @@
|
||||
padding: 10px 14px;
|
||||
font-size: 13px;
|
||||
color: #065f46;
|
||||
margin-top: 4px;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.storage-name-compose {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: flex-end;
|
||||
gap: 8px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.storage-compose-field {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.storage-compose-label {
|
||||
font-size: 12px;
|
||||
line-height: 1.2;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.storage-affix-input {
|
||||
width: 100px;
|
||||
|
||||
:deep(.el-input__wrapper) {
|
||||
padding-left: 8px;
|
||||
padding-right: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.storage-seq-input,
|
||||
.storage-pad-input {
|
||||
:deep(.el-input__wrapper) {
|
||||
padding-left: 8px;
|
||||
padding-right: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.storage-seq-input {
|
||||
width: 72px;
|
||||
}
|
||||
|
||||
.storage-pad-input {
|
||||
width: 64px;
|
||||
}
|
||||
|
||||
.storage-compose-sep,
|
||||
.storage-compose-mid {
|
||||
flex: 0 0 auto;
|
||||
align-self: flex-end;
|
||||
height: 32px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
font-size: 12px;
|
||||
white-space: nowrap;
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
|
||||
.storage-batch-chip {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
height: 26px;
|
||||
margin: 4px 6px 0 0;
|
||||
padding: 0 8px;
|
||||
border-radius: 6px;
|
||||
background: #fff;
|
||||
border: 1px solid #a7f3d0;
|
||||
color: #1e293b;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.storage-batch-chip__sep {
|
||||
margin: 0 4px;
|
||||
color: #94a3b8;
|
||||
}
|
||||
|
||||
.storage-batch-chip__code {
|
||||
color: var(--primary-dark, #059669);
|
||||
}
|
||||
|
||||
.storage-batch-chip--more {
|
||||
border-style: dashed;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
/* Shelf layout — scroll wrapper for overflow */
|
||||
@@ -1962,22 +2470,25 @@
|
||||
background: #fff7ed;
|
||||
}
|
||||
|
||||
/* 占用状态 — 深橙背景 */
|
||||
/* 占用状态 — 淡红背景 */
|
||||
&.occupied {
|
||||
background: #ea580c;
|
||||
border-color: #c2410c;
|
||||
background: #fef2f2;
|
||||
border-color: #fecaca;
|
||||
|
||||
&:hover {
|
||||
background: #c2410c;
|
||||
background: #fee2e2;
|
||||
}
|
||||
|
||||
.cell-code {
|
||||
color: #fff;
|
||||
.cell-empty {
|
||||
color: #991b1b;
|
||||
}
|
||||
|
||||
.cell-product-code,
|
||||
.cell-product-name {
|
||||
color: rgba(255, 255, 255, 0.92);
|
||||
color: #991b1b;
|
||||
}
|
||||
|
||||
.cell-product-type {
|
||||
color: #b91c1c;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2031,56 +2542,32 @@
|
||||
}
|
||||
}
|
||||
|
||||
.cell-code {
|
||||
.cell-empty {
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
max-width: 72px;
|
||||
padding: 0 4px;
|
||||
}
|
||||
|
||||
.cell-product-code,
|
||||
.cell-product-name {
|
||||
.cell-product-name,
|
||||
.cell-product-type {
|
||||
text-align: center;
|
||||
max-width: 72px;
|
||||
padding: 0 2px;
|
||||
}
|
||||
|
||||
.cell-product-code {
|
||||
font-size: 9px;
|
||||
color: #047857;
|
||||
line-height: 1.15;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
word-break: break-all;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.cell-product-name {
|
||||
font-size: 9px;
|
||||
color: #64748b;
|
||||
line-height: 1.15;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.cell-badge {
|
||||
position: absolute;
|
||||
top: 4px;
|
||||
right: 4px;
|
||||
min-width: 20px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
font-size: 11px;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
background: #f56c6c;
|
||||
border-radius: 8px;
|
||||
padding: 0 4px;
|
||||
.cell-product-type {
|
||||
font-size: 9px;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.occupancy-list-toolbar {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
<el-form-item label="关键词">
|
||||
<el-input v-model="searchForm.keyword" placeholder="物料编码/名称/批次号" clearable />
|
||||
<el-input v-model="searchForm.keyword" placeholder="物料名称/批次号" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料类型">
|
||||
<el-select v-model="searchForm.materialType" placeholder="全部" clearable>
|
||||
@@ -50,13 +50,6 @@
|
||||
header-align="center"
|
||||
:index="(index) => (pagination.page - 1) * pagination.pageSize + index + 1"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="materialCode"
|
||||
label="物料编码"
|
||||
min-width="120"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="materialName"
|
||||
label="物料名称"
|
||||
@@ -64,6 +57,9 @@
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column label="批次号" min-width="120" align="center" header-align="center">
|
||||
<template #default="{ row }">{{ row.batchNo || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料类型" min-width="90" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="row.materialType === 'reagent' ? 'success' : 'warning'" size="small">
|
||||
@@ -71,18 +67,6 @@
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="批次号" min-width="120" align="center" header-align="center">
|
||||
<template #default="{ row }">{{ row.batchNo || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="stockInNo"
|
||||
label="入库编号"
|
||||
min-width="120"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">{{ row.stockInNo || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="消耗数量" min-width="100" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
{{ displayConsumptionQty(row) }}
|
||||
|
||||
+4
-10
@@ -24,13 +24,6 @@
|
||||
:scroll-into-view-options="{ behavior: 'smooth', block: 'center' }"
|
||||
>
|
||||
<div class="form-grid-2">
|
||||
<el-form-item label="物料编码" prop="materialCode">
|
||||
<el-input
|
||||
v-model="formData.materialCode"
|
||||
placeholder="请输入物料编码"
|
||||
:disabled="isEdit"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料名称" prop="materialName">
|
||||
<el-input v-model="formData.materialName" placeholder="请输入物料名称" />
|
||||
</el-form-item>
|
||||
@@ -85,7 +78,7 @@
|
||||
<el-option
|
||||
v-for="opt in componentOptions"
|
||||
:key="opt.id"
|
||||
:label="`${opt.materialName}(${opt.materialCode})`"
|
||||
:label="opt.materialName"
|
||||
:value="opt.id"
|
||||
/>
|
||||
</el-select>
|
||||
@@ -170,7 +163,6 @@
|
||||
remark: ''
|
||||
})
|
||||
const formRules: FormRules = {
|
||||
materialCode: [{ required: true, message: '请输入物料编码', trigger: 'blur' }],
|
||||
materialName: [{ required: true, message: '请输入物料名称', trigger: 'blur' }]
|
||||
}
|
||||
|
||||
@@ -317,9 +309,11 @@
|
||||
saving.value = true
|
||||
try {
|
||||
let id = materialId.value
|
||||
const materialCode =
|
||||
(formData.materialCode || '').trim() || `PM-${String(Date.now()).slice(-6)}`
|
||||
const payload = {
|
||||
materialType: 'configured_reagent',
|
||||
materialCode: formData.materialCode.trim(),
|
||||
materialCode,
|
||||
materialName: formData.materialName.trim(),
|
||||
specModel: formData.specModel.trim(),
|
||||
unit: formData.unit.trim(),
|
||||
|
||||
@@ -139,13 +139,6 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="入库编号">
|
||||
<el-input
|
||||
v-model="formData.stockInNo"
|
||||
:placeholder="dialogReadonly ? '' : '留空自动生成'"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="入库日期" prop="stockInDate">
|
||||
<el-date-picker
|
||||
v-model="formData.stockInDate"
|
||||
@@ -164,13 +157,6 @@
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="货号">
|
||||
<el-input
|
||||
v-model="formData.catalogNo"
|
||||
:placeholder="dialogReadonly ? '' : '留空自动生成'"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="批号">
|
||||
<el-input
|
||||
v-model="formData.batchNo"
|
||||
@@ -248,15 +234,6 @@
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
label="物料编码"
|
||||
min-width="120"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="{ row }">{{ row.materialCode || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="物料名称"
|
||||
min-width="140"
|
||||
@@ -266,6 +243,14 @@
|
||||
>
|
||||
<template #default="{ row }">{{ row.materialName || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="批次号"
|
||||
min-width="120"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">{{ row.batchNo || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="物料类型"
|
||||
min-width="90"
|
||||
@@ -281,34 +266,6 @@
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="dialogReadonly"
|
||||
label="入库编号"
|
||||
min-width="120"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="{ row }">{{ row.stockInNo || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="批次号"
|
||||
min-width="120"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">{{ row.batchNo || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="dialogReadonly"
|
||||
label="货号"
|
||||
min-width="100"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="{ row }">{{ row.catalogNo || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="dialogReadonly"
|
||||
label="厂家"
|
||||
@@ -412,7 +369,7 @@
|
||||
<div class="material-select-filter">
|
||||
<el-input
|
||||
v-model="materialKeyword"
|
||||
placeholder="搜索物料名称/编码/领用人/入库编号/批号"
|
||||
placeholder="搜索物料名称/领用人/批号"
|
||||
clearable
|
||||
class="material-select-search"
|
||||
@input="loadAvailableMaterials"
|
||||
@@ -444,14 +401,6 @@
|
||||
@selection-change="handleMaterialSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" min-width="55" align="center" header-align="center" />
|
||||
<el-table-column
|
||||
prop="materialCode"
|
||||
label="物料编码"
|
||||
min-width="120"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="materialName"
|
||||
label="物料名称"
|
||||
@@ -460,6 +409,23 @@
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="batchNo"
|
||||
label="批号"
|
||||
min-width="120"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="stockInDate"
|
||||
label="入库日期"
|
||||
min-width="110"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">{{ formatDisplayOrDash(row.stockInDate) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="类型" min-width="80" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="row.materialType === 'reagent' ? 'success' : 'warning'" size="small">
|
||||
@@ -477,41 +443,6 @@
|
||||
>
|
||||
<template #default="{ row }">{{ row.specModel || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="catalogNo"
|
||||
label="货号"
|
||||
min-width="100"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="{ row }">{{ row.catalogNo || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="stockInNo"
|
||||
label="入库编号"
|
||||
min-width="120"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="stockInDate"
|
||||
label="入库日期"
|
||||
min-width="110"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">{{ formatDisplayOrDash(row.stockInDate) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="batchNo"
|
||||
label="批号"
|
||||
min-width="120"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="expireDate"
|
||||
label="过期日期"
|
||||
|
||||
+20
-62
@@ -235,7 +235,7 @@
|
||||
<el-input
|
||||
v-model="requisitionKeyword"
|
||||
class="unused-list-search"
|
||||
placeholder="搜索物料/批号/入库编号/领用人"
|
||||
placeholder="搜索物料/批号/领用人"
|
||||
clearable
|
||||
@input="debouncedLoadRequisitions"
|
||||
/>
|
||||
@@ -305,7 +305,7 @@
|
||||
</div>
|
||||
<div class="unused-line-item__meta">
|
||||
<span>{{ line.unusedQty }}{{ line.unit || '' }}</span>
|
||||
<span>{{ line.batchNo || line.stockInNo || '—' }}</span>
|
||||
<span>{{ line.batchNo || '—' }}</span>
|
||||
</div>
|
||||
<div class="unused-line-item__actions" @click.stop>
|
||||
<el-button link type="danger" size="small" @click="removeManualLine(line._key)">
|
||||
@@ -323,8 +323,7 @@
|
||||
<div>
|
||||
<h3 class="unused-detail-title">{{ activeRequisition.materialName }}</h3>
|
||||
<p class="unused-detail-sub">
|
||||
{{ activeRequisition.stockInNo || '—' }} · 批号
|
||||
{{ activeRequisition.batchNo || '—' }} · 领用
|
||||
批号 {{ activeRequisition.batchNo || '—' }} · 领用
|
||||
{{ activeRequisition.requisitionQty }}{{ activeRequisition.unit || '' }}
|
||||
<template v-if="activeRequisition.taskConsumedQty > 0">
|
||||
· 任务已消耗 {{ activeRequisition.taskConsumedQty
|
||||
@@ -407,7 +406,7 @@
|
||||
filterable
|
||||
remote
|
||||
clearable
|
||||
placeholder="输入入库编号、物料名称、批号检索"
|
||||
placeholder="输入物料名称、批号检索"
|
||||
popper-class="batch-out-option-popper"
|
||||
style="width: 100%"
|
||||
:loading="batchOptionsLoading"
|
||||
@@ -422,10 +421,10 @@
|
||||
>
|
||||
<div class="batch-option-item">
|
||||
<span class="batch-option-main"
|
||||
>{{ opt.stockInNo }} · {{ opt.materialName }}</span
|
||||
>{{ opt.materialName }} · 批号 {{ opt.batchNo || '—' }}</span
|
||||
>
|
||||
<span class="batch-option-sub">
|
||||
批号:{{ opt.batchNo || '—' }} · 剩余 {{ opt.remainingQty
|
||||
剩余 {{ opt.remainingQty
|
||||
}}{{ opt.unit || '' }}
|
||||
</span>
|
||||
</div>
|
||||
@@ -434,9 +433,6 @@
|
||||
</el-form-item>
|
||||
<div v-if="manualDraft.fromBatch" class="unused-readonly-grid">
|
||||
<div><span class="ro-label">物料</span>{{ manualDraft.materialName || '—' }}</div>
|
||||
<div
|
||||
><span class="ro-label">入库编号</span>{{ manualDraft.stockInNo || '—' }}</div
|
||||
>
|
||||
<div><span class="ro-label">批号</span>{{ manualDraft.batchNo || '—' }}</div>
|
||||
<div><span class="ro-label">规格</span>{{ manualDraft.specModel || '—' }}</div>
|
||||
<div><span class="ro-label">厂家</span>{{ manualDraft.manufacturer || '—' }}</div>
|
||||
@@ -548,12 +544,16 @@
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
label="入库编号"
|
||||
min-width="110"
|
||||
label="物料名称"
|
||||
min-width="130"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="{ row }">{{ displayText(row.stockInNo) }}</template>
|
||||
<template #default="{ row }">{{ displayText(row.materialName) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="批号" min-width="90" align="center" header-align="center">
|
||||
<template #default="{ row }">{{ displayText(row.batchNo) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="入库日期"
|
||||
@@ -571,23 +571,6 @@
|
||||
>
|
||||
<template #default="{ row }">{{ displayText(row.expireDate) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="物料编码"
|
||||
min-width="110"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">{{ displayText(row.materialCode) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="物料名称"
|
||||
min-width="130"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="{ row }">{{ displayText(row.materialName) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="规格型号"
|
||||
min-width="100"
|
||||
@@ -600,12 +583,6 @@
|
||||
<el-table-column label="单位" min-width="72" align="center" header-align="center">
|
||||
<template #default="{ row }">{{ displayText(row.unit) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="货号" min-width="100" align="center" header-align="center">
|
||||
<template #default="{ row }">{{ displayText(row.catalogNo) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="批号" min-width="90" align="center" header-align="center">
|
||||
<template #default="{ row }">{{ displayText(row.batchNo) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="厂家"
|
||||
min-width="110"
|
||||
@@ -669,12 +646,16 @@
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
label="入库编号"
|
||||
min-width="110"
|
||||
label="物料名称"
|
||||
min-width="130"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="{ row }">{{ displayText(row.stockInNo) }}</template>
|
||||
<template #default="{ row }">{{ displayText(row.materialName) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="批号" min-width="90" align="center" header-align="center">
|
||||
<template #default="{ row }">{{ displayText(row.batchNo) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="入库日期"
|
||||
@@ -692,23 +673,6 @@
|
||||
>
|
||||
<template #default="{ row }">{{ displayText(row.expireDate) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="物料编码"
|
||||
min-width="110"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">{{ displayText(row.materialCode) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="物料名称"
|
||||
min-width="130"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="{ row }">{{ displayText(row.materialName) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="规格型号"
|
||||
min-width="100"
|
||||
@@ -721,12 +685,6 @@
|
||||
<el-table-column label="单位" min-width="72" align="center" header-align="center">
|
||||
<template #default="{ row }">{{ displayText(row.unit) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="货号" min-width="100" align="center" header-align="center">
|
||||
<template #default="{ row }">{{ displayText(row.catalogNo) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="批号" min-width="90" align="center" header-align="center">
|
||||
<template #default="{ row }">{{ displayText(row.batchNo) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="厂家"
|
||||
min-width="110"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<el-form-item label="关键词">
|
||||
<el-input
|
||||
v-model="searchForm.keyword"
|
||||
placeholder="物料编码/名称/入库编号/批号/货号"
|
||||
placeholder="物料名称/批号"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -85,13 +85,6 @@
|
||||
header-align="center"
|
||||
:index="(index) => (pagination.page - 1) * pagination.pageSize + index + 1"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="materialCode"
|
||||
label="物料编码"
|
||||
min-width="120"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="materialName"
|
||||
label="物料名称"
|
||||
@@ -99,6 +92,12 @@
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column label="批号" min-width="100" align="center" header-align="center">
|
||||
<template #default="{ row }">{{ row.batchNo || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="入库日期" min-width="110" align="center" header-align="center">
|
||||
<template #default="{ row }">{{ formatDisplayOrDash(row.stockInDate) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料类型" min-width="100" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="productionMaterialTypeTagType(row.materialType)" size="small">
|
||||
@@ -106,24 +105,6 @@
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="stockInNo"
|
||||
label="入库编号"
|
||||
min-width="120"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">{{ row.stockInNo || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="入库日期" min-width="110" align="center" header-align="center">
|
||||
<template #default="{ row }">{{ formatDisplayOrDash(row.stockInDate) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="货号" min-width="100" align="center" header-align="center">
|
||||
<template #default="{ row }">{{ row.catalogNo || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="批号" min-width="100" align="center" header-align="center">
|
||||
<template #default="{ row }">{{ row.batchNo || '—' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="厂家"
|
||||
min-width="120"
|
||||
@@ -646,17 +627,14 @@
|
||||
{
|
||||
title: '变动信息',
|
||||
fields: [
|
||||
{ label: '物料编码', value: row.materialCode },
|
||||
{ label: '物料名称', value: row.materialName },
|
||||
{ label: '批号', value: row.batchNo || '—' },
|
||||
{ label: '入库日期', value: row.stockInDate || '—' },
|
||||
{
|
||||
label: '物料类型',
|
||||
value: productionMaterialTypeLabel(row.materialType),
|
||||
tagType: productionMaterialTypeTagType(row.materialType) as any
|
||||
},
|
||||
{ label: '入库编号', value: row.stockInNo || '—' },
|
||||
{ label: '入库日期', value: row.stockInDate || '—' },
|
||||
{ label: '货号', value: row.catalogNo || '—' },
|
||||
{ label: '批号', value: row.batchNo || '—' },
|
||||
{ label: '厂家', value: row.manufacturer || '—' },
|
||||
{
|
||||
label: '单价(元)',
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
<el-form-item label="关键词">
|
||||
<el-input v-model="searchForm.keyword" placeholder="物料编码/名称" clearable />
|
||||
<el-input v-model="searchForm.keyword" placeholder="物料名称/批号" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料类型">
|
||||
<el-select v-model="searchForm.materialType" placeholder="全部" clearable>
|
||||
@@ -106,9 +106,16 @@
|
||||
:index="(index) => (pagination.page - 1) * pagination.pageSize + index + 1"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="stockInNo"
|
||||
label="入库编号"
|
||||
min-width="120"
|
||||
prop="materialName"
|
||||
label="物料名称"
|
||||
min-width="150"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="batchNo"
|
||||
label="批号"
|
||||
min-width="100"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
@@ -133,20 +140,6 @@
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="materialCode"
|
||||
label="物料编码"
|
||||
min-width="130"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="materialName"
|
||||
label="物料名称"
|
||||
min-width="150"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column label="物料类型" min-width="100" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="productionMaterialTypeTagType(row.materialType)" size="small">
|
||||
@@ -168,20 +161,6 @@
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="catalogNo"
|
||||
label="货号"
|
||||
min-width="100"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="batchNo"
|
||||
label="批号"
|
||||
min-width="100"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="manufacturer"
|
||||
label="厂家"
|
||||
@@ -303,15 +282,9 @@
|
||||
<el-form-item label="物资" prop="materialName">
|
||||
<el-input v-model="formData.materialName" placeholder="请输入物资名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料编码" prop="materialCode">
|
||||
<el-input v-model="formData.materialCode" placeholder="请输入物料编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="规格型号" prop="specModel">
|
||||
<el-input v-model="formData.specModel" placeholder="请输入规格型号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="入库编号" prop="stockInNo">
|
||||
<el-input v-model="formData.stockInNo" placeholder="请输入入库编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="入库日期" prop="stockInDate">
|
||||
<el-date-picker
|
||||
v-model="formData.stockInDate"
|
||||
@@ -339,9 +312,6 @@
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="货号" prop="catalogNo">
|
||||
<el-input v-model="formData.catalogNo" placeholder="请输入货号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="批号" prop="batchNo">
|
||||
<el-input v-model="formData.batchNo" placeholder="请输入批号" />
|
||||
</el-form-item>
|
||||
@@ -461,7 +431,7 @@
|
||||
<el-option
|
||||
v-for="opt in materialOptions"
|
||||
:key="opt.id"
|
||||
:label="`${opt.materialName}(${opt.materialCode})`"
|
||||
:label="opt.materialName"
|
||||
:value="opt.id"
|
||||
/>
|
||||
</el-select>
|
||||
@@ -480,19 +450,6 @@
|
||||
<el-option label="耗材" value="consumable" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料编码" prop="newMaterialCode">
|
||||
<el-input
|
||||
v-if="stockInIsManualMaterial"
|
||||
v-model="stockInForm.newMaterialCode"
|
||||
placeholder="新物资编码"
|
||||
/>
|
||||
<el-input
|
||||
v-else
|
||||
:model-value="stockInSelectedOpt?.materialCode || ''"
|
||||
disabled
|
||||
placeholder="选择物资后自动带出"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="规格型号">
|
||||
<el-input
|
||||
v-if="stockInIsManualMaterial"
|
||||
@@ -506,9 +463,6 @@
|
||||
placeholder="—"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="入库编号" prop="stockInNo">
|
||||
<el-input v-model="stockInForm.stockInNo" placeholder="请输入入库编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="入库日期" prop="stockInDate">
|
||||
<el-date-picker
|
||||
v-model="stockInForm.stockInDate"
|
||||
@@ -536,9 +490,6 @@
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="货号" prop="catalogNo">
|
||||
<el-input v-model="stockInForm.catalogNo" placeholder="请输入货号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="批号" prop="batchNo">
|
||||
<el-input v-model="stockInForm.batchNo" placeholder="请输入批号" />
|
||||
</el-form-item>
|
||||
@@ -713,7 +664,7 @@
|
||||
<el-option
|
||||
v-for="opt in materialOptions"
|
||||
:key="opt.id"
|
||||
:label="`${opt.materialName}(${opt.materialCode})`"
|
||||
:label="opt.materialName"
|
||||
:value="opt.id"
|
||||
/>
|
||||
</el-select>
|
||||
@@ -734,9 +685,6 @@
|
||||
placeholder="选择物资后自动带出"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="入库编号">
|
||||
<el-input v-model="row.stockInNo" size="small" placeholder="必填" />
|
||||
</el-form-item>
|
||||
<el-form-item label="入库日期">
|
||||
<el-date-picker
|
||||
v-model="row.stockInDate"
|
||||
@@ -767,9 +715,6 @@
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="货号">
|
||||
<el-input v-model="row.catalogNo" size="small" placeholder="必填" />
|
||||
</el-form-item>
|
||||
<el-form-item label="批号">
|
||||
<el-input v-model="row.batchNo" size="small" placeholder="必填" />
|
||||
</el-form-item>
|
||||
@@ -903,7 +848,7 @@
|
||||
<div class="batch-stock-move-lines-head-left">
|
||||
<span class="batch-stock-move-lines-title">出库明细</span>
|
||||
<span class="batch-stock-move-lines-hint">
|
||||
共 {{ batchStockOutLines.length }} 项,按入库编号选择批次
|
||||
共 {{ batchStockOutLines.length }} 项,按物料与批号选择批次
|
||||
</span>
|
||||
</div>
|
||||
<el-button class="btn-ghost" @click="addBatchStockOutLine">
|
||||
@@ -926,7 +871,7 @@
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
label="入库编号"
|
||||
label="物料批次"
|
||||
min-width="280"
|
||||
align="center"
|
||||
header-align="center"
|
||||
@@ -937,7 +882,7 @@
|
||||
filterable
|
||||
remote
|
||||
clearable
|
||||
placeholder="选择入库批次"
|
||||
placeholder="选择物料批次"
|
||||
class="inner-cell-input batch-out-select"
|
||||
popper-class="batch-out-option-popper"
|
||||
:loading="batchOptionsLoading"
|
||||
@@ -947,17 +892,16 @@
|
||||
<el-option
|
||||
v-for="opt in batchOptions"
|
||||
:key="opt.id"
|
||||
:label="opt.label"
|
||||
:label="`${opt.materialName} · 批号 ${opt.batchNo || '—'}`"
|
||||
:value="opt.id"
|
||||
:disabled="isBatchOutOptionDisabled(opt.id, $index)"
|
||||
>
|
||||
<div class="batch-option-item">
|
||||
<span class="batch-option-main"
|
||||
>{{ opt.stockInNo }} · {{ opt.materialName }}</span
|
||||
>{{ opt.materialName }} · 批号 {{ opt.batchNo || '—' }}</span
|
||||
>
|
||||
<span class="batch-option-sub">
|
||||
厂家:{{ opt.manufacturer || '—' }} · 批号:{{ opt.batchNo || '—' }} ·
|
||||
货号:{{ opt.catalogNo || '—' }} · 剩余 {{ opt.remainingQty
|
||||
厂家:{{ opt.manufacturer || '—' }} · 剩余 {{ opt.remainingQty
|
||||
}}{{ opt.unit || '' }}
|
||||
</span>
|
||||
</div>
|
||||
@@ -1141,7 +1085,7 @@
|
||||
<div class="batch-stock-move-lines-head-left">
|
||||
<span class="batch-stock-move-lines-title">废弃明细</span>
|
||||
<span class="batch-stock-move-lines-hint">
|
||||
共 {{ batchDiscardLines.length }} 项,按入库编号选择批次
|
||||
共 {{ batchDiscardLines.length }} 项,按物料与批号选择批次
|
||||
</span>
|
||||
</div>
|
||||
<el-button class="btn-ghost" @click="addBatchDiscardLine">
|
||||
@@ -1164,7 +1108,7 @@
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
label="入库编号"
|
||||
label="物料批次"
|
||||
min-width="280"
|
||||
align="center"
|
||||
header-align="center"
|
||||
@@ -1175,7 +1119,7 @@
|
||||
filterable
|
||||
remote
|
||||
clearable
|
||||
placeholder="选择入库批次"
|
||||
placeholder="选择物料批次"
|
||||
class="inner-cell-input batch-out-select"
|
||||
popper-class="batch-out-option-popper"
|
||||
:loading="batchOptionsLoading"
|
||||
@@ -1185,17 +1129,16 @@
|
||||
<el-option
|
||||
v-for="opt in batchOptions"
|
||||
:key="opt.id"
|
||||
:label="opt.label"
|
||||
:label="`${opt.materialName} · 批号 ${opt.batchNo || '—'}`"
|
||||
:value="opt.id"
|
||||
:disabled="isBatchDiscardOptionDisabled(opt.id, $index)"
|
||||
>
|
||||
<div class="batch-option-item">
|
||||
<span class="batch-option-main"
|
||||
>{{ opt.stockInNo }} · {{ opt.materialName }}</span
|
||||
>{{ opt.materialName }} · 批号 {{ opt.batchNo || '—' }}</span
|
||||
>
|
||||
<span class="batch-option-sub">
|
||||
厂家:{{ opt.manufacturer || '—' }} · 批号:{{ opt.batchNo || '—' }} ·
|
||||
货号:{{ opt.catalogNo || '—' }} · 剩余 {{ opt.remainingQty
|
||||
厂家:{{ opt.manufacturer || '—' }} · 剩余 {{ opt.remainingQty
|
||||
}}{{ opt.unit || '' }}
|
||||
</span>
|
||||
</div>
|
||||
@@ -1590,15 +1533,12 @@
|
||||
})
|
||||
|
||||
const formRules = {
|
||||
stockInNo: [{ required: true, message: '请输入入库编号', trigger: 'blur' }],
|
||||
stockInDate: [{ required: true, message: '请选择入库日期', trigger: 'change' }],
|
||||
expireDate: [{ required: true, message: '请选择过期日期', trigger: 'change' }],
|
||||
catalogNo: [{ required: true, message: '请输入货号', trigger: 'blur' }],
|
||||
batchNo: [{ required: true, message: '请输入批号', trigger: 'blur' }],
|
||||
manufacturer: [{ required: true, message: '请输入厂家', trigger: 'blur' }],
|
||||
unitPrice: [{ required: true, message: '请输入单价', trigger: 'change' }],
|
||||
amount: [{ required: true, message: '请输入金额', trigger: 'change' }],
|
||||
materialCode: [{ required: true, message: '请输入物料编码', trigger: 'blur' }],
|
||||
materialName: [{ required: true, message: '请输入物料名称', trigger: 'blur' }]
|
||||
}
|
||||
|
||||
@@ -1643,20 +1583,8 @@
|
||||
|
||||
const stockInRules = {
|
||||
materialKey: [{ required: true, message: '请选择或输入物资', trigger: 'change' }],
|
||||
newMaterialCode: [
|
||||
{
|
||||
validator: (_r: unknown, _v: unknown, cb: (e?: Error) => void) => {
|
||||
if (!stockInIsManualMaterial.value) return cb()
|
||||
if (!(stockInForm.newMaterialCode || '').trim()) return cb(new Error('请输入新物资编码'))
|
||||
cb()
|
||||
},
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
stockInNo: [{ required: true, message: '请输入入库编号', trigger: 'blur' }],
|
||||
stockInDate: [{ required: true, message: '请选择入库日期', trigger: 'change' }],
|
||||
expireDate: [{ required: true, message: '请选择过期日期', trigger: 'change' }],
|
||||
catalogNo: [{ required: true, message: '请输入货号', trigger: 'blur' }],
|
||||
batchNo: [{ required: true, message: '请输入批号', trigger: 'blur' }],
|
||||
manufacturer: [{ required: true, message: '请输入厂家', trigger: 'blur' }],
|
||||
unitPrice: [{ required: true, message: '请输入单价', trigger: 'change' }],
|
||||
@@ -1896,12 +1824,11 @@
|
||||
if (!viewRow.value) return []
|
||||
const row = viewRow.value
|
||||
const batchFields = [
|
||||
{ label: '入库编号', value: row.stockInNo },
|
||||
{ label: '物料名称', value: row.materialName },
|
||||
{ label: '批号', value: row.batchNo },
|
||||
{ label: '入库日期', value: row.stockInDate },
|
||||
{ label: '过期日期', value: row.expireDate },
|
||||
{ label: '生产日期', value: row.productionDate || '—' },
|
||||
{ label: '货号', value: row.catalogNo },
|
||||
{ label: '批号', value: row.batchNo },
|
||||
{ label: '厂家', value: row.manufacturer },
|
||||
{ label: '存储位置', value: row.storageLocation || '—' },
|
||||
...(isConfiguredReagentRow(row)
|
||||
@@ -1921,8 +1848,6 @@
|
||||
{
|
||||
title: '物资信息',
|
||||
fields: [
|
||||
{ label: '物料编码', value: row.materialCode },
|
||||
{ label: '物料名称', value: row.materialName },
|
||||
{ label: '规格型号', value: row.specModel },
|
||||
{ label: '单位', value: row.unit },
|
||||
{
|
||||
@@ -2117,6 +2042,35 @@
|
||||
return `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())}`
|
||||
}
|
||||
|
||||
/** 入库编号默认值:RK + 年月日时分秒 + 2 位随机数(与配置试剂入库风格一致) */
|
||||
function generateStockInNo() {
|
||||
const now = new Date()
|
||||
const pad = (n: number) => String(n).padStart(2, '0')
|
||||
const day = `${now.getFullYear()}${pad(now.getMonth() + 1)}${pad(now.getDate())}`
|
||||
const time = `${pad(now.getHours())}${pad(now.getMinutes())}${pad(now.getSeconds())}`
|
||||
const rand = String(Math.floor(Math.random() * 100)).padStart(2, '0')
|
||||
return `RK${day}${time}${rand}`
|
||||
}
|
||||
|
||||
/** 货号默认值:物料编码 → 批号 → — */
|
||||
function resolveCatalogNo(materialCode?: string, batchNo?: string, catalogNo?: string) {
|
||||
const existing = (catalogNo || '').trim()
|
||||
if (existing) return existing
|
||||
const code = (materialCode || '').trim()
|
||||
if (code) return code
|
||||
const batch = (batchNo || '').trim()
|
||||
if (batch) return batch
|
||||
return '—'
|
||||
}
|
||||
|
||||
function ensureNewMaterialCode() {
|
||||
if ((stockInForm.newMaterialCode || '').trim()) return stockInForm.newMaterialCode.trim()
|
||||
const pad = String(Date.now()).slice(-6)
|
||||
const code = `PM-${pad}`
|
||||
stockInForm.newMaterialCode = code
|
||||
return code
|
||||
}
|
||||
|
||||
function onStockInMaterialKeyChange(val: string) {
|
||||
const opt = materialOptions.value.find((o) => o.id === val)
|
||||
if (opt) {
|
||||
@@ -2126,9 +2080,8 @@
|
||||
stockInForm.newUnit = ''
|
||||
} else {
|
||||
stockInForm.materialId = ''
|
||||
if (val && !stockInForm.newMaterialCode) {
|
||||
const pad = String(Date.now()).slice(-6)
|
||||
stockInForm.newMaterialCode = `PM-${pad}`
|
||||
if (val) {
|
||||
ensureNewMaterialCode()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2138,7 +2091,7 @@
|
||||
const name = (stockInForm.materialKey || '').trim()
|
||||
if (!name) throw new Error('请选择或输入物资')
|
||||
const created = await fetchCreateProductionMaterial({
|
||||
materialCode: (stockInForm.newMaterialCode || '').trim(),
|
||||
materialCode: ensureNewMaterialCode(),
|
||||
materialName: name,
|
||||
materialType: stockInForm.newMaterialType || 'consumable',
|
||||
specModel: stockInForm.newSpecModel?.trim() || undefined,
|
||||
@@ -2187,12 +2140,22 @@
|
||||
stockInLoading.value = true
|
||||
try {
|
||||
const materialId = await resolveStockInMaterialId()
|
||||
const materialCode =
|
||||
stockInSelectedOpt.value?.materialCode ||
|
||||
(stockInForm.newMaterialCode || '').trim() ||
|
||||
''
|
||||
const stockInNo = (stockInForm.stockInNo || '').trim() || generateStockInNo()
|
||||
const catalogNo = resolveCatalogNo(
|
||||
materialCode,
|
||||
stockInForm.batchNo,
|
||||
stockInForm.catalogNo
|
||||
)
|
||||
await fetchStockInProductionMaterial(materialId, {
|
||||
stockInNo: stockInForm.stockInNo.trim(),
|
||||
stockInNo,
|
||||
stockInDate: stockInForm.stockInDate,
|
||||
expireDate: stockInForm.expireDate,
|
||||
productionDate: stockInForm.productionDate || undefined,
|
||||
catalogNo: stockInForm.catalogNo.trim(),
|
||||
catalogNo,
|
||||
batchNo: stockInForm.batchNo.trim(),
|
||||
manufacturer: stockInForm.manufacturer.trim(),
|
||||
storageLocation: stockInForm.storageLocation?.trim() || undefined,
|
||||
@@ -2432,10 +2395,6 @@
|
||||
ElMessage.warning('请选择物资')
|
||||
return
|
||||
}
|
||||
if (!line.stockInNo?.trim()) {
|
||||
ElMessage.warning('请填写入库编号')
|
||||
return
|
||||
}
|
||||
if (!line.stockInDate) {
|
||||
ElMessage.warning('请选择入库日期')
|
||||
return
|
||||
@@ -2444,8 +2403,8 @@
|
||||
ElMessage.warning('请选择过期日期')
|
||||
return
|
||||
}
|
||||
if (!line.catalogNo?.trim() || !line.batchNo?.trim() || !line.manufacturer?.trim()) {
|
||||
ElMessage.warning('请填写货号、批号、厂家')
|
||||
if (!line.batchNo?.trim() || !line.manufacturer?.trim()) {
|
||||
ElMessage.warning('请填写批号、厂家')
|
||||
return
|
||||
}
|
||||
if (line.unitPrice == null || line.amount == null) {
|
||||
@@ -2469,13 +2428,13 @@
|
||||
batchStockInLoading.value = true
|
||||
try {
|
||||
const res = await fetchBatchStockInProductionMaterial({
|
||||
items: batchStockInLines.value.map((l) => ({
|
||||
items: batchStockInLines.value.map((l, idx) => ({
|
||||
materialId: l.materialId,
|
||||
stockInNo: l.stockInNo.trim(),
|
||||
stockInNo: (l.stockInNo || '').trim() || `${generateStockInNo()}${String(idx).padStart(2, '0')}`,
|
||||
stockInDate: l.stockInDate,
|
||||
expireDate: l.expireDate,
|
||||
productionDate: l.productionDate || undefined,
|
||||
catalogNo: l.catalogNo.trim(),
|
||||
catalogNo: resolveCatalogNo(l.materialCode, l.batchNo, l.catalogNo),
|
||||
batchNo: l.batchNo.trim(),
|
||||
manufacturer: l.manufacturer.trim(),
|
||||
storageLocation: l.storageLocation?.trim() || undefined,
|
||||
|
||||
@@ -450,11 +450,8 @@
|
||||
form.routeId = ''
|
||||
form.description = ''
|
||||
form.remark = ''
|
||||
if (
|
||||
props.workOrderRow?.workOrderType === 'temporary' &&
|
||||
props.workOrderRow?.workOrderNo
|
||||
) {
|
||||
form.taskName = `${props.workOrderRow.workOrderNo}任务`
|
||||
if (props.workOrderRow?.workOrderType === 'temporary') {
|
||||
form.taskName = '任务'
|
||||
}
|
||||
void remoteSearchRoutes('')
|
||||
}
|
||||
|
||||
+9
-5
@@ -24,12 +24,9 @@
|
||||
/>
|
||||
<span class="production-work-order-card__index">{{ cardIndex(idx) }}</span>
|
||||
<template v-if="isInboundSampleTitle(row)">
|
||||
<span class="production-work-order-card__no">
|
||||
{{ inboundCardTitleLab(row) }} -
|
||||
</span>
|
||||
<SampleCodeWithSpecialDisplay
|
||||
class="production-work-order-card__no"
|
||||
:sample-code="row.sampleCode"
|
||||
:sample-code="inboundCardTitleLab(row)"
|
||||
:is-special="!!row.isSpecial"
|
||||
:special-remark="row.specialRemark"
|
||||
monospace
|
||||
@@ -151,6 +148,9 @@
|
||||
v-if="field.kind === 'tag'"
|
||||
:type="field.getTagType?.(row) || 'info'"
|
||||
size="small"
|
||||
:class="{
|
||||
'production-work-order-card__qc-conclusion': field.label === '质检结论'
|
||||
}"
|
||||
>
|
||||
{{ field.getValue(row) }}
|
||||
</el-tag>
|
||||
@@ -405,7 +405,7 @@
|
||||
|
||||
function cardTitleLabel(row: ProductionWorkOrderItem) {
|
||||
if (isInboundSampleTitle(row)) {
|
||||
return `${inboundCardTitleLab(row)} - ${(row.sampleCode || '').trim() || '—'}`
|
||||
return inboundCardTitleLab(row)
|
||||
}
|
||||
if (isTemporaryWorkOrderTitle(row)) {
|
||||
return (row.remark || '').trim() || row.workOrderNo || '—'
|
||||
@@ -632,6 +632,10 @@
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.production-work-order-card__qc-conclusion.el-tag {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.production-work-order-card__checkbox {
|
||||
flex-shrink: 0;
|
||||
margin-right: -4px;
|
||||
|
||||
@@ -41,16 +41,18 @@
|
||||
lazy
|
||||
>
|
||||
<template #label>
|
||||
<span class="production-task-tabs__label">{{ section.taskName }}</span>
|
||||
<span class="production-task-tabs__label">{{ displayTaskName(section) }}</span>
|
||||
<span class="production-task-tabs__count">
|
||||
{{ section.completedStepCount }}/{{ section.stepCount }}
|
||||
</span>
|
||||
</template>
|
||||
<template v-if="activeTaskKey === section.key">
|
||||
<div class="production-task-tabs__meta">
|
||||
<span v-if="section.taskNo" class="production-task-tabs__meta-item">{{
|
||||
section.taskNo
|
||||
}}</span>
|
||||
<span
|
||||
v-if="section.taskNo && !isTemporaryWorkOrder"
|
||||
class="production-task-tabs__meta-item"
|
||||
>{{ section.taskNo }}</span
|
||||
>
|
||||
<span v-if="section.assigneeUserName" class="production-task-tabs__meta-item">
|
||||
负责人:{{ section.assigneeUserName }}
|
||||
</span>
|
||||
@@ -297,6 +299,22 @@
|
||||
return status === 'dpz' || status === 'jxz'
|
||||
})
|
||||
|
||||
const isTemporaryWorkOrder = computed(() => props.workOrder?.workOrderType === 'temporary')
|
||||
|
||||
/** 临时工单:Tab 标题去掉工单号前缀(如 LSSC…004任务 → 任务) */
|
||||
function displayTaskName(section: ProductionTaskSection) {
|
||||
const raw = String(section.taskName || '').trim()
|
||||
if (!isTemporaryWorkOrder.value) return raw || '生产任务'
|
||||
const woNo = String(
|
||||
props.workOrder?.workOrderNo || section.task?.workOrderNo || ''
|
||||
).trim()
|
||||
if (woNo && raw.startsWith(woNo)) {
|
||||
const stripped = raw.slice(woNo.length).trim()
|
||||
return stripped || '任务'
|
||||
}
|
||||
return raw || '任务'
|
||||
}
|
||||
|
||||
function taskStatusTag(status: string) {
|
||||
const map: Record<string, { label: string; type: string }> = {
|
||||
dpz: { label: '待配置', type: 'info' },
|
||||
|
||||
+20
-13
@@ -247,20 +247,27 @@
|
||||
|
||||
defineOptions({ name: 'QcWorkOrderProtocolPaymentPanel' })
|
||||
|
||||
const props = defineProps<{
|
||||
summary?: QcProtocolPaymentSummary | null
|
||||
/** 嵌入查看弹窗时隐藏区块标题,避免与 section 标题重复 */
|
||||
embedded?: boolean
|
||||
/** 列表卡片等窄区域:单行摘要 + 紧凑明细,不展示表格 */
|
||||
compact?: boolean
|
||||
/** 紧凑摘要行隐藏整体缴费状态 Tag */
|
||||
hideOverallPayStatus?: boolean
|
||||
/** 分期明细 chip 隐藏应缴/实收金额 */
|
||||
hideInstallmentDetailAmounts?: boolean
|
||||
}>()
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
summary?: QcProtocolPaymentSummary | null
|
||||
/** 嵌入查看弹窗时隐藏区块标题,避免与 section 标题重复 */
|
||||
embedded?: boolean
|
||||
/** 列表卡片等窄区域:单行摘要 + 紧凑明细,不展示表格 */
|
||||
compact?: boolean
|
||||
/** 紧凑摘要行隐藏整体缴费状态 Tag */
|
||||
hideOverallPayStatus?: boolean
|
||||
/** 分期明细 chip 隐藏应缴/实收金额 */
|
||||
hideInstallmentDetailAmounts?: boolean
|
||||
/** 紧凑模式下默认展开完整缴费摘要(采集协议单列表卡片) */
|
||||
defaultExpanded?: boolean
|
||||
}>(),
|
||||
{
|
||||
defaultExpanded: false
|
||||
}
|
||||
)
|
||||
|
||||
/** 列表卡片协议费用默认折叠 */
|
||||
const feeExpanded = ref(false)
|
||||
/** 列表卡片协议费用:可由 defaultExpanded 控制初始展开 */
|
||||
const feeExpanded = ref(!!props.defaultExpanded)
|
||||
|
||||
const isInstallment = computed(() => isInstallmentPayMode(props.summary?.payMode || ''))
|
||||
|
||||
|
||||
@@ -86,6 +86,15 @@
|
||||
>
|
||||
{{ workOrderStatusLabel(wo.workOrderStatus) }}
|
||||
</el-tag>
|
||||
<el-tag
|
||||
v-if="wo.qcConclusion"
|
||||
:type="qcWorkOrderConclusionTagType(wo.qcConclusion)"
|
||||
size="small"
|
||||
class="qc-wo-tab__conclusion"
|
||||
>
|
||||
{{ wo.qcConclusionLabel || qcWorkOrderConclusionLabel(wo.qcConclusion) }}
|
||||
</el-tag>
|
||||
<span v-else class="qc-wo-tab__conclusion-empty">—</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -123,7 +132,7 @@
|
||||
import type { QcWorkOrder } from '@/api/qc-work-order'
|
||||
import type { QcTask } from '@/api/qc-task'
|
||||
import type { QcInspectionBatch } from '@/utils/qc-inspection-batch'
|
||||
import { workOrderStatusLabel } from '@/utils/qc-labels'
|
||||
import { workOrderStatusLabel, qcWorkOrderConclusionLabel, qcWorkOrderConclusionTagType } from '@/utils/qc-labels'
|
||||
import type { TagType } from '@/utils/status-tag-registry'
|
||||
import {
|
||||
type QcWorkOrderSampleGroupModel,
|
||||
@@ -651,6 +660,12 @@
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
.qc-wo-tab__conclusion-empty {
|
||||
margin-left: 2px;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.qc-sample-row :deep(.qc-work-order-card) {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
|
||||
@@ -33,6 +33,14 @@
|
||||
<el-tag :type="workOrderStatusTagType(row.workOrderStatus)" size="small">
|
||||
{{ workOrderStatusLabel(row.workOrderStatus) }}
|
||||
</el-tag>
|
||||
<el-tag
|
||||
v-if="row.qcConclusion"
|
||||
:type="qcWorkOrderConclusionTagType(row.qcConclusion)"
|
||||
size="small"
|
||||
>
|
||||
{{ row.qcConclusionLabel || qcWorkOrderConclusionLabel(row.qcConclusion) }}
|
||||
</el-tag>
|
||||
<span v-else class="qc-work-order-card__conclusion-empty">—</span>
|
||||
<el-tag
|
||||
v-if="effectiveCardMeta.showTriggerTag"
|
||||
:type="resolveTriggerTagType(row)"
|
||||
@@ -232,7 +240,7 @@
|
||||
import type { QcWorkOrder, OutboundQcDetailProduct } from '@/api/qc-work-order'
|
||||
import type { QcTask } from '@/api/qc-task'
|
||||
import type { QcInspectionBatch } from '@/utils/qc-inspection-batch'
|
||||
import { workOrderStatusLabel } from '@/utils/qc-labels'
|
||||
import { workOrderStatusLabel, qcWorkOrderConclusionLabel, qcWorkOrderConclusionTagType } from '@/utils/qc-labels'
|
||||
import type { TagType } from '@/utils/status-tag-registry'
|
||||
import { productStatusLabel, productStatusTagType } from '@/utils/status-tag-registry'
|
||||
import {
|
||||
@@ -501,6 +509,11 @@
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.qc-work-order-card__conclusion-empty {
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.qc-work-order-card__index {
|
||||
flex-shrink: 0;
|
||||
font-size: 12px;
|
||||
|
||||
@@ -149,7 +149,9 @@
|
||||
:title="remarkEditTitle"
|
||||
:initial-remark="remarkEditInitialRemark"
|
||||
:initial-work-order-status="remarkEditInitialStatus"
|
||||
:initial-qc-conclusion="remarkEditInitialConclusion"
|
||||
show-work-order-status
|
||||
show-qc-conclusion
|
||||
:submitting="remarkEditLoading"
|
||||
@submit="submitRemarkEdit"
|
||||
/>
|
||||
@@ -391,19 +393,25 @@
|
||||
)
|
||||
const remarkEditInitialRemark = computed(() => remarkEditRow.value?.remark || '')
|
||||
const remarkEditInitialStatus = computed(() => remarkEditRow.value?.workOrderStatus || '')
|
||||
const remarkEditInitialConclusion = computed(() => remarkEditRow.value?.qcConclusion || '')
|
||||
|
||||
function handleEditRemark(row: QcWorkOrder) {
|
||||
remarkEditRow.value = row
|
||||
remarkEditVisible.value = true
|
||||
}
|
||||
|
||||
async function submitRemarkEdit(payload: { remark: string; workOrderStatus?: string }) {
|
||||
async function submitRemarkEdit(payload: {
|
||||
remark: string
|
||||
workOrderStatus?: string
|
||||
qcConclusion?: string
|
||||
}) {
|
||||
if (!remarkEditRow.value?.id) return
|
||||
remarkEditLoading.value = true
|
||||
try {
|
||||
await fetchUpdateQcWorkOrder(remarkEditRow.value.id, {
|
||||
remark: payload.remark,
|
||||
workOrderStatus: payload.workOrderStatus
|
||||
workOrderStatus: payload.workOrderStatus,
|
||||
qcConclusion: payload.qcConclusion
|
||||
})
|
||||
ElMessage.success('保存成功')
|
||||
remarkEditVisible.value = false
|
||||
|
||||
@@ -258,6 +258,47 @@
|
||||
{{ item.labStorageCode || '—' }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="protocol-card__sample-line">
|
||||
<span class="protocol-card__sample-label">接收</span>
|
||||
<span class="protocol-card__sample-value protocol-card__sample-value--reception">
|
||||
<el-tag
|
||||
:type="
|
||||
item.receptionAcceptConclusion
|
||||
? acceptConclusionTagType(item.receptionAcceptConclusion)
|
||||
: 'info'
|
||||
"
|
||||
size="small"
|
||||
>
|
||||
{{
|
||||
item.receptionAcceptConclusion
|
||||
? acceptConclusionLabel(item.receptionAcceptConclusion)
|
||||
: '未接收'
|
||||
}}
|
||||
</el-tag>
|
||||
<span
|
||||
class="protocol-card__sample-remark"
|
||||
:title="item.receptionRemark || undefined"
|
||||
>
|
||||
备注:{{ item.receptionRemark || '—' }}
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="protocol-card__sample-line">
|
||||
<span class="protocol-card__sample-label">质检</span>
|
||||
<span class="protocol-card__sample-value">
|
||||
<el-tag
|
||||
v-if="item.qcConclusion"
|
||||
:type="qcWorkOrderConclusionTagType(item.qcConclusion)"
|
||||
size="small"
|
||||
>
|
||||
{{
|
||||
item.qcConclusionLabel ||
|
||||
qcWorkOrderConclusionLabel(item.qcConclusion)
|
||||
}}
|
||||
</el-tag>
|
||||
<span v-else>—</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -367,7 +408,11 @@
|
||||
donationStatusDisplayLabel,
|
||||
donationStatusTagType,
|
||||
newbornSexLabel,
|
||||
deliveryModeLabel
|
||||
deliveryModeLabel,
|
||||
acceptConclusionLabel,
|
||||
acceptConclusionTagType,
|
||||
qcWorkOrderConclusionLabel,
|
||||
qcWorkOrderConclusionTagType
|
||||
} from '@/utils/status-tag-registry'
|
||||
import {
|
||||
formatProtocolDocDeleteConfirm,
|
||||
@@ -383,6 +428,10 @@
|
||||
labStorageCode: string
|
||||
isSpecial?: boolean
|
||||
specialRemark?: string
|
||||
receptionAcceptConclusion?: string
|
||||
receptionRemark?: string
|
||||
qcConclusion?: string
|
||||
qcConclusionLabel?: string
|
||||
}
|
||||
|
||||
function getSampleItems(row: ResearchDonationRow): DonationSampleItem[] {
|
||||
@@ -395,7 +444,11 @@
|
||||
sampleCode: String(rec.sampleCode || '').trim(),
|
||||
labStorageCode: String(rec.labStorageCode || '').trim(),
|
||||
isSpecial: !!rec.isSpecial,
|
||||
specialRemark: String(rec.specialRemark || '').trim()
|
||||
specialRemark: String(rec.specialRemark || '').trim(),
|
||||
receptionAcceptConclusion: String(rec.receptionAcceptConclusion || '').trim(),
|
||||
receptionRemark: String(rec.receptionRemark || '').trim(),
|
||||
qcConclusion: String(rec.qcConclusion || '').trim(),
|
||||
qcConclusionLabel: String(rec.qcConclusionLabel || '').trim()
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -872,6 +925,24 @@
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
&--reception {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 6px 8px;
|
||||
word-break: normal;
|
||||
}
|
||||
}
|
||||
|
||||
.protocol-card__sample-remark {
|
||||
min-width: 0;
|
||||
flex: 1 1 120px;
|
||||
overflow: hidden;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
font-size: 12px;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.protocol-card__foot {
|
||||
|
||||
Reference in new issue
Block a user