refactor: 全链路统一将物料编码改称图号,优化入库流程
1. 统一全系统UI与文档中的"物料编码"为客户口径"图号",覆盖前端页面、后端导出表头与帮助文档
2. 优化入库模块:
- 新增归属类型"其他"并完善注释
- 入库时自动回写入库单批次号
- 优化库位选择为三级联动下拉选择,替换原手动输入
- 新增入库归属编号录入功能
3. 更新需求文档,同步完成图号全链路改造的验收标记
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<script setup>
|
||||
defineOptions({ name: 'BaseData' })
|
||||
import { computed, reactive, ref, watch } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import request from '../utils/request'
|
||||
import { fmtTime } from '../utils/format'
|
||||
import { can } from '../utils/perm'
|
||||
@@ -50,7 +50,7 @@ async function loadZones() {
|
||||
try {
|
||||
const data = await request.get('/zone/list', {
|
||||
params: {
|
||||
zoneCode: zoneFilter.zoneCode.trim(),
|
||||
zoneCode: zoneFilter.zoneCode.trim().toUpperCase(),
|
||||
zoneName: zoneFilter.zoneName.trim(),
|
||||
status: zoneFilter.status,
|
||||
page: zonePage.current,
|
||||
@@ -89,6 +89,15 @@ async function saveZone() {
|
||||
ElMessage.warning('区域编码和区域名称必填')
|
||||
return
|
||||
}
|
||||
try {
|
||||
await ElMessageBox.confirm('确认保存该区域信息吗?保存后将写入数据库。', '操作确认', {
|
||||
confirmButtonText: '确认保存',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
zoneSaving.value = true
|
||||
try {
|
||||
if (zoneEditingId.value) {
|
||||
@@ -188,6 +197,15 @@ async function saveMaterial() {
|
||||
ElMessage.warning('「其他」类物料必须填写规格型号')
|
||||
return
|
||||
}
|
||||
try {
|
||||
await ElMessageBox.confirm('确认保存该物料档案吗?保存后将写入数据库。', '操作确认', {
|
||||
confirmButtonText: '确认保存',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
mSaving.value = true
|
||||
try {
|
||||
if (mEditingId.value) {
|
||||
@@ -199,18 +217,21 @@ async function saveMaterial() {
|
||||
manageMode: mForm.manageMode
|
||||
})
|
||||
ElMessage.success('物料修改成功')
|
||||
matDialog.value = false
|
||||
} else {
|
||||
await request.post('/material/create', { ...mForm, itemType: Number(mForm.itemType), safetyStock: Number(mForm.safetyStock) || 0 })
|
||||
ElMessage.success('物料新增成功')
|
||||
const created = await request.post('/material/create', { ...mForm, itemType: Number(mForm.itemType), safetyStock: Number(mForm.safetyStock) || 0 })
|
||||
ElMessage.success('物料新增成功,可继续上传图纸/附件')
|
||||
// 创建成功后切到编辑态:保持弹窗打开,便于立即上传附件
|
||||
mEditingId.value = created?.id || 0
|
||||
if (created?.code) mForm.code = created.code
|
||||
}
|
||||
matDialog.value = false
|
||||
await loadMaterials()
|
||||
} finally {
|
||||
mSaving.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 物料附件(bizType=material,bizId=物料编码):零件图纸 PDF 等
|
||||
// 物料附件(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 })
|
||||
@@ -308,7 +329,7 @@ async function onMaterialFile(e) {
|
||||
<el-form inline style="margin-bottom:14px" @submit.prevent="searchZones">
|
||||
<el-form-item label="区域编码">
|
||||
<el-input v-model="zoneFilter.zoneCode" placeholder="区域编码" clearable style="width:140px"
|
||||
@keyup.enter="searchZones" />
|
||||
@keyup.enter="searchZones" @input="zoneFilter.zoneCode = (zoneFilter.zoneCode || '').toUpperCase()" />
|
||||
</el-form-item>
|
||||
<el-form-item label="区域名称">
|
||||
<el-input v-model="zoneFilter.zoneName" placeholder="区域名称" clearable style="width:150px"
|
||||
@@ -368,7 +389,7 @@ async function onMaterialFile(e) {
|
||||
append-to-body destroy-on-close>
|
||||
<el-form label-width="90px">
|
||||
<el-form-item label="区域编码" required>
|
||||
<el-input v-model="zoneForm.zoneCode" placeholder="如 Z05" :disabled="!!zoneEditingId" clearable />
|
||||
<el-input v-model="zoneForm.zoneCode" placeholder="如 Z05" :disabled="!!zoneEditingId" clearable @input="zoneForm.zoneCode = (zoneForm.zoneCode || '').toUpperCase()" />
|
||||
</el-form-item>
|
||||
<el-form-item label="区域名称" required>
|
||||
<el-input v-model="zoneForm.zoneName" placeholder="如 待检区" clearable />
|
||||
@@ -486,8 +507,8 @@ async function onMaterialFile(e) {
|
||||
<el-dialog v-model="matDialog" :title="mEditingId ? '编辑物料' : '新增物料'" width="560px"
|
||||
append-to-body destroy-on-close>
|
||||
<el-form label-width="90px">
|
||||
<el-form-item label="物料编码/图号" required>
|
||||
<el-input v-model="mForm.code" placeholder="图号即物料编码,如 SCREW-M3" :disabled="!!mEditingId" clearable />
|
||||
<el-form-item label="图号" required>
|
||||
<el-input v-model="mForm.code" placeholder="图号,如 SCREW-M3" :disabled="!!mEditingId" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="名称" required>
|
||||
<el-input v-model="mForm.name" placeholder="如 螺丝 M3" clearable />
|
||||
@@ -523,6 +544,7 @@ async function onMaterialFile(e) {
|
||||
<el-input v-model="mForm.description" type="textarea" :rows="2" placeholder="备注(可空)" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<AttachmentPanel v-if="mEditingId" biz-type="material" :biz-id="mForm.code" title="附件(零件图纸 / 资料)" />
|
||||
<template #footer>
|
||||
<el-button @click="matDialog = false">取消</el-button>
|
||||
<el-button type="primary" :loading="mSaving" @click="saveMaterial">保存</el-button>
|
||||
|
||||
Reference in New Issue
Block a user