diff --git a/src/views/mes/cal/team/CalTeamMemberList.vue b/src/views/mes/cal/team/CalTeamMemberList.vue index 21def198b..9b35edc80 100644 --- a/src/views/mes/cal/team/CalTeamMemberList.vue +++ b/src/views/mes/cal/team/CalTeamMemberList.vue @@ -1,8 +1,11 @@ + @@ -24,17 +59,19 @@ import { CalTeamMemberApi, CalTeamMemberVO } from '@/api/mes/cal/team/member' import { getSimpleUserList } from '@/api/system/user' import type { UserVO } from '@/api/system/user' +defineOptions({ name: 'CalTeamMemberList' }) + const props = defineProps<{ teamId: number // 班组编号 }>() -const message = useMessage() +const { t } = useI18n() // 国际化 +const message = useMessage() // 消息弹窗 -const loading = ref(false) -const list = ref([]) -const formRef = ref>() +const loading = ref(false) // 列表的加载中 +const list = ref([]) // 列表的数据 -/** 加载列表 */ +/** 查询列表 */ const getList = async () => { loading.value = true try { @@ -44,9 +81,43 @@ const getList = async () => { } } -/** 打开添加弹窗 */ -const openForm = () => { - formRef.value?.open(props.teamId) +// ==================== 添加/修改 ==================== +const dialogVisible = ref(false) // 弹窗的是否展示 +const formLoading = ref(false) // 表单的加载中 +const formRef = ref() // 表单 Ref +const userList = ref([]) // 用户下拉列表 +const formData = ref({ + teamId: undefined as number | undefined, + userId: undefined as number | undefined, + remark: undefined as string | undefined +}) +const formRules = reactive({ + userId: [{ required: true, message: '用户不能为空', trigger: 'change' }] +}) + +/** 打开表单弹窗 */ +const openForm = async () => { + dialogVisible.value = true + formData.value = { teamId: props.teamId, userId: undefined, remark: undefined } + formRef.value?.resetFields() + userList.value = await getSimpleUserList() +} + +/** 提交表单 */ +const submitForm = async () => { + if (!formRef) return + const valid = await formRef.value.validate() + if (!valid) return + formLoading.value = true + try { + await CalTeamMemberApi.createTeamMember(formData.value as unknown as CalTeamMemberVO) + message.success(t('common.createSuccess')) + dialogVisible.value = false + // 刷新列表 + await getList() + } finally { + formLoading.value = false + } } /** 删除 */ @@ -59,6 +130,7 @@ const handleDelete = async (id: number) => { } catch {} } +/** 监听 teamId 变化,加载列表 */ watch( () => props.teamId, (val) => { diff --git a/src/views/mes/pro/route/RouteProcessList.vue b/src/views/mes/pro/route/RouteProcessList.vue index a0f3f4d85..22718b51b 100644 --- a/src/views/mes/pro/route/RouteProcessList.vue +++ b/src/views/mes/pro/route/RouteProcessList.vue @@ -9,27 +9,23 @@ - - - + + + - + @@ -42,18 +38,19 @@ {{ scope.row.waitTime ? scope.row.waitTime + '分钟' : '' }} - + @@ -65,7 +62,7 @@ - + @@ -88,7 +85,7 @@ - + - +
+ + {{ formData.colorCode }} +
diff --git a/src/views/mes/pro/route/RouteProductBomList.vue b/src/views/mes/pro/route/RouteProductBomList.vue index f7870b016..cef381506 100644 --- a/src/views/mes/pro/route/RouteProductBomList.vue +++ b/src/views/mes/pro/route/RouteProductBomList.vue @@ -17,8 +17,8 @@ - - + + @@ -35,14 +35,7 @@ - - - + import { ProRouteProductBomApi, ProRouteProductBomVO } from '@/api/mes/pro/route/productbom' import { ProRouteProcessApi } from '@/api/mes/pro/route/process' -import { MdItemApi } from '@/api/mes/md/item' +import MdItemSelect from '@/views/mes/md/item/components/MdItemSelect.vue' defineOptions({ name: 'RouteProductBomList' }) @@ -84,7 +77,6 @@ const loading = ref(false) // 列表的加载中 const bomList = ref([]) // BOM 列表的数据 const processList = ref([]) // 工序列表(用于 Tab) const activeProcessId = ref('') // 当前选中的工序 Tab -const itemList = ref([]) // 物料下拉列表 // 表单相关 const formVisible = ref(false) // 表单弹窗的是否展示 @@ -113,10 +105,9 @@ const getBomList = async () => { if (!activeProcessId.value) return loading.value = true try { - // TODO @AI:linter 报错; bomList.value = await ProRouteProductBomApi.getRouteProductBomList({ routeId: props.routeId, - processId: activeProcessId.value, + processId: Number(activeProcessId.value), productId: props.productId }) } finally { @@ -129,11 +120,6 @@ const handleTabChange = () => { getBomList() } -/** 加载物料列表 */ -const loadItemList = async () => { - itemList.value = await MdItemApi.getItemSimpleList() -} - /** 添加/修改操作 */ const openForm = (type: string, row?: ProRouteProductBomVO) => { formVisible.value = true @@ -185,6 +171,5 @@ const handleDelete = async (id: number) => { /** 初始化 */ onMounted(() => { loadProcessList() - loadItemList() }) diff --git a/src/views/mes/pro/route/RouteProductList.vue b/src/views/mes/pro/route/RouteProductList.vue index 808ee41bf..f97c996c4 100644 --- a/src/views/mes/pro/route/RouteProductList.vue +++ b/src/views/mes/pro/route/RouteProductList.vue @@ -9,8 +9,8 @@ - - + + @@ -23,9 +23,8 @@ - + @@ -33,17 +32,10 @@ - + - - - + @@ -76,28 +68,27 @@ + + - - - - - diff --git a/src/views/mes/pro/route/index.vue b/src/views/mes/pro/route/index.vue index 1ca61d5aa..e6af3f83a 100644 --- a/src/views/mes/pro/route/index.vue +++ b/src/views/mes/pro/route/index.vue @@ -69,13 +69,7 @@ @@ -86,10 +80,8 @@ :formatter="dateFormatter" width="180px" /> - +