linwenxin 1 år sedan
förälder
incheckning
00345a5c12
1 ändrade filer med 28 tillägg och 29 borttagningar
  1. 28 29
      src/views/auxiliaryFittings/purchasingManagement/mixins/form_tpl.js

+ 28 - 29
src/views/auxiliaryFittings/purchasingManagement/mixins/form_tpl.js

@@ -739,36 +739,35 @@ export default {
                 {!!~[0, 1].indexOf(this.formDialogType) ? <div style="margin-bottom:8px">
                   <el-button onClick={() => {
                     this.$refs.formRef.validate((valid, invalidFields, errLabels) => {
-                      if (invalidFields.websitId || invalidFields.venderId) {
-                        return
+                      if (valid || (Object.keys(invalidFields).length == 1 && invalidFields.items)) {
+                        this.formData.items.map((item) => { item.isEditRow = false })
+                        this.formData.items.push({
+                          "brand": "",
+                          "companyWechatId": "",
+                          "cost": "",
+                          "costValue": "",
+                          "goodsCategoryId": "",
+                          "goodsCategoryName": "",
+                          "goodsCode": "",
+                          "goodsId": "",
+                          "goodsName": "",
+                          "goodsSpecification": "",
+                          "goodsStockUnit": "",
+                          "goodsType": "",
+                          "note": "",
+                          "parentCategoryId": "",
+                          "parentCategoryName": "",
+                          "productCategory": "",
+                          "purchaseId": "",
+                          "recQty": "",
+                          "retQty": "",
+                          "retValue": "",
+                          "stockQty": "",
+                          "websitId": "",
+                          "websitName": "",
+                          "isEditRow": true,
+                        })
                       }
-                      this.formData.items.map((item) => { item.isEditRow = false })
-                      this.formData.items.push({
-                        "brand": "",
-                        "companyWechatId": "",
-                        "cost": "",
-                        "costValue": "",
-                        "goodsCategoryId": "",
-                        "goodsCategoryName": "",
-                        "goodsCode": "",
-                        "goodsId": "",
-                        "goodsName": "",
-                        "goodsSpecification": "",
-                        "goodsStockUnit": "",
-                        "goodsType": "",
-                        "note": "",
-                        "parentCategoryId": "",
-                        "parentCategoryName": "",
-                        "productCategory": "",
-                        "purchaseId": "",
-                        "recQty": "",
-                        "retQty": "",
-                        "retValue": "",
-                        "stockQty": "",
-                        "websitId": "",
-                        "websitName": "",
-                        "isEditRow": true,
-                      })
                     })
                   }}>添加</el-button>
                 </div> : null}