Browse Source

修复缓存bug

xiaohaizhao 1 year ago
parent
commit
715d09f0c8

+ 2 - 2
salesPanel/AnalysisOfTheProportionOfProductCategoriesInOrders/index.js

@@ -20,6 +20,8 @@ Component({
                 site: JSON.stringify(wx.getStorageSync('siteP')),
                 templetList: JSON.stringify(wx.getStorageSync('templetList')),
                 languagecode: wx.getStorageSync('languagecode'),
+                "content.dataid": wx.getStorageSync('userMsg').userid,
+                "content.username": wx.getStorageSync('userMsg').name,
             })
             _Http.basic({
                 "classname": "sysmanage.develop.optiontype.optiontype",
@@ -98,8 +100,6 @@ Component({
         "content": {
             pageNumber: 1,
             pageTotal: 1,
-            dataid: wx.getStorageSync('userMsg').userid,
-            username: wx.getStorageSync('userMsg').name,
             dateType: "本年",
             dataType: "金额",
             type: 0,

+ 4 - 2
salesPanel/AnalysisOfUninvoicedShipments/index.js

@@ -16,12 +16,14 @@ Component({
     lifetimes: {
         attached: function () {
             getApp().globalData.Language.getLanguagePackage(this)
+            this.setData({
+                "content.dataid": wx.getStorageSync('userMsg').userid,
+                "content.username": wx.getStorageSync('userMsg').name,
+            })
         }
     },
     data: {
         "content": {
-            dataid: wx.getStorageSync('userMsg').userid,
-            username: wx.getStorageSync('userMsg').name,
             unwriteoffamounttype: "订单",
             where: {}
         },

+ 4 - 2
salesPanel/FinancialCollectionAnalysis/index.js

@@ -16,12 +16,14 @@ Component({
     lifetimes: {
         attached: function () {
             getApp().globalData.Language.getLanguagePackage(this)
+            this.setData({
+                "content.dataid": wx.getStorageSync('userMsg').userid,
+                "content.username": wx.getStorageSync('userMsg').name,
+            })
         }
     },
     data: {
         "content": {
-            dataid: wx.getStorageSync('userMsg').userid,
-            username: wx.getStorageSync('userMsg').name,
             enddate: new Date().toISOString().split('T')[0],
             unwriteoffamounttype: "订单",
             where: {}

+ 4 - 2
salesPanel/GoodsDispatchedButInvoiceNotIssued/index.js

@@ -16,12 +16,14 @@ Component({
     lifetimes: {
         attached: function () {
             getApp().globalData.Language.getLanguagePackage(this)
+            this.setData({
+                "content.dataid": wx.getStorageSync('userMsg').userid,
+                "content.username": wx.getStorageSync('userMsg').name,
+            })
         }
     },
     data: {
         "content": {
-            dataid: wx.getStorageSync('userMsg').userid,
-            username: wx.getStorageSync('userMsg').name,
             enddate: new Date().toISOString().split('T')[0],
             where: {}
         },

+ 2 - 2
salesPanel/analysisOfOrderTypeDistribution/index.js

@@ -20,6 +20,8 @@ Component({
                 site: JSON.stringify(wx.getStorageSync('siteP')),
                 templetList: JSON.stringify(wx.getStorageSync('templetList')),
                 languagecode: wx.getStorageSync('languagecode'),
+                "content.dataid": wx.getStorageSync('userMsg').userid,
+                "content.username": wx.getStorageSync('userMsg').name,
             })
         }
     },
@@ -28,8 +30,6 @@ Component({
         "content": {
             pageNumber: 1,
             pageTotal: 1,
-            dataid: wx.getStorageSync('userMsg').userid,
-            username: wx.getStorageSync('userMsg').name,
             dateType: "本年",
             dataType: "金额",
             type: 0,

+ 4 - 2
salesPanel/biddingAnalysis/index.js

@@ -16,12 +16,14 @@ Component({
     lifetimes: {
         attached: function () {
             getApp().globalData.Language.getLanguagePackage(this)
+            this.setData({
+                "content.dataid": wx.getStorageSync('userMsg').userid,
+                "content.username": wx.getStorageSync('userMsg').name,
+            })
         }
     },
     data: {
         "content": {
-            dataid: wx.getStorageSync('userMsg').userid,
-            username: wx.getStorageSync('userMsg').name,
             enddate: new Date().toISOString().split('T')[0],
             where: {}
         },

+ 4 - 2
salesPanel/dataOverview/Client/ClientQuotationQuantity.js

@@ -16,12 +16,14 @@ Component({
     lifetimes: {
         attached: function () {
             getApp().globalData.Language.getLanguagePackage(this)
+            this.setData({
+                "content.dataid": wx.getStorageSync('userMsg').userid,
+                "content.username": wx.getStorageSync('userMsg').name,
+            })
         }
     },
     data: {
         "content": {
-            dataid: wx.getStorageSync('userMsg').userid,
-            username: wx.getStorageSync('userMsg').name,
             enddate: new Date().toISOString().split('T')[0],
             where: {}
         },

+ 3 - 3
salesPanel/dataOverview/Client/dataOverview.js

@@ -16,15 +16,15 @@ Component({
                     v.name = getApp().globalData.Language.getMapText(v.value);
                     v.color = v.value == this.data.content.dateType ? "#3874F6" : "";
                     return v
-                })
+                }),
+                "content.dataid": wx.getStorageSync('userMsg').userid,
+                "content.username": wx.getStorageSync('userMsg').name,
             })
         }
     },
     data: {
         "content": {
             dateType: "本年",
-            dataid: wx.getStorageSync('userMsg').userid,
-            username: wx.getStorageSync('userMsg').name,
             type: 0,
             "where": {
                 isleave: "1"

+ 4 - 2
salesPanel/dataOverview/Client/situationAnalysis.js

@@ -13,6 +13,10 @@ Component({
     lifetimes: {
         attached: function () {
             getApp().globalData.Language.getLanguagePackage(this)
+            this.setData({
+                "content.dataid": wx.getStorageSync('userMsg').userid,
+                "content.username": wx.getStorageSync('userMsg').name,
+            })
         }
     },
     data: {
@@ -20,8 +24,6 @@ Component({
         "content": {
             pageNumber: 1,
             pageTotal: 1,
-            dataid: wx.getStorageSync('userMsg').userid,
-            username: wx.getStorageSync('userMsg').name,
             dateType: "本年",
             type: 0,
             where: {

+ 84 - 82
salesPanel/dataOverview/Clue/AnalysisOfLeadConversion.js

@@ -16,12 +16,14 @@ Component({
     lifetimes: {
         attached: function () {
             getApp().globalData.Language.getLanguagePackage(this)
+            this.setData({
+                "content.dataid": wx.getStorageSync('userMsg').userid,
+                "content.username": wx.getStorageSync('userMsg').name,
+            })
         }
     },
     data: {
         "content": {
-            dataid: wx.getStorageSync('userMsg').userid,
-            username: wx.getStorageSync('userMsg').name,
             enddate: new Date().toISOString().split('T')[0],
             where: {}
         },
@@ -56,96 +58,96 @@ Component({
         initChart(data, dates) {
             console.log("data", data)
             let dividend = wx.getStorageSync('languagecode') == 'ZH' ? 10000 : 1000,
-            getMapText = getApp().globalData.Language.getMapText,
-            list = [{
-                name: "转化总次数",
-                color: "#6395F9"
-            }, {
-                name: "转化项目次数",
-                color: "#62DAAB"
-            }, {
-                name: "转化客户次数",
-                color: "#657797"
-            }, {
-                name: "总次数同比增长率",
-                color: "#F6C022"
-            }];
+                getMapText = getApp().globalData.Language.getMapText,
+                list = [{
+                    name: "转化总次数",
+                    color: "#6395F9"
+                }, {
+                    name: "转化项目次数",
+                    color: "#62DAAB"
+                }, {
+                    name: "转化客户次数",
+                    color: "#657797"
+                }, {
+                    name: "总次数同比增长率",
+                    color: "#F6C022"
+                }];
             list.map(item => {
-            item.data = data.filter(v => v.key == item.name).map(v => v.value)
-            return item
+                item.data = data.filter(v => v.key == item.name).map(v => v.value)
+                return item
             })
             console.log("list", list)
 
             const option = {
-            tooltip: {
-                trigger: 'axis',
-                confine: true,
-                formatter: function (params) {
-                let tooltipText = '';
-                params.forEach((item, index) => {
-                    tooltipText += `${index==0?item.axisValue+'\n':''}${item.marker}${item.seriesName}: ${item.seriesName == getMapText('总次数同比增长率') ? (item.value * 100).toFixed(2) :item.value}${item.seriesName == getMapText('总次数同比增长率') ? '%' : ''}\n`;
-                });
-                return tooltipText;
+                tooltip: {
+                    trigger: 'axis',
+                    confine: true,
+                    formatter: function (params) {
+                        let tooltipText = '';
+                        params.forEach((item, index) => {
+                            tooltipText += `${index==0?item.axisValue+'\n':''}${item.marker}${item.seriesName}: ${item.seriesName == getMapText('总次数同比增长率') ? (item.value * 100).toFixed(2) :item.value}${item.seriesName == getMapText('总次数同比增长率') ? '%' : ''}\n`;
+                        });
+                        return tooltipText;
+                    },
+                    textStyle: {
+                        fontSize: 10,
+                    }
                 },
-                textStyle: {
-                fontSize: 10,
-                }
-            },
-            legend: {
-                data: list.map(v => getMapText(v.name)),
-                top: '0rpx', // Moved legend position upwards by 10rpx
-                textStyle: {
-                fontSize: 12 // Reduced font size for legend text
-                }
-            },
-            grid: {
-                top: '32%', // Adjust grid top to leave space for the legend
-                left: '3%',
-                right: '4%',
-                bottom: '3%',
-                containLabel: true
-            },
-            xAxis: {
-                type: 'category',
-                boundaryGap: false,
-                data: dates,
-                axisLabel: {
-                interval: 0, // Force display all labels
-                rotate: 45, // Rotate labels to prevent overlap
-                fontSize: 10 // Reduced font size for X-axis labels
-                }
-            },
-            yAxis: {
-                type: 'value',
-                axisLabel: {
-                fontSize: 10 // Reduced font size for Y-axis labels
-                }
-            },
-            series: list.map(v => {
-                return {
-                name: getMapText(v.name),
-                type: 'line',
-                stack: 'Total',
-                data: v.data,
-                smooth: true, // Enable smooth transition for line charts
-                itemStyle: {
-                    color: v.color
+                legend: {
+                    data: list.map(v => getMapText(v.name)),
+                    top: '0rpx', // Moved legend position upwards by 10rpx
+                    textStyle: {
+                        fontSize: 12 // Reduced font size for legend text
+                    }
                 },
-                lineStyle: {
-                    color: v.color
-                }
-                }
-            })
+                grid: {
+                    top: '32%', // Adjust grid top to leave space for the legend
+                    left: '3%',
+                    right: '4%',
+                    bottom: '3%',
+                    containLabel: true
+                },
+                xAxis: {
+                    type: 'category',
+                    boundaryGap: false,
+                    data: dates,
+                    axisLabel: {
+                        interval: 0, // Force display all labels
+                        rotate: 45, // Rotate labels to prevent overlap
+                        fontSize: 10 // Reduced font size for X-axis labels
+                    }
+                },
+                yAxis: {
+                    type: 'value',
+                    axisLabel: {
+                        fontSize: 10 // Reduced font size for Y-axis labels
+                    }
+                },
+                series: list.map(v => {
+                    return {
+                        name: getMapText(v.name),
+                        type: 'line',
+                        stack: 'Total',
+                        data: v.data,
+                        smooth: true, // Enable smooth transition for line charts
+                        itemStyle: {
+                            color: v.color
+                        },
+                        lineStyle: {
+                            color: v.color
+                        }
+                    }
+                })
             };
             this.chartComponent = this.selectComponent('#mychart');
             this.chartComponent.init((canvas, width, height, dpr) => {
-            const chart = echarts.init(canvas, null, {
-                width,
-                height,
-                devicePixelRatio: dpr
-            });
-            chart.setOption(option);
-            return chart;
+                const chart = echarts.init(canvas, null, {
+                    width,
+                    height,
+                    devicePixelRatio: dpr
+                });
+                chart.setOption(option);
+                return chart;
             });
         },
         changeDate({

+ 4 - 2
salesPanel/dataOverview/Clue/NewAnalysisAdded.js

@@ -12,13 +12,15 @@ Component({
     lifetimes: {
         attached: function () {
             getApp().globalData.Language.getLanguagePackage(this)
+            this.setData({
+                "content.dataid": wx.getStorageSync('userMsg').userid,
+                "content.username": wx.getStorageSync('userMsg').name,
+            })
         }
     },
     data: {
         year: new Date().getFullYear().toString(),
         "content": {
-            dataid: wx.getStorageSync('userMsg').userid,
-            username: wx.getStorageSync('userMsg').name,
             enddate: new Date().toISOString().split('T')[0],
             where: {}
         }

+ 3 - 3
salesPanel/dataOverview/Clue/dataOverview.js

@@ -16,16 +16,16 @@ Component({
                     v.name = getApp().globalData.Language.getMapText(v.value);
                     v.color = v.value == this.data.content.dateType ? "#3874F6" : "";
                     return v
-                })
+                }),
+                "content.dataid": wx.getStorageSync('userMsg').userid,
+                "content.username": wx.getStorageSync('userMsg').name,
             })
         }
     },
     data: {
         "content": {
             dateType: "本年",
-            dataid: wx.getStorageSync('userMsg').userid,
             type: 0,
-            username: wx.getStorageSync('userMsg').name,
             "where": {
                 isleave: "1"
             }

+ 4 - 2
salesPanel/dataOverview/Clue/followUpAnalysis.js

@@ -12,13 +12,15 @@ Component({
     lifetimes: {
         attached: function () {
             getApp().globalData.Language.getLanguagePackage(this)
+            this.setData({
+                "content.dataid": wx.getStorageSync('userMsg').userid,
+                "content.username": wx.getStorageSync('userMsg').name,
+            })
         }
     },
     data: {
         year: new Date().getFullYear().toString(),
         "content": {
-            dataid: wx.getStorageSync('userMsg').userid,
-            username: wx.getStorageSync('userMsg').name,
             enddate: new Date().toISOString().split('T')[0],
             where: {}
         }

+ 4 - 2
salesPanel/dataOverview/Costs/SPmarketingExpenses.js

@@ -12,6 +12,10 @@ Component({
     lifetimes: {
         attached: function () {
             getApp().globalData.Language.getLanguagePackage(this)
+            this.setData({
+                "content.dataid": wx.getStorageSync('userMsg').userid,
+                "content.username": wx.getStorageSync('userMsg').name,
+            })
         }
     },
     data: {
@@ -19,8 +23,6 @@ Component({
         "content": {
             pageNumber: 1,
             pageTotal: 1,
-            dataid: wx.getStorageSync('userMsg').userid,
-            username: wx.getStorageSync('userMsg').name,
             dateType: "本年",
             type: 0,
             where: {

+ 3 - 3
salesPanel/dataOverview/Costs/dataOverview.js

@@ -21,15 +21,15 @@ Component({
                     v.name = getApp().globalData.Language.getMapText(v.value);
                     v.color = v.value == this.data.content.dateType ? "#3874F6" : "";
                     return v
-                })
+                }),
+                "content.dataid": wx.getStorageSync('userMsg').userid,
+                "content.username": wx.getStorageSync('userMsg').name,
             })
         }
     },
     data: {
         "content": {
             dateType: "本年",
-            dataid: wx.getStorageSync('userMsg').userid,
-            username: wx.getStorageSync('userMsg').name,
             type: 0,
             "where": {
                 isleave: "1"

+ 4 - 2
salesPanel/dataOverview/Project/ProjectQuotationQuantity.js

@@ -16,12 +16,14 @@ Component({
     lifetimes: {
         attached: function () {
             getApp().globalData.Language.getLanguagePackage(this)
+            this.setData({
+                "content.dataid": wx.getStorageSync('userMsg').userid,
+                "content.username": wx.getStorageSync('userMsg').name,
+            })
         }
     },
     data: {
         "content": {
-            dataid: wx.getStorageSync('userMsg').userid,
-            username: wx.getStorageSync('userMsg').name,
             enddate: new Date().toISOString().split('T')[0],
             where: {}
         },

+ 4 - 2
salesPanel/dataOverview/Project/ReportAnalysis.js

@@ -7,13 +7,15 @@ Component({
     lifetimes: {
         attached: function () {
             getApp().globalData.Language.getLanguagePackage(this)
+            this.setData({
+                "content.dataid": wx.getStorageSync('userMsg').userid,
+                "content.username": wx.getStorageSync('userMsg').name,
+            })
         }
     },
     data: {
         year: new Date().getFullYear().toString(),
         "content": {
-            dataid: wx.getStorageSync('userMsg').userid,
-            username: wx.getStorageSync('userMsg').name,
             enddate: new Date().toISOString().split('T')[0],
             where: {}
         }

+ 3 - 3
salesPanel/dataOverview/Project/dataOverview.js

@@ -16,15 +16,15 @@ Component({
                     v.name = getApp().globalData.Language.getMapText(v.value);
                     v.color = v.value == this.data.content.dateType ? "#3874F6" : "";
                     return v
-                })
+                }),
+                "content.dataid": wx.getStorageSync('userMsg').userid,
+                "content.username": wx.getStorageSync('userMsg').name,
             })
         }
     },
     data: {
         "content": {
             dateType: "本年",
-            dataid: wx.getStorageSync('userMsg').userid,
-            username: wx.getStorageSync('userMsg').name,
             type: 0,
             "where": {
                 isleave: "1"

+ 4 - 2
salesPanel/dataOverview/Project/situationAnalysis.js

@@ -13,6 +13,10 @@ Component({
     lifetimes: {
         attached: function () {
             getApp().globalData.Language.getLanguagePackage(this)
+            this.setData({
+                "content.dataid": wx.getStorageSync('userMsg').userid,
+                "content.username": wx.getStorageSync('userMsg').name,
+            })
         }
     },
     data: {
@@ -20,8 +24,6 @@ Component({
         "content": {
             pageNumber: 1,
             pageTotal: 1,
-            dataid: wx.getStorageSync('userMsg').userid,
-            username: wx.getStorageSync('userMsg').name,
             dateType: "本年",
             type: 0,
             where: {

+ 3 - 4
salesPanel/dataOverview/index.js

@@ -5,9 +5,6 @@ Page({
         ops: [],
         unfolds: [],
         showFiltrate: false,
-
-        dataid: wx.getStorageSync('userMsg').userid,
-        username: wx.getStorageSync('userMsg').name,
         type: 0,
         isleave: 1,
     },
@@ -27,7 +24,9 @@ Page({
         const ops = wx.getStorageSync('auth').wdataoverview.options.filter(v => ["Clue", "Client", "Project", "Cost"].includes(v))
         this.setData({
             active: ops[0],
-            unfolds: [ops[0]]
+            unfolds: [ops[0]],
+            dataid: wx.getStorageSync('userMsg').userid,
+            username: wx.getStorageSync('userMsg').name,
         })
         this.setData({
             ops: ops.map(v => {

+ 1 - 1
salesPanel/salesHourglass/index.js

@@ -44,7 +44,6 @@ Page({
             "enddate": "",
             "departmentid": ""
         },
-        username: wx.getStorageSync('userMsg').name,
         dateTypes: ["全部", "近一年", "近九个月", "近六个月", "近三个月"],
         content: {
             nocache: true,
@@ -137,6 +136,7 @@ Page({
         this.setData({
             isHY: ['HY', "YOSTEST1"].includes(wx.getStorageSync('userMsg').siteid),
             "content.dataid": wx.getStorageSync('userMsg').userid,
+            username: wx.getStorageSync('userMsg').name,
         })
         this.setComingYear()
 

+ 3 - 3
salesPanel/shipmentAnalysis/index.js

@@ -19,7 +19,9 @@ Component({
         attached: function () {
             getApp().globalData.Language.getLanguagePackage(this)
             this.setData({
-                siteid: wx.getStorageSync('userMsg').siteid
+                siteid: wx.getStorageSync('userMsg').siteid,
+                "content.dataid": wx.getStorageSync('userMsg').userid,
+                "content.username": wx.getStorageSync('userMsg').name,
             })
         }
     },
@@ -27,8 +29,6 @@ Component({
         "content": {
             pageNumber: 1,
             pageTotal: 1,
-            dataid: wx.getStorageSync('userMsg').userid,
-            username: wx.getStorageSync('userMsg').name,
             enddate: new Date().toISOString().split('T')[0],
             where: {}
         },

+ 4 - 2
salesPanel/top10/index.js

@@ -13,6 +13,10 @@ Component({
     lifetimes: {
         attached: function () {
             getApp().globalData.Language.getLanguagePackage(this)
+            this.setData({
+                "content.dataid": wx.getStorageSync('userMsg').userid,
+                "content.username": wx.getStorageSync('userMsg').name,
+            })
         }
     },
     data: {
@@ -24,8 +28,6 @@ Component({
             pageNumber: 1,
             pageTotal: 1,
             dateType: "本年",
-            dataid: wx.getStorageSync('userMsg').userid,
-            username: wx.getStorageSync('userMsg').name,
             sequence: "订单",
             type: 0,
             where: {

+ 4 - 2
salesPanel/trendAnalysis/index.js

@@ -18,13 +18,15 @@ Component({
     lifetimes: {
         attached: function () {
             getApp().globalData.Language.getLanguagePackage(this)
+            this.setData({
+                "content.dataid": wx.getStorageSync('userMsg').userid,
+                "content.username": wx.getStorageSync('userMsg').name,
+            })
         }
     },
     data: {
         year: new Date().getFullYear().toString(),
         "content": {
-            dataid: wx.getStorageSync('userMsg').userid,
-            username: wx.getStorageSync('userMsg').name,
             year: new Date().getFullYear().toString(),
             where: {}
         },