|
|
|
@ -29,7 +29,11 @@
|
|
|
|
align="center"
|
|
|
|
align="center"
|
|
|
|
prop="dataUnit"
|
|
|
|
prop="dataUnit"
|
|
|
|
width="140"
|
|
|
|
width="140"
|
|
|
|
/>
|
|
|
|
>
|
|
|
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
|
|
|
{{ getUnitLabel(scope.row?.dataUnit) }}
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column
|
|
|
|
<el-table-column
|
|
|
|
:label="t('RecipeManagement.RecipeLibrary.readDialogMaxColumn')"
|
|
|
|
:label="t('RecipeManagement.RecipeLibrary.readDialogMaxColumn')"
|
|
|
|
align="center"
|
|
|
|
align="center"
|
|
|
|
@ -94,6 +98,7 @@
|
|
|
|
import { RecipePointApi, RecipePointVO } from '@/api/iot/recipePoint'
|
|
|
|
import { RecipePointApi, RecipePointVO } from '@/api/iot/recipePoint'
|
|
|
|
import { RecipeDeviceRecordApi} from '@/api/iot/recipeDeviceRecord'
|
|
|
|
import { RecipeDeviceRecordApi} from '@/api/iot/recipeDeviceRecord'
|
|
|
|
import { RecipePointRecordApi,RecipePointRecordVO} from '@/api/iot/recipepointrecord'
|
|
|
|
import { RecipePointRecordApi,RecipePointRecordVO} from '@/api/iot/recipepointrecord'
|
|
|
|
|
|
|
|
import { ProductUnitApi, ProductUnitVO } from '@/api/erp/product/unit'
|
|
|
|
|
|
|
|
|
|
|
|
defineOptions({ name: 'FormulaLibraryReadDialog' })
|
|
|
|
defineOptions({ name: 'FormulaLibraryReadDialog' })
|
|
|
|
|
|
|
|
|
|
|
|
@ -111,6 +116,20 @@ const total = ref(0)
|
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const unitList = ref<ProductUnitVO[]>([])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const ensureUnitList = async () => {
|
|
|
|
|
|
|
|
if (unitList.value.length > 0) return
|
|
|
|
|
|
|
|
unitList.value = await ProductUnitApi.getProductUnitSimpleList()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const getUnitLabel = (dataUnit: unknown) => {
|
|
|
|
|
|
|
|
const id = String(dataUnit ?? '').trim()
|
|
|
|
|
|
|
|
if (!id) return '-'
|
|
|
|
|
|
|
|
const unit = unitList.value.find((u) => String(u.id) === id)
|
|
|
|
|
|
|
|
return unit?.name ?? id
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const queryParams = reactive({
|
|
|
|
const queryParams = reactive({
|
|
|
|
pageNo: 1,
|
|
|
|
pageNo: 1,
|
|
|
|
pageSize: 10
|
|
|
|
pageSize: 10
|
|
|
|
@ -157,6 +176,7 @@ const open = async (options: {
|
|
|
|
hasExistingRecords?: boolean
|
|
|
|
hasExistingRecords?: boolean
|
|
|
|
}) => {
|
|
|
|
}) => {
|
|
|
|
visible.value = true
|
|
|
|
visible.value = true
|
|
|
|
|
|
|
|
await ensureUnitList()
|
|
|
|
formulaLibraryId.value = options.id
|
|
|
|
formulaLibraryId.value = options.id
|
|
|
|
recipeId.value = options.recipeId
|
|
|
|
recipeId.value = options.recipeId
|
|
|
|
hasExistingRecords.value = !!options.hasExistingRecords
|
|
|
|
hasExistingRecords.value = !!options.hasExistingRecords
|
|
|
|
|