提交
This commit is contained in:
@@ -5,7 +5,7 @@ import { useRoute } from 'vue-router'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import request from '../utils/request'
|
||||
import { getRealName } from '../utils/auth'
|
||||
import { fmtTime } from '../utils/format'
|
||||
import { fmtTime, fmtDateOnly, friendlyBatchLabel } from '../utils/format'
|
||||
import { exportXlsxFetch } from '../utils/export'
|
||||
import { can } from '../utils/perm'
|
||||
import PageHelp from '../components/PageHelp.vue'
|
||||
@@ -72,7 +72,25 @@ async function loadPicker(kw = '') {
|
||||
else if (targetType.value === 'ELEC') params.manageMode = '2' // 电气件
|
||||
else if (targetType.value === 'OTHER') params.manageMode = '3' // 其他(辅料/工装/试验设备)
|
||||
const data = await request.get('/stock/details', { params })
|
||||
pickerOptions.value = data?.list || []
|
||||
const list = data?.list || []
|
||||
// 批次行改友好显示(2026-10-21 批次号收口):{图号} · {入库日期}入库 · 可用{数量}件 · {供应商},同物料同日多批加「第N批」;
|
||||
// 批次号仅作 value,界面不出现。SN 行保持原样
|
||||
const dayCount = {}
|
||||
const daySeen = {}
|
||||
for (const o of list) {
|
||||
if (Number(o.snMode) !== 1 && o.batchNo) {
|
||||
const k = `${o.materialCode || ''}|${fmtDateOnly(o.createdAt)}`
|
||||
dayCount[k] = (dayCount[k] || 0) + 1
|
||||
}
|
||||
}
|
||||
for (const o of list) {
|
||||
if (Number(o.snMode) !== 1 && o.batchNo) {
|
||||
const k = `${o.materialCode || ''}|${fmtDateOnly(o.createdAt)}`
|
||||
daySeen[k] = (daySeen[k] || 0) + 1
|
||||
o.fbLabel = `${o.materialCode || ''} · ${friendlyBatchLabel(o, dayCount[k] > 1 ? daySeen[k] : 0)}`
|
||||
}
|
||||
}
|
||||
pickerOptions.value = list
|
||||
} catch (e) {
|
||||
pickerOptions.value = []
|
||||
} finally {
|
||||
@@ -84,8 +102,9 @@ function pickerId(opt) {
|
||||
return Number(opt.snMode) === 1 ? opt.snCode : opt.batchNo // 列表混排批次/SN 行,按行 sn_mode 取标识
|
||||
}
|
||||
function pickerLabel(opt) {
|
||||
if (opt.fbLabel) return opt.fbLabel // 批次行:友好标签(图号·入库日期·可用数量·供应商),批次号不显示
|
||||
const id = pickerId(opt)
|
||||
return `${opt.materialCode || ''}|${id || ''}` // 下拉已按 qualityStatus=未检 过滤,无需再展示质量后缀
|
||||
return `${opt.materialCode || ''}|${id || ''}` // SN 行;下拉已按 qualityStatus=未检 过滤,无需再展示质量后缀
|
||||
}
|
||||
|
||||
function addItem(targetId, qty, materialCode = '', materialName = '', inboundNo = '', snMode = null) {
|
||||
@@ -288,7 +307,7 @@ async function submitInspection() {
|
||||
}
|
||||
|
||||
/* ===================== 待检清单(按入库单分组,§B2/E2) ===================== */
|
||||
const pendingFilters = reactive({ materialCode: '', inboundType: '', manageMode: '' })
|
||||
const pendingFilters = reactive({ materialCode: '', inboundNo: '', materialName: '', inboundType: '', dateFrom: '', dateTo: '' })
|
||||
const pendingLoading = ref(false)
|
||||
const pendingRows = ref([])
|
||||
const pendingTotal = ref(0)
|
||||
@@ -350,7 +369,11 @@ function loadPending() {
|
||||
try {
|
||||
const params = {
|
||||
materialCode: pendingFilters.materialCode.trim(),
|
||||
inboundNo: pendingFilters.inboundNo.trim(),
|
||||
materialName: pendingFilters.materialName.trim(),
|
||||
inboundType: pendingFilters.inboundType,
|
||||
dateFrom: pendingFilters.dateFrom,
|
||||
dateTo: pendingFilters.dateTo,
|
||||
manageMode: pendingFilters.manageMode,
|
||||
page: pendingPage.current,
|
||||
pageSize: pendingPage.size
|
||||
@@ -370,7 +393,7 @@ function searchPending() {
|
||||
}
|
||||
|
||||
function resetPending() {
|
||||
Object.assign(pendingFilters, { materialCode: '', inboundType: '', manageMode: '' })
|
||||
Object.assign(pendingFilters, { materialCode: '', inboundNo: '', materialName: '', inboundType: '', dateFrom: '', dateTo: '' })
|
||||
pendingPage.current = 1
|
||||
loadPending()
|
||||
}
|
||||
@@ -558,6 +581,17 @@ onMounted(() => {
|
||||
<el-form-item label="图号">
|
||||
<el-input v-model="pendingFilters.materialCode" placeholder="图号(模糊)" clearable style="width:150px" @keyup.enter="searchPending" />
|
||||
</el-form-item>
|
||||
<el-form-item label="入库单号">
|
||||
<el-input v-model="pendingFilters.inboundNo" placeholder="入库单号(模糊)" clearable style="width:150px" @keyup.enter="searchPending" />
|
||||
</el-form-item>
|
||||
<el-form-item label="名称">
|
||||
<el-input v-model="pendingFilters.materialName" placeholder="物料名称(模糊)" clearable style="width:140px" @keyup.enter="searchPending" />
|
||||
</el-form-item>
|
||||
<el-form-item label="入库时间">
|
||||
<el-date-picker v-model="pendingFilters.dateFrom" type="date" value-format="YYYY-MM-DD" placeholder="开始" style="width:130px" @change="searchPending" />
|
||||
<span style="margin:0 4px;color:#909399">~</span>
|
||||
<el-date-picker v-model="pendingFilters.dateTo" type="date" value-format="YYYY-MM-DD" placeholder="结束" style="width:130px" @change="searchPending" />
|
||||
</el-form-item>
|
||||
<el-form-item label="入库类型">
|
||||
<el-select v-model="pendingFilters.inboundType" placeholder="全部" clearable style="width:130px" @change="searchPending">
|
||||
<el-option label="采购入库" value="purchase" />
|
||||
@@ -590,6 +624,9 @@ onMounted(() => {
|
||||
<el-table-column prop="materialName" label="名称" min-width="120">
|
||||
<template #default="{ row }">{{ row.materialName || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="序列号" width="80" align="center">
|
||||
<template #default="{ row }">{{ snModeText(row.snMode) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="未检数量" width="100" align="center">
|
||||
<template #default="{ row }">{{ row.unInspectedQty }}</template>
|
||||
</el-table-column>
|
||||
|
||||
Reference in New Issue
Block a user