feat(mes): 添加计划班组和班次相关的 VO 及 API,新增点检保养方案设备和项目的 VO 及 API,添加工序选择器组件
parent
335f367e00
commit
1c4ae03e7d
|
|
@ -0,0 +1,35 @@
|
||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
// MES 计划班组关联 VO
|
||||||
|
export interface CalPlanTeamVO {
|
||||||
|
id: number
|
||||||
|
planId: number // 排班计划编号
|
||||||
|
teamId: number // 班组编号
|
||||||
|
teamCode: string // 班组编码
|
||||||
|
teamName: string // 班组名称
|
||||||
|
remark: string // 备注
|
||||||
|
attribute1: string
|
||||||
|
attribute2: string
|
||||||
|
attribute3: number
|
||||||
|
attribute4: number
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO @AI:挪到 team/index.ts 中
|
||||||
|
|
||||||
|
// MES 计划班组关联 API
|
||||||
|
export const CalPlanTeamApi = {
|
||||||
|
// 查询指定排班计划的班组列表
|
||||||
|
getPlanTeamListByPlan: async (planId: number) => {
|
||||||
|
return await request.get({ url: `/mes/cal/plan-team/list-by-plan?planId=` + planId })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增计划班组关联
|
||||||
|
createPlanTeam: async (data: CalPlanTeamVO) => {
|
||||||
|
return await request.post({ url: `/mes/cal/plan-team/create`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 删除计划班组关联
|
||||||
|
deletePlanTeam: async (id: number) => {
|
||||||
|
return await request.delete({ url: `/mes/cal/plan-team/delete?id=` + id })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
// TODO @AI:挪到 plan/shift 目录下
|
||||||
|
|
||||||
|
// MES 计划班次 VO
|
||||||
|
export interface CalPlanShiftVO {
|
||||||
|
id: number
|
||||||
|
planId: number // 排班计划编号
|
||||||
|
sort: number // 显示顺序
|
||||||
|
name: string // 班次名称
|
||||||
|
startTime: string // 开始时间
|
||||||
|
endTime: string // 结束时间
|
||||||
|
remark: string // 备注
|
||||||
|
attribute1: string
|
||||||
|
attribute2: string
|
||||||
|
attribute3: number
|
||||||
|
attribute4: number
|
||||||
|
}
|
||||||
|
|
||||||
|
// MES 计划班次 API
|
||||||
|
export const CalPlanShiftApi = {
|
||||||
|
// 查询指定排班计划的班次列表
|
||||||
|
getPlanShiftListByPlan: async (planId: number) => {
|
||||||
|
return await request.get({ url: `/mes/cal/plan-shift/list-by-plan?planId=` + planId })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增计划班次
|
||||||
|
createPlanShift: async (data: CalPlanShiftVO) => {
|
||||||
|
return await request.post({ url: `/mes/cal/plan-shift/create`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 修改计划班次
|
||||||
|
updatePlanShift: async (data: CalPlanShiftVO) => {
|
||||||
|
return await request.put({ url: `/mes/cal/plan-shift/update`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 删除计划班次
|
||||||
|
deletePlanShift: async (id: number) => {
|
||||||
|
return await request.delete({ url: `/mes/cal/plan-shift/delete?id=` + id })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
// TODO @AI:放到 machinery/index.ts
|
||||||
|
// MES 点检保养方案设备 VO
|
||||||
|
export interface DvCheckPlanMachineryVO {
|
||||||
|
id: number
|
||||||
|
planId: number // 方案编号
|
||||||
|
machineryId: number // 设备编号
|
||||||
|
machineryCode: string // 设备编码
|
||||||
|
machineryName: string // 设备名称
|
||||||
|
machineryBrand: string // 品牌
|
||||||
|
machinerySpec: string // 规格型号
|
||||||
|
remark: string // 备注
|
||||||
|
}
|
||||||
|
|
||||||
|
// MES 点检保养方案设备 API
|
||||||
|
export const DvCheckPlanMachineryApi = {
|
||||||
|
// 查询指定方案的设备列表
|
||||||
|
getListByPlan: async (planId: number) => {
|
||||||
|
return await request.get({ url: `/mes/dv/check-plan-machinery/list-by-plan?planId=` + planId })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增方案设备关联
|
||||||
|
create: async (data: DvCheckPlanMachineryVO) => {
|
||||||
|
return await request.post({ url: `/mes/dv/check-plan-machinery/create`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 删除方案设备关联
|
||||||
|
delete: async (id: number) => {
|
||||||
|
return await request.delete({ url: `/mes/dv/check-plan-machinery/delete?id=` + id })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
// TODO @AI:放到 subject/index.ts
|
||||||
|
// MES 点检保养方案项目 VO
|
||||||
|
export interface DvCheckPlanSubjectVO {
|
||||||
|
id: number
|
||||||
|
planId: number // 方案编号
|
||||||
|
subjectId: number // 项目编号
|
||||||
|
subjectCode: string // 项目编码
|
||||||
|
subjectName: string // 项目名称
|
||||||
|
subjectType: number // 项目类型
|
||||||
|
subjectContent: string // 项目内容
|
||||||
|
subjectStandard: string // 标准
|
||||||
|
remark: string // 备注
|
||||||
|
}
|
||||||
|
|
||||||
|
// MES 点检保养方案项目 API
|
||||||
|
export const DvCheckPlanSubjectApi = {
|
||||||
|
// 查询指定方案的项目列表
|
||||||
|
getListByPlan: async (planId: number) => {
|
||||||
|
return await request.get({ url: `/mes/dv/check-plan-subject/list-by-plan?planId=` + planId })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增方案项目关联
|
||||||
|
create: async (data: DvCheckPlanSubjectVO) => {
|
||||||
|
return await request.post({ url: `/mes/dv/check-plan-subject/create`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 删除方案项目关联
|
||||||
|
delete: async (id: number) => {
|
||||||
|
return await request.delete({ url: `/mes/dv/check-plan-subject/delete?id=` + id })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,79 @@
|
||||||
|
<!-- MES 工序选择器:纯下拉,前端过滤(支持 name、code) -->
|
||||||
|
<template>
|
||||||
|
<el-select
|
||||||
|
v-model="selectValue"
|
||||||
|
:placeholder="placeholder"
|
||||||
|
:disabled="disabled"
|
||||||
|
:clearable="clearable"
|
||||||
|
filterable
|
||||||
|
:filter-method="handleFilter"
|
||||||
|
class="!w-1/1"
|
||||||
|
@change="handleChange"
|
||||||
|
>
|
||||||
|
<el-option v-for="item in filteredList" :key="item.id" :label="item.name" :value="item.id">
|
||||||
|
<div class="flex items-center gap-8px">
|
||||||
|
<span>{{ item.name }}</span>
|
||||||
|
<el-tag v-if="item.code" size="small" type="info" class="ml-4px">{{ item.code }}</el-tag>
|
||||||
|
</div>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ProProcessApi, ProProcessVO } from '@/api/mes/pro/process'
|
||||||
|
|
||||||
|
defineOptions({ name: 'ProProcessSelect' })
|
||||||
|
|
||||||
|
const props = withDefaults(
|
||||||
|
defineProps<{
|
||||||
|
modelValue?: number
|
||||||
|
disabled?: boolean
|
||||||
|
clearable?: boolean
|
||||||
|
placeholder?: string
|
||||||
|
}>(),
|
||||||
|
{
|
||||||
|
disabled: false,
|
||||||
|
clearable: true,
|
||||||
|
placeholder: '请选择工序'
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
'update:modelValue': [value: number | undefined]
|
||||||
|
change: [item: ProProcessVO | undefined]
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const allList = ref<ProProcessVO[]>([])
|
||||||
|
const filteredList = ref<ProProcessVO[]>([])
|
||||||
|
|
||||||
|
const selectValue = computed({
|
||||||
|
get: () => props.modelValue,
|
||||||
|
set: (val) => emit('update:modelValue', val)
|
||||||
|
})
|
||||||
|
|
||||||
|
/** 前端过滤(name + code) */
|
||||||
|
const handleFilter = (query: string) => {
|
||||||
|
if (!query) {
|
||||||
|
filteredList.value = allList.value
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const keyword = query.toLowerCase()
|
||||||
|
filteredList.value = allList.value.filter(
|
||||||
|
(item) =>
|
||||||
|
item.name?.toLowerCase().includes(keyword) ||
|
||||||
|
item.code?.toLowerCase().includes(keyword)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 选中变化 */
|
||||||
|
const handleChange = (val: number | undefined) => {
|
||||||
|
const item = allList.value.find((o) => o.id === val)
|
||||||
|
emit('change', item)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 加载工序列表 */
|
||||||
|
onMounted(async () => {
|
||||||
|
allList.value = await ProProcessApi.getProcessSimpleList()
|
||||||
|
filteredList.value = allList.value
|
||||||
|
})
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue