This commit is contained in:
zlwu committed 2026-08-19 16:33:51 +08:00
1 parent 08f3b76e24
commit c7a7b6fa45
19 files changed
+22594 -10954

No files matched your search

+13 -12
View File
@@ -93,17 +93,18 @@ export const sqxpAdminRoutes: AppRouteRecord[] = [
menuCode: 'biz:cellStoragePaymentConfirm:list'
}
},
{
id: '70000000000000000000000000000011',
name: 'CellStorageStorageReleaseReview',
path: 'storage-release-review',
component: '/quality-inspection/storage-release-review/index',
meta: {
title: '入库放行审核',
keepAlive: true,
menuCode: 'biz:storageReleaseReview:list'
}
},
// 市场侧入库放行审核(总览)暂下线:改由生产/质检入口审核
// {
// id: '70000000000000000000000000000011',
// name: 'CellStorageStorageReleaseReview',
// path: 'storage-release-review',
// component: '/quality-inspection/storage-release-review/index',
// meta: {
// title: '入库放行审核',
// keepAlive: true,
// menuCode: 'biz:storageReleaseReview:list'
// }
// },
{
id: '50000000000000000000000000000005',
name: 'CellStorageRefundConfirm',
@@ -724,7 +725,7 @@ export const sqxpAdminRoutes: AppRouteRecord[] = [
}
},
{
id: '95400000000000000000000000000001',
id: '95500000000000000000000000000001',
name: 'ProductionStorageReleaseReview',
path: 'storage-release-review',
component: '/quality-inspection/storage-release-review/index',
@@ -1,4 +1,4 @@
<!-- 质检物料库 · 月初导入预览确认 -->
<!-- 质检物料库 · 月初导入预览确认(方案 B:一条明细两行) -->
<!-- eslint-disable vue/no-v-model-argument -->
<template>
<el-dialog
@@ -37,92 +37,118 @@
</div>
</el-form>
<div class="batch-stock-move-lines-head" style="margin-bottom: 12px">
<div class="batch-stock-move-lines-head-left">
<span class="batch-stock-move-lines-title">入库明细</span>
<span class="batch-stock-move-lines-hint">
共 {{ lines.length }} 项,可改字段后确认;删除行仅影响本次
<div class="month-import-lines-head">
<div class="month-import-lines-head-left">
<span class="month-import-lines-title">入库明细</span>
<span class="month-import-lines-hint">
共 {{ lines.length }} 项,每条分两行编辑;删除仅影响本次,不改模板
</span>
</div>
</div>
<div v-loading="loading">
<div v-if="lines.length" class="batch-in-line-list">
<div v-for="(row, index) in lines" :key="index" class="batch-in-line-card">
<div class="batch-in-line-card-head">
<span class="batch-in-line-card-index">{{ index + 1 }}</span>
<el-button link type="danger" size="small" @click="lines.splice(index, 1)">
<div v-loading="loading" class="month-import-dual-list">
<template v-if="lines.length">
<article v-for="(row, index) in lines" :key="row.templateId || index" class="dual-card">
<div class="dual-card-top">
<div class="dual-idx">{{ index + 1 }}</div>
<div class="dual-summary">
{{ row.materialName || '未命名物料' }}
<span v-if="row.materialCode" class="dual-summary-code">· {{ row.materialCode }}</span>
</div>
<el-button link type="danger" class="dual-delete" @click="lines.splice(index, 1)">
<el-icon><Delete /></el-icon>
删除
</el-button>
</div>
<div class="batch-in-line-grid batch-in-line-card-body">
<el-form-item label="物料" class="batch-in-col-span-2">
<el-input
:model-value="`${row.materialName}(${row.materialCode})`"
size="small"
disabled
/>
</el-form-item>
<el-form-item label="入库编号">
<el-input v-model="row.stockInNo" size="small" placeholder="必填" />
</el-form-item>
<el-form-item label="过期日期">
<div class="dual-grid">
<div class="dual-field">
<label class="dual-label col-label-required">物料编码</label>
<el-input v-model="row.materialCode" placeholder="请输入" clearable />
</div>
<div class="dual-field">
<label class="dual-label col-label-required">物料名称</label>
<el-input v-model="row.materialName" placeholder="请输入" clearable />
</div>
<div class="dual-field">
<label class="dual-label">规格型号</label>
<el-input v-model="row.specModel" placeholder="可选" clearable />
</div>
<div class="dual-field">
<label class="dual-label">单位</label>
<el-input v-model="row.unit" placeholder="可选" clearable />
</div>
<div class="dual-field">
<label class="dual-label col-label-required">入库编号</label>
<el-input v-model="row.stockInNo" placeholder="请输入" clearable />
</div>
<div class="dual-field">
<label class="dual-label col-label-required">过期日期</label>
<el-date-picker
v-model="row.expireDate"
type="date"
size="small"
value-format="YYYY-MM-DD"
placeholder="选择日期"
style="width: 100%"
/>
</el-form-item>
<el-form-item label="货号">
<el-input v-model="row.catalogNo" size="small" />
</el-form-item>
<el-form-item label="批号">
<el-input v-model="row.batchNo" size="small" />
</el-form-item>
<el-form-item label="厂家">
<el-input v-model="row.manufacturer" size="small" />
</el-form-item>
<el-form-item label="数量">
</div>
<div class="dual-row-sep" aria-hidden="true" />
<div class="dual-field">
<label class="dual-label col-label-required">货号</label>
<el-input v-model="row.catalogNo" placeholder="请输入" clearable />
</div>
<div class="dual-field">
<label class="dual-label col-label-required">批号</label>
<el-input v-model="row.batchNo" placeholder="请输入" clearable />
</div>
<div class="dual-field">
<label class="dual-label col-label-required">厂家</label>
<el-input v-model="row.manufacturer" placeholder="请输入" clearable />
</div>
<div class="dual-field">
<label class="dual-label col-label-required">数量</label>
<el-input-number
v-model="row.qty"
size="small"
:min="0.0001"
:precision="4"
:min="0"
:precision="2"
:step="0.01"
controls-position="right"
style="width: 100%"
@change="() => recalcAmount(row)"
/>
</el-form-item>
<el-form-item label="单价">
</div>
<div class="dual-field">
<label class="dual-label col-label-required">单价</label>
<el-input-number
v-model="row.unitPrice"
size="small"
:min="0"
:precision="2"
controls-position="right"
style="width: 100%"
@change="() => recalcAmount(row)"
/>
</el-form-item>
<el-form-item label="金额">
</div>
<div class="dual-field">
<label class="dual-label col-label-required">金额</label>
<el-input-number
v-model="row.amount"
size="small"
:min="0"
:precision="2"
controls-position="right"
style="width: 100%"
@change="() => markAmountTouched(row)"
/>
</el-form-item>
<el-form-item label="备注" class="batch-in-col-span-2">
<el-input v-model="row.remark" size="small" placeholder="可选" />
</el-form-item>
</div>
</div>
</div>
</div>
<div class="dual-remark">
<label class="dual-label">备注</label>
<el-input v-model="row.remark" placeholder="可选" clearable />
</div>
</article>
</template>
<el-empty v-else description="暂无预览明细" :image-size="56" />
</div>
@@ -184,7 +210,13 @@
}
loading.value = true
try {
lines.value = (await fetchPreviewQcMonthImport(stockInDate.value)) || []
const rows = (await fetchPreviewQcMonthImport(stockInDate.value)) || []
lines.value = rows.map((row) => ({
...row,
qty: Number(row.qty) || 0,
unitPrice: Number(row.unitPrice) || 0,
amount: Number(row.amount) || 0
}))
amountTouchedMap.value = {}
} catch {
lines.value = []
@@ -217,6 +249,14 @@
}
for (let i = 0; i < lines.value.length; i++) {
const line = lines.value[i]
if (!line.materialCode?.trim()) {
ElMessage.warning(`第 ${i + 1} 行请填写物料编码`)
return
}
if (!line.materialName?.trim()) {
ElMessage.warning(`第 ${i + 1} 行请填写物料名称`)
return
}
if (!line.stockInNo?.trim()) {
ElMessage.warning(`第 ${i + 1} 行请填写入库编号`)
return
@@ -242,13 +282,18 @@
items: lines.value.map((l) => ({
...l,
materialId: l.materialId || undefined,
stockInNo: l.stockInNo.trim(),
catalogNo: l.catalogNo.trim(),
batchNo: l.batchNo.trim(),
manufacturer: l.manufacturer.trim(),
materialCode: (l.materialCode || '').trim(),
materialName: (l.materialName || '').trim(),
specModel: (l.specModel || '').trim() || undefined,
unit: (l.unit || '').trim() || undefined,
stockInNo: (l.stockInNo || '').trim(),
catalogNo: (l.catalogNo || '').trim(),
batchNo: (l.batchNo || '').trim(),
manufacturer: (l.manufacturer || '').trim(),
qty: Number(l.qty),
unitPrice: Number(l.unitPrice),
amount: Number(l.amount)
amount: Number(l.amount),
remark: (l.remark || '').trim() || undefined
}))
})
ElMessage.success(`月初导入成功,共 ${res?.count ?? lines.value.length} 项`)
@@ -259,3 +304,148 @@
}
}
</script>
<style scoped lang="scss">
.month-import-lines-head {
display: flex;
align-items: flex-end;
justify-content: space-between;
gap: 16px;
margin: 4px 0 0;
}
.month-import-lines-head-left {
display: flex;
flex-direction: column;
gap: 4px;
min-width: 0;
}
.month-import-lines-title {
font-size: 14px;
font-weight: 600;
color: var(--mint-text, #0f172a);
}
.month-import-lines-hint {
font-size: 12px;
color: var(--mint-text-muted, #64748b);
}
.month-import-dual-list {
margin-top: 12px;
max-height: min(52vh, 520px);
overflow-y: auto;
display: flex;
flex-direction: column;
gap: 10px;
padding-right: 2px;
min-height: 120px;
}
.dual-card {
flex-shrink: 0;
border: 1px solid var(--mint-border, #e2e8f0);
border-radius: 8px;
background: #fff;
overflow: hidden;
}
.dual-card:nth-child(even) {
background: #fafafa;
}
.dual-card-top {
display: flex;
align-items: center;
gap: 10px;
padding: 8px 12px;
background: var(--mint-primary-bg, #ecfdf5);
border-bottom: 1px solid #d1fae5;
}
.dual-idx {
flex: 0 0 28px;
width: 28px;
height: 28px;
border-radius: 6px;
background: #fff;
border: 1px solid #a7f3d0;
color: var(--mint-primary-dark, #059669);
display: grid;
place-items: center;
font-weight: 700;
font-size: 12px;
}
.dual-summary {
flex: 1;
min-width: 0;
font-weight: 600;
color: var(--mint-primary-dark, #059669);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.dual-summary-code {
font-weight: 500;
color: var(--mint-text-muted, #64748b);
}
.dual-delete {
flex-shrink: 0;
}
.dual-grid {
display: grid;
grid-template-columns: repeat(6, minmax(0, 1fr));
gap: 8px 12px;
padding: 12px;
}
.dual-row-sep {
grid-column: 1 / -1;
height: 1px;
background: var(--mint-border, #e2e8f0);
margin: 2px 0;
}
.dual-field,
.dual-remark {
display: flex;
flex-direction: column;
gap: 4px;
min-width: 0;
}
.dual-remark {
padding: 0 12px 14px;
}
.dual-label {
font-size: 11px;
font-weight: 600;
color: var(--mint-text-muted, #64748b);
line-height: 1.3;
}
.col-label-required::before {
content: '*';
color: var(--el-color-danger, #dc2626);
margin-right: 3px;
}
:deep(.dual-field .el-input),
:deep(.dual-field .el-input-number),
:deep(.dual-field .el-date-editor),
:deep(.dual-remark .el-input) {
width: 100%;
}
@media (max-width: 900px) {
.dual-grid {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
}
</style>
@@ -5,7 +5,7 @@
<el-dialog
:model-value="modelValue"
title="维护月初模板"
width="1280px"
width="1440px"
class="dialog-form-layout material-batch-stock-dialog"
align-center
append-to-body
@@ -27,14 +27,109 @@
</div>
<el-table v-loading="loading" :data="rows" class="list-table" stripe max-height="420">
<el-table-column label="物料编码" prop="materialCode" min-width="120" show-overflow-tooltip />
<el-table-column label="物料名称" prop="materialName" min-width="140" show-overflow-tooltip />
<el-table-column label="货号" prop="catalogNo" min-width="100" show-overflow-tooltip />
<el-table-column label="批号" prop="batchNo" min-width="100" show-overflow-tooltip />
<el-table-column label="厂家" prop="manufacturer" min-width="120" show-overflow-tooltip />
<el-table-column label="数量" prop="inQty" min-width="80" align="right" />
<el-table-column label="过期日期" prop="expireDate" min-width="110" />
<el-table-column label="操作" fixed="right" min-width="160">
<el-table-column
type="index"
label="序号"
min-width="56"
align="center"
header-align="center"
fixed="left"
/>
<el-table-column
label="物料编码"
prop="materialCode"
min-width="120"
align="center"
header-align="center"
show-overflow-tooltip
/>
<el-table-column
label="物料名称"
prop="materialName"
min-width="140"
align="center"
header-align="center"
show-overflow-tooltip
/>
<el-table-column
label="规格型号"
prop="specModel"
min-width="120"
align="center"
header-align="center"
show-overflow-tooltip
>
<template #default="{ row }">{{ row.specModel || '—' }}</template>
</el-table-column>
<el-table-column
label="单位"
prop="unit"
min-width="80"
align="center"
header-align="center"
show-overflow-tooltip
>
<template #default="{ row }">{{ row.unit || '—' }}</template>
</el-table-column>
<el-table-column
label="货号"
prop="catalogNo"
min-width="110"
align="center"
header-align="center"
show-overflow-tooltip
>
<template #default="{ row }">{{ row.catalogNo || '—' }}</template>
</el-table-column>
<el-table-column
label="批号"
prop="batchNo"
min-width="110"
align="center"
header-align="center"
show-overflow-tooltip
>
<template #default="{ row }">{{ row.batchNo || '—' }}</template>
</el-table-column>
<el-table-column
label="厂家"
prop="manufacturer"
min-width="120"
align="center"
header-align="center"
show-overflow-tooltip
>
<template #default="{ row }">{{ row.manufacturer || '—' }}</template>
</el-table-column>
<el-table-column label="单价" prop="unitPrice" min-width="100" align="right" header-align="center">
<template #default="{ row }">{{ formatMoney(row.unitPrice) }}</template>
</el-table-column>
<el-table-column label="数量" prop="inQty" min-width="90" align="right" header-align="center">
<template #default="{ row }">{{ formatQty(row.inQty) }}</template>
</el-table-column>
<el-table-column label="金额" prop="amount" min-width="100" align="right" header-align="center">
<template #default="{ row }">{{ formatMoney(row.amount) }}</template>
</el-table-column>
<el-table-column
label="过期日期"
prop="expireDate"
min-width="120"
align="center"
header-align="center"
>
<template #default="{ row }">{{ row.expireDate || '—' }}</template>
</el-table-column>
<el-table-column
label="备注"
prop="remark"
min-width="140"
align="center"
header-align="center"
show-overflow-tooltip
>
<template #default="{ row }">{{ row.remark || '—' }}</template>
</el-table-column>
<el-table-column label="操作" fixed="right" min-width="160" align="center" header-align="center">
<template #default="{ row }">
<el-button link type="primary" @click="openEdit(row)">
<el-icon><Edit /></el-icon>
@@ -196,6 +291,18 @@
(e: 'saved'): void
}>()
function formatMoney(v: unknown) {
const n = Number(v)
if (!Number.isFinite(n)) return '—'
return n.toFixed(2)
}
function formatQty(v: unknown) {
const n = Number(v)
if (!Number.isFinite(n)) return '—'
return n.toFixed(2)
}
const loading = ref(false)
const saving = ref(false)
const rows = ref<QcMonthTemplateRow[]>([])