|
|
@@ -776,13 +776,19 @@ const visible = ref(false);
|
|
|
const layerIndex = ref(0);
|
|
|
const formData = ref<Record<string, any>>({
|
|
|
part_name: "",
|
|
|
- part_type: "",
|
|
|
+ part_type: null,
|
|
|
bom_code: "",
|
|
|
qty: undefined,
|
|
|
is_change: false,
|
|
|
change_content: "",
|
|
|
is_disable: false,
|
|
|
bom_det: undefined,
|
|
|
+ product_category:null,
|
|
|
+ manufacture_report:null,
|
|
|
+ unit:null,
|
|
|
+ part_attribute:null,
|
|
|
+ process:null,
|
|
|
+ manufacture_area:null,
|
|
|
});
|
|
|
const form = ref<FormInstance>();
|
|
|
const loading = ref(false);
|
|
|
@@ -809,6 +815,7 @@ const erpCodeDisabled = computed(() => {
|
|
|
|
|
|
const editType = ref<"add" | "edit">("edit");
|
|
|
const open = (node: any, type?: "add" | "edit", layer?: number) => {
|
|
|
+ console.log('Opening node.data:', node.data);
|
|
|
layerIndex.value = node?._node?.layerIndex || layer;
|
|
|
visible.value = true;
|
|
|
nodeData.value = cloneDeep(node.data);
|
|
|
@@ -822,6 +829,12 @@ const open = (node: any, type?: "add" | "edit", layer?: number) => {
|
|
|
formData.value = {
|
|
|
...node.data?.bom_det,
|
|
|
lever_number: layerIndex.value,
|
|
|
+ product_category : node.data?.product_category ?? null,
|
|
|
+ manufacture_report:node.data?.manufacture_report ?? null,
|
|
|
+ unit:node.data?.unit ?? null,
|
|
|
+ part_attribute:node.data?.part_attribute ?? null,
|
|
|
+ process:node.data?.process ?? null,
|
|
|
+ manufacture_area:node.data?.manufacture_area ?? null,
|
|
|
};
|
|
|
} else {
|
|
|
// 编辑 通过接口获取详情
|
|
|
@@ -972,12 +985,13 @@ const handleSubmit = async () => {
|
|
|
qty: formData.value.qty,
|
|
|
is_change: formData.value.is_change,
|
|
|
change_content: formData.value.change_content,
|
|
|
- manufacture_area: formData.value.manufacture_area,
|
|
|
- manufacture_report: formData.value.manufacture_report,
|
|
|
material_grade: formData.value.material_grade,
|
|
|
- part_attribute: formData.value.part_attribute,
|
|
|
- process: formData.value.process,
|
|
|
- product_category: formData.value.product_category,
|
|
|
+ product_category : formData.value.product_category ?? null,
|
|
|
+ manufacture_report:formData.value.manufacture_report ?? null,
|
|
|
+ unit:formData.value.unit ?? null,
|
|
|
+ part_attribute:formData.value.part_attribute ?? null,
|
|
|
+ process:formData.value.process ?? null,
|
|
|
+ manufacture_area:formData.value.manufacture_area ?? null,
|
|
|
supplier: formData.value.supplier,
|
|
|
erp_code: formData.value.erp_code,
|
|
|
// 编辑数据
|
|
|
@@ -991,6 +1005,7 @@ const handleSubmit = async () => {
|
|
|
delete result.part_type;
|
|
|
|
|
|
emit("ok", result);
|
|
|
+ console.log('Submitting result:', result);
|
|
|
close();
|
|
|
};
|
|
|
|