feat: 完成多模块迭代更新
- 新增过程巡检按步骤上报、数量不符上报、工位退料功能 - 增加工单工程编号三级归属字段 - 新增物料安全库存与缺货预警 - 新增附件管理、退库单管理模块 - 优化生产看板展示逻辑与前端页面文案 - 清理冗余的工艺路线相关代码与备份文件
This commit is contained in:
@@ -8,6 +8,7 @@ import { can } from '../utils/perm'
|
||||
import { exportXlsxFetch } from '../utils/export'
|
||||
import { getToken } from '../utils/auth'
|
||||
import PageHelp from '../components/PageHelp.vue'
|
||||
import AttachmentPanel from '../components/AttachmentPanel.vue'
|
||||
import { helpZone, helpMaterial } from '../help'
|
||||
|
||||
// mode: 'zone' = 区域维护;'material' = 物料档案(同一组件拆成两个独立菜单)
|
||||
@@ -40,7 +41,8 @@ const zonePage = reactive({ current: 1, size: 10 })
|
||||
|
||||
const zoneDialog = ref(false)
|
||||
const zoneEditingId = ref(0)
|
||||
const zoneForm = reactive({ zoneCode: '', zoneName: '', description: '' })
|
||||
// 区域库位:区域 → 货架号 → 第几层 → 位置号(客户诉求 问题记录 L32/L169,手填)
|
||||
const zoneForm = reactive({ zoneCode: '', zoneName: '', description: '', shelfNo: '', layerNo: '', positionNo: '' })
|
||||
const zoneSaving = ref(false)
|
||||
|
||||
async function loadZones() {
|
||||
@@ -69,14 +71,15 @@ function searchZones() {
|
||||
|
||||
function openZoneCreate() {
|
||||
zoneEditingId.value = 0
|
||||
Object.assign(zoneForm, { zoneCode: '', zoneName: '', description: '' })
|
||||
Object.assign(zoneForm, { zoneCode: '', zoneName: '', description: '', shelfNo: '', layerNo: '', positionNo: '' })
|
||||
zoneDialog.value = true
|
||||
}
|
||||
|
||||
function openZoneEdit(row) {
|
||||
zoneEditingId.value = row.id
|
||||
Object.assign(zoneForm, {
|
||||
zoneCode: row.zoneCode, zoneName: row.zoneName, description: row.description || ''
|
||||
zoneCode: row.zoneCode, zoneName: row.zoneName, description: row.description || '',
|
||||
shelfNo: row.shelfNo || '', layerNo: row.layerNo || '', positionNo: row.positionNo || ''
|
||||
})
|
||||
zoneDialog.value = true
|
||||
}
|
||||
@@ -115,7 +118,8 @@ const matDialog = ref(false)
|
||||
const mEditingId = ref(0)
|
||||
const mForm = reactive({
|
||||
code: '', name: '', shortName: '', spec: '', unit: '',
|
||||
manageMode: 1, templateCode: '', description: '', drawingNo: ''
|
||||
manageMode: 1, templateCode: '', description: '', drawingNo: '',
|
||||
itemType: 1, safetyStock: 0
|
||||
})
|
||||
const mSaving = ref(false)
|
||||
|
||||
@@ -151,7 +155,8 @@ function resetMForm() {
|
||||
mEditingId.value = 0
|
||||
Object.assign(mForm, {
|
||||
code: '', name: '', shortName: '', spec: '', unit: '',
|
||||
manageMode: 1, templateCode: '', description: '', drawingNo: ''
|
||||
manageMode: 1, templateCode: '', description: '', drawingNo: '',
|
||||
itemType: 1, safetyStock: 0
|
||||
})
|
||||
}
|
||||
|
||||
@@ -166,7 +171,9 @@ function openMatEdit(row) {
|
||||
code: row.code, name: row.name, shortName: row.shortName || '',
|
||||
spec: row.spec || '', unit: row.unit || '', manageMode: row.manageMode,
|
||||
templateCode: row.templateCode || '',
|
||||
drawingNo: row.drawingNo || '',
|
||||
drawingNo: row.drawingNo || '',
|
||||
itemType: row.itemType || 1,
|
||||
safetyStock: row.safetyStock || 0,
|
||||
description: row.description || ''
|
||||
})
|
||||
matDialog.value = true
|
||||
@@ -177,18 +184,25 @@ async function saveMaterial() {
|
||||
ElMessage.warning('物料编码和名称必填')
|
||||
return
|
||||
}
|
||||
// 其他类物料规格强制(客户诉求 问题记录 L50)
|
||||
if (Number(mForm.itemType) === 4 && !String(mForm.spec || '').trim()) {
|
||||
ElMessage.warning('「其他」类物料必须填写规格型号')
|
||||
return
|
||||
}
|
||||
mSaving.value = true
|
||||
try {
|
||||
if (mEditingId.value) {
|
||||
await request.post('/material/update', {
|
||||
id: mEditingId.value, name: mForm.name, shortName: mForm.shortName,
|
||||
spec: mForm.spec, unit: mForm.unit, description: mForm.description,
|
||||
drawingNo: mForm.drawingNo,
|
||||
drawingNo: mForm.drawingNo,
|
||||
itemType: Number(mForm.itemType),
|
||||
safetyStock: Number(mForm.safetyStock) || 0,
|
||||
manageMode: mForm.manageMode
|
||||
})
|
||||
ElMessage.success('物料修改成功')
|
||||
} else {
|
||||
await request.post('/material/create', { ...mForm })
|
||||
await request.post('/material/create', { ...mForm, itemType: Number(mForm.itemType), safetyStock: Number(mForm.safetyStock) || 0 })
|
||||
ElMessage.success('物料新增成功')
|
||||
}
|
||||
matDialog.value = false
|
||||
@@ -198,6 +212,24 @@ async function saveMaterial() {
|
||||
}
|
||||
}
|
||||
|
||||
// 物料附件(bizType=material,bizId=物料编码):零件图纸 PDF 等
|
||||
const attachDrawer = reactive({ visible: false, code: '', name: '' })
|
||||
function openMatAttach(row) {
|
||||
Object.assign(attachDrawer, { visible: true, code: row.code, name: row.name })
|
||||
}
|
||||
|
||||
// 品类显示(1原材料/2半成品/3成品/4其他)
|
||||
function itemTypeText(t) {
|
||||
return t === 3 ? '成品' : t === 2 ? '半成品' : t === 4 ? '其他' : '原材料'
|
||||
}
|
||||
function itemTypeTagType(t) {
|
||||
return t === 3 ? 'success' : t === 2 ? 'warning' : t === 4 ? 'danger' : 'info'
|
||||
}
|
||||
// 品类切换:其他类强制按数量管理(不做 SN)
|
||||
function onItemTypeChange(v) {
|
||||
if (Number(v) === 4) mForm.manageMode = 1
|
||||
}
|
||||
|
||||
// 区域维护 / 物料档案共用同一组件:切换菜单时复用,watch(mode, immediate) 保证进入即加载
|
||||
watch(
|
||||
() => props.mode,
|
||||
@@ -299,6 +331,15 @@ async function onMaterialFile(e) {
|
||||
<el-table-column label="ID" prop="id" width="60" align="center" />
|
||||
<el-table-column prop="zoneCode" label="区域编码" min-width="120" />
|
||||
<el-table-column prop="zoneName" label="区域名称" min-width="150" />
|
||||
<el-table-column prop="shelfNo" label="货架号" width="90" align="center">
|
||||
<template #default="{ row }">{{ row.shelfNo || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="layerNo" label="层" width="70" align="center">
|
||||
<template #default="{ row }">{{ row.layerNo || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="positionNo" label="位置号" width="90" align="center">
|
||||
<template #default="{ row }">{{ row.positionNo || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="90" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="row.status === '停用' ? 'info' : 'success'" size="small">
|
||||
@@ -334,6 +375,15 @@ async function onMaterialFile(e) {
|
||||
<el-form-item label="区域名称" required>
|
||||
<el-input v-model="zoneForm.zoneName" placeholder="如 待检区" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="货架号">
|
||||
<el-input v-model="zoneForm.shelfNo" placeholder="如 A / 03(可空,手填)" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="第几层">
|
||||
<el-input v-model="zoneForm.layerNo" placeholder="如 3(可空,手填)" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="位置号">
|
||||
<el-input v-model="zoneForm.positionNo" placeholder="如 12(可空,手填)" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="说明">
|
||||
<el-input v-model="zoneForm.description" type="textarea" :rows="2" placeholder="备注(可空)" />
|
||||
</el-form-item>
|
||||
@@ -366,6 +416,14 @@ async function onMaterialFile(e) {
|
||||
<el-option label="电气件(SN)" :value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="品类">
|
||||
<el-select v-model="matFilter.itemType" placeholder="全部" clearable style="width:120px" @change="searchMaterials">
|
||||
<el-option label="原材料" :value="1" />
|
||||
<el-option label="半成品" :value="2" />
|
||||
<el-option label="成品" :value="3" />
|
||||
<el-option label="其他" :value="4" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间">
|
||||
<el-date-picker v-model="matFilter.startDate" type="date" value-format="YYYY-MM-DD" placeholder="开始"
|
||||
style="width:130px" @change="searchMaterials" />
|
||||
@@ -400,9 +458,7 @@ async function onMaterialFile(e) {
|
||||
</el-table-column>
|
||||
<el-table-column label="品类" width="90" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="row.itemType === 3 ? 'success' : (row.itemType === 2 ? 'warning' : 'info')" size="small">
|
||||
{{ row.itemType === 3 ? '成品' : (row.itemType === 2 ? '半成品' : '原材料') }}
|
||||
</el-tag>
|
||||
<el-tag :type="itemTypeTagType(row.itemType)" size="small">{{ itemTypeText(row.itemType) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="类型" width="140" align="center">
|
||||
@@ -412,12 +468,16 @@ async function onMaterialFile(e) {
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="安全库存" width="100" align="center">
|
||||
<template #default="{ row }">{{ row.safetyStock || 0 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" width="155" align="center">
|
||||
<template #default="{ row }">{{ fmtTime(row.createdAt) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="90" align="center">
|
||||
<el-table-column label="操作" width="150" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button link type="primary" size="small" @click="openMatEdit(row)">编辑</el-button>
|
||||
<el-button link type="success" size="small" @click="openMatAttach(row)">附件</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -449,12 +509,24 @@ async function onMaterialFile(e) {
|
||||
<el-form-item label="图号">
|
||||
<el-input v-model="mForm.drawingNo" placeholder="图纸编号(可空)" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="品类">
|
||||
<el-select v-model="mForm.itemType" placeholder="请选择" style="width:100%" @change="onItemTypeChange">
|
||||
<el-option :value="1" label="原材料" />
|
||||
<el-option :value="2" label="半成品" />
|
||||
<el-option :value="3" label="成品" />
|
||||
<el-option :value="4" label="其他(辅料/工装/试验设备)" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型">
|
||||
<el-select v-model="mForm.manageMode" placeholder="请选择" style="width:100%">
|
||||
<el-select v-model="mForm.manageMode" placeholder="请选择" style="width:100%" :disabled="Number(mForm.itemType) === 4">
|
||||
<el-option :value="1" label="结构件(批次管理)" />
|
||||
<el-option :value="2" label="电气件(SN 管理)" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="安全库存">
|
||||
<el-input-number v-model="mForm.safetyStock" :min="0" :step="1" step-strictly style="width:100%" />
|
||||
<span style="color:#909399;font-size:12px;margin-left:8px">低于该值触发缺货预警(0=不预警)</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="说明">
|
||||
<el-input v-model="mForm.description" type="textarea" :rows="2" placeholder="备注(可空)" />
|
||||
</el-form-item>
|
||||
@@ -466,6 +538,11 @@ async function onMaterialFile(e) {
|
||||
</el-dialog>
|
||||
</template>
|
||||
</el-card>
|
||||
|
||||
<!-- 物料附件抽屉(图纸 PDF 等) -->
|
||||
<el-drawer v-model="attachDrawer.visible" :title="`物料附件:${attachDrawer.code} ${attachDrawer.name}`" size="620px">
|
||||
<AttachmentPanel biz-type="material" :biz-id="attachDrawer.code" title="附件(零件图纸 / 资料)" />
|
||||
</el-drawer>
|
||||
<PageHelp :data="helpData" :page="props.mode === 'material' ? 'Material' : 'Zone'" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -9,13 +9,27 @@ import { fmtNum } from '../utils/format'
|
||||
const router = useRouter()
|
||||
const overview = ref({})
|
||||
const loaded = ref(false)
|
||||
// 缺货预警(客户诉求 问题记录 L473:安全库存/缺货预警进 WMS 首页)
|
||||
const shortage = ref([])
|
||||
|
||||
async function load() {
|
||||
overview.value = await request.get('/display/overview')
|
||||
loaded.value = true
|
||||
}
|
||||
|
||||
onMounted(load)
|
||||
async function loadShortage() {
|
||||
try {
|
||||
const d = await request.get('/stock/shortage')
|
||||
shortage.value = d?.list || []
|
||||
} catch (e) {
|
||||
shortage.value = []
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
load()
|
||||
loadShortage()
|
||||
})
|
||||
|
||||
const cards = [
|
||||
{ key: 'totalQty', label: '在库总量' },
|
||||
@@ -53,6 +67,26 @@ const entries = [
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-card v-if="shortage.length" shadow="never" class="mb12" style="margin-top:12px">
|
||||
<template #header>
|
||||
<span style="color:#f56c6c;font-weight:600">缺货预警({{ shortage.length }} 项物料可用量低于安全库存)</span>
|
||||
</template>
|
||||
<el-table :data="shortage" border size="small" empty-text="暂无缺货物料">
|
||||
<el-table-column prop="materialCode" label="物料编码" min-width="140" />
|
||||
<el-table-column prop="materialName" label="物料名称" min-width="150" />
|
||||
<el-table-column prop="spec" label="规格" min-width="110">
|
||||
<template #default="{ row }">{{ row.spec || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="safetyStock" label="安全库存" width="100" align="center" />
|
||||
<el-table-column prop="availQty" label="可用量" width="90" align="center" />
|
||||
<el-table-column label="缺口" width="90" align="center">
|
||||
<template #default="{ row }">
|
||||
<span style="color:#f56c6c;font-weight:600">{{ row.shortQty }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" header="快捷入口">
|
||||
<div class="entries">
|
||||
<el-button v-for="e in entries" :key="e.path" size="large"
|
||||
|
||||
@@ -10,6 +10,7 @@ import { exportXlsxFetch } from '../utils/export'
|
||||
import { can } from '../utils/perm'
|
||||
import PageHelp from '../components/PageHelp.vue'
|
||||
import MaterialSelect from '../components/MaterialSelect.vue'
|
||||
import AttachmentPanel from '../components/AttachmentPanel.vue'
|
||||
import { helpInbound } from '../help'
|
||||
|
||||
const route = useRoute()
|
||||
@@ -186,7 +187,78 @@ async function importExcel(mode, which) {
|
||||
}
|
||||
}
|
||||
|
||||
/* ===================== Tab3 入库记录(统一主表 + 抽屉明细,不分页内嵌子表) ===================== */
|
||||
/* ===================== Tab3 其他入库(辅料/工装/试验设备,规格强制) =====================
|
||||
客户诉求(问题记录 L50-54):除结构件/电气件外增加「其他入库」,防螺栓、工装、试验设备等,
|
||||
规格强制填写;入库记录含 批次号/类型/归属(工单号/科技项目号/无)。 */
|
||||
const otherRef = ref()
|
||||
const submitting3 = ref(false)
|
||||
const form3 = reactive({
|
||||
materialCode: '', batchNo: '', quantity: 1, zoneCode: '',
|
||||
ownershipType: 'none', ownershipNo: '',
|
||||
supplier: '', remark: '', inspectionNo: ''
|
||||
})
|
||||
const rules3 = {
|
||||
materialCode: [{ required: true, message: '请选择物料', trigger: 'change' }],
|
||||
zoneCode: [{ required: true, message: '请选择入库区域', trigger: 'change' }],
|
||||
quantity: [{ required: true, message: '请输入数量', trigger: 'blur' }]
|
||||
}
|
||||
const otherMaterial = ref(null) // 选中物料(用于展示规格,规格为空时后端会拒绝)
|
||||
|
||||
function onOtherMaterial(item) {
|
||||
otherMaterial.value = item
|
||||
}
|
||||
|
||||
async function submitOther() {
|
||||
await otherRef.value.validate()
|
||||
if (!form3.quantity || form3.quantity <= 0) {
|
||||
ElMessage.warning('数量必须大于 0')
|
||||
return
|
||||
}
|
||||
if (form3.ownershipType !== 'none' && !form3.ownershipNo.trim()) {
|
||||
ElMessage.warning('请填写归属编号(工单号 / 科技项目号)')
|
||||
return
|
||||
}
|
||||
if (!form3.inspectionNo.trim()) {
|
||||
ElMessage.warning('请填写检测单号')
|
||||
return
|
||||
}
|
||||
if (otherMaterial.value && !String(otherMaterial.value.spec || '').trim()) {
|
||||
ElMessage.warning('该其他类物料未填写规格型号,请先到物料档案补全')
|
||||
return
|
||||
}
|
||||
try {
|
||||
await ElMessageBox.confirm(
|
||||
'确认其他入库:物料 ' + form3.materialCode + '|数量 ' + form3.quantity +
|
||||
'|区域 ' + form3.zoneCode + '|归属 ' + (form3.ownershipType === 'none' ? '无' : form3.ownershipNo) + '?',
|
||||
'其他入库提交确认', { type: 'warning' })
|
||||
} catch { return }
|
||||
submitting3.value = true
|
||||
try {
|
||||
const data = await request.post('/inbound/create', {
|
||||
inboundType: 'other',
|
||||
materialCode: form3.materialCode,
|
||||
batchNo: form3.batchNo.trim(),
|
||||
quantity: form3.quantity,
|
||||
zoneCode: form3.zoneCode,
|
||||
supplier: form3.supplier.trim(),
|
||||
remark: form3.remark.trim(),
|
||||
inspectionNo: form3.inspectionNo.trim(),
|
||||
ownershipType: form3.ownershipType,
|
||||
ownershipNo: form3.ownershipNo.trim(),
|
||||
operator
|
||||
})
|
||||
ElMessage.success(`其他入库成功:入库单号 ${data?.inboundNo || ''},数量 ${data?.quantity ?? form3.quantity}`)
|
||||
form3.batchNo = ''
|
||||
form3.quantity = 1
|
||||
form3.ownershipType = 'none'
|
||||
form3.ownershipNo = ''
|
||||
await loadRecords()
|
||||
} finally {
|
||||
submitting3.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/* ===================== Tab4 入库记录(统一主表 + 抽屉明细,不分页内嵌子表) ===================== */
|
||||
// 查询条件
|
||||
const filters = reactive({ inboundNo: '', materialCode: '', manageMode: '', materialName: '' })
|
||||
const dateRange = ref([]) // [开始日期, 结束日期] YYYY-MM-DD
|
||||
@@ -203,7 +275,8 @@ async function loadRecords() {
|
||||
params: {
|
||||
inboundNo: filters.inboundNo.trim(),
|
||||
materialCode: filters.materialCode.trim(),
|
||||
manageMode: filters.manageMode,
|
||||
manageMode: filters.manageMode === 'other' ? '' : filters.manageMode,
|
||||
inboundType: filters.manageMode === 'other' ? 'other' : '',
|
||||
materialName: filters.materialName.trim(),
|
||||
startDate: dateRange.value?.[0] || '',
|
||||
endDate: dateRange.value?.[1] || '',
|
||||
@@ -237,7 +310,8 @@ async function exportCsv() {
|
||||
await exportXlsxFetch('/api/inbound/export', {
|
||||
inboundNo: filters.inboundNo.trim(),
|
||||
materialCode: filters.materialCode.trim(),
|
||||
manageMode: filters.manageMode,
|
||||
manageMode: filters.manageMode === 'other' ? '' : filters.manageMode,
|
||||
inboundType: filters.manageMode === 'other' ? 'other' : '',
|
||||
materialName: filters.materialName.trim(),
|
||||
startDate: dateRange.value?.[0] || '',
|
||||
endDate: dateRange.value?.[1] || ''
|
||||
@@ -275,13 +349,35 @@ function changeDetailPage(p) {
|
||||
fetchDetailPage()
|
||||
}
|
||||
|
||||
function typeLabel(m) {
|
||||
return m === 1 ? '结构件' : m === 2 ? '电气件' : '-'
|
||||
function typeLabel(row) {
|
||||
if (row?.inboundType === 'other') return '其他'
|
||||
if (row?.inboundType === 'semi') return '半成品'
|
||||
if (row?.inboundType === 'finished') return '成品'
|
||||
if (row?.inboundType === 'return') return '退货'
|
||||
return row?.manageMode === 2 ? '电气件' : '结构件'
|
||||
}
|
||||
function typeTagType(row) {
|
||||
if (row?.inboundType === 'other') return 'info'
|
||||
return row?.manageMode === 1 ? 'primary' : 'warning'
|
||||
}
|
||||
function ownershipLabel(row) {
|
||||
const t = row?.ownershipType
|
||||
if (t === 'workorder') return '工单号 ' + (row.ownershipNo || '')
|
||||
if (t === 'project') return '科技项目号 ' + (row.ownershipNo || '')
|
||||
return '无'
|
||||
}
|
||||
|
||||
// 附件抽屉(bizType=inbound,bizId=入库单号):图纸 PDF / 检验报告挂载
|
||||
const attachDrawer = reactive({ visible: false, inboundNo: '' })
|
||||
function openAttach(row) {
|
||||
attachDrawer.inboundNo = row.inboundNo
|
||||
attachDrawer.visible = true
|
||||
}
|
||||
|
||||
function onTabChange(tab) {
|
||||
if (tab === 'batch') { loadDicts() }
|
||||
else if (tab === 'sn') { loadDicts() }
|
||||
else if (tab === 'other') { loadDicts() }
|
||||
else if (tab === 'records') { loadDicts(); loadRecords() }
|
||||
}
|
||||
|
||||
@@ -419,7 +515,59 @@ onMounted(() => {
|
||||
</el-card>
|
||||
</el-tab-pane>
|
||||
|
||||
<!-- ============ Tab3 入库记录(统一主表 + 抽屉明细) ============ -->
|
||||
<!-- ============ Tab3 其他入库(辅料/工装/试验设备) ============ -->
|
||||
<el-tab-pane label="其他入库" name="other">
|
||||
<el-card shadow="never">
|
||||
<div style="margin-bottom:10px;color:#909399;font-size:12px">
|
||||
其他入库用于 <b>辅料 / 螺栓 / 工装 / 试验设备</b> 等非结构件、非电气件物料;<b>规格型号强制</b>(在物料档案维护)。
|
||||
</div>
|
||||
<el-form ref="otherRef" :model="form3" :rules="rules3" label-width="110px" style="max-width:620px">
|
||||
<el-form-item label="物料" prop="materialCode">
|
||||
<MaterialSelect v-model="form3.materialCode" :item-type="4"
|
||||
placeholder="选择其他类物料(辅料/工装/试验设备)"
|
||||
@item-change="onOtherMaterial" />
|
||||
</el-form-item>
|
||||
<el-form-item label="规格型号">
|
||||
<el-input :model-value="otherMaterial?.spec || ''" placeholder="自动带出物料档案规格" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="批次号">
|
||||
<el-input v-model="form3.batchNo" placeholder="留空则自动生成" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="数量" prop="quantity">
|
||||
<el-input-number v-model="form3.quantity" :min="1" :step="1" step-strictly style="width:100%" />
|
||||
</el-form-item>
|
||||
<el-form-item label="区域" prop="zoneCode">
|
||||
<el-select v-model="form3.zoneCode" placeholder="请选择入库区域(必填)" clearable style="width:100%">
|
||||
<el-option v-for="z in zones" :key="z.id" :value="z.zoneCode"
|
||||
:label="`${z.zoneCode} ${z.zoneName || ''}`" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="归属">
|
||||
<el-select v-model="form3.ownershipType" style="width:160px;margin-right:8px">
|
||||
<el-option label="无" value="none" />
|
||||
<el-option label="工单号" value="workorder" />
|
||||
<el-option label="科技项目号" value="project" />
|
||||
</el-select>
|
||||
<el-input v-if="form3.ownershipType !== 'none'" v-model="form3.ownershipNo"
|
||||
placeholder="请填写归属编号" clearable style="width:260px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商">
|
||||
<el-input v-model="form3.supplier" placeholder="供应商名称(可空)" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="检测单号" required>
|
||||
<el-input v-model="form3.inspectionNo" placeholder="入库检报告单号(必填)" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form3.remark" placeholder="备注(可空)" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" :loading="submitting3" @click="submitOther">提交入库</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</el-tab-pane>
|
||||
|
||||
<!-- ============ Tab4 入库记录(统一主表 + 抽屉明细) ============ -->
|
||||
<el-tab-pane label="入库记录" name="records">
|
||||
<el-card shadow="never" class="mb12">
|
||||
<el-form inline @submit.prevent="search">
|
||||
@@ -434,6 +582,7 @@ onMounted(() => {
|
||||
<el-option label="全部" value="" />
|
||||
<el-option label="结构件" value="1" />
|
||||
<el-option label="电气件" value="2" />
|
||||
<el-option label="其他" value="other" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料名称">
|
||||
@@ -460,9 +609,7 @@ onMounted(() => {
|
||||
<el-table-column prop="inboundNo" label="入库单号" min-width="160" />
|
||||
<el-table-column label="类型" width="90" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag size="small" :type="row.manageMode === 1 ? 'primary' : row.manageMode === 2 ? 'warning' : 'info'">
|
||||
{{ typeLabel(row.manageMode) }}
|
||||
</el-tag>
|
||||
<el-tag size="small" :type="typeTagType(row)">{{ typeLabel(row) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="materialCode" label="物料编码" min-width="140" />
|
||||
@@ -484,14 +631,18 @@ onMounted(() => {
|
||||
<el-table-column prop="inspectionNo" label="检测单号" min-width="130" align="center">
|
||||
<template #default="{ row }">{{ row.inspectionNo || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="归属" min-width="150" align="center">
|
||||
<template #default="{ row }">{{ ownershipLabel(row) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="入库时间" width="160" align="center">
|
||||
<template #default="{ row }">{{ fmtTime(row.createdAt) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="110" align="center" fixed="right">
|
||||
<el-table-column label="操作" width="175" align="center" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button link type="primary" size="small" @click="openDetail(row)">
|
||||
明细{{ row.detailCount ? '(' + row.detailCount + ')' : '' }}
|
||||
</el-button>
|
||||
<el-button link type="success" size="small" @click="openAttach(row)">附件</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -539,6 +690,11 @@ onMounted(() => {
|
||||
@current-change="changeDetailPage" />
|
||||
</div>
|
||||
</el-drawer>
|
||||
|
||||
<!-- 入库单附件抽屉:图纸 PDF / 检验报告等(下沉到单据本身,不建独立附件中心) -->
|
||||
<el-drawer v-model="attachDrawer.visible" :title="`入库单附件:${attachDrawer.inboundNo}`" size="620px">
|
||||
<AttachmentPanel biz-type="inbound" :biz-id="attachDrawer.inboundNo" title="附件(图纸 / 报告)" />
|
||||
</el-drawer>
|
||||
</div>
|
||||
<PageHelp :data="helpInbound" page="Inbound" />
|
||||
</template>
|
||||
|
||||
@@ -9,6 +9,7 @@ import { fmtTime } from '../utils/format'
|
||||
import { exportXlsxFetch } from '../utils/export'
|
||||
import { can } from '../utils/perm'
|
||||
import PageHelp from '../components/PageHelp.vue'
|
||||
import AttachmentPanel from '../components/AttachmentPanel.vue'
|
||||
import { helpInspection } from '../help'
|
||||
|
||||
// ===== 多 Tab:录入在前默认打开,记录在后点击才见(参照出库管理) =====
|
||||
@@ -31,6 +32,11 @@ const checkDesc = ref('')
|
||||
const inspectionNo = ref('')
|
||||
const reportNo = ref('')
|
||||
|
||||
// 不合格品处置(客户诉求 问题记录 L137-145:退货 / 报废 / 部分入库)
|
||||
const disposalType = ref('NONE')
|
||||
const disposalRemark = ref('')
|
||||
const returnTrackingNo = ref('')
|
||||
|
||||
// 待检编号列表(合并单/批量,统一一次提交)
|
||||
const targetList = ref([])
|
||||
const scanInput = ref('')
|
||||
@@ -99,6 +105,19 @@ async function submitInspection() {
|
||||
ElMessage.warning('请填写检验员')
|
||||
return
|
||||
}
|
||||
// 判定不合格必须选择处置方式(不合格不入库、不上产线)
|
||||
if (status.value === '不合格' && disposalType.value === 'NONE') {
|
||||
ElMessage.warning('判定不合格时必须选择处置方式(退货 / 报废 / 部分入库)')
|
||||
return
|
||||
}
|
||||
if (status.value === '不合格' && disposalType.value === 'RETURN' && !returnTrackingNo.value.trim()) {
|
||||
ElMessage.warning('退货处置必须填写货运单号')
|
||||
return
|
||||
}
|
||||
if (status.value === '不合格' && disposalType.value === 'PARTIAL' && targetList.value.length > 1) {
|
||||
ElMessage.warning('「部分入库」一次只能处理 1 个批次,请分开提交')
|
||||
return
|
||||
}
|
||||
submitting.value = true
|
||||
try {
|
||||
const data = await request.post('/inspection/batch-flip', {
|
||||
@@ -111,6 +130,9 @@ async function submitInspection() {
|
||||
reportNo: reportNo.value.trim(),
|
||||
inspector: inspector.value.trim(),
|
||||
inspectionNo: inspectionNo.value.trim(),
|
||||
disposalType: status.value === '不合格' ? disposalType.value : 'NONE',
|
||||
disposalRemark: disposalRemark.value.trim(),
|
||||
returnTrackingNo: returnTrackingNo.value.trim(),
|
||||
})
|
||||
const n = data?.flipped ?? targetList.value.length
|
||||
ElMessage.success(`检验已记录:共 ${n} 条 → ${status.value}`)
|
||||
@@ -119,6 +141,9 @@ async function submitInspection() {
|
||||
passQty.value = 0
|
||||
checkDesc.value = ''
|
||||
reportNo.value = ''
|
||||
disposalType.value = 'NONE'
|
||||
disposalRemark.value = ''
|
||||
returnTrackingNo.value = ''
|
||||
// 提交成功后主动刷新记录 Tab(用户切过去即可见最新)
|
||||
await loadRecords()
|
||||
} finally {
|
||||
@@ -126,6 +151,37 @@ async function submitInspection() {
|
||||
}
|
||||
}
|
||||
|
||||
/* ===================== 不合格处置(对已判定不合格的记录做退货/报废/部分入库) ===================== */
|
||||
const disposeDialog = reactive({ visible: false, row: null, type: 'RETURN', remark: '', trackingNo: '' })
|
||||
function openDispose(row) {
|
||||
if (row.status !== '不合格') {
|
||||
ElMessage.warning('仅「不合格」记录可执行处置')
|
||||
return
|
||||
}
|
||||
Object.assign(disposeDialog, { visible: true, row, type: 'RETURN', remark: '', trackingNo: '' })
|
||||
}
|
||||
async function submitDispose() {
|
||||
if (disposeDialog.type === 'RETURN' && !disposeDialog.trackingNo.trim()) {
|
||||
ElMessage.warning('退货必须填写货运单号')
|
||||
return
|
||||
}
|
||||
await request.post('/inspection/dispose', {
|
||||
recordId: disposeDialog.row.id,
|
||||
disposalType: disposeDialog.type,
|
||||
disposalRemark: disposeDialog.remark.trim(),
|
||||
returnTrackingNo: disposeDialog.trackingNo.trim(),
|
||||
})
|
||||
ElMessage.success('处置完成')
|
||||
disposeDialog.visible = false
|
||||
await loadRecords()
|
||||
}
|
||||
|
||||
// 附件抽屉(bizType=inspection,bizId=检验记录ID)
|
||||
const attachDrawer = reactive({ visible: false, id: '', targetId: '' })
|
||||
function openAttach(row) {
|
||||
Object.assign(attachDrawer, { visible: true, id: String(row.id), targetId: row.targetId })
|
||||
}
|
||||
|
||||
/* ===================== Tab2 检验记录(点击才加载) ===================== */
|
||||
// 默认近3个月起始日期
|
||||
function defaultStart() {
|
||||
@@ -167,6 +223,11 @@ function typeLabel(t) {
|
||||
function targetTypeLabel(t) {
|
||||
return t === 'SN' ? 'SN' : t === 'BATCH' ? '批次' : (t || '-')
|
||||
}
|
||||
// 不合格处置方式显示(NONE=未处置)
|
||||
function disposalLabel(t) {
|
||||
const m = { RETURN: '退货', SCRAP: '报废', PARTIAL: '部分入库' }
|
||||
return m[t] || '未处置'
|
||||
}
|
||||
|
||||
async function loadRecords() {
|
||||
loading.value = true
|
||||
@@ -244,6 +305,27 @@ onMounted(() => {
|
||||
<el-radio value="不合格">不合格</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 不合格品处置(判定不合格时才出现):退货/报废/部分入库 -->
|
||||
<template v-if="status === '不合格'">
|
||||
<el-form-item label="处置方式">
|
||||
<el-radio-group v-model="disposalType">
|
||||
<el-radio-button value="RETURN">退货</el-radio-button>
|
||||
<el-radio-button value="SCRAP">报废</el-radio-button>
|
||||
<el-radio-button value="PARTIAL">部分入库</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="disposalType === 'RETURN'" label="货运单号">
|
||||
<el-input v-model="returnTrackingNo" placeholder="退货运单号(必填)" clearable style="width:280px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="处置说明">
|
||||
<el-input v-model="disposalRemark" placeholder="报废 / 退货原因(可空)" clearable style="width:420px" />
|
||||
</el-form-item>
|
||||
<el-form-item label=" ">
|
||||
<el-alert type="warning" :closable="false" style="max-width:560px"
|
||||
title="不合格品自动隔离:库存质量状态置「不合格/待退」,禁止领料上线;退货必填货运单号。" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
<el-form-item label="检验员">
|
||||
<el-input v-model="inspector" placeholder="检验员姓名" clearable style="width:260px" />
|
||||
</el-form-item>
|
||||
@@ -374,6 +456,12 @@ onMounted(() => {
|
||||
size="small">{{ row.status || '未检' }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="处置方式" width="100" align="center">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.status === '不合格'">{{ disposalLabel(row.disposalType) }}</span>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="inspectQty" label="检验数" width="80" align="center">
|
||||
<template #default="{ row }">{{ row.inspectQty || 0 }}</template>
|
||||
</el-table-column>
|
||||
@@ -400,6 +488,13 @@ onMounted(() => {
|
||||
<el-table-column label="检验时间" width="155" align="center">
|
||||
<template #default="{ row }">{{ fmtTime(row.createdAt) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="130" align="center" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-if="row.status === '不合格'" link type="warning" size="small"
|
||||
@click="openDispose(row)">处置</el-button>
|
||||
<el-button link type="success" size="small" @click="openAttach(row)">附件</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
@@ -432,6 +527,46 @@ onMounted(() => {
|
||||
</el-card>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<!-- 不合格处置弹窗 -->
|
||||
<el-dialog v-model="disposeDialog.visible" title="不合格品处置" width="480px">
|
||||
<el-form label-width="96px">
|
||||
<el-form-item label="批次/SN">
|
||||
<el-input :model-value="disposeDialog.row?.targetId || ''" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料编码">
|
||||
<el-input :model-value="disposeDialog.row?.materialCode || ''" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="检验数 / 合格数">
|
||||
<el-input :model-value="(disposeDialog.row?.inspectQty || 0) + ' / ' + (disposeDialog.row?.passQty || 0)"
|
||||
disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="处置方式" required>
|
||||
<el-radio-group v-model="disposeDialog.type">
|
||||
<el-radio-button value="RETURN">退货</el-radio-button>
|
||||
<el-radio-button value="SCRAP">报废</el-radio-button>
|
||||
<el-radio-button value="PARTIAL">部分入库</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="disposeDialog.type === 'RETURN'" label="货运单号" required>
|
||||
<el-input v-model="disposeDialog.trackingNo" placeholder="退货运单号" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="处置说明">
|
||||
<el-input v-model="disposeDialog.remark" type="textarea" :rows="2" placeholder="原因(可空)" />
|
||||
</el-form-item>
|
||||
<el-alert v-if="disposeDialog.type === 'PARTIAL'" type="info" :closable="false"
|
||||
title="部分入库:按「合格数」拆分批次,合格部分入库、差额部分隔离待处置。" />
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="disposeDialog.visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitDispose">确认处置</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 检验记录附件抽屉 -->
|
||||
<el-drawer v-model="attachDrawer.visible" :title="`检验附件:${attachDrawer.targetId}`" size="620px">
|
||||
<AttachmentPanel biz-type="inspection" :biz-id="attachDrawer.id" title="附件(检验报告 / 照片)" />
|
||||
</el-drawer>
|
||||
</div>
|
||||
<PageHelp :data="helpInspection" page="Inspection" />
|
||||
</template>
|
||||
|
||||
@@ -9,7 +9,7 @@ import { helpLedger } from '../help'
|
||||
const orderNo = ref('')
|
||||
const materialCode = ref('')
|
||||
const materialName = ref('')
|
||||
const status = ref('')
|
||||
const stateFilter = ref('')
|
||||
const loading = ref(false)
|
||||
const queried = ref(false)
|
||||
const rows = ref([])
|
||||
@@ -28,7 +28,7 @@ async function load() {
|
||||
orderNo: orderNo.value.trim() || undefined,
|
||||
materialCode: materialCode.value.trim() || undefined,
|
||||
materialName: materialName.value.trim() || undefined,
|
||||
status: status.value || undefined,
|
||||
state: stateFilter.value || undefined,
|
||||
page: page.current,
|
||||
pageSize: page.size
|
||||
}
|
||||
@@ -48,12 +48,18 @@ function search() {
|
||||
|
||||
onMounted(load)
|
||||
|
||||
// 展示状态由「已出库 vs 需求总量」实时派生,不再直接展示表内"进行中":
|
||||
// 领料完结(缺口=0) / 部分领料(有出库、缺口>0) / 待领料(未出过库)
|
||||
// 备料四态(服务端派生,客户诉求 L242-258):齐套 / 预警 / 未齐套 / 未到货
|
||||
function stateTagType(s) {
|
||||
switch (s) {
|
||||
case '齐套': return 'success'
|
||||
case '预警': return 'danger'
|
||||
case '未齐套': return 'warning'
|
||||
case '未到货': return 'info'
|
||||
default: return 'info'
|
||||
}
|
||||
}
|
||||
function statusView(row) {
|
||||
if (row.status === '领料完结') return { text: '领料完结', type: 'success' }
|
||||
if ((row.outQty || 0) > 0) return { text: '部分领料', type: 'primary' }
|
||||
return { text: '待领料', type: 'info' }
|
||||
return row.state || '未齐套'
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -73,11 +79,12 @@ function statusView(row) {
|
||||
<el-input v-model="materialName" placeholder="物料名称(可空)" clearable
|
||||
style="width:160px" @keyup.enter="search" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-select v-model="status" placeholder="全部" clearable style="width:130px" @change="search">
|
||||
<el-option label="待领料" value="待领料" />
|
||||
<el-option label="部分领料" value="部分领料" />
|
||||
<el-option label="领料完结" value="领料完结" />
|
||||
<el-form-item label="备料状态">
|
||||
<el-select v-model="stateFilter" placeholder="全部" clearable style="width:130px" @change="search">
|
||||
<el-option label="齐套" value="齐套" />
|
||||
<el-option label="预警" value="预警" />
|
||||
<el-option label="未齐套" value="未齐套" />
|
||||
<el-option label="未到货" value="未到货" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@@ -98,13 +105,19 @@ function statusView(row) {
|
||||
<template #default="{ row }">{{ row.materialName || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="totalQty" label="需求总量" width="100" align="center" />
|
||||
<el-table-column prop="availableQty" label="可用库存" width="100" align="center">
|
||||
<template #default="{ row }">{{ row.availableQty ?? 0 }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="outQty" label="已出库" width="90" align="center" />
|
||||
<el-table-column label="缺口" width="90" align="center">
|
||||
<template #default="{ row }">{{ gapOf(row) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="110" align="center">
|
||||
<el-table-column label="目标工位" width="100" align="center">
|
||||
<template #default="{ row }">{{ row.targetStation || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备料状态" width="110" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="statusView(row).type" size="small">{{ statusView(row).text }}</el-tag>
|
||||
<el-tag :type="stateTagType(statusView(row))" size="small">{{ statusView(row) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" min-width="140">
|
||||
|
||||
@@ -0,0 +1,140 @@
|
||||
<script setup>
|
||||
defineOptions({ name: 'ReturnOrder' })
|
||||
import { onMounted, reactive, ref } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import request from '../utils/request'
|
||||
import { fmtTime } from '../utils/format'
|
||||
import { can } from '../utils/perm'
|
||||
import PageHelp from '../components/PageHelp.vue'
|
||||
import { helpReturnOrder } from '../help'
|
||||
|
||||
const statusFilter = ref('PENDING')
|
||||
const loading = ref(false)
|
||||
const rows = ref([])
|
||||
const total = ref(0)
|
||||
const page = reactive({ current: 1, size: 20 })
|
||||
|
||||
const canConfirm = can('return:confirm')
|
||||
|
||||
async function load() {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await request.get('/return-order/query', {
|
||||
params: {
|
||||
status: statusFilter.value || undefined,
|
||||
page: page.current,
|
||||
pageSize: page.size
|
||||
}
|
||||
})
|
||||
rows.value = data?.list || []
|
||||
total.value = data?.total || 0
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function search() {
|
||||
page.current = 1
|
||||
load()
|
||||
}
|
||||
|
||||
async function confirmReceive(row) {
|
||||
await ElMessageBox.confirm(
|
||||
`确认收到工位退库的【${row.materialCode} ${row.materialName || ''}】共 ${row.qty}${row.unit || ''}?\n` +
|
||||
`确认后该数量将加回库存(物料编码 ${row.materialCode}),退库单置为「已收货」。`,
|
||||
'确认收货',
|
||||
{ type: 'warning', confirmButtonText: '确认收货', cancelButtonText: '取消' }
|
||||
)
|
||||
await request.post('/return-order/confirm', { returnNo: row.returnNo })
|
||||
ElMessage.success('已确认收货,库存已加回')
|
||||
load()
|
||||
}
|
||||
|
||||
onMounted(load)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<el-card shadow="never" class="mb12">
|
||||
<el-form inline @submit.prevent="search">
|
||||
<el-form-item label="状态">
|
||||
<el-select v-model="statusFilter" placeholder="全部" clearable style="width:140px" @change="search">
|
||||
<el-option label="待确认收货" value="PENDING" />
|
||||
<el-option label="已收货" value="RECEIVED" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" :loading="loading" @click="search">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
退库单(共 {{ total }} 条)
|
||||
</template>
|
||||
<el-table :data="rows" border v-loading="loading" empty-text="暂无退库单">
|
||||
<el-table-column prop="returnNo" label="退库单号" min-width="170" />
|
||||
<el-table-column prop="orderNo" label="工单号" min-width="130">
|
||||
<template #default="{ row }">{{ row.orderNo || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="stationNo" label="退库工位" width="90" align="center">
|
||||
<template #default="{ row }">工位{{ row.stationNo || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sn" label="产品序列号" min-width="140">
|
||||
<template #default="{ row }">{{ row.sn || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="materialCode" label="物料编码" min-width="130" />
|
||||
<el-table-column prop="materialName" label="物料名称" min-width="140">
|
||||
<template #default="{ row }">{{ row.materialName || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="spec" label="规格" min-width="110">
|
||||
<template #default="{ row }">{{ row.spec || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" width="100" align="center">
|
||||
<template #default="{ row }">{{ row.qty }}{{ row.unit || '' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="reason" label="退库原因" min-width="140" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ row.reason || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="110" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="row.status === 'RECEIVED' ? 'success' : 'warning'" size="small">
|
||||
{{ row.status === 'RECEIVED' ? '已收货' : '待确认收货' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="operator" label="退库人" width="100" align="center">
|
||||
<template #default="{ row }">{{ row.operator || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="退库时间" width="165" align="center">
|
||||
<template #default="{ row }">{{ fmtTime(row.createdAt) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="receiveBy" label="收货人" width="100" align="center">
|
||||
<template #default="{ row }">{{ row.receiveBy || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="收货时间" width="165" align="center">
|
||||
<template #default="{ row }">{{ row.receiveAt ? fmtTime(row.receiveAt) : '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="120" align="center" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-if="canConfirm && row.status !== 'RECEIVED'" type="primary" size="small"
|
||||
@click="confirmReceive(row)">确认收货</el-button>
|
||||
<span v-else style="color:#999">-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="pager">
|
||||
<el-pagination background layout="total, prev, pager, next" :total="total"
|
||||
:current-page="page.current" :page-size="page.size"
|
||||
@current-change="(p) => { page.current = p; load() }" />
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
<PageHelp :data="helpReturnOrder" page="ReturnOrder" />
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.mb12 { margin-bottom: 12px; }
|
||||
.pager { display: flex; justify-content: flex-end; margin-top: 10px; }
|
||||
</style>
|
||||
@@ -7,8 +7,15 @@ import { fmtTime } from '../utils/format'
|
||||
import { getRealName } from '../utils/auth'
|
||||
import PageHelp from '../components/PageHelp.vue'
|
||||
import MaterialSelect from '../components/MaterialSelect.vue'
|
||||
import AttachmentPanel from '../components/AttachmentPanel.vue'
|
||||
import { helpSemi } from '../help'
|
||||
|
||||
// 半成品/成品附件(bizType=semi,bizId=SN)
|
||||
const attachDrawer = reactive({ visible: false, sn: '' })
|
||||
function openAttach(row) {
|
||||
Object.assign(attachDrawer, { visible: true, sn: row.sn })
|
||||
}
|
||||
|
||||
/* ---------- 半成品/成品入库(携带已完成工序,连续扫码) ---------- */
|
||||
// 物料下拉由 MaterialSelect 组件按需远程搜索(最近 100 条)
|
||||
|
||||
@@ -214,6 +221,11 @@ function search() {
|
||||
<el-table-column label="创建时间" width="160" align="center">
|
||||
<template #default="{ row }">{{ fmtTime(row.createdAt) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="90" align="center" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button link type="success" size="small" @click="openAttach(row)">附件</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="pager">
|
||||
<el-pagination background layout="total, prev, pager, next" :total="total"
|
||||
@@ -223,6 +235,11 @@ function search() {
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
|
||||
<!-- 半成品/成品附件抽屉(bizType=semi,bizId=SN):入库资料 / 试验记录单 -->
|
||||
<el-drawer v-model="attachDrawer.visible" :title="`半成品附件:${attachDrawer.sn}`" size="620px">
|
||||
<AttachmentPanel biz-type="semi" :biz-id="attachDrawer.sn" title="附件(入库资料 / 试验记录)" />
|
||||
</el-drawer>
|
||||
<PageHelp :data="helpSemi" page="Semi" />
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user