Просмотр исходного кода

refactor: 1.统一处理多逗号分隔的modelKey和colorKey2. 替换所有waitSendCount字段为pendingShipmentQuantity

liujt 15 часов назад
Родитель
Сommit
9e651c10c6

+ 5 - 5
src/BIZComponents/inventoryTable.vue

@@ -2380,9 +2380,9 @@
             'customerExpectDeliveryDeadline',
             dayjs(new Date()).format('YYYY-MM-DD')
           );
-
-          this.$set(parasm, 'modelKey', item.modelKey || '');
-          this.$set(parasm, 'colorKey', item.colorKey || '');
+          // console.log('colorKey~~', item.colorKey);
+          this.$set(parasm, 'modelKey', item.modelKey?.split(',')?.[0] || '');
+          this.$set(parasm, 'colorKey', item.colorKey?.split(',')?.[0] || '');
           if (this.defTaxRate) {
             this.$set(parasm, 'taxRate', parasm.taxRate !== undefined && parasm.taxRate !== null ? parasm.taxRate : this.isContractBook ? this.defTaxRate : this.isTaxRate == 1 ? this.defTaxRate : undefined);
           }
@@ -2535,9 +2535,9 @@
             this.$set(parasm, 'singlePrice', 0);
           }
   
-          this.$set(parasm, 'modelKey', item.modelKey || '');
+          this.$set(parasm, 'modelKey', item.modelKey?.split(',')?.[0] || '');
 
-          this.$set(parasm, 'colorKey', item.colorKey || '');
+          this.$set(parasm, 'colorKey', item.colorKey?.split(',')?.[0] || '');
         
           if (this.isSupplier) {
             this.$set(

+ 6 - 6
src/views/purchasingManage/purchaseNeedManage/components/inventoryTable.vue

@@ -795,10 +795,10 @@
         if (data && data?.length) {
           this.form.datasource = data.map((item, index) => {
             if (item.modelKey) {
-              item.modelKey = item.modelKey;
+              item.modelKey = item.modelKey?.split(',')?.[0] || '';
             }
             if (item.colorKey) {
-              item.colorKey = item.colorKey;
+              item.colorKey = item.colorKey?.split(',')?.[0] || '';
             }
             item.key = index + 1;
             return item;
@@ -919,10 +919,10 @@
           this.$set(parasm, 'supplierId', item.supplierId);
           this.$set(parasm, 'supplierName', item.supplierName);
           if (item.modelKey) {
-            this.$set(parasm, 'modelKey', item.modelKey);
+            this.$set(parasm, 'modelKey', item.modelKey?.split(',')?.[0] || '');
           }
           if (item.colorKey) {
-            this.$set(parasm, 'colorKey', item.colorKey);
+            this.$set(parasm, 'colorKey', item.colorKey?.split(',')?.[0] || '');
           }
           this.$set(
             parasm,
@@ -1010,10 +1010,10 @@
           let parasm = idx == -1 ? row : this.form.datasource[i];
           this.$set(parasm, 'productId', item.id);
           if (item.modelKey) {
-            this.$set(parasm, 'modelKey', item.modelKey);
+            this.$set(parasm, 'modelKey', item.modelKey?.split(',')?.[0] || '');
           }
           if (item.colorKey) {
-            this.$set(parasm, 'colorKey', item.colorKey);
+            this.$set(parasm, 'colorKey', item.colorKey?.split(',')?.[0] || '');
           }
           this.$set(parasm, 'categoryName', item.name);
           this.$set(parasm, 'productCategoryId', item.categoryLevelId);

+ 4 - 4
src/views/purchasingManage/purchaseOrder/components/inventoryTableNew.vue

@@ -1461,10 +1461,10 @@
               ? item.guaranteePeriodUnitCode + ''
               : '';
             if (item.modelKey) {
-              item.modelKey = item.modelKey;
+              item.modelKey = item.modelKey?.split(',')?.[0] || '';
             }
             if (item.colorKey) {
-              item.colorKey = item.colorKey;
+              item.colorKey = item.colorKey?.split(',')?.[0] || '';
             }
             item.taxRate = item.taxRate || 13;
             item.discountRatio = Number(item.discountRatio) || 100; 
@@ -1560,10 +1560,10 @@
             this.$set(parasm, 'purchaseCount', item.saleCount);
           }
           if (item.modelKey) {
-            this.$set(parasm, 'modelKey', item.modelKey);
+            this.$set(parasm, 'modelKey', item.modelKey?.split(',')?.[0] || '');
           }
           if (item.colorKey) {
-            this.$set(parasm, 'colorKey', item.colorKey);
+            this.$set(parasm, 'colorKey', item.colorKey?.split(',')?.[0] || '');
           }
 
           this.$set(parasm, 'discountRatio', parasm.discountRatio || 100);

+ 4 - 4
src/views/purchasingManage/purchaseOrder/invoice/components/inventoryTable.vue

@@ -1118,10 +1118,10 @@
           this.$set(parasm, 'increaseTotalWeight', 0);
           this.$set(parasm, 'goodsLevel', item.goodsLevel);
           if (item.modelKey) {
-            this.$set(parasm, 'modelKey', item.modelKey);
+            this.$set(parasm, 'modelKey', item.modelKey?.split(',')?.[0] || '');
           }
           if (item.colorKey) {
-            this.$set(parasm, 'colorKey', item.colorKey);
+            this.$set(parasm, 'colorKey', item.colorKey?.split(',')?.[0] || '');
           }
           this.$set(
             parasm,
@@ -1265,14 +1265,14 @@
               this.$set(
                 this.form.datasource[index],
                 'modelKey',
-                item.modelKey
+                item.modelKey?.split(',')?.[0] || ''
               );
             }
             if (item.colorKey) {
               this.$set(
                 this.form.datasource[index],
                 'colorKey',
-                item.colorKey
+                item.colorKey?.split(',')?.[0] || ''
               );
             }
             if (!item.warehouseId && this.isWarehouseId == 1) {

+ 6 - 6
src/views/purchasingManage/purchasePlanManage/components/inventoryTable.vue

@@ -934,10 +934,10 @@
           this.form.datasource = [];
           data.forEach((row) => {
             if (row.modelKey) {
-              row.modelKey = row.modelKey;
+              row.modelKey = row.modelKey?.split(',')?.[0] || '';
             }
             if (row.colorKey) {
-              row.colorKey = row.colorKey;
+              row.colorKey = row.colorKey?.split(',')?.[0] || '';
             }
             row['reqTotalCount'] = row['reqTotalCount'] || row.totalCount;
             row['arrivalWay'] = row.arrivalWay || 1;
@@ -1131,10 +1131,10 @@
           this.$set(parasm, 'supplierId', item.supplierId);
           this.$set(parasm, 'supplierName', item.supplierName);
           if (item.modelKey) {
-            this.$set(parasm, 'modelKey', item.modelKey);
+            this.$set(parasm, 'modelKey', item.modelKey?.split(',')?.[0] || '');
           }
           if (item.colorKey) {
-            this.$set(parasm, 'colorKey', item.colorKey);
+            this.$set(parasm, 'colorKey', item.colorKey?.split(',')?.[0] || '');
           }
           this.$set(
             parasm,
@@ -1210,10 +1210,10 @@
           this.$set(parasm, 'produceType', item.componentAttribute);
           this.$set(parasm, 'approvalNumber', item.extField.approvalNumber);
           if (item.modelKey) {
-            this.$set(parasm, 'modelKey', item.modelKey);
+            this.$set(parasm, 'modelKey', item.modelKey?.split(',')?.[0] || '');
           }
           if (item.colorKey) {
-            this.$set(parasm, 'colorKey', item.colorKey);
+            this.$set(parasm, 'colorKey', item.colorKey?.split(',')?.[0] || '');
           }
           this.$set(
             parasm,

+ 1 - 1
src/views/saleManage/saleOrder/invoice/components/inventoryTable.vue

@@ -772,7 +772,7 @@
           },
           {
             width: 150,
-            prop: 'waitSendCount',
+            prop: 'pendingShipmentQuantity',
             label: '待发数量',
             align: 'center'
           },

+ 1 - 1
src/views/saleManage/saleOrder/invoice/components/inventoryTableDetails.vue

@@ -224,7 +224,7 @@
           },
           {
             width: 150,
-            prop: 'waitSendCount',
+            prop: 'pendingShipmentQuantity',
             label: '待发数量',
             align: 'center'
           },