feat: 重构入库流程,支持序列号与类型解耦,新增通用入库组件
- 重构物料档案字段:将"序列号件"改为"序列号",描述是否有序列号,与类型独立 - 调整入库页逻辑:按物料"序列号"决定记账方式,类型仅用于页签归属 - 新增通用入库组件 InboundEntry,复用三个类型页签的表单逻辑 - 优化成品入库页面,提交后自动切换到入库列表页签 - 修正物料校验提示文案,统一表述为"是否有序列号"
This commit is contained in:
@@ -38,8 +38,9 @@
|
||||
<el-table-column label="创建时间" width="160" align="center">
|
||||
<template #default="{ row }">{{ fmtTime(row.createdAt) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="150" align="center" fixed="right">
|
||||
<el-table-column label="操作" width="200" align="center" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button link type="primary" size="small" @click="openDetail(row)">详情</el-button>
|
||||
<el-button v-if="can('sys.role:edit')" link type="primary" size="small"
|
||||
:disabled="row.code === 'SUPER_ADMIN'" @click="openEdit(row)">编辑权限</el-button>
|
||||
<el-button v-if="can('sys.role:delete')" link type="danger" size="small"
|
||||
@@ -77,6 +78,7 @@
|
||||
<el-button type="primary" :loading="saving" @click="save">保存</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<DetailDrawer :visible="detail.show" :title="detail.title" :fields="detail.fields" :data="detail.row" @update:visible="detail.show = $event" />
|
||||
</div>
|
||||
<PageHelp :data="helpRole" page="RoleManage" />
|
||||
</template>
|
||||
@@ -89,6 +91,7 @@ import request from '../utils/request'
|
||||
import { fmtTime } from '../utils/format'
|
||||
import { can } from '../utils/perm'
|
||||
import PageHelp from '../components/PageHelp.vue'
|
||||
import DetailDrawer from '../components/DetailDrawer.vue'
|
||||
import { helpRole } from '../help'
|
||||
|
||||
const loading = ref(false)
|
||||
@@ -96,6 +99,29 @@ const roles = ref([])
|
||||
const perms = ref([]) // 全部权限定义(MENU + BUTTON)
|
||||
const treeRef = ref()
|
||||
|
||||
/* ---------- 详情抽屉 ---------- */
|
||||
const detail = reactive({ show: false, title: '角色详情', fields: [], row: null })
|
||||
function openDetail(row) {
|
||||
detail.fields = [
|
||||
{ key: 'id', label: 'ID' },
|
||||
{ key: 'code', label: '角色编码' },
|
||||
{ key: 'name', label: '角色名称' },
|
||||
{ key: 'builtin', label: '内置角色' },
|
||||
{ key: 'permCount', label: '权限数' },
|
||||
{ key: 'perms', label: '权限明细' },
|
||||
{ key: 'remark', label: '备注' },
|
||||
{ key: 'createdAt', label: '创建时间', type: 'time' }
|
||||
]
|
||||
detail.row = {
|
||||
...row,
|
||||
builtin: ['SUPER_ADMIN', 'OPERATOR', 'INSPECTOR'].includes(row.code) ? '是' : '否',
|
||||
permCount: permCount(row),
|
||||
perms: permSummary(row),
|
||||
remark: row.remark || '-'
|
||||
}
|
||||
detail.show = true
|
||||
}
|
||||
|
||||
const codeName = computed(() => {
|
||||
const m = {}
|
||||
for (const p of perms.value) m[p.code] = p.name
|
||||
|
||||
@@ -27,12 +27,12 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="接驳台(实体)" width="100" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag size="small" :type="row.hasDock ? 'success' : 'info'">{{ row.hasDock ? '有' : '无' }}</el-tag>
|
||||
<el-tag size="small" :type="hasDockOf(row.stationNo) ? 'success' : 'info'">{{ hasDockOf(row.stationNo) ? '有' : '无' }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="接驳台编码" min-width="150">
|
||||
<el-table-column label="接驳台编码" min-width="170">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.dockCode">{{ row.dockCode }}</span>
|
||||
<span v-if="dockCodesOf(row.stationNo)">{{ dockCodesOf(row.stationNo) }}</span>
|
||||
<span v-else style="color:#909399">未绑定</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -121,6 +121,26 @@ import { helpStation } from '../help'
|
||||
|
||||
const stations = ref([])
|
||||
const flows = ref([])
|
||||
// 接驳台主数据(真源在 dock 表):一工位可绑多个接驳台(R1/R2),展示按 dock.station_no 聚合
|
||||
const dockByStation = ref({})
|
||||
|
||||
async function loadDocks() {
|
||||
const data = await request.get('/docks', { params: { page: 1, size: 200 } })
|
||||
const map = {}
|
||||
for (const d of data?.list || []) {
|
||||
const no = Number(d.stationNo) || 0
|
||||
if (no <= 0) continue
|
||||
;(map[no] = map[no] || []).push(d.dockCode)
|
||||
}
|
||||
dockByStation.value = map
|
||||
}
|
||||
function dockCodesOf(no) {
|
||||
const codes = dockByStation.value[Number(no)] || []
|
||||
return codes.length ? codes.join(' / ') : ''
|
||||
}
|
||||
function hasDockOf(no) {
|
||||
return (dockByStation.value[Number(no)] || []).length > 0
|
||||
}
|
||||
|
||||
// 终端页签固定集合(与工位终端 Main.vue 页签一一对应)
|
||||
const TAB_OPTIONS = [
|
||||
@@ -217,7 +237,7 @@ async function remove(row) {
|
||||
// ---------- 工位派工已删除:路线由工单「工艺组合」决定,绑定关系即本页下拉选择 ----------
|
||||
|
||||
onMounted(async () => {
|
||||
await load()
|
||||
await Promise.all([load(), loadDocks()])
|
||||
flows.value = (await request.get('/process-flows', { params: { pageSize: 1000, page: 1 } }))?.list || []
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -175,7 +175,9 @@ function stepDisplay(step) {
|
||||
}
|
||||
|
||||
async function load() {
|
||||
stations.value = (await request.get('/stations')) || []
|
||||
const list = (await request.get('/stations')) || []
|
||||
// 虚拟工位作业只允许选择虚拟工位(0/13/14/15),过滤掉实体工位,防止误选
|
||||
stations.value = list.filter((s) => s.stationType === 'OFFLINE')
|
||||
}
|
||||
|
||||
async function loadTask() {
|
||||
|
||||
Reference in New Issue
Block a user