feat(mes): 添加车间详情链接和表单只读模式

在工作站列表中为车间编码添加了详情链接,点击后可查看车间详细信息。同时,在工作站表单中增加了只读模式,确保在查看详情时无法修改数据。
pull/871/MERGE
YunaiV 2026-03-28 19:04:13 +08:00
parent 351ee4fb0d
commit 075629e49c
2 changed files with 19 additions and 5 deletions

View File

@ -6,6 +6,7 @@
:rules="formRules"
label-width="100px"
v-loading="formLoading"
:disabled="isDetail"
>
<el-row>
<el-col :span="12">
@ -62,7 +63,7 @@
</el-row>
</el-form>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button v-if="!isDetail" @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
@ -79,9 +80,17 @@ const { t } = useI18n() // 国际化
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) //
const formType = ref('') // create - update -
const formType = ref('') // create - update - detail -
const isDetail = computed(() => formType.value === 'detail') //
const dialogTitle = computed(() => {
const titles: Record<string, string> = {
create: '新增车间',
update: '修改车间',
detail: '查看车间'
}
return titles[formType.value] || formType.value
})
const userList = ref<UserApi.UserVO[]>([]) //
const formData = ref({
id: undefined,
@ -102,7 +111,6 @@ const formRef = ref() // 表单 Ref
/** 打开弹窗 */
const open = async (type: string, id?: number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
//

View File

@ -54,7 +54,13 @@
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="车间编码" align="center" prop="code" />
<el-table-column label="车间编码" align="center" prop="code">
<template #default="scope">
<el-link type="primary" @click="openForm('detail', scope.row.id)">
{{ scope.row.code }}
</el-link>
</template>
</el-table-column>
<el-table-column label="车间名称" align="center" prop="name" width="150" />
<el-table-column label="面积" align="center" prop="area" />
<el-table-column label="负责人" align="center" prop="chargeUserName" />