|
|
|
@ -84,10 +84,10 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<template #footer>
|
|
|
|
<template #footer>
|
|
|
|
<el-button @click="submitForm" type="primary">
|
|
|
|
<el-button @click="submitForm" type="primary" :loading="submitLoading" :disabled="submitLoading">
|
|
|
|
{{ t('RecipeManagement.RecipeLibrary.readDialogSubmitButtonText') }}
|
|
|
|
{{ t('RecipeManagement.RecipeLibrary.readDialogSubmitButtonText') }}
|
|
|
|
</el-button>
|
|
|
|
</el-button>
|
|
|
|
<el-button @click="visible = false">
|
|
|
|
<el-button @click="visible = false" :disabled="submitLoading">
|
|
|
|
{{ t('RecipeManagement.RecipeLibrary.readDialogCancelButton') }}
|
|
|
|
{{ t('RecipeManagement.RecipeLibrary.readDialogCancelButton') }}
|
|
|
|
</el-button>
|
|
|
|
</el-button>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
@ -107,6 +107,7 @@ type PageResult<T> = { list: T[]; total: number }
|
|
|
|
const visible = ref(false)
|
|
|
|
const visible = ref(false)
|
|
|
|
const title = ref('')
|
|
|
|
const title = ref('')
|
|
|
|
const loading = ref(false)
|
|
|
|
const loading = ref(false)
|
|
|
|
|
|
|
|
const submitLoading = ref(false)
|
|
|
|
const hasExistingRecords = ref(false)
|
|
|
|
const hasExistingRecords = ref(false)
|
|
|
|
|
|
|
|
|
|
|
|
const recipeId = ref<string | number | undefined>(undefined)
|
|
|
|
const recipeId = ref<string | number | undefined>(undefined)
|
|
|
|
@ -115,6 +116,9 @@ const total = ref(0)
|
|
|
|
|
|
|
|
|
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
|
|
|
|
const emit = defineEmits<{
|
|
|
|
|
|
|
|
(e: 'success'): void
|
|
|
|
|
|
|
|
}>()
|
|
|
|
|
|
|
|
|
|
|
|
const unitList = ref<ProductUnitVO[]>([])
|
|
|
|
const unitList = ref<ProductUnitVO[]>([])
|
|
|
|
|
|
|
|
|
|
|
|
@ -194,11 +198,18 @@ defineExpose({ open })
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const submitForm = async () => {
|
|
|
|
const submitForm = async () => {
|
|
|
|
|
|
|
|
if (submitLoading.value) return
|
|
|
|
|
|
|
|
submitLoading.value = true
|
|
|
|
console.log(list.value)
|
|
|
|
console.log(list.value)
|
|
|
|
|
|
|
|
try {
|
|
|
|
await RecipePointRecordApi.createRecipePointRecordBatch(list.value as unknown as RecipePointRecordVO[])
|
|
|
|
await RecipePointRecordApi.createRecipePointRecordBatch(list.value as unknown as RecipePointRecordVO[])
|
|
|
|
await RecipeDeviceRecordApi.createRecipeDeviceRecordBatch(formulaLibraryId.value)
|
|
|
|
await RecipeDeviceRecordApi.createRecipeDeviceRecordBatch(formulaLibraryId.value)
|
|
|
|
visible.value = false
|
|
|
|
visible.value = false
|
|
|
|
message.success(t('common.createSuccess'))
|
|
|
|
message.success(t('common.createSuccess'))
|
|
|
|
|
|
|
|
emit('success')
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
|
|
submitLoading.value = false
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|