xiaohaizhao 11 месяцев назад
Родитель
Сommit
12fd2ca7c2
2 измененных файлов с 55 добавлено и 2 удалено
  1. 1 0
      packageA/setclient/detail.js
  2. 54 2
      salesPanel/dataOverview/Client/situationAnalysis.js

+ 1 - 0
packageA/setclient/detail.js

@@ -716,6 +716,7 @@ Page({
         this.partialRenewal();
     },
     onUnload() {
+        _Http.updateList && _Http.updateList()
         const page = getCurrentPages().find(v => v.__route__ == 'packageA/setclient/index');
         if (!page) return;
         let content = JSON.parse(JSON.stringify(page.data.content));

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

@@ -28,6 +28,7 @@ Component({
                 begdate: "",
                 enddate: "",
                 isleave: "1",
+                customerstype: ""
             }
         },
     },
@@ -49,6 +50,7 @@ Component({
             if (init) {
                 content.pageNumber = 1;
                 content.pageTotal = 1;
+                content.where.customerstype = "";
             }
             if (content.pageNumber > content.pageTotal) return;
             _Http.basic({
@@ -68,7 +70,7 @@ Component({
                 })
                 this.selectComponent("#TimeRange").onCancel()
 
-                _Http.basic({
+                if (init) _Http.basic({
                     id: this.data.idname,
                     content
                 }).then(res1 => {
@@ -79,9 +81,32 @@ Component({
         },
         initChart(data, total) {
             const getMapText = getApp().globalData.Language.getMapText;
+            let countDown = null,
+                that = this;
+
+            function changeUnwriteoffamounttype(index) {
+                if (countDown) return;
+                countDown = setTimeout(() => {
+                    clearTimeout(countDown)
+                    countDown = null;
+                    if (data[index].key != that.data.content.where.customerstype) that.setData({
+                        "content.where.customerstype": data[index].key || "",
+                        "content.pageNumber": 1,
+                    });
+                    that.getList()
+
+                }, 200)
+            };
+
+
             let option = {
                 tooltip: {
-                    trigger: 'item'
+                    trigger: 'item',
+                    confine: true, // Ensure tooltip stays within chart boundaries
+                    formatter: function (params) {
+                        changeUnwriteoffamounttype(params.dataIndex)
+                        return `${getMapText(params.name)}: ${params.value} (${params.percent}%)`;
+                    },
                 },
                 legend: {
                     type: 'scroll', // Enable scrollable legend
@@ -164,8 +189,35 @@ Component({
                 return chart;
             });
         },
+        upDateList() {
+            _Http.updateList = () => {
+                let content = JSON.parse(JSON.stringify(this.data.content));
+                console.log("content", content)
+                try {
+                    content.pageSize = (content.pageNumber - 1) * content.pageSize;
+                    content.pageNumber = 1;
+                } catch (error) {
+                    console.log("error", error)
+                }
+                _Http.basic({
+                    id: '20231018164504',
+                    content
+                }).then(res => {
+                    console.log("更新列表", res);
+                    if (res.code == '1') {
+                        this.setData({
+                            list: res.data
+                        })
+                    }
+                })
+            }
+        },
         toDetail(e) {
             console.log(e)
+            wx.navigateTo({
+                url: '/packageA/setclient/detail?id=' + e.currentTarget.dataset.item.sa_customersid,
+            })
+            this.upDateList();
         },
         changeDate({
             detail