feat(wms): 增加版本管理功能和操作按钮

在规程主表的操作列中新增“版本与方案”按钮,点击后可跳转至版本管理页面。更新了操作列的宽度以适应新按钮。同时,在后端服务中添加了对规程版本存在性的校验,确保在删除规程时不会影响相关版本数据。
This commit is contained in:
王文昊
2026-04-20 19:14:50 +08:00
parent 62b594026b
commit f501994da6
22 changed files with 1357 additions and 2 deletions

View File

@@ -74,8 +74,9 @@
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="160" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="140">
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="220">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-document" @click="goVersionManage(scope.row)">版本与方案</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
</template>
@@ -300,6 +301,21 @@ export default {
this.download('wms/processSpec/export', {
...this.queryParams
}, `processSpec_${new Date().getTime()}.xlsx`)
},
goVersionManage(row) {
const specId = row.specId
if (specId == null || specId === '') {
this.$modal.msgWarning('无法获取规程ID请刷新列表后重试')
return
}
// 固定落在「…/processSpec/version」避免列表为 …/processSpec/list 时拼成 …/list/version 导致路由不匹配、query 丢失
const pathCurrent = this.$route.path.replace(/\/$/, '')
const m = pathCurrent.match(/^(.*\/processSpec)(?:\/.*)?$/)
const base = m ? m[1] : pathCurrent
this.$router.push({
path: `${base}/version`,
query: { specId: String(specId) }
})
}
}
}