feat: 新增产品工艺管理与工序审核功能
- 新增产品工艺(product_process)及明细(product_process_item)数据模型 - 新增工序审核开关(need_audit)与审核角色(audit_role)字段 - 新增待审核签字页面与路由 - 优化 WMS/MES 接口交互,增加业务错误处理与友好提示 - 补充库存过滤逻辑,避免返回已出库 SN 数据 - 调整默认查询时间范围为近一个月,优化用户体验
This commit is contained in:
@@ -241,7 +241,7 @@ onMounted(() => { loadDocks(); loadTasks(); loadMode() })
|
||||
<!-- ③ 下发 AGV(仓管操作) -->
|
||||
<el-tab-pane label="下发AGV" name="dispatch" lazy>
|
||||
<div class="toolbar">
|
||||
<el-select v-model="mrQuery.status" style="width: 130px" @change="mrPage.current = 1; loadMrs()">
|
||||
<el-select v-model="mrQuery.status" style="width: 130px" placeholder="请选择状态" @change="mrPage.current = 1; loadMrs()">
|
||||
<el-option label="待发料(PENDING)" value="PENDING" />
|
||||
<el-option label="已备料(已出库)" value="LOCKED" />
|
||||
<el-option label="配送中(DELIVERING)" value="DELIVERING" />
|
||||
@@ -251,7 +251,7 @@ onMounted(() => { loadDocks(); loadTasks(); loadMode() })
|
||||
<span class="tip">勾选待发料行 → 行内可改目标接驳台 → 下发</span>
|
||||
</div>
|
||||
<div class="toolbar">
|
||||
<el-select v-model="sourceDock" style="width: 130px">
|
||||
<el-select v-model="sourceDock" style="width: 130px" placeholder="请选择接驳台">
|
||||
<el-option v-for="d in dockOptions" :key="d" :label="d" :value="d" />
|
||||
</el-select>
|
||||
<el-button @click="batchSetDock('DOCK01')">批量设 DOCK01</el-button>
|
||||
|
||||
@@ -792,7 +792,7 @@ async function onMaterialFile(e) {
|
||||
<el-input v-model="nodeForm.remark" type="textarea" :rows="2" placeholder="备注(可空)" />
|
||||
</el-form-item>
|
||||
<el-form-item v-if="nodeEditing" label="状态">
|
||||
<el-select v-model="nodeForm.status" style="width:130px">
|
||||
<el-select v-model="nodeForm.status" style="width:130px" placeholder="请选择状态">
|
||||
<el-option label="启用" value="启用" />
|
||||
<el-option label="停用" value="停用" />
|
||||
</el-select>
|
||||
|
||||
@@ -279,7 +279,7 @@ onActivated(() => {
|
||||
<div>
|
||||
<div style="font-weight:600;margin-bottom:6px">批次件导入(序列号=否 的物料)</div>
|
||||
<div style="margin-bottom:8px;color:#909399;font-size:12px">
|
||||
列头顺序(首行忽略)<b>图号 | 批次号(可空自动生成) | 数量 | 生产日期 | 供应商 | 区域 | 备注</b>
|
||||
列头顺序(首行忽略)<b>图号 | 批次号(可空自动生成) | 数量 | 生产日期 | 供应商 | 区域 | 架 | 层 | 位 | 备注 | 检测单号 | 产品工号 | 归属类型 | 归属编号</b>(架/层/位/备注/检测单号/产品工号/归属 可缺列,缺则留空)
|
||||
</div>
|
||||
<el-upload ref="batchUploadRef" :auto-upload="false" accept=".xlsx" :limit="1" drag
|
||||
:on-exceed="(f) => onExceed(f, 'batch')">
|
||||
@@ -293,7 +293,7 @@ onActivated(() => {
|
||||
<div>
|
||||
<div style="font-weight:600;margin-bottom:6px">SN 件导入(序列号=是 的物料)</div>
|
||||
<div style="margin-bottom:8px;color:#909399;font-size:12px">
|
||||
列头顺序(首行忽略)<b>图号 | SN | 区域 | 生产日期 | 供应商</b>
|
||||
列头顺序(首行忽略)<b>图号 | SN | 区域 | 生产日期 | 供应商 | 架 | 层 | 位 | 备注 | 检测单号 | 产品工号 | 归属类型 | 归属编号</b>(架/层/位/备注/检测单号/产品工号/归属 可缺列,缺则留空)
|
||||
</div>
|
||||
<el-upload ref="snUploadRef" :auto-upload="false" accept=".xlsx" :limit="1" drag
|
||||
:on-exceed="(f) => onExceed(f, 'sn')">
|
||||
|
||||
@@ -334,7 +334,14 @@ const inboundTypeLabel = (t) => {
|
||||
const m = { purchase: '采购入库', semi: '半成品入库', finished: '成品入库', return: '退库入库', other: '其他入库' }
|
||||
return m[t] || t || '-'
|
||||
}
|
||||
const pendingTargetLabel = (d) => (d.matManageMode === 3 ? '其他' : d.snMode === 1 ? '序列号件' : '批次件')
|
||||
// 与物料档案字段口径一致:类型(1结构件/2电气件/3其他) / 序列号(1是/2否/0未选择)
|
||||
const matTypeText = (m) => (m === 3 ? '其他' : m === 2 ? '电气件' : '结构件')
|
||||
const snModeText = (v) => (Number(v) === 1 ? '是' : Number(v) === 2 ? '否' : '未选择')
|
||||
// 抽屉明细行 snMode 取首行(同一物料编码所有行一致,抽屉打开即加载)
|
||||
const headSnMode = computed(() => {
|
||||
const first = detailDrawer.list && detailDrawer.list[0]
|
||||
return first ? first.snMode : null
|
||||
})
|
||||
|
||||
function loadPending() {
|
||||
pendingLoading.value = true
|
||||
@@ -548,7 +555,7 @@ onMounted(() => {
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-card shadow="never" header="待检清单(quality_status=未检,按入库单分组;点「查看明细」右侧抽屉)">
|
||||
<el-card shadow="never" header="待检清单">
|
||||
<el-table :data="pendingRows" border size="small" v-loading="pendingLoading" empty-text="暂无待检(全部已检)">
|
||||
<el-table-column prop="inboundNo" label="入库单号" min-width="160" />
|
||||
<el-table-column label="入库类型" width="110" align="center">
|
||||
@@ -622,7 +629,7 @@ onMounted(() => {
|
||||
</el-form-item>
|
||||
<el-form-item label="归属">
|
||||
<div style="display:flex;gap:8px;width:100%;max-width:560px">
|
||||
<el-select v-model="ownershipType" style="width:150px" :disabled="!!sourceInboundNo">
|
||||
<el-select v-model="ownershipType" style="width:150px" placeholder="请选择归属" :disabled="!!sourceInboundNo">
|
||||
<el-option label="合同号" value="workorder" />
|
||||
<el-option label="科技项目号" value="project" />
|
||||
<el-option label="其他" value="other" />
|
||||
@@ -894,10 +901,13 @@ onMounted(() => {
|
||||
<el-drawer v-model="detailDrawer.visible"
|
||||
:title="`待检明细:${detailDrawer.row?.inboundNo} · ${detailDrawer.row?.materialCode}`"
|
||||
size="640px" destroy-on-close>
|
||||
<div v-if="detailDrawer.row" style="margin-bottom:10px">
|
||||
<el-tag type="info" size="small">{{ inboundTypeLabel(detailDrawer.row.inboundType) }}</el-tag>
|
||||
<el-tag size="small" style="margin-left:6px">{{ detailDrawer.row.materialName || '-' }}</el-tag>
|
||||
<el-tag size="small" style="margin-left:6px">{{ ownershipTypeLabel(detailDrawer.row.ownershipType) }}:{{ detailDrawer.row.ownershipNo || '-' }}</el-tag>
|
||||
<div v-if="detailDrawer.row" class="insp-head">
|
||||
<span class="ih-item"><b>入库类型</b>{{ inboundTypeLabel(detailDrawer.row.inboundType) }}</span>
|
||||
<span class="ih-item"><b>图号</b>{{ detailDrawer.row.materialCode || '-' }}</span>
|
||||
<span class="ih-item"><b>名称</b>{{ detailDrawer.row.materialName || '-' }}</span>
|
||||
<span class="ih-item"><b>类型</b>{{ matTypeText(detailDrawer.row.matManageMode) }}</span>
|
||||
<span class="ih-item"><b>序列号</b>{{ snModeText(headSnMode) }}</span>
|
||||
<span class="ih-item"><b>归属</b>{{ ownershipTypeLabel(detailDrawer.row.ownershipType) }}:{{ detailDrawer.row.ownershipNo || '-' }}</span>
|
||||
</div>
|
||||
<el-table :data="detailDrawer.list" border size="small" v-loading="detailDrawer.loading" empty-text="暂无明细">
|
||||
<el-table-column width="50" align="center">
|
||||
@@ -907,9 +917,6 @@ onMounted(() => {
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="编号" prop="targetId" min-width="170" />
|
||||
<el-table-column label="类型" width="80" align="center">
|
||||
<template #default="{ row }">{{ pendingTargetLabel(row) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" width="70" align="center">
|
||||
<template #default="{ row }">{{ row.quantity }}</template>
|
||||
</el-table-column>
|
||||
@@ -981,4 +988,6 @@ onMounted(() => {
|
||||
.mb12 { margin-bottom: 12px; }
|
||||
.pager { display: flex; justify-content: flex-end; margin-top: 12px; }
|
||||
.tip { margin-left: 10px; color: #909399; font-size: 12px; }
|
||||
.insp-head { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 12px; font-size: 13px; color: #606266; align-items: center; }
|
||||
.insp-head .ih-item b { color: #303133; margin-right: 4px; font-weight: 600; }
|
||||
</style>
|
||||
|
||||
@@ -496,7 +496,7 @@ onMounted(loadDicts)
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="出库类别" required>
|
||||
<el-select v-model="genForm.outboundCategory" style="width:100%">
|
||||
<el-select v-model="genForm.outboundCategory" style="width:100%" placeholder="请选择出库类别">
|
||||
<el-option v-for="c in CATEGORY_OPTIONS" :key="c.value" :value="c.value" :label="c.label" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -504,7 +504,7 @@ onMounted(loadDicts)
|
||||
<el-input v-model="genForm.inspectionNo" placeholder="退货/报废需溯源检验单据时填写(选填)" clearable style="width:100%" />
|
||||
</el-form-item>
|
||||
<el-form-item label="归属">
|
||||
<el-select v-model="genForm.ownershipType" style="width:160px;margin-right:8px">
|
||||
<el-select v-model="genForm.ownershipType" style="width:160px;margin-right:8px" placeholder="请选择归属">
|
||||
<el-option v-for="o in OWNERSHIP_OPTIONS" :key="o.value" :value="o.value" :label="o.label" />
|
||||
</el-select>
|
||||
<el-input v-if="genForm.ownershipType !== 'none'" v-model="genForm.ownershipNo"
|
||||
|
||||
@@ -252,7 +252,7 @@ onMounted(() => {
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" required>
|
||||
<el-select v-model="form.isActive" style="width:100%">
|
||||
<el-select v-model="form.isActive" style="width:100%" placeholder="请选择状态">
|
||||
<el-option label="启用" :value="true" />
|
||||
<el-option label="停用" :value="false" />
|
||||
</el-select>
|
||||
|
||||
@@ -5,6 +5,18 @@ import { getToken } from './auth'
|
||||
// 统一请求实例:baseURL /api,响应为 { code, message, data }
|
||||
const request = axios.create({ baseURL: '/api', timeout: 30000 })
|
||||
|
||||
// 业务化报错:把底层网络/连接/服务不可达等技术错误翻译成业务人员能看懂的提示
|
||||
function friendlyMsg(raw) {
|
||||
if (!raw || typeof raw !== 'string') return '操作失败,请稍后重试'
|
||||
if (/dial tcp|connectex|connection could be made|refused|ECONNREFUSED|ETIMEDOUT|127\.0\.0\.1|Post "http|Get "http|WMS 未配置|拉取 WMS|无法获取 WMS|MES 未配置|拉取 MES/i.test(raw)) {
|
||||
return '无法连接服务(服务未启动或网络不可达),相关功能暂不可用;请检查服务状态或联系管理员'
|
||||
}
|
||||
if (/Network Error|Failed to fetch|ERR_NETWORK|ERR_CONNECTION|网络异常|网络连接/i.test(raw)) {
|
||||
return '网络连接异常,请检查网络后重试或联系管理员'
|
||||
}
|
||||
return raw
|
||||
}
|
||||
|
||||
request.interceptors.request.use((config) => {
|
||||
const token = getToken()
|
||||
if (token) config.headers.Authorization = `Bearer ${token}`
|
||||
@@ -20,7 +32,7 @@ request.interceptors.response.use(
|
||||
const body = resp.data
|
||||
if (body && typeof body === 'object' && 'code' in body) {
|
||||
if (body.code !== 0) {
|
||||
const msg = body.message || '操作失败'
|
||||
const msg = friendlyMsg(body.message || '操作失败')
|
||||
ElMessage.error(msg)
|
||||
return Promise.reject(new Error(msg))
|
||||
}
|
||||
@@ -37,7 +49,7 @@ request.interceptors.response.use(
|
||||
window.location.href = '/login'
|
||||
}
|
||||
} else {
|
||||
const msg = error.response?.data?.message || error.message || '网络错误'
|
||||
const msg = friendlyMsg(error.response?.data?.message || error.message || '网络错误')
|
||||
ElMessage.error(msg)
|
||||
}
|
||||
return Promise.reject(error)
|
||||
|
||||
Reference in New Issue
Block a user