✨ feat(mes): 增强工序管理功能,新增工序校验逻辑
新增工序创建和更新时的存在性校验,确保工序有效性。 同时,重构工艺路线服务,优化工序引用检查逻辑。pull/871/MERGE
parent
12566d6860
commit
d18a58f44f
|
|
@ -84,18 +84,6 @@ const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
const loading = ref(false) // 列表的加载中
|
const loading = ref(false) // 列表的加载中
|
||||||
const list = ref<ProProcessContentVO[]>([]) // 列表的数据
|
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 dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
const dialogTitle = ref('') // 弹窗的标题
|
const dialogTitle = ref('') // 弹窗的标题
|
||||||
const formLoading = ref(false) // 表单的加载中
|
const formLoading = ref(false) // 表单的加载中
|
||||||
|
|
@ -115,6 +103,16 @@ const formRules = reactive({
|
||||||
sort: [{ required: true, message: '序号不能为空', trigger: 'blur' }]
|
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 openForm = (type: string, row?: ProProcessContentVO) => {
|
||||||
const maxSort = list.value.reduce((max, item) => Math.max(max, item.sort || 0), 0)
|
const maxSort = list.value.reduce((max, item) => Math.max(max, item.sort || 0), 0)
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,7 @@ import { ProProcessApi, ProProcessVO } from '@/api/mes/pro/process'
|
||||||
import ProProcessContentList from './ProProcessContentList.vue'
|
import ProProcessContentList from './ProProcessContentList.vue'
|
||||||
|
|
||||||
defineOptions({ name: 'ProProcessForm' })
|
defineOptions({ name: 'ProProcessForm' })
|
||||||
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
|
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
const message = useMessage() // 消息弹窗
|
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 () => {
|
const submitForm = async () => {
|
||||||
// 校验表单
|
// 校验表单
|
||||||
if (!formRef) return
|
if (!formRef) return
|
||||||
|
|
@ -152,4 +151,6 @@ const resetForm = () => {
|
||||||
}
|
}
|
||||||
formRef.value?.resetFields()
|
formRef.value?.resetFields()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,7 @@
|
||||||
:show-overflow-tooltip="true"
|
:show-overflow-tooltip="true"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
>
|
>
|
||||||
|
<!-- TODO @AI:增加【详情】操作;点击下;工序编码; -->
|
||||||
<el-table-column label="工序编码" align="center" prop="code" width="150" />
|
<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="name" width="200" />
|
||||||
<el-table-column label="状态" align="center" prop="status" width="100">
|
<el-table-column label="状态" align="center" prop="status" width="100">
|
||||||
|
|
@ -134,6 +135,7 @@ const { t } = useI18n() // 国际化
|
||||||
const loading = ref(true) // 列表的加载中
|
const loading = ref(true) // 列表的加载中
|
||||||
const list = ref<ProProcessVO[]>([]) // 列表的数据
|
const list = ref<ProProcessVO[]>([]) // 列表的数据
|
||||||
const total = ref(0) // 列表的总页数
|
const total = ref(0) // 列表的总页数
|
||||||
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
const queryParams = reactive({
|
const queryParams = reactive({
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
|
@ -142,7 +144,7 @@ const queryParams = reactive({
|
||||||
status: undefined
|
status: undefined
|
||||||
})
|
})
|
||||||
const queryFormRef = ref() // 搜索的表单
|
const queryFormRef = ref() // 搜索的表单
|
||||||
const exportLoading = ref(false) // 导出的加载中
|
const formRef = ref() // 表单弹窗
|
||||||
|
|
||||||
/** 查询列表 */
|
/** 查询列表 */
|
||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
|
|
@ -169,7 +171,6 @@ const resetQuery = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 添加/修改操作 */
|
/** 添加/修改操作 */
|
||||||
const formRef = ref()
|
|
||||||
const openForm = (type: string, id?: number) => {
|
const openForm = (type: string, id?: number) => {
|
||||||
formRef.value.open(type, id)
|
formRef.value.open(type, id)
|
||||||
}
|
}
|
||||||
|
|
@ -203,7 +204,7 @@ const handleExport = async () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 初始化 **/
|
/** 初始化 **/
|
||||||
onMounted(async () => {
|
onMounted(() => {
|
||||||
await getList()
|
getList()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue