feat(mes): 新增设备点检记录相关功能,包括记录明细接口及表单组件
parent
afaf6e371e
commit
d033bcaaf5
|
|
@ -0,0 +1,57 @@
|
||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
// MES 设备点检记录 VO
|
||||||
|
export interface DvCheckRecordVO {
|
||||||
|
id: number // 编号
|
||||||
|
planId: number // 点检计划编号
|
||||||
|
planType?: number // 计划类型
|
||||||
|
planName?: string // 计划名称
|
||||||
|
machineryId: number // 设备编号
|
||||||
|
machineryCode?: string // 设备编码
|
||||||
|
machineryName?: string // 设备名称
|
||||||
|
machineryBrand?: string // 品牌
|
||||||
|
machinerySpec?: string // 规格型号
|
||||||
|
checkTime: Date // 点检时间
|
||||||
|
userId: number // 点检人编号
|
||||||
|
nickname?: string // 点检人名称
|
||||||
|
status: number // 状态
|
||||||
|
remark: string // 备注
|
||||||
|
}
|
||||||
|
|
||||||
|
// MES 设备点检记录 API
|
||||||
|
export const DvCheckRecordApi = {
|
||||||
|
// 查询设备点检记录分页
|
||||||
|
getCheckRecordPage: async (params: any) => {
|
||||||
|
return await request.get({ url: `/mes/dv/check-record/page`, params })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 查询设备点检记录详情
|
||||||
|
getCheckRecord: async (id: number) => {
|
||||||
|
return await request.get({ url: `/mes/dv/check-record/get?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增设备点检记录
|
||||||
|
createCheckRecord: async (data: DvCheckRecordVO) => {
|
||||||
|
return await request.post({ url: `/mes/dv/check-record/create`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 修改设备点检记录
|
||||||
|
updateCheckRecord: async (data: DvCheckRecordVO) => {
|
||||||
|
return await request.put({ url: `/mes/dv/check-record/update`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 提交设备点检记录
|
||||||
|
submitCheckRecord: async (id: number) => {
|
||||||
|
return await request.put({ url: `/mes/dv/check-record/submit?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 删除设备点检记录
|
||||||
|
deleteCheckRecord: async (id: number) => {
|
||||||
|
return await request.delete({ url: `/mes/dv/check-record/delete?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 导出设备点检记录 Excel
|
||||||
|
exportCheckRecord: async (params: any) => {
|
||||||
|
return await request.download({ url: `/mes/dv/check-record/export-excel`, params })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
// MES 设备点检记录明细 VO
|
||||||
|
export interface DvCheckRecordLineVO {
|
||||||
|
id: number // 编号
|
||||||
|
recordId: number // 点检记录编号
|
||||||
|
subjectId: number // 点检项目编号
|
||||||
|
subjectCode?: string // 项目编码
|
||||||
|
subjectName?: string // 项目名称
|
||||||
|
subjectContent?: string // 检查内容
|
||||||
|
subjectStandard?: string // 检查标准
|
||||||
|
// TODO @AI:number
|
||||||
|
checkStatus: string // 点检结果
|
||||||
|
checkResult?: string // 异常描述
|
||||||
|
remark: string // 备注
|
||||||
|
}
|
||||||
|
|
||||||
|
// MES 设备点检记录明细 API
|
||||||
|
export const DvCheckRecordLineApi = {
|
||||||
|
// 查询设备点检记录明细分页
|
||||||
|
getCheckRecordLinePage: async (params: any) => {
|
||||||
|
return await request.get({ url: `/mes/dv/check-record-line/page`, params })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 查询设备点检记录明细详情
|
||||||
|
getCheckRecordLine: async (id: number) => {
|
||||||
|
return await request.get({ url: `/mes/dv/check-record-line/get?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增设备点检记录明细
|
||||||
|
createCheckRecordLine: async (data: DvCheckRecordLineVO) => {
|
||||||
|
return await request.post({ url: `/mes/dv/check-record-line/create`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 修改设备点检记录明细
|
||||||
|
updateCheckRecordLine: async (data: DvCheckRecordLineVO) => {
|
||||||
|
return await request.put({ url: `/mes/dv/check-record-line/update`, data })
|
||||||
|
},
|
||||||
|
|
||||||
|
// 删除设备点检记录明细
|
||||||
|
deleteCheckRecordLine: async (id: number) => {
|
||||||
|
return await request.delete({ url: `/mes/dv/check-record-line/delete?id=` + id })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -39,6 +39,11 @@ export const DvMaintenRecordApi = {
|
||||||
return await request.put({ url: `/mes/dv/mainten-record/update`, data })
|
return await request.put({ url: `/mes/dv/mainten-record/update`, data })
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 提交设备保养记录
|
||||||
|
submitMaintenRecord: async (id: number) => {
|
||||||
|
return await request.put({ url: `/mes/dv/mainten-record/submit?id=` + id })
|
||||||
|
},
|
||||||
|
|
||||||
// 删除设备保养记录
|
// 删除设备保养记录
|
||||||
deleteMaintenRecord: async (id: number) => {
|
deleteMaintenRecord: async (id: number) => {
|
||||||
return await request.delete({ url: `/mes/dv/mainten-record/delete?id=` + id })
|
return await request.delete({ url: `/mes/dv/mainten-record/delete?id=` + id })
|
||||||
|
|
|
||||||
|
|
@ -283,4 +283,6 @@ export enum DICT_TYPE {
|
||||||
MES_MAINTEN_STATUS = 'mes_mainten_status', // MES 保养结果
|
MES_MAINTEN_STATUS = 'mes_mainten_status', // MES 保养结果
|
||||||
MES_DV_REPAIR_STATUS = 'mes_dv_repair_status', // MES 维修工单状态
|
MES_DV_REPAIR_STATUS = 'mes_dv_repair_status', // MES 维修工单状态
|
||||||
MES_DV_REPAIR_RESULT = 'mes_dv_repair_result', // MES 维修结果
|
MES_DV_REPAIR_RESULT = 'mes_dv_repair_result', // MES 维修结果
|
||||||
|
MES_DV_CHECK_RECORD_STATUS = 'mes_dv_check_record_status', // MES 点检记录状态
|
||||||
|
MES_DV_CHECK_RESULT = 'mes_dv_check_result', // MES 点检结果
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,147 @@
|
||||||
|
<template>
|
||||||
|
<Dialog :title="dialogTitle" v-model="dialogVisible" width="900px">
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
v-loading="formLoading"
|
||||||
|
:model="formData"
|
||||||
|
:rules="formRules"
|
||||||
|
label-width="100px"
|
||||||
|
>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="设备" prop="machineryId">
|
||||||
|
<DvMachinerySelect v-model="formData.machineryId" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="点检计划" prop="planId">
|
||||||
|
<DvCheckPlanSelect v-model="formData.planId" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="点检人" prop="userId">
|
||||||
|
<UserSelect v-model="formData.userId" placeholder="请选择点检人" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="点检时间" prop="checkTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="formData.checkTime"
|
||||||
|
type="datetime"
|
||||||
|
value-format="x"
|
||||||
|
placeholder="选择点检时间"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="formData.remark" type="textarea" placeholder="请输入备注" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<!-- 编辑时展示点检项目明细 -->
|
||||||
|
<template v-if="formData.id">
|
||||||
|
<el-divider content-position="center">点检项目明细</el-divider>
|
||||||
|
<CheckRecordLineList :record-id="formData.id" />
|
||||||
|
</template>
|
||||||
|
<template #footer>
|
||||||
|
<el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
</template>
|
||||||
|
</Dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { DvCheckRecordApi } from '@/api/mes/dv/checkrecord'
|
||||||
|
import DvMachinerySelect from '@/views/mes/dv/machinery/components/DvMachinerySelect.vue'
|
||||||
|
import DvCheckPlanSelect from '@/views/mes/dv/checkplan/components/DvCheckPlanSelect.vue'
|
||||||
|
import UserSelect from '@/views/system/user/components/UserSelect.vue'
|
||||||
|
import CheckRecordLineList from './CheckRecordLineList.vue'
|
||||||
|
|
||||||
|
defineOptions({ name: 'CheckRecordForm' })
|
||||||
|
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
|
const dialogTitle = ref('') // 弹窗的标题
|
||||||
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||||
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||||
|
const formData = ref({
|
||||||
|
id: undefined,
|
||||||
|
planId: undefined,
|
||||||
|
machineryId: undefined,
|
||||||
|
checkTime: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
status: undefined,
|
||||||
|
remark: ''
|
||||||
|
})
|
||||||
|
const formRules = reactive({
|
||||||
|
machineryId: [{ required: true, message: '设备不能为空', trigger: 'blur' }],
|
||||||
|
checkTime: [{ required: true, message: '点检时间不能为空', trigger: 'blur' }]
|
||||||
|
})
|
||||||
|
const formRef = ref() // 表单 Ref
|
||||||
|
|
||||||
|
/** 打开弹窗 */
|
||||||
|
const open = async (type: string, id?: number) => {
|
||||||
|
dialogVisible.value = true
|
||||||
|
dialogTitle.value = t('action.' + type)
|
||||||
|
formType.value = type
|
||||||
|
resetForm()
|
||||||
|
// 修改时,设置数据
|
||||||
|
if (id) {
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
formData.value = await DvCheckRecordApi.getCheckRecord(id)
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
|
/** 提交表单 */
|
||||||
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
|
const submitForm = async () => {
|
||||||
|
// 校验表单
|
||||||
|
if (!formRef) return
|
||||||
|
const valid = await formRef.value.validate()
|
||||||
|
if (!valid) return
|
||||||
|
// 提交请求
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
const data = formData.value as any
|
||||||
|
if (formType.value === 'create') {
|
||||||
|
await DvCheckRecordApi.createCheckRecord(data)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await DvCheckRecordApi.updateCheckRecord(data)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
dialogVisible.value = false
|
||||||
|
// 发送操作成功的事件
|
||||||
|
emit('success')
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置表单 */
|
||||||
|
const resetForm = () => {
|
||||||
|
formData.value = {
|
||||||
|
id: undefined,
|
||||||
|
planId: undefined,
|
||||||
|
machineryId: undefined,
|
||||||
|
checkTime: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
status: undefined,
|
||||||
|
remark: ''
|
||||||
|
}
|
||||||
|
formRef.value?.resetFields()
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,205 @@
|
||||||
|
<!-- MES 设备点检记录明细列表 -->
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<!-- 操作栏 -->
|
||||||
|
<el-row class="mb-10px" v-if="!disabled">
|
||||||
|
<el-button type="primary" plain @click="openForm('create')">
|
||||||
|
<Icon icon="ep:plus" class="mr-5px" /> 添加明细
|
||||||
|
</el-button>
|
||||||
|
</el-row>
|
||||||
|
<!-- 列表 -->
|
||||||
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||||
|
<el-table-column label="项目编码" align="center" prop="subjectCode" />
|
||||||
|
<el-table-column label="项目名称" align="center" prop="subjectName" />
|
||||||
|
<el-table-column label="检查内容" align="center" prop="subjectContent" />
|
||||||
|
<el-table-column label="检查标准" align="center" prop="subjectStandard" />
|
||||||
|
<el-table-column label="点检结果" align="center" prop="checkStatus">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.MES_DV_CHECK_RESULT" :value="scope.row.checkStatus" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="异常描述" align="center" prop="checkResult" />
|
||||||
|
<el-table-column label="操作" align="center" width="130" v-if="!disabled">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button link type="primary" @click="openForm('update', scope.row)">编辑</el-button>
|
||||||
|
<el-button link type="danger" @click="handleDelete(scope.row.id)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<Pagination
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNo"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
|
<Dialog :title="formTitle" v-model="formVisible" width="500px">
|
||||||
|
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="80px">
|
||||||
|
<el-form-item label="点检项目" prop="subjectId">
|
||||||
|
<el-select
|
||||||
|
v-model="formData.subjectId"
|
||||||
|
filterable
|
||||||
|
remote
|
||||||
|
reserve-keyword
|
||||||
|
placeholder="请输入项目名称搜索"
|
||||||
|
:remote-method="getSubjectOptions"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in subjectOptions"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="点检结果" prop="checkStatus">
|
||||||
|
<el-radio-group v-model="formData.checkStatus">
|
||||||
|
<el-radio
|
||||||
|
v-for="dict in getStrDictOptions(DICT_TYPE.MES_DV_CHECK_RESULT)"
|
||||||
|
:key="dict.value"
|
||||||
|
:value="dict.value"
|
||||||
|
>
|
||||||
|
{{ dict.label }}
|
||||||
|
</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- TODO @AI:checkStatus 改成 int 枚举;然后 constants.ts 里; -->
|
||||||
|
<el-form-item label="异常描述" prop="checkResult" v-if="formData.checkStatus === 'N'">
|
||||||
|
<el-input v-model="formData.checkResult" type="textarea" placeholder="请输入异常描述" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注" prop="remark">
|
||||||
|
<el-input v-model="formData.remark" type="textarea" placeholder="请输入备注" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="formVisible = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="submitForm" :loading="formLoading">确 定</el-button>
|
||||||
|
</template>
|
||||||
|
</Dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||||
|
import { DvCheckRecordLineApi } from '@/api/mes/dv/checkrecord/line'
|
||||||
|
import { DvSubjectApi } from '@/api/mes/dv/subject'
|
||||||
|
|
||||||
|
defineOptions({ name: 'CheckRecordLineList' })
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
recordId: number
|
||||||
|
disabled?: boolean
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
|
const loading = ref(false) // 列表的加载中
|
||||||
|
const list = ref([]) // 列表的数据
|
||||||
|
const total = ref(0) // 列表的总页数
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
recordId: props.recordId
|
||||||
|
})
|
||||||
|
|
||||||
|
// 表单相关
|
||||||
|
const formVisible = ref(false) // 表单弹窗的是否展示
|
||||||
|
const formTitle = ref('') // 表单弹窗的标题
|
||||||
|
const formLoading = ref(false) // 表单的加载中
|
||||||
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||||
|
const formRef = ref() // 表单 Ref
|
||||||
|
const formData = ref<any>({}) // 表单数据
|
||||||
|
const formRules = reactive({
|
||||||
|
subjectId: [{ required: true, message: '点检项目不能为空', trigger: 'blur' }],
|
||||||
|
checkStatus: [{ required: true, message: '点检结果不能为空', trigger: 'blur' }]
|
||||||
|
})
|
||||||
|
const subjectOptions = ref<any[]>([]) // 项目选项列表
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const data = await DvCheckRecordLineApi.getCheckRecordLinePage(queryParams)
|
||||||
|
list.value = data.list
|
||||||
|
total.value = data.total
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 添加/修改操作 */
|
||||||
|
const openForm = async (type: string, row?: any) => {
|
||||||
|
formVisible.value = true
|
||||||
|
formTitle.value = type === 'create' ? '添加明细' : '编辑明细'
|
||||||
|
formType.value = type
|
||||||
|
if (type === 'create') {
|
||||||
|
formData.value = {
|
||||||
|
recordId: props.recordId,
|
||||||
|
subjectId: undefined,
|
||||||
|
checkStatus: 'Y',
|
||||||
|
checkResult: '',
|
||||||
|
remark: ''
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
formData.value = { ...row }
|
||||||
|
if (row.subjectId) {
|
||||||
|
const subject = await DvSubjectApi.getSubject(row.subjectId)
|
||||||
|
if (subject) subjectOptions.value = [subject]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
formRef.value?.resetFields()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 提交表单 */
|
||||||
|
const submitForm = async () => {
|
||||||
|
const valid = await formRef.value.validate()
|
||||||
|
if (!valid) return
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
if (formType.value === 'create') {
|
||||||
|
await DvCheckRecordLineApi.createCheckRecordLine(formData.value)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await DvCheckRecordLineApi.updateCheckRecordLine(formData.value)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
formVisible.value = false
|
||||||
|
await getList()
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
const handleDelete = async (id: number) => {
|
||||||
|
try {
|
||||||
|
await message.delConfirm()
|
||||||
|
await DvCheckRecordLineApi.deleteCheckRecordLine(id)
|
||||||
|
message.success(t('common.delSuccess'))
|
||||||
|
await getList()
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 获取项目选项 */
|
||||||
|
const getSubjectOptions = async (query: string) => {
|
||||||
|
try {
|
||||||
|
const data = await DvSubjectApi.getSubjectPage({ name: query, pageNo: 1, pageSize: 20 })
|
||||||
|
subjectOptions.value = data.list
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 监听记录编号变化 */
|
||||||
|
watch(
|
||||||
|
() => props.recordId,
|
||||||
|
(val) => {
|
||||||
|
if (val) {
|
||||||
|
queryParams.recordId = val
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
)
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,230 @@
|
||||||
|
<template>
|
||||||
|
<ContentWrap>
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<el-form
|
||||||
|
class="-mb-15px"
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryFormRef"
|
||||||
|
:inline="true"
|
||||||
|
label-width="90px"
|
||||||
|
>
|
||||||
|
<el-form-item label="点检计划" prop="planId">
|
||||||
|
<DvCheckPlanSelect v-model="queryParams.planId" class="!w-240px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设备" prop="machineryId">
|
||||||
|
<DvMachinerySelect v-model="queryParams.machineryId" class="!w-240px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="点检人" prop="userId">
|
||||||
|
<UserSelect v-model="queryParams.userId" placeholder="请选择点检人" class="!w-240px" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="状态" prop="status">
|
||||||
|
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable class="!w-240px">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.MES_DV_CHECK_RECORD_STATUS)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="点检时间" prop="checkTime">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="queryParams.checkTime"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
type="daterange"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||||
|
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
@click="openForm('create')"
|
||||||
|
v-hasPermi="['mes:dv-check-record:create']"
|
||||||
|
>
|
||||||
|
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
@click="handleExport"
|
||||||
|
:loading="exportLoading"
|
||||||
|
v-hasPermi="['mes:dv-check-record:export']"
|
||||||
|
>
|
||||||
|
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<ContentWrap>
|
||||||
|
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||||
|
<el-table-column label="设备编码" align="center" prop="machineryCode" />
|
||||||
|
<el-table-column label="设备名称" align="center" prop="machineryName" />
|
||||||
|
<el-table-column label="品牌" align="center" prop="machineryBrand" />
|
||||||
|
<el-table-column label="规格型号" align="center" prop="machinerySpec" />
|
||||||
|
<el-table-column label="计划名称" align="center" prop="planName" />
|
||||||
|
<el-table-column
|
||||||
|
label="点检时间"
|
||||||
|
align="center"
|
||||||
|
prop="checkTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
width="180px"
|
||||||
|
/>
|
||||||
|
<el-table-column label="点检人" align="center" prop="nickname" />
|
||||||
|
<el-table-column label="状态" align="center" prop="status">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.MES_DV_CHECK_RECORD_STATUS" :value="scope.row.status" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template #default="scope">
|
||||||
|
<!-- TODO @AI:只有草稿,可以编辑; -->
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="primary"
|
||||||
|
@click="openForm('update', scope.row.id)"
|
||||||
|
v-hasPermi="['mes:dv-check-record:update']"
|
||||||
|
>
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<!-- TODO @AI:10 这些,都换成枚举 -->
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="success"
|
||||||
|
@click="handleSubmit(scope.row)"
|
||||||
|
v-if="scope.row.status === 10"
|
||||||
|
v-hasPermi="['mes:dv-check-record:update']"
|
||||||
|
>
|
||||||
|
提交
|
||||||
|
</el-button>
|
||||||
|
<!-- TODO @AI:只有草稿,可以删除; -->
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope.row.id)"
|
||||||
|
v-if="scope.row.status === 10"
|
||||||
|
v-hasPermi="['mes:dv-check-record:delete']"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!-- 分页 -->
|
||||||
|
<Pagination
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNo"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</ContentWrap>
|
||||||
|
|
||||||
|
<!-- 表单弹窗 -->
|
||||||
|
<CheckRecordForm ref="formRef" @success="getList" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
|
import download from '@/utils/download'
|
||||||
|
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||||
|
import { DvCheckRecordApi } from '@/api/mes/dv/checkrecord'
|
||||||
|
import CheckRecordForm from './CheckRecordForm.vue'
|
||||||
|
import DvMachinerySelect from '@/views/mes/dv/machinery/components/DvMachinerySelect.vue'
|
||||||
|
import DvCheckPlanSelect from '@/views/mes/dv/checkplan/components/DvCheckPlanSelect.vue'
|
||||||
|
import UserSelect from '@/views/system/user/components/UserSelect.vue'
|
||||||
|
|
||||||
|
defineOptions({ name: 'MesDvCheckRecord' })
|
||||||
|
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
|
const loading = ref(true) // 列表的加载中
|
||||||
|
const list = ref([]) // 列表的数据
|
||||||
|
const total = ref(0) // 列表的总页数
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
planId: undefined,
|
||||||
|
machineryId: undefined,
|
||||||
|
userId: undefined,
|
||||||
|
status: undefined,
|
||||||
|
checkTime: []
|
||||||
|
})
|
||||||
|
const queryFormRef = ref() // 搜索的表单
|
||||||
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const data = await DvCheckRecordApi.getCheckRecordPage(queryParams)
|
||||||
|
list.value = data.list
|
||||||
|
total.value = data.total
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
const handleQuery = () => {
|
||||||
|
queryParams.pageNo = 1
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
const resetQuery = () => {
|
||||||
|
queryFormRef.value.resetFields()
|
||||||
|
handleQuery()
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 添加/修改操作 */
|
||||||
|
const formRef = ref()
|
||||||
|
const openForm = (type: string, id?: number) => {
|
||||||
|
formRef.value.open(type, id)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 提交按钮操作 */
|
||||||
|
const handleSubmit = async (row: any) => {
|
||||||
|
try {
|
||||||
|
await message.confirm('确认提交该点检记录吗?')
|
||||||
|
await DvCheckRecordApi.submitCheckRecord(row.id)
|
||||||
|
message.success('提交成功')
|
||||||
|
await getList()
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
const handleDelete = async (id: number) => {
|
||||||
|
try {
|
||||||
|
await message.delConfirm()
|
||||||
|
await DvCheckRecordApi.deleteCheckRecord(id)
|
||||||
|
message.success(t('common.delSuccess'))
|
||||||
|
await getList()
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = async () => {
|
||||||
|
try {
|
||||||
|
await message.exportConfirm()
|
||||||
|
exportLoading.value = true
|
||||||
|
const data = await DvCheckRecordApi.exportCheckRecord(queryParams)
|
||||||
|
download.excel(data, '设备点检记录.xls')
|
||||||
|
} catch {
|
||||||
|
} finally {
|
||||||
|
exportLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 初始化 **/
|
||||||
|
onMounted(() => {
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
@ -64,6 +64,7 @@ import DvMachinerySelect from '@/views/mes/dv/machinery/components/DvMachinerySe
|
||||||
import DvCheckPlanSelect from '@/views/mes/dv/checkplan/components/DvCheckPlanSelect.vue'
|
import DvCheckPlanSelect from '@/views/mes/dv/checkplan/components/DvCheckPlanSelect.vue'
|
||||||
import UserSelect from '@/views/system/user/components/UserSelect.vue'
|
import UserSelect from '@/views/system/user/components/UserSelect.vue'
|
||||||
import MaintenRecordLineList from './MaintenRecordLineList.vue'
|
import MaintenRecordLineList from './MaintenRecordLineList.vue'
|
||||||
|
import { MesDvMaintenRecordStatusEnum } from '@/views/mes/utils/constants'
|
||||||
|
|
||||||
defineOptions({ name: 'MaintenRecordForm' })
|
defineOptions({ name: 'MaintenRecordForm' })
|
||||||
|
|
||||||
|
|
@ -80,7 +81,7 @@ const formData = ref({
|
||||||
machineryId: undefined,
|
machineryId: undefined,
|
||||||
maintenTime: undefined,
|
maintenTime: undefined,
|
||||||
userId: undefined,
|
userId: undefined,
|
||||||
status: 0,
|
status: MesDvMaintenRecordStatusEnum.PREPARE,
|
||||||
remark: ''
|
remark: ''
|
||||||
})
|
})
|
||||||
const formRules = reactive({
|
const formRules = reactive({
|
||||||
|
|
@ -141,7 +142,7 @@ const resetForm = () => {
|
||||||
machineryId: undefined,
|
machineryId: undefined,
|
||||||
maintenTime: undefined,
|
maintenTime: undefined,
|
||||||
userId: undefined,
|
userId: undefined,
|
||||||
status: 0, // TODO @AI:这里要枚举!
|
status: MesDvMaintenRecordStatusEnum.PREPARE,
|
||||||
remark: ''
|
remark: ''
|
||||||
}
|
}
|
||||||
formRef.value?.resetFields()
|
formRef.value?.resetFields()
|
||||||
|
|
|
||||||
|
|
@ -36,23 +36,9 @@
|
||||||
<!-- 表单弹窗:添加/修改 -->
|
<!-- 表单弹窗:添加/修改 -->
|
||||||
<Dialog :title="formTitle" v-model="formVisible" width="500px">
|
<Dialog :title="formTitle" v-model="formVisible" width="500px">
|
||||||
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="80px">
|
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="80px">
|
||||||
<!-- TODO @AI:这里的项目,是不是全称;另外,搞个 subject 的 select 组件,更好的复用呀; -->
|
<!-- DONE @AI:这里的项目,是不是全称;另外,搞个 subject 的 select 组件,更好的复用呀; -->
|
||||||
<el-form-item label="项目" prop="subjectId">
|
<el-form-item label="项目" prop="subjectId">
|
||||||
<el-select
|
<DvSubjectSelect v-model="formData.subjectId" />
|
||||||
v-model="formData.subjectId"
|
|
||||||
filterable
|
|
||||||
remote
|
|
||||||
reserve-keyword
|
|
||||||
placeholder="请输入项目名称搜索"
|
|
||||||
:remote-method="getSubjectOptions"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in subjectOptions"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.name"
|
|
||||||
:value="item.id"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="保养结果" prop="status">
|
<el-form-item label="保养结果" prop="status">
|
||||||
<el-radio-group v-model="formData.status">
|
<el-radio-group v-model="formData.status">
|
||||||
|
|
@ -65,7 +51,6 @@
|
||||||
</el-radio>
|
</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- TODO @AI:是不是只有异常的时候,才描述噢 -->
|
|
||||||
<el-form-item label="异常描述" prop="result">
|
<el-form-item label="异常描述" prop="result">
|
||||||
<el-input v-model="formData.result" type="textarea" placeholder="请输入异常描述" />
|
<el-input v-model="formData.result" type="textarea" placeholder="请输入异常描述" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -73,7 +58,6 @@
|
||||||
<el-input v-model="formData.remark" type="textarea" placeholder="请输入备注" />
|
<el-input v-model="formData.remark" type="textarea" placeholder="请输入备注" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<!-- TODO @AI:记录多的时候,下面的按钮位置不对; -->
|
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button @click="formVisible = false">取 消</el-button>
|
<el-button @click="formVisible = false">取 消</el-button>
|
||||||
<el-button type="primary" @click="submitForm" :loading="formLoading">确 定</el-button>
|
<el-button type="primary" @click="submitForm" :loading="formLoading">确 定</el-button>
|
||||||
|
|
@ -85,7 +69,8 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||||
import { DvMaintenRecordLineApi } from '@/api/mes/dv/maintenrecord/line'
|
import { DvMaintenRecordLineApi } from '@/api/mes/dv/maintenrecord/line'
|
||||||
import { DvSubjectApi } from '@/api/mes/dv/subject'
|
import { MesDvMaintenStatusEnum } from '@/views/mes/utils/constants'
|
||||||
|
import DvSubjectSelect from '@/views/mes/dv/subject/components/DvSubjectSelect.vue'
|
||||||
|
|
||||||
defineOptions({ name: 'MaintenRecordLineList' })
|
defineOptions({ name: 'MaintenRecordLineList' })
|
||||||
|
|
||||||
|
|
@ -117,7 +102,6 @@ const formRules = reactive({
|
||||||
subjectId: [{ required: true, message: '项目不能为空', trigger: 'blur' }],
|
subjectId: [{ required: true, message: '项目不能为空', trigger: 'blur' }],
|
||||||
status: [{ required: true, message: '保养结果不能为空', trigger: 'blur' }]
|
status: [{ required: true, message: '保养结果不能为空', trigger: 'blur' }]
|
||||||
})
|
})
|
||||||
const subjectOptions = ref<any[]>([]) // 项目选项列表
|
|
||||||
|
|
||||||
/** 查询列表 */
|
/** 查询列表 */
|
||||||
const getList = async () => {
|
const getList = async () => {
|
||||||
|
|
@ -140,16 +124,12 @@ const openForm = async (type: string, row?: any) => {
|
||||||
formData.value = {
|
formData.value = {
|
||||||
recordId: props.recordId,
|
recordId: props.recordId,
|
||||||
subjectId: undefined,
|
subjectId: undefined,
|
||||||
status: 1,
|
status: MesDvMaintenStatusEnum.NORMAL,
|
||||||
result: '',
|
result: '',
|
||||||
remark: ''
|
remark: ''
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
formData.value = { ...row }
|
formData.value = { ...row }
|
||||||
if (row.subjectId) {
|
|
||||||
const subject = await DvSubjectApi.getSubject(row.subjectId)
|
|
||||||
if (subject) subjectOptions.value = [subject]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
formRef.value?.resetFields()
|
formRef.value?.resetFields()
|
||||||
}
|
}
|
||||||
|
|
@ -184,15 +164,6 @@ const handleDelete = async (id: number) => {
|
||||||
} catch {}
|
} catch {}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 获取项目选项 */
|
|
||||||
// TODO @AI:不要分页,通过 simple-list 接口!
|
|
||||||
const getSubjectOptions = async (query: string) => {
|
|
||||||
try {
|
|
||||||
const data = await DvSubjectApi.getSubjectPage({ name: query, pageNo: 1, pageSize: 20 })
|
|
||||||
subjectOptions.value = data.list
|
|
||||||
} catch {}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 监听记录编号变化 */
|
/** 监听记录编号变化 */
|
||||||
watch(
|
watch(
|
||||||
() => props.recordId,
|
() => props.recordId,
|
||||||
|
|
@ -204,4 +175,5 @@ watch(
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
)
|
)
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -8,15 +8,12 @@
|
||||||
:inline="true"
|
:inline="true"
|
||||||
label-width="90px"
|
label-width="90px"
|
||||||
>
|
>
|
||||||
<!-- DONE @AI:计划 select;如果没组件,就封装一个; -->
|
|
||||||
<el-form-item label="保养计划" prop="planId">
|
<el-form-item label="保养计划" prop="planId">
|
||||||
<DvCheckPlanSelect v-model="queryParams.planId" class="!w-240px" />
|
<DvCheckPlanSelect v-model="queryParams.planId" class="!w-240px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- DONE @AI:设备 select;如果没组件,就封装一个; -->
|
|
||||||
<el-form-item label="设备" prop="machineryId">
|
<el-form-item label="设备" prop="machineryId">
|
||||||
<DvMachinerySelect v-model="queryParams.machineryId" class="!w-240px" />
|
<DvMachinerySelect v-model="queryParams.machineryId" class="!w-240px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- DONE @AI:用户 select;如果没组件,就封装一个 -->
|
|
||||||
<el-form-item label="保养人" prop="userId">
|
<el-form-item label="保养人" prop="userId">
|
||||||
<UserSelect v-model="queryParams.userId" placeholder="请选择保养人" class="!w-240px" />
|
<UserSelect v-model="queryParams.userId" placeholder="请选择保养人" class="!w-240px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -90,7 +87,7 @@
|
||||||
link
|
link
|
||||||
type="success"
|
type="success"
|
||||||
@click="handleSubmit(scope.row)"
|
@click="handleSubmit(scope.row)"
|
||||||
v-if="scope.row.status === 0"
|
v-if="scope.row.status === MesDvMaintenRecordStatusEnum.PREPARE"
|
||||||
v-hasPermi="['mes:dv-mainten-record:update']"
|
v-hasPermi="['mes:dv-mainten-record:update']"
|
||||||
>
|
>
|
||||||
提交
|
提交
|
||||||
|
|
@ -99,6 +96,7 @@
|
||||||
link
|
link
|
||||||
type="danger"
|
type="danger"
|
||||||
@click="handleDelete(scope.row.id)"
|
@click="handleDelete(scope.row.id)"
|
||||||
|
v-if="scope.row.status === MesDvMaintenRecordStatusEnum.PREPARE"
|
||||||
v-hasPermi="['mes:dv-mainten-record:delete']"
|
v-hasPermi="['mes:dv-mainten-record:delete']"
|
||||||
>
|
>
|
||||||
删除
|
删除
|
||||||
|
|
@ -128,6 +126,7 @@ import DvMachinerySelect from '@/views/mes/dv/machinery/components/DvMachinerySe
|
||||||
import DvCheckPlanSelect from '@/views/mes/dv/checkplan/components/DvCheckPlanSelect.vue'
|
import DvCheckPlanSelect from '@/views/mes/dv/checkplan/components/DvCheckPlanSelect.vue'
|
||||||
import UserSelect from '@/views/system/user/components/UserSelect.vue'
|
import UserSelect from '@/views/system/user/components/UserSelect.vue'
|
||||||
import { DICT_TYPE } from '@/utils/dict'
|
import { DICT_TYPE } from '@/utils/dict'
|
||||||
|
import { MesDvMaintenRecordStatusEnum } from '@/views/mes/utils/constants'
|
||||||
|
|
||||||
defineOptions({ name: 'MesDvMaintenRecord' })
|
defineOptions({ name: 'MesDvMaintenRecord' })
|
||||||
|
|
||||||
|
|
@ -182,7 +181,7 @@ const openForm = (type: string, id?: number) => {
|
||||||
const handleSubmit = async (row: any) => {
|
const handleSubmit = async (row: any) => {
|
||||||
try {
|
try {
|
||||||
await message.confirm('确认提交该保养记录吗?')
|
await message.confirm('确认提交该保养记录吗?')
|
||||||
await DvMaintenRecordApi.updateMaintenRecord({ ...row, status: 1 })
|
await DvMaintenRecordApi.submitMaintenRecord(row.id)
|
||||||
message.success('提交成功')
|
message.success('提交成功')
|
||||||
await getList()
|
await getList()
|
||||||
} catch {}
|
} catch {}
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,18 @@ export const MesDvCheckPlanStatusEnum = {
|
||||||
ENABLED: 1 // 已启用
|
ENABLED: 1 // 已启用
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** MES 设备保养记录状态枚举 */
|
||||||
|
export const MesDvMaintenRecordStatusEnum = {
|
||||||
|
PREPARE: 0, // 草稿
|
||||||
|
SUBMITTED: 1 // 已提交
|
||||||
|
}
|
||||||
|
|
||||||
|
/** MES 设备保养明细结果枚举(对应字典 mes_mainten_status) */
|
||||||
|
export const MesDvMaintenStatusEnum = {
|
||||||
|
NORMAL: 1, // 正常
|
||||||
|
ABNORMAL: 2 // 异常
|
||||||
|
}
|
||||||
|
|
||||||
/** 获取物料/产品标识的标签 */
|
/** 获取物料/产品标识的标签 */
|
||||||
export const getItemOrProductLabel = (value: string): string => {
|
export const getItemOrProductLabel = (value: string): string => {
|
||||||
for (const item of Object.values(MesItemOrProductEnum)) {
|
for (const item of Object.values(MesItemOrProductEnum)) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue