فهرست منبع

feat:校验子商品不超过十条

snow 1 سال پیش
والد
کامیت
5b95b187c4
2فایلهای تغییر یافته به همراه24 افزوده شده و 0 حذف شده
  1. 12 0
      src/views/goodStore/goodsCost/components/baseForm.vue
  2. 12 0
      src/views/goodStore/supplierGoodsCost/components/baseForm.vue

+ 12 - 0
src/views/goodStore/goodsCost/components/baseForm.vue

@@ -1260,6 +1260,18 @@ export default {
     onChildProdChange(index = null, type = "view") {
     onChildProdChange(index = null, type = "view") {
       this.modalType = type;
       this.modalType = type;
 
 
+      if (type === "add") {
+        if (this.editIndex !== -1) {
+          this.$message.warning("当前有正在编辑的子商品,请先保存");
+          return;
+        }
+
+        if (this.childTableData.length === 10) {
+          this.$message.warning("子商品最多不能超过十条");
+          return;
+        }
+      }
+
       if (type === "view" && index !== null) {
       if (type === "view" && index !== null) {
         this.editItem = { ...this.childTableData[index] };
         this.editItem = { ...this.childTableData[index] };
       } else {
       } else {

+ 12 - 0
src/views/goodStore/supplierGoodsCost/components/baseForm.vue

@@ -1264,6 +1264,18 @@ export default {
     onChildProdChange(index = null, type = "view") {
     onChildProdChange(index = null, type = "view") {
       this.modalType = type;
       this.modalType = type;
 
 
+      if (type === "add") {
+        if (this.editIndex !== -1) {
+          this.$message.warning("当前有正在编辑的子商品,请先保存");
+          return;
+        }
+
+        if (this.childTableData.length === 10) {
+          this.$message.warning("子商品最多不能超过十条");
+          return;
+        }
+      }
+
       if (type === "view" && index !== null) {
       if (type === "view" && index !== null) {
         this.editItem = { ...this.childTableData[index] };
         this.editItem = { ...this.childTableData[index] };
       } else {
       } else {