|
|
|
|
@ -11,17 +11,24 @@
|
|
|
|
|
<el-input disabled v-model="formData.feedingRecordCode" placeholder="保存自动生成单号" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="制浆线:" prop="feedingPipeline">
|
|
|
|
|
<el-radio-group v-model="formData.feedingPipeline">
|
|
|
|
|
<el-radio
|
|
|
|
|
v-for="dict in getStrDictOptions(DICT_TYPE.MES_FEEDING_PIPELINE)"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.value"
|
|
|
|
|
>
|
|
|
|
|
{{ dict.label }}
|
|
|
|
|
</el-radio>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
<el-tree-select
|
|
|
|
|
v-model="formData.feedingPipeline"
|
|
|
|
|
:data="organizationTree"
|
|
|
|
|
:props="defaultProps"
|
|
|
|
|
check-strictly
|
|
|
|
|
default-expand-all
|
|
|
|
|
placeholder="请选择制浆线"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="投料类型:" prop="feedingType">
|
|
|
|
|
<el-form-item prop="feedingType">
|
|
|
|
|
<template #label>
|
|
|
|
|
<span>
|
|
|
|
|
投料类型
|
|
|
|
|
<el-tooltip content="来源:数据字典-生产投料类型" placement="top">
|
|
|
|
|
<Icon icon="ep:question-filled" />
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
</span>
|
|
|
|
|
</template>
|
|
|
|
|
<el-radio-group v-model="formData.feedingType">
|
|
|
|
|
<el-radio
|
|
|
|
|
v-for="dict in getStrDictOptions(DICT_TYPE.MES_FEEDING_TYPE)"
|
|
|
|
|
@ -82,10 +89,14 @@ import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
|
|
|
|
|
import { FeedingRecordApi, FeedingRecordVO } from '@/api/mes/feedingrecord'
|
|
|
|
|
import FeedingRecordDetailForm from './components/FeedingRecordDetailForm.vue'
|
|
|
|
|
import {ProductApi, ProductVO} from "@/api/erp/product/product";
|
|
|
|
|
import { OrganizationApi, OrganizationVO } from '@/api/mes/organization'
|
|
|
|
|
import { defaultProps, handleTree } from '@/utils/tree'
|
|
|
|
|
|
|
|
|
|
/** 投料记录 表单 */
|
|
|
|
|
defineOptions({ name: 'FeedingRecordForm' })
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const organizationTree = ref() // 树形结构
|
|
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
|
const productList = ref<ProductVO[]>([]) // 产品列表
|
|
|
|
|
@ -98,7 +109,6 @@ const formData = ref({
|
|
|
|
|
feedingRecordCode: undefined,
|
|
|
|
|
productId: undefined,
|
|
|
|
|
planId: undefined,
|
|
|
|
|
productId: undefined,
|
|
|
|
|
itemId: undefined,
|
|
|
|
|
feedingPipeline: undefined,
|
|
|
|
|
feedingType: undefined,
|
|
|
|
|
@ -109,7 +119,8 @@ const formData = ref({
|
|
|
|
|
recordStatus: undefined,
|
|
|
|
|
})
|
|
|
|
|
const formRules = reactive({
|
|
|
|
|
feedingType: [{ required: true, message: '投料类型不能为空', trigger: 'blur' }]
|
|
|
|
|
feedingType: [{ required: true, message: '投料类型不能为空', trigger: 'blur' }],
|
|
|
|
|
feedingPipeline: [{ required: true, message: '制浆线不能为空', trigger: 'blur' }]
|
|
|
|
|
})
|
|
|
|
|
const formRef = ref() // 表单 Ref
|
|
|
|
|
|
|
|
|
|
@ -122,10 +133,8 @@ const open = async (type: string, id?: number) => {
|
|
|
|
|
dialogVisible.value = true
|
|
|
|
|
dialogTitle.value = t('action.' + type)
|
|
|
|
|
formType.value = type
|
|
|
|
|
|
|
|
|
|
resetForm()
|
|
|
|
|
formData.value.feedingType = 'org'
|
|
|
|
|
formData.value.feedingPipeline = 'zhijiang2'
|
|
|
|
|
// 修改时,设置数据
|
|
|
|
|
if (id) {
|
|
|
|
|
formLoading.value = true
|
|
|
|
|
@ -137,6 +146,8 @@ const open = async (type: string, id?: number) => {
|
|
|
|
|
}
|
|
|
|
|
// 加载产品、
|
|
|
|
|
productList.value = await ProductApi.getMesProductSimpleList()
|
|
|
|
|
// 加载组织
|
|
|
|
|
await getOrganizationTree()
|
|
|
|
|
}
|
|
|
|
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
|
|
|
|
|
|
|
|
|
@ -195,4 +206,14 @@ const resetForm = () => {
|
|
|
|
|
}
|
|
|
|
|
formRef.value?.resetFields()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 获得产线工位树 */
|
|
|
|
|
const getOrganizationTree = async () => {
|
|
|
|
|
organizationTree.value = []
|
|
|
|
|
const req = {orgClass:'pipeline'}
|
|
|
|
|
const data = await OrganizationApi.getOrganizationList(req)
|
|
|
|
|
const root: Tree = { id: 0, name: '顶级产线工位', children: [] }
|
|
|
|
|
root.children = handleTree(data, 'id', 'parentId')
|
|
|
|
|
organizationTree.value.push(root)
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|