From 21b754497b6615ec11e095781306751cad04b0cd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=88=98=E4=BB=95=E4=BC=9F?= <499672082@qq.com>
Date: Sat, 20 Jan 2024 01:37:46 +0800
Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
 src/components/AiSingleProductDetail.vue      |  81 ++++
 src/manifest.production.json                  |   2 +-
 src/router/index.js                           |   7 +-
 src/view/Home.vue                             |  14 +-
 src/view/{ => sale}/ExportSaleData.vue        |  63 +--
 src/view/sale/ExportSaleOutData.vue           | 223 ++++++++++
 src/view/selection/singletrack/Index.vue      |   9 +-
 .../singletrack/components/Detail.vue         |  56 +--
 .../selection/singletrack/components/List.vue | 390 ++++++++++--------
 .../singletrack/components/SheinDetail.vue    | 302 --------------
 10 files changed, 593 insertions(+), 554 deletions(-)
 create mode 100644 src/components/AiSingleProductDetail.vue
 rename src/view/{ => sale}/ExportSaleData.vue (95%)
 create mode 100644 src/view/sale/ExportSaleOutData.vue
 delete mode 100644 src/view/selection/singletrack/components/SheinDetail.vue
diff --git a/src/components/AiSingleProductDetail.vue b/src/components/AiSingleProductDetail.vue
new file mode 100644
index 0000000..7d16367
--- /dev/null
+++ b/src/components/AiSingleProductDetail.vue
@@ -0,0 +1,81 @@
+
+  
+    
+      
+        
+        
+          
+        
+      
+      
+        
+          
+        
+      
+    
+  
+
+
+
diff --git a/src/manifest.production.json b/src/manifest.production.json
index 5187be6..bdb46d8 100644
--- a/src/manifest.production.json
+++ b/src/manifest.production.json
@@ -2,7 +2,7 @@
   "manifest_version": 3,
   "name": "TEMU助手",
   "description": "TEMU助手 - 自动化提高生产效率",
-  "version": "3.1.6",
+  "version": "3.1.7",
   "background": {
     "service_worker": "/background.js"
   },
diff --git a/src/router/index.js b/src/router/index.js
index a1af403..5a4bcd5 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -138,7 +138,12 @@ const router = new VueRouter({
         {
           path: 'saleData',
           name: 'saleData',
-          component: () => import('../view/ExportSaleData.vue')
+          component: () => import('../view/sale/ExportSaleData.vue')
+        },
+        {
+          path: 'saleOut',
+          name: 'saleOut',
+          component: () => import('../view/sale/ExportSaleOutData.vue')
         },
         
         // {
diff --git a/src/view/Home.vue b/src/view/Home.vue
index 1dc8896..8dffb2e 100644
--- a/src/view/Home.vue
+++ b/src/view/Home.vue
@@ -98,7 +98,7 @@
               上架新品
               我的分组
             
-            
+            单品跟踪
             7天畅销品
             首页商品跟踪
           
@@ -115,10 +115,14 @@
               
             
           
-          
-            
-            销售数据
-          
+          
+            
+              
+              销售管理
+            
+            销售管理
+            售罄看板
+          
           
             
             新手园地
diff --git a/src/view/ExportSaleData.vue b/src/view/sale/ExportSaleData.vue
similarity index 95%
rename from src/view/ExportSaleData.vue
rename to src/view/sale/ExportSaleData.vue
index 4f71333..7634c43 100644
--- a/src/view/ExportSaleData.vue
+++ b/src/view/sale/ExportSaleData.vue
@@ -851,7 +851,7 @@ import { Message } from 'element-ui'
           return
         }
         let beginDateStr = formatDate(this.skuDownloadForm.date[0])
-        let endDateStyr = formatDate(this.skuDownloadForm.date[1])
+        let endDateStr = formatDate(this.skuDownloadForm.date[1])
 
         let temp = {}
         temp = {
@@ -872,9 +872,9 @@ import { Message } from 'element-ui'
         let tempSkuList = this.list.filter(item => {
           return item.onSalesDurationOffline != '-天'
         })
-        this.tempSkuIds = []
+        let tempSkuIds = []
         tempSkuList.map(i => {
-          this.tempSkuIds.push(i.productSkuId) 
+          tempSkuIds.push(i.productSkuId) 
         })
 
         this.skuSaleNumberList = []
@@ -898,34 +898,43 @@ import { Message } from 'element-ui'
             this.skuSaleNumberList.push(temp)
           }
         })
-        
 
-        let res = await sendChromeAPIMessage({
-          url: 'oms/bg/venom/api/supplier/sales/management/querySkuSalesNumber',
-          needMallId: true,
-          mallId: this.mallId,
-          data: {
-            "productSkuIds": this.tempSkuIds,
-            "startDate": beginDateStr,
-            "endDate": endDateStyr
-          }})
+        let reqSkusIds = [], pageSize = 200
+        for (let i = 0; i < tempSkuIds.length; i++) {
+          reqSkusIds.push(tempSkuIds[i])
+          if (reqSkusIds.length % pageSize == 0 || ((i+1) == tempSkuIds.length)) {
+            let res = await sendChromeAPIMessage({
+              url: 'oms/bg/venom/api/supplier/sales/management/querySkuSalesNumber',
+              needMallId: true,
+              mallId: this.mallId,
+              data: {
+                "productSkuIds": reqSkusIds,
+                "startDate": beginDateStr,
+                "endDate": endDateStr
+            }})
 
-          if (res.success) {
-            res.result.map(item => {
-              for (let i = 0; i < this.skuSaleNumberList.length; i++) {
-                if (this.skuSaleNumberList[i].sku == item.prodSkuId) {
-                  this.skuSaleNumberList[i][item.date] = item.salesNumber
-                  break
+            if (res.success) {
+              res.result.map(item => {
+                for (let i = 0; i < this.skuSaleNumberList.length; i++) {
+                  if (this.skuSaleNumberList[i].sku == item.prodSkuId) {
+                    this.skuSaleNumberList[i][item.date] = item.salesNumber
+                    break
+                  }
                 }
-              }
-            })
-            document.getElementById('downloadSkuSaleNumber').click()
-          } else {
-            Message.error("获取SKU历史销量数据失败")
+              })
+            } else {
+              this.isLoading = false
+              Message.error("获取SKU历史销量数据失败")
+              break
+            }
+
+            if ((i+1) == tempSkuIds.length) {
+              document.getElementById('downloadSkuSaleNumber').click()
+              this.isLoading = false
+            }
+            reqSkusIds = []
           }
-
-          this.isLoading = false
-
+        }
       }
     }
   }
diff --git a/src/view/sale/ExportSaleOutData.vue b/src/view/sale/ExportSaleOutData.vue
new file mode 100644
index 0000000..4facb6d
--- /dev/null
+++ b/src/view/sale/ExportSaleOutData.vue
@@ -0,0 +1,223 @@
+
+  
+    
+      
+        
+      
+    
+    
+      
+        
+          
+            即将售罄
+            已售罄
+          
+        
+        
+        
+      
+      
+        
+          
+            导出数据
+          
+        
+         {}">
+        
+      
+    
+  
+
+
+
+
+
diff --git a/src/view/selection/singletrack/Index.vue b/src/view/selection/singletrack/Index.vue
index 3b042d0..e2fc2d8 100644
--- a/src/view/selection/singletrack/Index.vue
+++ b/src/view/selection/singletrack/Index.vue
@@ -11,7 +11,6 @@
 
-
-