Browse Source

排期推送:数据调整为 取list中sku数据

shipeng 2 weeks ago
parent
commit
91480ccc1e

+ 26 - 16
src/views/otaMr/ctrip/dialog/dataEdit.vue

@@ -226,24 +226,34 @@ export default {
           let list = []
           if(type == 'yesPush') {
             list = res.data
-          }else {
-            if( res.data && res.data.length > 0){
-              obj.sku.forEach((item,index)=>{
-                let obj1 = JSON.parse(JSON.stringify(item))
-                res.data.forEach((item1,index1)=>{
-                  if(item1.id == obj1.id){
-                    obj1 =  JSON.parse(JSON.stringify(item1))
-                  }
+          } else {
+            // if( res.data && res.data.length > 0){
+            //   obj.sku.forEach((item,index)=>{
+            //     let obj1 = JSON.parse(JSON.stringify(item))
+            //     res.data.forEach((item1,index1)=>{
+            //       if(item1.id == obj1.id){
+            //         obj1 =  JSON.parse(JSON.stringify(item1))
+            //       }
                   
-                })
-                list.push({
-                  ...obj1,
-                  tableId: "id_" + index
-                })
-              })
+            //     })
+            //     list.push({
+            //       ...obj1,
+            //       tableId: "id_" + index
+            //     })
+            //   })
               
-              this.goodsList = res.data
-            }else {
+            //   this.goodsList = res.data
+            // }else {
+            //   obj.sku.forEach((item,index)=>{
+            //     list.push({
+            //       ...item,
+            //       tableId: "id_" + index
+            //     })
+            //   })
+            // }
+
+            // 修改 取list中sku数据 2025.06/23
+            if(obj.sku?.length > 0) {
               obj.sku.forEach((item,index)=>{
                 list.push({
                   ...item,

+ 26 - 16
src/views/otaMr/maoyan/dialog/dataEdit.vue

@@ -298,24 +298,34 @@ export default {
           let list = []
           if(type == 'yesPush') {
             list = res.data
-          }else {
-            if( res.data && res.data.length > 0){
-              obj.sku.forEach((item,index)=>{
-                let obj1 = JSON.parse(JSON.stringify(item))
-                res.data.forEach((item1,index1)=>{
-                  if(item1.id == obj1.id){
-                    obj1 =  JSON.parse(JSON.stringify(item1))
-                  }
+          } else {
+            // if( res.data && res.data.length > 0){
+            //   obj.sku.forEach((item,index)=>{
+            //     let obj1 = JSON.parse(JSON.stringify(item))
+            //     res.data.forEach((item1,index1)=>{
+            //       if(item1.id == obj1.id){
+            //         obj1 =  JSON.parse(JSON.stringify(item1))
+            //       }
                   
-                })
-                list.push({
-                  ...obj1,
-                  tableId: "id_" + index
-                })
-              })
+            //     })
+            //     list.push({
+            //       ...obj1,
+            //       tableId: "id_" + index
+            //     })
+            //   })
               
-              this.goodsList = res.data
-            }else {
+            //   this.goodsList = res.data
+            // }else {
+            //   obj.sku.forEach((item,index)=>{
+            //     list.push({
+            //       ...item,
+            //       tableId: "id_" + index
+            //     })
+            //   })
+            // }
+
+            // 调整为 取list中sku数据 2025.06/23
+            if(obj.sku?.length > 0) {
               obj.sku.forEach((item,index)=>{
                 list.push({
                   ...item,

+ 27 - 17
src/views/otaMr/meituan/dialog/dataEdit.vue

@@ -250,25 +250,35 @@ export default {
           let list = []
           if(type == 'yesPush') {
             list = res.data
-          }else {
-            if( res.data && res.data.length > 0){
-              obj.sku.forEach((item,index)=>{
-                let obj1 = JSON.parse(JSON.stringify(item))
-                res.data.forEach((item1,index1)=>{
-                  if(item1.id == obj1.id){
-                    obj1 =  JSON.parse(JSON.stringify(item1))
-                  }
+          } else {
+            // if( res.data && res.data.length > 0){
+            //   obj.sku.forEach((item,index)=>{
+            //     let obj1 = JSON.parse(JSON.stringify(item))
+            //     res.data.forEach((item1,index1)=>{
+            //       if(item1.id == obj1.id){
+            //         obj1 =  JSON.parse(JSON.stringify(item1))
+            //       }
                   
-                })
-                list.push({
-                  ...obj1,
-                  tableId: "id_" + index
-                })
-              })
+            //     })
+            //     list.push({
+            //       ...obj1,
+            //       tableId: "id_" + index
+            //     })
+            //   })
               
-              this.goodsList = res.data
-            }else {
-              obj.sku.forEach((item,index)=>{
+            //   this.goodsList = res.data
+            // }else {
+            //   obj.sku.forEach((item,index)=>{
+            //     list.push({
+            //       ...item,
+            //       tableId: "id_" + index
+            //     })
+            //   })
+            // }
+
+            // 调整为 取list中sku数据 2025.06/23
+            if(obj.sku?.length > 0){
+              obj.sku.forEach((item,index) => {
                 list.push({
                   ...item,
                   tableId: "id_" + index

+ 25 - 16
src/views/otaMr/tiktok/dialog/dataEdit.vue

@@ -270,24 +270,33 @@ export default {
           let list = []
           if(type == 'yesPush') {
             list = res.data
-          }else {
-            if( res.data && res.data.length > 0){
-              obj.sku.forEach((item,index)=>{
-                let obj1 = JSON.parse(JSON.stringify(item))
-                res.data.forEach((item1,index1)=>{
-                  if(item1.id == obj1.id){
-                    obj1 =  JSON.parse(JSON.stringify(item1))
-                  }
+          } else {
+            // if( res.data && res.data.length > 0){
+            //   obj.sku.forEach((item,index)=>{
+            //     let obj1 = JSON.parse(JSON.stringify(item))
+            //     res.data.forEach((item1,index1)=>{
+            //       if(item1.id == obj1.id){
+            //         obj1 =  JSON.parse(JSON.stringify(item1))
+            //       }
                   
-                })
-                list.push({
-                  ...obj1,
-                  tableId: "id_" + index
-                })
-              })
+            //     })
+            //     list.push({
+            //       ...obj1,
+            //       tableId: "id_" + index
+            //     })
+            //   })
               
-              this.goodsList = res.data
-            }else {
+            //   this.goodsList = res.data
+            // }else {
+            //   obj.sku.forEach((item,index)=>{
+            //     list.push({
+            //       ...item,
+            //       tableId: "id_" + index
+            //     })
+            //   })
+            // }
+            // 调整为 取list中sku数据 2025.06/23
+            if(obj.sku?.length > 0) {
               obj.sku.forEach((item,index)=>{
                 list.push({
                   ...item,