|
|
|
|
@ -41,22 +41,6 @@
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item :label="t('RecipeManagement.RecipeLibrary.searchPlanLabel')" prop="planId">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="queryParams.planId"
|
|
|
|
|
:placeholder="t('RecipeManagement.RecipeLibrary.searchPlanPlaceholder')"
|
|
|
|
|
clearable
|
|
|
|
|
filterable
|
|
|
|
|
class="!w-240px"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="opt in planOptions"
|
|
|
|
|
:key="String(opt.value)"
|
|
|
|
|
:label="opt.label"
|
|
|
|
|
:value="opt.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<!-- <el-form-item label="来源" prop="source">
|
|
|
|
|
<el-select v-model="queryParams.source" placeholder="请选择来源" clearable class="!w-240px">
|
|
|
|
|
<el-option v-for="opt in sourceOptions" :key="opt.value" :label="opt.label" :value="opt.value" />
|
|
|
|
|
@ -115,16 +99,6 @@
|
|
|
|
|
<span>{{ scope.row.recipeName ?? '-' }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
:label="t('RecipeManagement.RecipeLibrary.tablePlanCodeColumn')"
|
|
|
|
|
align="center"
|
|
|
|
|
prop="planCode"
|
|
|
|
|
min-width="160"
|
|
|
|
|
>
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<span>{{ scope.row.planCode ?? '-' }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
:label="t('RecipeManagement.RecipeLibrary.tableCreatorColumn')"
|
|
|
|
|
align="center"
|
|
|
|
|
@ -212,17 +186,6 @@
|
|
|
|
|
<el-option v-for="opt in recipeOptions" :key="String(opt.value)" :label="opt.label" :value="opt.value" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item :label="t('RecipeManagement.RecipeLibrary.dialogPlanLabel')" prop="planId">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="dialogForm.planId"
|
|
|
|
|
:placeholder="t('RecipeManagement.RecipeLibrary.dialogPlanPlaceholder')"
|
|
|
|
|
clearable
|
|
|
|
|
filterable
|
|
|
|
|
class="!w-full"
|
|
|
|
|
>
|
|
|
|
|
<el-option v-for="opt in planOptions" :key="String(opt.value)" :label="opt.label" :value="opt.value" />
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item :label="t('RecipeManagement.RecipeLibrary.dialogSourceLabel')" prop="source">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="dialogForm.source"
|
|
|
|
|
@ -256,7 +219,6 @@ import { dateFormatter } from '@/utils/formatTime'
|
|
|
|
|
import { RecipePlanDetailApi, RecipePlanDetailVO } from '@/api/iot/recipePlanDetail'
|
|
|
|
|
import { RecipeConfigApi } from '@/api/iot/recipeConfig'
|
|
|
|
|
import { RecipePointApi } from '@/api/iot/recipePoint'
|
|
|
|
|
import { PlanApi } from '@/api/mes/plan'
|
|
|
|
|
import FormulaLibraryDetailTabs from './components/FormulaLibraryDetailTabs.vue'
|
|
|
|
|
import FormulaLibraryReadDialog from './components/FormulaLibraryReadDialog.vue'
|
|
|
|
|
import { RecipeDeviceRecordApi} from '@/api/iot/recipeDeviceRecord'
|
|
|
|
|
@ -278,7 +240,6 @@ const queryParams = reactive({
|
|
|
|
|
code: '' as string,
|
|
|
|
|
name: '' as string,
|
|
|
|
|
recipeId: undefined as string | number | undefined,
|
|
|
|
|
planId: undefined as string | number | undefined,
|
|
|
|
|
source: undefined as string | undefined
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
@ -294,21 +255,13 @@ const sourceOptions: SelectOption<string>[] = [
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
const recipeOptions = ref<SelectOption[]>([])
|
|
|
|
|
const planOptions = ref<SelectOption[]>([])
|
|
|
|
|
|
|
|
|
|
const ensureOptionsLoaded = async () => {
|
|
|
|
|
const [recipeRes, planRes] = await Promise.all([
|
|
|
|
|
RecipeConfigApi.getRecipeConfigPage({}),
|
|
|
|
|
PlanApi.getPlanPage({ status: 6 })
|
|
|
|
|
])
|
|
|
|
|
const recipeRes = await RecipeConfigApi.getRecipeConfigPage({})
|
|
|
|
|
recipeOptions.value = (recipeRes?.list ?? []).map((item: any) => {
|
|
|
|
|
const label = item.name ? `${item.recipeCode ?? ''}${item.recipeCode ? '-' : ''}${item.name}` : String(item.id)
|
|
|
|
|
return { label, value: item.id }
|
|
|
|
|
})
|
|
|
|
|
planOptions.value = (planRes?.list ?? []).map((item: any) => {
|
|
|
|
|
const label = item.code ?? String(item.id)
|
|
|
|
|
return { label, value: item.id }
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const buildQueryParams = () => {
|
|
|
|
|
@ -319,8 +272,7 @@ const buildQueryParams = () => {
|
|
|
|
|
pageSize: queryParams.pageSize,
|
|
|
|
|
code: code ? code : undefined,
|
|
|
|
|
name: name ? name : undefined,
|
|
|
|
|
recipeId: queryParams.recipeId ? String(queryParams.recipeId) : undefined,
|
|
|
|
|
planId: queryParams.planId ? String(queryParams.planId) : undefined,
|
|
|
|
|
recipeId: queryParams.recipeId ? String(queryParams.recipeId) : undefined,
|
|
|
|
|
source: queryParams.source ? queryParams.source : undefined
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -394,13 +346,12 @@ const dialogFormRef = ref()
|
|
|
|
|
const dialogType = ref<'create' | 'update'>('create')
|
|
|
|
|
|
|
|
|
|
const dialogForm = ref<RecipePlanDetailVO>({
|
|
|
|
|
id: undefined,
|
|
|
|
|
code: '',
|
|
|
|
|
name: '',
|
|
|
|
|
recipeId: undefined,
|
|
|
|
|
planId: undefined,
|
|
|
|
|
source: undefined,
|
|
|
|
|
isEnable: undefined
|
|
|
|
|
id: undefined,
|
|
|
|
|
code: '',
|
|
|
|
|
name: '',
|
|
|
|
|
recipeId: undefined,
|
|
|
|
|
source: undefined,
|
|
|
|
|
isEnable: undefined
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const dialogRules = reactive({
|
|
|
|
|
@ -412,9 +363,6 @@ const dialogRules = reactive({
|
|
|
|
|
],
|
|
|
|
|
recipeId: [
|
|
|
|
|
{ required: true, message: t('RecipeManagement.RecipeLibrary.validatorRecipeRequired'), trigger: 'change' }
|
|
|
|
|
],
|
|
|
|
|
planId: [
|
|
|
|
|
{ required: true, message: t('RecipeManagement.RecipeLibrary.validatorPlanRequired'), trigger: 'change' }
|
|
|
|
|
]
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
@ -423,9 +371,8 @@ const resetDialogForm = () => {
|
|
|
|
|
id: undefined,
|
|
|
|
|
code: '',
|
|
|
|
|
name: '',
|
|
|
|
|
recipeId: undefined,
|
|
|
|
|
planId: undefined,
|
|
|
|
|
source: undefined
|
|
|
|
|
recipeId: undefined,
|
|
|
|
|
source: undefined
|
|
|
|
|
}
|
|
|
|
|
dialogFormRef.value?.resetFields?.()
|
|
|
|
|
}
|
|
|
|
|
@ -441,8 +388,7 @@ const openDialog = async (type: 'create' | 'update', row?: RecipePlanDetailVO) =
|
|
|
|
|
id: row.id,
|
|
|
|
|
code: row.code,
|
|
|
|
|
name: row.name,
|
|
|
|
|
recipeId: row.recipeId ?? (row as any).recipeId,
|
|
|
|
|
planId: row.planId ?? (row as any).planId,
|
|
|
|
|
recipeId: row.recipeId ?? (row as any).recipeId,
|
|
|
|
|
source: row.source
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -475,8 +421,7 @@ const submitDialog = async () => {
|
|
|
|
|
id: dialogForm.value.id,
|
|
|
|
|
code: dialogForm.value.code,
|
|
|
|
|
name: dialogForm.value.name,
|
|
|
|
|
recipeId: dialogForm.value.recipeId,
|
|
|
|
|
planId: dialogForm.value.planId,
|
|
|
|
|
recipeId: dialogForm.value.recipeId,
|
|
|
|
|
source: dialogForm.value.source
|
|
|
|
|
}
|
|
|
|
|
if (dialogType.value === 'create') {
|
|
|
|
|
|