Quellcode durchsuchen

新增编辑项目修复

XuZinan vor 2 Jahren
Ursprung
Commit
7aba7a1990
1 geänderte Dateien mit 11 neuen und 0 gelöschten Zeilen
  1. 11 0
      src/pages/PurchaseAdmin/PurchaseList/Approval/ApprovalModal.js

+ 11 - 0
src/pages/PurchaseAdmin/PurchaseList/Approval/ApprovalModal.js

@@ -83,6 +83,16 @@ function AddModal(props) {
       type: item.code,
     });
     setType(item);
+    if (id == 7) {
+      form.resetFields(['industry_id', 'location', 'name', 'version']);
+      setCodes({
+        type: '',
+        industry: '',
+        location: '',
+        name: '',
+        version: '',
+      });
+    }
     form.setFieldsValue({ flow_id: id == 7 ? '4' : '1' });
   };
   const changeIndustry = id => {
@@ -196,6 +206,7 @@ function AddModal(props) {
   // };
 
   useEffect(() => {
+    form.resetFields();
     if (data.id) {
       const type = typeList.find(item => item.id == data.type_id);
       const industry = industryList.find(item => item.id == data.industry_id);