Selaa lähdekoodia

新增商品规格bug

panhui 5 vuotta sitten
vanhempi
commit
75887f18c7
1 muutettua tiedostoa jossa 10 lisäystä ja 2 poistoa
  1. 10 2
      screens/Goods/GoodsSpecificationScreen.js

+ 10 - 2
screens/Goods/GoodsSpecificationScreen.js

@@ -135,7 +135,8 @@ export default function GoodsSpecificationScreen() {
       }
 
       if (isNew) {
-        content.push({ name: "", multiple: false });
+        content.push({ name: "", multiple: false, addIndex: 0 });
+        changeNew([{ name: "", multiple: false, addIndex: 0 }]);
       } else {
         addNew.forEach((item, index) => {
           if (item.addType === "1") {
@@ -494,7 +495,14 @@ export default function GoodsSpecificationScreen() {
           )}
         </Layout>
 
-        <Button size="small" onPress={() => saveInfo(editNowInfo)}>
+        <Button
+          disabled={
+            !editNowInfo.name ||
+            (!!editNowInfo.parent && editNowInfo.amount === "")
+          }
+          size="small"
+          onPress={() => saveInfo(editNowInfo)}
+        >
           {confirm}
         </Button>
         <Button