feat(mes): 增强工序管理功能,新增工序校验逻辑

新增工序创建和更新时的存在性校验,确保工序有效性。
同时,重构工艺路线服务,优化工序引用检查逻辑。
pull/871/MERGE
YunaiV 2026-04-04 11:28:27 +08:00
parent 12566d6860
commit d18a58f44f
3 changed files with 18 additions and 18 deletions

View File

@ -84,18 +84,6 @@ const { t } = useI18n() // 国际化
const loading = ref(false) //
const list = ref<ProProcessContentVO[]>([]) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
list.value = await ProProcessContentApi.getProcessContentListByProcessId(props.processId)
} finally {
loading.value = false
}
}
// ==================== / ====================
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) //
@ -115,6 +103,16 @@ const formRules = reactive({
sort: [{ required: true, message: '序号不能为空', trigger: 'blur' }]
})
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
list.value = await ProProcessContentApi.getProcessContentListByProcessId(props.processId)
} finally {
loading.value = false
}
}
/** 添加/修改操作 */
const openForm = (type: string, row?: ProProcessContentVO) => {
const maxSort = list.value.reduce((max, item) => Math.max(max, item.sort || 0), 0)

View File

@ -68,6 +68,7 @@ import { ProProcessApi, ProProcessVO } from '@/api/mes/pro/process'
import ProProcessContentList from './ProProcessContentList.vue'
defineOptions({ name: 'ProProcessForm' })
const emit = defineEmits(['success']) // success
const { t } = useI18n() //
const message = useMessage() //
@ -112,10 +113,8 @@ const open = async (type: string, id?: number) => {
}
}
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
if (!formRef) return
@ -152,4 +151,6 @@ const resetForm = () => {
}
formRef.value?.resetFields()
}
defineExpose({ open }) // open
</script>

View File

@ -70,6 +70,7 @@
:show-overflow-tooltip="true"
row-key="id"
>
<!-- TODO @AI增加详情操作点击下工序编码 -->
<el-table-column label="工序编码" align="center" prop="code" width="150" />
<el-table-column label="工序名称" align="center" prop="name" width="200" />
<el-table-column label="状态" align="center" prop="status" width="100">
@ -134,6 +135,7 @@ const { t } = useI18n() // 国际化
const loading = ref(true) //
const list = ref<ProProcessVO[]>([]) //
const total = ref(0) //
const exportLoading = ref(false) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
@ -142,7 +144,7 @@ const queryParams = reactive({
status: undefined
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
const formRef = ref() //
/** 查询列表 */
const getList = async () => {
@ -169,7 +171,6 @@ const resetQuery = () => {
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
}
@ -203,7 +204,7 @@ const handleExport = async () => {
}
/** 初始化 **/
onMounted(async () => {
await getList()
onMounted(() => {
getList()
})
</script>