diff --git a/src/views/erp/product/category/erpproductcategoryfault/ProductCategoryFaultForm.vue b/src/views/erp/product/category/erpproductcategoryfault/ProductCategoryFaultForm.vue
index 061350c2d..181597288 100644
--- a/src/views/erp/product/category/erpproductcategoryfault/ProductCategoryFaultForm.vue
+++ b/src/views/erp/product/category/erpproductcategoryfault/ProductCategoryFaultForm.vue
@@ -9,7 +9,7 @@
>
-
+
@@ -73,8 +73,10 @@ import { ProductCategoryVO } from '@/api/erp/product/category'
import { ProductCategoryPartApi, ProductCategoryPartVO} from '@/api/erp/product/category/productcategorypart'
/** 从父组件取productCategoryList数组*/
-defineProps<{
+const props = defineProps<{
productCategoryList: ProductCategoryVO[]
+ productCategoryId: number
+
}
>();
@@ -97,7 +99,7 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
const formType = ref('') // 表单的类型:create - 新增;update - 修改
const formData = ref({
id: undefined,
- productCategoryId: undefined,
+ productCategoryId: null as number | null,
productFaultPart: undefined,
productFault: undefined,
ifAffectSale: undefined,
@@ -120,6 +122,8 @@ const open = async (type: string, id?: number) => {
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
+ formData.value.productCategoryId = props.productCategoryId
+
// 修改时,设置数据
if (id) {
formLoading.value = true
@@ -167,7 +171,7 @@ const submitForm = async () => {
const resetForm = () => {
formData.value = {
id: undefined,
- productCategoryId: undefined,
+ productCategoryId: null as number | null,
productFaultPart: undefined,
productFault: undefined,
ifAffectSale: undefined,
diff --git a/src/views/erp/product/category/erpproductcategoryfault/index.vue b/src/views/erp/product/category/erpproductcategoryfault/index.vue
index 5bf7b5e87..8adb915f2 100644
--- a/src/views/erp/product/category/erpproductcategoryfault/index.vue
+++ b/src/views/erp/product/category/erpproductcategoryfault/index.vue
@@ -12,6 +12,7 @@
@@ -215,7 +216,7 @@
-
+