Răsfoiți Sursa

fix: 机型多选导致问题

liujt 1 lună în urmă
părinte
comite
6c079f3662
1 a modificat fișierele cu 12 adăugiri și 13 ștergeri
  1. 12 13
      src/BIZComponents/inventoryTable.vue

+ 12 - 13
src/BIZComponents/inventoryTable.vue

@@ -818,7 +818,6 @@
             filterable
             allow-create
             default-first-option
-            multiple
           >
           </DictSelection>
         </el-form-item>
@@ -2005,6 +2004,7 @@
           v.industryArtFiles = v.industryArtFiles || [];
           v.otherFiles = v.otherFiles || [];
         });
+        console.log('comitDatasource~~~', comitDatasource);
         return comitDatasource;
       },
       getPrice() {
@@ -2094,6 +2094,7 @@
       },
 
       changeAll() {
+        console.log('changeAll', this.form.datasource);
         this.allPrice = getAllPrice(this.form.datasource) || 0;
         this.allQuantity = getAllQuantity(this.form.datasource, this.countObj) || 0;
         this.form.discountTotalPrice = getAllDiscountPrice(this.form.datasource) || 0;
@@ -2380,12 +2381,8 @@
             dayjs(new Date()).format('YYYY-MM-DD')
           );
 
-          if (item.modelKey) {
-            this.$set(parasm, 'modelKey', item.modelKey);
-          }
-          if (item.colorKey) {
-            this.$set(parasm, 'colorKey', item.colorKey);
-          }
+          this.$set(parasm, 'modelKey', item.modelKey || '');
+          this.$set(parasm, 'colorKey', item.colorKey || '');
           if (this.defTaxRate) {
             this.$set(parasm, 'taxRate', parasm.taxRate ? parasm.taxRate : this.isContractBook ? this.defTaxRate : this.isTaxRate == 1 ? this.defTaxRate : undefined);
           }
@@ -2483,9 +2480,12 @@
             this.form.datasource.push(row);
           }
         });
+
+        console.log('changeParent~~~', this.form.datasource);
         this.changeCount();
       },
       async replaceTable(obj, idx) {
+        console.log('replaceTable', obj, idx);
         for (let index = 0; index < obj.length; index++) {
           const item = obj[index];
           let i = idx == -1 ? index : idx;
@@ -2534,12 +2534,11 @@
           } else {
             this.$set(parasm, 'singlePrice', 0);
           }
-          if (item.modelKey) {
-            this.$set(parasm, 'modelKey', item.modelKey);
-          }
-          if (item.colorKey) {
-            this.$set(parasm, 'colorKey', item.colorKey);
-          }
+  
+          this.$set(parasm, 'modelKey', item.modelKey || '');
+
+          this.$set(parasm, 'colorKey', item.colorKey || '');
+        
           if (this.isSupplier) {
             this.$set(
               parasm,